Paymaster SDK Tutorial (Typescript)
Install the paymaster SDK
npm install @kanalabs/paymaster-sdk
or
yarn add @kanalabs/paymaster-sdkInitialize SDK with Private Key and projectKey
import { PaymasterSdk } from "@kanalabs/paymaster-sdk";
const sdk = new PaymasterSdk(
{
privateKey:
"user private key", // Optional
},
{
projectKey: "your project key",
network: Network.TESTNET // default MAINNET
chain: chainName.Aptos // default aptos chain
}
);Initialize SDK without Private Key
import { PaymasterSdk } from "@kanalabs/paymaster-sdk";
const sdk = new PaymasterSdk({}, { projectKey: testProjectKey, network: Network.TESTNET })Check If user already whitelisted,
To add user to whitelist
Initialize user account
Sponsor Transactions for Aptos
Sponsor Transactions for Supra
Sponsor Transaction with Sender Auth and Transaction for Aptos
Sponsor Transaction with Sender Auth and Transaction for Supra
Paymaster SDK Example Repo
Last updated