Push Refill Transaction

Push Refill Transaction

Push refill transaction allows to manually push a transaction from one of the scheduled refill transactions.
Note: You can only use this method once per 4 hours per wallet.
let response = await walletInstance.PushRefillTransaction();

if (response.success) {
  //request successful
  console.log("Push Refill successfully.");
}
else {
  console.log("Request failed due to error:", response.message);
}
let response:PushRefillTxResultWrapper=await walletInstance.PushRefillTransaction();
       
if (response.success) {
  //request successful
  console.log("Push Refill successfully.");
} else {
  console.log("Request failed due to error:", response.message);
}

You will get the following response from the PushRefillTransaction method. It is JSON representation Only.

{
   "success":true,
   "data":{      
   }
}

Full Example

Using ETH Chain.

import { CoinsEnum, LiminalEnvironment, LiminalJs } from "@lmnl/liminaljs";
const main = async () => {
    try {
        // Instance of Liminal Js
        let liminalJs = new LiminalJs(LiminalEnvironment.test);
        await liminalJs
            .Authenticate({
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        })
            .AuthenticateWithAccessToken();
        // Get Wallet Instance
        let walletInstance = await liminalJs
            .Coin(CoinsEnum.eth)
            .Wallets()
            .Get({ walletId: 310 });
      
        let response = await walletInstance.PushRefillTransaction();
        if (response.success) {
            //request successful
            console.log("Push Refill successfully.");
        }
        else {
            console.log("Request failed due to error:", response.message);
        }
    }
    catch (ex) {
        throw ex;
    }
};
main().then((resolve) => console.log("Complete")).catch((error) => console.log(error));
import {
    CoinsEnum,
    LiminalEnvironment,
    LiminalJs,
    Wallet,
    PushRefillTxResultWrapper
} from "@lmnl/liminaljs"

const main = async (): Promise<void> => {
    try {
        // Instance of Liminal Js
        let liminalJs = new LiminalJs(LiminalEnvironment.test);
        await liminalJs
            .Authenticate({
               clientId: "YOUR_CLIENT_ID",
                clientSecret: "YOUR_CLIENT_SECRET"
            })
            .AuthenticateWithAccessToken();

        // Get Wallet Instance
        let walletInstance: Wallet = await liminalJs
            .Coin(CoinsEnum.eth)
            .Wallets()
            .Get({ walletId: 310 });

        let response:PushRefillTxResultWrapper=await walletInstance.PushRefillTransaction();
       
        if (response.success) {
            //request successful
            console.log("Push Refill successfully.");
        } else {
            console.log("Request failed due to error:", response.message);
        }

    }
    catch (ex) {
        throw ex;
    }
}

main().then((resolve) => console.log("Complete")).catch((error) => console.log(error));

Using ERC20 Token.

import { CoinsEnum, LiminalEnvironment, LiminalJs } from "@lmnl/liminaljs";
const main = async () => {
    try {
        // Instance of Liminal Js
        let liminalJs = new LiminalJs(LiminalEnvironment.test);
        await liminalJs
            .Authenticate({
            clientId: "YOUR_CLIENT_ID",
            clientSecret: "YOUR_CLIENT_SECRET"
        })
            .AuthenticateWithAccessToken();
        // Get Wallet Instance
        let walletInstance = await liminalJs
            .Coin(CoinsEnum.eth)
            .Token({
                tokenName:"bat",
                tokenAddress:"0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99"
            })
            .Wallets()
            .Get({ walletId: 310 });
      
        let response = await walletInstance.PushRefillTransaction();
        if (response.success) {
            //request successful
            console.log("Push Refill successfully.");
        }
        else {
            console.log("Request failed due to error:", response.message);
        }
    }
    catch (ex) {
        throw ex;
    }
};
main().then((resolve) => console.log("Complete")).catch((error) => console.log(error));
import {
    CoinsEnum,
    LiminalEnvironment,
    LiminalJs,
    Wallet,
    PushRefillTxResultWrapper
} from "@lmnl/liminaljs"

const main = async (): Promise<void> => {
    try {
        // Instance of Liminal Js
        let liminalJs = new LiminalJs(LiminalEnvironment.test);
        await liminalJs
            .Authenticate({
               clientId: "YOUR_CLIENT_ID",
                clientSecret: "YOUR_CLIENT_SECRET"
            })
            .AuthenticateWithAccessToken();

        // Get Wallet Instance
        let walletInstance: Wallet = await liminalJs
            .Coin(CoinsEnum.eth)
            .Token({
                tokenName:"bat",
                tokenAddress:"0xbF7A7169562078c96f0eC1A8aFD6aE50f12e5A99"
            })
            .Wallets()
            .Get({ walletId: 310 });

        let response:PushRefillTxResultWrapper=await walletInstance.PushRefillTransaction();
       
        if (response.success) {
            //request successful
            console.log("Push Refill successfully.");
        } else {
            console.log("Request failed due to error:", response.message);
        }

    }
    catch (ex) {
        throw ex;
    }
}

main().then((resolve) => console.log("Complete")).catch((error) => console.log(error));

Did this page help you?