@secux/app-eth
Version:
SecuX Hardware Wallet ETH API
72 lines (68 loc) • 2.86 kB
TypeScript
/*!
Copyright 2022 SecuX Technology Inc
Copyright Chen Wei-En
Copyright Wu Tsung-Yu
Licensed under the Apache License, Version 2.0 (the License);
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an AS IS BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
import { Interface } from "@ethersproject/abi";
import { baseData, PrefixedHexString } from "./interface";
export declare class ERC20 {
/**
* ERC20 Function Call
* - function transfer(address _to, uint256 _value) public returns (bool success)
* @param {string} path BIP32
* @param {baseData} content
* @param {transferData} args
* @returns {object} prepared
* @returns {communicationData} prepared.commandData
* @returns {communicationData} prepared.rawTx
*/
static prepareTransfer(path: string, content: baseData, args: transferData): {
commandData: import("@secux/utility/lib/communication").communicationData;
rawTx: import("@secux/utility/lib/communication").communicationData;
};
/**
* ERC20 Function Call
* - function transferFrom(address _from, address _to, uint256 _value) public returns (bool success)
* @param {string} path BIP32
* @param {baseData} content
* @param {transferFromData} args
* @returns {object} prepared
* @returns {communicationData} prepared.commandData
* @returns {communicationData} prepared.rawTx
*/
static prepareTransferFrom(path: string, content: baseData, args: transferFromData): {
commandData: import("@secux/utility/lib/communication").communicationData;
rawTx: import("@secux/utility/lib/communication").communicationData;
};
/**
* ERC20 Methods
* - function approve(address _spender, uint256 _value) public returns (bool success)
* @param {string} path BIP32
* @param {baseData} content
* @param {transferData} args
* @returns {object} prepared
* @returns {communicationData} prepared.commandData
* @returns {communicationData} prepared.rawTx
*/
static prepareApprove(path: string, content: baseData, args: transferData): {
commandData: import("@secux/utility/lib/communication").communicationData;
rawTx: import("@secux/utility/lib/communication").communicationData;
};
}
export declare const erc20_def: Interface;
export interface transferData {
toAddress: string;
amount: number | PrefixedHexString;
}
export interface transferFromData extends transferData {
fromAddress: string;
}