fix: token program moved to its own repo (#502)

This commit is contained in:
Jack May
2019-10-02 14:07:03 -07:00
committed by Michael Vines
parent c31ca1fc1b
commit b4922e8aef
5 changed files with 52 additions and 2166 deletions

View File

@ -233,92 +233,6 @@ declare module '@solana/web3.js' {
serialize(): Buffer;
}
// === src/token-program.js ===
declare export class TokenAmount extends BN {
toBuffer(): Buffer;
fromBuffer(buffer: Buffer): TokenAmount;
}
declare export type TokenInfo = {|
supply: TokenAmount,
decimals: number,
name: string,
symbol: string,
|};
declare export type TokenAccountInfo = {|
token: PublicKey,
owner: PublicKey,
amount: TokenAmount,
source: null | PublicKey,
originalAmount: TokenAmount,
|};
declare type TokenAndPublicKey = [Token, PublicKey];
declare export class Token {
programId: PublicKey;
token: PublicKey;
static createNewToken(
connection: Connection,
owner: Account,
supply: TokenAmount,
name: string,
symbol: string,
decimals: number,
programId?: PublicKey,
): Promise<TokenAndPublicKey>;
constructor(connection: Connection, token: PublicKey): Token;
newAccount(owner: Account, source?: PublicKey): Promise<PublicKey>;
tokenInfo(): Promise<TokenInfo>;
accountInfo(account: PublicKey): Promise<TokenAccountInfo>;
transfer(
owner: Account,
source: PublicKey,
destination: PublicKey,
amount: number | TokenAmount,
): Promise<TransactionSignature>;
approve(
owner: Account,
account: PublicKey,
delegate: PublicKey,
amount: number | TokenAmount,
): Promise<void>;
revoke(
owner: Account,
account: PublicKey,
delegate: PublicKey,
): Promise<void>;
setOwner(
owner: Account,
account: PublicKey,
newOwner: PublicKey,
): Promise<void>;
transferInstruction(
owner: PublicKey,
source: PublicKey,
destination: PublicKey,
amount: number | TokenAmount,
): Promise<TransactionInstruction>;
approveInstruction(
owner: PublicKey,
account: PublicKey,
delegate: PublicKey,
amount: number | TokenAmount,
): TransactionInstruction;
revokeInstruction(
owner: PublicKey,
account: PublicKey,
delegate: PublicKey,
): TransactionInstruction;
setOwnerInstruction(
owner: PublicKey,
account: PublicKey,
newOwner: PublicKey,
): TransactionInstruction;
}
// === src/loader.js ===
declare export class Loader {
static load(