Skip to content

Wallet

@aeternity/aepp-sdk/es/utils/aepp-wallet-communication/rpc/wallet-rpc

RPC handler for WAELLET side

Example

import WalletRpc from '@aeternity/aepp-sdk/es/utils/aepp-wallet-communication/rpc/wallet-rpc'

exports.WalletRpc(param, onConnection, onSubscription, onSign, onAskAccounts, onDisconnect) ⇒ Object

Contain functionality for aepp interaction and managing multiple aepps

Kind: Exported function
rtype: Stamp

Param Type Description
param Object Init params object
[param.name] String Wallet name
onConnection function Call-back function for incoming AEPP connection (Second argument contain function for accept/deny request)
onSubscription function Call-back function for incoming AEPP account subscription (Second argument contain function for accept/deny request)
onSign function Call-back function for incoming AEPP sign request (Second argument contain function for accept/deny request)
onAskAccounts function Call-back function for incoming AEPP get address request (Second argument contain function for accept/deny request)
onDisconnect function Call-back function for disconnect event

exports.WalletRpc.getClients() ⇒ Object

Get RpcClients object which contain all connected AEPPS

Kind: instance method of exports.WalletRpc
rtype: () => Object

exports.WalletRpc.addRpcClient(clientConnection) ⇒ void

Add new AEPP connection

Kind: instance method of exports.WalletRpc
rtype: (clientConnection: Object) => Object

Param Type Description
clientConnection Object AEPP connection object

exports.WalletRpc.shareWalletInfo(postFn) ⇒ void

Share wallet info Send shareWalletInfo message to notify AEPP about wallet

Kind: instance method of exports.WalletRpc
rtype: (postFn: Function) => void

Param Type Description
postFn function Send message function like (msg) => void

exports.WalletRpc.getWalletInfo() ⇒ Object

Get Wallet info object

Kind: instance method of exports.WalletRpc
Returns: Object - Object with wallet information(id, name, network, ...)
rtype: () => Object

exports.WalletRpc.getAccounts() ⇒ Object

Get Wallet accounts

Kind: instance method of exports.WalletRpc
Returns: Object - Object with accounts information({ connected: Object, current: Object })
rtype: () => Object