The TransactionSigner works really well with the AtomicTransactionComposer, which is really helpful when interacting with smart contracts or group/atomic transactions. The TransactionSigner interface/type is defined as:
/**
* This type represents a function which can sign transactions from an atomic transaction group.
* @param txnGroup - The atomic group containing transactions to be signed
* @param indexesToSign - An array of indexes in the atomic transaction group that should be signed
* @returns A promise which resolves an array of encoded signed transactions. The length of the
* array will be the same as the length of indexesToSign, and each index i in the array
* corresponds to the signed transaction from txnGroup[indexesToSign[i]]
*/
export declare type TransactionSigner = (txnGroup: Transaction[], indexesToSign: number[]) => Promise<Uint8Array[]>;
A basic implementation of it would look like this (but should probably live in the PeraWalletConnect type/class):
The
TransactionSigner
works really well with theAtomicTransactionComposer
, which is really helpful when interacting with smart contracts or group/atomic transactions. TheTransactionSigner
interface/type is defined as:A basic implementation of it would look like this (but should probably live in the PeraWalletConnect type/class):
Usage: