Similar to "DirectSecp256k1HdWallet", but uses PKP to sign

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.

    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;
    }

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

    • 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 Promise<SigningStargateClient>

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

  • Runs the specified Lit action with the given parameters.

    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>

    • A Promise that resolves with the signature returned by the Lit action.
    • 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.
  • Sign the provided data with the PKP private key.

    Parameters

    • toSign: Uint8Array

      The data to be signed.

    Returns Promise<SigResponse>

    • A Promise that resolves with the signature of the provided data.
    • 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.
  • *** 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).

    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

    • OptionalexplicitSignerData: 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[];
    }>

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

  • Signs the provided transaction using the LIT node client and returns 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>

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