@secux/app-eth
Version:
SecuX Hardware Wallet ETH API
79 lines (75 loc) • 3.12 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.
*/
/// <reference types="node" />
/// <reference types="node" />
import { Interface } from "@ethersproject/abi";
import { baseData, PrefixedHexString } from "./interface";
export declare class ERC721 {
/**
* ERC721 Function Call
* - function safeTransferFrom(address _from, address _to, uint256 _tokenId, bytes [data]) external payable
* @param {string} path BIP32
* @param {baseData} content
* @param {safeTransferDataArgs} args
* @returns {object} prepared
* @returns {communicationData} prepared.commandData
* @returns {communicationData} prepared.rawTx
*/
static prepareSafeTransferFrom(path: string, content: baseData, args: safeTransferDataArgs): {
commandData: import("@secux/utility/lib/communication").communicationData;
rawTx: import("@secux/utility/lib/communication").communicationData;
};
/**
* ERC721 Function Call
* - function transferFrom(address _from, address _to, uint256 _tokenId) external payable
* @param {string} path BIP32
* @param {baseData} content
* @param {safeTransferArgs} args
* @returns {object} prepared
* @returns {communicationData} prepared.commandData
* @returns {communicationData} prepared.rawTx
*/
static prepareTransferFrom(path: string, content: baseData, args: safeTransferArgs): {
commandData: import("@secux/utility/lib/communication").communicationData;
rawTx: import("@secux/utility/lib/communication").communicationData;
};
/**
* ERC721 Function Call
* - function approve(address _approved, uint256 _tokenId) external payable
* @param {string} path BIP32
* @param {baseData} content
* @param {safeTransferArgs} args
* @returns {object} prepared
* @returns {communicationData} prepared.commandData
* @returns {communicationData} prepared.rawTx
*/
static prepareApprove(path: string, content: baseData, args: approveArgs): {
commandData: import("@secux/utility/lib/communication").communicationData;
rawTx: import("@secux/utility/lib/communication").communicationData;
};
}
export declare const erc721_def: Interface;
export interface safeTransferArgs {
fromAddress: string;
toAddress: string;
tokenId: number | PrefixedHexString;
}
export interface safeTransferDataArgs extends safeTransferArgs {
data?: PrefixedHexString | Buffer;
}
export type approveArgs = {
toAddress: string;
tokenId: number | PrefixedHexString;
};