import { AddressString, AttributeUsage, Hash256String, NetworkType, PublicKeyString } from '@neo-one/client-common'; export interface DapiProvider { readonly name: string; readonly website: string; readonly version: string; readonly compatibility: readonly string[]; readonly extra: object; } export interface DapiNetworks { readonly networks: readonly NetworkType[]; readonly defaultNetwork: NetworkType; } export interface DapiAccount { readonly address: AddressString; readonly label?: string; } export interface DapiPublicKey { readonly address: AddressString; readonly publicKey: PublicKeyString; } export interface InvokeReadArgs { readonly scriptHash: string; readonly operation: string; readonly args: readonly Argument[]; readonly network?: string; } export declare type ArgumentDataType = 'String' | 'Boolean' | 'Hash160' | 'Hash256' | 'Integer' | 'ByteArray' | 'Array' | 'Address'; export interface Argument { readonly type: ArgumentDataType; readonly value: any; } export interface SendArgs { readonly fromAddress: AddressString; readonly toAddress: string; readonly asset: Hash256String; readonly amount: string; readonly remark?: string; readonly fee?: string; readonly network?: NetworkType; readonly broadcastOverride?: boolean; } export interface AttachedAssets { readonly NEO?: string; readonly GAS?: string; } export interface TxHashAttribute extends Argument { readonly txAttrUsage: AttributeUsage; } export interface InvokeArgs extends InvokeReadArgs { readonly attachedAssets?: AttachedAssets; readonly fee?: string; readonly assetIntentOverrides?: AssetIntentOverrides; readonly triggerContractVerification?: boolean; readonly txHashAttributes?: readonly TxHashAttribute[]; } export interface AssetIntentOverrides { readonly inputs: readonly AssetInput[]; readonly outputs: readonly AssetOutput[]; } export interface AssetInput { readonly txid: string; readonly index: number; } export interface AssetOutput { readonly asset: Hash256String; readonly address: AddressString; readonly value: string; } export interface WriteResult { readonly txid: string; readonly nodeUrl: string; } export declare const ACCOUNT_CHANGED = "ACCOUNT_CHANGED"; export declare const NETWORK_CHANGED = "NETWORK_CHANGED"; export declare type Event = 'READY' | typeof ACCOUNT_CHANGED | typeof NETWORK_CHANGED | 'DISCONNECTED' | 'BLOCK_HEIGHT_CHANGED' | 'TRANSACTION_CONFIRMED'; export interface DapiError { readonly type: `NO_PROVIDER` | `CONNECTION_DENIED`; readonly description: string; readonly data: string; } export interface Dapi { readonly getNetworks: () => Promise; readonly getAccount: () => Promise; readonly getPublicKey: () => Promise; readonly send: (args: SendArgs) => Promise; readonly invoke: (args: InvokeArgs) => Promise; readonly addEventListener: (event: Event, callback: (...args: any) => void) => void; readonly removeEventListener: (event: Event) => void; }