@parifi/sdk
Version:
Parifi SDK with common utility functions
46 lines (45 loc) • 1.31 kB
JavaScript
// src/relayers/gelato/gelato-function.ts
import {
GelatoRelay
} from "@gelatonetwork/relay-sdk";
var executeTxUsingGelato = async (targetContractAddress, chainId, gelatoKey, encodedTxData, gelatoGasLimit) => {
const request = {
chainId: BigInt(chainId.toString()),
target: targetContractAddress,
data: encodedTxData
};
const relay = new GelatoRelay();
const relayOptions = {
gasLimit: gelatoGasLimit || BigInt(5e6)
};
const { taskId } = await relay.sponsoredCall(request, gelatoKey || "", relayOptions);
return taskId;
};
var checkGelatoTaskStatus = async (taskId) => {
const relay = new GelatoRelay();
const txStatus = await relay.getTaskStatus(taskId);
return txStatus;
};
// src/relayers/gelato/index.ts
var Gelato = class {
constructor(gelatoConfig, rpcConfig) {
this.gelatoConfig = gelatoConfig;
this.rpcConfig = rpcConfig;
this.checkGelatoTaskStatus = (taskId) => {
return checkGelatoTaskStatus(taskId);
};
}
async executeTxUsingGelato(targetContractAddress, encodedTxData, gelatoGasLimit) {
return await executeTxUsingGelato(
targetContractAddress,
this.rpcConfig.chainId,
this.gelatoConfig?.apiKey,
encodedTxData,
gelatoGasLimit
);
}
};
export {
Gelato
};
//# sourceMappingURL=index.mjs.map