ChainSig.js Documentation - v1.1.6
    Preparing search index...

    Class ChainAdapter<TransactionRequest, UnsignedTransaction>Abstract

    Type Parameters

    • TransactionRequest
    • UnsignedTransaction

    Hierarchy (View Summary)

    Index

    Constructors

    Methods

    • Gets the native token balance and decimals for a given address

      Parameters

      • address: string

        The address to check

      Returns Promise<{ balance: bigint; decimals: number }>

      Promise resolving to an object containing: - balance: The balance as a bigint, in the chain's base units - decimals: The number of decimals used to format the balance

    • Uses Sig Network Key Derivation Function to derive the address and public key. from a signer ID and string path.

      Parameters

      • predecessor: string

        The id/address of the account requesting signature

      • path: string

        The string path used to derive the key

      Returns Promise<{ address: string; publicKey: string }>

      Promise resolving to the derived address and public key

    • Deserializes a transaction string back into an unsigned transaction object. This reverses the serialization done by serializeTransaction().

      Parameters

      • serialized: string

        The serialized transaction string

      Returns UnsignedTransaction

      The deserialized unsigned transaction

    • Prepares a transaction for Sig Network MPC signing by creating the necessary payloads. This method handles chain-specific transaction preparation including:

      • Fee calculation
      • Nonce/sequence management
      • UTXO selection (for UTXO-based chains)
      • Transaction encoding

      Parameters

      • transactionRequest: TransactionRequest

        The transaction request containing parameters like recipient, amount, etc.

      Returns Promise<
          {
              transaction: UnsignedTransaction;
              hashesToSign: contracts.HashToSign[];
          },
      >

      Promise resolving to an object containing: - transaction: The unsigned transaction - hashesToSign: Array of payloads to be signed by MPC. The order of these payloads must match the order of signatures provided to finalizeTransactionSigning()

    • Adds Sig Network MPC-generated signatures to an unsigned transaction.

      Parameters

      • params: {
            transaction: UnsignedTransaction | Transaction;
            rsvSignatures: RSVSignature[] | Signature;
        }

        Parameters for adding signatures

        • transaction: UnsignedTransaction | Transaction

          The unsigned transaction to add signatures to

        • rsvSignatures: RSVSignature[] | Signature

          Array of RSV signatures generated through MPC. Must be in the same order as the payloads returned by prepareTransactionForSigning()

      Returns string

      The serialized signed transaction ready for broadcast

    • Broadcasts a signed transaction to the network.

      Parameters

      • txSerialized: string

        The serialized signed transaction

      Returns Promise<{ hash: string }>

      Promise resolving to an object containing the transaction hash/ID