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

    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

    • Serializes an unsigned transaction to a string format. This is useful for storing or transmitting the transaction.

      Parameters

      • transaction: AnyRawTransaction

        The unsigned transaction to serialize

      Returns string

      The serialized transaction string

    • 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 SimpleTransaction | MultiAgentTransaction

      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: AnyRawTransaction

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

      Returns Promise<
          { transaction: AnyRawTransaction; 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()

    • Parameters

      • params: { rsvSignatures: Signature; publicKey: string }

      Returns AccountAuthenticatorEd25519

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

      Parameters

      • params: {
            transaction: AnyRawTransaction;
            rsvSignatures: Signature;
            publicKey: string;
            additionalSignersAuthenticators?: AccountAuthenticator[];
            feePayerAuthenticator?: AccountAuthenticator;
        }

        Parameters for adding signatures

        • transaction: AnyRawTransaction

          The unsigned transaction to add signatures to

        • rsvSignatures: Signature

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

        • publicKey: string
        • OptionaladditionalSignersAuthenticators?: AccountAuthenticator[]
        • OptionalfeePayerAuthenticator?: AccountAuthenticator

      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