solone-sdk
Version:
javascript sdk for solona
37 lines (36 loc) • 1.73 kB
TypeScript
import { ConfirmedSignaturesForAddress2Options, Connection as ConnectionType, PublicKey as PublicKeyType } from '@solana/web3.js';
import { TransactionObject, Cluster, payerType, recieverType, CreateAccountResponse } from './types';
export declare class Solone {
private DECIMAL_OFFSET;
connection: ConnectionType;
network: string;
payers: {
[key: string]: payerType;
};
recievers: {
[key: string]: recieverType;
};
masterUrl: string;
masterKey: string;
/**
* Create a new Solana Object
* @param {string} network network to connect
*/
constructor(network: Cluster, masterUrl?: string, masterKey?: string);
/**
* Create a new Solana Object
* @param {string} network network to connect
*/
switchRpcUrl: (url: string) => void;
switchNetwork: (network: Cluster) => void;
getAccountBalance: (address: string | PublicKeyType) => Promise<number>;
createAccount: (secret?: string | Uint8Array | undefined) => Promise<CreateAccountResponse>;
getTransactions: (address: string, options: ConfirmedSignaturesForAddress2Options) => Promise<Array<TransactionObject>>;
fundAccount: (address: string | PublicKeyType, amount?: number | undefined) => Promise<string>;
addPayer: (name: string, secretKey?: string | Uint8Array | undefined) => Promise<boolean>;
getPayerWithName: (name: string) => payerType | string;
getRecieverWithName: (name: string) => recieverType | string;
addRecivers: (name: string, address: string | PublicKeyType) => Promise<boolean>;
sendTransaction: (toPubkey: PublicKeyType, fromPubkey: PublicKeyType, amount: number, secretKey: Uint8Array) => Promise<string>;
private apiCall;
}