diff --git a/README.md b/README.md index 3ab8557..9e968c1 100644 --- a/README.md +++ b/README.md @@ -97,6 +97,17 @@ const tx = await oms.wallet.sendTransaction({ network: Networks.polygon, to: '0xRecipient', value: parseUnits('1', 18), // 1 POL + selectFeeOption: (feeOptions) => { + // If this Polygon mainnet transaction is not sponsored, choose a fee token the wallet can pay. + const selectedFeeOption = feeOptions.find(({ feeOption, availableRaw }) => + availableRaw !== undefined && BigInt(availableRaw) >= BigInt(feeOption.value) + ) + if (!selectedFeeOption) { + throw new Error('No fee option has enough balance') + } + + return { token: selectedFeeOption.feeOption.token.symbol } + }, }) console.log(tx.txnHash ?? tx.txnId) ``` diff --git a/package.json b/package.json index 2c9eca3..c7022c5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@0xsequence/typescript-sdk", - "version": "0.1.0-alpha.0", + "version": "0.1.0-alpha.1", "description": "TypeScript SDK for OMS (Open Money Stack).", "main": "dist/index.js", "module": "dist/esm/index.js",