Custom Signing
By default in order to sign any transactions, user's wallet of type JWKInterface
needs to be passed as an argument for the method.
It is also possible to pass as wallet property object of type CustomSignature
. Interface for the discussed below:
type SignatureType = 'arweave' | 'ethereum';
type SigningFunction = (tx: Transaction) => Promise<void>;
type CustomSignature = { signer: SigningFunction; type: SignatureType };
An example of a method which uses custom signing functionality:
const customSigningFunction = async (tx: Transaction) => {
await sign(tx);
};
await contract.connect({ signer: customSigningFunction, signatureType: 'arweave' }).writeInteraction({
function: 'function',
});
Custom signing function is then used to sign the transaction.
tip
The most common use case for that is signing transaction with EVM wallet.
More about it in the Signature plugin
section.