@neo-one/server-plugin-wallet
Version:
NEO•ONE Server wallet plugin.
40 lines (39 loc) • 1.54 kB
TypeScript
import { UserAccountID } from '@neo-one/client-common';
import { CRUD, DescribeTable, ListTable, MasterResourceAdapter, MasterResourceAdapterOptions, ResourceState, ResourceType } from '@neo-one/server-plugin';
import { WalletPlugin } from './WalletPlugin';
export interface Coin {
readonly assetName: string;
readonly asset: string;
readonly amount: string;
}
export interface Wallet {
readonly plugin: string;
readonly resourceType: string;
readonly name: string;
readonly baseName: string;
readonly state: ResourceState;
readonly network: string;
readonly accountID: UserAccountID;
readonly address: string;
readonly unlocked: boolean;
readonly neoBalance: string;
readonly gasBalance: string;
readonly wif: string | undefined;
readonly nep2: string | undefined;
readonly publicKey: string;
readonly balance: readonly Coin[];
}
export interface WalletResourceOptions {
readonly network?: string;
readonly password?: string;
readonly privateKey?: string;
}
export declare class WalletResourceType extends ResourceType<Wallet, WalletResourceOptions> {
constructor({ plugin }: {
readonly plugin: WalletPlugin;
});
createMasterResourceAdapter({ pluginManager, dataPath, }: MasterResourceAdapterOptions): Promise<MasterResourceAdapter<Wallet, WalletResourceOptions>>;
getCRUD(): CRUD<Wallet, WalletResourceOptions>;
getListTable(resources: readonly Wallet[]): ListTable;
getDescribeTable(resource: Wallet): DescribeTable;
}