SDK Implementation
Installation
Install the Gasyard SDK via npm:
npm install gasyard-sdkInitialization
To use the SDK, import it and initialize with your API key:
import { ConfigResponse, GasyardSDK } from 'gasyard-sdk';
const sdk = new GasyardSDK({
apiKey: 'DEMO',});Need Help?
If you're looking to integrate our API or SDK and need assistance, feel free to reach out on Telegram: t.me/qimchi.
1. Get a Swap Quote
Fetches a quote for token swaps between networks.
Example Usage:
const getQuote = async () => {
try {
const quote = await sdk.getQuote({
inputNetwork: 2,
outputNetwork: 5,
inputTokenAmount: "5000000000000000",
outputTokenContract: "0xaf88d065e77c8cC2239327C5EDb3A432268e5831"
});
console.log(quote);
} catch (error) {
console.error(error);
}
};
getQuote();2. Get Network Configuration
Retrieves configuration details for a specified blockchain network.
Example Usage:
3. Check Transaction Status
Checks the status of a transaction based on its hash.
Example Usage:
4. Get Transaction History
Fetches transaction history for a given address.
Example Usage:
5. Bridge Tokens
Initiates a token bridging transaction between two networks.
Example Usage:
Last updated