Skip to content

@liquality.near.<internal>.WalletProvider

Krasimir Raykov edited this page Mar 30, 2022 · 2 revisions

Interface: WalletProvider

@liquality/near..WalletProvider

Implemented by

Table of contents

Properties

Methods

Properties

canUpdateFee

Optional canUpdateFee: boolean | () => boolean

Flag indicating if the wallet allows apps to update transaction fees

returns True if wallet accepts fee updating

Defined in

types/dist/lib/Wallet.d.ts:89

Methods

exportPrivateKey

Optional exportPrivateKey(): Promise<string>

Exports the private key for the account for BTC, https://en.bitcoin.it/wiki/Wallet_import_format for ETH, the privateKey for NEAR, the secretKey

Returns

Promise<string>

Resolves with the key as a string

Defined in

types/dist/lib/Wallet.d.ts:97


getAddresses

getAddresses(startingIndex?, numAddresses?, change?): Promise<Address[]>

Get addresses/accounts of the user.

Parameters

Name Type
startingIndex? number
numAddresses? number
change? boolean

Returns

Promise<Address[]>

Resolves with a list of addresses. Rejects with InvalidProviderResponseError if provider's response is invalid.

Defined in

types/dist/lib/Wallet.d.ts:21


getConnectedNetwork

getConnectedNetwork(): Promise<any>

Retrieve the network connected to by the wallet

Returns

Promise<any>

Resolves with the network object

Defined in

types/dist/lib/Wallet.d.ts:79


getUnusedAddress

getUnusedAddress(change?, numAddressPerCall?): Promise<Address>

Get unused address/account of the user.

Parameters

Name Type
change? boolean
numAddressPerCall? number

Returns

Promise<Address>

Resolves with a address object. Rejects with InvalidProviderResponseError if provider's response is invalid.

Defined in

types/dist/lib/Wallet.d.ts:67


getUsedAddresses

getUsedAddresses(numAddressPerCall?): Promise<Address[]>

Get used addresses/accounts of the user.

Parameters

Name Type
numAddressPerCall? number

Returns

Promise<Address[]>

Resolves with a list of addresses. Rejects with InvalidProviderResponseError if provider's response is invalid.

Defined in

types/dist/lib/Wallet.d.ts:29


isWalletAvailable

isWalletAvailable(): Promise<boolean>

Retrieve the availability status of the wallet

Returns

Promise<boolean>

True if the wallet is available to use

Defined in

types/dist/lib/Wallet.d.ts:84


sendBatchTransaction

sendBatchTransaction(transactions): Promise<Transaction<any>[]>

Create, sign & broad a transaction with multiple outputs.

Parameters

Name Type Description
transactions TransactionRequest[] to, value, data

Returns

Promise<Transaction<any>[]>

Resolves with a signed transaction.

Defined in

types/dist/lib/Wallet.d.ts:58


sendSweepTransaction

sendSweepTransaction(address, asset, fee?): Promise<Transaction<any>>

Create, sign & broadcast a sweep transaction.

Parameters

Name Type Description
address AddressType External address.
asset Asset -
fee? FeeType -

Returns

Promise<Transaction<any>>

Resolves with a signed transaction.

Defined in

types/dist/lib/Wallet.d.ts:45


sendTransaction

sendTransaction(options): Promise<Transaction<any>>

Create, sign & broadcast a transaction.

Parameters

Name Type
options TransactionRequest

Returns

Promise<Transaction<any>>

Resolves with a signed transaction.

Defined in

types/dist/lib/Wallet.d.ts:38


signMessage

signMessage(message, from): Promise<string>

Sign a message.

Parameters

Name Type Description
message string Message to be signed.
from string The address from which the message is signed.

Returns

Promise<string>

Resolves with a signed message.

Defined in

types/dist/lib/Wallet.d.ts:74


updateTransactionFee

updateTransactionFee(tx, newFee): Promise<Transaction<any>>

Update the fee of a transaction.

Parameters

Name Type Description
tx string | Transaction<any> Transaction object or hash of the transaction to update
newFee FeeType New fee price in native unit (e.g. sat/b, wei)

Returns

Promise<Transaction<any>>

Resolves with the new transaction

Defined in

types/dist/lib/Wallet.d.ts:52

Clone this wiki locally