@coral-xyz/spl-token
Advanced tools
Comparing version 0.29.0 to 0.30.0
/// <reference types="node" /> | ||
import { AccountsCoder, Idl } from "@coral-xyz/anchor"; | ||
import { IdlTypeDef } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
export declare class SplTokenAccountsCoder<A extends string = string> implements AccountsCoder { | ||
@@ -14,4 +13,4 @@ constructor(_idl: Idl); | ||
}; | ||
size(idlAccount: IdlTypeDef): number; | ||
size(accountName: A): number; | ||
} | ||
//# sourceMappingURL=accounts.d.ts.map |
@@ -94,4 +94,4 @@ "use strict"; | ||
} | ||
size(idlAccount) { | ||
switch (idlAccount.name) { | ||
size(accountName) { | ||
switch (accountName) { | ||
case "mint": { | ||
@@ -107,3 +107,3 @@ return 82; | ||
default: { | ||
throw new Error(`Invalid account name: ${idlAccount.name}`); | ||
throw new Error(`Invalid account name: ${accountName}`); | ||
} | ||
@@ -110,0 +110,0 @@ } |
@@ -10,17 +10,15 @@ import { PublicKey } from "@solana/web3.js"; | ||
declare type SplToken = { | ||
version: "3.3.0"; | ||
name: "spl_token"; | ||
address: string; | ||
metadata: { | ||
name: "splToken"; | ||
version: "3.3.0"; | ||
spec: "0.1.0"; | ||
}; | ||
instructions: [ | ||
{ | ||
name: "initializeMint"; | ||
name: "amountToUiAmount"; | ||
discriminator: [23]; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "rent"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
@@ -30,14 +28,4 @@ ]; | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "mintAuthority"; | ||
type: "publicKey"; | ||
}, | ||
{ | ||
name: "freezeAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
name: "amount"; | ||
type: "u64"; | ||
} | ||
@@ -47,39 +35,41 @@ ]; | ||
{ | ||
name: "initializeAccount"; | ||
name: "approve"; | ||
discriminator: [4]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "source"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "delegate"; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
signer: true; | ||
} | ||
]; | ||
args: [ | ||
{ | ||
name: "rent"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "amount"; | ||
type: "u64"; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "initializeMultisig"; | ||
name: "approveChecked"; | ||
discriminator: [13]; | ||
accounts: [ | ||
{ | ||
name: "multisig"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "source"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "rent"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "mint"; | ||
}, | ||
{ | ||
name: "delegate"; | ||
}, | ||
{ | ||
name: "owner"; | ||
signer: true; | ||
} | ||
@@ -89,3 +79,7 @@ ]; | ||
{ | ||
name: "m"; | ||
name: "amount"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
@@ -96,18 +90,16 @@ } | ||
{ | ||
name: "transfer"; | ||
name: "burn"; | ||
discriminator: [8]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "destination"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "mint"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "authority"; | ||
isMut: false; | ||
isSigner: true; | ||
signer: true; | ||
} | ||
@@ -123,18 +115,16 @@ ]; | ||
{ | ||
name: "approve"; | ||
name: "burnChecked"; | ||
discriminator: [15]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "delegate"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "mint"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "authority"; | ||
signer: true; | ||
} | ||
@@ -146,2 +136,6 @@ ]; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
} | ||
@@ -151,13 +145,16 @@ ]; | ||
{ | ||
name: "revoke"; | ||
name: "closeAccount"; | ||
discriminator: [9]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "destination"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
signer: true; | ||
} | ||
@@ -168,78 +165,64 @@ ]; | ||
{ | ||
name: "setAuthority"; | ||
name: "freezeAccount"; | ||
discriminator: [10]; | ||
accounts: [ | ||
{ | ||
name: "owned"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "mint"; | ||
}, | ||
{ | ||
name: "signer"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "owner"; | ||
signer: true; | ||
} | ||
]; | ||
args: [ | ||
args: []; | ||
}, | ||
{ | ||
name: "getAccountDataSize"; | ||
discriminator: [21]; | ||
accounts: [ | ||
{ | ||
name: "authorityType"; | ||
type: { | ||
defined: "AuthorityType"; | ||
}; | ||
}, | ||
{ | ||
name: "newAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
name: "mint"; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "mintTo"; | ||
name: "initializeAccount"; | ||
discriminator: [1]; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "mint"; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
} | ||
]; | ||
args: [ | ||
}, | ||
{ | ||
name: "amount"; | ||
type: "u64"; | ||
name: "rent"; | ||
address: "SysvarRent111111111111111111111111111111111"; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "burn"; | ||
name: "initializeAccount2"; | ||
discriminator: [16]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "authority"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "rent"; | ||
address: "SysvarRent111111111111111111111111111111111"; | ||
} | ||
@@ -249,4 +232,4 @@ ]; | ||
{ | ||
name: "amount"; | ||
type: "u64"; | ||
name: "owner"; | ||
type: "pubkey"; | ||
} | ||
@@ -256,39 +239,27 @@ ]; | ||
{ | ||
name: "closeAccount"; | ||
name: "initializeAccount3"; | ||
discriminator: [18]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
}, | ||
{ | ||
name: "destination"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
name: "mint"; | ||
} | ||
]; | ||
args: [ | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
type: "pubkey"; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "freezeAccount"; | ||
name: "initializeImmutableOwner"; | ||
discriminator: [22]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
writable: true; | ||
} | ||
@@ -299,44 +270,68 @@ ]; | ||
{ | ||
name: "thawAccount"; | ||
name: "initializeMint"; | ||
discriminator: [0]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "mint"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "rent"; | ||
address: "SysvarRent111111111111111111111111111111111"; | ||
} | ||
]; | ||
args: [ | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "mintAuthority"; | ||
type: "pubkey"; | ||
}, | ||
{ | ||
name: "freezeAuthority"; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "transferChecked"; | ||
name: "initializeMint2"; | ||
discriminator: [20]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "mint"; | ||
writable: true; | ||
} | ||
]; | ||
args: [ | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "mintAuthority"; | ||
type: "pubkey"; | ||
}, | ||
{ | ||
name: "destination"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "freezeAuthority"; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
} | ||
]; | ||
}, | ||
{ | ||
name: "initializeMultisig"; | ||
discriminator: [2]; | ||
accounts: [ | ||
{ | ||
name: "multisig"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "authority"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "rent"; | ||
address: "SysvarRent111111111111111111111111111111111"; | ||
} | ||
@@ -346,7 +341,3 @@ ]; | ||
{ | ||
name: "amount"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
name: "m"; | ||
type: "u8"; | ||
@@ -357,23 +348,11 @@ } | ||
{ | ||
name: "approveChecked"; | ||
name: "initializeMultisig2"; | ||
discriminator: [19]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "multisig"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "delegate"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "signer"; | ||
} | ||
@@ -383,7 +362,3 @@ ]; | ||
{ | ||
name: "amount"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
name: "m"; | ||
type: "u8"; | ||
@@ -394,18 +369,16 @@ } | ||
{ | ||
name: "mintToChecked"; | ||
name: "mintTo"; | ||
discriminator: [7]; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
}, | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
signer: true; | ||
} | ||
@@ -417,6 +390,2 @@ ]; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
} | ||
@@ -426,18 +395,16 @@ ]; | ||
{ | ||
name: "burnChecked"; | ||
name: "mintToChecked"; | ||
discriminator: [14]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "mint"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "authority"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "owner"; | ||
signer: true; | ||
} | ||
@@ -457,18 +424,31 @@ ]; | ||
{ | ||
name: "initializeAccount2"; | ||
name: "revoke"; | ||
discriminator: [5]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "source"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "owner"; | ||
signer: true; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "setAuthority"; | ||
discriminator: [6]; | ||
accounts: [ | ||
{ | ||
name: "owned"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "rent"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "owner"; | ||
signer: true; | ||
}, | ||
{ | ||
name: "signer"; | ||
signer: true; | ||
} | ||
@@ -478,4 +458,14 @@ ]; | ||
{ | ||
name: "owner"; | ||
type: "publicKey"; | ||
name: "authorityType"; | ||
type: { | ||
defined: { | ||
name: "authorityType"; | ||
}; | ||
}; | ||
}, | ||
{ | ||
name: "newAuthority"; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
} | ||
@@ -486,7 +476,7 @@ ]; | ||
name: "syncNative"; | ||
discriminator: [17]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
} | ||
@@ -497,34 +487,34 @@ ]; | ||
{ | ||
name: "initializeAccount3"; | ||
name: "thawAccount"; | ||
discriminator: [11]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
]; | ||
args: [ | ||
}, | ||
{ | ||
name: "owner"; | ||
type: "publicKey"; | ||
signer: true; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "initializeMultisig2"; | ||
name: "transfer"; | ||
discriminator: [3]; | ||
accounts: [ | ||
{ | ||
name: "multisig"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "source"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "signer"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "destination"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "authority"; | ||
signer: true; | ||
} | ||
@@ -534,4 +524,4 @@ ]; | ||
{ | ||
name: "m"; | ||
type: "u8"; | ||
name: "amount"; | ||
type: "u64"; | ||
} | ||
@@ -541,58 +531,21 @@ ]; | ||
{ | ||
name: "initializeMint2"; | ||
name: "transferChecked"; | ||
discriminator: [12]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
} | ||
]; | ||
args: [ | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "mintAuthority"; | ||
type: "publicKey"; | ||
name: "destination"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "freezeAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
name: "authority"; | ||
signer: true; | ||
} | ||
]; | ||
}, | ||
{ | ||
name: "getAccountDataSize"; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "initializeImmutableOwner"; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "amountToUiAmount"; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
]; | ||
args: [ | ||
@@ -602,2 +555,6 @@ { | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
} | ||
@@ -608,7 +565,6 @@ ]; | ||
name: "uiAmountToAmount"; | ||
discriminator: [24]; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
@@ -619,5 +575,3 @@ ]; | ||
name: "uiAmount"; | ||
type: { | ||
defined: "&'astr"; | ||
}; | ||
type: "string"; | ||
} | ||
@@ -630,144 +584,11 @@ ]; | ||
name: "mint"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "mintAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
}, | ||
{ | ||
name: "supply"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "isInitialized"; | ||
type: "bool"; | ||
}, | ||
{ | ||
name: "freezeAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
} | ||
]; | ||
}; | ||
discriminator: []; | ||
}, | ||
{ | ||
name: "account"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "mint"; | ||
type: "publicKey"; | ||
}, | ||
{ | ||
name: "owner"; | ||
type: "publicKey"; | ||
}, | ||
{ | ||
name: "amount"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "delegate"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
}, | ||
{ | ||
name: "state"; | ||
type: { | ||
defined: "AccountState"; | ||
}; | ||
}, | ||
{ | ||
name: "isNative"; | ||
type: { | ||
defined: "COption<u64>"; | ||
}; | ||
}, | ||
{ | ||
name: "delegatedAmount"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "closeAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
} | ||
]; | ||
}; | ||
}, | ||
{ | ||
name: "multisig"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "m"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "n"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "isInitialized"; | ||
type: "bool"; | ||
}, | ||
{ | ||
name: "signers"; | ||
type: { | ||
array: ["publicKey", 11]; | ||
}; | ||
} | ||
]; | ||
}; | ||
} | ||
]; | ||
types: [ | ||
{ | ||
name: "AccountState"; | ||
type: { | ||
kind: "enum"; | ||
variants: [ | ||
{ | ||
name: "Uninitialized"; | ||
}, | ||
{ | ||
name: "Initialized"; | ||
}, | ||
{ | ||
name: "Frozen"; | ||
} | ||
]; | ||
}; | ||
discriminator: []; | ||
}, | ||
{ | ||
name: "AuthorityType"; | ||
type: { | ||
kind: "enum"; | ||
variants: [ | ||
{ | ||
name: "MintTokens"; | ||
}, | ||
{ | ||
name: "FreezeAccount"; | ||
}, | ||
{ | ||
name: "AccountOwner"; | ||
}, | ||
{ | ||
name: "CloseAccount"; | ||
} | ||
]; | ||
}; | ||
name: "account"; | ||
discriminator: []; | ||
} | ||
@@ -778,3 +599,3 @@ ]; | ||
code: 0; | ||
name: "NotRentExempt"; | ||
name: "notRentExempt"; | ||
msg: "Lamport balance below rent-exempt threshold"; | ||
@@ -784,3 +605,3 @@ }, | ||
code: 1; | ||
name: "InsufficientFunds"; | ||
name: "insufficientFunds"; | ||
msg: "Insufficient funds"; | ||
@@ -790,3 +611,3 @@ }, | ||
code: 2; | ||
name: "InvalidMint"; | ||
name: "invalidMint"; | ||
msg: "Invalid Mint"; | ||
@@ -796,3 +617,3 @@ }, | ||
code: 3; | ||
name: "MintMismatch"; | ||
name: "mintMismatch"; | ||
msg: "Account not associated with this Mint"; | ||
@@ -802,3 +623,3 @@ }, | ||
code: 4; | ||
name: "OwnerMismatch"; | ||
name: "ownerMismatch"; | ||
msg: "Owner does not match"; | ||
@@ -808,3 +629,3 @@ }, | ||
code: 5; | ||
name: "FixedSupply"; | ||
name: "fixedSupply"; | ||
msg: "Fixed supply"; | ||
@@ -814,3 +635,3 @@ }, | ||
code: 6; | ||
name: "AlreadyInUse"; | ||
name: "alreadyInUse"; | ||
msg: "Already in use"; | ||
@@ -820,3 +641,3 @@ }, | ||
code: 7; | ||
name: "InvalidNumberOfProvidedSigners"; | ||
name: "invalidNumberOfProvidedSigners"; | ||
msg: "Invalid number of provided signers"; | ||
@@ -826,3 +647,3 @@ }, | ||
code: 8; | ||
name: "InvalidNumberOfRequiredSigners"; | ||
name: "invalidNumberOfRequiredSigners"; | ||
msg: "Invalid number of required signers"; | ||
@@ -832,3 +653,3 @@ }, | ||
code: 9; | ||
name: "UninitializedState"; | ||
name: "uninitializedState"; | ||
msg: "State is unititialized"; | ||
@@ -838,3 +659,3 @@ }, | ||
code: 10; | ||
name: "NativeNotSupported"; | ||
name: "nativeNotSupported"; | ||
msg: "Instruction does not support native tokens"; | ||
@@ -844,3 +665,3 @@ }, | ||
code: 11; | ||
name: "NonNativeHasBalance"; | ||
name: "nonNativeHasBalance"; | ||
msg: "Non-native account can only be closed if its balance is zero"; | ||
@@ -850,3 +671,3 @@ }, | ||
code: 12; | ||
name: "InvalidInstruction"; | ||
name: "invalidInstruction"; | ||
msg: "Invalid instruction"; | ||
@@ -856,3 +677,3 @@ }, | ||
code: 13; | ||
name: "InvalidState"; | ||
name: "invalidState"; | ||
msg: "State is invalid for requested operation"; | ||
@@ -862,3 +683,3 @@ }, | ||
code: 14; | ||
name: "Overflow"; | ||
name: "overflow"; | ||
msg: "Operation overflowed"; | ||
@@ -868,3 +689,3 @@ }, | ||
code: 15; | ||
name: "AuthorityTypeNotSupported"; | ||
name: "authorityTypeNotSupported"; | ||
msg: "Account does not support specified authority type"; | ||
@@ -874,3 +695,3 @@ }, | ||
code: 16; | ||
name: "MintCannotFreeze"; | ||
name: "mintCannotFreeze"; | ||
msg: "This token mint cannot freeze accounts"; | ||
@@ -880,3 +701,3 @@ }, | ||
code: 17; | ||
name: "AccountFrozen"; | ||
name: "accountFrozen"; | ||
msg: "Account is frozen"; | ||
@@ -886,3 +707,3 @@ }, | ||
code: 18; | ||
name: "MintDecimalsMismatch"; | ||
name: "mintDecimalsMismatch"; | ||
msg: "The provided decimals value different from the Mint decimals"; | ||
@@ -892,8 +713,185 @@ }, | ||
code: 19; | ||
name: "NonNativeNotSupported"; | ||
name: "nonNativeNotSupported"; | ||
msg: "Instruction does not support non-native tokens"; | ||
} | ||
]; | ||
types: [ | ||
{ | ||
name: "accountState"; | ||
type: { | ||
kind: "enum"; | ||
variants: [ | ||
{ | ||
name: "uninitialized"; | ||
}, | ||
{ | ||
name: "initialized"; | ||
}, | ||
{ | ||
name: "frozen"; | ||
} | ||
]; | ||
}; | ||
}, | ||
{ | ||
name: "authorityType"; | ||
type: { | ||
kind: "enum"; | ||
variants: [ | ||
{ | ||
name: "mintTokens"; | ||
}, | ||
{ | ||
name: "freezeAccount"; | ||
}, | ||
{ | ||
name: "accountOwner"; | ||
}, | ||
{ | ||
name: "closeAccount"; | ||
} | ||
]; | ||
}; | ||
}, | ||
{ | ||
name: "mint"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "mintAuthority"; | ||
docs: [ | ||
"Optional authority used to mint new tokens. The mint authority may only be provided during", | ||
"mint creation. If no mint authority is present then the mint has a fixed supply and no", | ||
"further tokens may be minted." | ||
]; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
}, | ||
{ | ||
name: "supply"; | ||
docs: ["Total supply of tokens."]; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
docs: [ | ||
"Number of base 10 digits to the right of the decimal place." | ||
]; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "isInitialized"; | ||
docs: ["Is `true` if this structure has been initialized"]; | ||
type: "bool"; | ||
}, | ||
{ | ||
name: "freezeAuthority"; | ||
docs: ["Optional authority to freeze token accounts."]; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
} | ||
]; | ||
}; | ||
}, | ||
{ | ||
name: "multisig"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "m"; | ||
docs: ["Number of signers required"]; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "n"; | ||
docs: ["Number of valid signers"]; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "isInitialized"; | ||
docs: ["Is `true` if this structure has been initialized"]; | ||
type: "bool"; | ||
}, | ||
{ | ||
name: "signers"; | ||
docs: ["Signer public keys"]; | ||
type: { | ||
array: ["pubkey", 11]; | ||
}; | ||
} | ||
]; | ||
}; | ||
}, | ||
{ | ||
name: "account"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "mint"; | ||
docs: ["The mint associated with this account"]; | ||
type: "pubkey"; | ||
}, | ||
{ | ||
name: "owner"; | ||
docs: ["The owner of this account."]; | ||
type: "pubkey"; | ||
}, | ||
{ | ||
name: "amount"; | ||
docs: ["The amount of tokens this account holds."]; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "delegate"; | ||
docs: [ | ||
"If `delegate` is `Some` then `delegated_amount` represents", | ||
"the amount authorized by the delegate" | ||
]; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
}, | ||
{ | ||
name: "state"; | ||
docs: ["The account's state"]; | ||
type: { | ||
defined: { | ||
name: "accountState"; | ||
}; | ||
}; | ||
}, | ||
{ | ||
name: "isNative"; | ||
docs: [ | ||
"If is_native.is_some, this is a native token, and the value logs the rent-exempt reserve. An", | ||
"Account is required to be rent-exempt, so the value is used by the Processor to ensure that", | ||
"wrapped SOL accounts do not drop below this threshold." | ||
]; | ||
type: { | ||
coption: "u64"; | ||
}; | ||
}, | ||
{ | ||
name: "delegatedAmount"; | ||
docs: ["The amount delegated"]; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "closeAuthority"; | ||
docs: ["Optional authority to close the account."]; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
} | ||
]; | ||
}; | ||
} | ||
]; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=program.d.ts.map |
@@ -9,84 +9,77 @@ "use strict"; | ||
function splTokenProgram(params) { | ||
var _a; | ||
return new anchor_1.Program(IDL, (_a = params === null || params === void 0 ? void 0 : params.programId) !== null && _a !== void 0 ? _a : exports.SPL_TOKEN_PROGRAM_ID, params === null || params === void 0 ? void 0 : params.provider, new coder_1.SplTokenCoder(IDL)); | ||
return new anchor_1.Program((params === null || params === void 0 ? void 0 : params.programId) ? { ...IDL, address: params.programId.toString() } : IDL, params === null || params === void 0 ? void 0 : params.provider, new coder_1.SplTokenCoder(IDL)); | ||
} | ||
exports.splTokenProgram = splTokenProgram; | ||
const IDL = { | ||
version: "3.3.0", | ||
name: "spl_token", | ||
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", | ||
metadata: { | ||
name: "splToken", | ||
version: "3.3.0", | ||
spec: "0.1.0", | ||
}, | ||
instructions: [ | ||
{ | ||
name: "initializeMint", | ||
name: "amountToUiAmount", | ||
discriminator: [23], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "rent", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "mintAuthority", | ||
type: "publicKey", | ||
}, | ||
{ | ||
name: "freezeAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "initializeAccount", | ||
name: "approve", | ||
discriminator: [4], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "source", | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "delegate", | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: false, | ||
signer: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "rent", | ||
isMut: false, | ||
isSigner: false, | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "initializeMultisig", | ||
name: "approveChecked", | ||
discriminator: [13], | ||
accounts: [ | ||
{ | ||
name: "multisig", | ||
isMut: true, | ||
isSigner: false, | ||
name: "source", | ||
writable: true, | ||
}, | ||
{ | ||
name: "rent", | ||
isMut: false, | ||
isSigner: false, | ||
name: "mint", | ||
}, | ||
{ | ||
name: "delegate", | ||
}, | ||
{ | ||
name: "owner", | ||
signer: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "m", | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
@@ -97,18 +90,16 @@ }, | ||
{ | ||
name: "transfer", | ||
name: "burn", | ||
discriminator: [8], | ||
accounts: [ | ||
{ | ||
name: "source", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "destination", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mint", | ||
writable: true, | ||
}, | ||
{ | ||
name: "authority", | ||
isMut: false, | ||
isSigner: true, | ||
signer: true, | ||
}, | ||
@@ -124,18 +115,16 @@ ], | ||
{ | ||
name: "approve", | ||
name: "burnChecked", | ||
discriminator: [15], | ||
accounts: [ | ||
{ | ||
name: "source", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "delegate", | ||
isMut: false, | ||
isSigner: false, | ||
name: "mint", | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
name: "authority", | ||
signer: true, | ||
}, | ||
@@ -148,16 +137,23 @@ ], | ||
}, | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "revoke", | ||
name: "closeAccount", | ||
discriminator: [9], | ||
accounts: [ | ||
{ | ||
name: "source", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "destination", | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
signer: true, | ||
}, | ||
@@ -168,78 +164,64 @@ ], | ||
{ | ||
name: "setAuthority", | ||
name: "freezeAccount", | ||
discriminator: [10], | ||
accounts: [ | ||
{ | ||
name: "owned", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
name: "mint", | ||
}, | ||
{ | ||
name: "signer", | ||
isMut: false, | ||
isSigner: true, | ||
name: "owner", | ||
signer: true, | ||
}, | ||
], | ||
args: [ | ||
args: [], | ||
}, | ||
{ | ||
name: "getAccountDataSize", | ||
discriminator: [21], | ||
accounts: [ | ||
{ | ||
name: "authorityType", | ||
type: { | ||
defined: "AuthorityType", | ||
}, | ||
name: "mint", | ||
}, | ||
{ | ||
name: "newAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "mintTo", | ||
name: "initializeAccount", | ||
discriminator: [1], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mint", | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "amount", | ||
type: "u64", | ||
name: "rent", | ||
address: "SysvarRent111111111111111111111111111111111", | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "burn", | ||
name: "initializeAccount2", | ||
discriminator: [16], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "authority", | ||
isMut: false, | ||
isSigner: true, | ||
name: "rent", | ||
address: "SysvarRent111111111111111111111111111111111", | ||
}, | ||
@@ -249,4 +231,4 @@ ], | ||
{ | ||
name: "amount", | ||
type: "u64", | ||
name: "owner", | ||
type: "pubkey", | ||
}, | ||
@@ -256,95 +238,103 @@ ], | ||
{ | ||
name: "closeAccount", | ||
name: "initializeAccount3", | ||
discriminator: [18], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "destination", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mint", | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
type: "pubkey", | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "freezeAccount", | ||
name: "initializeImmutableOwner", | ||
discriminator: [22], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "initializeMint", | ||
discriminator: [0], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
name: "rent", | ||
address: "SysvarRent111111111111111111111111111111111", | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "thawAccount", | ||
accounts: [ | ||
args: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "mintAuthority", | ||
type: "pubkey", | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
name: "freezeAuthority", | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "transferChecked", | ||
name: "initializeMint2", | ||
discriminator: [20], | ||
accounts: [ | ||
{ | ||
name: "source", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mint", | ||
writable: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "destination", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mintAuthority", | ||
type: "pubkey", | ||
}, | ||
{ | ||
name: "authority", | ||
isMut: false, | ||
isSigner: true, | ||
name: "freezeAuthority", | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
], | ||
args: [ | ||
}, | ||
{ | ||
name: "initializeMultisig", | ||
discriminator: [2], | ||
accounts: [ | ||
{ | ||
name: "amount", | ||
type: "u64", | ||
name: "multisig", | ||
writable: true, | ||
}, | ||
{ | ||
name: "decimals", | ||
name: "rent", | ||
address: "SysvarRent111111111111111111111111111111111", | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "m", | ||
type: "u8", | ||
@@ -355,32 +345,16 @@ }, | ||
{ | ||
name: "approveChecked", | ||
name: "initializeMultisig2", | ||
discriminator: [19], | ||
accounts: [ | ||
{ | ||
name: "source", | ||
isMut: true, | ||
isSigner: false, | ||
name: "multisig", | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "signer", | ||
}, | ||
{ | ||
name: "delegate", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "decimals", | ||
name: "m", | ||
type: "u8", | ||
@@ -391,18 +365,16 @@ }, | ||
{ | ||
name: "mintToChecked", | ||
name: "mintTo", | ||
discriminator: [7], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
signer: true, | ||
}, | ||
@@ -415,25 +387,19 @@ ], | ||
}, | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "burnChecked", | ||
name: "mintToChecked", | ||
discriminator: [14], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mint", | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "authority", | ||
isMut: false, | ||
isSigner: true, | ||
name: "owner", | ||
signer: true, | ||
}, | ||
@@ -453,25 +419,48 @@ ], | ||
{ | ||
name: "initializeAccount2", | ||
name: "revoke", | ||
discriminator: [5], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "source", | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "owner", | ||
signer: true, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "setAuthority", | ||
discriminator: [6], | ||
accounts: [ | ||
{ | ||
name: "rent", | ||
isMut: false, | ||
isSigner: false, | ||
name: "owned", | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
signer: true, | ||
}, | ||
{ | ||
name: "signer", | ||
signer: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "owner", | ||
type: "publicKey", | ||
name: "authorityType", | ||
type: { | ||
defined: { | ||
name: "authorityType", | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "newAuthority", | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
], | ||
@@ -481,7 +470,7 @@ }, | ||
name: "syncNative", | ||
discriminator: [17], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
@@ -492,40 +481,40 @@ ], | ||
{ | ||
name: "initializeAccount3", | ||
name: "thawAccount", | ||
discriminator: [11], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "owner", | ||
type: "publicKey", | ||
signer: true, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "initializeMultisig2", | ||
name: "transfer", | ||
discriminator: [3], | ||
accounts: [ | ||
{ | ||
name: "multisig", | ||
isMut: true, | ||
isSigner: false, | ||
name: "source", | ||
writable: true, | ||
}, | ||
{ | ||
name: "signer", | ||
isMut: false, | ||
isSigner: false, | ||
name: "destination", | ||
writable: true, | ||
}, | ||
{ | ||
name: "authority", | ||
signer: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "m", | ||
type: "u8", | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
@@ -535,56 +524,19 @@ ], | ||
{ | ||
name: "initializeMint2", | ||
name: "transferChecked", | ||
discriminator: [12], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
name: "source", | ||
writable: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "mintAuthority", | ||
type: "publicKey", | ||
}, | ||
{ | ||
name: "freezeAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "getAccountDataSize", | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "initializeImmutableOwner", | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "destination", | ||
writable: true, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "amountToUiAmount", | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "authority", | ||
signer: true, | ||
}, | ||
@@ -597,2 +549,6 @@ ], | ||
}, | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
], | ||
@@ -602,7 +558,6 @@ }, | ||
name: "uiAmountToAmount", | ||
discriminator: [24], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
@@ -613,5 +568,3 @@ ], | ||
name: "uiAmount", | ||
type: { | ||
defined: "&'astr", | ||
}, | ||
type: "string", | ||
}, | ||
@@ -624,145 +577,12 @@ ], | ||
name: "mint", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "mintAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
{ | ||
name: "supply", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "isInitialized", | ||
type: "bool", | ||
}, | ||
{ | ||
name: "freezeAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
], | ||
}, | ||
discriminator: [], | ||
}, | ||
{ | ||
name: "account", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "mint", | ||
type: "publicKey", | ||
}, | ||
{ | ||
name: "owner", | ||
type: "publicKey", | ||
}, | ||
{ | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "delegate", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
{ | ||
name: "state", | ||
type: { | ||
defined: "AccountState", | ||
}, | ||
}, | ||
{ | ||
name: "isNative", | ||
type: { | ||
defined: "COption<u64>", | ||
}, | ||
}, | ||
{ | ||
name: "delegatedAmount", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "closeAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "multisig", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "m", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "n", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "isInitialized", | ||
type: "bool", | ||
}, | ||
{ | ||
name: "signers", | ||
type: { | ||
array: ["publicKey", 11], | ||
}, | ||
}, | ||
], | ||
}, | ||
discriminator: [], | ||
}, | ||
], | ||
types: [ | ||
{ | ||
name: "AccountState", | ||
type: { | ||
kind: "enum", | ||
variants: [ | ||
{ | ||
name: "Uninitialized", | ||
}, | ||
{ | ||
name: "Initialized", | ||
}, | ||
{ | ||
name: "Frozen", | ||
}, | ||
], | ||
}, | ||
name: "account", | ||
discriminator: [], | ||
}, | ||
{ | ||
name: "AuthorityType", | ||
type: { | ||
kind: "enum", | ||
variants: [ | ||
{ | ||
name: "MintTokens", | ||
}, | ||
{ | ||
name: "FreezeAccount", | ||
}, | ||
{ | ||
name: "AccountOwner", | ||
}, | ||
{ | ||
name: "CloseAccount", | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
@@ -772,3 +592,3 @@ errors: [ | ||
code: 0, | ||
name: "NotRentExempt", | ||
name: "notRentExempt", | ||
msg: "Lamport balance below rent-exempt threshold", | ||
@@ -778,3 +598,3 @@ }, | ||
code: 1, | ||
name: "InsufficientFunds", | ||
name: "insufficientFunds", | ||
msg: "Insufficient funds", | ||
@@ -784,3 +604,3 @@ }, | ||
code: 2, | ||
name: "InvalidMint", | ||
name: "invalidMint", | ||
msg: "Invalid Mint", | ||
@@ -790,3 +610,3 @@ }, | ||
code: 3, | ||
name: "MintMismatch", | ||
name: "mintMismatch", | ||
msg: "Account not associated with this Mint", | ||
@@ -796,3 +616,3 @@ }, | ||
code: 4, | ||
name: "OwnerMismatch", | ||
name: "ownerMismatch", | ||
msg: "Owner does not match", | ||
@@ -802,3 +622,3 @@ }, | ||
code: 5, | ||
name: "FixedSupply", | ||
name: "fixedSupply", | ||
msg: "Fixed supply", | ||
@@ -808,3 +628,3 @@ }, | ||
code: 6, | ||
name: "AlreadyInUse", | ||
name: "alreadyInUse", | ||
msg: "Already in use", | ||
@@ -814,3 +634,3 @@ }, | ||
code: 7, | ||
name: "InvalidNumberOfProvidedSigners", | ||
name: "invalidNumberOfProvidedSigners", | ||
msg: "Invalid number of provided signers", | ||
@@ -820,3 +640,3 @@ }, | ||
code: 8, | ||
name: "InvalidNumberOfRequiredSigners", | ||
name: "invalidNumberOfRequiredSigners", | ||
msg: "Invalid number of required signers", | ||
@@ -826,3 +646,3 @@ }, | ||
code: 9, | ||
name: "UninitializedState", | ||
name: "uninitializedState", | ||
msg: "State is unititialized", | ||
@@ -832,3 +652,3 @@ }, | ||
code: 10, | ||
name: "NativeNotSupported", | ||
name: "nativeNotSupported", | ||
msg: "Instruction does not support native tokens", | ||
@@ -838,3 +658,3 @@ }, | ||
code: 11, | ||
name: "NonNativeHasBalance", | ||
name: "nonNativeHasBalance", | ||
msg: "Non-native account can only be closed if its balance is zero", | ||
@@ -844,3 +664,3 @@ }, | ||
code: 12, | ||
name: "InvalidInstruction", | ||
name: "invalidInstruction", | ||
msg: "Invalid instruction", | ||
@@ -850,3 +670,3 @@ }, | ||
code: 13, | ||
name: "InvalidState", | ||
name: "invalidState", | ||
msg: "State is invalid for requested operation", | ||
@@ -856,3 +676,3 @@ }, | ||
code: 14, | ||
name: "Overflow", | ||
name: "overflow", | ||
msg: "Operation overflowed", | ||
@@ -862,3 +682,3 @@ }, | ||
code: 15, | ||
name: "AuthorityTypeNotSupported", | ||
name: "authorityTypeNotSupported", | ||
msg: "Account does not support specified authority type", | ||
@@ -868,3 +688,3 @@ }, | ||
code: 16, | ||
name: "MintCannotFreeze", | ||
name: "mintCannotFreeze", | ||
msg: "This token mint cannot freeze accounts", | ||
@@ -874,3 +694,3 @@ }, | ||
code: 17, | ||
name: "AccountFrozen", | ||
name: "accountFrozen", | ||
msg: "Account is frozen", | ||
@@ -880,3 +700,3 @@ }, | ||
code: 18, | ||
name: "MintDecimalsMismatch", | ||
name: "mintDecimalsMismatch", | ||
msg: "The provided decimals value different from the Mint decimals", | ||
@@ -886,7 +706,184 @@ }, | ||
code: 19, | ||
name: "NonNativeNotSupported", | ||
name: "nonNativeNotSupported", | ||
msg: "Instruction does not support non-native tokens", | ||
}, | ||
], | ||
types: [ | ||
{ | ||
name: "accountState", | ||
type: { | ||
kind: "enum", | ||
variants: [ | ||
{ | ||
name: "uninitialized", | ||
}, | ||
{ | ||
name: "initialized", | ||
}, | ||
{ | ||
name: "frozen", | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "authorityType", | ||
type: { | ||
kind: "enum", | ||
variants: [ | ||
{ | ||
name: "mintTokens", | ||
}, | ||
{ | ||
name: "freezeAccount", | ||
}, | ||
{ | ||
name: "accountOwner", | ||
}, | ||
{ | ||
name: "closeAccount", | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "mint", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "mintAuthority", | ||
docs: [ | ||
"Optional authority used to mint new tokens. The mint authority may only be provided during", | ||
"mint creation. If no mint authority is present then the mint has a fixed supply and no", | ||
"further tokens may be minted.", | ||
], | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
{ | ||
name: "supply", | ||
docs: ["Total supply of tokens."], | ||
type: "u64", | ||
}, | ||
{ | ||
name: "decimals", | ||
docs: [ | ||
"Number of base 10 digits to the right of the decimal place.", | ||
], | ||
type: "u8", | ||
}, | ||
{ | ||
name: "isInitialized", | ||
docs: ["Is `true` if this structure has been initialized"], | ||
type: "bool", | ||
}, | ||
{ | ||
name: "freezeAuthority", | ||
docs: ["Optional authority to freeze token accounts."], | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "multisig", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "m", | ||
docs: ["Number of signers required"], | ||
type: "u8", | ||
}, | ||
{ | ||
name: "n", | ||
docs: ["Number of valid signers"], | ||
type: "u8", | ||
}, | ||
{ | ||
name: "isInitialized", | ||
docs: ["Is `true` if this structure has been initialized"], | ||
type: "bool", | ||
}, | ||
{ | ||
name: "signers", | ||
docs: ["Signer public keys"], | ||
type: { | ||
array: ["pubkey", 11], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "account", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "mint", | ||
docs: ["The mint associated with this account"], | ||
type: "pubkey", | ||
}, | ||
{ | ||
name: "owner", | ||
docs: ["The owner of this account."], | ||
type: "pubkey", | ||
}, | ||
{ | ||
name: "amount", | ||
docs: ["The amount of tokens this account holds."], | ||
type: "u64", | ||
}, | ||
{ | ||
name: "delegate", | ||
docs: [ | ||
"If `delegate` is `Some` then `delegated_amount` represents", | ||
"the amount authorized by the delegate", | ||
], | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
{ | ||
name: "state", | ||
docs: ["The account's state"], | ||
type: { | ||
defined: { | ||
name: "accountState", | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "isNative", | ||
docs: [ | ||
"If is_native.is_some, this is a native token, and the value logs the rent-exempt reserve. An", | ||
"Account is required to be rent-exempt, so the value is used by the Processor to ensure that", | ||
"wrapped SOL accounts do not drop below this threshold.", | ||
], | ||
type: { | ||
coption: "u64", | ||
}, | ||
}, | ||
{ | ||
name: "delegatedAmount", | ||
docs: ["The amount delegated"], | ||
type: "u64", | ||
}, | ||
{ | ||
name: "closeAuthority", | ||
docs: ["Optional authority to close the account."], | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; | ||
//# sourceMappingURL=program.js.map |
/// <reference types="node" /> | ||
import { AccountsCoder, Idl } from "@coral-xyz/anchor"; | ||
import { IdlTypeDef } from "@coral-xyz/anchor/dist/cjs/idl"; | ||
export declare class SplTokenAccountsCoder<A extends string = string> implements AccountsCoder { | ||
@@ -14,4 +13,4 @@ constructor(_idl: Idl); | ||
}; | ||
size(idlAccount: IdlTypeDef): number; | ||
size(accountName: A): number; | ||
} | ||
//# sourceMappingURL=accounts.d.ts.map |
@@ -68,4 +68,4 @@ // @ts-nocheck | ||
} | ||
size(idlAccount) { | ||
switch (idlAccount.name) { | ||
size(accountName) { | ||
switch (accountName) { | ||
case "mint": { | ||
@@ -81,3 +81,3 @@ return 82; | ||
default: { | ||
throw new Error(`Invalid account name: ${idlAccount.name}`); | ||
throw new Error(`Invalid account name: ${accountName}`); | ||
} | ||
@@ -84,0 +84,0 @@ } |
@@ -10,17 +10,15 @@ import { PublicKey } from "@solana/web3.js"; | ||
declare type SplToken = { | ||
version: "3.3.0"; | ||
name: "spl_token"; | ||
address: string; | ||
metadata: { | ||
name: "splToken"; | ||
version: "3.3.0"; | ||
spec: "0.1.0"; | ||
}; | ||
instructions: [ | ||
{ | ||
name: "initializeMint"; | ||
name: "amountToUiAmount"; | ||
discriminator: [23]; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "rent"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
@@ -30,14 +28,4 @@ ]; | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "mintAuthority"; | ||
type: "publicKey"; | ||
}, | ||
{ | ||
name: "freezeAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
name: "amount"; | ||
type: "u64"; | ||
} | ||
@@ -47,39 +35,41 @@ ]; | ||
{ | ||
name: "initializeAccount"; | ||
name: "approve"; | ||
discriminator: [4]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "source"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "delegate"; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
signer: true; | ||
} | ||
]; | ||
args: [ | ||
{ | ||
name: "rent"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "amount"; | ||
type: "u64"; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "initializeMultisig"; | ||
name: "approveChecked"; | ||
discriminator: [13]; | ||
accounts: [ | ||
{ | ||
name: "multisig"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "source"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "rent"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "mint"; | ||
}, | ||
{ | ||
name: "delegate"; | ||
}, | ||
{ | ||
name: "owner"; | ||
signer: true; | ||
} | ||
@@ -89,3 +79,7 @@ ]; | ||
{ | ||
name: "m"; | ||
name: "amount"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
@@ -96,18 +90,16 @@ } | ||
{ | ||
name: "transfer"; | ||
name: "burn"; | ||
discriminator: [8]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "destination"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "mint"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "authority"; | ||
isMut: false; | ||
isSigner: true; | ||
signer: true; | ||
} | ||
@@ -123,18 +115,16 @@ ]; | ||
{ | ||
name: "approve"; | ||
name: "burnChecked"; | ||
discriminator: [15]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "delegate"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "mint"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "authority"; | ||
signer: true; | ||
} | ||
@@ -146,2 +136,6 @@ ]; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
} | ||
@@ -151,13 +145,16 @@ ]; | ||
{ | ||
name: "revoke"; | ||
name: "closeAccount"; | ||
discriminator: [9]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "destination"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
signer: true; | ||
} | ||
@@ -168,78 +165,64 @@ ]; | ||
{ | ||
name: "setAuthority"; | ||
name: "freezeAccount"; | ||
discriminator: [10]; | ||
accounts: [ | ||
{ | ||
name: "owned"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "mint"; | ||
}, | ||
{ | ||
name: "signer"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "owner"; | ||
signer: true; | ||
} | ||
]; | ||
args: [ | ||
args: []; | ||
}, | ||
{ | ||
name: "getAccountDataSize"; | ||
discriminator: [21]; | ||
accounts: [ | ||
{ | ||
name: "authorityType"; | ||
type: { | ||
defined: "AuthorityType"; | ||
}; | ||
}, | ||
{ | ||
name: "newAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
name: "mint"; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "mintTo"; | ||
name: "initializeAccount"; | ||
discriminator: [1]; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "mint"; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
} | ||
]; | ||
args: [ | ||
}, | ||
{ | ||
name: "amount"; | ||
type: "u64"; | ||
name: "rent"; | ||
address: "SysvarRent111111111111111111111111111111111"; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "burn"; | ||
name: "initializeAccount2"; | ||
discriminator: [16]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "authority"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "rent"; | ||
address: "SysvarRent111111111111111111111111111111111"; | ||
} | ||
@@ -249,4 +232,4 @@ ]; | ||
{ | ||
name: "amount"; | ||
type: "u64"; | ||
name: "owner"; | ||
type: "pubkey"; | ||
} | ||
@@ -256,39 +239,27 @@ ]; | ||
{ | ||
name: "closeAccount"; | ||
name: "initializeAccount3"; | ||
discriminator: [18]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
}, | ||
{ | ||
name: "destination"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
name: "mint"; | ||
} | ||
]; | ||
args: [ | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
type: "pubkey"; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "freezeAccount"; | ||
name: "initializeImmutableOwner"; | ||
discriminator: [22]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
writable: true; | ||
} | ||
@@ -299,44 +270,68 @@ ]; | ||
{ | ||
name: "thawAccount"; | ||
name: "initializeMint"; | ||
discriminator: [0]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "mint"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "rent"; | ||
address: "SysvarRent111111111111111111111111111111111"; | ||
} | ||
]; | ||
args: [ | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "mintAuthority"; | ||
type: "pubkey"; | ||
}, | ||
{ | ||
name: "freezeAuthority"; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "transferChecked"; | ||
name: "initializeMint2"; | ||
discriminator: [20]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "mint"; | ||
writable: true; | ||
} | ||
]; | ||
args: [ | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "mintAuthority"; | ||
type: "pubkey"; | ||
}, | ||
{ | ||
name: "destination"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "freezeAuthority"; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
} | ||
]; | ||
}, | ||
{ | ||
name: "initializeMultisig"; | ||
discriminator: [2]; | ||
accounts: [ | ||
{ | ||
name: "multisig"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "authority"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "rent"; | ||
address: "SysvarRent111111111111111111111111111111111"; | ||
} | ||
@@ -346,7 +341,3 @@ ]; | ||
{ | ||
name: "amount"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
name: "m"; | ||
type: "u8"; | ||
@@ -357,23 +348,11 @@ } | ||
{ | ||
name: "approveChecked"; | ||
name: "initializeMultisig2"; | ||
discriminator: [19]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "multisig"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "delegate"; | ||
isMut: false; | ||
isSigner: false; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "signer"; | ||
} | ||
@@ -383,7 +362,3 @@ ]; | ||
{ | ||
name: "amount"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
name: "m"; | ||
type: "u8"; | ||
@@ -394,18 +369,16 @@ } | ||
{ | ||
name: "mintToChecked"; | ||
name: "mintTo"; | ||
discriminator: [7]; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
}, | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
}, | ||
{ | ||
name: "owner"; | ||
isMut: false; | ||
isSigner: true; | ||
signer: true; | ||
} | ||
@@ -417,6 +390,2 @@ ]; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
} | ||
@@ -426,18 +395,16 @@ ]; | ||
{ | ||
name: "burnChecked"; | ||
name: "mintToChecked"; | ||
discriminator: [14]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "mint"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "account"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "authority"; | ||
isMut: false; | ||
isSigner: true; | ||
name: "owner"; | ||
signer: true; | ||
} | ||
@@ -457,18 +424,31 @@ ]; | ||
{ | ||
name: "initializeAccount2"; | ||
name: "revoke"; | ||
discriminator: [5]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "source"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "owner"; | ||
signer: true; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "setAuthority"; | ||
discriminator: [6]; | ||
accounts: [ | ||
{ | ||
name: "owned"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "rent"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "owner"; | ||
signer: true; | ||
}, | ||
{ | ||
name: "signer"; | ||
signer: true; | ||
} | ||
@@ -478,4 +458,14 @@ ]; | ||
{ | ||
name: "owner"; | ||
type: "publicKey"; | ||
name: "authorityType"; | ||
type: { | ||
defined: { | ||
name: "authorityType"; | ||
}; | ||
}; | ||
}, | ||
{ | ||
name: "newAuthority"; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
} | ||
@@ -486,7 +476,7 @@ ]; | ||
name: "syncNative"; | ||
discriminator: [17]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
} | ||
@@ -497,34 +487,34 @@ ]; | ||
{ | ||
name: "initializeAccount3"; | ||
name: "thawAccount"; | ||
discriminator: [11]; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
]; | ||
args: [ | ||
}, | ||
{ | ||
name: "owner"; | ||
type: "publicKey"; | ||
signer: true; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "initializeMultisig2"; | ||
name: "transfer"; | ||
discriminator: [3]; | ||
accounts: [ | ||
{ | ||
name: "multisig"; | ||
isMut: true; | ||
isSigner: false; | ||
name: "source"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "signer"; | ||
isMut: false; | ||
isSigner: false; | ||
name: "destination"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "authority"; | ||
signer: true; | ||
} | ||
@@ -534,4 +524,4 @@ ]; | ||
{ | ||
name: "m"; | ||
type: "u8"; | ||
name: "amount"; | ||
type: "u64"; | ||
} | ||
@@ -541,58 +531,21 @@ ]; | ||
{ | ||
name: "initializeMint2"; | ||
name: "transferChecked"; | ||
discriminator: [12]; | ||
accounts: [ | ||
{ | ||
name: "source"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "mint"; | ||
isMut: true; | ||
isSigner: false; | ||
} | ||
]; | ||
args: [ | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "mintAuthority"; | ||
type: "publicKey"; | ||
name: "destination"; | ||
writable: true; | ||
}, | ||
{ | ||
name: "freezeAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
name: "authority"; | ||
signer: true; | ||
} | ||
]; | ||
}, | ||
{ | ||
name: "getAccountDataSize"; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "initializeImmutableOwner"; | ||
accounts: [ | ||
{ | ||
name: "account"; | ||
isMut: true; | ||
isSigner: false; | ||
} | ||
]; | ||
args: []; | ||
}, | ||
{ | ||
name: "amountToUiAmount"; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
]; | ||
args: [ | ||
@@ -602,2 +555,6 @@ { | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
} | ||
@@ -608,7 +565,6 @@ ]; | ||
name: "uiAmountToAmount"; | ||
discriminator: [24]; | ||
accounts: [ | ||
{ | ||
name: "mint"; | ||
isMut: false; | ||
isSigner: false; | ||
} | ||
@@ -619,5 +575,3 @@ ]; | ||
name: "uiAmount"; | ||
type: { | ||
defined: "&'astr"; | ||
}; | ||
type: "string"; | ||
} | ||
@@ -630,144 +584,11 @@ ]; | ||
name: "mint"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "mintAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
}, | ||
{ | ||
name: "supply"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "isInitialized"; | ||
type: "bool"; | ||
}, | ||
{ | ||
name: "freezeAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
} | ||
]; | ||
}; | ||
discriminator: []; | ||
}, | ||
{ | ||
name: "account"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "mint"; | ||
type: "publicKey"; | ||
}, | ||
{ | ||
name: "owner"; | ||
type: "publicKey"; | ||
}, | ||
{ | ||
name: "amount"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "delegate"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
}, | ||
{ | ||
name: "state"; | ||
type: { | ||
defined: "AccountState"; | ||
}; | ||
}, | ||
{ | ||
name: "isNative"; | ||
type: { | ||
defined: "COption<u64>"; | ||
}; | ||
}, | ||
{ | ||
name: "delegatedAmount"; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "closeAuthority"; | ||
type: { | ||
defined: "COption<Pubkey>"; | ||
}; | ||
} | ||
]; | ||
}; | ||
}, | ||
{ | ||
name: "multisig"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "m"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "n"; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "isInitialized"; | ||
type: "bool"; | ||
}, | ||
{ | ||
name: "signers"; | ||
type: { | ||
array: ["publicKey", 11]; | ||
}; | ||
} | ||
]; | ||
}; | ||
} | ||
]; | ||
types: [ | ||
{ | ||
name: "AccountState"; | ||
type: { | ||
kind: "enum"; | ||
variants: [ | ||
{ | ||
name: "Uninitialized"; | ||
}, | ||
{ | ||
name: "Initialized"; | ||
}, | ||
{ | ||
name: "Frozen"; | ||
} | ||
]; | ||
}; | ||
discriminator: []; | ||
}, | ||
{ | ||
name: "AuthorityType"; | ||
type: { | ||
kind: "enum"; | ||
variants: [ | ||
{ | ||
name: "MintTokens"; | ||
}, | ||
{ | ||
name: "FreezeAccount"; | ||
}, | ||
{ | ||
name: "AccountOwner"; | ||
}, | ||
{ | ||
name: "CloseAccount"; | ||
} | ||
]; | ||
}; | ||
name: "account"; | ||
discriminator: []; | ||
} | ||
@@ -778,3 +599,3 @@ ]; | ||
code: 0; | ||
name: "NotRentExempt"; | ||
name: "notRentExempt"; | ||
msg: "Lamport balance below rent-exempt threshold"; | ||
@@ -784,3 +605,3 @@ }, | ||
code: 1; | ||
name: "InsufficientFunds"; | ||
name: "insufficientFunds"; | ||
msg: "Insufficient funds"; | ||
@@ -790,3 +611,3 @@ }, | ||
code: 2; | ||
name: "InvalidMint"; | ||
name: "invalidMint"; | ||
msg: "Invalid Mint"; | ||
@@ -796,3 +617,3 @@ }, | ||
code: 3; | ||
name: "MintMismatch"; | ||
name: "mintMismatch"; | ||
msg: "Account not associated with this Mint"; | ||
@@ -802,3 +623,3 @@ }, | ||
code: 4; | ||
name: "OwnerMismatch"; | ||
name: "ownerMismatch"; | ||
msg: "Owner does not match"; | ||
@@ -808,3 +629,3 @@ }, | ||
code: 5; | ||
name: "FixedSupply"; | ||
name: "fixedSupply"; | ||
msg: "Fixed supply"; | ||
@@ -814,3 +635,3 @@ }, | ||
code: 6; | ||
name: "AlreadyInUse"; | ||
name: "alreadyInUse"; | ||
msg: "Already in use"; | ||
@@ -820,3 +641,3 @@ }, | ||
code: 7; | ||
name: "InvalidNumberOfProvidedSigners"; | ||
name: "invalidNumberOfProvidedSigners"; | ||
msg: "Invalid number of provided signers"; | ||
@@ -826,3 +647,3 @@ }, | ||
code: 8; | ||
name: "InvalidNumberOfRequiredSigners"; | ||
name: "invalidNumberOfRequiredSigners"; | ||
msg: "Invalid number of required signers"; | ||
@@ -832,3 +653,3 @@ }, | ||
code: 9; | ||
name: "UninitializedState"; | ||
name: "uninitializedState"; | ||
msg: "State is unititialized"; | ||
@@ -838,3 +659,3 @@ }, | ||
code: 10; | ||
name: "NativeNotSupported"; | ||
name: "nativeNotSupported"; | ||
msg: "Instruction does not support native tokens"; | ||
@@ -844,3 +665,3 @@ }, | ||
code: 11; | ||
name: "NonNativeHasBalance"; | ||
name: "nonNativeHasBalance"; | ||
msg: "Non-native account can only be closed if its balance is zero"; | ||
@@ -850,3 +671,3 @@ }, | ||
code: 12; | ||
name: "InvalidInstruction"; | ||
name: "invalidInstruction"; | ||
msg: "Invalid instruction"; | ||
@@ -856,3 +677,3 @@ }, | ||
code: 13; | ||
name: "InvalidState"; | ||
name: "invalidState"; | ||
msg: "State is invalid for requested operation"; | ||
@@ -862,3 +683,3 @@ }, | ||
code: 14; | ||
name: "Overflow"; | ||
name: "overflow"; | ||
msg: "Operation overflowed"; | ||
@@ -868,3 +689,3 @@ }, | ||
code: 15; | ||
name: "AuthorityTypeNotSupported"; | ||
name: "authorityTypeNotSupported"; | ||
msg: "Account does not support specified authority type"; | ||
@@ -874,3 +695,3 @@ }, | ||
code: 16; | ||
name: "MintCannotFreeze"; | ||
name: "mintCannotFreeze"; | ||
msg: "This token mint cannot freeze accounts"; | ||
@@ -880,3 +701,3 @@ }, | ||
code: 17; | ||
name: "AccountFrozen"; | ||
name: "accountFrozen"; | ||
msg: "Account is frozen"; | ||
@@ -886,3 +707,3 @@ }, | ||
code: 18; | ||
name: "MintDecimalsMismatch"; | ||
name: "mintDecimalsMismatch"; | ||
msg: "The provided decimals value different from the Mint decimals"; | ||
@@ -892,8 +713,185 @@ }, | ||
code: 19; | ||
name: "NonNativeNotSupported"; | ||
name: "nonNativeNotSupported"; | ||
msg: "Instruction does not support non-native tokens"; | ||
} | ||
]; | ||
types: [ | ||
{ | ||
name: "accountState"; | ||
type: { | ||
kind: "enum"; | ||
variants: [ | ||
{ | ||
name: "uninitialized"; | ||
}, | ||
{ | ||
name: "initialized"; | ||
}, | ||
{ | ||
name: "frozen"; | ||
} | ||
]; | ||
}; | ||
}, | ||
{ | ||
name: "authorityType"; | ||
type: { | ||
kind: "enum"; | ||
variants: [ | ||
{ | ||
name: "mintTokens"; | ||
}, | ||
{ | ||
name: "freezeAccount"; | ||
}, | ||
{ | ||
name: "accountOwner"; | ||
}, | ||
{ | ||
name: "closeAccount"; | ||
} | ||
]; | ||
}; | ||
}, | ||
{ | ||
name: "mint"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "mintAuthority"; | ||
docs: [ | ||
"Optional authority used to mint new tokens. The mint authority may only be provided during", | ||
"mint creation. If no mint authority is present then the mint has a fixed supply and no", | ||
"further tokens may be minted." | ||
]; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
}, | ||
{ | ||
name: "supply"; | ||
docs: ["Total supply of tokens."]; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "decimals"; | ||
docs: [ | ||
"Number of base 10 digits to the right of the decimal place." | ||
]; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "isInitialized"; | ||
docs: ["Is `true` if this structure has been initialized"]; | ||
type: "bool"; | ||
}, | ||
{ | ||
name: "freezeAuthority"; | ||
docs: ["Optional authority to freeze token accounts."]; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
} | ||
]; | ||
}; | ||
}, | ||
{ | ||
name: "multisig"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "m"; | ||
docs: ["Number of signers required"]; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "n"; | ||
docs: ["Number of valid signers"]; | ||
type: "u8"; | ||
}, | ||
{ | ||
name: "isInitialized"; | ||
docs: ["Is `true` if this structure has been initialized"]; | ||
type: "bool"; | ||
}, | ||
{ | ||
name: "signers"; | ||
docs: ["Signer public keys"]; | ||
type: { | ||
array: ["pubkey", 11]; | ||
}; | ||
} | ||
]; | ||
}; | ||
}, | ||
{ | ||
name: "account"; | ||
type: { | ||
kind: "struct"; | ||
fields: [ | ||
{ | ||
name: "mint"; | ||
docs: ["The mint associated with this account"]; | ||
type: "pubkey"; | ||
}, | ||
{ | ||
name: "owner"; | ||
docs: ["The owner of this account."]; | ||
type: "pubkey"; | ||
}, | ||
{ | ||
name: "amount"; | ||
docs: ["The amount of tokens this account holds."]; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "delegate"; | ||
docs: [ | ||
"If `delegate` is `Some` then `delegated_amount` represents", | ||
"the amount authorized by the delegate" | ||
]; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
}, | ||
{ | ||
name: "state"; | ||
docs: ["The account's state"]; | ||
type: { | ||
defined: { | ||
name: "accountState"; | ||
}; | ||
}; | ||
}, | ||
{ | ||
name: "isNative"; | ||
docs: [ | ||
"If is_native.is_some, this is a native token, and the value logs the rent-exempt reserve. An", | ||
"Account is required to be rent-exempt, so the value is used by the Processor to ensure that", | ||
"wrapped SOL accounts do not drop below this threshold." | ||
]; | ||
type: { | ||
coption: "u64"; | ||
}; | ||
}, | ||
{ | ||
name: "delegatedAmount"; | ||
docs: ["The amount delegated"]; | ||
type: "u64"; | ||
}, | ||
{ | ||
name: "closeAuthority"; | ||
docs: ["Optional authority to close the account."]; | ||
type: { | ||
coption: "pubkey"; | ||
}; | ||
} | ||
]; | ||
}; | ||
} | ||
]; | ||
}; | ||
export {}; | ||
//# sourceMappingURL=program.d.ts.map |
@@ -6,83 +6,76 @@ import { PublicKey } from "@solana/web3.js"; | ||
export function splTokenProgram(params) { | ||
var _a; | ||
return new Program(IDL, (_a = params === null || params === void 0 ? void 0 : params.programId) !== null && _a !== void 0 ? _a : SPL_TOKEN_PROGRAM_ID, params === null || params === void 0 ? void 0 : params.provider, new SplTokenCoder(IDL)); | ||
return new Program((params === null || params === void 0 ? void 0 : params.programId) ? { ...IDL, address: params.programId.toString() } : IDL, params === null || params === void 0 ? void 0 : params.provider, new SplTokenCoder(IDL)); | ||
} | ||
const IDL = { | ||
version: "3.3.0", | ||
name: "spl_token", | ||
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA", | ||
metadata: { | ||
name: "splToken", | ||
version: "3.3.0", | ||
spec: "0.1.0", | ||
}, | ||
instructions: [ | ||
{ | ||
name: "initializeMint", | ||
name: "amountToUiAmount", | ||
discriminator: [23], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "rent", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "mintAuthority", | ||
type: "publicKey", | ||
}, | ||
{ | ||
name: "freezeAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "initializeAccount", | ||
name: "approve", | ||
discriminator: [4], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "source", | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "delegate", | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: false, | ||
signer: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "rent", | ||
isMut: false, | ||
isSigner: false, | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "initializeMultisig", | ||
name: "approveChecked", | ||
discriminator: [13], | ||
accounts: [ | ||
{ | ||
name: "multisig", | ||
isMut: true, | ||
isSigner: false, | ||
name: "source", | ||
writable: true, | ||
}, | ||
{ | ||
name: "rent", | ||
isMut: false, | ||
isSigner: false, | ||
name: "mint", | ||
}, | ||
{ | ||
name: "delegate", | ||
}, | ||
{ | ||
name: "owner", | ||
signer: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "m", | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
@@ -93,18 +86,16 @@ }, | ||
{ | ||
name: "transfer", | ||
name: "burn", | ||
discriminator: [8], | ||
accounts: [ | ||
{ | ||
name: "source", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "destination", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mint", | ||
writable: true, | ||
}, | ||
{ | ||
name: "authority", | ||
isMut: false, | ||
isSigner: true, | ||
signer: true, | ||
}, | ||
@@ -120,18 +111,16 @@ ], | ||
{ | ||
name: "approve", | ||
name: "burnChecked", | ||
discriminator: [15], | ||
accounts: [ | ||
{ | ||
name: "source", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "delegate", | ||
isMut: false, | ||
isSigner: false, | ||
name: "mint", | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
name: "authority", | ||
signer: true, | ||
}, | ||
@@ -144,16 +133,23 @@ ], | ||
}, | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "revoke", | ||
name: "closeAccount", | ||
discriminator: [9], | ||
accounts: [ | ||
{ | ||
name: "source", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "destination", | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
signer: true, | ||
}, | ||
@@ -164,78 +160,64 @@ ], | ||
{ | ||
name: "setAuthority", | ||
name: "freezeAccount", | ||
discriminator: [10], | ||
accounts: [ | ||
{ | ||
name: "owned", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
name: "mint", | ||
}, | ||
{ | ||
name: "signer", | ||
isMut: false, | ||
isSigner: true, | ||
name: "owner", | ||
signer: true, | ||
}, | ||
], | ||
args: [ | ||
args: [], | ||
}, | ||
{ | ||
name: "getAccountDataSize", | ||
discriminator: [21], | ||
accounts: [ | ||
{ | ||
name: "authorityType", | ||
type: { | ||
defined: "AuthorityType", | ||
}, | ||
name: "mint", | ||
}, | ||
{ | ||
name: "newAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "mintTo", | ||
name: "initializeAccount", | ||
discriminator: [1], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mint", | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "amount", | ||
type: "u64", | ||
name: "rent", | ||
address: "SysvarRent111111111111111111111111111111111", | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "burn", | ||
name: "initializeAccount2", | ||
discriminator: [16], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "authority", | ||
isMut: false, | ||
isSigner: true, | ||
name: "rent", | ||
address: "SysvarRent111111111111111111111111111111111", | ||
}, | ||
@@ -245,4 +227,4 @@ ], | ||
{ | ||
name: "amount", | ||
type: "u64", | ||
name: "owner", | ||
type: "pubkey", | ||
}, | ||
@@ -252,95 +234,103 @@ ], | ||
{ | ||
name: "closeAccount", | ||
name: "initializeAccount3", | ||
discriminator: [18], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "destination", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mint", | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
type: "pubkey", | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "freezeAccount", | ||
name: "initializeImmutableOwner", | ||
discriminator: [22], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "initializeMint", | ||
discriminator: [0], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
name: "rent", | ||
address: "SysvarRent111111111111111111111111111111111", | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "thawAccount", | ||
accounts: [ | ||
args: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "mintAuthority", | ||
type: "pubkey", | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
name: "freezeAuthority", | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "transferChecked", | ||
name: "initializeMint2", | ||
discriminator: [20], | ||
accounts: [ | ||
{ | ||
name: "source", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mint", | ||
writable: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "destination", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mintAuthority", | ||
type: "pubkey", | ||
}, | ||
{ | ||
name: "authority", | ||
isMut: false, | ||
isSigner: true, | ||
name: "freezeAuthority", | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
], | ||
args: [ | ||
}, | ||
{ | ||
name: "initializeMultisig", | ||
discriminator: [2], | ||
accounts: [ | ||
{ | ||
name: "amount", | ||
type: "u64", | ||
name: "multisig", | ||
writable: true, | ||
}, | ||
{ | ||
name: "decimals", | ||
name: "rent", | ||
address: "SysvarRent111111111111111111111111111111111", | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "m", | ||
type: "u8", | ||
@@ -351,32 +341,16 @@ }, | ||
{ | ||
name: "approveChecked", | ||
name: "initializeMultisig2", | ||
discriminator: [19], | ||
accounts: [ | ||
{ | ||
name: "source", | ||
isMut: true, | ||
isSigner: false, | ||
name: "multisig", | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "signer", | ||
}, | ||
{ | ||
name: "delegate", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "decimals", | ||
name: "m", | ||
type: "u8", | ||
@@ -387,18 +361,16 @@ }, | ||
{ | ||
name: "mintToChecked", | ||
name: "mintTo", | ||
discriminator: [7], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
isMut: false, | ||
isSigner: true, | ||
signer: true, | ||
}, | ||
@@ -411,25 +383,19 @@ ], | ||
}, | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "burnChecked", | ||
name: "mintToChecked", | ||
discriminator: [14], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "mint", | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
name: "account", | ||
writable: true, | ||
}, | ||
{ | ||
name: "authority", | ||
isMut: false, | ||
isSigner: true, | ||
name: "owner", | ||
signer: true, | ||
}, | ||
@@ -449,25 +415,48 @@ ], | ||
{ | ||
name: "initializeAccount2", | ||
name: "revoke", | ||
discriminator: [5], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "source", | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "owner", | ||
signer: true, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "setAuthority", | ||
discriminator: [6], | ||
accounts: [ | ||
{ | ||
name: "rent", | ||
isMut: false, | ||
isSigner: false, | ||
name: "owned", | ||
writable: true, | ||
}, | ||
{ | ||
name: "owner", | ||
signer: true, | ||
}, | ||
{ | ||
name: "signer", | ||
signer: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "owner", | ||
type: "publicKey", | ||
name: "authorityType", | ||
type: { | ||
defined: { | ||
name: "authorityType", | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "newAuthority", | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
], | ||
@@ -477,7 +466,7 @@ }, | ||
name: "syncNative", | ||
discriminator: [17], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
@@ -488,40 +477,40 @@ ], | ||
{ | ||
name: "initializeAccount3", | ||
name: "thawAccount", | ||
discriminator: [11], | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
writable: true, | ||
}, | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "owner", | ||
type: "publicKey", | ||
signer: true, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "initializeMultisig2", | ||
name: "transfer", | ||
discriminator: [3], | ||
accounts: [ | ||
{ | ||
name: "multisig", | ||
isMut: true, | ||
isSigner: false, | ||
name: "source", | ||
writable: true, | ||
}, | ||
{ | ||
name: "signer", | ||
isMut: false, | ||
isSigner: false, | ||
name: "destination", | ||
writable: true, | ||
}, | ||
{ | ||
name: "authority", | ||
signer: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "m", | ||
type: "u8", | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
@@ -531,56 +520,19 @@ ], | ||
{ | ||
name: "initializeMint2", | ||
name: "transferChecked", | ||
discriminator: [12], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: true, | ||
isSigner: false, | ||
name: "source", | ||
writable: true, | ||
}, | ||
], | ||
args: [ | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "mintAuthority", | ||
type: "publicKey", | ||
}, | ||
{ | ||
name: "freezeAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
], | ||
}, | ||
{ | ||
name: "getAccountDataSize", | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "initializeImmutableOwner", | ||
accounts: [ | ||
{ | ||
name: "account", | ||
isMut: true, | ||
isSigner: false, | ||
name: "destination", | ||
writable: true, | ||
}, | ||
], | ||
args: [], | ||
}, | ||
{ | ||
name: "amountToUiAmount", | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
name: "authority", | ||
signer: true, | ||
}, | ||
@@ -593,2 +545,6 @@ ], | ||
}, | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
], | ||
@@ -598,7 +554,6 @@ }, | ||
name: "uiAmountToAmount", | ||
discriminator: [24], | ||
accounts: [ | ||
{ | ||
name: "mint", | ||
isMut: false, | ||
isSigner: false, | ||
}, | ||
@@ -609,5 +564,3 @@ ], | ||
name: "uiAmount", | ||
type: { | ||
defined: "&'astr", | ||
}, | ||
type: "string", | ||
}, | ||
@@ -620,145 +573,12 @@ ], | ||
name: "mint", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "mintAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
{ | ||
name: "supply", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "decimals", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "isInitialized", | ||
type: "bool", | ||
}, | ||
{ | ||
name: "freezeAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
], | ||
}, | ||
discriminator: [], | ||
}, | ||
{ | ||
name: "account", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "mint", | ||
type: "publicKey", | ||
}, | ||
{ | ||
name: "owner", | ||
type: "publicKey", | ||
}, | ||
{ | ||
name: "amount", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "delegate", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
{ | ||
name: "state", | ||
type: { | ||
defined: "AccountState", | ||
}, | ||
}, | ||
{ | ||
name: "isNative", | ||
type: { | ||
defined: "COption<u64>", | ||
}, | ||
}, | ||
{ | ||
name: "delegatedAmount", | ||
type: "u64", | ||
}, | ||
{ | ||
name: "closeAuthority", | ||
type: { | ||
defined: "COption<Pubkey>", | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "multisig", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "m", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "n", | ||
type: "u8", | ||
}, | ||
{ | ||
name: "isInitialized", | ||
type: "bool", | ||
}, | ||
{ | ||
name: "signers", | ||
type: { | ||
array: ["publicKey", 11], | ||
}, | ||
}, | ||
], | ||
}, | ||
discriminator: [], | ||
}, | ||
], | ||
types: [ | ||
{ | ||
name: "AccountState", | ||
type: { | ||
kind: "enum", | ||
variants: [ | ||
{ | ||
name: "Uninitialized", | ||
}, | ||
{ | ||
name: "Initialized", | ||
}, | ||
{ | ||
name: "Frozen", | ||
}, | ||
], | ||
}, | ||
name: "account", | ||
discriminator: [], | ||
}, | ||
{ | ||
name: "AuthorityType", | ||
type: { | ||
kind: "enum", | ||
variants: [ | ||
{ | ||
name: "MintTokens", | ||
}, | ||
{ | ||
name: "FreezeAccount", | ||
}, | ||
{ | ||
name: "AccountOwner", | ||
}, | ||
{ | ||
name: "CloseAccount", | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
@@ -768,3 +588,3 @@ errors: [ | ||
code: 0, | ||
name: "NotRentExempt", | ||
name: "notRentExempt", | ||
msg: "Lamport balance below rent-exempt threshold", | ||
@@ -774,3 +594,3 @@ }, | ||
code: 1, | ||
name: "InsufficientFunds", | ||
name: "insufficientFunds", | ||
msg: "Insufficient funds", | ||
@@ -780,3 +600,3 @@ }, | ||
code: 2, | ||
name: "InvalidMint", | ||
name: "invalidMint", | ||
msg: "Invalid Mint", | ||
@@ -786,3 +606,3 @@ }, | ||
code: 3, | ||
name: "MintMismatch", | ||
name: "mintMismatch", | ||
msg: "Account not associated with this Mint", | ||
@@ -792,3 +612,3 @@ }, | ||
code: 4, | ||
name: "OwnerMismatch", | ||
name: "ownerMismatch", | ||
msg: "Owner does not match", | ||
@@ -798,3 +618,3 @@ }, | ||
code: 5, | ||
name: "FixedSupply", | ||
name: "fixedSupply", | ||
msg: "Fixed supply", | ||
@@ -804,3 +624,3 @@ }, | ||
code: 6, | ||
name: "AlreadyInUse", | ||
name: "alreadyInUse", | ||
msg: "Already in use", | ||
@@ -810,3 +630,3 @@ }, | ||
code: 7, | ||
name: "InvalidNumberOfProvidedSigners", | ||
name: "invalidNumberOfProvidedSigners", | ||
msg: "Invalid number of provided signers", | ||
@@ -816,3 +636,3 @@ }, | ||
code: 8, | ||
name: "InvalidNumberOfRequiredSigners", | ||
name: "invalidNumberOfRequiredSigners", | ||
msg: "Invalid number of required signers", | ||
@@ -822,3 +642,3 @@ }, | ||
code: 9, | ||
name: "UninitializedState", | ||
name: "uninitializedState", | ||
msg: "State is unititialized", | ||
@@ -828,3 +648,3 @@ }, | ||
code: 10, | ||
name: "NativeNotSupported", | ||
name: "nativeNotSupported", | ||
msg: "Instruction does not support native tokens", | ||
@@ -834,3 +654,3 @@ }, | ||
code: 11, | ||
name: "NonNativeHasBalance", | ||
name: "nonNativeHasBalance", | ||
msg: "Non-native account can only be closed if its balance is zero", | ||
@@ -840,3 +660,3 @@ }, | ||
code: 12, | ||
name: "InvalidInstruction", | ||
name: "invalidInstruction", | ||
msg: "Invalid instruction", | ||
@@ -846,3 +666,3 @@ }, | ||
code: 13, | ||
name: "InvalidState", | ||
name: "invalidState", | ||
msg: "State is invalid for requested operation", | ||
@@ -852,3 +672,3 @@ }, | ||
code: 14, | ||
name: "Overflow", | ||
name: "overflow", | ||
msg: "Operation overflowed", | ||
@@ -858,3 +678,3 @@ }, | ||
code: 15, | ||
name: "AuthorityTypeNotSupported", | ||
name: "authorityTypeNotSupported", | ||
msg: "Account does not support specified authority type", | ||
@@ -864,3 +684,3 @@ }, | ||
code: 16, | ||
name: "MintCannotFreeze", | ||
name: "mintCannotFreeze", | ||
msg: "This token mint cannot freeze accounts", | ||
@@ -870,3 +690,3 @@ }, | ||
code: 17, | ||
name: "AccountFrozen", | ||
name: "accountFrozen", | ||
msg: "Account is frozen", | ||
@@ -876,3 +696,3 @@ }, | ||
code: 18, | ||
name: "MintDecimalsMismatch", | ||
name: "mintDecimalsMismatch", | ||
msg: "The provided decimals value different from the Mint decimals", | ||
@@ -882,7 +702,184 @@ }, | ||
code: 19, | ||
name: "NonNativeNotSupported", | ||
name: "nonNativeNotSupported", | ||
msg: "Instruction does not support non-native tokens", | ||
}, | ||
], | ||
types: [ | ||
{ | ||
name: "accountState", | ||
type: { | ||
kind: "enum", | ||
variants: [ | ||
{ | ||
name: "uninitialized", | ||
}, | ||
{ | ||
name: "initialized", | ||
}, | ||
{ | ||
name: "frozen", | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "authorityType", | ||
type: { | ||
kind: "enum", | ||
variants: [ | ||
{ | ||
name: "mintTokens", | ||
}, | ||
{ | ||
name: "freezeAccount", | ||
}, | ||
{ | ||
name: "accountOwner", | ||
}, | ||
{ | ||
name: "closeAccount", | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "mint", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "mintAuthority", | ||
docs: [ | ||
"Optional authority used to mint new tokens. The mint authority may only be provided during", | ||
"mint creation. If no mint authority is present then the mint has a fixed supply and no", | ||
"further tokens may be minted.", | ||
], | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
{ | ||
name: "supply", | ||
docs: ["Total supply of tokens."], | ||
type: "u64", | ||
}, | ||
{ | ||
name: "decimals", | ||
docs: [ | ||
"Number of base 10 digits to the right of the decimal place.", | ||
], | ||
type: "u8", | ||
}, | ||
{ | ||
name: "isInitialized", | ||
docs: ["Is `true` if this structure has been initialized"], | ||
type: "bool", | ||
}, | ||
{ | ||
name: "freezeAuthority", | ||
docs: ["Optional authority to freeze token accounts."], | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "multisig", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "m", | ||
docs: ["Number of signers required"], | ||
type: "u8", | ||
}, | ||
{ | ||
name: "n", | ||
docs: ["Number of valid signers"], | ||
type: "u8", | ||
}, | ||
{ | ||
name: "isInitialized", | ||
docs: ["Is `true` if this structure has been initialized"], | ||
type: "bool", | ||
}, | ||
{ | ||
name: "signers", | ||
docs: ["Signer public keys"], | ||
type: { | ||
array: ["pubkey", 11], | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
{ | ||
name: "account", | ||
type: { | ||
kind: "struct", | ||
fields: [ | ||
{ | ||
name: "mint", | ||
docs: ["The mint associated with this account"], | ||
type: "pubkey", | ||
}, | ||
{ | ||
name: "owner", | ||
docs: ["The owner of this account."], | ||
type: "pubkey", | ||
}, | ||
{ | ||
name: "amount", | ||
docs: ["The amount of tokens this account holds."], | ||
type: "u64", | ||
}, | ||
{ | ||
name: "delegate", | ||
docs: [ | ||
"If `delegate` is `Some` then `delegated_amount` represents", | ||
"the amount authorized by the delegate", | ||
], | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
{ | ||
name: "state", | ||
docs: ["The account's state"], | ||
type: { | ||
defined: { | ||
name: "accountState", | ||
}, | ||
}, | ||
}, | ||
{ | ||
name: "isNative", | ||
docs: [ | ||
"If is_native.is_some, this is a native token, and the value logs the rent-exempt reserve. An", | ||
"Account is required to be rent-exempt, so the value is used by the Processor to ensure that", | ||
"wrapped SOL accounts do not drop below this threshold.", | ||
], | ||
type: { | ||
coption: "u64", | ||
}, | ||
}, | ||
{ | ||
name: "delegatedAmount", | ||
docs: ["The amount delegated"], | ||
type: "u64", | ||
}, | ||
{ | ||
name: "closeAuthority", | ||
docs: ["Optional authority to close the account."], | ||
type: { | ||
coption: "pubkey", | ||
}, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
}; | ||
//# sourceMappingURL=program.js.map |
{ | ||
"name": "@coral-xyz/spl-token", | ||
"description": "Anchor client for Solana Program Library Token", | ||
"version": "0.29.0", | ||
"version": "0.30.0", | ||
"author": "acheron <acheroncrypto@gmail.com>", | ||
@@ -30,3 +30,3 @@ "license": "Apache-2.0", | ||
"dependencies": { | ||
"@coral-xyz/anchor": "=0.29.0", | ||
"@coral-xyz/anchor": "=0.30.0", | ||
"@native-to-anchor/buffer-layout": "=0.1.0" | ||
@@ -33,0 +33,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
877685
5749
Updated@coral-xyz/anchor@=0.30.0