@dynamic-labs/ethereum-gasless-extension
v4.89.0
Published
Exposes the EVM gas sponsorship surface of `@dynamic-labs/ethereum-gasless-core` as a `ethereumGasless` namespace on the Dynamic client. Works for both the web and React Native (WebView) consumers — the extension forwards each call across `messageTranspor
Downloads
3,641
Readme
ethereum-gasless-extension
Exposes the EVM gas sponsorship surface of
@dynamic-labs/ethereum-gasless-core as a ethereumGasless namespace on the
Dynamic client. Works for both the web and React Native (WebView) consumers —
the extension forwards each call across messageTransport to the
EthereumGaslessController in webview-controller, which holds the wallet
keys.
Installation
npm install @dynamic-labs/ethereum-gasless-extensionUsage
import { EthereumGaslessExtension } from '@dynamic-labs/ethereum-gasless-extension';
import { createClient } from '@dynamic-labs/client';
const dynamicClient = createClient({
/* ... */
}).extend(EthereumGaslessExtension());
// Send a sponsored transaction end-to-end.
const wallet = dynamicClient.wallets.primary;
const { transactionHash } = await dynamicClient.ethereumGasless.send({
wallet,
calls: [{ target: '0x...', data: '0x', value: 0n }],
});
// Or split signing and relaying for retries / batching.
const signed = await dynamicClient.ethereumGasless.sign({ wallet, calls });
const { requestId } = await dynamicClient.ethereumGasless.relay({
wallet,
calls,
});
const status = await dynamicClient.ethereumGasless.getStatus({ requestId });See @dynamic-labs/ethereum-gasless-core for the underlying implementation
and full type documentation.
