From fc441ce66562e089da118338205f6363043cd444 Mon Sep 17 00:00:00 2001 From: philippe-ftx <62417741+philippe-ftx@users.noreply.github.com> Date: Mon, 14 Sep 2020 17:45:46 +0200 Subject: [PATCH] Export initializeAccount, closeAccount and transfer account indexes (#18) Export initializeAccount, closeAccount and transfer account indexes --- src/token-instructions.js | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/src/token-instructions.js b/src/token-instructions.js index 04405ca..682093c 100644 --- a/src/token-instructions.js +++ b/src/token-instructions.js @@ -6,6 +6,21 @@ import { } from '@solana/web3.js'; import { publicKeyLayout } from './layout'; +// NOTE: Update these if the position of arguments for the initializeAccount instruction changes +export const INITIALIZE_ACCOUNT_ACCOUNT_INDEX = 0; +export const INITIALIZE_ACCOUNT_MINT_INDEX = 1; +export const INITIALIZE_ACCOUNT_OWNER_INDEX = 2; + +// NOTE: Update these if the position of arguments for the transfer instruction changes +export const TRANSFER_SOURCE_INDEX = 0; +export const TRANSFER_DESTINATION_INDEX = 1; +export const TRANSFER_OWNER_INDEX = 2; + +// NOTE: Update these if the position of arguments for the closeAccount instruction changes +export const CLOSE_ACCOUNT_SOURCE_INDEX = 0; +export const CLOSE_ACCOUNT_DESTINATION_INDEX = 1; +export const CLOSE_ACCOUNT_OWNER_INDEX = 2; + export const TOKEN_PROGRAM_ID = new PublicKey( 'TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA', );