Private
Readonly
addressPrivate
addressesPrivate
Optional
masterPrivate
modelPrivate
Optional
seedStatic
MAX_Private
buildReturns a WalletAddress object for the given AddressModel.
The AddressModel to build the WalletAddress from.
The index of the AddressModel.
The WalletAddress object.
Get the claimable balance for the supplied asset.
The asset to check claimable balance for.
The staking mode. Defaults to DEFAULT.
Additional options for getting the claimable balance.
The claimable balance.
if the default address is not found.
Private
createCreates a staking operation to claim stake, signs it, and broadcasts it on the blockchain.
The amount for the staking operation.
The asset for the staking operation.
The staking mode. Defaults to DEFAULT.
Additional options such as setting the mode for the staking action.
The amount to wait for the transaction to complete when broadcasted.
The amount to check each time for a successful broadcast.
The staking operation after it's completed fully.
if the default address is not found.
Creates a Payload Signature.
The Unsigned Payload to sign.
A promise that resolves to the Payload Signature object.
if the API request to create a Payload Signature fails.
if the default address is not found.
Creates a staking operation to stake, signs it, and broadcasts it on the blockchain.
The amount for the staking operation.
The asset for the staking operation.
The staking mode. Defaults to DEFAULT.
Additional options such as setting the mode for the staking action.
The amount to wait for the transaction to complete when broadcasted.
The amount to check each time for a successful broadcast.
The staking operation after it's completed fully.
if the default address is not found.
Trades the given amount of the given Asset for another Asset. Currently only the default address is used to source the Trade.
The options to create the Trade.
The created Trade object.
If the default address is not found.
If the private key is not loaded, or if the asset IDs are unsupported, or if there are insufficient funds.
Transfers the given amount of the given Asset to the given address. Only same-Network Transfers are supported. Currently only the default_address is used to source the Transfer.
The options to create the Transfer.
The created Transfer object.
if the API request to create a Transfer fails.
if the API request to broadcast a Transfer fails.
Creates a staking operation to unstake, signs it, and broadcasts it on the blockchain.
The amount for the staking operation.
The asset for the staking operation.
The staking mode. Defaults to DEFAULT.
Additional options such as setting the mode for the staking action.
The amount to wait for the transaction to complete when broadcasted.
The amount to check each time for a successful broadcast.
The staking operation after it's completed successfully.
if the default address is not found.
Deploys a custom contract.
The options for creating the custom contract.
A Promise that resolves to the deployed SmartContract object.
If the private key is not loaded when not using server signer.
Deploys an ERC1155 token contract.
The options for creating the ERC1155 token.
A Promise that resolves to the deployed SmartContract object.
If the private key is not loaded when not using server signer.
Deploys an ERC721 token contract.
The options for creating the ERC721 token.
A Promise that resolves to the deployed SmartContract object.
If the private key is not loaded when not using server signer.
Deploys an ERC20 token contract.
The options for creating the ERC20 token.
A Promise that resolves to the deployed SmartContract object.
If the private key is not loaded when not using server signer.
Private
deriveExports the Wallet's data to a WalletData object.
The Wallet's data.
Requests funds from the faucet for the Wallet's default address and returns the faucet transaction. This is only supported on testnet networks.
Optional
assetId: stringThe ID of the Asset to request from the faucet.
The successful faucet transaction
If the default address is not found.
If the request fails.
Fund the wallet from your account on the Coinbase Platform.
The options to create the fund operation
The created fund operation object
If the default address does not exist
Returns the WalletAddress with the given ID.
The ID of the WalletAddress to retrieve.
The WalletAddress.
Returns the default address of the Wallet.
The default address
Private
getPrivate
getReturns the ServerSigner Status of the Wallet.
the ServerSigner Status.
Lists the historical staking balances for the address.
The asset ID.
The start time.
The end time.
The staking balances.
if the default address is not found.
Invokes a contract with the given data.
The options to invoke the contract
The ContractInvocation object.
if the API request to create a contract invocation fails.
Returns the list of Addresses in the Wallet.
The list of Addresses.
Returns the list of balances of this Wallet. Balances are aggregated across all Addresses in the Wallet.
The list of balances. The key is the Asset ID, and the value is the balance.
Returns all the fund operations associated with the wallet's default address.
The pagination options.
The paginated list response of fund operations.
If the default address does not exist
Lists the historical balances for a given asset belonging to the default address of the wallet.
The asset ID.
The pagination options.
The paginated list response of Historical Balances for the given Asset ID.
Get the pending claimable balance for the supplied asset.
The asset to check pending claimable balance for.
The staking mode. Defaults to DEFAULT.
Additional options for getting the pending claimable balance.
The pending claimable balance.
if the default address is not found.
Get a quote for funding the wallet from your Coinbase platform account.
The options to create the fund quote
The fund quote object
If the default address does not exist
Private
reloadSaves the seed of the Wallet to the given file.
The path of the file to save the seed to
Whether the seed information persisted to the local file system should be encrypted or not. Data is unencrypted by default.
A string indicating the success of the operation
Use saveSeedToFile() instead
If the Wallet does not have a seed
Saves the seed of the Wallet to the given file. Wallets whose seeds are saved this way can be rehydrated using load_seed. A single file can be used for multiple Wallet seeds. This is an insecure method of storing Wallet seeds and should only be used for development purposes.
The path of the file to save the seed to
Whether the seed information persisted to the local file system should be encrypted or not. Data is unencrypted by default.
A string indicating the success of the operation
If the Wallet does not have a seed
Private
setGet the stakeable balance for the supplied asset.
The asset to check the stakeable balance for.
The staking mode. Defaults to DEFAULT.
Additional options for getting the stakeable balance.
The stakeable balance.
if the default address is not found.
Lists the staking rewards for the address.
The asset ID.
The start time.
The end time.
The format to return the rewards in. (usd, native). Defaults to usd.
The staking rewards.
if the default address is not found.
Get the unstakeable balance for the supplied asset.
The asset to check the unstakeable balance for.
The staking mode. Defaults to DEFAULT.
Additional options for getting the unstakeable balance.
The unstakeable balance.
if the default address is not found.
Private
validatePrivate
waitWaits until the ServerSigner has created a seed for the Wallet.
The ID of the Wallet that is awaiting seed creation.
The interval at which to poll the CDPService, in seconds.
The maximum amount of time to wait for the ServerSigner to create a seed, in seconds.
if the API request to get a Wallet fails.
if the ServerSigner times out.
Static
createCreates a new Wallet with a random seed.
The options to create the Wallet.
A promise that resolves with the new Wallet object.
Wallet
If the model or client is not provided.
Static
createCreates a new Wallet with the given seed.
The options to create the Wallet.
A promise that resolves with the new Wallet object.
If the model or client is not provided.
Static
fetchFetches a Wallet by its ID. The returned wallet can be immediately used for signing operations if backed by a server signer. If the wallet is not backed by a server signer, the wallet's seed will need to be set before it can be used for signing operations.
The ID of the Wallet to fetch
The fetched Wallet
Static
importLoads an existing CDP Wallet using a wallet data object or mnemonic seed phrase.
The data used to import the wallet:
the ID of the blockchain network. Defaults to 'base-sepolia'.
A Promise that resolves to the loaded Wallet instance
If the data format is invalid.
If the seed is not provided.
If the mnemonic seed phrase is invalid.
Static
initReturns a new Wallet object. Do not use this method directly. Instead, use one of:
The underlying Wallet model object
Optional
seed: stringThe seed to use for the Wallet. Expects a 32-byte hexadecimal with no 0x prefix. If null or undefined, a new seed will be generated. If the empty string, no seed is generated, and the Wallet will be instantiated without a seed and its corresponding private keys.
A promise that resolves with the new Wallet object.
Wallet
If the model or client is not provided.
Static
listLists the Wallets belonging to the CDP Project.
The pagination options.
The paginated list response of Wallets.
A representation of a Wallet. Wallets come with a single default Address, but can expand to have a set of Addresses, each of which can hold a balance of one or more Assets. Wallets can create new Addresses, list their addresses, list their balances, and transfer Assets to other Addresses. Wallets should be created through User.createWallet or User.importWallet. Wallets should be created using
Wallet.create
, imported usingWallet.import
, or fetched usingWallet.fetch
. Existing wallets can be imported with a seed usingWallet.import
. Wallets backed by a Server Signer can be fetched withWallet.fetch
and used for signing operations immediately.