UNPKG

1.82 kBTypeScriptView Raw
1import { ABI, AddressString, Event, InvokeReceipt, SmartContractNetworksDefinition, SmartContractReadOptions, TransactionOptions, TransactionResult } from '@neo-one/client-common';
2import BigNumber from 'bignumber.js';
3import { Client } from './Client';
4import { SmartContract } from './types';
5export declare type NEP5Event = NEP5TransferEvent;
6export interface NEP5TransferEventParameters {
7 readonly from: AddressString | undefined;
8 readonly to: AddressString | undefined;
9 readonly amount: BigNumber;
10}
11export interface NEP5TransferEvent extends Event<'transfer', NEP5TransferEventParameters> {
12}
13export interface NEP5SmartContract<TClient extends Client = Client> extends SmartContract<TClient, NEP5Event> {
14 readonly balanceOf: (address: AddressString, options?: SmartContractReadOptions) => Promise<BigNumber>;
15 readonly decimals: (options?: SmartContractReadOptions) => Promise<BigNumber>;
16 readonly name: (options?: SmartContractReadOptions) => Promise<string>;
17 readonly owner: (options?: SmartContractReadOptions) => Promise<AddressString>;
18 readonly symbol: (options?: SmartContractReadOptions) => Promise<string>;
19 readonly totalSupply: (options?: SmartContractReadOptions) => Promise<BigNumber>;
20 readonly transfer: (from: AddressString, to: AddressString, amount: BigNumber, options?: TransactionOptions) => TransactionResult<InvokeReceipt<boolean, NEP5Event>>;
21}
22export declare const abi: (decimals: number) => ABI;
23export declare const getDecimals: (client: Client<any, any>, networksDefinition: SmartContractNetworksDefinition, network: string) => Promise<number>;
24export declare const createNEP5SmartContract: <TClient extends Client<any, any>>(client: TClient, networksDefinition: SmartContractNetworksDefinition, decimals: number) => NEP5SmartContract<Client<any, any>>;