// From LYNC DashboardconstapiKey="LYNC API KEY Dashboard";// Get this from LYNCconstlyncAuthKey="Get this from LYNC Support";
The performPaymasterTransaction function
import { TxnBuilderTypes, TransactionResponse} from"supra-l1-sdk";interfacePaymasterTransactionReturnData { receipt:TransactionResponse; accountCreationReceipt:TransactionResponse; privateKey:string;}/** * The account information. * @param{string} privateKey - The private key for the account. * @param{string} accountAddress - The account address. */interfaceAccountInfo { privateKey:string; accountAddress:string;}functionperformPaymasterTransaction( lyncAuthKey:string, supraNetwork:"testnet_supra"|"mainnet_supra", apiKey:string, inputTransaction: { entryFnStr:`0x${string}::${string}::${string}`; entryFnTypeArgs?:TxnBuilderTypes.TypeTag[]; entryFnArgs:Uint8Array[]; }, showLogs:boolean, accountData?:AccountInfo,):Promise<PaymasterTransactionReturnData>;
Using the performPaymasterTransaction function
constaccountData= { privateKey:"0x....", accountAddress:"0x...."};constdata=awaitperformPaymasterTransaction( lyncAuthKey,"testnet_supra",// "testnet_supra" or "mainnet_supra", apiKey, { entryFnStr:"0x1b89ab160c9ec18b5ee37f6d2774b5e8a9433c620a98bad062b6b738bd829316::tst_unity::set_data_num_u32", entryFnArgs: [BCS.bcsSerializeU32(10)], },false,// show logs or not accountData // optional - will generate a new account if not provided);console.log(data);