Get Paymaster
To get a paymaster by ID, use the following:
import { ChainId, KriptonioSdk } from '@kriptonio/sdk';
const sdk = new KriptonioSdk({
accessToken: 'your-access-token',
});
const paymaster = await sdk.paymaster.get({ id: '<id>' });
If you want to get a paymaster if it already exists for the wallet, you can use the getOrCreate
method.
import { ChainId, KriptonioSdk } from '@kriptonio/sdk';
const sdk = new KriptonioSdk({
accessToken: 'your-access-token',
});
const paymaster = await sdk.paymaster.getOrCreate({
entryPoint: '0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789',
wallet: '0x123',
chainId: ChainId.Polygon,
});