Similar to "DirectSecp256k1HdWallet", but uses PKP to sign

Hierarchy

  • PKPCosmosWallet

Implements

Constructors

Properties

addressPrefix: string
defaultSigName: string = 'pkp-cosmos-sign-tx'
rpc: string

Accessors

Methods

  • Prepares transaction data by calculating the amount and fee. Returns the amount and fee in the format required by the SigningStargateClient.sign method.

    Property

    The amount of tokens to send.

    Property

    The denomination of the tokens to send.

    Property

    The gas price to use for the transaction.

    Property

    The fee to use for the transaction.

    Returns

    An object containing the amount and fee in the format required by the SigningStargateClient.sign method.

    Parameters

    • options: {
          amount: number;
          denom: string;
          fee: number;
          gasPrice: number;
      }

      Transaction configuration.

      • amount: number
      • denom: string
      • fee: number
      • gasPrice: number

    Returns {
        amount: Coin[];
        fee: StdFee;
    }

    • amount: Coin[]
    • fee: StdFee
  • Returns account data, including the algorithm used, the address, and the compressed public key

    Returns Promise<readonly AccountData[]>

  • getClient is an asynchronous function that creates and returns a SigningStargateClient instance. The SigningStargateClient is connected to the provided rpcEndpoint, and the wallet instance itself acts as the signer.

    Returns

    A promise that resolves to a SigningStargateClient instance connected to the rpcEndpoint with the wallet as the signer.

    Returns Promise<SigningStargateClient>

  • Runs the specified Lit action with the given parameters.

    Returns

    • A Promise that resolves with the signature returned by the Lit action.

    Throws

    • Throws an error if pkpPubKey is not provided, if controllerAuthSig or controllerSessionSigs is not provided, if controllerSessionSigs is not an object, if executeJsArgs does not have either code or ipfsId, or if an error occurs during the execution of the Lit action.

    Parameters

    • toSign: Uint8Array

      The data to be signed by the Lit action.

    • sigName: string

      The name of the signature to be returned by the Lit action.

    Returns Promise<any>

  • Sign the provided data with the PKP private key.

    Returns

    • A Promise that resolves with the signature of the provided data.

    Throws

    • Throws an error if pkpPubKey is not provided, if controllerAuthSig or controllerSessionSigs is not provided, if controllerSessionSigs is not an object, or if an error occurs during the signing process.

    Parameters

    • toSign: Uint8Array

      The data to be signed.

    Returns Promise<SigResponse>

  • *** NOTE: This is a copy of the SigningStargateClient.sign method ***

    Gets account number and sequence from the API, creates a sign doc, creates a single signature and assembles the signed transaction.

    The sign mode (SIGN_MODE_DIRECT or SIGN_MODE_LEGACY_AMINO_JSON) is determined by this client's signer.

    You can pass signer data (account number, sequence and chain ID) explicitly instead of querying them from the chain. This is needed when signing for a multisig account, but it also allows for offline signing (See the SigningStargateClient.offline constructor).

    Returns

    A promise that resolves to an object containing the signed transaction bytes and signature array

    Parameters

    • messages: readonly EncodeObject[]

      An array of messages to be signed, following the EncodeObject format

    • fee: StdFee

      The transaction fee object, containing the gas limit and amount

    • memo: string

      An optional memo string to be included in the transaction

    • Optional explicitSignerData: SignerData

      Optional SignerData to be used during signing (e.g., account number, sequence, and chain ID)

    Returns Promise<{
        authInfoBytes: Uint8Array;
        bodyBytes: Uint8Array;
        signatures: readonly Uint8Array[];
    }>

  • Signs the provided transaction using the LIT node client and returns the signed transaction and the encoded signature.

    Returns

    A promise that resolves to a DirectSignResponse containing the signed transaction and the encoded signature.

    Parameters

    • address: string

      The address of the signer.

    • signDoc: SignDoc

      The transaction data to be signed.

    Returns Promise<DirectSignResponse>

Generated using TypeDoc