starcoin-framework

Module 0x1::EasyGasScript

use 0x1::EasyGas;
use 0x1::TransferScripts;

Function register

public entry fun register<TokenType: store>(sender: signer, precision: u8)
Implementation
public entry fun register<TokenType: store>(sender: signer, precision: u8) {
    EasyGas::register_oracle<TokenType>(&sender, precision)
}

Function init_data_source

public entry fun init_data_source<TokenType: store>(sender: signer, init_value: u128)
Implementation
public entry fun init_data_source<TokenType: store>(sender: signer, init_value: u128) {
    EasyGas::init_oracle_source<TokenType>(&sender, init_value);
}

Function update

public entry fun update<TokenType: store>(sender: signer, value: u128)
Implementation
public entry fun update<TokenType: store>(sender: signer, value: u128) {
    EasyGas::update_oracle<TokenType>(&sender, value)
}

Function withdraw_gas_fee_entry

public entry fun withdraw_gas_fee_entry<TokenType: store>(sender: signer, amount: u128)
Implementation
public entry fun withdraw_gas_fee_entry<TokenType: store>(sender: signer, amount: u128) {
    EasyGas::withdraw_gas_fee<TokenType>(&sender, amount);
}

Function deposit

public entry fun deposit<TokenType: store>(sender: signer, amount: u128)
Implementation
public entry fun deposit<TokenType: store>(sender: signer, amount:u128)  {
    let address = EasyGas::get_gas_fee_address();
    peer_to_peer_v2<TokenType>(sender, address, amount)
}