DirectSecp256k1HdWallet
HD wallet using BIP-39 mnemonic with Protobuf Direct signing. ImplementsOfflineDirectSigner.
Static Methods
| Method | Parameters | Returns |
|---|---|---|
generate | length?: 12 | 15 | 18 | 21 | 24, options?: Partial<DirectSecp256k1HdWalletOptions> | Promise<DirectSecp256k1HdWallet> |
fromMnemonic | mnemonic: string, options?: Partial<DirectSecp256k1HdWalletOptions> | Promise<DirectSecp256k1HdWallet> |
deserialize | serialization: string, password: string | Promise<DirectSecp256k1HdWallet> |
deserializeWithEncryptionKey | serialization: string, encryptionKey: Uint8Array | Promise<DirectSecp256k1HdWallet> |
Instance Methods
| Method | Parameters | Returns |
|---|---|---|
getAccounts | — | Promise<readonly AccountData[]> |
signDirect | signerAddress: string, signDoc: SignDoc | Promise<DirectSignResponse> |
serialize | password: string | Promise<string> |
serializeWithEncryptionKey | encryptionKey: Uint8Array, kdfConfiguration: KdfConfiguration | Promise<string> |
Instance Properties
| Property | Type |
|---|---|
mnemonic | string |
Options
Usage
DirectSecp256k1Wallet
Single-key wallet for Protobuf Direct signing. ImplementsOfflineDirectSigner.
| Method | Parameters | Returns |
|---|---|---|
fromKey (static) | privkey: Uint8Array, prefix?: string | Promise<DirectSecp256k1Wallet> |
getAccounts | — | Promise<readonly AccountData[]> |
signDirect | address: string, signDoc: SignDoc | Promise<DirectSignResponse> |
DirectEthSecp256k1HdWallet
HD wallet using Ethereum’s secp256k1 curve for chains with EVM compatibility. Supportsgenerate, fromMnemonic, getAccounts, and signDirect like DirectSecp256k1HdWallet, but uses the Ethereum HD path m/44'/60'/0'/0/0 by default and Keccak-256 for address derivation. Does not support wallet serialization (serialize/deserialize).
DirectEthSecp256k1Wallet
Single-key wallet using Ethereum’s secp256k1 curve. SupportsfromKey, getAccounts, and signDirect like DirectSecp256k1Wallet, but reports algo: "eth_secp256k1" and uses Keccak-256 for signing.
Registry
Maps type URLs to protobuf codec implementations for encoding and decoding messages.| Method | Parameters | Returns |
|---|---|---|
constructor | customTypes?: Iterable<[string, GeneratedType]> | Registry |
register | typeUrl: string, type: GeneratedType | void |
lookupType | typeUrl: string | GeneratedType | undefined |
encode | encodeObject: EncodeObject | Uint8Array |
encodeAsAny | encodeObject: EncodeObject | Any |
encodeTxBody | txBodyFields: TxBodyValue | Uint8Array |
decode | decodeObject: DecodeObject | any |
decodeTxBody | txBody: Uint8Array | TxBody |
Usage
Key Types
EncodeObject
DecodeObject
TxBodyEncodeObject
AccountData
OfflineDirectSigner
OfflineSigner
DecodedTxRaw
Helper Functions
| Function | Parameters | Returns |
|---|---|---|
makeAuthInfoBytes | signers: ReadonlyArray<{ pubkey: Any; sequence: bigint | number }>, feeAmount: readonly Coin[], gasLimit: number, feeGranter: string | undefined, feePayer: string | undefined, signMode?: SignMode | Uint8Array |
makeSignDoc | bodyBytes: Uint8Array, authInfoBytes: Uint8Array, chainId: string, accountNumber: number | SignDoc |
makeSignBytes | signDoc: SignDoc | Uint8Array |
decodeTxRaw | tx: Uint8Array | DecodedTxRaw |
encodePubkey | pubkey: Pubkey | Any |
decodePubkey | pubkey: Any | Pubkey |
decodeOptionalPubkey | pubkey: Any | null | undefined | Pubkey | null |
makeCosmoshubPath | account: number | HdPath |
coin | amount: number | string, denom: string | Coin |
coins | amount: number | string, denom: string | Coin[] |
parseCoins | input: string | Coin[] |
extractKdfConfiguration | serialization: string | KdfConfiguration |
executeKdf | password: string, configuration: KdfConfiguration | Promise<Uint8Array> |