Appearance
Key Management Service (KMS)
The Key Management Service (KMS) facilitates the management of cryptographic keys and signing operations. It supports interactions with key management systems either through a local Vault using the SkcVault class or via a CMS using the SkcCmsVault class.
SkcVault
The SkcVault
class provides key management and signing functionalities using a local Vault. It implements the ethers.Signer
interface for interacting with the Ethereum blockchain.
Creating Instances
new SkcVault( options: VaultClientOptions
, offset?: string, evmProvider?: Provider
)
Creates an instance of SkcVault
that allows for interaction with a Vault.
Properties
kmsOptions:
VaultClientOptions
Configuration options required for Vault integrationoffset?: string
An optional offset for signing through single key.evmProvider?:
Provider
Ethereum provider for blockchain interaction.
Instance Methods
vault.storeMnemonic ( mnemonic: string
) ⇒ Promise<any>
Stores a mnemonic securely in the local vault.
vault.connect ( provider: Provider
) ⇒ this
Connects the local vault to an Ethereum provider and returns a Signer
instance for on-chain interactions.
vault.getAddress () ⇒ Promise<string
>
Returns the Ethereum address associated with the local vault key.
vault.getNonce ( blockTag?: BlockTag
) ⇒ Promise<number
>
Returns the current transaction nonce for the vault address.
vault.populateCall ( tx: TransactionRequest
) ⇒ Promise<TransactionLike
<string>>
Prepares the transaction call data.
vault.populateTransaction ( tx: TransactionRequest
) ⇒ Promise<TransactionLike
<string>>
Populates a transaction request with necessary details before sending.
vault.estimateGas ( tx: TransactionRequest
) ⇒ Promise<bigint
>
Estimates the gas required for the transaction.
vault.call ( tx: TransactionRequest
) ⇒ Promise<string
>
Calls a method on a contract or performs an off-chain read operation.
vault.resolveName ( name: string
) ⇒ Promise<null | string>
Resolves a human-readable name to an Ethereum address.
vault.sendTransaction ( tx: TransactionRequest
) ⇒ Promise<TransactionResponse
>
Sends a signed transaction to the Ethereum network.
vault.signTransaction ( tx: TransactionRequest
) ⇒ Promise<string
>
Signs a transaction using the local vault.
vault.signMessage ( message: string
| Uint8Array
) ⇒ Promise<string
>
Signs an ECDSA message using the private key stored in the vault.
vault.signTypedData ( domain: TypedDataDomain
,
types: Record< string, Array<TypedDataField
>>,
value: Record< string, any> ) ⇒ Promise<string
>
Signs EIP-712 typed data using the local vault.
For more details, visit Method Implementation Reference
SkcCmsVault
The SkcCmsVault
class provides key management and signing functionalities using a CMS. It implements the ethers.Signer
interface for interacting with the Ethereum blockchain.
Creating Instances
new SkcCmsVault( skcCms: SkcCms
, offset?: string, evmProvider?: Provider
)
Creates an instance of SkcCmsVault
that allows for interaction with a CMS.
Properties
skcCms:
SkcCms
CMS client used for interacting with the CMS.offset?: string
An optional offset for signing through single key.provider?:
Provider
Ethereum provider for blockchain interaction.
Instance Methods
vault.connect ( provider: Provider
) ⇒ this
Connects the CMS vault to an Ethereum provider and returns a Signer
instance for on-chain interactions.
vault.getAddress () ⇒ Promise<string
>
Returns the Ethereum address associated with the CMS vault key.
vault.getNonce ( blockTag?: BlockTag
) ⇒ Promise<number
>
Returns the current transaction nonce for the CMS vault address.
vault.populateCall ( tx: TransactionRequest
) ⇒ Promise<TransactionLike
<string>>
Prepares the transaction call data.
vault.populateTransaction ( tx: TransactionRequest
) ⇒ Promise<TransactionLike
<string>>
Populates a transaction request with necessary details before sending.
vault.estimateGas ( tx: TransactionRequest
) ⇒ Promise<bigint
>
Estimates the gas required for the transaction.
vault.call ( tx: TransactionRequest
) ⇒ Promise<string
>
Calls a method on a contract or performs an off-chain read operation.
vault.resolveName ( name: string
) ⇒ Promise<null | string>
Resolves a human-readable name to an Ethereum address.
vault.sendTransaction ( tx: TransactionRequest
) ⇒ Promise<TransactionResponse
>
Sends a signed transaction to the Ethereum network.
vault.signTransaction ( txData: TransactionRequest
) ⇒ Promise<string
>
Signs a transaction using the CMS vault.
vault.signMessage ( message: string
| Uint8Array
) ⇒ Promise<string
>
Signs an ECDSA message using the private key stored in the CMS vault.
vault.signTypedData ( domain: TypedDataDomain
, types: Record< string, Array<TypedDataField
>>, value: Record< string, any> ) ⇒ Promise<string
>
Signs EIP-712 typed data using the CMS vault.
For more details, visit Method Implementation Reference