Class Kmd

Abstract service client to encapsulate shared AlgodClient and IndexerClient logic

Hierarchy

Constructors

Methods

  • createWallet creates a wallet with the specified name, password, driver, and master derivation key. If the master derivation key is blank, one is generated internally to kmd. CreateWallet returns a CreateWalletResponse containing information about the new wallet.

    Parameters

    • walletName: string
    • walletPassword: string
    • walletMDK: Uint8Array = ...
    • walletDriverName: string = 'sqlite'

    Returns Promise<any>

  • deleteKey accepts a wallet handle, wallet password, and address, and deletes the information about this address from the wallet (including address and secret key). If DeleteKey is called on a key generated using GenerateKey, the same key will not be generated again. However, if a wallet is recovered using the master derivation key, a key generated in this way can be recovered.

    Parameters

    • walletHandle: string
    • walletPassword: string
    • addr: string

    Returns Promise<any>

  • deleteMultisig accepts a wallet handle, wallet password, and multisig address, and deletes the information about this multisig address from the wallet (including address and secret key).

    Parameters

    • walletHandle: string
    • walletPassword: string
    • addr: string

    Returns Promise<any>

  • exportKey accepts a wallet handle, wallet password, and address, and returns an ExportKeyResponse containing the ed25519 private key corresponding to the address stored in the wallet.

    Parameters

    • walletHandle: string
    • walletPassword: string
    • addr: string

    Returns Promise<{ private_key: Buffer }>

  • exportMasterDerivationKey accepts a wallet handle and a wallet password, and returns an ExportMasterDerivationKeyResponse containing the master derivation key. This key can be used as an argument to CreateWallet in order to recover the keys generated by this wallet. The master derivation key can be encoded as a sequence of words using the mnemonic library, and

    Parameters

    • walletHandle: string
    • walletPassword: string

    Returns Promise<{ master_derivation_key: Buffer }>

  • exportMultisig accepts a wallet handle, wallet password, and multisig address, and returns an ExportMultisigResponse containing the stored multisig preimage. The preimage contains all of the information necessary to derive the multisig address, including version, threshold, and a list of public keys.

    Parameters

    • walletHandle: string
    • addr: string

    Returns Promise<any>

  • generateKey accepts a wallet handle, and then generates the next key in the wallet using its internal master derivation key. Two wallets with the same master derivation key will generate the same sequence of keys.

    Parameters

    • walletHandle: string

    Returns Promise<any>

  • getWallet accepts a wallet handle and returns high level information about this wallet in a GetWalletResponse.

    Parameters

    • walletHandle: string

    Returns Promise<any>

  • importKey accepts a wallet handle and an ed25519 private key, and imports the key into the wallet. It returns an ImportKeyResponse containing the address corresponding to this private key.

    Parameters

    • walletHandle: string
    • secretKey: Uint8Array

    Returns Promise<any>

  • importMultisig accepts a wallet handle and the information required to generate a multisig address. It derives this address, and stores all of the information within the wallet. It returns a ImportMultisigResponse with the derived address.

    Parameters

    • walletHandle: string
    • version: number
    • threshold: number
    • pks: string[]

    Returns Promise<any>

  • initWalletHandle accepts a wallet ID and a wallet password, and returns an initWalletHandleResponse containing a wallet handle token. This wallet handle token can be used for subsequent operations on this wallet, like key generation, transaction signing, etc.. WalletHandleTokens expire after a configurable number of seconds, and must be renewed periodically with RenewWalletHandle. It is good practice to call ReleaseWalletHandle when you're done interacting with this wallet.

    Parameters

    • walletID: string
    • walletPassword: string

    Returns Promise<any>

  • ListKeys accepts a wallet handle and returns a ListKeysResponse containing all of the addresses for which this wallet contains secret keys.

    Parameters

    • walletHandle: string

    Returns Promise<any>

  • listMultisig accepts a wallet handle and returns a ListMultisigResponse containing the multisig addresses whose preimages are stored in this wallet. A preimage is the information needed to reconstruct this multisig address, including multisig version information, threshold information, and a list of public keys.

    Parameters

    • walletHandle: string

    Returns Promise<any>

  • listWallets returns a ListWalletsResponse containing the list of wallets known to kmd. Using a wallet ID returned from this endpoint, you can initialize a wallet handle with client.InitWalletHandle

    Returns Promise<any>

  • releaseWalletHandle invalidates the passed wallet handle token, making it unusuable for subsequent wallet operations.

    Parameters

    • walletHandle: string

    Returns Promise<any>

  • renameWallet accepts a wallet ID, wallet password, and a new wallet name, and renames the underlying wallet.

    Parameters

    • walletID: string
    • walletPassword: string
    • newWalletName: string

    Returns Promise<any>

  • renewWalletHandle accepts a wallet handle and attempts to renew it, moving the expiration time to some number of seconds in the future. It returns a RenewWalletHandleResponse containing the walletHandle and the number of seconds until expiration

    Parameters

    • walletHandle: string

    Returns Promise<any>

  • Set the default int decoding method for all JSON requests this client creates.

    Parameters

    • method: IntDecoding

      {"default" | "safe" | "mixed" | "bigint"} method The method to use when parsing the response for request. Must be one of "default", "safe", "mixed", or "bigint". See JSONRequest.setIntDecoding for more details about what each method does.

    Returns void

  • signMultisigTransaction accepts a wallet handle, wallet password, transaction, public key (not an address), and an optional partial MultisigSig. It looks up the secret key corresponding to the public key, and returns a SignMultisigTransactionResponse containing a MultisigSig with a signature by the secret key included.

    Parameters

    • walletHandle: string
    • pw: string
    • transaction: TransactionLike
    • pk: string | Uint8Array
    • partial: string

    Returns Promise<any>

  • signTransaction accepts a wallet handle, wallet password, and a transaction, and returns and SignTransactionResponse containing an encoded, signed transaction. The transaction is signed using the key corresponding to the Sender field.

    Parameters

    Returns Promise<any>

  • signTransactionWithSpecificPublicKey accepts a wallet handle, wallet password, a transaction, and a public key, and returns and SignTransactionResponse containing an encoded, signed transaction. The transaction is signed using the key corresponding to the publicKey arg.

    Parameters

    • walletHandle: string
    • walletPassword: string
    • transaction: TransactionLike
    • publicKey: string | Uint8Array

      sign the txn with the key corresponding to publicKey (used for working with a rekeyed addr)

    Returns Promise<any>

  • version returns a VersionResponse containing a list of kmd API versions supported by this running kmd instance.

    Returns Promise<any>

Generated using TypeDoc