Skip to main content

Address

@coinbase/waas-sdk-webAPI


Interface: Address<P>

The object representing an on-chain Address.

Type parameters

P extends IProtocolFamily

Properties

address

address: 0x${string}

The hex, 0x-prefixed onchain address.

Example

"0xabcdabcdbac..."

protocolFamily

protocolFamily: P

The protocolFamily that this address can transact with.

See

ProtocolFamily

Example

"protocolFamilies/evm"

Methods

exportKey()

exportKey(backup, passcode?, format?): Promise<ExtendedPrivateKey | RawPrivateKey>

Exports the BIP32 extended private keys associated with this address.

Parameters

backup: string

The backup associated with the wallet that this address belongs to.

passcode?: string

The optional passcode associated with the wallet that this address belongs to.

format?: PrivateKeyFormat

The optional type of private key to export, defaults to RAW.

Returns

Promise<ExtendedPrivateKey | RawPrivateKey>

A promise of the exported private key for this address.

Throws

An error if the passcode is invalid.


exportKeyFromHostedBackup()

exportKeyFromHostedBackup(passcode?, format?): Promise<ExtendedPrivateKey | RawPrivateKey>

Exports the BIP32 extended private keys associated with this address using CB hosted backups.

Parameters

passcode?: string

The optional passcode associated with the wallet that this address belongs to.

format?: PrivateKeyFormat

The optional type of private key to export, defaults to RAW.

Returns

Promise<ExtendedPrivateKey | RawPrivateKey>

A promise of the exported private key for this address.

Throws

An error if the passcode is invalid.


sign()

sign(message): Promise<Signature>

Sign a hex-encoded message using this address.

Parameters

message: string

The hex-encoded message to sign.

Returns

Promise<Signature>

A promise of the Signature.

Example

wallet.addresses.for(ProtocolFamily.EVM).sign("message_to_sign")
* ```

Was this helpful?