Class ExtensionWallet

This wallet (proxy) allows interacting with the CIPXX compatible extension wallets.

 const wallet = new ExtensionWallet()
wallet
.connect({appName: 'MySuperDApp', networkName: NetworkName.SignumMainnet})
.then( connection => {
console.log('Successfully connected', connection)
const ledger = LedgerClientFactory.createClient({ nodeHost: connection.currentNodeHost });
console.log('Sending some money...')
return ledger.transaction.sendAmountToSingleRecipient({
senderPublicKey: connection.publicKey,
recipientId: Address.fromReedSolomonAddress('TS-K37B-9V85-FB95-793HN').getNumericId(),
feePlanck: String(FeeQuantPlanck),
amountPlanck: Amount.fromSigna(1).getPlanck()
})
})
.then( unsignedTransaction => {
return wallet.confirm(unsignedTransaction.unsignedTransactionBytes)
})
.then( confirmedTransaction => {
console.log('Successfully sent money:', confirmedTransaction)
}).catch(console.error)

At this time, this wallet does only work in the browser

Constructors

Accessors

Methods

  • Requests a confirmation, i.e. cryptographic signing, of a transaction.

    The unsignedTransaction byte sequence is being returned by any of the SignumJS operations as long as no private key is passed as parameter to the operation

    Parameters

    • unsignedTransaction: string

      The hexadecimal byte string of an unsigned transaction.

    Returns Promise<ConfirmedTransaction>

    The confirmed transaction, in case of success

    const { unsignedTransactionBytes } = await ledger.transaction.sendAmountToSingleRecipient({
    senderPublicKey: connection.publicKey, // only public key is passed!
    recipientId: Address.fromReedSolomonAddress('TS-K37B-9V85-FB95-793HN').getNumericId(),
    feePlanck: String(FeeQuantPlanck),
    amountPlanck: Amount.fromSigna(1).getPlanck()
    })
    const { transactionId, fullHash } = await wallet.confirm(unsignedTransactionBytes)

    Error if signing failed for some reason, i.e. rejected operation or invalid transaction data