npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@trikon_sdk/custom-paymaster-sdk

v1.0.3

Published

Node.js SDK for Trikon OS APIs

Readme

🧠 CustomPaymasterSDX

The CustomPaymasterSDX is a Node.js SDK to interact with Trikon’s Paymaster Service, a backend service that provides Account Abstraction-powered features such as:

  • Anonymous login/signup
  • Multichain token portfolio viewing
  • ERC-20 and native token transfer (with or without gas sponsorship)
  • Token swap across chains
  • Token approval checks and gas estimations

This SDK is intended for developers building smart account-based decentralized applications (dApps) that wish to offer seamless user experience with minimal wallet friction.


📦 Installation

npm install node-fetch dotenv

Configuration

You need to first login to https://trikon.io and create an account to get an API key, project id and dapp id. These will be used in further SDK methods.

🔑 Initialization

const CustomPaymasterSDK = require("@trikon_sdk/custom-paymaster-sdk");

const sdk = new CustomPaymasterSDK({
  apiKey: 'YOUR_API_KEY_HERE' // replace with actual Trikon API key
});

🧪 API Methods and Usage

All methods return a Promise and must be called using await or .then().


testTrikonSDX()

Purpose: To verify if the Trikon SDX system is up and responding.

await sdk.testTrikonSDX();

🔐 signUpAnonymous(data)

Purpose: Registers a user anonymously.

await sdk.signUpAnonymous({
  userName: 'testuser',
  password: 'testpassword'
});

🔐 signInAnonymous(data)

Purpose: Signs in an anonymous user and returns their session/token data.

await sdk.signInAnonymous({
  userName: 'testuser',
  password: 'testpassword',
  projectId: 'your_project_id',
  dappId: 'your_dapp_id'
});

💼 getMultichainPortfolio(address)

Purpose: Retrieves all ERC-20 and native token balances of a wallet across supported chains.

await sdk.getMultichainPortfolio('0xYourAddress');

💰 getBalance(data)

Purpose: Fetches the native token balance of a wallet on a specific chain.

await sdk.getBalance({
  address: '0xYourAddress',
  chainId: '0x89'  // Polygon
});

🪙 getERC20Balance(data)

Purpose: Returns the balance of a specific ERC-20 token for a wallet.

await sdk.getERC20Balance({
  contractAddress: '0xdAC17F...',   // token contract (e.g., USDT)
  address: '0xYourAddress',
  chainId: '0x1'                    // Ethereum mainnet
});

🛡️ checkERC20ApprovalAmount(data)

Purpose: Checks whether the token is approved for transfer to a spender contract.

await sdk.checkERC20ApprovalAmount({
  contractAddress: '0xdAC17F...',
  userAddress: '0xYourAddress',
  spenderAddress: '0xSpenderContract',
  chainId: '0x1'
});

approveERC20(data)

Purpose: Approve the transfer of an ERC-20 token via smart account.

await sdk.approveERC20({
  cfa: '0xYourSmartAccount',
  toAddress: '0xRecipient',
  valueInEther: '0.0001',
  contractAddress: '0xTokenContract',
  projectId: 'your_project_id',
  chainId: '0xaa36a7'
});

estimateGasSendERC20Transfer(data)

Purpose: Estimate the gas required to send an ERC-20 token via smart account.

await sdk.estimateGasSendERC20Transfer({
  cfa: '0xYourSmartAccount',
  toAddress: '0xRecipient',
  valueInEther: '0.0001',
  contractAddress: '0xTokenContract',
  projectId: 'your_project_id',
  chainId: '0xaa36a7'
});

🚀 sendERC20Transfer(data)

Purpose: Executes the transfer of ERC-20 tokens using the Account Abstraction smart account.

await sdk.sendERC20Transfer({
  toAddress: '0xRecipient',
  projectId: 'your_project_id',
  contractAddress: '0xTokenContract',
  valueInEther: '0.0001',
  chainId: '0xaa36a7',
  cfa: '0xYourSmartAccount'
});

estimateGasSendNative(data)

Purpose: Estimate the gas required to send native tokens (ETH, MATIC, etc.).

await sdk.estimateGasSendNative({
  toAddress: '0xRecipient',
  valueInEther: '0.00000001',
  chainId: '0xaa36a7',
  projectId: 'your_project_id',
  cfa: '0xYourSmartAccount'
});

🚀 sendNative(data)

Purpose: Sends native tokens from the smart account.

await sdk.sendNative({
  toAddress: '0xRecipient',
  valueInEther: '0.00000001',
  chainId: '0xaa36a7',
  projectId: 'your_project_id',
  cfa: '0xYourSmartAccount'
});

📡 getLifiRoutes(data)

Purpose: Fetches token swap route options between two chains.

await sdk.getLifiRoutes({
  fromAddress: '0xYourAddress',
  fromChainId: 1,
  toChainId: 137,
  fromTokenAddress: '0xdAC17F...', // USDT
  toTokenAddress: '0x0000000000000000000000000000000000000000', // MATIC
  fromAmount: '1000000'
});

🔄 swapAssets(data)

Purpose: Initiates a cross-chain token swap using LiFi tools (like StargateV2).

await sdk.swapAssets({
  fromAddress: '0xYourAddress',
  fromChain: 137,
  fromToken: '0x0000000000000000000000000000000000000000',
  toChain: 8453,
  toToken: '0x0000000000000000000000000000000000000000',
  fromAmount: '2000000000000',
  selectedTool: 'stargateV2', 
  chainId: '0xaa36a7',
  cfa: '0xYourSmartAccount'
});

🧠 Notes

  • All requests require a valid API key via x-api-key header.
  • Many requests require projectId, dappId, and cfa (users smart contract wallet).
  • chainId should be in hexadecimal format (e.g., 0xaa36a7 for Sepolia).

🧰 Troubleshooting

  • Error 400/500: Check if all required parameters are present.
  • Authentication Error: Make sure your API key is correct and not expired.
  • Token Transfer Fails: Ensure the user has balance, allowance, and correct network selected.

📜 License

MIT © 2025 Trikon


🤝 Support

If you have any questions or need help integrating the SDK, contact the Trikon team.