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vC,GAAAovC,CAAA,CAAAC,CAAA,EACA,IAAAtrC,EAAAsrC,CAAA,IAAAA,EAAA,eACA,IAAAD,EACA,OAAA3d,EAAA,CAAA1tB,EAAA,QAEA,IAAA4f,EAAA8N,EAAA,CAAA1tB,EAAA,CAAAqrC,EAAA,CACA,IAAAzrB,EACA,uBAAA5f,EAAA,YAAAqrC,EAAA,GAEA,OAAAzrB,CAAA,CAsBA,eAAA1jB,GAAAoV,CAAA,CAAAosB,CAAA,CAAA6N,CAAA,CAAAC,CAAA,MACAC,EACAt3B,CACAo3B,CAAAA,GAAApsC,OAAAgE,SAAA,CAAA2L,cAAA,CAAAC,IAAA,CAAAw8B,EAAA,yBACAE,EAAAF,EACIp3B,EAAAq3B,GACJD,GAAApsC,OAAAgE,SAAA,CAAA2L,cAAA,CAAAC,IAAA,CAAAw8B,EAAA,eACAE,EAAAF,EACIp3B,EAAAq3B,GAEJr3B,EAAAo3B,EAEA,IAAAl3B,EAAAF,GAAA,CACAG,cAAAH,EAAAG,aAAA,CACAC,oBAAAJ,EAAAI,mBAAA,EAAAJ,EAAAK,UAAA,CACAxF,eAAAmF,EAAAnF,cAAA,EAEA/L,EAAA,MAAAqO,EAAAmsB,kBAAA,CAAAC,EAAArpB,GACAG,EAAAL,GAAAA,EAAAK,UAAA,CACAgiB,EAAAiV,EAAAn6B,EAAAqD,kBAAA,CAAA82B,EAAAj3B,GAAAlD,EAAAqD,kBAAA,CAAA1R,EAAAuR,EAAA,CACAJ,EAAA,OAAAoiB,CAAA,EAAAn2B,KAAA,CACA,GAAA+T,EAAA/R,GAAA,CACA,+BAAAY,EAAA,WAAAuM,KAAAC,SAAA,CAAA2E,GAAA,IAEA,OAAAnR,CAAA,CAKA,IAAAvK,GAAA,GAGA","sources":["webpack://_N_E/./node_modules/@metaplex-foundation/beet-solana/node_modules/@solana/web3.js/lib/index.browser.esm.js","webpack://_N_E/"],"sourcesContent":["import { Buffer } from 'buffer';\nimport { ed25519 } from '@noble/curves/ed25519';\nimport BN from 'bn.js';\nimport bs58 from 'bs58';\nimport { sha256 } from '@noble/hashes/sha256';\nimport { serialize, deserialize, deserializeUnchecked } from 'borsh';\nimport * as BufferLayout from '@solana/buffer-layout';\nimport { blob } from '@solana/buffer-layout';\nimport { toBigIntLE, toBufferLE } from 'bigint-buffer';\nimport { coerce, instance, string, tuple, literal, unknown, type, number, array, nullable, optional, boolean, record, union, create, any, assert as assert$1 } from 'superstruct';\nimport RpcClient from 'jayson/lib/client/browser';\nimport RpcWebSocketCommonClient from 'rpc-websockets/dist/lib/client';\nimport createRpc from 'rpc-websockets/dist/lib/client/websocket.browser';\nimport { keccak_256 } from '@noble/hashes/sha3';\nimport { secp256k1 } from '@noble/curves/secp256k1';\n\n/**\n * A 64 byte secret key, the first 32 bytes of which is the\n * private scalar and the last 32 bytes is the public key.\n * Read more: https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/\n */\n\n/**\n * Ed25519 Keypair\n */\n\nconst generatePrivateKey = ed25519.utils.randomPrivateKey;\nconst generateKeypair = () => {\n const privateScalar = ed25519.utils.randomPrivateKey();\n const publicKey = getPublicKey(privateScalar);\n const secretKey = new Uint8Array(64);\n secretKey.set(privateScalar);\n secretKey.set(publicKey, 32);\n return {\n publicKey,\n secretKey\n };\n};\nconst getPublicKey = ed25519.getPublicKey;\nfunction isOnCurve(publicKey) {\n try {\n ed25519.ExtendedPoint.fromHex(publicKey);\n return true;\n } catch {\n return false;\n }\n}\nconst sign = (message, secretKey) => ed25519.sign(message, secretKey.slice(0, 32));\nconst verify = ed25519.verify;\n\nconst toBuffer = arr => {\n if (Buffer.isBuffer(arr)) {\n return arr;\n } else if (arr instanceof Uint8Array) {\n return Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength);\n } else {\n return Buffer.from(arr);\n }\n};\n\n// Class wrapping a plain object\nclass Struct {\n constructor(properties) {\n Object.assign(this, properties);\n }\n encode() {\n return Buffer.from(serialize(SOLANA_SCHEMA, this));\n }\n static decode(data) {\n return deserialize(SOLANA_SCHEMA, this, data);\n }\n static decodeUnchecked(data) {\n return deserializeUnchecked(SOLANA_SCHEMA, this, data);\n }\n}\n\n// Class representing a Rust-compatible enum, since enums are only strings or\n// numbers in pure JS\nclass Enum extends Struct {\n constructor(properties) {\n super(properties);\n this.enum = '';\n if (Object.keys(properties).length !== 1) {\n throw new Error('Enum can only take single value');\n }\n Object.keys(properties).map(key => {\n this.enum = key;\n });\n }\n}\nconst SOLANA_SCHEMA = new Map();\n\nvar _class;\nlet _Symbol$toStringTag;\n\n/**\n * Maximum length of derived pubkey seed\n */\nconst MAX_SEED_LENGTH = 32;\n\n/**\n * Size of public key in bytes\n */\nconst PUBLIC_KEY_LENGTH = 32;\n\n/**\n * Value to be converted into public key\n */\n\n/**\n * JSON object representation of PublicKey class\n */\n\nfunction isPublicKeyData(value) {\n return value._bn !== undefined;\n}\n\n// local counter used by PublicKey.unique()\nlet uniquePublicKeyCounter = 1;\n\n/**\n * A public key\n */\n_Symbol$toStringTag = Symbol.toStringTag;\nclass PublicKey extends Struct {\n /**\n * Create a new PublicKey object\n * @param value ed25519 public key as buffer or base-58 encoded string\n */\n constructor(value) {\n super({});\n /** @internal */\n this._bn = void 0;\n if (isPublicKeyData(value)) {\n this._bn = value._bn;\n } else {\n if (typeof value === 'string') {\n // assume base 58 encoding by default\n const decoded = bs58.decode(value);\n if (decoded.length != PUBLIC_KEY_LENGTH) {\n throw new Error(`Invalid public key input`);\n }\n this._bn = new BN(decoded);\n } else {\n this._bn = new BN(value);\n }\n if (this._bn.byteLength() > PUBLIC_KEY_LENGTH) {\n throw new Error(`Invalid public key input`);\n }\n }\n }\n\n /**\n * Returns a unique PublicKey for tests and benchmarks using a counter\n */\n static unique() {\n const key = new PublicKey(uniquePublicKeyCounter);\n uniquePublicKeyCounter += 1;\n return new PublicKey(key.toBuffer());\n }\n\n /**\n * Default public key value. The base58-encoded string representation is all ones (as seen below)\n * The underlying BN number is 32 bytes that are all zeros\n */\n\n /**\n * Checks if two publicKeys are equal\n */\n equals(publicKey) {\n return this._bn.eq(publicKey._bn);\n }\n\n /**\n * Return the base-58 representation of the public key\n */\n toBase58() {\n return bs58.encode(this.toBytes());\n }\n toJSON() {\n return this.toBase58();\n }\n\n /**\n * Return the byte array representation of the public key in big endian\n */\n toBytes() {\n const buf = this.toBuffer();\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n /**\n * Return the Buffer representation of the public key in big endian\n */\n toBuffer() {\n const b = this._bn.toArrayLike(Buffer);\n if (b.length === PUBLIC_KEY_LENGTH) {\n return b;\n }\n const zeroPad = Buffer.alloc(32);\n b.copy(zeroPad, 32 - b.length);\n return zeroPad;\n }\n get [_Symbol$toStringTag]() {\n return `PublicKey(${this.toString()})`;\n }\n\n /**\n * Return the base-58 representation of the public key\n */\n toString() {\n return this.toBase58();\n }\n\n /**\n * Derive a public key from another key, a seed, and a program ID.\n * The program ID will also serve as the owner of the public key, giving\n * it permission to write data to the account.\n */\n /* eslint-disable require-await */\n static async createWithSeed(fromPublicKey, seed, programId) {\n const buffer = Buffer.concat([fromPublicKey.toBuffer(), Buffer.from(seed), programId.toBuffer()]);\n const publicKeyBytes = sha256(buffer);\n return new PublicKey(publicKeyBytes);\n }\n\n /**\n * Derive a program address from seeds and a program ID.\n */\n /* eslint-disable require-await */\n static createProgramAddressSync(seeds, programId) {\n let buffer = Buffer.alloc(0);\n seeds.forEach(function (seed) {\n if (seed.length > MAX_SEED_LENGTH) {\n throw new TypeError(`Max seed length exceeded`);\n }\n buffer = Buffer.concat([buffer, toBuffer(seed)]);\n });\n buffer = Buffer.concat([buffer, programId.toBuffer(), Buffer.from('ProgramDerivedAddress')]);\n const publicKeyBytes = sha256(buffer);\n if (isOnCurve(publicKeyBytes)) {\n throw new Error(`Invalid seeds, address must fall off the curve`);\n }\n return new PublicKey(publicKeyBytes);\n }\n\n /**\n * Async version of createProgramAddressSync\n * For backwards compatibility\n *\n * @deprecated Use {@link createProgramAddressSync} instead\n */\n /* eslint-disable require-await */\n static async createProgramAddress(seeds, programId) {\n return this.createProgramAddressSync(seeds, programId);\n }\n\n /**\n * Find a valid program address\n *\n * Valid program addresses must fall off the ed25519 curve. This function\n * iterates a nonce until it finds one that when combined with the seeds\n * results in a valid program address.\n */\n static findProgramAddressSync(seeds, programId) {\n let nonce = 255;\n let address;\n while (nonce != 0) {\n try {\n const seedsWithNonce = seeds.concat(Buffer.from([nonce]));\n address = this.createProgramAddressSync(seedsWithNonce, programId);\n } catch (err) {\n if (err instanceof TypeError) {\n throw err;\n }\n nonce--;\n continue;\n }\n return [address, nonce];\n }\n throw new Error(`Unable to find a viable program address nonce`);\n }\n\n /**\n * Async version of findProgramAddressSync\n * For backwards compatibility\n *\n * @deprecated Use {@link findProgramAddressSync} instead\n */\n static async findProgramAddress(seeds, programId) {\n return this.findProgramAddressSync(seeds, programId);\n }\n\n /**\n * Check that a pubkey is on the ed25519 curve.\n */\n static isOnCurve(pubkeyData) {\n const pubkey = new PublicKey(pubkeyData);\n return isOnCurve(pubkey.toBytes());\n }\n}\n_class = PublicKey;\nPublicKey.default = new _class('11111111111111111111111111111111');\nSOLANA_SCHEMA.set(PublicKey, {\n kind: 'struct',\n fields: [['_bn', 'u256']]\n});\n\n/**\n * An account key pair (public and secret keys).\n *\n * @deprecated since v1.10.0, please use {@link Keypair} instead.\n */\nclass Account {\n /**\n * Create a new Account object\n *\n * If the secretKey parameter is not provided a new key pair is randomly\n * created for the account\n *\n * @param secretKey Secret key for the account\n */\n constructor(secretKey) {\n /** @internal */\n this._publicKey = void 0;\n /** @internal */\n this._secretKey = void 0;\n if (secretKey) {\n const secretKeyBuffer = toBuffer(secretKey);\n if (secretKey.length !== 64) {\n throw new Error('bad secret key size');\n }\n this._publicKey = secretKeyBuffer.slice(32, 64);\n this._secretKey = secretKeyBuffer.slice(0, 32);\n } else {\n this._secretKey = toBuffer(generatePrivateKey());\n this._publicKey = toBuffer(getPublicKey(this._secretKey));\n }\n }\n\n /**\n * The public key for this account\n */\n get publicKey() {\n return new PublicKey(this._publicKey);\n }\n\n /**\n * The **unencrypted** secret key for this account. The first 32 bytes\n * is the private scalar and the last 32 bytes is the public key.\n * Read more: https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/\n */\n get secretKey() {\n return Buffer.concat([this._secretKey, this._publicKey], 64);\n }\n}\n\nconst BPF_LOADER_DEPRECATED_PROGRAM_ID = new PublicKey('BPFLoader1111111111111111111111111111111111');\n\n/**\n * Maximum over-the-wire size of a Transaction\n *\n * 1280 is IPv6 minimum MTU\n * 40 bytes is the size of the IPv6 header\n * 8 bytes is the size of the fragment header\n */\nconst PACKET_DATA_SIZE = 1280 - 40 - 8;\nconst VERSION_PREFIX_MASK = 0x7f;\nconst SIGNATURE_LENGTH_IN_BYTES = 64;\n\nclass TransactionExpiredBlockheightExceededError extends Error {\n constructor(signature) {\n super(`Signature ${signature} has expired: block height exceeded.`);\n this.signature = void 0;\n this.signature = signature;\n }\n}\nObject.defineProperty(TransactionExpiredBlockheightExceededError.prototype, 'name', {\n value: 'TransactionExpiredBlockheightExceededError'\n});\nclass TransactionExpiredTimeoutError extends Error {\n constructor(signature, timeoutSeconds) {\n super(`Transaction was not confirmed in ${timeoutSeconds.toFixed(2)} seconds. It is ` + 'unknown if it succeeded or failed. Check signature ' + `${signature} using the Solana Explorer or CLI tools.`);\n this.signature = void 0;\n this.signature = signature;\n }\n}\nObject.defineProperty(TransactionExpiredTimeoutError.prototype, 'name', {\n value: 'TransactionExpiredTimeoutError'\n});\nclass TransactionExpiredNonceInvalidError extends Error {\n constructor(signature) {\n super(`Signature ${signature} has expired: the nonce is no longer valid.`);\n this.signature = void 0;\n this.signature = signature;\n }\n}\nObject.defineProperty(TransactionExpiredNonceInvalidError.prototype, 'name', {\n value: 'TransactionExpiredNonceInvalidError'\n});\n\nclass MessageAccountKeys {\n constructor(staticAccountKeys, accountKeysFromLookups) {\n this.staticAccountKeys = void 0;\n this.accountKeysFromLookups = void 0;\n this.staticAccountKeys = staticAccountKeys;\n this.accountKeysFromLookups = accountKeysFromLookups;\n }\n keySegments() {\n const keySegments = [this.staticAccountKeys];\n if (this.accountKeysFromLookups) {\n keySegments.push(this.accountKeysFromLookups.writable);\n keySegments.push(this.accountKeysFromLookups.readonly);\n }\n return keySegments;\n }\n get(index) {\n for (const keySegment of this.keySegments()) {\n if (index < keySegment.length) {\n return keySegment[index];\n } else {\n index -= keySegment.length;\n }\n }\n return;\n }\n get length() {\n return this.keySegments().flat().length;\n }\n compileInstructions(instructions) {\n // Bail early if any account indexes would overflow a u8\n const U8_MAX = 255;\n if (this.length > U8_MAX + 1) {\n throw new Error('Account index overflow encountered during compilation');\n }\n const keyIndexMap = new Map();\n this.keySegments().flat().forEach((key, index) => {\n keyIndexMap.set(key.toBase58(), index);\n });\n const findKeyIndex = key => {\n const keyIndex = keyIndexMap.get(key.toBase58());\n if (keyIndex === undefined) throw new Error('Encountered an unknown instruction account key during compilation');\n return keyIndex;\n };\n return instructions.map(instruction => {\n return {\n programIdIndex: findKeyIndex(instruction.programId),\n accountKeyIndexes: instruction.keys.map(meta => findKeyIndex(meta.pubkey)),\n data: instruction.data\n };\n });\n }\n}\n\n/**\n * Layout for a public key\n */\nconst publicKey = (property = 'publicKey') => {\n return BufferLayout.blob(32, property);\n};\n\n/**\n * Layout for a signature\n */\nconst signature = (property = 'signature') => {\n return BufferLayout.blob(64, property);\n};\n/**\n * Layout for a Rust String type\n */\nconst rustString = (property = 'string') => {\n const rsl = BufferLayout.struct([BufferLayout.u32('length'), BufferLayout.u32('lengthPadding'), BufferLayout.blob(BufferLayout.offset(BufferLayout.u32(), -8), 'chars')], property);\n const _decode = rsl.decode.bind(rsl);\n const _encode = rsl.encode.bind(rsl);\n const rslShim = rsl;\n rslShim.decode = (b, offset) => {\n const data = _decode(b, offset);\n return data['chars'].toString();\n };\n rslShim.encode = (str, b, offset) => {\n const data = {\n chars: Buffer.from(str, 'utf8')\n };\n return _encode(data, b, offset);\n };\n rslShim.alloc = str => {\n return BufferLayout.u32().span + BufferLayout.u32().span + Buffer.from(str, 'utf8').length;\n };\n return rslShim;\n};\n\n/**\n * Layout for an Authorized object\n */\nconst authorized = (property = 'authorized') => {\n return BufferLayout.struct([publicKey('staker'), publicKey('withdrawer')], property);\n};\n\n/**\n * Layout for a Lockup object\n */\nconst lockup = (property = 'lockup') => {\n return BufferLayout.struct([BufferLayout.ns64('unixTimestamp'), BufferLayout.ns64('epoch'), publicKey('custodian')], property);\n};\n\n/**\n * Layout for a VoteInit object\n */\nconst voteInit = (property = 'voteInit') => {\n return BufferLayout.struct([publicKey('nodePubkey'), publicKey('authorizedVoter'), publicKey('authorizedWithdrawer'), BufferLayout.u8('commission')], property);\n};\n\n/**\n * Layout for a VoteAuthorizeWithSeedArgs object\n */\nconst voteAuthorizeWithSeedArgs = (property = 'voteAuthorizeWithSeedArgs') => {\n return BufferLayout.struct([BufferLayout.u32('voteAuthorizationType'), publicKey('currentAuthorityDerivedKeyOwnerPubkey'), rustString('currentAuthorityDerivedKeySeed'), publicKey('newAuthorized')], property);\n};\nfunction getAlloc(type, fields) {\n const getItemAlloc = item => {\n if (item.span >= 0) {\n return item.span;\n } else if (typeof item.alloc === 'function') {\n return item.alloc(fields[item.property]);\n } else if ('count' in item && 'elementLayout' in item) {\n const field = fields[item.property];\n if (Array.isArray(field)) {\n return field.length * getItemAlloc(item.elementLayout);\n }\n } else if ('fields' in item) {\n // This is a `Structure` whose size needs to be recursively measured.\n return getAlloc({\n layout: item\n }, fields[item.property]);\n }\n // Couldn't determine allocated size of layout\n return 0;\n };\n let alloc = 0;\n type.layout.fields.forEach(item => {\n alloc += getItemAlloc(item);\n });\n return alloc;\n}\n\nfunction decodeLength(bytes) {\n let len = 0;\n let size = 0;\n for (;;) {\n let elem = bytes.shift();\n len |= (elem & 0x7f) << size * 7;\n size += 1;\n if ((elem & 0x80) === 0) {\n break;\n }\n }\n return len;\n}\nfunction encodeLength(bytes, len) {\n let rem_len = len;\n for (;;) {\n let elem = rem_len & 0x7f;\n rem_len >>= 7;\n if (rem_len == 0) {\n bytes.push(elem);\n break;\n } else {\n elem |= 0x80;\n bytes.push(elem);\n }\n }\n}\n\nfunction assert (condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n\nclass CompiledKeys {\n constructor(payer, keyMetaMap) {\n this.payer = void 0;\n this.keyMetaMap = void 0;\n this.payer = payer;\n this.keyMetaMap = keyMetaMap;\n }\n static compile(instructions, payer) {\n const keyMetaMap = new Map();\n const getOrInsertDefault = pubkey => {\n const address = pubkey.toBase58();\n let keyMeta = keyMetaMap.get(address);\n if (keyMeta === undefined) {\n keyMeta = {\n isSigner: false,\n isWritable: false,\n isInvoked: false\n };\n keyMetaMap.set(address, keyMeta);\n }\n return keyMeta;\n };\n const payerKeyMeta = getOrInsertDefault(payer);\n payerKeyMeta.isSigner = true;\n payerKeyMeta.isWritable = true;\n for (const ix of instructions) {\n getOrInsertDefault(ix.programId).isInvoked = true;\n for (const accountMeta of ix.keys) {\n const keyMeta = getOrInsertDefault(accountMeta.pubkey);\n keyMeta.isSigner ||= accountMeta.isSigner;\n keyMeta.isWritable ||= accountMeta.isWritable;\n }\n }\n return new CompiledKeys(payer, keyMetaMap);\n }\n getMessageComponents() {\n const mapEntries = [...this.keyMetaMap.entries()];\n assert(mapEntries.length <= 256, 'Max static account keys length exceeded');\n const writableSigners = mapEntries.filter(([, meta]) => meta.isSigner && meta.isWritable);\n const readonlySigners = mapEntries.filter(([, meta]) => meta.isSigner && !meta.isWritable);\n const writableNonSigners = mapEntries.filter(([, meta]) => !meta.isSigner && meta.isWritable);\n const readonlyNonSigners = mapEntries.filter(([, meta]) => !meta.isSigner && !meta.isWritable);\n const header = {\n numRequiredSignatures: writableSigners.length + readonlySigners.length,\n numReadonlySignedAccounts: readonlySigners.length,\n numReadonlyUnsignedAccounts: readonlyNonSigners.length\n };\n\n // sanity checks\n {\n assert(writableSigners.length > 0, 'Expected at least one writable signer key');\n const [payerAddress] = writableSigners[0];\n assert(payerAddress === this.payer.toBase58(), 'Expected first writable signer key to be the fee payer');\n }\n const staticAccountKeys = [...writableSigners.map(([address]) => new PublicKey(address)), ...readonlySigners.map(([address]) => new PublicKey(address)), ...writableNonSigners.map(([address]) => new PublicKey(address)), ...readonlyNonSigners.map(([address]) => new PublicKey(address))];\n return [header, staticAccountKeys];\n }\n extractTableLookup(lookupTable) {\n const [writableIndexes, drainedWritableKeys] = this.drainKeysFoundInLookupTable(lookupTable.state.addresses, keyMeta => !keyMeta.isSigner && !keyMeta.isInvoked && keyMeta.isWritable);\n const [readonlyIndexes, drainedReadonlyKeys] = this.drainKeysFoundInLookupTable(lookupTable.state.addresses, keyMeta => !keyMeta.isSigner && !keyMeta.isInvoked && !keyMeta.isWritable);\n\n // Don't extract lookup if no keys were found\n if (writableIndexes.length === 0 && readonlyIndexes.length === 0) {\n return;\n }\n return [{\n accountKey: lookupTable.key,\n writableIndexes,\n readonlyIndexes\n }, {\n writable: drainedWritableKeys,\n readonly: drainedReadonlyKeys\n }];\n }\n\n /** @internal */\n drainKeysFoundInLookupTable(lookupTableEntries, keyMetaFilter) {\n const lookupTableIndexes = new Array();\n const drainedKeys = new Array();\n for (const [address, keyMeta] of this.keyMetaMap.entries()) {\n if (keyMetaFilter(keyMeta)) {\n const key = new PublicKey(address);\n const lookupTableIndex = lookupTableEntries.findIndex(entry => entry.equals(key));\n if (lookupTableIndex >= 0) {\n assert(lookupTableIndex < 256, 'Max lookup table index exceeded');\n lookupTableIndexes.push(lookupTableIndex);\n drainedKeys.push(key);\n this.keyMetaMap.delete(address);\n }\n }\n }\n return [lookupTableIndexes, drainedKeys];\n }\n}\n\n/**\n * An instruction to execute by a program\n *\n * @property {number} programIdIndex\n * @property {number[]} accounts\n * @property {string} data\n */\n\n/**\n * Message constructor arguments\n */\n\n/**\n * List of instructions to be processed atomically\n */\nclass Message {\n constructor(args) {\n this.header = void 0;\n this.accountKeys = void 0;\n this.recentBlockhash = void 0;\n this.instructions = void 0;\n this.indexToProgramIds = new Map();\n this.header = args.header;\n this.accountKeys = args.accountKeys.map(account => new PublicKey(account));\n this.recentBlockhash = args.recentBlockhash;\n this.instructions = args.instructions;\n this.instructions.forEach(ix => this.indexToProgramIds.set(ix.programIdIndex, this.accountKeys[ix.programIdIndex]));\n }\n get version() {\n return 'legacy';\n }\n get staticAccountKeys() {\n return this.accountKeys;\n }\n get compiledInstructions() {\n return this.instructions.map(ix => ({\n programIdIndex: ix.programIdIndex,\n accountKeyIndexes: ix.accounts,\n data: bs58.decode(ix.data)\n }));\n }\n get addressTableLookups() {\n return [];\n }\n getAccountKeys() {\n return new MessageAccountKeys(this.staticAccountKeys);\n }\n static compile(args) {\n const compiledKeys = CompiledKeys.compile(args.instructions, args.payerKey);\n const [header, staticAccountKeys] = compiledKeys.getMessageComponents();\n const accountKeys = new MessageAccountKeys(staticAccountKeys);\n const instructions = accountKeys.compileInstructions(args.instructions).map(ix => ({\n programIdIndex: ix.programIdIndex,\n accounts: ix.accountKeyIndexes,\n data: bs58.encode(ix.data)\n }));\n return new Message({\n header,\n accountKeys: staticAccountKeys,\n recentBlockhash: args.recentBlockhash,\n instructions\n });\n }\n isAccountSigner(index) {\n return index < this.header.numRequiredSignatures;\n }\n isAccountWritable(index) {\n const numSignedAccounts = this.header.numRequiredSignatures;\n if (index >= this.header.numRequiredSignatures) {\n const unsignedAccountIndex = index - numSignedAccounts;\n const numUnsignedAccounts = this.accountKeys.length - numSignedAccounts;\n const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;\n return unsignedAccountIndex < numWritableUnsignedAccounts;\n } else {\n const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;\n return index < numWritableSignedAccounts;\n }\n }\n isProgramId(index) {\n return this.indexToProgramIds.has(index);\n }\n programIds() {\n return [...this.indexToProgramIds.values()];\n }\n nonProgramIds() {\n return this.accountKeys.filter((_, index) => !this.isProgramId(index));\n }\n serialize() {\n const numKeys = this.accountKeys.length;\n let keyCount = [];\n encodeLength(keyCount, numKeys);\n const instructions = this.instructions.map(instruction => {\n const {\n accounts,\n programIdIndex\n } = instruction;\n const data = Array.from(bs58.decode(instruction.data));\n let keyIndicesCount = [];\n encodeLength(keyIndicesCount, accounts.length);\n let dataCount = [];\n encodeLength(dataCount, data.length);\n return {\n programIdIndex,\n keyIndicesCount: Buffer.from(keyIndicesCount),\n keyIndices: accounts,\n dataLength: Buffer.from(dataCount),\n data\n };\n });\n let instructionCount = [];\n encodeLength(instructionCount, instructions.length);\n let instructionBuffer = Buffer.alloc(PACKET_DATA_SIZE);\n Buffer.from(instructionCount).copy(instructionBuffer);\n let instructionBufferLength = instructionCount.length;\n instructions.forEach(instruction => {\n const instructionLayout = BufferLayout.struct([BufferLayout.u8('programIdIndex'), BufferLayout.blob(instruction.keyIndicesCount.length, 'keyIndicesCount'), BufferLayout.seq(BufferLayout.u8('keyIndex'), instruction.keyIndices.length, 'keyIndices'), BufferLayout.blob(instruction.dataLength.length, 'dataLength'), BufferLayout.seq(BufferLayout.u8('userdatum'), instruction.data.length, 'data')]);\n const length = instructionLayout.encode(instruction, instructionBuffer, instructionBufferLength);\n instructionBufferLength += length;\n });\n instructionBuffer = instructionBuffer.slice(0, instructionBufferLength);\n const signDataLayout = BufferLayout.struct([BufferLayout.blob(1, 'numRequiredSignatures'), BufferLayout.blob(1, 'numReadonlySignedAccounts'), BufferLayout.blob(1, 'numReadonlyUnsignedAccounts'), BufferLayout.blob(keyCount.length, 'keyCount'), BufferLayout.seq(publicKey('key'), numKeys, 'keys'), publicKey('recentBlockhash')]);\n const transaction = {\n numRequiredSignatures: Buffer.from([this.header.numRequiredSignatures]),\n numReadonlySignedAccounts: Buffer.from([this.header.numReadonlySignedAccounts]),\n numReadonlyUnsignedAccounts: Buffer.from([this.header.numReadonlyUnsignedAccounts]),\n keyCount: Buffer.from(keyCount),\n keys: this.accountKeys.map(key => toBuffer(key.toBytes())),\n recentBlockhash: bs58.decode(this.recentBlockhash)\n };\n let signData = Buffer.alloc(2048);\n const length = signDataLayout.encode(transaction, signData);\n instructionBuffer.copy(signData, length);\n return signData.slice(0, length + instructionBuffer.length);\n }\n\n /**\n * Decode a compiled message into a Message object.\n */\n static from(buffer) {\n // Slice up wire data\n let byteArray = [...buffer];\n const numRequiredSignatures = byteArray.shift();\n if (numRequiredSignatures !== (numRequiredSignatures & VERSION_PREFIX_MASK)) {\n throw new Error('Versioned messages must be deserialized with VersionedMessage.deserialize()');\n }\n const numReadonlySignedAccounts = byteArray.shift();\n const numReadonlyUnsignedAccounts = byteArray.shift();\n const accountCount = decodeLength(byteArray);\n let accountKeys = [];\n for (let i = 0; i < accountCount; i++) {\n const account = byteArray.slice(0, PUBLIC_KEY_LENGTH);\n byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);\n accountKeys.push(new PublicKey(Buffer.from(account)));\n }\n const recentBlockhash = byteArray.slice(0, PUBLIC_KEY_LENGTH);\n byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);\n const instructionCount = decodeLength(byteArray);\n let instructions = [];\n for (let i = 0; i < instructionCount; i++) {\n const programIdIndex = byteArray.shift();\n const accountCount = decodeLength(byteArray);\n const accounts = byteArray.slice(0, accountCount);\n byteArray = byteArray.slice(accountCount);\n const dataLength = decodeLength(byteArray);\n const dataSlice = byteArray.slice(0, dataLength);\n const data = bs58.encode(Buffer.from(dataSlice));\n byteArray = byteArray.slice(dataLength);\n instructions.push({\n programIdIndex,\n accounts,\n data\n });\n }\n const messageArgs = {\n header: {\n numRequiredSignatures,\n numReadonlySignedAccounts,\n numReadonlyUnsignedAccounts\n },\n recentBlockhash: bs58.encode(Buffer.from(recentBlockhash)),\n accountKeys,\n instructions\n };\n return new Message(messageArgs);\n }\n}\n\n/**\n * Message constructor arguments\n */\n\nclass MessageV0 {\n constructor(args) {\n this.header = void 0;\n this.staticAccountKeys = void 0;\n this.recentBlockhash = void 0;\n this.compiledInstructions = void 0;\n this.addressTableLookups = void 0;\n this.header = args.header;\n this.staticAccountKeys = args.staticAccountKeys;\n this.recentBlockhash = args.recentBlockhash;\n this.compiledInstructions = args.compiledInstructions;\n this.addressTableLookups = args.addressTableLookups;\n }\n get version() {\n return 0;\n }\n get numAccountKeysFromLookups() {\n let count = 0;\n for (const lookup of this.addressTableLookups) {\n count += lookup.readonlyIndexes.length + lookup.writableIndexes.length;\n }\n return count;\n }\n getAccountKeys(args) {\n let accountKeysFromLookups;\n if (args && 'accountKeysFromLookups' in args && args.accountKeysFromLookups) {\n if (this.numAccountKeysFromLookups != args.accountKeysFromLookups.writable.length + args.accountKeysFromLookups.readonly.length) {\n throw new Error('Failed to get account keys because of a mismatch in the number of account keys from lookups');\n }\n accountKeysFromLookups = args.accountKeysFromLookups;\n } else if (args && 'addressLookupTableAccounts' in args && args.addressLookupTableAccounts) {\n accountKeysFromLookups = this.resolveAddressTableLookups(args.addressLookupTableAccounts);\n } else if (this.addressTableLookups.length > 0) {\n throw new Error('Failed to get account keys because address table lookups were not resolved');\n }\n return new MessageAccountKeys(this.staticAccountKeys, accountKeysFromLookups);\n }\n isAccountSigner(index) {\n return index < this.header.numRequiredSignatures;\n }\n isAccountWritable(index) {\n const numSignedAccounts = this.header.numRequiredSignatures;\n const numStaticAccountKeys = this.staticAccountKeys.length;\n if (index >= numStaticAccountKeys) {\n const lookupAccountKeysIndex = index - numStaticAccountKeys;\n const numWritableLookupAccountKeys = this.addressTableLookups.reduce((count, lookup) => count + lookup.writableIndexes.length, 0);\n return lookupAccountKeysIndex < numWritableLookupAccountKeys;\n } else if (index >= this.header.numRequiredSignatures) {\n const unsignedAccountIndex = index - numSignedAccounts;\n const numUnsignedAccounts = numStaticAccountKeys - numSignedAccounts;\n const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;\n return unsignedAccountIndex < numWritableUnsignedAccounts;\n } else {\n const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;\n return index < numWritableSignedAccounts;\n }\n }\n resolveAddressTableLookups(addressLookupTableAccounts) {\n const accountKeysFromLookups = {\n writable: [],\n readonly: []\n };\n for (const tableLookup of this.addressTableLookups) {\n const tableAccount = addressLookupTableAccounts.find(account => account.key.equals(tableLookup.accountKey));\n if (!tableAccount) {\n throw new Error(`Failed to find address lookup table account for table key ${tableLookup.accountKey.toBase58()}`);\n }\n for (const index of tableLookup.writableIndexes) {\n if (index < tableAccount.state.addresses.length) {\n accountKeysFromLookups.writable.push(tableAccount.state.addresses[index]);\n } else {\n throw new Error(`Failed to find address for index ${index} in address lookup table ${tableLookup.accountKey.toBase58()}`);\n }\n }\n for (const index of tableLookup.readonlyIndexes) {\n if (index < tableAccount.state.addresses.length) {\n accountKeysFromLookups.readonly.push(tableAccount.state.addresses[index]);\n } else {\n throw new Error(`Failed to find address for index ${index} in address lookup table ${tableLookup.accountKey.toBase58()}`);\n }\n }\n }\n return accountKeysFromLookups;\n }\n static compile(args) {\n const compiledKeys = CompiledKeys.compile(args.instructions, args.payerKey);\n const addressTableLookups = new Array();\n const accountKeysFromLookups = {\n writable: new Array(),\n readonly: new Array()\n };\n const lookupTableAccounts = args.addressLookupTableAccounts || [];\n for (const lookupTable of lookupTableAccounts) {\n const extractResult = compiledKeys.extractTableLookup(lookupTable);\n if (extractResult !== undefined) {\n const [addressTableLookup, {\n writable,\n readonly\n }] = extractResult;\n addressTableLookups.push(addressTableLookup);\n accountKeysFromLookups.writable.push(...writable);\n accountKeysFromLookups.readonly.push(...readonly);\n }\n }\n const [header, staticAccountKeys] = compiledKeys.getMessageComponents();\n const accountKeys = new MessageAccountKeys(staticAccountKeys, accountKeysFromLookups);\n const compiledInstructions = accountKeys.compileInstructions(args.instructions);\n return new MessageV0({\n header,\n staticAccountKeys,\n recentBlockhash: args.recentBlockhash,\n compiledInstructions,\n addressTableLookups\n });\n }\n serialize() {\n const encodedStaticAccountKeysLength = Array();\n encodeLength(encodedStaticAccountKeysLength, this.staticAccountKeys.length);\n const serializedInstructions = this.serializeInstructions();\n const encodedInstructionsLength = Array();\n encodeLength(encodedInstructionsLength, this.compiledInstructions.length);\n const serializedAddressTableLookups = this.serializeAddressTableLookups();\n const encodedAddressTableLookupsLength = Array();\n encodeLength(encodedAddressTableLookupsLength, this.addressTableLookups.length);\n const messageLayout = BufferLayout.struct([BufferLayout.u8('prefix'), BufferLayout.struct([BufferLayout.u8('numRequiredSignatures'), BufferLayout.u8('numReadonlySignedAccounts'), BufferLayout.u8('numReadonlyUnsignedAccounts')], 'header'), BufferLayout.blob(encodedStaticAccountKeysLength.length, 'staticAccountKeysLength'), BufferLayout.seq(publicKey(), this.staticAccountKeys.length, 'staticAccountKeys'), publicKey('recentBlockhash'), BufferLayout.blob(encodedInstructionsLength.length, 'instructionsLength'), BufferLayout.blob(serializedInstructions.length, 'serializedInstructions'), BufferLayout.blob(encodedAddressTableLookupsLength.length, 'addressTableLookupsLength'), BufferLayout.blob(serializedAddressTableLookups.length, 'serializedAddressTableLookups')]);\n const serializedMessage = new Uint8Array(PACKET_DATA_SIZE);\n const MESSAGE_VERSION_0_PREFIX = 1 << 7;\n const serializedMessageLength = messageLayout.encode({\n prefix: MESSAGE_VERSION_0_PREFIX,\n header: this.header,\n staticAccountKeysLength: new Uint8Array(encodedStaticAccountKeysLength),\n staticAccountKeys: this.staticAccountKeys.map(key => key.toBytes()),\n recentBlockhash: bs58.decode(this.recentBlockhash),\n instructionsLength: new Uint8Array(encodedInstructionsLength),\n serializedInstructions,\n addressTableLookupsLength: new Uint8Array(encodedAddressTableLookupsLength),\n serializedAddressTableLookups\n }, serializedMessage);\n return serializedMessage.slice(0, serializedMessageLength);\n }\n serializeInstructions() {\n let serializedLength = 0;\n const serializedInstructions = new Uint8Array(PACKET_DATA_SIZE);\n for (const instruction of this.compiledInstructions) {\n const encodedAccountKeyIndexesLength = Array();\n encodeLength(encodedAccountKeyIndexesLength, instruction.accountKeyIndexes.length);\n const encodedDataLength = Array();\n encodeLength(encodedDataLength, instruction.data.length);\n const instructionLayout = BufferLayout.struct([BufferLayout.u8('programIdIndex'), BufferLayout.blob(encodedAccountKeyIndexesLength.length, 'encodedAccountKeyIndexesLength'), BufferLayout.seq(BufferLayout.u8(), instruction.accountKeyIndexes.length, 'accountKeyIndexes'), BufferLayout.blob(encodedDataLength.length, 'encodedDataLength'), BufferLayout.blob(instruction.data.length, 'data')]);\n serializedLength += instructionLayout.encode({\n programIdIndex: instruction.programIdIndex,\n encodedAccountKeyIndexesLength: new Uint8Array(encodedAccountKeyIndexesLength),\n accountKeyIndexes: instruction.accountKeyIndexes,\n encodedDataLength: new Uint8Array(encodedDataLength),\n data: instruction.data\n }, serializedInstructions, serializedLength);\n }\n return serializedInstructions.slice(0, serializedLength);\n }\n serializeAddressTableLookups() {\n let serializedLength = 0;\n const serializedAddressTableLookups = new Uint8Array(PACKET_DATA_SIZE);\n for (const lookup of this.addressTableLookups) {\n const encodedWritableIndexesLength = Array();\n encodeLength(encodedWritableIndexesLength, lookup.writableIndexes.length);\n const encodedReadonlyIndexesLength = Array();\n encodeLength(encodedReadonlyIndexesLength, lookup.readonlyIndexes.length);\n const addressTableLookupLayout = BufferLayout.struct([publicKey('accountKey'), BufferLayout.blob(encodedWritableIndexesLength.length, 'encodedWritableIndexesLength'), BufferLayout.seq(BufferLayout.u8(), lookup.writableIndexes.length, 'writableIndexes'), BufferLayout.blob(encodedReadonlyIndexesLength.length, 'encodedReadonlyIndexesLength'), BufferLayout.seq(BufferLayout.u8(), lookup.readonlyIndexes.length, 'readonlyIndexes')]);\n serializedLength += addressTableLookupLayout.encode({\n accountKey: lookup.accountKey.toBytes(),\n encodedWritableIndexesLength: new Uint8Array(encodedWritableIndexesLength),\n writableIndexes: lookup.writableIndexes,\n encodedReadonlyIndexesLength: new Uint8Array(encodedReadonlyIndexesLength),\n readonlyIndexes: lookup.readonlyIndexes\n }, serializedAddressTableLookups, serializedLength);\n }\n return serializedAddressTableLookups.slice(0, serializedLength);\n }\n static deserialize(serializedMessage) {\n let byteArray = [...serializedMessage];\n const prefix = byteArray.shift();\n const maskedPrefix = prefix & VERSION_PREFIX_MASK;\n assert(prefix !== maskedPrefix, `Expected versioned message but received legacy message`);\n const version = maskedPrefix;\n assert(version === 0, `Expected versioned message with version 0 but found version ${version}`);\n const header = {\n numRequiredSignatures: byteArray.shift(),\n numReadonlySignedAccounts: byteArray.shift(),\n numReadonlyUnsignedAccounts: byteArray.shift()\n };\n const staticAccountKeys = [];\n const staticAccountKeysLength = decodeLength(byteArray);\n for (let i = 0; i < staticAccountKeysLength; i++) {\n staticAccountKeys.push(new PublicKey(byteArray.splice(0, PUBLIC_KEY_LENGTH)));\n }\n const recentBlockhash = bs58.encode(byteArray.splice(0, PUBLIC_KEY_LENGTH));\n const instructionCount = decodeLength(byteArray);\n const compiledInstructions = [];\n for (let i = 0; i < instructionCount; i++) {\n const programIdIndex = byteArray.shift();\n const accountKeyIndexesLength = decodeLength(byteArray);\n const accountKeyIndexes = byteArray.splice(0, accountKeyIndexesLength);\n const dataLength = decodeLength(byteArray);\n const data = new Uint8Array(byteArray.splice(0, dataLength));\n compiledInstructions.push({\n programIdIndex,\n accountKeyIndexes,\n data\n });\n }\n const addressTableLookupsCount = decodeLength(byteArray);\n const addressTableLookups = [];\n for (let i = 0; i < addressTableLookupsCount; i++) {\n const accountKey = new PublicKey(byteArray.splice(0, PUBLIC_KEY_LENGTH));\n const writableIndexesLength = decodeLength(byteArray);\n const writableIndexes = byteArray.splice(0, writableIndexesLength);\n const readonlyIndexesLength = decodeLength(byteArray);\n const readonlyIndexes = byteArray.splice(0, readonlyIndexesLength);\n addressTableLookups.push({\n accountKey,\n writableIndexes,\n readonlyIndexes\n });\n }\n return new MessageV0({\n header,\n staticAccountKeys,\n recentBlockhash,\n compiledInstructions,\n addressTableLookups\n });\n }\n}\n\n// eslint-disable-next-line no-redeclare\nconst VersionedMessage = {\n deserializeMessageVersion(serializedMessage) {\n const prefix = serializedMessage[0];\n const maskedPrefix = prefix & VERSION_PREFIX_MASK;\n\n // if the highest bit of the prefix is not set, the message is not versioned\n if (maskedPrefix === prefix) {\n return 'legacy';\n }\n\n // the lower 7 bits of the prefix indicate the message version\n return maskedPrefix;\n },\n deserialize: serializedMessage => {\n const version = VersionedMessage.deserializeMessageVersion(serializedMessage);\n if (version === 'legacy') {\n return Message.from(serializedMessage);\n }\n if (version === 0) {\n return MessageV0.deserialize(serializedMessage);\n } else {\n throw new Error(`Transaction message version ${version} deserialization is not supported`);\n }\n }\n};\n\n/** @internal */\n\n/**\n * Transaction signature as base-58 encoded string\n */\n\nlet TransactionStatus = /*#__PURE__*/function (TransactionStatus) {\n TransactionStatus[TransactionStatus[\"BLOCKHEIGHT_EXCEEDED\"] = 0] = \"BLOCKHEIGHT_EXCEEDED\";\n TransactionStatus[TransactionStatus[\"PROCESSED\"] = 1] = \"PROCESSED\";\n TransactionStatus[TransactionStatus[\"TIMED_OUT\"] = 2] = \"TIMED_OUT\";\n TransactionStatus[TransactionStatus[\"NONCE_INVALID\"] = 3] = \"NONCE_INVALID\";\n return TransactionStatus;\n}({});\n\n/**\n * Default (empty) signature\n */\nconst DEFAULT_SIGNATURE = Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);\n\n/**\n * Account metadata used to define instructions\n */\n\n/**\n * List of TransactionInstruction object fields that may be initialized at construction\n */\n\n/**\n * Configuration object for Transaction.serialize()\n */\n\n/**\n * @internal\n */\n\n/**\n * Transaction Instruction class\n */\nclass TransactionInstruction {\n constructor(opts) {\n /**\n * Public keys to include in this transaction\n * Boolean represents whether this pubkey needs to sign the transaction\n */\n this.keys = void 0;\n /**\n * Program Id to execute\n */\n this.programId = void 0;\n /**\n * Program input\n */\n this.data = Buffer.alloc(0);\n this.programId = opts.programId;\n this.keys = opts.keys;\n if (opts.data) {\n this.data = opts.data;\n }\n }\n\n /**\n * @internal\n */\n toJSON() {\n return {\n keys: this.keys.map(({\n pubkey,\n isSigner,\n isWritable\n }) => ({\n pubkey: pubkey.toJSON(),\n isSigner,\n isWritable\n })),\n programId: this.programId.toJSON(),\n data: [...this.data]\n };\n }\n}\n\n/**\n * Pair of signature and corresponding public key\n */\n\n/**\n * List of Transaction object fields that may be initialized at construction\n */\n\n// For backward compatibility; an unfortunate consequence of being\n// forced to over-export types by the documentation generator.\n// See https://github.com/solana-labs/solana/pull/25820\n\n/**\n * Blockhash-based transactions have a lifetime that are defined by\n * the blockhash they include. Any transaction whose blockhash is\n * too old will be rejected.\n */\n\n/**\n * Use these options to construct a durable nonce transaction.\n */\n\n/**\n * Nonce information to be used to build an offline Transaction.\n */\n\n/**\n * @internal\n */\n\n/**\n * Transaction class\n */\nclass Transaction {\n /**\n * The first (payer) Transaction signature\n *\n * @returns {Buffer | null} Buffer of payer's signature\n */\n get signature() {\n if (this.signatures.length > 0) {\n return this.signatures[0].signature;\n }\n return null;\n }\n\n /**\n * The transaction fee payer\n */\n\n // Construct a transaction with a blockhash and lastValidBlockHeight\n\n // Construct a transaction using a durable nonce\n\n /**\n * @deprecated `TransactionCtorFields` has been deprecated and will be removed in a future version.\n * Please supply a `TransactionBlockhashCtor` instead.\n */\n\n /**\n * Construct an empty Transaction\n */\n constructor(opts) {\n /**\n * Signatures for the transaction. Typically created by invoking the\n * `sign()` method\n */\n this.signatures = [];\n this.feePayer = void 0;\n /**\n * The instructions to atomically execute\n */\n this.instructions = [];\n /**\n * A recent transaction id. Must be populated by the caller\n */\n this.recentBlockhash = void 0;\n /**\n * the last block chain can advance to before tx is declared expired\n * */\n this.lastValidBlockHeight = void 0;\n /**\n * Optional Nonce information. If populated, transaction will use a durable\n * Nonce hash instead of a recentBlockhash. Must be populated by the caller\n */\n this.nonceInfo = void 0;\n /**\n * If this is a nonce transaction this represents the minimum slot from which\n * to evaluate if the nonce has advanced when attempting to confirm the\n * transaction. This protects against a case where the transaction confirmation\n * logic loads the nonce account from an old slot and assumes the mismatch in\n * nonce value implies that the nonce has been advanced.\n */\n this.minNonceContextSlot = void 0;\n /**\n * @internal\n */\n this._message = void 0;\n /**\n * @internal\n */\n this._json = void 0;\n if (!opts) {\n return;\n }\n if (opts.feePayer) {\n this.feePayer = opts.feePayer;\n }\n if (opts.signatures) {\n this.signatures = opts.signatures;\n }\n if (Object.prototype.hasOwnProperty.call(opts, 'nonceInfo')) {\n const {\n minContextSlot,\n nonceInfo\n } = opts;\n this.minNonceContextSlot = minContextSlot;\n this.nonceInfo = nonceInfo;\n } else if (Object.prototype.hasOwnProperty.call(opts, 'lastValidBlockHeight')) {\n const {\n blockhash,\n lastValidBlockHeight\n } = opts;\n this.recentBlockhash = blockhash;\n this.lastValidBlockHeight = lastValidBlockHeight;\n } else {\n const {\n recentBlockhash,\n nonceInfo\n } = opts;\n if (nonceInfo) {\n this.nonceInfo = nonceInfo;\n }\n this.recentBlockhash = recentBlockhash;\n }\n }\n\n /**\n * @internal\n */\n toJSON() {\n return {\n recentBlockhash: this.recentBlockhash || null,\n feePayer: this.feePayer ? this.feePayer.toJSON() : null,\n nonceInfo: this.nonceInfo ? {\n nonce: this.nonceInfo.nonce,\n nonceInstruction: this.nonceInfo.nonceInstruction.toJSON()\n } : null,\n instructions: this.instructions.map(instruction => instruction.toJSON()),\n signers: this.signatures.map(({\n publicKey\n }) => {\n return publicKey.toJSON();\n })\n };\n }\n\n /**\n * Add one or more instructions to this Transaction\n *\n * @param {Array< Transaction | TransactionInstruction | TransactionInstructionCtorFields >} items - Instructions to add to the Transaction\n */\n add(...items) {\n if (items.length === 0) {\n throw new Error('No instructions');\n }\n items.forEach(item => {\n if ('instructions' in item) {\n this.instructions = this.instructions.concat(item.instructions);\n } else if ('data' in item && 'programId' in item && 'keys' in item) {\n this.instructions.push(item);\n } else {\n this.instructions.push(new TransactionInstruction(item));\n }\n });\n return this;\n }\n\n /**\n * Compile transaction data\n */\n compileMessage() {\n if (this._message && JSON.stringify(this.toJSON()) === JSON.stringify(this._json)) {\n return this._message;\n }\n let recentBlockhash;\n let instructions;\n if (this.nonceInfo) {\n recentBlockhash = this.nonceInfo.nonce;\n if (this.instructions[0] != this.nonceInfo.nonceInstruction) {\n instructions = [this.nonceInfo.nonceInstruction, ...this.instructions];\n } else {\n instructions = this.instructions;\n }\n } else {\n recentBlockhash = this.recentBlockhash;\n instructions = this.instructions;\n }\n if (!recentBlockhash) {\n throw new Error('Transaction recentBlockhash required');\n }\n if (instructions.length < 1) {\n console.warn('No instructions provided');\n }\n let feePayer;\n if (this.feePayer) {\n feePayer = this.feePayer;\n } else if (this.signatures.length > 0 && this.signatures[0].publicKey) {\n // Use implicit fee payer\n feePayer = this.signatures[0].publicKey;\n } else {\n throw new Error('Transaction fee payer required');\n }\n for (let i = 0; i < instructions.length; i++) {\n if (instructions[i].programId === undefined) {\n throw new Error(`Transaction instruction index ${i} has undefined program id`);\n }\n }\n const programIds = [];\n const accountMetas = [];\n instructions.forEach(instruction => {\n instruction.keys.forEach(accountMeta => {\n accountMetas.push({\n ...accountMeta\n });\n });\n const programId = instruction.programId.toString();\n if (!programIds.includes(programId)) {\n programIds.push(programId);\n }\n });\n\n // Append programID account metas\n programIds.forEach(programId => {\n accountMetas.push({\n pubkey: new PublicKey(programId),\n isSigner: false,\n isWritable: false\n });\n });\n\n // Cull duplicate account metas\n const uniqueMetas = [];\n accountMetas.forEach(accountMeta => {\n const pubkeyString = accountMeta.pubkey.toString();\n const uniqueIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.toString() === pubkeyString;\n });\n if (uniqueIndex > -1) {\n uniqueMetas[uniqueIndex].isWritable = uniqueMetas[uniqueIndex].isWritable || accountMeta.isWritable;\n uniqueMetas[uniqueIndex].isSigner = uniqueMetas[uniqueIndex].isSigner || accountMeta.isSigner;\n } else {\n uniqueMetas.push(accountMeta);\n }\n });\n\n // Sort. Prioritizing first by signer, then by writable\n uniqueMetas.sort(function (x, y) {\n if (x.isSigner !== y.isSigner) {\n // Signers always come before non-signers\n return x.isSigner ? -1 : 1;\n }\n if (x.isWritable !== y.isWritable) {\n // Writable accounts always come before read-only accounts\n return x.isWritable ? -1 : 1;\n }\n // Otherwise, sort by pubkey, stringwise.\n const options = {\n localeMatcher: 'best fit',\n usage: 'sort',\n sensitivity: 'variant',\n ignorePunctuation: false,\n numeric: false,\n caseFirst: 'lower'\n };\n return x.pubkey.toBase58().localeCompare(y.pubkey.toBase58(), 'en', options);\n });\n\n // Move fee payer to the front\n const feePayerIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.equals(feePayer);\n });\n if (feePayerIndex > -1) {\n const [payerMeta] = uniqueMetas.splice(feePayerIndex, 1);\n payerMeta.isSigner = true;\n payerMeta.isWritable = true;\n uniqueMetas.unshift(payerMeta);\n } else {\n uniqueMetas.unshift({\n pubkey: feePayer,\n isSigner: true,\n isWritable: true\n });\n }\n\n // Disallow unknown signers\n for (const signature of this.signatures) {\n const uniqueIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.equals(signature.publicKey);\n });\n if (uniqueIndex > -1) {\n if (!uniqueMetas[uniqueIndex].isSigner) {\n uniqueMetas[uniqueIndex].isSigner = true;\n console.warn('Transaction references a signature that is unnecessary, ' + 'only the fee payer and instruction signer accounts should sign a transaction. ' + 'This behavior is deprecated and will throw an error in the next major version release.');\n }\n } else {\n throw new Error(`unknown signer: ${signature.publicKey.toString()}`);\n }\n }\n let numRequiredSignatures = 0;\n let numReadonlySignedAccounts = 0;\n let numReadonlyUnsignedAccounts = 0;\n\n // Split out signing from non-signing keys and count header values\n const signedKeys = [];\n const unsignedKeys = [];\n uniqueMetas.forEach(({\n pubkey,\n isSigner,\n isWritable\n }) => {\n if (isSigner) {\n signedKeys.push(pubkey.toString());\n numRequiredSignatures += 1;\n if (!isWritable) {\n numReadonlySignedAccounts += 1;\n }\n } else {\n unsignedKeys.push(pubkey.toString());\n if (!isWritable) {\n numReadonlyUnsignedAccounts += 1;\n }\n }\n });\n const accountKeys = signedKeys.concat(unsignedKeys);\n const compiledInstructions = instructions.map(instruction => {\n const {\n data,\n programId\n } = instruction;\n return {\n programIdIndex: accountKeys.indexOf(programId.toString()),\n accounts: instruction.keys.map(meta => accountKeys.indexOf(meta.pubkey.toString())),\n data: bs58.encode(data)\n };\n });\n compiledInstructions.forEach(instruction => {\n assert(instruction.programIdIndex >= 0);\n instruction.accounts.forEach(keyIndex => assert(keyIndex >= 0));\n });\n return new Message({\n header: {\n numRequiredSignatures,\n numReadonlySignedAccounts,\n numReadonlyUnsignedAccounts\n },\n accountKeys,\n recentBlockhash,\n instructions: compiledInstructions\n });\n }\n\n /**\n * @internal\n */\n _compile() {\n const message = this.compileMessage();\n const signedKeys = message.accountKeys.slice(0, message.header.numRequiredSignatures);\n if (this.signatures.length === signedKeys.length) {\n const valid = this.signatures.every((pair, index) => {\n return signedKeys[index].equals(pair.publicKey);\n });\n if (valid) return message;\n }\n this.signatures = signedKeys.map(publicKey => ({\n signature: null,\n publicKey\n }));\n return message;\n }\n\n /**\n * Get a buffer of the Transaction data that need to be covered by signatures\n */\n serializeMessage() {\n return this._compile().serialize();\n }\n\n /**\n * Get the estimated fee associated with a transaction\n *\n * @param {Connection} connection Connection to RPC Endpoint.\n *\n * @returns {Promise} The estimated fee for the transaction\n */\n async getEstimatedFee(connection) {\n return (await connection.getFeeForMessage(this.compileMessage())).value;\n }\n\n /**\n * Specify the public keys which will be used to sign the Transaction.\n * The first signer will be used as the transaction fee payer account.\n *\n * Signatures can be added with either `partialSign` or `addSignature`\n *\n * @deprecated Deprecated since v0.84.0. Only the fee payer needs to be\n * specified and it can be set in the Transaction constructor or with the\n * `feePayer` property.\n */\n setSigners(...signers) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n const seen = new Set();\n this.signatures = signers.filter(publicKey => {\n const key = publicKey.toString();\n if (seen.has(key)) {\n return false;\n } else {\n seen.add(key);\n return true;\n }\n }).map(publicKey => ({\n signature: null,\n publicKey\n }));\n }\n\n /**\n * Sign the Transaction with the specified signers. Multiple signatures may\n * be applied to a Transaction. The first signature is considered \"primary\"\n * and is used identify and confirm transactions.\n *\n * If the Transaction `feePayer` is not set, the first signer will be used\n * as the transaction fee payer account.\n *\n * Transaction fields should not be modified after the first call to `sign`,\n * as doing so may invalidate the signature and cause the Transaction to be\n * rejected.\n *\n * The Transaction must be assigned a valid `recentBlockhash` before invoking this method\n *\n * @param {Array} signers Array of signers that will sign the transaction\n */\n sign(...signers) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n\n // Dedupe signers\n const seen = new Set();\n const uniqueSigners = [];\n for (const signer of signers) {\n const key = signer.publicKey.toString();\n if (seen.has(key)) {\n continue;\n } else {\n seen.add(key);\n uniqueSigners.push(signer);\n }\n }\n this.signatures = uniqueSigners.map(signer => ({\n signature: null,\n publicKey: signer.publicKey\n }));\n const message = this._compile();\n this._partialSign(message, ...uniqueSigners);\n }\n\n /**\n * Partially sign a transaction with the specified accounts. All accounts must\n * correspond to either the fee payer or a signer account in the transaction\n * instructions.\n *\n * All the caveats from the `sign` method apply to `partialSign`\n *\n * @param {Array} signers Array of signers that will sign the transaction\n */\n partialSign(...signers) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n\n // Dedupe signers\n const seen = new Set();\n const uniqueSigners = [];\n for (const signer of signers) {\n const key = signer.publicKey.toString();\n if (seen.has(key)) {\n continue;\n } else {\n seen.add(key);\n uniqueSigners.push(signer);\n }\n }\n const message = this._compile();\n this._partialSign(message, ...uniqueSigners);\n }\n\n /**\n * @internal\n */\n _partialSign(message, ...signers) {\n const signData = message.serialize();\n signers.forEach(signer => {\n const signature = sign(signData, signer.secretKey);\n this._addSignature(signer.publicKey, toBuffer(signature));\n });\n }\n\n /**\n * Add an externally created signature to a transaction. The public key\n * must correspond to either the fee payer or a signer account in the transaction\n * instructions.\n *\n * @param {PublicKey} pubkey Public key that will be added to the transaction.\n * @param {Buffer} signature An externally created signature to add to the transaction.\n */\n addSignature(pubkey, signature) {\n this._compile(); // Ensure signatures array is populated\n this._addSignature(pubkey, signature);\n }\n\n /**\n * @internal\n */\n _addSignature(pubkey, signature) {\n assert(signature.length === 64);\n const index = this.signatures.findIndex(sigpair => pubkey.equals(sigpair.publicKey));\n if (index < 0) {\n throw new Error(`unknown signer: ${pubkey.toString()}`);\n }\n this.signatures[index].signature = Buffer.from(signature);\n }\n\n /**\n * Verify signatures of a Transaction\n * Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one.\n * If no boolean is provided, we expect a fully signed Transaction by default.\n *\n * @param {boolean} [requireAllSignatures=true] Require a fully signed Transaction\n */\n verifySignatures(requireAllSignatures = true) {\n const signatureErrors = this._getMessageSignednessErrors(this.serializeMessage(), requireAllSignatures);\n return !signatureErrors;\n }\n\n /**\n * @internal\n */\n _getMessageSignednessErrors(message, requireAllSignatures) {\n const errors = {};\n for (const {\n signature,\n publicKey\n } of this.signatures) {\n if (signature === null) {\n if (requireAllSignatures) {\n (errors.missing ||= []).push(publicKey);\n }\n } else {\n if (!verify(signature, message, publicKey.toBytes())) {\n (errors.invalid ||= []).push(publicKey);\n }\n }\n }\n return errors.invalid || errors.missing ? errors : undefined;\n }\n\n /**\n * Serialize the Transaction in the wire format.\n *\n * @param {Buffer} [config] Config of transaction.\n *\n * @returns {Buffer} Signature of transaction in wire format.\n */\n serialize(config) {\n const {\n requireAllSignatures,\n verifySignatures\n } = Object.assign({\n requireAllSignatures: true,\n verifySignatures: true\n }, config);\n const signData = this.serializeMessage();\n if (verifySignatures) {\n const sigErrors = this._getMessageSignednessErrors(signData, requireAllSignatures);\n if (sigErrors) {\n let errorMessage = 'Signature verification failed.';\n if (sigErrors.invalid) {\n errorMessage += `\\nInvalid signature for public key${sigErrors.invalid.length === 1 ? '' : '(s)'} [\\`${sigErrors.invalid.map(p => p.toBase58()).join('`, `')}\\`].`;\n }\n if (sigErrors.missing) {\n errorMessage += `\\nMissing signature for public key${sigErrors.missing.length === 1 ? '' : '(s)'} [\\`${sigErrors.missing.map(p => p.toBase58()).join('`, `')}\\`].`;\n }\n throw new Error(errorMessage);\n }\n }\n return this._serialize(signData);\n }\n\n /**\n * @internal\n */\n _serialize(signData) {\n const {\n signatures\n } = this;\n const signatureCount = [];\n encodeLength(signatureCount, signatures.length);\n const transactionLength = signatureCount.length + signatures.length * 64 + signData.length;\n const wireTransaction = Buffer.alloc(transactionLength);\n assert(signatures.length < 256);\n Buffer.from(signatureCount).copy(wireTransaction, 0);\n signatures.forEach(({\n signature\n }, index) => {\n if (signature !== null) {\n assert(signature.length === 64, `signature has invalid length`);\n Buffer.from(signature).copy(wireTransaction, signatureCount.length + index * 64);\n }\n });\n signData.copy(wireTransaction, signatureCount.length + signatures.length * 64);\n assert(wireTransaction.length <= PACKET_DATA_SIZE, `Transaction too large: ${wireTransaction.length} > ${PACKET_DATA_SIZE}`);\n return wireTransaction;\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get keys() {\n assert(this.instructions.length === 1);\n return this.instructions[0].keys.map(keyObj => keyObj.pubkey);\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get programId() {\n assert(this.instructions.length === 1);\n return this.instructions[0].programId;\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get data() {\n assert(this.instructions.length === 1);\n return this.instructions[0].data;\n }\n\n /**\n * Parse a wire transaction into a Transaction object.\n *\n * @param {Buffer | Uint8Array | Array} buffer Signature of wire Transaction\n *\n * @returns {Transaction} Transaction associated with the signature\n */\n static from(buffer) {\n // Slice up wire data\n let byteArray = [...buffer];\n const signatureCount = decodeLength(byteArray);\n let signatures = [];\n for (let i = 0; i < signatureCount; i++) {\n const signature = byteArray.slice(0, SIGNATURE_LENGTH_IN_BYTES);\n byteArray = byteArray.slice(SIGNATURE_LENGTH_IN_BYTES);\n signatures.push(bs58.encode(Buffer.from(signature)));\n }\n return Transaction.populate(Message.from(byteArray), signatures);\n }\n\n /**\n * Populate Transaction object from message and signatures\n *\n * @param {Message} message Message of transaction\n * @param {Array} signatures List of signatures to assign to the transaction\n *\n * @returns {Transaction} The populated Transaction\n */\n static populate(message, signatures = []) {\n const transaction = new Transaction();\n transaction.recentBlockhash = message.recentBlockhash;\n if (message.header.numRequiredSignatures > 0) {\n transaction.feePayer = message.accountKeys[0];\n }\n signatures.forEach((signature, index) => {\n const sigPubkeyPair = {\n signature: signature == bs58.encode(DEFAULT_SIGNATURE) ? null : bs58.decode(signature),\n publicKey: message.accountKeys[index]\n };\n transaction.signatures.push(sigPubkeyPair);\n });\n message.instructions.forEach(instruction => {\n const keys = instruction.accounts.map(account => {\n const pubkey = message.accountKeys[account];\n return {\n pubkey,\n isSigner: transaction.signatures.some(keyObj => keyObj.publicKey.toString() === pubkey.toString()) || message.isAccountSigner(account),\n isWritable: message.isAccountWritable(account)\n };\n });\n transaction.instructions.push(new TransactionInstruction({\n keys,\n programId: message.accountKeys[instruction.programIdIndex],\n data: bs58.decode(instruction.data)\n }));\n });\n transaction._message = message;\n transaction._json = transaction.toJSON();\n return transaction;\n }\n}\n\nclass TransactionMessage {\n constructor(args) {\n this.payerKey = void 0;\n this.instructions = void 0;\n this.recentBlockhash = void 0;\n this.payerKey = args.payerKey;\n this.instructions = args.instructions;\n this.recentBlockhash = args.recentBlockhash;\n }\n static decompile(message, args) {\n const {\n header,\n compiledInstructions,\n recentBlockhash\n } = message;\n const {\n numRequiredSignatures,\n numReadonlySignedAccounts,\n numReadonlyUnsignedAccounts\n } = header;\n const numWritableSignedAccounts = numRequiredSignatures - numReadonlySignedAccounts;\n assert(numWritableSignedAccounts > 0, 'Message header is invalid');\n const numWritableUnsignedAccounts = message.staticAccountKeys.length - numRequiredSignatures - numReadonlyUnsignedAccounts;\n assert(numWritableUnsignedAccounts >= 0, 'Message header is invalid');\n const accountKeys = message.getAccountKeys(args);\n const payerKey = accountKeys.get(0);\n if (payerKey === undefined) {\n throw new Error('Failed to decompile message because no account keys were found');\n }\n const instructions = [];\n for (const compiledIx of compiledInstructions) {\n const keys = [];\n for (const keyIndex of compiledIx.accountKeyIndexes) {\n const pubkey = accountKeys.get(keyIndex);\n if (pubkey === undefined) {\n throw new Error(`Failed to find key for account key index ${keyIndex}`);\n }\n const isSigner = keyIndex < numRequiredSignatures;\n let isWritable;\n if (isSigner) {\n isWritable = keyIndex < numWritableSignedAccounts;\n } else if (keyIndex < accountKeys.staticAccountKeys.length) {\n isWritable = keyIndex - numRequiredSignatures < numWritableUnsignedAccounts;\n } else {\n isWritable = keyIndex - accountKeys.staticAccountKeys.length <\n // accountKeysFromLookups cannot be undefined because we already found a pubkey for this index above\n accountKeys.accountKeysFromLookups.writable.length;\n }\n keys.push({\n pubkey,\n isSigner: keyIndex < header.numRequiredSignatures,\n isWritable\n });\n }\n const programId = accountKeys.get(compiledIx.programIdIndex);\n if (programId === undefined) {\n throw new Error(`Failed to find program id for program id index ${compiledIx.programIdIndex}`);\n }\n instructions.push(new TransactionInstruction({\n programId,\n data: toBuffer(compiledIx.data),\n keys\n }));\n }\n return new TransactionMessage({\n payerKey,\n instructions,\n recentBlockhash\n });\n }\n compileToLegacyMessage() {\n return Message.compile({\n payerKey: this.payerKey,\n recentBlockhash: this.recentBlockhash,\n instructions: this.instructions\n });\n }\n compileToV0Message(addressLookupTableAccounts) {\n return MessageV0.compile({\n payerKey: this.payerKey,\n recentBlockhash: this.recentBlockhash,\n instructions: this.instructions,\n addressLookupTableAccounts\n });\n }\n}\n\n/**\n * Versioned transaction class\n */\nclass VersionedTransaction {\n get version() {\n return this.message.version;\n }\n constructor(message, signatures) {\n this.signatures = void 0;\n this.message = void 0;\n if (signatures !== undefined) {\n assert(signatures.length === message.header.numRequiredSignatures, 'Expected signatures length to be equal to the number of required signatures');\n this.signatures = signatures;\n } else {\n const defaultSignatures = [];\n for (let i = 0; i < message.header.numRequiredSignatures; i++) {\n defaultSignatures.push(new Uint8Array(SIGNATURE_LENGTH_IN_BYTES));\n }\n this.signatures = defaultSignatures;\n }\n this.message = message;\n }\n serialize() {\n const serializedMessage = this.message.serialize();\n const encodedSignaturesLength = Array();\n encodeLength(encodedSignaturesLength, this.signatures.length);\n const transactionLayout = BufferLayout.struct([BufferLayout.blob(encodedSignaturesLength.length, 'encodedSignaturesLength'), BufferLayout.seq(signature(), this.signatures.length, 'signatures'), BufferLayout.blob(serializedMessage.length, 'serializedMessage')]);\n const serializedTransaction = new Uint8Array(2048);\n const serializedTransactionLength = transactionLayout.encode({\n encodedSignaturesLength: new Uint8Array(encodedSignaturesLength),\n signatures: this.signatures,\n serializedMessage\n }, serializedTransaction);\n return serializedTransaction.slice(0, serializedTransactionLength);\n }\n static deserialize(serializedTransaction) {\n let byteArray = [...serializedTransaction];\n const signatures = [];\n const signaturesLength = decodeLength(byteArray);\n for (let i = 0; i < signaturesLength; i++) {\n signatures.push(new Uint8Array(byteArray.splice(0, SIGNATURE_LENGTH_IN_BYTES)));\n }\n const message = VersionedMessage.deserialize(new Uint8Array(byteArray));\n return new VersionedTransaction(message, signatures);\n }\n sign(signers) {\n const messageData = this.message.serialize();\n const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures);\n for (const signer of signers) {\n const signerIndex = signerPubkeys.findIndex(pubkey => pubkey.equals(signer.publicKey));\n assert(signerIndex >= 0, `Cannot sign with non signer key ${signer.publicKey.toBase58()}`);\n this.signatures[signerIndex] = sign(messageData, signer.secretKey);\n }\n }\n addSignature(publicKey, signature) {\n assert(signature.byteLength === 64, 'Signature must be 64 bytes long');\n const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures);\n const signerIndex = signerPubkeys.findIndex(pubkey => pubkey.equals(publicKey));\n assert(signerIndex >= 0, `Can not add signature; \\`${publicKey.toBase58()}\\` is not required to sign this transaction`);\n this.signatures[signerIndex] = signature;\n }\n}\n\n// TODO: These constants should be removed in favor of reading them out of a\n// Syscall account\n\n/**\n * @internal\n */\nconst NUM_TICKS_PER_SECOND = 160;\n\n/**\n * @internal\n */\nconst DEFAULT_TICKS_PER_SLOT = 64;\n\n/**\n * @internal\n */\nconst NUM_SLOTS_PER_SECOND = NUM_TICKS_PER_SECOND / DEFAULT_TICKS_PER_SLOT;\n\n/**\n * @internal\n */\nconst MS_PER_SLOT = 1000 / NUM_SLOTS_PER_SECOND;\n\nconst SYSVAR_CLOCK_PUBKEY = new PublicKey('SysvarC1ock11111111111111111111111111111111');\nconst SYSVAR_EPOCH_SCHEDULE_PUBKEY = new PublicKey('SysvarEpochSchedu1e111111111111111111111111');\nconst SYSVAR_INSTRUCTIONS_PUBKEY = new PublicKey('Sysvar1nstructions1111111111111111111111111');\nconst SYSVAR_RECENT_BLOCKHASHES_PUBKEY = new PublicKey('SysvarRecentB1ockHashes11111111111111111111');\nconst SYSVAR_RENT_PUBKEY = new PublicKey('SysvarRent111111111111111111111111111111111');\nconst SYSVAR_REWARDS_PUBKEY = new PublicKey('SysvarRewards111111111111111111111111111111');\nconst SYSVAR_SLOT_HASHES_PUBKEY = new PublicKey('SysvarS1otHashes111111111111111111111111111');\nconst SYSVAR_SLOT_HISTORY_PUBKEY = new PublicKey('SysvarS1otHistory11111111111111111111111111');\nconst SYSVAR_STAKE_HISTORY_PUBKEY = new PublicKey('SysvarStakeHistory1111111111111111111111111');\n\n/**\n * Sign, send and confirm a transaction.\n *\n * If `commitment` option is not specified, defaults to 'max' commitment.\n *\n * @param {Connection} connection\n * @param {Transaction} transaction\n * @param {Array} signers\n * @param {ConfirmOptions} [options]\n * @returns {Promise}\n */\nasync function sendAndConfirmTransaction(connection, transaction, signers, options) {\n const sendOptions = options && {\n skipPreflight: options.skipPreflight,\n preflightCommitment: options.preflightCommitment || options.commitment,\n maxRetries: options.maxRetries,\n minContextSlot: options.minContextSlot\n };\n const signature = await connection.sendTransaction(transaction, signers, sendOptions);\n let status;\n if (transaction.recentBlockhash != null && transaction.lastValidBlockHeight != null) {\n status = (await connection.confirmTransaction({\n abortSignal: options?.abortSignal,\n signature: signature,\n blockhash: transaction.recentBlockhash,\n lastValidBlockHeight: transaction.lastValidBlockHeight\n }, options && options.commitment)).value;\n } else if (transaction.minNonceContextSlot != null && transaction.nonceInfo != null) {\n const {\n nonceInstruction\n } = transaction.nonceInfo;\n const nonceAccountPubkey = nonceInstruction.keys[0].pubkey;\n status = (await connection.confirmTransaction({\n abortSignal: options?.abortSignal,\n minContextSlot: transaction.minNonceContextSlot,\n nonceAccountPubkey,\n nonceValue: transaction.nonceInfo.nonce,\n signature\n }, options && options.commitment)).value;\n } else {\n if (options?.abortSignal != null) {\n console.warn('sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was ' + 'supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` ' + 'or a combination of `nonceInfo` and `minNonceContextSlot` are abortable.');\n }\n status = (await connection.confirmTransaction(signature, options && options.commitment)).value;\n }\n if (status.err) {\n throw new Error(`Transaction ${signature} failed (${JSON.stringify(status)})`);\n }\n return signature;\n}\n\n// zzz\nfunction sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\n/**\n * @internal\n */\n\n/**\n * Populate a buffer of instruction data using an InstructionType\n * @internal\n */\nfunction encodeData(type, fields) {\n const allocLength = type.layout.span >= 0 ? type.layout.span : getAlloc(type, fields);\n const data = Buffer.alloc(allocLength);\n const layoutFields = Object.assign({\n instruction: type.index\n }, fields);\n type.layout.encode(layoutFields, data);\n return data;\n}\n\n/**\n * Decode instruction data buffer using an InstructionType\n * @internal\n */\nfunction decodeData$1(type, buffer) {\n let data;\n try {\n data = type.layout.decode(buffer);\n } catch (err) {\n throw new Error('invalid instruction; ' + err);\n }\n if (data.instruction !== type.index) {\n throw new Error(`invalid instruction; instruction index mismatch ${data.instruction} != ${type.index}`);\n }\n return data;\n}\n\n/**\n * https://github.com/solana-labs/solana/blob/90bedd7e067b5b8f3ddbb45da00a4e9cabb22c62/sdk/src/fee_calculator.rs#L7-L11\n *\n * @internal\n */\nconst FeeCalculatorLayout = BufferLayout.nu64('lamportsPerSignature');\n\n/**\n * Calculator for transaction fees.\n *\n * @deprecated Deprecated since Solana v1.8.0.\n */\n\n/**\n * See https://github.com/solana-labs/solana/blob/0ea2843ec9cdc517572b8e62c959f41b55cf4453/sdk/src/nonce_state.rs#L29-L32\n *\n * @internal\n */\nconst NonceAccountLayout = BufferLayout.struct([BufferLayout.u32('version'), BufferLayout.u32('state'), publicKey('authorizedPubkey'), publicKey('nonce'), BufferLayout.struct([FeeCalculatorLayout], 'feeCalculator')]);\nconst NONCE_ACCOUNT_LENGTH = NonceAccountLayout.span;\n\n/**\n * A durable nonce is a 32 byte value encoded as a base58 string.\n */\n\n/**\n * NonceAccount class\n */\nclass NonceAccount {\n /**\n * @internal\n */\n constructor(args) {\n this.authorizedPubkey = void 0;\n this.nonce = void 0;\n this.feeCalculator = void 0;\n this.authorizedPubkey = args.authorizedPubkey;\n this.nonce = args.nonce;\n this.feeCalculator = args.feeCalculator;\n }\n\n /**\n * Deserialize NonceAccount from the account data.\n *\n * @param buffer account data\n * @return NonceAccount\n */\n static fromAccountData(buffer) {\n const nonceAccount = NonceAccountLayout.decode(toBuffer(buffer), 0);\n return new NonceAccount({\n authorizedPubkey: new PublicKey(nonceAccount.authorizedPubkey),\n nonce: new PublicKey(nonceAccount.nonce).toString(),\n feeCalculator: nonceAccount.feeCalculator\n });\n }\n}\n\nconst encodeDecode = layout => {\n const decode = layout.decode.bind(layout);\n const encode = layout.encode.bind(layout);\n return {\n decode,\n encode\n };\n};\nconst bigInt = length => property => {\n const layout = blob(length, property);\n const {\n encode,\n decode\n } = encodeDecode(layout);\n const bigIntLayout = layout;\n bigIntLayout.decode = (buffer, offset) => {\n const src = decode(buffer, offset);\n return toBigIntLE(Buffer.from(src));\n };\n bigIntLayout.encode = (bigInt, buffer, offset) => {\n const src = toBufferLE(bigInt, length);\n return encode(src, buffer, offset);\n };\n return bigIntLayout;\n};\nconst u64 = bigInt(8);\n\n/**\n * Create account system transaction params\n */\n\n/**\n * Transfer system transaction params\n */\n\n/**\n * Assign system transaction params\n */\n\n/**\n * Create account with seed system transaction params\n */\n\n/**\n * Create nonce account system transaction params\n */\n\n/**\n * Create nonce account with seed system transaction params\n */\n\n/**\n * Initialize nonce account system instruction params\n */\n\n/**\n * Advance nonce account system instruction params\n */\n\n/**\n * Withdraw nonce account system transaction params\n */\n\n/**\n * Authorize nonce account system transaction params\n */\n\n/**\n * Allocate account system transaction params\n */\n\n/**\n * Allocate account with seed system transaction params\n */\n\n/**\n * Assign account with seed system transaction params\n */\n\n/**\n * Transfer with seed system transaction params\n */\n\n/** Decoded transfer system transaction instruction */\n\n/** Decoded transferWithSeed system transaction instruction */\n\n/**\n * System Instruction class\n */\nclass SystemInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a system instruction and retrieve the instruction type.\n */\n static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n let type;\n for (const [ixType, layout] of Object.entries(SYSTEM_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType;\n break;\n }\n }\n if (!type) {\n throw new Error('Instruction type incorrect; not a SystemInstruction');\n }\n return type;\n }\n\n /**\n * Decode a create account system instruction and retrieve the instruction params.\n */\n static decodeCreateAccount(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n lamports,\n space,\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Create, instruction.data);\n return {\n fromPubkey: instruction.keys[0].pubkey,\n newAccountPubkey: instruction.keys[1].pubkey,\n lamports,\n space,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode a transfer system instruction and retrieve the instruction params.\n */\n static decodeTransfer(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n lamports\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Transfer, instruction.data);\n return {\n fromPubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n lamports\n };\n }\n\n /**\n * Decode a transfer with seed system instruction and retrieve the instruction params.\n */\n static decodeTransferWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n lamports,\n seed,\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed, instruction.data);\n return {\n fromPubkey: instruction.keys[0].pubkey,\n basePubkey: instruction.keys[1].pubkey,\n toPubkey: instruction.keys[2].pubkey,\n lamports,\n seed,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode an allocate system instruction and retrieve the instruction params.\n */\n static decodeAllocate(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n const {\n space\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Allocate, instruction.data);\n return {\n accountPubkey: instruction.keys[0].pubkey,\n space\n };\n }\n\n /**\n * Decode an allocate with seed system instruction and retrieve the instruction params.\n */\n static decodeAllocateWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n const {\n base,\n seed,\n space,\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed, instruction.data);\n return {\n accountPubkey: instruction.keys[0].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n space,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode an assign system instruction and retrieve the instruction params.\n */\n static decodeAssign(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n const {\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Assign, instruction.data);\n return {\n accountPubkey: instruction.keys[0].pubkey,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode an assign with seed system instruction and retrieve the instruction params.\n */\n static decodeAssignWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n const {\n base,\n seed,\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed, instruction.data);\n return {\n accountPubkey: instruction.keys[0].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode a create account with seed system instruction and retrieve the instruction params.\n */\n static decodeCreateWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n base,\n seed,\n lamports,\n space,\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed, instruction.data);\n return {\n fromPubkey: instruction.keys[0].pubkey,\n newAccountPubkey: instruction.keys[1].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n lamports,\n space,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode a nonce initialize system instruction and retrieve the instruction params.\n */\n static decodeNonceInitialize(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n authorized\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount, instruction.data);\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: new PublicKey(authorized)\n };\n }\n\n /**\n * Decode a nonce advance system instruction and retrieve the instruction params.\n */\n static decodeNonceAdvance(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount, instruction.data);\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey\n };\n }\n\n /**\n * Decode a nonce withdraw system instruction and retrieve the instruction params.\n */\n static decodeNonceWithdraw(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 5);\n const {\n lamports\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount, instruction.data);\n return {\n noncePubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey,\n lamports\n };\n }\n\n /**\n * Decode a nonce authorize system instruction and retrieve the instruction params.\n */\n static decodeNonceAuthorize(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n authorized\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount, instruction.data);\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[1].pubkey,\n newAuthorizedPubkey: new PublicKey(authorized)\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId) {\n if (!programId.equals(SystemProgram.programId)) {\n throw new Error('invalid instruction; programId is not SystemProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys, expectedLength) {\n if (keys.length < expectedLength) {\n throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`);\n }\n }\n}\n\n/**\n * An enumeration of valid SystemInstructionType's\n */\n\n/**\n * An enumeration of valid system InstructionType's\n * @internal\n */\nconst SYSTEM_INSTRUCTION_LAYOUTS = Object.freeze({\n Create: {\n index: 0,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), BufferLayout.ns64('lamports'), BufferLayout.ns64('space'), publicKey('programId')])\n },\n Assign: {\n index: 1,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), publicKey('programId')])\n },\n Transfer: {\n index: 2,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), u64('lamports')])\n },\n CreateWithSeed: {\n index: 3,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), publicKey('base'), rustString('seed'), BufferLayout.ns64('lamports'), BufferLayout.ns64('space'), publicKey('programId')])\n },\n AdvanceNonceAccount: {\n index: 4,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')])\n },\n WithdrawNonceAccount: {\n index: 5,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), BufferLayout.ns64('lamports')])\n },\n InitializeNonceAccount: {\n index: 6,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), publicKey('authorized')])\n },\n AuthorizeNonceAccount: {\n index: 7,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), publicKey('authorized')])\n },\n Allocate: {\n index: 8,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), BufferLayout.ns64('space')])\n },\n AllocateWithSeed: {\n index: 9,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), publicKey('base'), rustString('seed'), BufferLayout.ns64('space'), publicKey('programId')])\n },\n AssignWithSeed: {\n index: 10,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), publicKey('base'), rustString('seed'), publicKey('programId')])\n },\n TransferWithSeed: {\n index: 11,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), u64('lamports'), rustString('seed'), publicKey('programId')])\n },\n UpgradeNonceAccount: {\n index: 12,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')])\n }\n});\n\n/**\n * Factory class for transactions to interact with the System program\n */\nclass SystemProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the System program\n */\n\n /**\n * Generate a transaction instruction that creates a new account\n */\n static createAccount(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Create;\n const data = encodeData(type, {\n lamports: params.lamports,\n space: params.space,\n programId: toBuffer(params.programId.toBuffer())\n });\n return new TransactionInstruction({\n keys: [{\n pubkey: params.fromPubkey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: params.newAccountPubkey,\n isSigner: true,\n isWritable: true\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction instruction that transfers lamports from one account to another\n */\n static transfer(params) {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed;\n data = encodeData(type, {\n lamports: BigInt(params.lamports),\n seed: params.seed,\n programId: toBuffer(params.programId.toBuffer())\n });\n keys = [{\n pubkey: params.fromPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.basePubkey,\n isSigner: true,\n isWritable: false\n }, {\n pubkey: params.toPubkey,\n isSigner: false,\n isWritable: true\n }];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Transfer;\n data = encodeData(type, {\n lamports: BigInt(params.lamports)\n });\n keys = [{\n pubkey: params.fromPubkey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: params.toPubkey,\n isSigner: false,\n isWritable: true\n }];\n }\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction instruction that assigns an account to a program\n */\n static assign(params) {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed;\n data = encodeData(type, {\n base: toBuffer(params.basePubkey.toBuffer()),\n seed: params.seed,\n programId: toBuffer(params.programId.toBuffer())\n });\n keys = [{\n pubkey: params.accountPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.basePubkey,\n isSigner: true,\n isWritable: false\n }];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Assign;\n data = encodeData(type, {\n programId: toBuffer(params.programId.toBuffer())\n });\n keys = [{\n pubkey: params.accountPubkey,\n isSigner: true,\n isWritable: true\n }];\n }\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction instruction that creates a new account at\n * an address generated with `from`, a seed, and programId\n */\n static createAccountWithSeed(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed;\n const data = encodeData(type, {\n base: toBuffer(params.basePubkey.toBuffer()),\n seed: params.seed,\n lamports: params.lamports,\n space: params.space,\n programId: toBuffer(params.programId.toBuffer())\n });\n let keys = [{\n pubkey: params.fromPubkey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: params.newAccountPubkey,\n isSigner: false,\n isWritable: true\n }];\n if (params.basePubkey != params.fromPubkey) {\n keys.push({\n pubkey: params.basePubkey,\n isSigner: true,\n isWritable: false\n });\n }\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction that creates a new Nonce account\n */\n static createNonceAccount(params) {\n const transaction = new Transaction();\n if ('basePubkey' in params && 'seed' in params) {\n transaction.add(SystemProgram.createAccountWithSeed({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.noncePubkey,\n basePubkey: params.basePubkey,\n seed: params.seed,\n lamports: params.lamports,\n space: NONCE_ACCOUNT_LENGTH,\n programId: this.programId\n }));\n } else {\n transaction.add(SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.noncePubkey,\n lamports: params.lamports,\n space: NONCE_ACCOUNT_LENGTH,\n programId: this.programId\n }));\n }\n const initParams = {\n noncePubkey: params.noncePubkey,\n authorizedPubkey: params.authorizedPubkey\n };\n transaction.add(this.nonceInitialize(initParams));\n return transaction;\n }\n\n /**\n * Generate an instruction to initialize a Nonce account\n */\n static nonceInitialize(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount;\n const data = encodeData(type, {\n authorized: toBuffer(params.authorizedPubkey.toBuffer())\n });\n const instructionData = {\n keys: [{\n pubkey: params.noncePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false\n }],\n programId: this.programId,\n data\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate an instruction to advance the nonce in a Nonce account\n */\n static nonceAdvance(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount;\n const data = encodeData(type);\n const instructionData = {\n keys: [{\n pubkey: params.noncePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: params.authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a transaction instruction that withdraws lamports from a Nonce account\n */\n static nonceWithdraw(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount;\n const data = encodeData(type, {\n lamports: params.lamports\n });\n return new TransactionInstruction({\n keys: [{\n pubkey: params.noncePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.toPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: params.authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction instruction that authorizes a new PublicKey as the authority\n * on a Nonce account.\n */\n static nonceAuthorize(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount;\n const data = encodeData(type, {\n authorized: toBuffer(params.newAuthorizedPubkey.toBuffer())\n });\n return new TransactionInstruction({\n keys: [{\n pubkey: params.noncePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction instruction that allocates space in an account without funding\n */\n static allocate(params) {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed;\n data = encodeData(type, {\n base: toBuffer(params.basePubkey.toBuffer()),\n seed: params.seed,\n space: params.space,\n programId: toBuffer(params.programId.toBuffer())\n });\n keys = [{\n pubkey: params.accountPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.basePubkey,\n isSigner: true,\n isWritable: false\n }];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Allocate;\n data = encodeData(type, {\n space: params.space\n });\n keys = [{\n pubkey: params.accountPubkey,\n isSigner: true,\n isWritable: true\n }];\n }\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data\n });\n }\n}\nSystemProgram.programId = new PublicKey('11111111111111111111111111111111');\n\n// Keep program chunks under PACKET_DATA_SIZE, leaving enough room for the\n// rest of the Transaction fields\n//\n// TODO: replace 300 with a proper constant for the size of the other\n// Transaction fields\nconst CHUNK_SIZE = PACKET_DATA_SIZE - 300;\n\n/**\n * Program loader interface\n */\nclass Loader {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Amount of program data placed in each load Transaction\n */\n\n /**\n * Minimum number of signatures required to load a program not including\n * retries\n *\n * Can be used to calculate transaction fees\n */\n static getMinNumSignatures(dataLength) {\n return 2 * (\n // Every transaction requires two signatures (payer + program)\n Math.ceil(dataLength / Loader.chunkSize) + 1 +\n // Add one for Create transaction\n 1) // Add one for Finalize transaction\n ;\n }\n\n /**\n * Loads a generic program\n *\n * @param connection The connection to use\n * @param payer System account that pays to load the program\n * @param program Account to load the program into\n * @param programId Public key that identifies the loader\n * @param data Program octets\n * @return true if program was loaded successfully, false if program was already loaded\n */\n static async load(connection, payer, program, programId, data) {\n {\n const balanceNeeded = await connection.getMinimumBalanceForRentExemption(data.length);\n\n // Fetch program account info to check if it has already been created\n const programInfo = await connection.getAccountInfo(program.publicKey, 'confirmed');\n let transaction = null;\n if (programInfo !== null) {\n if (programInfo.executable) {\n console.error('Program load failed, account is already executable');\n return false;\n }\n if (programInfo.data.length !== data.length) {\n transaction = transaction || new Transaction();\n transaction.add(SystemProgram.allocate({\n accountPubkey: program.publicKey,\n space: data.length\n }));\n }\n if (!programInfo.owner.equals(programId)) {\n transaction = transaction || new Transaction();\n transaction.add(SystemProgram.assign({\n accountPubkey: program.publicKey,\n programId\n }));\n }\n if (programInfo.lamports < balanceNeeded) {\n transaction = transaction || new Transaction();\n transaction.add(SystemProgram.transfer({\n fromPubkey: payer.publicKey,\n toPubkey: program.publicKey,\n lamports: balanceNeeded - programInfo.lamports\n }));\n }\n } else {\n transaction = new Transaction().add(SystemProgram.createAccount({\n fromPubkey: payer.publicKey,\n newAccountPubkey: program.publicKey,\n lamports: balanceNeeded > 0 ? balanceNeeded : 1,\n space: data.length,\n programId\n }));\n }\n\n // If the account is already created correctly, skip this step\n // and proceed directly to loading instructions\n if (transaction !== null) {\n await sendAndConfirmTransaction(connection, transaction, [payer, program], {\n commitment: 'confirmed'\n });\n }\n }\n const dataLayout = BufferLayout.struct([BufferLayout.u32('instruction'), BufferLayout.u32('offset'), BufferLayout.u32('bytesLength'), BufferLayout.u32('bytesLengthPadding'), BufferLayout.seq(BufferLayout.u8('byte'), BufferLayout.offset(BufferLayout.u32(), -8), 'bytes')]);\n const chunkSize = Loader.chunkSize;\n let offset = 0;\n let array = data;\n let transactions = [];\n while (array.length > 0) {\n const bytes = array.slice(0, chunkSize);\n const data = Buffer.alloc(chunkSize + 16);\n dataLayout.encode({\n instruction: 0,\n // Load instruction\n offset,\n bytes: bytes,\n bytesLength: 0,\n bytesLengthPadding: 0\n }, data);\n const transaction = new Transaction().add({\n keys: [{\n pubkey: program.publicKey,\n isSigner: true,\n isWritable: true\n }],\n programId,\n data\n });\n transactions.push(sendAndConfirmTransaction(connection, transaction, [payer, program], {\n commitment: 'confirmed'\n }));\n\n // Delay between sends in an attempt to reduce rate limit errors\n if (connection._rpcEndpoint.includes('solana.com')) {\n const REQUESTS_PER_SECOND = 4;\n await sleep(1000 / REQUESTS_PER_SECOND);\n }\n offset += chunkSize;\n array = array.slice(chunkSize);\n }\n await Promise.all(transactions);\n\n // Finalize the account loaded with program data for execution\n {\n const dataLayout = BufferLayout.struct([BufferLayout.u32('instruction')]);\n const data = Buffer.alloc(dataLayout.span);\n dataLayout.encode({\n instruction: 1 // Finalize instruction\n }, data);\n const transaction = new Transaction().add({\n keys: [{\n pubkey: program.publicKey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false\n }],\n programId,\n data\n });\n const deployCommitment = 'processed';\n const finalizeSignature = await connection.sendTransaction(transaction, [payer, program], {\n preflightCommitment: deployCommitment\n });\n const {\n context,\n value\n } = await connection.confirmTransaction({\n signature: finalizeSignature,\n lastValidBlockHeight: transaction.lastValidBlockHeight,\n blockhash: transaction.recentBlockhash\n }, deployCommitment);\n if (value.err) {\n throw new Error(`Transaction ${finalizeSignature} failed (${JSON.stringify(value)})`);\n }\n // We prevent programs from being usable until the slot after their deployment.\n // See https://github.com/solana-labs/solana/pull/29654\n while (true // eslint-disable-line no-constant-condition\n ) {\n try {\n const currentSlot = await connection.getSlot({\n commitment: deployCommitment\n });\n if (currentSlot > context.slot) {\n break;\n }\n } catch {\n /* empty */\n }\n await new Promise(resolve => setTimeout(resolve, Math.round(MS_PER_SLOT / 2)));\n }\n }\n\n // success\n return true;\n }\n}\nLoader.chunkSize = CHUNK_SIZE;\n\n/**\n * @deprecated Deprecated since Solana v1.17.20.\n */\nconst BPF_LOADER_PROGRAM_ID = new PublicKey('BPFLoader2111111111111111111111111111111111');\n\n/**\n * Factory class for transactions to interact with a program loader\n *\n * @deprecated Deprecated since Solana v1.17.20.\n */\nclass BpfLoader {\n /**\n * Minimum number of signatures required to load a program not including\n * retries\n *\n * Can be used to calculate transaction fees\n */\n static getMinNumSignatures(dataLength) {\n return Loader.getMinNumSignatures(dataLength);\n }\n\n /**\n * Load a SBF program\n *\n * @param connection The connection to use\n * @param payer Account that will pay program loading fees\n * @param program Account to load the program into\n * @param elf The entire ELF containing the SBF program\n * @param loaderProgramId The program id of the BPF loader to use\n * @return true if program was loaded successfully, false if program was already loaded\n */\n static load(connection, payer, program, elf, loaderProgramId) {\n return Loader.load(connection, payer, program, loaderProgramId, elf);\n }\n}\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nvar objToString = Object.prototype.toString;\nvar objKeys = Object.keys || function(obj) {\n\t\tvar keys = [];\n\t\tfor (var name in obj) {\n\t\t\tkeys.push(name);\n\t\t}\n\t\treturn keys;\n\t};\n\nfunction stringify(val, isArrayProp) {\n\tvar i, max, str, keys, key, propVal, toStr;\n\tif (val === true) {\n\t\treturn \"true\";\n\t}\n\tif (val === false) {\n\t\treturn \"false\";\n\t}\n\tswitch (typeof val) {\n\t\tcase \"object\":\n\t\t\tif (val === null) {\n\t\t\t\treturn null;\n\t\t\t} else if (val.toJSON && typeof val.toJSON === \"function\") {\n\t\t\t\treturn stringify(val.toJSON(), isArrayProp);\n\t\t\t} else {\n\t\t\t\ttoStr = objToString.call(val);\n\t\t\t\tif (toStr === \"[object Array]\") {\n\t\t\t\t\tstr = '[';\n\t\t\t\t\tmax = val.length - 1;\n\t\t\t\t\tfor(i = 0; i < max; i++) {\n\t\t\t\t\t\tstr += stringify(val[i], true) + ',';\n\t\t\t\t\t}\n\t\t\t\t\tif (max > -1) {\n\t\t\t\t\t\tstr += stringify(val[i], true);\n\t\t\t\t\t}\n\t\t\t\t\treturn str + ']';\n\t\t\t\t} else if (toStr === \"[object Object]\") {\n\t\t\t\t\t// only object is left\n\t\t\t\t\tkeys = objKeys(val).sort();\n\t\t\t\t\tmax = keys.length;\n\t\t\t\t\tstr = \"\";\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile (i < max) {\n\t\t\t\t\t\tkey = keys[i];\n\t\t\t\t\t\tpropVal = stringify(val[key], false);\n\t\t\t\t\t\tif (propVal !== undefined) {\n\t\t\t\t\t\t\tif (str) {\n\t\t\t\t\t\t\t\tstr += ',';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstr += JSON.stringify(key) + ':' + propVal;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\treturn '{' + str + '}';\n\t\t\t\t} else {\n\t\t\t\t\treturn JSON.stringify(val);\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"function\":\n\t\tcase \"undefined\":\n\t\t\treturn isArrayProp ? null : undefined;\n\t\tcase \"string\":\n\t\t\treturn JSON.stringify(val);\n\t\tdefault:\n\t\t\treturn isFinite(val) ? val : null;\n\t}\n}\n\nvar fastStableStringify = function(val) {\n\tvar returnVal = stringify(val, false);\n\tif (returnVal !== undefined) {\n\t\treturn ''+ returnVal;\n\t}\n};\n\nvar fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);\n\nconst MINIMUM_SLOT_PER_EPOCH = 32;\n\n// Returns the number of trailing zeros in the binary representation of self.\nfunction trailingZeros(n) {\n let trailingZeros = 0;\n while (n > 1) {\n n /= 2;\n trailingZeros++;\n }\n return trailingZeros;\n}\n\n// Returns the smallest power of two greater than or equal to n\nfunction nextPowerOfTwo(n) {\n if (n === 0) return 1;\n n--;\n n |= n >> 1;\n n |= n >> 2;\n n |= n >> 4;\n n |= n >> 8;\n n |= n >> 16;\n n |= n >> 32;\n return n + 1;\n}\n\n/**\n * Epoch schedule\n * (see https://docs.solana.com/terminology#epoch)\n * Can be retrieved with the {@link Connection.getEpochSchedule} method\n */\nclass EpochSchedule {\n constructor(slotsPerEpoch, leaderScheduleSlotOffset, warmup, firstNormalEpoch, firstNormalSlot) {\n /** The maximum number of slots in each epoch */\n this.slotsPerEpoch = void 0;\n /** The number of slots before beginning of an epoch to calculate a leader schedule for that epoch */\n this.leaderScheduleSlotOffset = void 0;\n /** Indicates whether epochs start short and grow */\n this.warmup = void 0;\n /** The first epoch with `slotsPerEpoch` slots */\n this.firstNormalEpoch = void 0;\n /** The first slot of `firstNormalEpoch` */\n this.firstNormalSlot = void 0;\n this.slotsPerEpoch = slotsPerEpoch;\n this.leaderScheduleSlotOffset = leaderScheduleSlotOffset;\n this.warmup = warmup;\n this.firstNormalEpoch = firstNormalEpoch;\n this.firstNormalSlot = firstNormalSlot;\n }\n getEpoch(slot) {\n return this.getEpochAndSlotIndex(slot)[0];\n }\n getEpochAndSlotIndex(slot) {\n if (slot < this.firstNormalSlot) {\n const epoch = trailingZeros(nextPowerOfTwo(slot + MINIMUM_SLOT_PER_EPOCH + 1)) - trailingZeros(MINIMUM_SLOT_PER_EPOCH) - 1;\n const epochLen = this.getSlotsInEpoch(epoch);\n const slotIndex = slot - (epochLen - MINIMUM_SLOT_PER_EPOCH);\n return [epoch, slotIndex];\n } else {\n const normalSlotIndex = slot - this.firstNormalSlot;\n const normalEpochIndex = Math.floor(normalSlotIndex / this.slotsPerEpoch);\n const epoch = this.firstNormalEpoch + normalEpochIndex;\n const slotIndex = normalSlotIndex % this.slotsPerEpoch;\n return [epoch, slotIndex];\n }\n }\n getFirstSlotInEpoch(epoch) {\n if (epoch <= this.firstNormalEpoch) {\n return (Math.pow(2, epoch) - 1) * MINIMUM_SLOT_PER_EPOCH;\n } else {\n return (epoch - this.firstNormalEpoch) * this.slotsPerEpoch + this.firstNormalSlot;\n }\n }\n getLastSlotInEpoch(epoch) {\n return this.getFirstSlotInEpoch(epoch) + this.getSlotsInEpoch(epoch) - 1;\n }\n getSlotsInEpoch(epoch) {\n if (epoch < this.firstNormalEpoch) {\n return Math.pow(2, epoch + trailingZeros(MINIMUM_SLOT_PER_EPOCH));\n } else {\n return this.slotsPerEpoch;\n }\n }\n}\n\nclass SendTransactionError extends Error {\n constructor(message, logs) {\n super(message);\n this.logs = void 0;\n this.logs = logs;\n }\n}\n\n// Keep in sync with client/src/rpc_custom_errors.rs\n// Typescript `enums` thwart tree-shaking. See https://bargsten.org/jsts/enums/\nconst SolanaJSONRPCErrorCode = {\n JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001,\n JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002,\n JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003,\n JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004,\n JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005,\n JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006,\n JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007,\n JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008,\n JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009,\n JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010,\n JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011,\n JSON_RPC_SCAN_ERROR: -32012,\n JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013,\n JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014,\n JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015,\n JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016\n};\nclass SolanaJSONRPCError extends Error {\n constructor({\n code,\n message,\n data\n }, customMessage) {\n super(customMessage != null ? `${customMessage}: ${message}` : message);\n this.code = void 0;\n this.data = void 0;\n this.code = code;\n this.data = data;\n this.name = 'SolanaJSONRPCError';\n }\n}\n\nvar fetchImpl = globalThis.fetch;\n\nclass RpcWebSocketClient extends RpcWebSocketCommonClient {\n constructor(address, options, generate_request_id) {\n const webSocketFactory = url => {\n const rpc = createRpc(url, {\n autoconnect: true,\n max_reconnects: 5,\n reconnect: true,\n reconnect_interval: 1000,\n ...options\n });\n if ('socket' in rpc) {\n this.underlyingSocket = rpc.socket;\n } else {\n this.underlyingSocket = rpc;\n }\n return rpc;\n };\n super(webSocketFactory, address, options, generate_request_id);\n this.underlyingSocket = void 0;\n }\n call(...args) {\n const readyState = this.underlyingSocket?.readyState;\n if (readyState === 1 /* WebSocket.OPEN */) {\n return super.call(...args);\n }\n return Promise.reject(new Error('Tried to call a JSON-RPC method `' + args[0] + '` but the socket was not `CONNECTING` or `OPEN` (`readyState` was ' + readyState + ')'));\n }\n notify(...args) {\n const readyState = this.underlyingSocket?.readyState;\n if (readyState === 1 /* WebSocket.OPEN */) {\n return super.notify(...args);\n }\n return Promise.reject(new Error('Tried to send a JSON-RPC notification `' + args[0] + '` but the socket was not `CONNECTING` or `OPEN` (`readyState` was ' + readyState + ')'));\n }\n}\n\n/**\n * @internal\n */\n\n/**\n * Decode account data buffer using an AccountType\n * @internal\n */\nfunction decodeData(type, data) {\n let decoded;\n try {\n decoded = type.layout.decode(data);\n } catch (err) {\n throw new Error('invalid instruction; ' + err);\n }\n if (decoded.typeIndex !== type.index) {\n throw new Error(`invalid account data; account type mismatch ${decoded.typeIndex} != ${type.index}`);\n }\n return decoded;\n}\n\n/// The serialized size of lookup table metadata\nconst LOOKUP_TABLE_META_SIZE = 56;\nclass AddressLookupTableAccount {\n constructor(args) {\n this.key = void 0;\n this.state = void 0;\n this.key = args.key;\n this.state = args.state;\n }\n isActive() {\n const U64_MAX = BigInt('0xffffffffffffffff');\n return this.state.deactivationSlot === U64_MAX;\n }\n static deserialize(accountData) {\n const meta = decodeData(LookupTableMetaLayout, accountData);\n const serializedAddressesLen = accountData.length - LOOKUP_TABLE_META_SIZE;\n assert(serializedAddressesLen >= 0, 'lookup table is invalid');\n assert(serializedAddressesLen % 32 === 0, 'lookup table is invalid');\n const numSerializedAddresses = serializedAddressesLen / 32;\n const {\n addresses\n } = BufferLayout.struct([BufferLayout.seq(publicKey(), numSerializedAddresses, 'addresses')]).decode(accountData.slice(LOOKUP_TABLE_META_SIZE));\n return {\n deactivationSlot: meta.deactivationSlot,\n lastExtendedSlot: meta.lastExtendedSlot,\n lastExtendedSlotStartIndex: meta.lastExtendedStartIndex,\n authority: meta.authority.length !== 0 ? new PublicKey(meta.authority[0]) : undefined,\n addresses: addresses.map(address => new PublicKey(address))\n };\n }\n}\nconst LookupTableMetaLayout = {\n index: 1,\n layout: BufferLayout.struct([BufferLayout.u32('typeIndex'), u64('deactivationSlot'), BufferLayout.nu64('lastExtendedSlot'), BufferLayout.u8('lastExtendedStartIndex'), BufferLayout.u8(),\n // option\n BufferLayout.seq(publicKey(), BufferLayout.offset(BufferLayout.u8(), -1), 'authority')])\n};\n\nconst URL_RE = /^[^:]+:\\/\\/([^:[]+|\\[[^\\]]+\\])(:\\d+)?(.*)/i;\nfunction makeWebsocketUrl(endpoint) {\n const matches = endpoint.match(URL_RE);\n if (matches == null) {\n throw TypeError(`Failed to validate endpoint URL \\`${endpoint}\\``);\n }\n const [_,\n // eslint-disable-line @typescript-eslint/no-unused-vars\n hostish, portWithColon, rest] = matches;\n const protocol = endpoint.startsWith('https:') ? 'wss:' : 'ws:';\n const startPort = portWithColon == null ? null : parseInt(portWithColon.slice(1), 10);\n const websocketPort =\n // Only shift the port by +1 as a convention for ws(s) only if given endpoint\n // is explicitly specifying the endpoint port (HTTP-based RPC), assuming\n // we're directly trying to connect to solana-validator's ws listening port.\n // When the endpoint omits the port, we're connecting to the protocol\n // default ports: http(80) or https(443) and it's assumed we're behind a reverse\n // proxy which manages WebSocket upgrade and backend port redirection.\n startPort == null ? '' : `:${startPort + 1}`;\n return `${protocol}//${hostish}${websocketPort}${rest}`;\n}\n\nconst PublicKeyFromString = coerce(instance(PublicKey), string(), value => new PublicKey(value));\nconst RawAccountDataResult = tuple([string(), literal('base64')]);\nconst BufferFromRawAccountData = coerce(instance(Buffer), RawAccountDataResult, value => Buffer.from(value[0], 'base64'));\n\n/**\n * Attempt to use a recent blockhash for up to 30 seconds\n * @internal\n */\nconst BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1000;\n\n/**\n * HACK.\n * Copied from rpc-websockets/dist/lib/client.\n * Otherwise, `yarn build` fails with:\n * https://gist.github.com/steveluscher/c057eca81d479ef705cdb53162f9971d\n */\n\n/** @internal */\n/** @internal */\n/** @internal */\n/** @internal */\n\n/** @internal */\n/**\n * @internal\n * Every subscription contains the args used to open the subscription with\n * the server, and a list of callers interested in notifications.\n */\n\n/**\n * @internal\n * A subscription may be in various states of connectedness. Only when it is\n * fully connected will it have a server subscription id associated with it.\n * This id can be returned to the server to unsubscribe the client entirely.\n */\n\n/**\n * A type that encapsulates a subscription's RPC method\n * names and notification (callback) signature.\n */\n\n/**\n * @internal\n * Utility type that keeps tagged unions intact while omitting properties.\n */\n\n/**\n * @internal\n * This type represents a single subscribable 'topic.' It's made up of:\n *\n * - The args used to open the subscription with the server,\n * - The state of the subscription, in terms of its connectedness, and\n * - The set of callbacks to call when the server publishes notifications\n *\n * This record gets indexed by `SubscriptionConfigHash` and is used to\n * set up subscriptions, fan out notifications, and track subscription state.\n */\n\n/**\n * @internal\n */\n\n/**\n * Extra contextual information for RPC responses\n */\n\n/**\n * Options for sending transactions\n */\n\n/**\n * Options for confirming transactions\n */\n\n/**\n * Options for getConfirmedSignaturesForAddress2\n */\n\n/**\n * Options for getSignaturesForAddress\n */\n\n/**\n * RPC Response with extra contextual information\n */\n\n/**\n * A strategy for confirming transactions that uses the last valid\n * block height for a given blockhash to check for transaction expiration.\n */\n\n/**\n * A strategy for confirming durable nonce transactions.\n */\n\n/**\n * Properties shared by all transaction confirmation strategies\n */\n\n/**\n * This type represents all transaction confirmation strategies\n */\n\n/* @internal */\nfunction assertEndpointUrl(putativeUrl) {\n if (/^https?:/.test(putativeUrl) === false) {\n throw new TypeError('Endpoint URL must start with `http:` or `https:`.');\n }\n return putativeUrl;\n}\n\n/** @internal */\nfunction extractCommitmentFromConfig(commitmentOrConfig) {\n let commitment;\n let config;\n if (typeof commitmentOrConfig === 'string') {\n commitment = commitmentOrConfig;\n } else if (commitmentOrConfig) {\n const {\n commitment: specifiedCommitment,\n ...specifiedConfig\n } = commitmentOrConfig;\n commitment = specifiedCommitment;\n config = specifiedConfig;\n }\n return {\n commitment,\n config\n };\n}\n\n/**\n * @internal\n */\nfunction createRpcResult(result) {\n return union([type({\n jsonrpc: literal('2.0'),\n id: string(),\n result\n }), type({\n jsonrpc: literal('2.0'),\n id: string(),\n error: type({\n code: unknown(),\n message: string(),\n data: optional(any())\n })\n })]);\n}\nconst UnknownRpcResult = createRpcResult(unknown());\n\n/**\n * @internal\n */\nfunction jsonRpcResult(schema) {\n return coerce(createRpcResult(schema), UnknownRpcResult, value => {\n if ('error' in value) {\n return value;\n } else {\n return {\n ...value,\n result: create(value.result, schema)\n };\n }\n });\n}\n\n/**\n * @internal\n */\nfunction jsonRpcResultAndContext(value) {\n return jsonRpcResult(type({\n context: type({\n slot: number()\n }),\n value\n }));\n}\n\n/**\n * @internal\n */\nfunction notificationResultAndContext(value) {\n return type({\n context: type({\n slot: number()\n }),\n value\n });\n}\n\n/**\n * @internal\n */\nfunction versionedMessageFromResponse(version, response) {\n if (version === 0) {\n return new MessageV0({\n header: response.header,\n staticAccountKeys: response.accountKeys.map(accountKey => new PublicKey(accountKey)),\n recentBlockhash: response.recentBlockhash,\n compiledInstructions: response.instructions.map(ix => ({\n programIdIndex: ix.programIdIndex,\n accountKeyIndexes: ix.accounts,\n data: bs58.decode(ix.data)\n })),\n addressTableLookups: response.addressTableLookups\n });\n } else {\n return new Message(response);\n }\n}\n\n/**\n * The level of commitment desired when querying state\n *
\n *   'processed': Query the most recent block which has reached 1 confirmation by the connected node\n *   'confirmed': Query the most recent block which has reached 1 confirmation by the cluster\n *   'finalized': Query the most recent block which has been finalized by the cluster\n * 
\n */\n\n// Deprecated as of v1.5.5\n\n/**\n * A subset of Commitment levels, which are at least optimistically confirmed\n *
\n *   'confirmed': Query the most recent block which has reached 1 confirmation by the cluster\n *   'finalized': Query the most recent block which has been finalized by the cluster\n * 
\n */\n\n/**\n * Filter for largest accounts query\n *
\n *   'circulating':    Return the largest accounts that are part of the circulating supply\n *   'nonCirculating': Return the largest accounts that are not part of the circulating supply\n * 
\n */\n\n/**\n * Configuration object for changing `getAccountInfo` query behavior\n */\n\n/**\n * Configuration object for changing `getBalance` query behavior\n */\n\n/**\n * Configuration object for changing `getBlock` query behavior\n */\n\n/**\n * Configuration object for changing `getBlock` query behavior\n */\n\n/**\n * Configuration object for changing `getStakeMinimumDelegation` query behavior\n */\n\n/**\n * Configuration object for changing `getBlockHeight` query behavior\n */\n\n/**\n * Configuration object for changing `getEpochInfo` query behavior\n */\n\n/**\n * Configuration object for changing `getInflationReward` query behavior\n */\n\n/**\n * Configuration object for changing `getLatestBlockhash` query behavior\n */\n\n/**\n * Configuration object for changing `isBlockhashValid` query behavior\n */\n\n/**\n * Configuration object for changing `getSlot` query behavior\n */\n\n/**\n * Configuration object for changing `getSlotLeader` query behavior\n */\n\n/**\n * Configuration object for changing `getTransaction` query behavior\n */\n\n/**\n * Configuration object for changing `getTransaction` query behavior\n */\n\n/**\n * Configuration object for changing `getLargestAccounts` query behavior\n */\n\n/**\n * Configuration object for changing `getSupply` request behavior\n */\n\n/**\n * Configuration object for changing query behavior\n */\n\n/**\n * Information describing a cluster node\n */\n\n/**\n * Information describing a vote account\n */\n\n/**\n * A collection of cluster vote accounts\n */\n\n/**\n * Network Inflation\n * (see https://docs.solana.com/implemented-proposals/ed_overview)\n */\n\nconst GetInflationGovernorResult = type({\n foundation: number(),\n foundationTerm: number(),\n initial: number(),\n taper: number(),\n terminal: number()\n});\n\n/**\n * The inflation reward for an epoch\n */\n\n/**\n * Expected JSON RPC response for the \"getInflationReward\" message\n */\nconst GetInflationRewardResult = jsonRpcResult(array(nullable(type({\n epoch: number(),\n effectiveSlot: number(),\n amount: number(),\n postBalance: number(),\n commission: optional(nullable(number()))\n}))));\n\n/**\n * Configuration object for changing `getRecentPrioritizationFees` query behavior\n */\n\n/**\n * Expected JSON RPC response for the \"getRecentPrioritizationFees\" message\n */\nconst GetRecentPrioritizationFeesResult = array(type({\n slot: number(),\n prioritizationFee: number()\n}));\n/**\n * Expected JSON RPC response for the \"getInflationRate\" message\n */\nconst GetInflationRateResult = type({\n total: number(),\n validator: number(),\n foundation: number(),\n epoch: number()\n});\n\n/**\n * Information about the current epoch\n */\n\nconst GetEpochInfoResult = type({\n epoch: number(),\n slotIndex: number(),\n slotsInEpoch: number(),\n absoluteSlot: number(),\n blockHeight: optional(number()),\n transactionCount: optional(number())\n});\nconst GetEpochScheduleResult = type({\n slotsPerEpoch: number(),\n leaderScheduleSlotOffset: number(),\n warmup: boolean(),\n firstNormalEpoch: number(),\n firstNormalSlot: number()\n});\n\n/**\n * Leader schedule\n * (see https://docs.solana.com/terminology#leader-schedule)\n */\n\nconst GetLeaderScheduleResult = record(string(), array(number()));\n\n/**\n * Transaction error or null\n */\nconst TransactionErrorResult = nullable(union([type({}), string()]));\n\n/**\n * Signature status for a transaction\n */\nconst SignatureStatusResult = type({\n err: TransactionErrorResult\n});\n\n/**\n * Transaction signature received notification\n */\nconst SignatureReceivedResult = literal('receivedSignature');\n\n/**\n * Version info for a node\n */\n\nconst VersionResult = type({\n 'solana-core': string(),\n 'feature-set': optional(number())\n});\nconst SimulatedTransactionResponseStruct = jsonRpcResultAndContext(type({\n err: nullable(union([type({}), string()])),\n logs: nullable(array(string())),\n accounts: optional(nullable(array(nullable(type({\n executable: boolean(),\n owner: string(),\n lamports: number(),\n data: array(string()),\n rentEpoch: optional(number())\n }))))),\n unitsConsumed: optional(number()),\n returnData: optional(nullable(type({\n programId: string(),\n data: tuple([string(), literal('base64')])\n })))\n}));\n\n/**\n * Metadata for a parsed confirmed transaction on the ledger\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.\n */\n\n/**\n * Collection of addresses loaded by a transaction using address table lookups\n */\n\n/**\n * Metadata for a parsed transaction on the ledger\n */\n\n/**\n * Metadata for a confirmed transaction on the ledger\n */\n\n/**\n * A processed transaction from the RPC API\n */\n\n/**\n * A processed transaction from the RPC API\n */\n\n/**\n * A processed transaction message from the RPC API\n */\n\n/**\n * A confirmed transaction on the ledger\n *\n * @deprecated Deprecated since Solana v1.8.0.\n */\n\n/**\n * A partially decoded transaction instruction\n */\n\n/**\n * A parsed transaction message account\n */\n\n/**\n * A parsed transaction instruction\n */\n\n/**\n * A parsed address table lookup\n */\n\n/**\n * A parsed transaction message\n */\n\n/**\n * A parsed transaction\n */\n\n/**\n * A parsed and confirmed transaction on the ledger\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.\n */\n\n/**\n * A parsed transaction on the ledger with meta\n */\n\n/**\n * A processed block fetched from the RPC API\n */\n\n/**\n * A processed block fetched from the RPC API where the `transactionDetails` mode is `accounts`\n */\n\n/**\n * A processed block fetched from the RPC API where the `transactionDetails` mode is `none`\n */\n\n/**\n * A block with parsed transactions\n */\n\n/**\n * A block with parsed transactions where the `transactionDetails` mode is `accounts`\n */\n\n/**\n * A block with parsed transactions where the `transactionDetails` mode is `none`\n */\n\n/**\n * A processed block fetched from the RPC API\n */\n\n/**\n * A processed block fetched from the RPC API where the `transactionDetails` mode is `accounts`\n */\n\n/**\n * A processed block fetched from the RPC API where the `transactionDetails` mode is `none`\n */\n\n/**\n * A confirmed block on the ledger\n *\n * @deprecated Deprecated since Solana v1.8.0.\n */\n\n/**\n * A Block on the ledger with signatures only\n */\n\n/**\n * recent block production information\n */\n\n/**\n * Expected JSON RPC response for the \"getBlockProduction\" message\n */\nconst BlockProductionResponseStruct = jsonRpcResultAndContext(type({\n byIdentity: record(string(), array(number())),\n range: type({\n firstSlot: number(),\n lastSlot: number()\n })\n}));\n\n/**\n * A performance sample\n */\n\nfunction createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent) {\n const fetch = customFetch ? customFetch : fetchImpl;\n let agent;\n {\n if (httpAgent != null) {\n console.warn('You have supplied an `httpAgent` when creating a `Connection` in a browser environment.' + 'It has been ignored; `httpAgent` is only used in Node environments.');\n }\n }\n let fetchWithMiddleware;\n if (fetchMiddleware) {\n fetchWithMiddleware = async (info, init) => {\n const modifiedFetchArgs = await new Promise((resolve, reject) => {\n try {\n fetchMiddleware(info, init, (modifiedInfo, modifiedInit) => resolve([modifiedInfo, modifiedInit]));\n } catch (error) {\n reject(error);\n }\n });\n return await fetch(...modifiedFetchArgs);\n };\n }\n const clientBrowser = new RpcClient(async (request, callback) => {\n const options = {\n method: 'POST',\n body: request,\n agent,\n headers: Object.assign({\n 'Content-Type': 'application/json'\n }, httpHeaders || {}, COMMON_HTTP_HEADERS)\n };\n try {\n let too_many_requests_retries = 5;\n let res;\n let waitTime = 500;\n for (;;) {\n if (fetchWithMiddleware) {\n res = await fetchWithMiddleware(url, options);\n } else {\n res = await fetch(url, options);\n }\n if (res.status !== 429 /* Too many requests */) {\n break;\n }\n if (disableRetryOnRateLimit === true) {\n break;\n }\n too_many_requests_retries -= 1;\n if (too_many_requests_retries === 0) {\n break;\n }\n console.error(`Server responded with ${res.status} ${res.statusText}. Retrying after ${waitTime}ms delay...`);\n await sleep(waitTime);\n waitTime *= 2;\n }\n const text = await res.text();\n if (res.ok) {\n callback(null, text);\n } else {\n callback(new Error(`${res.status} ${res.statusText}: ${text}`));\n }\n } catch (err) {\n if (err instanceof Error) callback(err);\n }\n }, {});\n return clientBrowser;\n}\nfunction createRpcRequest(client) {\n return (method, args) => {\n return new Promise((resolve, reject) => {\n client.request(method, args, (err, response) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(response);\n });\n });\n };\n}\nfunction createRpcBatchRequest(client) {\n return requests => {\n return new Promise((resolve, reject) => {\n // Do nothing if requests is empty\n if (requests.length === 0) resolve([]);\n const batch = requests.map(params => {\n return client.request(params.methodName, params.args);\n });\n client.request(batch, (err, response) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(response);\n });\n });\n };\n}\n\n/**\n * Expected JSON RPC response for the \"getInflationGovernor\" message\n */\nconst GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);\n\n/**\n * Expected JSON RPC response for the \"getInflationRate\" message\n */\nconst GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);\n\n/**\n * Expected JSON RPC response for the \"getRecentPrioritizationFees\" message\n */\nconst GetRecentPrioritizationFeesRpcResult = jsonRpcResult(GetRecentPrioritizationFeesResult);\n\n/**\n * Expected JSON RPC response for the \"getEpochInfo\" message\n */\nconst GetEpochInfoRpcResult = jsonRpcResult(GetEpochInfoResult);\n\n/**\n * Expected JSON RPC response for the \"getEpochSchedule\" message\n */\nconst GetEpochScheduleRpcResult = jsonRpcResult(GetEpochScheduleResult);\n\n/**\n * Expected JSON RPC response for the \"getLeaderSchedule\" message\n */\nconst GetLeaderScheduleRpcResult = jsonRpcResult(GetLeaderScheduleResult);\n\n/**\n * Expected JSON RPC response for the \"minimumLedgerSlot\" and \"getFirstAvailableBlock\" messages\n */\nconst SlotRpcResult = jsonRpcResult(number());\n\n/**\n * Supply\n */\n\n/**\n * Expected JSON RPC response for the \"getSupply\" message\n */\nconst GetSupplyRpcResult = jsonRpcResultAndContext(type({\n total: number(),\n circulating: number(),\n nonCirculating: number(),\n nonCirculatingAccounts: array(PublicKeyFromString)\n}));\n\n/**\n * Token amount object which returns a token amount in different formats\n * for various client use cases.\n */\n\n/**\n * Expected JSON RPC structure for token amounts\n */\nconst TokenAmountResult = type({\n amount: string(),\n uiAmount: nullable(number()),\n decimals: number(),\n uiAmountString: optional(string())\n});\n\n/**\n * Token address and balance.\n */\n\n/**\n * Expected JSON RPC response for the \"getTokenLargestAccounts\" message\n */\nconst GetTokenLargestAccountsResult = jsonRpcResultAndContext(array(type({\n address: PublicKeyFromString,\n amount: string(),\n uiAmount: nullable(number()),\n decimals: number(),\n uiAmountString: optional(string())\n})));\n\n/**\n * Expected JSON RPC response for the \"getTokenAccountsByOwner\" message\n */\nconst GetTokenAccountsByOwner = jsonRpcResultAndContext(array(type({\n pubkey: PublicKeyFromString,\n account: type({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: BufferFromRawAccountData,\n rentEpoch: number()\n })\n})));\nconst ParsedAccountDataResult = type({\n program: string(),\n parsed: unknown(),\n space: number()\n});\n\n/**\n * Expected JSON RPC response for the \"getTokenAccountsByOwner\" message with parsed data\n */\nconst GetParsedTokenAccountsByOwner = jsonRpcResultAndContext(array(type({\n pubkey: PublicKeyFromString,\n account: type({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: ParsedAccountDataResult,\n rentEpoch: number()\n })\n})));\n\n/**\n * Pair of an account address and its balance\n */\n\n/**\n * Expected JSON RPC response for the \"getLargestAccounts\" message\n */\nconst GetLargestAccountsRpcResult = jsonRpcResultAndContext(array(type({\n lamports: number(),\n address: PublicKeyFromString\n})));\n\n/**\n * @internal\n */\nconst AccountInfoResult = type({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: BufferFromRawAccountData,\n rentEpoch: number()\n});\n\n/**\n * @internal\n */\nconst KeyedAccountInfoResult = type({\n pubkey: PublicKeyFromString,\n account: AccountInfoResult\n});\nconst ParsedOrRawAccountData = coerce(union([instance(Buffer), ParsedAccountDataResult]), union([RawAccountDataResult, ParsedAccountDataResult]), value => {\n if (Array.isArray(value)) {\n return create(value, BufferFromRawAccountData);\n } else {\n return value;\n }\n});\n\n/**\n * @internal\n */\nconst ParsedAccountInfoResult = type({\n executable: boolean(),\n owner: PublicKeyFromString,\n lamports: number(),\n data: ParsedOrRawAccountData,\n rentEpoch: number()\n});\nconst KeyedParsedAccountInfoResult = type({\n pubkey: PublicKeyFromString,\n account: ParsedAccountInfoResult\n});\n\n/**\n * @internal\n */\nconst StakeActivationResult = type({\n state: union([literal('active'), literal('inactive'), literal('activating'), literal('deactivating')]),\n active: number(),\n inactive: number()\n});\n\n/**\n * Expected JSON RPC response for the \"getConfirmedSignaturesForAddress2\" message\n */\n\nconst GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult(array(type({\n signature: string(),\n slot: number(),\n err: TransactionErrorResult,\n memo: nullable(string()),\n blockTime: optional(nullable(number()))\n})));\n\n/**\n * Expected JSON RPC response for the \"getSignaturesForAddress\" message\n */\nconst GetSignaturesForAddressRpcResult = jsonRpcResult(array(type({\n signature: string(),\n slot: number(),\n err: TransactionErrorResult,\n memo: nullable(string()),\n blockTime: optional(nullable(number()))\n})));\n\n/***\n * Expected JSON RPC response for the \"accountNotification\" message\n */\nconst AccountNotificationResult = type({\n subscription: number(),\n result: notificationResultAndContext(AccountInfoResult)\n});\n\n/**\n * @internal\n */\nconst ProgramAccountInfoResult = type({\n pubkey: PublicKeyFromString,\n account: AccountInfoResult\n});\n\n/***\n * Expected JSON RPC response for the \"programNotification\" message\n */\nconst ProgramAccountNotificationResult = type({\n subscription: number(),\n result: notificationResultAndContext(ProgramAccountInfoResult)\n});\n\n/**\n * @internal\n */\nconst SlotInfoResult = type({\n parent: number(),\n slot: number(),\n root: number()\n});\n\n/**\n * Expected JSON RPC response for the \"slotNotification\" message\n */\nconst SlotNotificationResult = type({\n subscription: number(),\n result: SlotInfoResult\n});\n\n/**\n * Slot updates which can be used for tracking the live progress of a cluster.\n * - `\"firstShredReceived\"`: connected node received the first shred of a block.\n * Indicates that a new block that is being produced.\n * - `\"completed\"`: connected node has received all shreds of a block. Indicates\n * a block was recently produced.\n * - `\"optimisticConfirmation\"`: block was optimistically confirmed by the\n * cluster. It is not guaranteed that an optimistic confirmation notification\n * will be sent for every finalized blocks.\n * - `\"root\"`: the connected node rooted this block.\n * - `\"createdBank\"`: the connected node has started validating this block.\n * - `\"frozen\"`: the connected node has validated this block.\n * - `\"dead\"`: the connected node failed to validate this block.\n */\n\n/**\n * @internal\n */\nconst SlotUpdateResult = union([type({\n type: union([literal('firstShredReceived'), literal('completed'), literal('optimisticConfirmation'), literal('root')]),\n slot: number(),\n timestamp: number()\n}), type({\n type: literal('createdBank'),\n parent: number(),\n slot: number(),\n timestamp: number()\n}), type({\n type: literal('frozen'),\n slot: number(),\n timestamp: number(),\n stats: type({\n numTransactionEntries: number(),\n numSuccessfulTransactions: number(),\n numFailedTransactions: number(),\n maxTransactionsPerEntry: number()\n })\n}), type({\n type: literal('dead'),\n slot: number(),\n timestamp: number(),\n err: string()\n})]);\n\n/**\n * Expected JSON RPC response for the \"slotsUpdatesNotification\" message\n */\nconst SlotUpdateNotificationResult = type({\n subscription: number(),\n result: SlotUpdateResult\n});\n\n/**\n * Expected JSON RPC response for the \"signatureNotification\" message\n */\nconst SignatureNotificationResult = type({\n subscription: number(),\n result: notificationResultAndContext(union([SignatureStatusResult, SignatureReceivedResult]))\n});\n\n/**\n * Expected JSON RPC response for the \"rootNotification\" message\n */\nconst RootNotificationResult = type({\n subscription: number(),\n result: number()\n});\nconst ContactInfoResult = type({\n pubkey: string(),\n gossip: nullable(string()),\n tpu: nullable(string()),\n rpc: nullable(string()),\n version: nullable(string())\n});\nconst VoteAccountInfoResult = type({\n votePubkey: string(),\n nodePubkey: string(),\n activatedStake: number(),\n epochVoteAccount: boolean(),\n epochCredits: array(tuple([number(), number(), number()])),\n commission: number(),\n lastVote: number(),\n rootSlot: nullable(number())\n});\n\n/**\n * Expected JSON RPC response for the \"getVoteAccounts\" message\n */\nconst GetVoteAccounts = jsonRpcResult(type({\n current: array(VoteAccountInfoResult),\n delinquent: array(VoteAccountInfoResult)\n}));\nconst ConfirmationStatus = union([literal('processed'), literal('confirmed'), literal('finalized')]);\nconst SignatureStatusResponse = type({\n slot: number(),\n confirmations: nullable(number()),\n err: TransactionErrorResult,\n confirmationStatus: optional(ConfirmationStatus)\n});\n\n/**\n * Expected JSON RPC response for the \"getSignatureStatuses\" message\n */\nconst GetSignatureStatusesRpcResult = jsonRpcResultAndContext(array(nullable(SignatureStatusResponse)));\n\n/**\n * Expected JSON RPC response for the \"getMinimumBalanceForRentExemption\" message\n */\nconst GetMinimumBalanceForRentExemptionRpcResult = jsonRpcResult(number());\nconst AddressTableLookupStruct = type({\n accountKey: PublicKeyFromString,\n writableIndexes: array(number()),\n readonlyIndexes: array(number())\n});\nconst ConfirmedTransactionResult = type({\n signatures: array(string()),\n message: type({\n accountKeys: array(string()),\n header: type({\n numRequiredSignatures: number(),\n numReadonlySignedAccounts: number(),\n numReadonlyUnsignedAccounts: number()\n }),\n instructions: array(type({\n accounts: array(number()),\n data: string(),\n programIdIndex: number()\n })),\n recentBlockhash: string(),\n addressTableLookups: optional(array(AddressTableLookupStruct))\n })\n});\nconst AnnotatedAccountKey = type({\n pubkey: PublicKeyFromString,\n signer: boolean(),\n writable: boolean(),\n source: optional(union([literal('transaction'), literal('lookupTable')]))\n});\nconst ConfirmedTransactionAccountsModeResult = type({\n accountKeys: array(AnnotatedAccountKey),\n signatures: array(string())\n});\nconst ParsedInstructionResult = type({\n parsed: unknown(),\n program: string(),\n programId: PublicKeyFromString\n});\nconst RawInstructionResult = type({\n accounts: array(PublicKeyFromString),\n data: string(),\n programId: PublicKeyFromString\n});\nconst InstructionResult = union([RawInstructionResult, ParsedInstructionResult]);\nconst UnknownInstructionResult = union([type({\n parsed: unknown(),\n program: string(),\n programId: string()\n}), type({\n accounts: array(string()),\n data: string(),\n programId: string()\n})]);\nconst ParsedOrRawInstruction = coerce(InstructionResult, UnknownInstructionResult, value => {\n if ('accounts' in value) {\n return create(value, RawInstructionResult);\n } else {\n return create(value, ParsedInstructionResult);\n }\n});\n\n/**\n * @internal\n */\nconst ParsedConfirmedTransactionResult = type({\n signatures: array(string()),\n message: type({\n accountKeys: array(AnnotatedAccountKey),\n instructions: array(ParsedOrRawInstruction),\n recentBlockhash: string(),\n addressTableLookups: optional(nullable(array(AddressTableLookupStruct)))\n })\n});\nconst TokenBalanceResult = type({\n accountIndex: number(),\n mint: string(),\n owner: optional(string()),\n uiTokenAmount: TokenAmountResult\n});\nconst LoadedAddressesResult = type({\n writable: array(PublicKeyFromString),\n readonly: array(PublicKeyFromString)\n});\n\n/**\n * @internal\n */\nconst ConfirmedTransactionMetaResult = type({\n err: TransactionErrorResult,\n fee: number(),\n innerInstructions: optional(nullable(array(type({\n index: number(),\n instructions: array(type({\n accounts: array(number()),\n data: string(),\n programIdIndex: number()\n }))\n })))),\n preBalances: array(number()),\n postBalances: array(number()),\n logMessages: optional(nullable(array(string()))),\n preTokenBalances: optional(nullable(array(TokenBalanceResult))),\n postTokenBalances: optional(nullable(array(TokenBalanceResult))),\n loadedAddresses: optional(LoadedAddressesResult),\n computeUnitsConsumed: optional(number())\n});\n\n/**\n * @internal\n */\nconst ParsedConfirmedTransactionMetaResult = type({\n err: TransactionErrorResult,\n fee: number(),\n innerInstructions: optional(nullable(array(type({\n index: number(),\n instructions: array(ParsedOrRawInstruction)\n })))),\n preBalances: array(number()),\n postBalances: array(number()),\n logMessages: optional(nullable(array(string()))),\n preTokenBalances: optional(nullable(array(TokenBalanceResult))),\n postTokenBalances: optional(nullable(array(TokenBalanceResult))),\n loadedAddresses: optional(LoadedAddressesResult),\n computeUnitsConsumed: optional(number())\n});\nconst TransactionVersionStruct = union([literal(0), literal('legacy')]);\n\n/** @internal */\nconst RewardsResult = type({\n pubkey: string(),\n lamports: number(),\n postBalance: nullable(number()),\n rewardType: nullable(string()),\n commission: optional(nullable(number()))\n});\n\n/**\n * Expected JSON RPC response for the \"getBlock\" message\n */\nconst GetBlockRpcResult = jsonRpcResult(nullable(type({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n transactions: array(type({\n transaction: ConfirmedTransactionResult,\n meta: nullable(ConfirmedTransactionMetaResult),\n version: optional(TransactionVersionStruct)\n })),\n rewards: optional(array(RewardsResult)),\n blockTime: nullable(number()),\n blockHeight: nullable(number())\n})));\n\n/**\n * Expected JSON RPC response for the \"getBlock\" message when `transactionDetails` is `none`\n */\nconst GetNoneModeBlockRpcResult = jsonRpcResult(nullable(type({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n rewards: optional(array(RewardsResult)),\n blockTime: nullable(number()),\n blockHeight: nullable(number())\n})));\n\n/**\n * Expected JSON RPC response for the \"getBlock\" message when `transactionDetails` is `accounts`\n */\nconst GetAccountsModeBlockRpcResult = jsonRpcResult(nullable(type({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n transactions: array(type({\n transaction: ConfirmedTransactionAccountsModeResult,\n meta: nullable(ConfirmedTransactionMetaResult),\n version: optional(TransactionVersionStruct)\n })),\n rewards: optional(array(RewardsResult)),\n blockTime: nullable(number()),\n blockHeight: nullable(number())\n})));\n\n/**\n * Expected parsed JSON RPC response for the \"getBlock\" message\n */\nconst GetParsedBlockRpcResult = jsonRpcResult(nullable(type({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n transactions: array(type({\n transaction: ParsedConfirmedTransactionResult,\n meta: nullable(ParsedConfirmedTransactionMetaResult),\n version: optional(TransactionVersionStruct)\n })),\n rewards: optional(array(RewardsResult)),\n blockTime: nullable(number()),\n blockHeight: nullable(number())\n})));\n\n/**\n * Expected parsed JSON RPC response for the \"getBlock\" message when `transactionDetails` is `accounts`\n */\nconst GetParsedAccountsModeBlockRpcResult = jsonRpcResult(nullable(type({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n transactions: array(type({\n transaction: ConfirmedTransactionAccountsModeResult,\n meta: nullable(ParsedConfirmedTransactionMetaResult),\n version: optional(TransactionVersionStruct)\n })),\n rewards: optional(array(RewardsResult)),\n blockTime: nullable(number()),\n blockHeight: nullable(number())\n})));\n\n/**\n * Expected parsed JSON RPC response for the \"getBlock\" message when `transactionDetails` is `none`\n */\nconst GetParsedNoneModeBlockRpcResult = jsonRpcResult(nullable(type({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n rewards: optional(array(RewardsResult)),\n blockTime: nullable(number()),\n blockHeight: nullable(number())\n})));\n\n/**\n * Expected JSON RPC response for the \"getConfirmedBlock\" message\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetBlockRpcResult} instead.\n */\nconst GetConfirmedBlockRpcResult = jsonRpcResult(nullable(type({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n transactions: array(type({\n transaction: ConfirmedTransactionResult,\n meta: nullable(ConfirmedTransactionMetaResult)\n })),\n rewards: optional(array(RewardsResult)),\n blockTime: nullable(number())\n})));\n\n/**\n * Expected JSON RPC response for the \"getBlock\" message\n */\nconst GetBlockSignaturesRpcResult = jsonRpcResult(nullable(type({\n blockhash: string(),\n previousBlockhash: string(),\n parentSlot: number(),\n signatures: array(string()),\n blockTime: nullable(number())\n})));\n\n/**\n * Expected JSON RPC response for the \"getTransaction\" message\n */\nconst GetTransactionRpcResult = jsonRpcResult(nullable(type({\n slot: number(),\n meta: nullable(ConfirmedTransactionMetaResult),\n blockTime: optional(nullable(number())),\n transaction: ConfirmedTransactionResult,\n version: optional(TransactionVersionStruct)\n})));\n\n/**\n * Expected parsed JSON RPC response for the \"getTransaction\" message\n */\nconst GetParsedTransactionRpcResult = jsonRpcResult(nullable(type({\n slot: number(),\n transaction: ParsedConfirmedTransactionResult,\n meta: nullable(ParsedConfirmedTransactionMetaResult),\n blockTime: optional(nullable(number())),\n version: optional(TransactionVersionStruct)\n})));\n\n/**\n * Expected JSON RPC response for the \"getRecentBlockhash\" message\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.\n */\nconst GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext(type({\n blockhash: string(),\n feeCalculator: type({\n lamportsPerSignature: number()\n })\n}));\n\n/**\n * Expected JSON RPC response for the \"getLatestBlockhash\" message\n */\nconst GetLatestBlockhashRpcResult = jsonRpcResultAndContext(type({\n blockhash: string(),\n lastValidBlockHeight: number()\n}));\n\n/**\n * Expected JSON RPC response for the \"isBlockhashValid\" message\n */\nconst IsBlockhashValidRpcResult = jsonRpcResultAndContext(boolean());\nconst PerfSampleResult = type({\n slot: number(),\n numTransactions: number(),\n numSlots: number(),\n samplePeriodSecs: number()\n});\n\n/*\n * Expected JSON RPC response for \"getRecentPerformanceSamples\" message\n */\nconst GetRecentPerformanceSamplesRpcResult = jsonRpcResult(array(PerfSampleResult));\n\n/**\n * Expected JSON RPC response for the \"getFeeCalculatorForBlockhash\" message\n */\nconst GetFeeCalculatorRpcResult = jsonRpcResultAndContext(nullable(type({\n feeCalculator: type({\n lamportsPerSignature: number()\n })\n})));\n\n/**\n * Expected JSON RPC response for the \"requestAirdrop\" message\n */\nconst RequestAirdropRpcResult = jsonRpcResult(string());\n\n/**\n * Expected JSON RPC response for the \"sendTransaction\" message\n */\nconst SendTransactionRpcResult = jsonRpcResult(string());\n\n/**\n * Information about the latest slot being processed by a node\n */\n\n/**\n * Parsed account data\n */\n\n/**\n * Stake Activation data\n */\n\n/**\n * Data slice argument for getProgramAccounts\n */\n\n/**\n * Memory comparison filter for getProgramAccounts\n */\n\n/**\n * Data size comparison filter for getProgramAccounts\n */\n\n/**\n * A filter object for getProgramAccounts\n */\n\n/**\n * Configuration object for getProgramAccounts requests\n */\n\n/**\n * Configuration object for getParsedProgramAccounts\n */\n\n/**\n * Configuration object for getMultipleAccounts\n */\n\n/**\n * Configuration object for `getStakeActivation`\n */\n\n/**\n * Configuration object for `getStakeActivation`\n */\n\n/**\n * Configuration object for `getStakeActivation`\n */\n\n/**\n * Configuration object for `getNonce`\n */\n\n/**\n * Configuration object for `getNonceAndContext`\n */\n\n/**\n * Information describing an account\n */\n\n/**\n * Account information identified by pubkey\n */\n\n/**\n * Callback function for account change notifications\n */\n\n/**\n * Callback function for program account change notifications\n */\n\n/**\n * Callback function for slot change notifications\n */\n\n/**\n * Callback function for slot update notifications\n */\n\n/**\n * Callback function for signature status notifications\n */\n\n/**\n * Signature status notification with transaction result\n */\n\n/**\n * Signature received notification\n */\n\n/**\n * Callback function for signature notifications\n */\n\n/**\n * Signature subscription options\n */\n\n/**\n * Callback function for root change notifications\n */\n\n/**\n * @internal\n */\nconst LogsResult = type({\n err: TransactionErrorResult,\n logs: array(string()),\n signature: string()\n});\n\n/**\n * Logs result.\n */\n\n/**\n * Expected JSON RPC response for the \"logsNotification\" message.\n */\nconst LogsNotificationResult = type({\n result: notificationResultAndContext(LogsResult),\n subscription: number()\n});\n\n/**\n * Filter for log subscriptions.\n */\n\n/**\n * Callback function for log notifications.\n */\n\n/**\n * Signature result\n */\n\n/**\n * Transaction error\n */\n\n/**\n * Transaction confirmation status\n *
\n *   'processed': Transaction landed in a block which has reached 1 confirmation by the connected node\n *   'confirmed': Transaction landed in a block which has reached 1 confirmation by the cluster\n *   'finalized': Transaction landed in a block which has been finalized by the cluster\n * 
\n */\n\n/**\n * Signature status\n */\n\n/**\n * A confirmed signature with its status\n */\n\n/**\n * An object defining headers to be passed to the RPC server\n */\n\n/**\n * The type of the JavaScript `fetch()` API\n */\n\n/**\n * A callback used to augment the outgoing HTTP request\n */\n\n/**\n * Configuration for instantiating a Connection\n */\n\n/** @internal */\nconst COMMON_HTTP_HEADERS = {\n 'solana-client': `js/${\"0.0.0-development\" }`\n};\n\n/**\n * A connection to a fullnode JSON RPC endpoint\n */\nclass Connection {\n /**\n * Establish a JSON RPC connection\n *\n * @param endpoint URL to the fullnode JSON RPC endpoint\n * @param commitmentOrConfig optional default commitment level or optional ConnectionConfig configuration object\n */\n constructor(endpoint, _commitmentOrConfig) {\n /** @internal */\n this._commitment = void 0;\n /** @internal */\n this._confirmTransactionInitialTimeout = void 0;\n /** @internal */\n this._rpcEndpoint = void 0;\n /** @internal */\n this._rpcWsEndpoint = void 0;\n /** @internal */\n this._rpcClient = void 0;\n /** @internal */\n this._rpcRequest = void 0;\n /** @internal */\n this._rpcBatchRequest = void 0;\n /** @internal */\n this._rpcWebSocket = void 0;\n /** @internal */\n this._rpcWebSocketConnected = false;\n /** @internal */\n this._rpcWebSocketHeartbeat = null;\n /** @internal */\n this._rpcWebSocketIdleTimeout = null;\n /** @internal\n * A number that we increment every time an active connection closes.\n * Used to determine whether the same socket connection that was open\n * when an async operation started is the same one that's active when\n * its continuation fires.\n *\n */\n this._rpcWebSocketGeneration = 0;\n /** @internal */\n this._disableBlockhashCaching = false;\n /** @internal */\n this._pollingBlockhash = false;\n /** @internal */\n this._blockhashInfo = {\n latestBlockhash: null,\n lastFetch: 0,\n transactionSignatures: [],\n simulatedSignatures: []\n };\n /** @internal */\n this._nextClientSubscriptionId = 0;\n /** @internal */\n this._subscriptionDisposeFunctionsByClientSubscriptionId = {};\n /** @internal */\n this._subscriptionHashByClientSubscriptionId = {};\n /** @internal */\n this._subscriptionStateChangeCallbacksByHash = {};\n /** @internal */\n this._subscriptionCallbacksByServerSubscriptionId = {};\n /** @internal */\n this._subscriptionsByHash = {};\n /**\n * Special case.\n * After a signature is processed, RPCs automatically dispose of the\n * subscription on the server side. We need to track which of these\n * subscriptions have been disposed in such a way, so that we know\n * whether the client is dealing with a not-yet-processed signature\n * (in which case we must tear down the server subscription) or an\n * already-processed signature (in which case the client can simply\n * clear out the subscription locally without telling the server).\n *\n * NOTE: There is a proposal to eliminate this special case, here:\n * https://github.com/solana-labs/solana/issues/18892\n */\n /** @internal */\n this._subscriptionsAutoDisposedByRpc = new Set();\n /*\n * Returns the current block height of the node\n */\n this.getBlockHeight = (() => {\n const requestPromises = {};\n return async commitmentOrConfig => {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const requestHash = fastStableStringify$1(args);\n requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {\n try {\n const unsafeRes = await this._rpcRequest('getBlockHeight', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get block height information');\n }\n return res.result;\n } finally {\n delete requestPromises[requestHash];\n }\n })();\n return await requestPromises[requestHash];\n };\n })();\n let wsEndpoint;\n let httpHeaders;\n let fetch;\n let fetchMiddleware;\n let disableRetryOnRateLimit;\n let httpAgent;\n if (_commitmentOrConfig && typeof _commitmentOrConfig === 'string') {\n this._commitment = _commitmentOrConfig;\n } else if (_commitmentOrConfig) {\n this._commitment = _commitmentOrConfig.commitment;\n this._confirmTransactionInitialTimeout = _commitmentOrConfig.confirmTransactionInitialTimeout;\n wsEndpoint = _commitmentOrConfig.wsEndpoint;\n httpHeaders = _commitmentOrConfig.httpHeaders;\n fetch = _commitmentOrConfig.fetch;\n fetchMiddleware = _commitmentOrConfig.fetchMiddleware;\n disableRetryOnRateLimit = _commitmentOrConfig.disableRetryOnRateLimit;\n httpAgent = _commitmentOrConfig.httpAgent;\n }\n this._rpcEndpoint = assertEndpointUrl(endpoint);\n this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);\n this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent);\n this._rpcRequest = createRpcRequest(this._rpcClient);\n this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);\n this._rpcWebSocket = new RpcWebSocketClient(this._rpcWsEndpoint, {\n autoconnect: false,\n max_reconnects: Infinity\n });\n this._rpcWebSocket.on('open', this._wsOnOpen.bind(this));\n this._rpcWebSocket.on('error', this._wsOnError.bind(this));\n this._rpcWebSocket.on('close', this._wsOnClose.bind(this));\n this._rpcWebSocket.on('accountNotification', this._wsOnAccountNotification.bind(this));\n this._rpcWebSocket.on('programNotification', this._wsOnProgramAccountNotification.bind(this));\n this._rpcWebSocket.on('slotNotification', this._wsOnSlotNotification.bind(this));\n this._rpcWebSocket.on('slotsUpdatesNotification', this._wsOnSlotUpdatesNotification.bind(this));\n this._rpcWebSocket.on('signatureNotification', this._wsOnSignatureNotification.bind(this));\n this._rpcWebSocket.on('rootNotification', this._wsOnRootNotification.bind(this));\n this._rpcWebSocket.on('logsNotification', this._wsOnLogsNotification.bind(this));\n }\n\n /**\n * The default commitment used for requests\n */\n get commitment() {\n return this._commitment;\n }\n\n /**\n * The RPC endpoint\n */\n get rpcEndpoint() {\n return this._rpcEndpoint;\n }\n\n /**\n * Fetch the balance for the specified public key, return with context\n */\n async getBalanceAndContext(publicKey, commitmentOrConfig) {\n /** @internal */\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([publicKey.toBase58()], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getBalance', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(number()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get balance for ${publicKey.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch the balance for the specified public key\n */\n async getBalance(publicKey, commitmentOrConfig) {\n return await this.getBalanceAndContext(publicKey, commitmentOrConfig).then(x => x.value).catch(e => {\n throw new Error('failed to get balance of account ' + publicKey.toBase58() + ': ' + e);\n });\n }\n\n /**\n * Fetch the estimated production time of a block\n */\n async getBlockTime(slot) {\n const unsafeRes = await this._rpcRequest('getBlockTime', [slot]);\n const res = create(unsafeRes, jsonRpcResult(nullable(number())));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get block time for slot ${slot}`);\n }\n return res.result;\n }\n\n /**\n * Fetch the lowest slot that the node has information about in its ledger.\n * This value may increase over time if the node is configured to purge older ledger data\n */\n async getMinimumLedgerSlot() {\n const unsafeRes = await this._rpcRequest('minimumLedgerSlot', []);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get minimum ledger slot');\n }\n return res.result;\n }\n\n /**\n * Fetch the slot of the lowest confirmed block that has not been purged from the ledger\n */\n async getFirstAvailableBlock() {\n const unsafeRes = await this._rpcRequest('getFirstAvailableBlock', []);\n const res = create(unsafeRes, SlotRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get first available block');\n }\n return res.result;\n }\n\n /**\n * Fetch information about the current supply\n */\n async getSupply(config) {\n let configArg = {};\n if (typeof config === 'string') {\n configArg = {\n commitment: config\n };\n } else if (config) {\n configArg = {\n ...config,\n commitment: config && config.commitment || this.commitment\n };\n } else {\n configArg = {\n commitment: this.commitment\n };\n }\n const unsafeRes = await this._rpcRequest('getSupply', [configArg]);\n const res = create(unsafeRes, GetSupplyRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get supply');\n }\n return res.result;\n }\n\n /**\n * Fetch the current supply of a token mint\n */\n async getTokenSupply(tokenMintAddress, commitment) {\n const args = this._buildArgs([tokenMintAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenSupply', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get token supply');\n }\n return res.result;\n }\n\n /**\n * Fetch the current balance of a token account\n */\n async getTokenAccountBalance(tokenAddress, commitment) {\n const args = this._buildArgs([tokenAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenAccountBalance', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get token account balance');\n }\n return res.result;\n }\n\n /**\n * Fetch all the token accounts owned by the specified account\n *\n * @return {Promise}\n */\n async getTokenAccountsByOwner(ownerAddress, filter, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n let _args = [ownerAddress.toBase58()];\n if ('mint' in filter) {\n _args.push({\n mint: filter.mint.toBase58()\n });\n } else {\n _args.push({\n programId: filter.programId.toBase58()\n });\n }\n const args = this._buildArgs(_args, commitment, 'base64', config);\n const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);\n const res = create(unsafeRes, GetTokenAccountsByOwner);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch parsed token accounts owned by the specified account\n *\n * @return {Promise}>>>}\n */\n async getParsedTokenAccountsByOwner(ownerAddress, filter, commitment) {\n let _args = [ownerAddress.toBase58()];\n if ('mint' in filter) {\n _args.push({\n mint: filter.mint.toBase58()\n });\n } else {\n _args.push({\n programId: filter.programId.toBase58()\n });\n }\n const args = this._buildArgs(_args, commitment, 'jsonParsed');\n const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);\n const res = create(unsafeRes, GetParsedTokenAccountsByOwner);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch the 20 largest accounts with their current balances\n */\n async getLargestAccounts(config) {\n const arg = {\n ...config,\n commitment: config && config.commitment || this.commitment\n };\n const args = arg.filter || arg.commitment ? [arg] : [];\n const unsafeRes = await this._rpcRequest('getLargestAccounts', args);\n const res = create(unsafeRes, GetLargestAccountsRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get largest accounts');\n }\n return res.result;\n }\n\n /**\n * Fetch the 20 largest token accounts with their current balances\n * for a given mint.\n */\n async getTokenLargestAccounts(mintAddress, commitment) {\n const args = this._buildArgs([mintAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenLargestAccounts', args);\n const res = create(unsafeRes, GetTokenLargestAccountsResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get token largest accounts');\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for the specified public key, return with context\n */\n async getAccountInfoAndContext(publicKey, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([publicKey.toBase58()], commitment, 'base64', config);\n const unsafeRes = await this._rpcRequest('getAccountInfo', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(nullable(AccountInfoResult)));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch parsed account info for the specified public key\n */\n async getParsedAccountInfo(publicKey, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed', config);\n const unsafeRes = await this._rpcRequest('getAccountInfo', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(nullable(ParsedAccountInfoResult)));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for the specified public key\n */\n async getAccountInfo(publicKey, commitmentOrConfig) {\n try {\n const res = await this.getAccountInfoAndContext(publicKey, commitmentOrConfig);\n return res.value;\n } catch (e) {\n throw new Error('failed to get info about account ' + publicKey.toBase58() + ': ' + e);\n }\n }\n\n /**\n * Fetch all the account info for multiple accounts specified by an array of public keys, return with context\n */\n async getMultipleParsedAccounts(publicKeys, rawConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(rawConfig);\n const keys = publicKeys.map(key => key.toBase58());\n const args = this._buildArgs([keys], commitment, 'jsonParsed', config);\n const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(ParsedAccountInfoResult))));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys}`);\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for multiple accounts specified by an array of public keys, return with context\n */\n async getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const keys = publicKeys.map(key => key.toBase58());\n const args = this._buildArgs([keys], commitment, 'base64', config);\n const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(array(nullable(AccountInfoResult))));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys}`);\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for multiple accounts specified by an array of public keys\n */\n async getMultipleAccountsInfo(publicKeys, commitmentOrConfig) {\n const res = await this.getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig);\n return res.value;\n }\n\n /**\n * Returns epoch activation information for a stake account that has been delegated\n */\n async getStakeActivation(publicKey, commitmentOrConfig, epoch) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([publicKey.toBase58()], commitment, undefined /* encoding */, {\n ...config,\n epoch: epoch != null ? epoch : config?.epoch\n });\n const unsafeRes = await this._rpcRequest('getStakeActivation', args);\n const res = create(unsafeRes, jsonRpcResult(StakeActivationResult));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get Stake Activation ${publicKey.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch all the accounts owned by the specified program id\n *\n * @return {Promise}>>}\n */\n\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n async getProgramAccounts(programId, configOrCommitment) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(configOrCommitment);\n const {\n encoding,\n ...configWithoutEncoding\n } = config || {};\n const args = this._buildArgs([programId.toBase58()], commitment, encoding || 'base64', configWithoutEncoding);\n const unsafeRes = await this._rpcRequest('getProgramAccounts', args);\n const baseSchema = array(KeyedAccountInfoResult);\n const res = configWithoutEncoding.withContext === true ? create(unsafeRes, jsonRpcResultAndContext(baseSchema)) : create(unsafeRes, jsonRpcResult(baseSchema));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch and parse all the accounts owned by the specified program id\n *\n * @return {Promise}>>}\n */\n async getParsedProgramAccounts(programId, configOrCommitment) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(configOrCommitment);\n const args = this._buildArgs([programId.toBase58()], commitment, 'jsonParsed', config);\n const unsafeRes = await this._rpcRequest('getProgramAccounts', args);\n const res = create(unsafeRes, jsonRpcResult(array(KeyedParsedAccountInfoResult)));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`);\n }\n return res.result;\n }\n\n /** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n async confirmTransaction(strategy, commitment) {\n let rawSignature;\n if (typeof strategy == 'string') {\n rawSignature = strategy;\n } else {\n const config = strategy;\n if (config.abortSignal?.aborted) {\n return Promise.reject(config.abortSignal.reason);\n }\n rawSignature = config.signature;\n }\n let decodedSignature;\n try {\n decodedSignature = bs58.decode(rawSignature);\n } catch (err) {\n throw new Error('signature must be base58 encoded: ' + rawSignature);\n }\n assert(decodedSignature.length === 64, 'signature has invalid length');\n if (typeof strategy === 'string') {\n return await this.confirmTransactionUsingLegacyTimeoutStrategy({\n commitment: commitment || this.commitment,\n signature: rawSignature\n });\n } else if ('lastValidBlockHeight' in strategy) {\n return await this.confirmTransactionUsingBlockHeightExceedanceStrategy({\n commitment: commitment || this.commitment,\n strategy\n });\n } else {\n return await this.confirmTransactionUsingDurableNonceStrategy({\n commitment: commitment || this.commitment,\n strategy\n });\n }\n }\n getCancellationPromise(signal) {\n return new Promise((_, reject) => {\n if (signal == null) {\n return;\n }\n if (signal.aborted) {\n reject(signal.reason);\n } else {\n signal.addEventListener('abort', () => {\n reject(signal.reason);\n });\n }\n });\n }\n getTransactionConfirmationPromise({\n commitment,\n signature\n }) {\n let signatureSubscriptionId;\n let disposeSignatureSubscriptionStateChangeObserver;\n let done = false;\n const confirmationPromise = new Promise((resolve, reject) => {\n try {\n signatureSubscriptionId = this.onSignature(signature, (result, context) => {\n signatureSubscriptionId = undefined;\n const response = {\n context,\n value: result\n };\n resolve({\n __type: TransactionStatus.PROCESSED,\n response\n });\n }, commitment);\n const subscriptionSetupPromise = new Promise(resolveSubscriptionSetup => {\n if (signatureSubscriptionId == null) {\n resolveSubscriptionSetup();\n } else {\n disposeSignatureSubscriptionStateChangeObserver = this._onSubscriptionStateChange(signatureSubscriptionId, nextState => {\n if (nextState === 'subscribed') {\n resolveSubscriptionSetup();\n }\n });\n }\n });\n (async () => {\n await subscriptionSetupPromise;\n if (done) return;\n const response = await this.getSignatureStatus(signature);\n if (done) return;\n if (response == null) {\n return;\n }\n const {\n context,\n value\n } = response;\n if (value == null) {\n return;\n }\n if (value?.err) {\n reject(value.err);\n } else {\n switch (commitment) {\n case 'confirmed':\n case 'single':\n case 'singleGossip':\n {\n if (value.confirmationStatus === 'processed') {\n return;\n }\n break;\n }\n case 'finalized':\n case 'max':\n case 'root':\n {\n if (value.confirmationStatus === 'processed' || value.confirmationStatus === 'confirmed') {\n return;\n }\n break;\n }\n // exhaust enums to ensure full coverage\n case 'processed':\n case 'recent':\n }\n done = true;\n resolve({\n __type: TransactionStatus.PROCESSED,\n response: {\n context,\n value\n }\n });\n }\n })();\n } catch (err) {\n reject(err);\n }\n });\n const abortConfirmation = () => {\n if (disposeSignatureSubscriptionStateChangeObserver) {\n disposeSignatureSubscriptionStateChangeObserver();\n disposeSignatureSubscriptionStateChangeObserver = undefined;\n }\n if (signatureSubscriptionId != null) {\n this.removeSignatureListener(signatureSubscriptionId);\n signatureSubscriptionId = undefined;\n }\n };\n return {\n abortConfirmation,\n confirmationPromise\n };\n }\n async confirmTransactionUsingBlockHeightExceedanceStrategy({\n commitment,\n strategy: {\n abortSignal,\n lastValidBlockHeight,\n signature\n }\n }) {\n let done = false;\n const expiryPromise = new Promise(resolve => {\n const checkBlockHeight = async () => {\n try {\n const blockHeight = await this.getBlockHeight(commitment);\n return blockHeight;\n } catch (_e) {\n return -1;\n }\n };\n (async () => {\n let currentBlockHeight = await checkBlockHeight();\n if (done) return;\n while (currentBlockHeight <= lastValidBlockHeight) {\n await sleep(1000);\n if (done) return;\n currentBlockHeight = await checkBlockHeight();\n if (done) return;\n }\n resolve({\n __type: TransactionStatus.BLOCKHEIGHT_EXCEEDED\n });\n })();\n });\n const {\n abortConfirmation,\n confirmationPromise\n } = this.getTransactionConfirmationPromise({\n commitment,\n signature\n });\n const cancellationPromise = this.getCancellationPromise(abortSignal);\n let result;\n try {\n const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]);\n if (outcome.__type === TransactionStatus.PROCESSED) {\n result = outcome.response;\n } else {\n throw new TransactionExpiredBlockheightExceededError(signature);\n }\n } finally {\n done = true;\n abortConfirmation();\n }\n return result;\n }\n async confirmTransactionUsingDurableNonceStrategy({\n commitment,\n strategy: {\n abortSignal,\n minContextSlot,\n nonceAccountPubkey,\n nonceValue,\n signature\n }\n }) {\n let done = false;\n const expiryPromise = new Promise(resolve => {\n let currentNonceValue = nonceValue;\n let lastCheckedSlot = null;\n const getCurrentNonceValue = async () => {\n try {\n const {\n context,\n value: nonceAccount\n } = await this.getNonceAndContext(nonceAccountPubkey, {\n commitment,\n minContextSlot\n });\n lastCheckedSlot = context.slot;\n return nonceAccount?.nonce;\n } catch (e) {\n // If for whatever reason we can't reach/read the nonce\n // account, just keep using the last-known value.\n return currentNonceValue;\n }\n };\n (async () => {\n currentNonceValue = await getCurrentNonceValue();\n if (done) return;\n while (true // eslint-disable-line no-constant-condition\n ) {\n if (nonceValue !== currentNonceValue) {\n resolve({\n __type: TransactionStatus.NONCE_INVALID,\n slotInWhichNonceDidAdvance: lastCheckedSlot\n });\n return;\n }\n await sleep(2000);\n if (done) return;\n currentNonceValue = await getCurrentNonceValue();\n if (done) return;\n }\n })();\n });\n const {\n abortConfirmation,\n confirmationPromise\n } = this.getTransactionConfirmationPromise({\n commitment,\n signature\n });\n const cancellationPromise = this.getCancellationPromise(abortSignal);\n let result;\n try {\n const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]);\n if (outcome.__type === TransactionStatus.PROCESSED) {\n result = outcome.response;\n } else {\n // Double check that the transaction is indeed unconfirmed.\n let signatureStatus;\n while (true // eslint-disable-line no-constant-condition\n ) {\n const status = await this.getSignatureStatus(signature);\n if (status == null) {\n break;\n }\n if (status.context.slot < (outcome.slotInWhichNonceDidAdvance ?? minContextSlot)) {\n await sleep(400);\n continue;\n }\n signatureStatus = status;\n break;\n }\n if (signatureStatus?.value) {\n const commitmentForStatus = commitment || 'finalized';\n const {\n confirmationStatus\n } = signatureStatus.value;\n switch (commitmentForStatus) {\n case 'processed':\n case 'recent':\n if (confirmationStatus !== 'processed' && confirmationStatus !== 'confirmed' && confirmationStatus !== 'finalized') {\n throw new TransactionExpiredNonceInvalidError(signature);\n }\n break;\n case 'confirmed':\n case 'single':\n case 'singleGossip':\n if (confirmationStatus !== 'confirmed' && confirmationStatus !== 'finalized') {\n throw new TransactionExpiredNonceInvalidError(signature);\n }\n break;\n case 'finalized':\n case 'max':\n case 'root':\n if (confirmationStatus !== 'finalized') {\n throw new TransactionExpiredNonceInvalidError(signature);\n }\n break;\n default:\n // Exhaustive switch.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n (_ => {})(commitmentForStatus);\n }\n result = {\n context: signatureStatus.context,\n value: {\n err: signatureStatus.value.err\n }\n };\n } else {\n throw new TransactionExpiredNonceInvalidError(signature);\n }\n }\n } finally {\n done = true;\n abortConfirmation();\n }\n return result;\n }\n async confirmTransactionUsingLegacyTimeoutStrategy({\n commitment,\n signature\n }) {\n let timeoutId;\n const expiryPromise = new Promise(resolve => {\n let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;\n switch (commitment) {\n case 'processed':\n case 'recent':\n case 'single':\n case 'confirmed':\n case 'singleGossip':\n {\n timeoutMs = this._confirmTransactionInitialTimeout || 30 * 1000;\n break;\n }\n }\n timeoutId = setTimeout(() => resolve({\n __type: TransactionStatus.TIMED_OUT,\n timeoutMs\n }), timeoutMs);\n });\n const {\n abortConfirmation,\n confirmationPromise\n } = this.getTransactionConfirmationPromise({\n commitment,\n signature\n });\n let result;\n try {\n const outcome = await Promise.race([confirmationPromise, expiryPromise]);\n if (outcome.__type === TransactionStatus.PROCESSED) {\n result = outcome.response;\n } else {\n throw new TransactionExpiredTimeoutError(signature, outcome.timeoutMs / 1000);\n }\n } finally {\n clearTimeout(timeoutId);\n abortConfirmation();\n }\n return result;\n }\n\n /**\n * Return the list of nodes that are currently participating in the cluster\n */\n async getClusterNodes() {\n const unsafeRes = await this._rpcRequest('getClusterNodes', []);\n const res = create(unsafeRes, jsonRpcResult(array(ContactInfoResult)));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get cluster nodes');\n }\n return res.result;\n }\n\n /**\n * Return the list of nodes that are currently participating in the cluster\n */\n async getVoteAccounts(commitment) {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getVoteAccounts', args);\n const res = create(unsafeRes, GetVoteAccounts);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get vote accounts');\n }\n return res.result;\n }\n\n /**\n * Fetch the current slot that the node is processing\n */\n async getSlot(commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getSlot', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get slot');\n }\n return res.result;\n }\n\n /**\n * Fetch the current slot leader of the cluster\n */\n async getSlotLeader(commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getSlotLeader', args);\n const res = create(unsafeRes, jsonRpcResult(string()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get slot leader');\n }\n return res.result;\n }\n\n /**\n * Fetch `limit` number of slot leaders starting from `startSlot`\n *\n * @param startSlot fetch slot leaders starting from this slot\n * @param limit number of slot leaders to return\n */\n async getSlotLeaders(startSlot, limit) {\n const args = [startSlot, limit];\n const unsafeRes = await this._rpcRequest('getSlotLeaders', args);\n const res = create(unsafeRes, jsonRpcResult(array(PublicKeyFromString)));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get slot leaders');\n }\n return res.result;\n }\n\n /**\n * Fetch the current status of a signature\n */\n async getSignatureStatus(signature, config) {\n const {\n context,\n value: values\n } = await this.getSignatureStatuses([signature], config);\n assert(values.length === 1);\n const value = values[0];\n return {\n context,\n value\n };\n }\n\n /**\n * Fetch the current statuses of a batch of signatures\n */\n async getSignatureStatuses(signatures, config) {\n const params = [signatures];\n if (config) {\n params.push(config);\n }\n const unsafeRes = await this._rpcRequest('getSignatureStatuses', params);\n const res = create(unsafeRes, GetSignatureStatusesRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get signature status');\n }\n return res.result;\n }\n\n /**\n * Fetch the current transaction count of the cluster\n */\n async getTransactionCount(commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getTransactionCount', args);\n const res = create(unsafeRes, jsonRpcResult(number()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transaction count');\n }\n return res.result;\n }\n\n /**\n * Fetch the current total currency supply of the cluster in lamports\n *\n * @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.\n */\n async getTotalSupply(commitment) {\n const result = await this.getSupply({\n commitment,\n excludeNonCirculatingAccountsList: true\n });\n return result.value.total;\n }\n\n /**\n * Fetch the cluster InflationGovernor parameters\n */\n async getInflationGovernor(commitment) {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getInflationGovernor', args);\n const res = create(unsafeRes, GetInflationGovernorRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get inflation');\n }\n return res.result;\n }\n\n /**\n * Fetch the inflation reward for a list of addresses for an epoch\n */\n async getInflationReward(addresses, epoch, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([addresses.map(pubkey => pubkey.toBase58())], commitment, undefined /* encoding */, {\n ...config,\n epoch: epoch != null ? epoch : config?.epoch\n });\n const unsafeRes = await this._rpcRequest('getInflationReward', args);\n const res = create(unsafeRes, GetInflationRewardResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get inflation reward');\n }\n return res.result;\n }\n\n /**\n * Fetch the specific inflation values for the current epoch\n */\n async getInflationRate() {\n const unsafeRes = await this._rpcRequest('getInflationRate', []);\n const res = create(unsafeRes, GetInflationRateRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');\n }\n return res.result;\n }\n\n /**\n * Fetch the Epoch Info parameters\n */\n async getEpochInfo(commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getEpochInfo', args);\n const res = create(unsafeRes, GetEpochInfoRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get epoch info');\n }\n return res.result;\n }\n\n /**\n * Fetch the Epoch Schedule parameters\n */\n async getEpochSchedule() {\n const unsafeRes = await this._rpcRequest('getEpochSchedule', []);\n const res = create(unsafeRes, GetEpochScheduleRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get epoch schedule');\n }\n const epochSchedule = res.result;\n return new EpochSchedule(epochSchedule.slotsPerEpoch, epochSchedule.leaderScheduleSlotOffset, epochSchedule.warmup, epochSchedule.firstNormalEpoch, epochSchedule.firstNormalSlot);\n }\n\n /**\n * Fetch the leader schedule for the current epoch\n * @return {Promise>}\n */\n async getLeaderSchedule() {\n const unsafeRes = await this._rpcRequest('getLeaderSchedule', []);\n const res = create(unsafeRes, GetLeaderScheduleRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get leader schedule');\n }\n return res.result;\n }\n\n /**\n * Fetch the minimum balance needed to exempt an account of `dataLength`\n * size from rent\n */\n async getMinimumBalanceForRentExemption(dataLength, commitment) {\n const args = this._buildArgs([dataLength], commitment);\n const unsafeRes = await this._rpcRequest('getMinimumBalanceForRentExemption', args);\n const res = create(unsafeRes, GetMinimumBalanceForRentExemptionRpcResult);\n if ('error' in res) {\n console.warn('Unable to fetch minimum balance for rent exemption');\n return 0;\n }\n return res.result;\n }\n\n /**\n * Fetch a recent blockhash from the cluster, return with context\n * @return {Promise>}\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.\n */\n async getRecentBlockhashAndContext(commitment) {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getRecentBlockhash', args);\n const res = create(unsafeRes, GetRecentBlockhashAndContextRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get recent blockhash');\n }\n return res.result;\n }\n\n /**\n * Fetch recent performance samples\n * @return {Promise>}\n */\n async getRecentPerformanceSamples(limit) {\n const unsafeRes = await this._rpcRequest('getRecentPerformanceSamples', limit ? [limit] : []);\n const res = create(unsafeRes, GetRecentPerformanceSamplesRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get recent performance samples');\n }\n return res.result;\n }\n\n /**\n * Fetch the fee calculator for a recent blockhash from the cluster, return with context\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getFeeForMessage} instead.\n */\n async getFeeCalculatorForBlockhash(blockhash, commitment) {\n const args = this._buildArgs([blockhash], commitment);\n const unsafeRes = await this._rpcRequest('getFeeCalculatorForBlockhash', args);\n const res = create(unsafeRes, GetFeeCalculatorRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get fee calculator');\n }\n const {\n context,\n value\n } = res.result;\n return {\n context,\n value: value !== null ? value.feeCalculator : null\n };\n }\n\n /**\n * Fetch the fee for a message from the cluster, return with context\n */\n async getFeeForMessage(message, commitment) {\n const wireMessage = toBuffer(message.serialize()).toString('base64');\n const args = this._buildArgs([wireMessage], commitment);\n const unsafeRes = await this._rpcRequest('getFeeForMessage', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(nullable(number())));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get fee for message');\n }\n if (res.result === null) {\n throw new Error('invalid blockhash');\n }\n return res.result;\n }\n\n /**\n * Fetch a list of prioritization fees from recent blocks.\n */\n async getRecentPrioritizationFees(config) {\n const accounts = config?.lockedWritableAccounts?.map(key => key.toBase58());\n const args = accounts?.length ? [accounts] : [];\n const unsafeRes = await this._rpcRequest('getRecentPrioritizationFees', args);\n const res = create(unsafeRes, GetRecentPrioritizationFeesRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get recent prioritization fees');\n }\n return res.result;\n }\n /**\n * Fetch a recent blockhash from the cluster\n * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.\n */\n async getRecentBlockhash(commitment) {\n try {\n const res = await this.getRecentBlockhashAndContext(commitment);\n return res.value;\n } catch (e) {\n throw new Error('failed to get recent blockhash: ' + e);\n }\n }\n\n /**\n * Fetch the latest blockhash from the cluster\n * @return {Promise}\n */\n async getLatestBlockhash(commitmentOrConfig) {\n try {\n const res = await this.getLatestBlockhashAndContext(commitmentOrConfig);\n return res.value;\n } catch (e) {\n throw new Error('failed to get recent blockhash: ' + e);\n }\n }\n\n /**\n * Fetch the latest blockhash from the cluster\n * @return {Promise}\n */\n async getLatestBlockhashAndContext(commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getLatestBlockhash', args);\n const res = create(unsafeRes, GetLatestBlockhashRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get latest blockhash');\n }\n return res.result;\n }\n\n /**\n * Returns whether a blockhash is still valid or not\n */\n async isBlockhashValid(blockhash, rawConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(rawConfig);\n const args = this._buildArgs([blockhash], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('isBlockhashValid', args);\n const res = create(unsafeRes, IsBlockhashValidRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to determine if the blockhash `' + blockhash + '`is valid');\n }\n return res.result;\n }\n\n /**\n * Fetch the node version\n */\n async getVersion() {\n const unsafeRes = await this._rpcRequest('getVersion', []);\n const res = create(unsafeRes, jsonRpcResult(VersionResult));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get version');\n }\n return res.result;\n }\n\n /**\n * Fetch the genesis hash\n */\n async getGenesisHash() {\n const unsafeRes = await this._rpcRequest('getGenesisHash', []);\n const res = create(unsafeRes, jsonRpcResult(string()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get genesis hash');\n }\n return res.result;\n }\n\n /**\n * Fetch a processed block from the cluster.\n *\n * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by\n * setting the `maxSupportedTransactionVersion` property.\n */\n\n /**\n * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by\n * setting the `maxSupportedTransactionVersion` property.\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by\n * setting the `maxSupportedTransactionVersion` property.\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Fetch a processed block from the cluster.\n */\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Fetch a processed block from the cluster.\n */\n // eslint-disable-next-line no-dupe-class-members\n async getBlock(slot, rawConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(rawConfig);\n const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getBlock', args);\n try {\n switch (config?.transactionDetails) {\n case 'accounts':\n {\n const res = create(unsafeRes, GetAccountsModeBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n return res.result;\n }\n case 'none':\n {\n const res = create(unsafeRes, GetNoneModeBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n return res.result;\n }\n default:\n {\n const res = create(unsafeRes, GetBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n const {\n result\n } = res;\n return result ? {\n ...result,\n transactions: result.transactions.map(({\n transaction,\n meta,\n version\n }) => ({\n meta,\n transaction: {\n ...transaction,\n message: versionedMessageFromResponse(version, transaction.message)\n },\n version\n }))\n } : null;\n }\n }\n } catch (e) {\n throw new SolanaJSONRPCError(e, 'failed to get confirmed block');\n }\n }\n\n /**\n * Fetch parsed transaction details for a confirmed or finalized block\n */\n\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n async getParsedBlock(slot, rawConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(rawConfig);\n const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);\n const unsafeRes = await this._rpcRequest('getBlock', args);\n try {\n switch (config?.transactionDetails) {\n case 'accounts':\n {\n const res = create(unsafeRes, GetParsedAccountsModeBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n return res.result;\n }\n case 'none':\n {\n const res = create(unsafeRes, GetParsedNoneModeBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n return res.result;\n }\n default:\n {\n const res = create(unsafeRes, GetParsedBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n return res.result;\n }\n }\n } catch (e) {\n throw new SolanaJSONRPCError(e, 'failed to get block');\n }\n }\n /*\n * Returns recent block production information from the current or previous epoch\n */\n async getBlockProduction(configOrCommitment) {\n let extra;\n let commitment;\n if (typeof configOrCommitment === 'string') {\n commitment = configOrCommitment;\n } else if (configOrCommitment) {\n const {\n commitment: c,\n ...rest\n } = configOrCommitment;\n commitment = c;\n extra = rest;\n }\n const args = this._buildArgs([], commitment, 'base64', extra);\n const unsafeRes = await this._rpcRequest('getBlockProduction', args);\n const res = create(unsafeRes, BlockProductionResponseStruct);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get block production information');\n }\n return res.result;\n }\n\n /**\n * Fetch a confirmed or finalized transaction from the cluster.\n *\n * @deprecated Instead, call `getTransaction` using a\n * `GetVersionedTransactionConfig` by setting the\n * `maxSupportedTransactionVersion` property.\n */\n\n /**\n * Fetch a confirmed or finalized transaction from the cluster.\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Fetch a confirmed or finalized transaction from the cluster.\n */\n // eslint-disable-next-line no-dupe-class-members\n async getTransaction(signature, rawConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(rawConfig);\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getTransaction', args);\n const res = create(unsafeRes, GetTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transaction');\n }\n const result = res.result;\n if (!result) return result;\n return {\n ...result,\n transaction: {\n ...result.transaction,\n message: versionedMessageFromResponse(result.version, result.transaction.message)\n }\n };\n }\n\n /**\n * Fetch parsed transaction details for a confirmed or finalized transaction\n */\n async getParsedTransaction(signature, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);\n const unsafeRes = await this._rpcRequest('getTransaction', args);\n const res = create(unsafeRes, GetParsedTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transaction');\n }\n return res.result;\n }\n\n /**\n * Fetch parsed transaction details for a batch of confirmed transactions\n */\n async getParsedTransactions(signatures, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const batch = signatures.map(signature => {\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);\n return {\n methodName: 'getTransaction',\n args\n };\n });\n const unsafeRes = await this._rpcBatchRequest(batch);\n const res = unsafeRes.map(unsafeRes => {\n const res = create(unsafeRes, GetParsedTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transactions');\n }\n return res.result;\n });\n return res;\n }\n\n /**\n * Fetch transaction details for a batch of confirmed transactions.\n * Similar to {@link getParsedTransactions} but returns a {@link TransactionResponse}.\n *\n * @deprecated Instead, call `getTransactions` using a\n * `GetVersionedTransactionConfig` by setting the\n * `maxSupportedTransactionVersion` property.\n */\n\n /**\n * Fetch transaction details for a batch of confirmed transactions.\n * Similar to {@link getParsedTransactions} but returns a {@link\n * VersionedTransactionResponse}.\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Fetch transaction details for a batch of confirmed transactions.\n * Similar to {@link getParsedTransactions} but returns a {@link\n * VersionedTransactionResponse}.\n */\n // eslint-disable-next-line no-dupe-class-members\n async getTransactions(signatures, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const batch = signatures.map(signature => {\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, undefined /* encoding */, config);\n return {\n methodName: 'getTransaction',\n args\n };\n });\n const unsafeRes = await this._rpcBatchRequest(batch);\n const res = unsafeRes.map(unsafeRes => {\n const res = create(unsafeRes, GetTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transactions');\n }\n const result = res.result;\n if (!result) return result;\n return {\n ...result,\n transaction: {\n ...result.transaction,\n message: versionedMessageFromResponse(result.version, result.transaction.message)\n }\n };\n });\n return res;\n }\n\n /**\n * Fetch a list of Transactions and transaction statuses from the cluster\n * for a confirmed block.\n *\n * @deprecated Deprecated since v1.13.0. Please use {@link getBlock} instead.\n */\n async getConfirmedBlock(slot, commitment) {\n const args = this._buildArgsAtLeastConfirmed([slot], commitment);\n const unsafeRes = await this._rpcRequest('getConfirmedBlock', args);\n const res = create(unsafeRes, GetConfirmedBlockRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block');\n }\n const result = res.result;\n if (!result) {\n throw new Error('Confirmed block ' + slot + ' not found');\n }\n const block = {\n ...result,\n transactions: result.transactions.map(({\n transaction,\n meta\n }) => {\n const message = new Message(transaction.message);\n return {\n meta,\n transaction: {\n ...transaction,\n message\n }\n };\n })\n };\n return {\n ...block,\n transactions: block.transactions.map(({\n transaction,\n meta\n }) => {\n return {\n meta,\n transaction: Transaction.populate(transaction.message, transaction.signatures)\n };\n })\n };\n }\n\n /**\n * Fetch confirmed blocks between two slots\n */\n async getBlocks(startSlot, endSlot, commitment) {\n const args = this._buildArgsAtLeastConfirmed(endSlot !== undefined ? [startSlot, endSlot] : [startSlot], commitment);\n const unsafeRes = await this._rpcRequest('getBlocks', args);\n const res = create(unsafeRes, jsonRpcResult(array(number())));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get blocks');\n }\n return res.result;\n }\n\n /**\n * Fetch a list of Signatures from the cluster for a block, excluding rewards\n */\n async getBlockSignatures(slot, commitment) {\n const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {\n transactionDetails: 'signatures',\n rewards: false\n });\n const unsafeRes = await this._rpcRequest('getBlock', args);\n const res = create(unsafeRes, GetBlockSignaturesRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get block');\n }\n const result = res.result;\n if (!result) {\n throw new Error('Block ' + slot + ' not found');\n }\n return result;\n }\n\n /**\n * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getBlockSignatures} instead.\n */\n async getConfirmedBlockSignatures(slot, commitment) {\n const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {\n transactionDetails: 'signatures',\n rewards: false\n });\n const unsafeRes = await this._rpcRequest('getConfirmedBlock', args);\n const res = create(unsafeRes, GetBlockSignaturesRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block');\n }\n const result = res.result;\n if (!result) {\n throw new Error('Confirmed block ' + slot + ' not found');\n }\n return result;\n }\n\n /**\n * Fetch a transaction details for a confirmed transaction\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getTransaction} instead.\n */\n async getConfirmedTransaction(signature, commitment) {\n const args = this._buildArgsAtLeastConfirmed([signature], commitment);\n const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);\n const res = create(unsafeRes, GetTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transaction');\n }\n const result = res.result;\n if (!result) return result;\n const message = new Message(result.transaction.message);\n const signatures = result.transaction.signatures;\n return {\n ...result,\n transaction: Transaction.populate(message, signatures)\n };\n }\n\n /**\n * Fetch parsed transaction details for a confirmed transaction\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransaction} instead.\n */\n async getParsedConfirmedTransaction(signature, commitment) {\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');\n const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);\n const res = create(unsafeRes, GetParsedTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transaction');\n }\n return res.result;\n }\n\n /**\n * Fetch parsed transaction details for a batch of confirmed transactions\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransactions} instead.\n */\n async getParsedConfirmedTransactions(signatures, commitment) {\n const batch = signatures.map(signature => {\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');\n return {\n methodName: 'getConfirmedTransaction',\n args\n };\n });\n const unsafeRes = await this._rpcBatchRequest(batch);\n const res = unsafeRes.map(unsafeRes => {\n const res = create(unsafeRes, GetParsedTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transactions');\n }\n return res.result;\n });\n return res;\n }\n\n /**\n * Fetch a list of all the confirmed signatures for transactions involving an address\n * within a specified slot range. Max range allowed is 10,000 slots.\n *\n * @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.\n *\n * @param address queried address\n * @param startSlot start slot, inclusive\n * @param endSlot end slot, inclusive\n */\n async getConfirmedSignaturesForAddress(address, startSlot, endSlot) {\n let options = {};\n let firstAvailableBlock = await this.getFirstAvailableBlock();\n while (!('until' in options)) {\n startSlot--;\n if (startSlot <= 0 || startSlot < firstAvailableBlock) {\n break;\n }\n try {\n const block = await this.getConfirmedBlockSignatures(startSlot, 'finalized');\n if (block.signatures.length > 0) {\n options.until = block.signatures[block.signatures.length - 1].toString();\n }\n } catch (err) {\n if (err instanceof Error && err.message.includes('skipped')) {\n continue;\n } else {\n throw err;\n }\n }\n }\n let highestConfirmedRoot = await this.getSlot('finalized');\n while (!('before' in options)) {\n endSlot++;\n if (endSlot > highestConfirmedRoot) {\n break;\n }\n try {\n const block = await this.getConfirmedBlockSignatures(endSlot);\n if (block.signatures.length > 0) {\n options.before = block.signatures[block.signatures.length - 1].toString();\n }\n } catch (err) {\n if (err instanceof Error && err.message.includes('skipped')) {\n continue;\n } else {\n throw err;\n }\n }\n }\n const confirmedSignatureInfo = await this.getConfirmedSignaturesForAddress2(address, options);\n return confirmedSignatureInfo.map(info => info.signature);\n }\n\n /**\n * Returns confirmed signatures for transactions involving an\n * address backwards in time from the provided signature or most recent confirmed block\n *\n *\n * @param address queried address\n * @param options\n */\n async getConfirmedSignaturesForAddress2(address, options, commitment) {\n const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);\n const unsafeRes = await this._rpcRequest('getConfirmedSignaturesForAddress2', args);\n const res = create(unsafeRes, GetConfirmedSignaturesForAddress2RpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get confirmed signatures for address');\n }\n return res.result;\n }\n\n /**\n * Returns confirmed signatures for transactions involving an\n * address backwards in time from the provided signature or most recent confirmed block\n *\n *\n * @param address queried address\n * @param options\n */\n async getSignaturesForAddress(address, options, commitment) {\n const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);\n const unsafeRes = await this._rpcRequest('getSignaturesForAddress', args);\n const res = create(unsafeRes, GetSignaturesForAddressRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get signatures for address');\n }\n return res.result;\n }\n async getAddressLookupTable(accountKey, config) {\n const {\n context,\n value: accountInfo\n } = await this.getAccountInfoAndContext(accountKey, config);\n let value = null;\n if (accountInfo !== null) {\n value = new AddressLookupTableAccount({\n key: accountKey,\n state: AddressLookupTableAccount.deserialize(accountInfo.data)\n });\n }\n return {\n context,\n value\n };\n }\n\n /**\n * Fetch the contents of a Nonce account from the cluster, return with context\n */\n async getNonceAndContext(nonceAccount, commitmentOrConfig) {\n const {\n context,\n value: accountInfo\n } = await this.getAccountInfoAndContext(nonceAccount, commitmentOrConfig);\n let value = null;\n if (accountInfo !== null) {\n value = NonceAccount.fromAccountData(accountInfo.data);\n }\n return {\n context,\n value\n };\n }\n\n /**\n * Fetch the contents of a Nonce account from the cluster\n */\n async getNonce(nonceAccount, commitmentOrConfig) {\n return await this.getNonceAndContext(nonceAccount, commitmentOrConfig).then(x => x.value).catch(e => {\n throw new Error('failed to get nonce for account ' + nonceAccount.toBase58() + ': ' + e);\n });\n }\n\n /**\n * Request an allocation of lamports to the specified address\n *\n * ```typescript\n * import { Connection, PublicKey, LAMPORTS_PER_SOL } from \"@solana/web3.js\";\n *\n * (async () => {\n * const connection = new Connection(\"https://api.testnet.solana.com\", \"confirmed\");\n * const myAddress = new PublicKey(\"2nr1bHFT86W9tGnyvmYW4vcHKsQB3sVQfnddasz4kExM\");\n * const signature = await connection.requestAirdrop(myAddress, LAMPORTS_PER_SOL);\n * await connection.confirmTransaction(signature);\n * })();\n * ```\n */\n async requestAirdrop(to, lamports) {\n const unsafeRes = await this._rpcRequest('requestAirdrop', [to.toBase58(), lamports]);\n const res = create(unsafeRes, RequestAirdropRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `airdrop to ${to.toBase58()} failed`);\n }\n return res.result;\n }\n\n /**\n * @internal\n */\n async _blockhashWithExpiryBlockHeight(disableCache) {\n if (!disableCache) {\n // Wait for polling to finish\n while (this._pollingBlockhash) {\n await sleep(100);\n }\n const timeSinceFetch = Date.now() - this._blockhashInfo.lastFetch;\n const expired = timeSinceFetch >= BLOCKHASH_CACHE_TIMEOUT_MS;\n if (this._blockhashInfo.latestBlockhash !== null && !expired) {\n return this._blockhashInfo.latestBlockhash;\n }\n }\n return await this._pollNewBlockhash();\n }\n\n /**\n * @internal\n */\n async _pollNewBlockhash() {\n this._pollingBlockhash = true;\n try {\n const startTime = Date.now();\n const cachedLatestBlockhash = this._blockhashInfo.latestBlockhash;\n const cachedBlockhash = cachedLatestBlockhash ? cachedLatestBlockhash.blockhash : null;\n for (let i = 0; i < 50; i++) {\n const latestBlockhash = await this.getLatestBlockhash('finalized');\n if (cachedBlockhash !== latestBlockhash.blockhash) {\n this._blockhashInfo = {\n latestBlockhash,\n lastFetch: Date.now(),\n transactionSignatures: [],\n simulatedSignatures: []\n };\n return latestBlockhash;\n }\n\n // Sleep for approximately half a slot\n await sleep(MS_PER_SLOT / 2);\n }\n throw new Error(`Unable to obtain a new blockhash after ${Date.now() - startTime}ms`);\n } finally {\n this._pollingBlockhash = false;\n }\n }\n\n /**\n * get the stake minimum delegation\n */\n async getStakeMinimumDelegation(config) {\n const {\n commitment,\n config: configArg\n } = extractCommitmentFromConfig(config);\n const args = this._buildArgs([], commitment, 'base64', configArg);\n const unsafeRes = await this._rpcRequest('getStakeMinimumDelegation', args);\n const res = create(unsafeRes, jsonRpcResultAndContext(number()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get stake minimum delegation`);\n }\n return res.result;\n }\n\n /**\n * Simulate a transaction\n *\n * @deprecated Instead, call {@link simulateTransaction} with {@link\n * VersionedTransaction} and {@link SimulateTransactionConfig} parameters\n */\n\n /**\n * Simulate a transaction\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Simulate a transaction\n */\n // eslint-disable-next-line no-dupe-class-members\n async simulateTransaction(transactionOrMessage, configOrSigners, includeAccounts) {\n if ('message' in transactionOrMessage) {\n const versionedTx = transactionOrMessage;\n const wireTransaction = versionedTx.serialize();\n const encodedTransaction = Buffer.from(wireTransaction).toString('base64');\n if (Array.isArray(configOrSigners) || includeAccounts !== undefined) {\n throw new Error('Invalid arguments');\n }\n const config = configOrSigners || {};\n config.encoding = 'base64';\n if (!('commitment' in config)) {\n config.commitment = this.commitment;\n }\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('simulateTransaction', args);\n const res = create(unsafeRes, SimulatedTransactionResponseStruct);\n if ('error' in res) {\n throw new Error('failed to simulate transaction: ' + res.error.message);\n }\n return res.result;\n }\n let transaction;\n if (transactionOrMessage instanceof Transaction) {\n let originalTx = transactionOrMessage;\n transaction = new Transaction();\n transaction.feePayer = originalTx.feePayer;\n transaction.instructions = transactionOrMessage.instructions;\n transaction.nonceInfo = originalTx.nonceInfo;\n transaction.signatures = originalTx.signatures;\n } else {\n transaction = Transaction.populate(transactionOrMessage);\n // HACK: this function relies on mutating the populated transaction\n transaction._message = transaction._json = undefined;\n }\n if (configOrSigners !== undefined && !Array.isArray(configOrSigners)) {\n throw new Error('Invalid arguments');\n }\n const signers = configOrSigners;\n if (transaction.nonceInfo && signers) {\n transaction.sign(...signers);\n } else {\n let disableCache = this._disableBlockhashCaching;\n for (;;) {\n const latestBlockhash = await this._blockhashWithExpiryBlockHeight(disableCache);\n transaction.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight;\n transaction.recentBlockhash = latestBlockhash.blockhash;\n if (!signers) break;\n transaction.sign(...signers);\n if (!transaction.signature) {\n throw new Error('!signature'); // should never happen\n }\n const signature = transaction.signature.toString('base64');\n if (!this._blockhashInfo.simulatedSignatures.includes(signature) && !this._blockhashInfo.transactionSignatures.includes(signature)) {\n // The signature of this transaction has not been seen before with the\n // current recentBlockhash, all done. Let's break\n this._blockhashInfo.simulatedSignatures.push(signature);\n break;\n } else {\n // This transaction would be treated as duplicate (its derived signature\n // matched to one of already recorded signatures).\n // So, we must fetch a new blockhash for a different signature by disabling\n // our cache not to wait for the cache expiration (BLOCKHASH_CACHE_TIMEOUT_MS).\n disableCache = true;\n }\n }\n }\n const message = transaction._compile();\n const signData = message.serialize();\n const wireTransaction = transaction._serialize(signData);\n const encodedTransaction = wireTransaction.toString('base64');\n const config = {\n encoding: 'base64',\n commitment: this.commitment\n };\n if (includeAccounts) {\n const addresses = (Array.isArray(includeAccounts) ? includeAccounts : message.nonProgramIds()).map(key => key.toBase58());\n config['accounts'] = {\n encoding: 'base64',\n addresses\n };\n }\n if (signers) {\n config.sigVerify = true;\n }\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('simulateTransaction', args);\n const res = create(unsafeRes, SimulatedTransactionResponseStruct);\n if ('error' in res) {\n let logs;\n if ('data' in res.error) {\n logs = res.error.data.logs;\n if (logs && Array.isArray(logs)) {\n const traceIndent = '\\n ';\n const logTrace = traceIndent + logs.join(traceIndent);\n console.error(res.error.message, logTrace);\n }\n }\n throw new SendTransactionError('failed to simulate transaction: ' + res.error.message, logs);\n }\n return res.result;\n }\n\n /**\n * Sign and send a transaction\n *\n * @deprecated Instead, call {@link sendTransaction} with a {@link\n * VersionedTransaction}\n */\n\n /**\n * Send a signed transaction\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Sign and send a transaction\n */\n // eslint-disable-next-line no-dupe-class-members\n async sendTransaction(transaction, signersOrOptions, options) {\n if ('version' in transaction) {\n if (signersOrOptions && Array.isArray(signersOrOptions)) {\n throw new Error('Invalid arguments');\n }\n const wireTransaction = transaction.serialize();\n return await this.sendRawTransaction(wireTransaction, signersOrOptions);\n }\n if (signersOrOptions === undefined || !Array.isArray(signersOrOptions)) {\n throw new Error('Invalid arguments');\n }\n const signers = signersOrOptions;\n if (transaction.nonceInfo) {\n transaction.sign(...signers);\n } else {\n let disableCache = this._disableBlockhashCaching;\n for (;;) {\n const latestBlockhash = await this._blockhashWithExpiryBlockHeight(disableCache);\n transaction.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight;\n transaction.recentBlockhash = latestBlockhash.blockhash;\n transaction.sign(...signers);\n if (!transaction.signature) {\n throw new Error('!signature'); // should never happen\n }\n const signature = transaction.signature.toString('base64');\n if (!this._blockhashInfo.transactionSignatures.includes(signature)) {\n // The signature of this transaction has not been seen before with the\n // current recentBlockhash, all done. Let's break\n this._blockhashInfo.transactionSignatures.push(signature);\n break;\n } else {\n // This transaction would be treated as duplicate (its derived signature\n // matched to one of already recorded signatures).\n // So, we must fetch a new blockhash for a different signature by disabling\n // our cache not to wait for the cache expiration (BLOCKHASH_CACHE_TIMEOUT_MS).\n disableCache = true;\n }\n }\n }\n const wireTransaction = transaction.serialize();\n return await this.sendRawTransaction(wireTransaction, options);\n }\n\n /**\n * Send a transaction that has already been signed and serialized into the\n * wire format\n */\n async sendRawTransaction(rawTransaction, options) {\n const encodedTransaction = toBuffer(rawTransaction).toString('base64');\n const result = await this.sendEncodedTransaction(encodedTransaction, options);\n return result;\n }\n\n /**\n * Send a transaction that has already been signed, serialized into the\n * wire format, and encoded as a base64 string\n */\n async sendEncodedTransaction(encodedTransaction, options) {\n const config = {\n encoding: 'base64'\n };\n const skipPreflight = options && options.skipPreflight;\n const preflightCommitment = options && options.preflightCommitment || this.commitment;\n if (options && options.maxRetries != null) {\n config.maxRetries = options.maxRetries;\n }\n if (options && options.minContextSlot != null) {\n config.minContextSlot = options.minContextSlot;\n }\n if (skipPreflight) {\n config.skipPreflight = skipPreflight;\n }\n if (preflightCommitment) {\n config.preflightCommitment = preflightCommitment;\n }\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('sendTransaction', args);\n const res = create(unsafeRes, SendTransactionRpcResult);\n if ('error' in res) {\n let logs;\n if ('data' in res.error) {\n logs = res.error.data.logs;\n }\n throw new SendTransactionError('failed to send transaction: ' + res.error.message, logs);\n }\n return res.result;\n }\n\n /**\n * @internal\n */\n _wsOnOpen() {\n this._rpcWebSocketConnected = true;\n this._rpcWebSocketHeartbeat = setInterval(() => {\n // Ping server every 5s to prevent idle timeouts\n (async () => {\n try {\n await this._rpcWebSocket.notify('ping');\n // eslint-disable-next-line no-empty\n } catch {}\n })();\n }, 5000);\n this._updateSubscriptions();\n }\n\n /**\n * @internal\n */\n _wsOnError(err) {\n this._rpcWebSocketConnected = false;\n console.error('ws error:', err.message);\n }\n\n /**\n * @internal\n */\n _wsOnClose(code) {\n this._rpcWebSocketConnected = false;\n this._rpcWebSocketGeneration = (this._rpcWebSocketGeneration + 1) % Number.MAX_SAFE_INTEGER;\n if (this._rpcWebSocketIdleTimeout) {\n clearTimeout(this._rpcWebSocketIdleTimeout);\n this._rpcWebSocketIdleTimeout = null;\n }\n if (this._rpcWebSocketHeartbeat) {\n clearInterval(this._rpcWebSocketHeartbeat);\n this._rpcWebSocketHeartbeat = null;\n }\n if (code === 1000) {\n // explicit close, check if any subscriptions have been made since close\n this._updateSubscriptions();\n return;\n }\n\n // implicit close, prepare subscriptions for auto-reconnect\n this._subscriptionCallbacksByServerSubscriptionId = {};\n Object.entries(this._subscriptionsByHash).forEach(([hash, subscription]) => {\n this._setSubscription(hash, {\n ...subscription,\n state: 'pending'\n });\n });\n }\n\n /**\n * @internal\n */\n _setSubscription(hash, nextSubscription) {\n const prevState = this._subscriptionsByHash[hash]?.state;\n this._subscriptionsByHash[hash] = nextSubscription;\n if (prevState !== nextSubscription.state) {\n const stateChangeCallbacks = this._subscriptionStateChangeCallbacksByHash[hash];\n if (stateChangeCallbacks) {\n stateChangeCallbacks.forEach(cb => {\n try {\n cb(nextSubscription.state);\n // eslint-disable-next-line no-empty\n } catch {}\n });\n }\n }\n }\n\n /**\n * @internal\n */\n _onSubscriptionStateChange(clientSubscriptionId, callback) {\n const hash = this._subscriptionHashByClientSubscriptionId[clientSubscriptionId];\n if (hash == null) {\n return () => {};\n }\n const stateChangeCallbacks = this._subscriptionStateChangeCallbacksByHash[hash] ||= new Set();\n stateChangeCallbacks.add(callback);\n return () => {\n stateChangeCallbacks.delete(callback);\n if (stateChangeCallbacks.size === 0) {\n delete this._subscriptionStateChangeCallbacksByHash[hash];\n }\n };\n }\n\n /**\n * @internal\n */\n async _updateSubscriptions() {\n if (Object.keys(this._subscriptionsByHash).length === 0) {\n if (this._rpcWebSocketConnected) {\n this._rpcWebSocketConnected = false;\n this._rpcWebSocketIdleTimeout = setTimeout(() => {\n this._rpcWebSocketIdleTimeout = null;\n try {\n this._rpcWebSocket.close();\n } catch (err) {\n // swallow error if socket has already been closed.\n if (err instanceof Error) {\n console.log(`Error when closing socket connection: ${err.message}`);\n }\n }\n }, 500);\n }\n return;\n }\n if (this._rpcWebSocketIdleTimeout !== null) {\n clearTimeout(this._rpcWebSocketIdleTimeout);\n this._rpcWebSocketIdleTimeout = null;\n this._rpcWebSocketConnected = true;\n }\n if (!this._rpcWebSocketConnected) {\n this._rpcWebSocket.connect();\n return;\n }\n const activeWebSocketGeneration = this._rpcWebSocketGeneration;\n const isCurrentConnectionStillActive = () => {\n return activeWebSocketGeneration === this._rpcWebSocketGeneration;\n };\n await Promise.all(\n // Don't be tempted to change this to `Object.entries`. We call\n // `_updateSubscriptions` recursively when processing the state,\n // so it's important that we look up the *current* version of\n // each subscription, every time we process a hash.\n Object.keys(this._subscriptionsByHash).map(async hash => {\n const subscription = this._subscriptionsByHash[hash];\n if (subscription === undefined) {\n // This entry has since been deleted. Skip.\n return;\n }\n switch (subscription.state) {\n case 'pending':\n case 'unsubscribed':\n if (subscription.callbacks.size === 0) {\n /**\n * You can end up here when:\n *\n * - a subscription has recently unsubscribed\n * without having new callbacks added to it\n * while the unsubscribe was in flight, or\n * - when a pending subscription has its\n * listeners removed before a request was\n * sent to the server.\n *\n * Being that nobody is interested in this\n * subscription any longer, delete it.\n */\n delete this._subscriptionsByHash[hash];\n if (subscription.state === 'unsubscribed') {\n delete this._subscriptionCallbacksByServerSubscriptionId[subscription.serverSubscriptionId];\n }\n await this._updateSubscriptions();\n return;\n }\n await (async () => {\n const {\n args,\n method\n } = subscription;\n try {\n this._setSubscription(hash, {\n ...subscription,\n state: 'subscribing'\n });\n const serverSubscriptionId = await this._rpcWebSocket.call(method, args);\n this._setSubscription(hash, {\n ...subscription,\n serverSubscriptionId,\n state: 'subscribed'\n });\n this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId] = subscription.callbacks;\n await this._updateSubscriptions();\n } catch (e) {\n if (e instanceof Error) {\n console.error(`${method} error for argument`, args, e.message);\n }\n if (!isCurrentConnectionStillActive()) {\n return;\n }\n // TODO: Maybe add an 'errored' state or a retry limit?\n this._setSubscription(hash, {\n ...subscription,\n state: 'pending'\n });\n await this._updateSubscriptions();\n }\n })();\n break;\n case 'subscribed':\n if (subscription.callbacks.size === 0) {\n // By the time we successfully set up a subscription\n // with the server, the client stopped caring about it.\n // Tear it down now.\n await (async () => {\n const {\n serverSubscriptionId,\n unsubscribeMethod\n } = subscription;\n if (this._subscriptionsAutoDisposedByRpc.has(serverSubscriptionId)) {\n /**\n * Special case.\n * If we're dealing with a subscription that has been auto-\n * disposed by the RPC, then we can skip the RPC call to\n * tear down the subscription here.\n *\n * NOTE: There is a proposal to eliminate this special case, here:\n * https://github.com/solana-labs/solana/issues/18892\n */\n this._subscriptionsAutoDisposedByRpc.delete(serverSubscriptionId);\n } else {\n this._setSubscription(hash, {\n ...subscription,\n state: 'unsubscribing'\n });\n this._setSubscription(hash, {\n ...subscription,\n state: 'unsubscribing'\n });\n try {\n await this._rpcWebSocket.call(unsubscribeMethod, [serverSubscriptionId]);\n } catch (e) {\n if (e instanceof Error) {\n console.error(`${unsubscribeMethod} error:`, e.message);\n }\n if (!isCurrentConnectionStillActive()) {\n return;\n }\n // TODO: Maybe add an 'errored' state or a retry limit?\n this._setSubscription(hash, {\n ...subscription,\n state: 'subscribed'\n });\n await this._updateSubscriptions();\n return;\n }\n }\n this._setSubscription(hash, {\n ...subscription,\n state: 'unsubscribed'\n });\n await this._updateSubscriptions();\n })();\n }\n break;\n }\n }));\n }\n\n /**\n * @internal\n */\n _handleServerNotification(serverSubscriptionId, callbackArgs) {\n const callbacks = this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId];\n if (callbacks === undefined) {\n return;\n }\n callbacks.forEach(cb => {\n try {\n cb(\n // I failed to find a way to convince TypeScript that `cb` is of type\n // `TCallback` which is certainly compatible with `Parameters`.\n // See https://github.com/microsoft/TypeScript/issues/47615\n // @ts-ignore\n ...callbackArgs);\n } catch (e) {\n console.error(e);\n }\n });\n }\n\n /**\n * @internal\n */\n _wsOnAccountNotification(notification) {\n const {\n result,\n subscription\n } = create(notification, AccountNotificationResult);\n this._handleServerNotification(subscription, [result.value, result.context]);\n }\n\n /**\n * @internal\n */\n _makeSubscription(subscriptionConfig,\n /**\n * When preparing `args` for a call to `_makeSubscription`, be sure\n * to carefully apply a default `commitment` property, if necessary.\n *\n * - If the user supplied a `commitment` use that.\n * - Otherwise, if the `Connection::commitment` is set, use that.\n * - Otherwise, set it to the RPC server default: `finalized`.\n *\n * This is extremely important to ensure that these two fundamentally\n * identical subscriptions produce the same identifying hash:\n *\n * - A subscription made without specifying a commitment.\n * - A subscription made where the commitment specified is the same\n * as the default applied to the subscription above.\n *\n * Example; these two subscriptions must produce the same hash:\n *\n * - An `accountSubscribe` subscription for `'PUBKEY'`\n * - An `accountSubscribe` subscription for `'PUBKEY'` with commitment\n * `'finalized'`.\n *\n * See the 'making a subscription with defaulted params omitted' test\n * in `connection-subscriptions.ts` for more.\n */\n args) {\n const clientSubscriptionId = this._nextClientSubscriptionId++;\n const hash = fastStableStringify$1([subscriptionConfig.method, args], true /* isArrayProp */);\n const existingSubscription = this._subscriptionsByHash[hash];\n if (existingSubscription === undefined) {\n this._subscriptionsByHash[hash] = {\n ...subscriptionConfig,\n args,\n callbacks: new Set([subscriptionConfig.callback]),\n state: 'pending'\n };\n } else {\n existingSubscription.callbacks.add(subscriptionConfig.callback);\n }\n this._subscriptionHashByClientSubscriptionId[clientSubscriptionId] = hash;\n this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId] = async () => {\n delete this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId];\n delete this._subscriptionHashByClientSubscriptionId[clientSubscriptionId];\n const subscription = this._subscriptionsByHash[hash];\n assert(subscription !== undefined, `Could not find a \\`Subscription\\` when tearing down client subscription #${clientSubscriptionId}`);\n subscription.callbacks.delete(subscriptionConfig.callback);\n await this._updateSubscriptions();\n };\n this._updateSubscriptions();\n return clientSubscriptionId;\n }\n\n /**\n * Register a callback to be invoked whenever the specified account changes\n *\n * @param publicKey Public key of the account to monitor\n * @param callback Function to invoke whenever the account is changed\n * @param commitment Specify the commitment level account changes must reach before notification\n * @return subscription id\n */\n onAccountChange(publicKey, callback, commitment) {\n const args = this._buildArgs([publicKey.toBase58()], commitment || this._commitment || 'finalized',\n // Apply connection/server default.\n 'base64');\n return this._makeSubscription({\n callback,\n method: 'accountSubscribe',\n unsubscribeMethod: 'accountUnsubscribe'\n }, args);\n }\n\n /**\n * Deregister an account notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeAccountChangeListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'account change');\n }\n\n /**\n * @internal\n */\n _wsOnProgramAccountNotification(notification) {\n const {\n result,\n subscription\n } = create(notification, ProgramAccountNotificationResult);\n this._handleServerNotification(subscription, [{\n accountId: result.value.pubkey,\n accountInfo: result.value.account\n }, result.context]);\n }\n\n /**\n * Register a callback to be invoked whenever accounts owned by the\n * specified program change\n *\n * @param programId Public key of the program to monitor\n * @param callback Function to invoke whenever the account is changed\n * @param commitment Specify the commitment level account changes must reach before notification\n * @param filters The program account filters to pass into the RPC method\n * @return subscription id\n */\n onProgramAccountChange(programId, callback, commitment, filters) {\n const args = this._buildArgs([programId.toBase58()], commitment || this._commitment || 'finalized',\n // Apply connection/server default.\n 'base64' /* encoding */, filters ? {\n filters: filters\n } : undefined /* extra */);\n return this._makeSubscription({\n callback,\n method: 'programSubscribe',\n unsubscribeMethod: 'programUnsubscribe'\n }, args);\n }\n\n /**\n * Deregister an account notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeProgramAccountChangeListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'program account change');\n }\n\n /**\n * Registers a callback to be invoked whenever logs are emitted.\n */\n onLogs(filter, callback, commitment) {\n const args = this._buildArgs([typeof filter === 'object' ? {\n mentions: [filter.toString()]\n } : filter], commitment || this._commitment || 'finalized' // Apply connection/server default.\n );\n return this._makeSubscription({\n callback,\n method: 'logsSubscribe',\n unsubscribeMethod: 'logsUnsubscribe'\n }, args);\n }\n\n /**\n * Deregister a logs callback.\n *\n * @param id client subscription id to deregister.\n */\n async removeOnLogsListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'logs');\n }\n\n /**\n * @internal\n */\n _wsOnLogsNotification(notification) {\n const {\n result,\n subscription\n } = create(notification, LogsNotificationResult);\n this._handleServerNotification(subscription, [result.value, result.context]);\n }\n\n /**\n * @internal\n */\n _wsOnSlotNotification(notification) {\n const {\n result,\n subscription\n } = create(notification, SlotNotificationResult);\n this._handleServerNotification(subscription, [result]);\n }\n\n /**\n * Register a callback to be invoked upon slot changes\n *\n * @param callback Function to invoke whenever the slot changes\n * @return subscription id\n */\n onSlotChange(callback) {\n return this._makeSubscription({\n callback,\n method: 'slotSubscribe',\n unsubscribeMethod: 'slotUnsubscribe'\n }, [] /* args */);\n }\n\n /**\n * Deregister a slot notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeSlotChangeListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot change');\n }\n\n /**\n * @internal\n */\n _wsOnSlotUpdatesNotification(notification) {\n const {\n result,\n subscription\n } = create(notification, SlotUpdateNotificationResult);\n this._handleServerNotification(subscription, [result]);\n }\n\n /**\n * Register a callback to be invoked upon slot updates. {@link SlotUpdate}'s\n * may be useful to track live progress of a cluster.\n *\n * @param callback Function to invoke whenever the slot updates\n * @return subscription id\n */\n onSlotUpdate(callback) {\n return this._makeSubscription({\n callback,\n method: 'slotsUpdatesSubscribe',\n unsubscribeMethod: 'slotsUpdatesUnsubscribe'\n }, [] /* args */);\n }\n\n /**\n * Deregister a slot update notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeSlotUpdateListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot update');\n }\n\n /**\n * @internal\n */\n\n async _unsubscribeClientSubscription(clientSubscriptionId, subscriptionName) {\n const dispose = this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId];\n if (dispose) {\n await dispose();\n } else {\n console.warn('Ignored unsubscribe request because an active subscription with id ' + `\\`${clientSubscriptionId}\\` for '${subscriptionName}' events ` + 'could not be found.');\n }\n }\n _buildArgs(args, override, encoding, extra) {\n const commitment = override || this._commitment;\n if (commitment || encoding || extra) {\n let options = {};\n if (encoding) {\n options.encoding = encoding;\n }\n if (commitment) {\n options.commitment = commitment;\n }\n if (extra) {\n options = Object.assign(options, extra);\n }\n args.push(options);\n }\n return args;\n }\n\n /**\n * @internal\n */\n _buildArgsAtLeastConfirmed(args, override, encoding, extra) {\n const commitment = override || this._commitment;\n if (commitment && !['confirmed', 'finalized'].includes(commitment)) {\n throw new Error('Using Connection with default commitment: `' + this._commitment + '`, but method requires at least `confirmed`');\n }\n return this._buildArgs(args, override, encoding, extra);\n }\n\n /**\n * @internal\n */\n _wsOnSignatureNotification(notification) {\n const {\n result,\n subscription\n } = create(notification, SignatureNotificationResult);\n if (result.value !== 'receivedSignature') {\n /**\n * Special case.\n * After a signature is processed, RPCs automatically dispose of the\n * subscription on the server side. We need to track which of these\n * subscriptions have been disposed in such a way, so that we know\n * whether the client is dealing with a not-yet-processed signature\n * (in which case we must tear down the server subscription) or an\n * already-processed signature (in which case the client can simply\n * clear out the subscription locally without telling the server).\n *\n * NOTE: There is a proposal to eliminate this special case, here:\n * https://github.com/solana-labs/solana/issues/18892\n */\n this._subscriptionsAutoDisposedByRpc.add(subscription);\n }\n this._handleServerNotification(subscription, result.value === 'receivedSignature' ? [{\n type: 'received'\n }, result.context] : [{\n type: 'status',\n result: result.value\n }, result.context]);\n }\n\n /**\n * Register a callback to be invoked upon signature updates\n *\n * @param signature Transaction signature string in base 58\n * @param callback Function to invoke on signature notifications\n * @param commitment Specify the commitment level signature must reach before notification\n * @return subscription id\n */\n onSignature(signature, callback, commitment) {\n const args = this._buildArgs([signature], commitment || this._commitment || 'finalized' // Apply connection/server default.\n );\n const clientSubscriptionId = this._makeSubscription({\n callback: (notification, context) => {\n if (notification.type === 'status') {\n callback(notification.result, context);\n // Signatures subscriptions are auto-removed by the RPC service\n // so no need to explicitly send an unsubscribe message.\n try {\n this.removeSignatureListener(clientSubscriptionId);\n // eslint-disable-next-line no-empty\n } catch (_err) {\n // Already removed.\n }\n }\n },\n method: 'signatureSubscribe',\n unsubscribeMethod: 'signatureUnsubscribe'\n }, args);\n return clientSubscriptionId;\n }\n\n /**\n * Register a callback to be invoked when a transaction is\n * received and/or processed.\n *\n * @param signature Transaction signature string in base 58\n * @param callback Function to invoke on signature notifications\n * @param options Enable received notifications and set the commitment\n * level that signature must reach before notification\n * @return subscription id\n */\n onSignatureWithOptions(signature, callback, options) {\n const {\n commitment,\n ...extra\n } = {\n ...options,\n commitment: options && options.commitment || this._commitment || 'finalized' // Apply connection/server default.\n };\n const args = this._buildArgs([signature], commitment, undefined /* encoding */, extra);\n const clientSubscriptionId = this._makeSubscription({\n callback: (notification, context) => {\n callback(notification, context);\n // Signatures subscriptions are auto-removed by the RPC service\n // so no need to explicitly send an unsubscribe message.\n try {\n this.removeSignatureListener(clientSubscriptionId);\n // eslint-disable-next-line no-empty\n } catch (_err) {\n // Already removed.\n }\n },\n method: 'signatureSubscribe',\n unsubscribeMethod: 'signatureUnsubscribe'\n }, args);\n return clientSubscriptionId;\n }\n\n /**\n * Deregister a signature notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeSignatureListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'signature result');\n }\n\n /**\n * @internal\n */\n _wsOnRootNotification(notification) {\n const {\n result,\n subscription\n } = create(notification, RootNotificationResult);\n this._handleServerNotification(subscription, [result]);\n }\n\n /**\n * Register a callback to be invoked upon root changes\n *\n * @param callback Function to invoke whenever the root changes\n * @return subscription id\n */\n onRootChange(callback) {\n return this._makeSubscription({\n callback,\n method: 'rootSubscribe',\n unsubscribeMethod: 'rootUnsubscribe'\n }, [] /* args */);\n }\n\n /**\n * Deregister a root notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeRootChangeListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'root change');\n }\n}\n\n/**\n * Keypair signer interface\n */\n\n/**\n * An account keypair used for signing transactions.\n */\nclass Keypair {\n /**\n * Create a new keypair instance.\n * Generate random keypair if no {@link Ed25519Keypair} is provided.\n *\n * @param {Ed25519Keypair} keypair ed25519 keypair\n */\n constructor(keypair) {\n this._keypair = void 0;\n this._keypair = keypair ?? generateKeypair();\n }\n\n /**\n * Generate a new random keypair\n *\n * @returns {Keypair} Keypair\n */\n static generate() {\n return new Keypair(generateKeypair());\n }\n\n /**\n * Create a keypair from a raw secret key byte array.\n *\n * This method should only be used to recreate a keypair from a previously\n * generated secret key. Generating keypairs from a random seed should be done\n * with the {@link Keypair.fromSeed} method.\n *\n * @throws error if the provided secret key is invalid and validation is not skipped.\n *\n * @param secretKey secret key byte array\n * @param options skip secret key validation\n *\n * @returns {Keypair} Keypair\n */\n static fromSecretKey(secretKey, options) {\n if (secretKey.byteLength !== 64) {\n throw new Error('bad secret key size');\n }\n const publicKey = secretKey.slice(32, 64);\n if (!options || !options.skipValidation) {\n const privateScalar = secretKey.slice(0, 32);\n const computedPublicKey = getPublicKey(privateScalar);\n for (let ii = 0; ii < 32; ii++) {\n if (publicKey[ii] !== computedPublicKey[ii]) {\n throw new Error('provided secretKey is invalid');\n }\n }\n }\n return new Keypair({\n publicKey,\n secretKey\n });\n }\n\n /**\n * Generate a keypair from a 32 byte seed.\n *\n * @param seed seed byte array\n *\n * @returns {Keypair} Keypair\n */\n static fromSeed(seed) {\n const publicKey = getPublicKey(seed);\n const secretKey = new Uint8Array(64);\n secretKey.set(seed);\n secretKey.set(publicKey, 32);\n return new Keypair({\n publicKey,\n secretKey\n });\n }\n\n /**\n * The public key for this keypair\n *\n * @returns {PublicKey} PublicKey\n */\n get publicKey() {\n return new PublicKey(this._keypair.publicKey);\n }\n\n /**\n * The raw secret key for this keypair\n * @returns {Uint8Array} Secret key in an array of Uint8 bytes\n */\n get secretKey() {\n return new Uint8Array(this._keypair.secretKey);\n }\n}\n\n/**\n * An enumeration of valid LookupTableInstructionType's\n */\n\n/**\n * An enumeration of valid address lookup table InstructionType's\n * @internal\n */\nconst LOOKUP_TABLE_INSTRUCTION_LAYOUTS = Object.freeze({\n CreateLookupTable: {\n index: 0,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), u64('recentSlot'), BufferLayout.u8('bumpSeed')])\n },\n FreezeLookupTable: {\n index: 1,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')])\n },\n ExtendLookupTable: {\n index: 2,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), u64(), BufferLayout.seq(publicKey(), BufferLayout.offset(BufferLayout.u32(), -8), 'addresses')])\n },\n DeactivateLookupTable: {\n index: 3,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')])\n },\n CloseLookupTable: {\n index: 4,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')])\n }\n});\nclass AddressLookupTableInstruction {\n /**\n * @internal\n */\n constructor() {}\n static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const index = instructionTypeLayout.decode(instruction.data);\n let type;\n for (const [layoutType, layout] of Object.entries(LOOKUP_TABLE_INSTRUCTION_LAYOUTS)) {\n if (layout.index == index) {\n type = layoutType;\n break;\n }\n }\n if (!type) {\n throw new Error('Invalid Instruction. Should be a LookupTable Instruction');\n }\n return type;\n }\n static decodeCreateLookupTable(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeysLength(instruction.keys, 4);\n const {\n recentSlot\n } = decodeData$1(LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable, instruction.data);\n return {\n authority: instruction.keys[1].pubkey,\n payer: instruction.keys[2].pubkey,\n recentSlot: Number(recentSlot)\n };\n }\n static decodeExtendLookupTable(instruction) {\n this.checkProgramId(instruction.programId);\n if (instruction.keys.length < 2) {\n throw new Error(`invalid instruction; found ${instruction.keys.length} keys, expected at least 2`);\n }\n const {\n addresses\n } = decodeData$1(LOOKUP_TABLE_INSTRUCTION_LAYOUTS.ExtendLookupTable, instruction.data);\n return {\n lookupTable: instruction.keys[0].pubkey,\n authority: instruction.keys[1].pubkey,\n payer: instruction.keys.length > 2 ? instruction.keys[2].pubkey : undefined,\n addresses: addresses.map(buffer => new PublicKey(buffer))\n };\n }\n static decodeCloseLookupTable(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeysLength(instruction.keys, 3);\n return {\n lookupTable: instruction.keys[0].pubkey,\n authority: instruction.keys[1].pubkey,\n recipient: instruction.keys[2].pubkey\n };\n }\n static decodeFreezeLookupTable(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeysLength(instruction.keys, 2);\n return {\n lookupTable: instruction.keys[0].pubkey,\n authority: instruction.keys[1].pubkey\n };\n }\n static decodeDeactivateLookupTable(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeysLength(instruction.keys, 2);\n return {\n lookupTable: instruction.keys[0].pubkey,\n authority: instruction.keys[1].pubkey\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId) {\n if (!programId.equals(AddressLookupTableProgram.programId)) {\n throw new Error('invalid instruction; programId is not AddressLookupTable Program');\n }\n }\n /**\n * @internal\n */\n static checkKeysLength(keys, expectedLength) {\n if (keys.length < expectedLength) {\n throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`);\n }\n }\n}\nclass AddressLookupTableProgram {\n /**\n * @internal\n */\n constructor() {}\n static createLookupTable(params) {\n const [lookupTableAddress, bumpSeed] = PublicKey.findProgramAddressSync([params.authority.toBuffer(), toBufferLE(BigInt(params.recentSlot), 8)], this.programId);\n const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable;\n const data = encodeData(type, {\n recentSlot: BigInt(params.recentSlot),\n bumpSeed: bumpSeed\n });\n const keys = [{\n pubkey: lookupTableAddress,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authority,\n isSigner: true,\n isWritable: false\n }, {\n pubkey: params.payer,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: SystemProgram.programId,\n isSigner: false,\n isWritable: false\n }];\n return [new TransactionInstruction({\n programId: this.programId,\n keys: keys,\n data: data\n }), lookupTableAddress];\n }\n static freezeLookupTable(params) {\n const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.FreezeLookupTable;\n const data = encodeData(type);\n const keys = [{\n pubkey: params.lookupTable,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authority,\n isSigner: true,\n isWritable: false\n }];\n return new TransactionInstruction({\n programId: this.programId,\n keys: keys,\n data: data\n });\n }\n static extendLookupTable(params) {\n const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.ExtendLookupTable;\n const data = encodeData(type, {\n addresses: params.addresses.map(addr => addr.toBytes())\n });\n const keys = [{\n pubkey: params.lookupTable,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authority,\n isSigner: true,\n isWritable: false\n }];\n if (params.payer) {\n keys.push({\n pubkey: params.payer,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: SystemProgram.programId,\n isSigner: false,\n isWritable: false\n });\n }\n return new TransactionInstruction({\n programId: this.programId,\n keys: keys,\n data: data\n });\n }\n static deactivateLookupTable(params) {\n const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.DeactivateLookupTable;\n const data = encodeData(type);\n const keys = [{\n pubkey: params.lookupTable,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authority,\n isSigner: true,\n isWritable: false\n }];\n return new TransactionInstruction({\n programId: this.programId,\n keys: keys,\n data: data\n });\n }\n static closeLookupTable(params) {\n const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CloseLookupTable;\n const data = encodeData(type);\n const keys = [{\n pubkey: params.lookupTable,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authority,\n isSigner: true,\n isWritable: false\n }, {\n pubkey: params.recipient,\n isSigner: false,\n isWritable: true\n }];\n return new TransactionInstruction({\n programId: this.programId,\n keys: keys,\n data: data\n });\n }\n}\nAddressLookupTableProgram.programId = new PublicKey('AddressLookupTab1e1111111111111111111111111');\n\n/**\n * Compute Budget Instruction class\n */\nclass ComputeBudgetInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a compute budget instruction and retrieve the instruction type.\n */\n static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = BufferLayout.u8('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n let type;\n for (const [ixType, layout] of Object.entries(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType;\n break;\n }\n }\n if (!type) {\n throw new Error('Instruction type incorrect; not a ComputeBudgetInstruction');\n }\n return type;\n }\n\n /**\n * Decode request units compute budget instruction and retrieve the instruction params.\n */\n static decodeRequestUnits(instruction) {\n this.checkProgramId(instruction.programId);\n const {\n units,\n additionalFee\n } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits, instruction.data);\n return {\n units,\n additionalFee\n };\n }\n\n /**\n * Decode request heap frame compute budget instruction and retrieve the instruction params.\n */\n static decodeRequestHeapFrame(instruction) {\n this.checkProgramId(instruction.programId);\n const {\n bytes\n } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestHeapFrame, instruction.data);\n return {\n bytes\n };\n }\n\n /**\n * Decode set compute unit limit compute budget instruction and retrieve the instruction params.\n */\n static decodeSetComputeUnitLimit(instruction) {\n this.checkProgramId(instruction.programId);\n const {\n units\n } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit, instruction.data);\n return {\n units\n };\n }\n\n /**\n * Decode set compute unit price compute budget instruction and retrieve the instruction params.\n */\n static decodeSetComputeUnitPrice(instruction) {\n this.checkProgramId(instruction.programId);\n const {\n microLamports\n } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice, instruction.data);\n return {\n microLamports\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId) {\n if (!programId.equals(ComputeBudgetProgram.programId)) {\n throw new Error('invalid instruction; programId is not ComputeBudgetProgram');\n }\n }\n}\n\n/**\n * An enumeration of valid ComputeBudgetInstructionType's\n */\n\n/**\n * Request units instruction params\n */\n\n/**\n * Request heap frame instruction params\n */\n\n/**\n * Set compute unit limit instruction params\n */\n\n/**\n * Set compute unit price instruction params\n */\n\n/**\n * An enumeration of valid ComputeBudget InstructionType's\n * @internal\n */\nconst COMPUTE_BUDGET_INSTRUCTION_LAYOUTS = Object.freeze({\n RequestUnits: {\n index: 0,\n layout: BufferLayout.struct([BufferLayout.u8('instruction'), BufferLayout.u32('units'), BufferLayout.u32('additionalFee')])\n },\n RequestHeapFrame: {\n index: 1,\n layout: BufferLayout.struct([BufferLayout.u8('instruction'), BufferLayout.u32('bytes')])\n },\n SetComputeUnitLimit: {\n index: 2,\n layout: BufferLayout.struct([BufferLayout.u8('instruction'), BufferLayout.u32('units')])\n },\n SetComputeUnitPrice: {\n index: 3,\n layout: BufferLayout.struct([BufferLayout.u8('instruction'), u64('microLamports')])\n }\n});\n\n/**\n * Factory class for transaction instructions to interact with the Compute Budget program\n */\nclass ComputeBudgetProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the Compute Budget program\n */\n\n /**\n * @deprecated Instead, call {@link setComputeUnitLimit} and/or {@link setComputeUnitPrice}\n */\n static requestUnits(params) {\n const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits;\n const data = encodeData(type, params);\n return new TransactionInstruction({\n keys: [],\n programId: this.programId,\n data\n });\n }\n static requestHeapFrame(params) {\n const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestHeapFrame;\n const data = encodeData(type, params);\n return new TransactionInstruction({\n keys: [],\n programId: this.programId,\n data\n });\n }\n static setComputeUnitLimit(params) {\n const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit;\n const data = encodeData(type, params);\n return new TransactionInstruction({\n keys: [],\n programId: this.programId,\n data\n });\n }\n static setComputeUnitPrice(params) {\n const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice;\n const data = encodeData(type, {\n microLamports: BigInt(params.microLamports)\n });\n return new TransactionInstruction({\n keys: [],\n programId: this.programId,\n data\n });\n }\n}\nComputeBudgetProgram.programId = new PublicKey('ComputeBudget111111111111111111111111111111');\n\nconst PRIVATE_KEY_BYTES$1 = 64;\nconst PUBLIC_KEY_BYTES$1 = 32;\nconst SIGNATURE_BYTES = 64;\n\n/**\n * Params for creating an ed25519 instruction using a public key\n */\n\n/**\n * Params for creating an ed25519 instruction using a private key\n */\n\nconst ED25519_INSTRUCTION_LAYOUT = BufferLayout.struct([BufferLayout.u8('numSignatures'), BufferLayout.u8('padding'), BufferLayout.u16('signatureOffset'), BufferLayout.u16('signatureInstructionIndex'), BufferLayout.u16('publicKeyOffset'), BufferLayout.u16('publicKeyInstructionIndex'), BufferLayout.u16('messageDataOffset'), BufferLayout.u16('messageDataSize'), BufferLayout.u16('messageInstructionIndex')]);\nclass Ed25519Program {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the ed25519 program\n */\n\n /**\n * Create an ed25519 instruction with a public key and signature. The\n * public key must be a buffer that is 32 bytes long, and the signature\n * must be a buffer of 64 bytes.\n */\n static createInstructionWithPublicKey(params) {\n const {\n publicKey,\n message,\n signature,\n instructionIndex\n } = params;\n assert(publicKey.length === PUBLIC_KEY_BYTES$1, `Public Key must be ${PUBLIC_KEY_BYTES$1} bytes but received ${publicKey.length} bytes`);\n assert(signature.length === SIGNATURE_BYTES, `Signature must be ${SIGNATURE_BYTES} bytes but received ${signature.length} bytes`);\n const publicKeyOffset = ED25519_INSTRUCTION_LAYOUT.span;\n const signatureOffset = publicKeyOffset + publicKey.length;\n const messageDataOffset = signatureOffset + signature.length;\n const numSignatures = 1;\n const instructionData = Buffer.alloc(messageDataOffset + message.length);\n const index = instructionIndex == null ? 0xffff // An index of `u16::MAX` makes it default to the current instruction.\n : instructionIndex;\n ED25519_INSTRUCTION_LAYOUT.encode({\n numSignatures,\n padding: 0,\n signatureOffset,\n signatureInstructionIndex: index,\n publicKeyOffset,\n publicKeyInstructionIndex: index,\n messageDataOffset,\n messageDataSize: message.length,\n messageInstructionIndex: index\n }, instructionData);\n instructionData.fill(publicKey, publicKeyOffset);\n instructionData.fill(signature, signatureOffset);\n instructionData.fill(message, messageDataOffset);\n return new TransactionInstruction({\n keys: [],\n programId: Ed25519Program.programId,\n data: instructionData\n });\n }\n\n /**\n * Create an ed25519 instruction with a private key. The private key\n * must be a buffer that is 64 bytes long.\n */\n static createInstructionWithPrivateKey(params) {\n const {\n privateKey,\n message,\n instructionIndex\n } = params;\n assert(privateKey.length === PRIVATE_KEY_BYTES$1, `Private key must be ${PRIVATE_KEY_BYTES$1} bytes but received ${privateKey.length} bytes`);\n try {\n const keypair = Keypair.fromSecretKey(privateKey);\n const publicKey = keypair.publicKey.toBytes();\n const signature = sign(message, keypair.secretKey);\n return this.createInstructionWithPublicKey({\n publicKey,\n message,\n signature,\n instructionIndex\n });\n } catch (error) {\n throw new Error(`Error creating instruction; ${error}`);\n }\n }\n}\nEd25519Program.programId = new PublicKey('Ed25519SigVerify111111111111111111111111111');\n\nconst ecdsaSign = (msgHash, privKey) => {\n const signature = secp256k1.sign(msgHash, privKey);\n return [signature.toCompactRawBytes(), signature.recovery];\n};\nsecp256k1.utils.isValidPrivateKey;\nconst publicKeyCreate = secp256k1.getPublicKey;\n\nconst PRIVATE_KEY_BYTES = 32;\nconst ETHEREUM_ADDRESS_BYTES = 20;\nconst PUBLIC_KEY_BYTES = 64;\nconst SIGNATURE_OFFSETS_SERIALIZED_SIZE = 11;\n\n/**\n * Params for creating an secp256k1 instruction using a public key\n */\n\n/**\n * Params for creating an secp256k1 instruction using an Ethereum address\n */\n\n/**\n * Params for creating an secp256k1 instruction using a private key\n */\n\nconst SECP256K1_INSTRUCTION_LAYOUT = BufferLayout.struct([BufferLayout.u8('numSignatures'), BufferLayout.u16('signatureOffset'), BufferLayout.u8('signatureInstructionIndex'), BufferLayout.u16('ethAddressOffset'), BufferLayout.u8('ethAddressInstructionIndex'), BufferLayout.u16('messageDataOffset'), BufferLayout.u16('messageDataSize'), BufferLayout.u8('messageInstructionIndex'), BufferLayout.blob(20, 'ethAddress'), BufferLayout.blob(64, 'signature'), BufferLayout.u8('recoveryId')]);\nclass Secp256k1Program {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the secp256k1 program\n */\n\n /**\n * Construct an Ethereum address from a secp256k1 public key buffer.\n * @param {Buffer} publicKey a 64 byte secp256k1 public key buffer\n */\n static publicKeyToEthAddress(publicKey) {\n assert(publicKey.length === PUBLIC_KEY_BYTES, `Public key must be ${PUBLIC_KEY_BYTES} bytes but received ${publicKey.length} bytes`);\n try {\n return Buffer.from(keccak_256(toBuffer(publicKey))).slice(-ETHEREUM_ADDRESS_BYTES);\n } catch (error) {\n throw new Error(`Error constructing Ethereum address: ${error}`);\n }\n }\n\n /**\n * Create an secp256k1 instruction with a public key. The public key\n * must be a buffer that is 64 bytes long.\n */\n static createInstructionWithPublicKey(params) {\n const {\n publicKey,\n message,\n signature,\n recoveryId,\n instructionIndex\n } = params;\n return Secp256k1Program.createInstructionWithEthAddress({\n ethAddress: Secp256k1Program.publicKeyToEthAddress(publicKey),\n message,\n signature,\n recoveryId,\n instructionIndex\n });\n }\n\n /**\n * Create an secp256k1 instruction with an Ethereum address. The address\n * must be a hex string or a buffer that is 20 bytes long.\n */\n static createInstructionWithEthAddress(params) {\n const {\n ethAddress: rawAddress,\n message,\n signature,\n recoveryId,\n instructionIndex = 0\n } = params;\n let ethAddress;\n if (typeof rawAddress === 'string') {\n if (rawAddress.startsWith('0x')) {\n ethAddress = Buffer.from(rawAddress.substr(2), 'hex');\n } else {\n ethAddress = Buffer.from(rawAddress, 'hex');\n }\n } else {\n ethAddress = rawAddress;\n }\n assert(ethAddress.length === ETHEREUM_ADDRESS_BYTES, `Address must be ${ETHEREUM_ADDRESS_BYTES} bytes but received ${ethAddress.length} bytes`);\n const dataStart = 1 + SIGNATURE_OFFSETS_SERIALIZED_SIZE;\n const ethAddressOffset = dataStart;\n const signatureOffset = dataStart + ethAddress.length;\n const messageDataOffset = signatureOffset + signature.length + 1;\n const numSignatures = 1;\n const instructionData = Buffer.alloc(SECP256K1_INSTRUCTION_LAYOUT.span + message.length);\n SECP256K1_INSTRUCTION_LAYOUT.encode({\n numSignatures,\n signatureOffset,\n signatureInstructionIndex: instructionIndex,\n ethAddressOffset,\n ethAddressInstructionIndex: instructionIndex,\n messageDataOffset,\n messageDataSize: message.length,\n messageInstructionIndex: instructionIndex,\n signature: toBuffer(signature),\n ethAddress: toBuffer(ethAddress),\n recoveryId\n }, instructionData);\n instructionData.fill(toBuffer(message), SECP256K1_INSTRUCTION_LAYOUT.span);\n return new TransactionInstruction({\n keys: [],\n programId: Secp256k1Program.programId,\n data: instructionData\n });\n }\n\n /**\n * Create an secp256k1 instruction with a private key. The private key\n * must be a buffer that is 32 bytes long.\n */\n static createInstructionWithPrivateKey(params) {\n const {\n privateKey: pkey,\n message,\n instructionIndex\n } = params;\n assert(pkey.length === PRIVATE_KEY_BYTES, `Private key must be ${PRIVATE_KEY_BYTES} bytes but received ${pkey.length} bytes`);\n try {\n const privateKey = toBuffer(pkey);\n const publicKey = publicKeyCreate(privateKey, false /* isCompressed */).slice(1); // throw away leading byte\n const messageHash = Buffer.from(keccak_256(toBuffer(message)));\n const [signature, recoveryId] = ecdsaSign(messageHash, privateKey);\n return this.createInstructionWithPublicKey({\n publicKey,\n message,\n signature,\n recoveryId,\n instructionIndex\n });\n } catch (error) {\n throw new Error(`Error creating instruction; ${error}`);\n }\n }\n}\nSecp256k1Program.programId = new PublicKey('KeccakSecp256k11111111111111111111111111111');\n\nvar _class2;\n\n/**\n * Address of the stake config account which configures the rate\n * of stake warmup and cooldown as well as the slashing penalty.\n */\nconst STAKE_CONFIG_ID = new PublicKey('StakeConfig11111111111111111111111111111111');\n\n/**\n * Stake account authority info\n */\nclass Authorized {\n /**\n * Create a new Authorized object\n * @param staker the stake authority\n * @param withdrawer the withdraw authority\n */\n constructor(staker, withdrawer) {\n /** stake authority */\n this.staker = void 0;\n /** withdraw authority */\n this.withdrawer = void 0;\n this.staker = staker;\n this.withdrawer = withdrawer;\n }\n}\n/**\n * Stake account lockup info\n */\nclass Lockup {\n /**\n * Create a new Lockup object\n */\n constructor(unixTimestamp, epoch, custodian) {\n /** Unix timestamp of lockup expiration */\n this.unixTimestamp = void 0;\n /** Epoch of lockup expiration */\n this.epoch = void 0;\n /** Lockup custodian authority */\n this.custodian = void 0;\n this.unixTimestamp = unixTimestamp;\n this.epoch = epoch;\n this.custodian = custodian;\n }\n\n /**\n * Default, inactive Lockup value\n */\n}\n_class2 = Lockup;\nLockup.default = new _class2(0, 0, PublicKey.default);\n/**\n * Create stake account transaction params\n */\n/**\n * Create stake account with seed transaction params\n */\n/**\n * Initialize stake instruction params\n */\n/**\n * Delegate stake instruction params\n */\n/**\n * Authorize stake instruction params\n */\n/**\n * Authorize stake instruction params using a derived key\n */\n/**\n * Split stake instruction params\n */\n/**\n * Split with seed transaction params\n */\n/**\n * Withdraw stake instruction params\n */\n/**\n * Deactivate stake instruction params\n */\n/**\n * Merge stake instruction params\n */\n/**\n * Stake Instruction class\n */\nclass StakeInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a stake instruction and retrieve the instruction type.\n */\n static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n let type;\n for (const [ixType, layout] of Object.entries(STAKE_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType;\n break;\n }\n }\n if (!type) {\n throw new Error('Instruction type incorrect; not a StakeInstruction');\n }\n return type;\n }\n\n /**\n * Decode a initialize stake instruction and retrieve the instruction params.\n */\n static decodeInitialize(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n authorized,\n lockup\n } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Initialize, instruction.data);\n return {\n stakePubkey: instruction.keys[0].pubkey,\n authorized: new Authorized(new PublicKey(authorized.staker), new PublicKey(authorized.withdrawer)),\n lockup: new Lockup(lockup.unixTimestamp, lockup.epoch, new PublicKey(lockup.custodian))\n };\n }\n\n /**\n * Decode a delegate stake instruction and retrieve the instruction params.\n */\n static decodeDelegate(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 6);\n decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Delegate, instruction.data);\n return {\n stakePubkey: instruction.keys[0].pubkey,\n votePubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[5].pubkey\n };\n }\n\n /**\n * Decode an authorize stake instruction and retrieve the instruction params.\n */\n static decodeAuthorize(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n newAuthorized,\n stakeAuthorizationType\n } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Authorize, instruction.data);\n const o = {\n stakePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n stakeAuthorizationType: {\n index: stakeAuthorizationType\n }\n };\n if (instruction.keys.length > 3) {\n o.custodianPubkey = instruction.keys[3].pubkey;\n }\n return o;\n }\n\n /**\n * Decode an authorize-with-seed stake instruction and retrieve the instruction params.\n */\n static decodeAuthorizeWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n newAuthorized,\n stakeAuthorizationType,\n authoritySeed,\n authorityOwner\n } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed, instruction.data);\n const o = {\n stakePubkey: instruction.keys[0].pubkey,\n authorityBase: instruction.keys[1].pubkey,\n authoritySeed: authoritySeed,\n authorityOwner: new PublicKey(authorityOwner),\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n stakeAuthorizationType: {\n index: stakeAuthorizationType\n }\n };\n if (instruction.keys.length > 3) {\n o.custodianPubkey = instruction.keys[3].pubkey;\n }\n return o;\n }\n\n /**\n * Decode a split stake instruction and retrieve the instruction params.\n */\n static decodeSplit(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n lamports\n } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Split, instruction.data);\n return {\n stakePubkey: instruction.keys[0].pubkey,\n splitStakePubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n lamports\n };\n }\n\n /**\n * Decode a merge stake instruction and retrieve the instruction params.\n */\n static decodeMerge(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Merge, instruction.data);\n return {\n stakePubkey: instruction.keys[0].pubkey,\n sourceStakePubKey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey\n };\n }\n\n /**\n * Decode a withdraw stake instruction and retrieve the instruction params.\n */\n static decodeWithdraw(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 5);\n const {\n lamports\n } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Withdraw, instruction.data);\n const o = {\n stakePubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey,\n lamports\n };\n if (instruction.keys.length > 5) {\n o.custodianPubkey = instruction.keys[5].pubkey;\n }\n return o;\n }\n\n /**\n * Decode a deactivate stake instruction and retrieve the instruction params.\n */\n static decodeDeactivate(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Deactivate, instruction.data);\n return {\n stakePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId) {\n if (!programId.equals(StakeProgram.programId)) {\n throw new Error('invalid instruction; programId is not StakeProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys, expectedLength) {\n if (keys.length < expectedLength) {\n throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`);\n }\n }\n}\n\n/**\n * An enumeration of valid StakeInstructionType's\n */\n\n/**\n * An enumeration of valid stake InstructionType's\n * @internal\n */\nconst STAKE_INSTRUCTION_LAYOUTS = Object.freeze({\n Initialize: {\n index: 0,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), authorized(), lockup()])\n },\n Authorize: {\n index: 1,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), publicKey('newAuthorized'), BufferLayout.u32('stakeAuthorizationType')])\n },\n Delegate: {\n index: 2,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')])\n },\n Split: {\n index: 3,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), BufferLayout.ns64('lamports')])\n },\n Withdraw: {\n index: 4,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), BufferLayout.ns64('lamports')])\n },\n Deactivate: {\n index: 5,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')])\n },\n Merge: {\n index: 7,\n layout: BufferLayout.struct([BufferLayout.u32('instruction')])\n },\n AuthorizeWithSeed: {\n index: 8,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), publicKey('newAuthorized'), BufferLayout.u32('stakeAuthorizationType'), rustString('authoritySeed'), publicKey('authorityOwner')])\n }\n});\n\n/**\n * Stake authorization type\n */\n\n/**\n * An enumeration of valid StakeAuthorizationLayout's\n */\nconst StakeAuthorizationLayout = Object.freeze({\n Staker: {\n index: 0\n },\n Withdrawer: {\n index: 1\n }\n});\n\n/**\n * Factory class for transactions to interact with the Stake program\n */\nclass StakeProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the Stake program\n */\n\n /**\n * Generate an Initialize instruction to add to a Stake Create transaction\n */\n static initialize(params) {\n const {\n stakePubkey,\n authorized,\n lockup: maybeLockup\n } = params;\n const lockup = maybeLockup || Lockup.default;\n const type = STAKE_INSTRUCTION_LAYOUTS.Initialize;\n const data = encodeData(type, {\n authorized: {\n staker: toBuffer(authorized.staker.toBuffer()),\n withdrawer: toBuffer(authorized.withdrawer.toBuffer())\n },\n lockup: {\n unixTimestamp: lockup.unixTimestamp,\n epoch: lockup.epoch,\n custodian: toBuffer(lockup.custodian.toBuffer())\n }\n });\n const instructionData = {\n keys: [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false\n }],\n programId: this.programId,\n data\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a Transaction that creates a new Stake account at\n * an address generated with `from`, a seed, and the Stake programId\n */\n static createAccountWithSeed(params) {\n const transaction = new Transaction();\n transaction.add(SystemProgram.createAccountWithSeed({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n basePubkey: params.basePubkey,\n seed: params.seed,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId\n }));\n const {\n stakePubkey,\n authorized,\n lockup\n } = params;\n return transaction.add(this.initialize({\n stakePubkey,\n authorized,\n lockup\n }));\n }\n\n /**\n * Generate a Transaction that creates a new Stake account\n */\n static createAccount(params) {\n const transaction = new Transaction();\n transaction.add(SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId\n }));\n const {\n stakePubkey,\n authorized,\n lockup\n } = params;\n return transaction.add(this.initialize({\n stakePubkey,\n authorized,\n lockup\n }));\n }\n\n /**\n * Generate a Transaction that delegates Stake tokens to a validator\n * Vote PublicKey. This transaction can also be used to redelegate Stake\n * to a new validator Vote PublicKey.\n */\n static delegate(params) {\n const {\n stakePubkey,\n authorizedPubkey,\n votePubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Delegate;\n const data = encodeData(type);\n return new Transaction().add({\n keys: [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: votePubkey,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: STAKE_CONFIG_ID,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a Transaction that authorizes a new PublicKey as Staker\n * or Withdrawer on the Stake account.\n */\n static authorize(params) {\n const {\n stakePubkey,\n authorizedPubkey,\n newAuthorizedPubkey,\n stakeAuthorizationType,\n custodianPubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Authorize;\n const data = encodeData(type, {\n newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()),\n stakeAuthorizationType: stakeAuthorizationType.index\n });\n const keys = [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }];\n if (custodianPubkey) {\n keys.push({\n pubkey: custodianPubkey,\n isSigner: true,\n isWritable: false\n });\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a Transaction that authorizes a new PublicKey as Staker\n * or Withdrawer on the Stake account.\n */\n static authorizeWithSeed(params) {\n const {\n stakePubkey,\n authorityBase,\n authoritySeed,\n authorityOwner,\n newAuthorizedPubkey,\n stakeAuthorizationType,\n custodianPubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed;\n const data = encodeData(type, {\n newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()),\n stakeAuthorizationType: stakeAuthorizationType.index,\n authoritySeed: authoritySeed,\n authorityOwner: toBuffer(authorityOwner.toBuffer())\n });\n const keys = [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: authorityBase,\n isSigner: true,\n isWritable: false\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }];\n if (custodianPubkey) {\n keys.push({\n pubkey: custodianPubkey,\n isSigner: true,\n isWritable: false\n });\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * @internal\n */\n static splitInstruction(params) {\n const {\n stakePubkey,\n authorizedPubkey,\n splitStakePubkey,\n lamports\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Split;\n const data = encodeData(type, {\n lamports\n });\n return new TransactionInstruction({\n keys: [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: splitStakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a Transaction that splits Stake tokens into another stake account\n */\n static split(params) {\n const transaction = new Transaction();\n transaction.add(SystemProgram.createAccount({\n fromPubkey: params.authorizedPubkey,\n newAccountPubkey: params.splitStakePubkey,\n lamports: 0,\n space: this.space,\n programId: this.programId\n }));\n return transaction.add(this.splitInstruction(params));\n }\n\n /**\n * Generate a Transaction that splits Stake tokens into another account\n * derived from a base public key and seed\n */\n static splitWithSeed(params) {\n const {\n stakePubkey,\n authorizedPubkey,\n splitStakePubkey,\n basePubkey,\n seed,\n lamports\n } = params;\n const transaction = new Transaction();\n transaction.add(SystemProgram.allocate({\n accountPubkey: splitStakePubkey,\n basePubkey,\n seed,\n space: this.space,\n programId: this.programId\n }));\n return transaction.add(this.splitInstruction({\n stakePubkey,\n authorizedPubkey,\n splitStakePubkey,\n lamports\n }));\n }\n\n /**\n * Generate a Transaction that merges Stake accounts.\n */\n static merge(params) {\n const {\n stakePubkey,\n sourceStakePubKey,\n authorizedPubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Merge;\n const data = encodeData(type);\n return new Transaction().add({\n keys: [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: sourceStakePubKey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a Transaction that withdraws deactivated Stake tokens.\n */\n static withdraw(params) {\n const {\n stakePubkey,\n authorizedPubkey,\n toPubkey,\n lamports,\n custodianPubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Withdraw;\n const data = encodeData(type, {\n lamports\n });\n const keys = [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: toPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }];\n if (custodianPubkey) {\n keys.push({\n pubkey: custodianPubkey,\n isSigner: true,\n isWritable: false\n });\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a Transaction that deactivates Stake tokens.\n */\n static deactivate(params) {\n const {\n stakePubkey,\n authorizedPubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Deactivate;\n const data = encodeData(type);\n return new Transaction().add({\n keys: [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n}\nStakeProgram.programId = new PublicKey('Stake11111111111111111111111111111111111111');\n/**\n * Max space of a Stake account\n *\n * This is generated from the solana-stake-program StakeState struct as\n * `StakeState::size_of()`:\n * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeState.html\n */\nStakeProgram.space = 200;\n\n/**\n * Vote account info\n */\nclass VoteInit {\n /** [0, 100] */\n\n constructor(nodePubkey, authorizedVoter, authorizedWithdrawer, commission) {\n this.nodePubkey = void 0;\n this.authorizedVoter = void 0;\n this.authorizedWithdrawer = void 0;\n this.commission = void 0;\n this.nodePubkey = nodePubkey;\n this.authorizedVoter = authorizedVoter;\n this.authorizedWithdrawer = authorizedWithdrawer;\n this.commission = commission;\n }\n}\n\n/**\n * Create vote account transaction params\n */\n\n/**\n * InitializeAccount instruction params\n */\n\n/**\n * Authorize instruction params\n */\n\n/**\n * AuthorizeWithSeed instruction params\n */\n\n/**\n * Withdraw from vote account transaction params\n */\n\n/**\n * Vote Instruction class\n */\nclass VoteInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a vote instruction and retrieve the instruction type.\n */\n static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = BufferLayout.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n let type;\n for (const [ixType, layout] of Object.entries(VOTE_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType;\n break;\n }\n }\n if (!type) {\n throw new Error('Instruction type incorrect; not a VoteInstruction');\n }\n return type;\n }\n\n /**\n * Decode an initialize vote instruction and retrieve the instruction params.\n */\n static decodeInitializeAccount(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 4);\n const {\n voteInit\n } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.InitializeAccount, instruction.data);\n return {\n votePubkey: instruction.keys[0].pubkey,\n nodePubkey: instruction.keys[3].pubkey,\n voteInit: new VoteInit(new PublicKey(voteInit.nodePubkey), new PublicKey(voteInit.authorizedVoter), new PublicKey(voteInit.authorizedWithdrawer), voteInit.commission)\n };\n }\n\n /**\n * Decode an authorize instruction and retrieve the instruction params.\n */\n static decodeAuthorize(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n newAuthorized,\n voteAuthorizationType\n } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.Authorize, instruction.data);\n return {\n votePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n voteAuthorizationType: {\n index: voteAuthorizationType\n }\n };\n }\n\n /**\n * Decode an authorize instruction and retrieve the instruction params.\n */\n static decodeAuthorizeWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n voteAuthorizeWithSeedArgs: {\n currentAuthorityDerivedKeyOwnerPubkey,\n currentAuthorityDerivedKeySeed,\n newAuthorized,\n voteAuthorizationType\n }\n } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed, instruction.data);\n return {\n currentAuthorityDerivedKeyBasePubkey: instruction.keys[2].pubkey,\n currentAuthorityDerivedKeyOwnerPubkey: new PublicKey(currentAuthorityDerivedKeyOwnerPubkey),\n currentAuthorityDerivedKeySeed: currentAuthorityDerivedKeySeed,\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n voteAuthorizationType: {\n index: voteAuthorizationType\n },\n votePubkey: instruction.keys[0].pubkey\n };\n }\n\n /**\n * Decode a withdraw instruction and retrieve the instruction params.\n */\n static decodeWithdraw(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n lamports\n } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.Withdraw, instruction.data);\n return {\n votePubkey: instruction.keys[0].pubkey,\n authorizedWithdrawerPubkey: instruction.keys[2].pubkey,\n lamports,\n toPubkey: instruction.keys[1].pubkey\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId) {\n if (!programId.equals(VoteProgram.programId)) {\n throw new Error('invalid instruction; programId is not VoteProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys, expectedLength) {\n if (keys.length < expectedLength) {\n throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`);\n }\n }\n}\n\n/**\n * An enumeration of valid VoteInstructionType's\n */\n\n/** @internal */\n\nconst VOTE_INSTRUCTION_LAYOUTS = Object.freeze({\n InitializeAccount: {\n index: 0,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), voteInit()])\n },\n Authorize: {\n index: 1,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), publicKey('newAuthorized'), BufferLayout.u32('voteAuthorizationType')])\n },\n Withdraw: {\n index: 3,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), BufferLayout.ns64('lamports')])\n },\n AuthorizeWithSeed: {\n index: 10,\n layout: BufferLayout.struct([BufferLayout.u32('instruction'), voteAuthorizeWithSeedArgs()])\n }\n});\n\n/**\n * VoteAuthorize type\n */\n\n/**\n * An enumeration of valid VoteAuthorization layouts.\n */\nconst VoteAuthorizationLayout = Object.freeze({\n Voter: {\n index: 0\n },\n Withdrawer: {\n index: 1\n }\n});\n\n/**\n * Factory class for transactions to interact with the Vote program\n */\nclass VoteProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the Vote program\n */\n\n /**\n * Generate an Initialize instruction.\n */\n static initializeAccount(params) {\n const {\n votePubkey,\n nodePubkey,\n voteInit\n } = params;\n const type = VOTE_INSTRUCTION_LAYOUTS.InitializeAccount;\n const data = encodeData(type, {\n voteInit: {\n nodePubkey: toBuffer(voteInit.nodePubkey.toBuffer()),\n authorizedVoter: toBuffer(voteInit.authorizedVoter.toBuffer()),\n authorizedWithdrawer: toBuffer(voteInit.authorizedWithdrawer.toBuffer()),\n commission: voteInit.commission\n }\n });\n const instructionData = {\n keys: [{\n pubkey: votePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: nodePubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a transaction that creates a new Vote account.\n */\n static createAccount(params) {\n const transaction = new Transaction();\n transaction.add(SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.votePubkey,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId\n }));\n return transaction.add(this.initializeAccount({\n votePubkey: params.votePubkey,\n nodePubkey: params.voteInit.nodePubkey,\n voteInit: params.voteInit\n }));\n }\n\n /**\n * Generate a transaction that authorizes a new Voter or Withdrawer on the Vote account.\n */\n static authorize(params) {\n const {\n votePubkey,\n authorizedPubkey,\n newAuthorizedPubkey,\n voteAuthorizationType\n } = params;\n const type = VOTE_INSTRUCTION_LAYOUTS.Authorize;\n const data = encodeData(type, {\n newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()),\n voteAuthorizationType: voteAuthorizationType.index\n });\n const keys = [{\n pubkey: votePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }];\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction that authorizes a new Voter or Withdrawer on the Vote account\n * where the current Voter or Withdrawer authority is a derived key.\n */\n static authorizeWithSeed(params) {\n const {\n currentAuthorityDerivedKeyBasePubkey,\n currentAuthorityDerivedKeyOwnerPubkey,\n currentAuthorityDerivedKeySeed,\n newAuthorizedPubkey,\n voteAuthorizationType,\n votePubkey\n } = params;\n const type = VOTE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed;\n const data = encodeData(type, {\n voteAuthorizeWithSeedArgs: {\n currentAuthorityDerivedKeyOwnerPubkey: toBuffer(currentAuthorityDerivedKeyOwnerPubkey.toBuffer()),\n currentAuthorityDerivedKeySeed: currentAuthorityDerivedKeySeed,\n newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()),\n voteAuthorizationType: voteAuthorizationType.index\n }\n });\n const keys = [{\n pubkey: votePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: currentAuthorityDerivedKeyBasePubkey,\n isSigner: true,\n isWritable: false\n }];\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction to withdraw from a Vote account.\n */\n static withdraw(params) {\n const {\n votePubkey,\n authorizedWithdrawerPubkey,\n lamports,\n toPubkey\n } = params;\n const type = VOTE_INSTRUCTION_LAYOUTS.Withdraw;\n const data = encodeData(type, {\n lamports\n });\n const keys = [{\n pubkey: votePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: toPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: authorizedWithdrawerPubkey,\n isSigner: true,\n isWritable: false\n }];\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction to withdraw safely from a Vote account.\n *\n * This function was created as a safeguard for vote accounts running validators, `safeWithdraw`\n * checks that the withdraw amount will not exceed the specified balance while leaving enough left\n * to cover rent. If you wish to close the vote account by withdrawing the full amount, call the\n * `withdraw` method directly.\n */\n static safeWithdraw(params, currentVoteAccountBalance, rentExemptMinimum) {\n if (params.lamports > currentVoteAccountBalance - rentExemptMinimum) {\n throw new Error('Withdraw will leave vote account with insuffcient funds.');\n }\n return VoteProgram.withdraw(params);\n }\n}\nVoteProgram.programId = new PublicKey('Vote111111111111111111111111111111111111111');\n/**\n * Max space of a Vote account\n *\n * This is generated from the solana-vote-program VoteState struct as\n * `VoteState::size_of()`:\n * https://docs.rs/solana-vote-program/1.9.5/solana_vote_program/vote_state/struct.VoteState.html#method.size_of\n *\n * KEEP IN SYNC WITH `VoteState::size_of()` in https://github.com/solana-labs/solana/blob/a474cb24b9238f5edcc982f65c0b37d4a1046f7e/sdk/program/src/vote/state/mod.rs#L340-L342\n */\nVoteProgram.space = 3731;\n\nconst VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo111111111111111111111111111111');\n\n/**\n * @internal\n */\n\n/**\n * Info used to identity validators.\n */\n\nconst InfoString = type({\n name: string(),\n website: optional(string()),\n details: optional(string()),\n keybaseUsername: optional(string())\n});\n\n/**\n * ValidatorInfo class\n */\nclass ValidatorInfo {\n /**\n * Construct a valid ValidatorInfo\n *\n * @param key validator public key\n * @param info validator information\n */\n constructor(key, info) {\n /**\n * validator public key\n */\n this.key = void 0;\n /**\n * validator information\n */\n this.info = void 0;\n this.key = key;\n this.info = info;\n }\n\n /**\n * Deserialize ValidatorInfo from the config account data. Exactly two config\n * keys are required in the data.\n *\n * @param buffer config account data\n * @return null if info was not found\n */\n static fromConfigData(buffer) {\n let byteArray = [...buffer];\n const configKeyCount = decodeLength(byteArray);\n if (configKeyCount !== 2) return null;\n const configKeys = [];\n for (let i = 0; i < 2; i++) {\n const publicKey = new PublicKey(byteArray.slice(0, PUBLIC_KEY_LENGTH));\n byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);\n const isSigner = byteArray.slice(0, 1)[0] === 1;\n byteArray = byteArray.slice(1);\n configKeys.push({\n publicKey,\n isSigner\n });\n }\n if (configKeys[0].publicKey.equals(VALIDATOR_INFO_KEY)) {\n if (configKeys[1].isSigner) {\n const rawInfo = rustString().decode(Buffer.from(byteArray));\n const info = JSON.parse(rawInfo);\n assert$1(info, InfoString);\n return new ValidatorInfo(configKeys[1].publicKey, info);\n }\n }\n return null;\n }\n}\n\nconst VOTE_PROGRAM_ID = new PublicKey('Vote111111111111111111111111111111111111111');\n\n/**\n * History of how many credits earned by the end of each epoch\n */\n\n/**\n * See https://github.com/solana-labs/solana/blob/8a12ed029cfa38d4a45400916c2463fb82bbec8c/programs/vote_api/src/vote_state.rs#L68-L88\n *\n * @internal\n */\nconst VoteAccountLayout = BufferLayout.struct([publicKey('nodePubkey'), publicKey('authorizedWithdrawer'), BufferLayout.u8('commission'), BufferLayout.nu64(),\n// votes.length\nBufferLayout.seq(BufferLayout.struct([BufferLayout.nu64('slot'), BufferLayout.u32('confirmationCount')]), BufferLayout.offset(BufferLayout.u32(), -8), 'votes'), BufferLayout.u8('rootSlotValid'), BufferLayout.nu64('rootSlot'), BufferLayout.nu64(),\n// authorizedVoters.length\nBufferLayout.seq(BufferLayout.struct([BufferLayout.nu64('epoch'), publicKey('authorizedVoter')]), BufferLayout.offset(BufferLayout.u32(), -8), 'authorizedVoters'), BufferLayout.struct([BufferLayout.seq(BufferLayout.struct([publicKey('authorizedPubkey'), BufferLayout.nu64('epochOfLastAuthorizedSwitch'), BufferLayout.nu64('targetEpoch')]), 32, 'buf'), BufferLayout.nu64('idx'), BufferLayout.u8('isEmpty')], 'priorVoters'), BufferLayout.nu64(),\n// epochCredits.length\nBufferLayout.seq(BufferLayout.struct([BufferLayout.nu64('epoch'), BufferLayout.nu64('credits'), BufferLayout.nu64('prevCredits')]), BufferLayout.offset(BufferLayout.u32(), -8), 'epochCredits'), BufferLayout.struct([BufferLayout.nu64('slot'), BufferLayout.nu64('timestamp')], 'lastTimestamp')]);\n/**\n * VoteAccount class\n */\nclass VoteAccount {\n /**\n * @internal\n */\n constructor(args) {\n this.nodePubkey = void 0;\n this.authorizedWithdrawer = void 0;\n this.commission = void 0;\n this.rootSlot = void 0;\n this.votes = void 0;\n this.authorizedVoters = void 0;\n this.priorVoters = void 0;\n this.epochCredits = void 0;\n this.lastTimestamp = void 0;\n this.nodePubkey = args.nodePubkey;\n this.authorizedWithdrawer = args.authorizedWithdrawer;\n this.commission = args.commission;\n this.rootSlot = args.rootSlot;\n this.votes = args.votes;\n this.authorizedVoters = args.authorizedVoters;\n this.priorVoters = args.priorVoters;\n this.epochCredits = args.epochCredits;\n this.lastTimestamp = args.lastTimestamp;\n }\n\n /**\n * Deserialize VoteAccount from the account data.\n *\n * @param buffer account data\n * @return VoteAccount\n */\n static fromAccountData(buffer) {\n const versionOffset = 4;\n const va = VoteAccountLayout.decode(toBuffer(buffer), versionOffset);\n let rootSlot = va.rootSlot;\n if (!va.rootSlotValid) {\n rootSlot = null;\n }\n return new VoteAccount({\n nodePubkey: new PublicKey(va.nodePubkey),\n authorizedWithdrawer: new PublicKey(va.authorizedWithdrawer),\n commission: va.commission,\n votes: va.votes,\n rootSlot,\n authorizedVoters: va.authorizedVoters.map(parseAuthorizedVoter),\n priorVoters: getPriorVoters(va.priorVoters),\n epochCredits: va.epochCredits,\n lastTimestamp: va.lastTimestamp\n });\n }\n}\nfunction parseAuthorizedVoter({\n authorizedVoter,\n epoch\n}) {\n return {\n epoch,\n authorizedVoter: new PublicKey(authorizedVoter)\n };\n}\nfunction parsePriorVoters({\n authorizedPubkey,\n epochOfLastAuthorizedSwitch,\n targetEpoch\n}) {\n return {\n authorizedPubkey: new PublicKey(authorizedPubkey),\n epochOfLastAuthorizedSwitch,\n targetEpoch\n };\n}\nfunction getPriorVoters({\n buf,\n idx,\n isEmpty\n}) {\n if (isEmpty) {\n return [];\n }\n return [...buf.slice(idx + 1).map(parsePriorVoters), ...buf.slice(0, idx).map(parsePriorVoters)];\n}\n\nconst endpoint = {\n http: {\n devnet: 'http://api.devnet.solana.com',\n testnet: 'http://api.testnet.solana.com',\n 'mainnet-beta': 'http://api.mainnet-beta.solana.com/'\n },\n https: {\n devnet: 'https://api.devnet.solana.com',\n testnet: 'https://api.testnet.solana.com',\n 'mainnet-beta': 'https://api.mainnet-beta.solana.com/'\n }\n};\n/**\n * Retrieves the RPC API URL for the specified cluster\n * @param {Cluster} [cluster=\"devnet\"] - The cluster name of the RPC API URL to use. Possible options: 'devnet' | 'testnet' | 'mainnet-beta'\n * @param {boolean} [tls=\"http\"] - Use TLS when connecting to cluster.\n *\n * @returns {string} URL string of the RPC endpoint\n */\nfunction clusterApiUrl(cluster, tls) {\n const key = tls === false ? 'http' : 'https';\n if (!cluster) {\n return endpoint[key]['devnet'];\n }\n const url = endpoint[key][cluster];\n if (!url) {\n throw new Error(`Unknown ${key} cluster: ${cluster}`);\n }\n return url;\n}\n\n/**\n * Send and confirm a raw transaction\n *\n * If `commitment` option is not specified, defaults to 'max' commitment.\n *\n * @param {Connection} connection\n * @param {Buffer} rawTransaction\n * @param {TransactionConfirmationStrategy} confirmationStrategy\n * @param {ConfirmOptions} [options]\n * @returns {Promise}\n */\n\n/**\n * @deprecated Calling `sendAndConfirmRawTransaction()` without a `confirmationStrategy`\n * is no longer supported and will be removed in a future version.\n */\n// eslint-disable-next-line no-redeclare\n\n// eslint-disable-next-line no-redeclare\nasync function sendAndConfirmRawTransaction(connection, rawTransaction, confirmationStrategyOrConfirmOptions, maybeConfirmOptions) {\n let confirmationStrategy;\n let options;\n if (confirmationStrategyOrConfirmOptions && Object.prototype.hasOwnProperty.call(confirmationStrategyOrConfirmOptions, 'lastValidBlockHeight')) {\n confirmationStrategy = confirmationStrategyOrConfirmOptions;\n options = maybeConfirmOptions;\n } else if (confirmationStrategyOrConfirmOptions && Object.prototype.hasOwnProperty.call(confirmationStrategyOrConfirmOptions, 'nonceValue')) {\n confirmationStrategy = confirmationStrategyOrConfirmOptions;\n options = maybeConfirmOptions;\n } else {\n options = confirmationStrategyOrConfirmOptions;\n }\n const sendOptions = options && {\n skipPreflight: options.skipPreflight,\n preflightCommitment: options.preflightCommitment || options.commitment,\n minContextSlot: options.minContextSlot\n };\n const signature = await connection.sendRawTransaction(rawTransaction, sendOptions);\n const commitment = options && options.commitment;\n const confirmationPromise = confirmationStrategy ? connection.confirmTransaction(confirmationStrategy, commitment) : connection.confirmTransaction(signature, commitment);\n const status = (await confirmationPromise).value;\n if (status.err) {\n throw new Error(`Raw transaction ${signature} failed (${JSON.stringify(status)})`);\n }\n return signature;\n}\n\n/**\n * There are 1-billion lamports in one SOL\n */\nconst LAMPORTS_PER_SOL = 1000000000;\n\nexport { Account, AddressLookupTableAccount, AddressLookupTableInstruction, AddressLookupTableProgram, Authorized, BLOCKHASH_CACHE_TIMEOUT_MS, BPF_LOADER_DEPRECATED_PROGRAM_ID, BPF_LOADER_PROGRAM_ID, BpfLoader, COMPUTE_BUDGET_INSTRUCTION_LAYOUTS, ComputeBudgetInstruction, ComputeBudgetProgram, Connection, Ed25519Program, Enum, EpochSchedule, FeeCalculatorLayout, Keypair, LAMPORTS_PER_SOL, LOOKUP_TABLE_INSTRUCTION_LAYOUTS, Loader, Lockup, MAX_SEED_LENGTH, Message, MessageAccountKeys, MessageV0, NONCE_ACCOUNT_LENGTH, NonceAccount, PACKET_DATA_SIZE, PUBLIC_KEY_LENGTH, PublicKey, SIGNATURE_LENGTH_IN_BYTES, SOLANA_SCHEMA, STAKE_CONFIG_ID, STAKE_INSTRUCTION_LAYOUTS, SYSTEM_INSTRUCTION_LAYOUTS, SYSVAR_CLOCK_PUBKEY, SYSVAR_EPOCH_SCHEDULE_PUBKEY, SYSVAR_INSTRUCTIONS_PUBKEY, SYSVAR_RECENT_BLOCKHASHES_PUBKEY, SYSVAR_RENT_PUBKEY, SYSVAR_REWARDS_PUBKEY, SYSVAR_SLOT_HASHES_PUBKEY, SYSVAR_SLOT_HISTORY_PUBKEY, SYSVAR_STAKE_HISTORY_PUBKEY, Secp256k1Program, SendTransactionError, SolanaJSONRPCError, SolanaJSONRPCErrorCode, StakeAuthorizationLayout, StakeInstruction, StakeProgram, Struct, SystemInstruction, SystemProgram, Transaction, TransactionExpiredBlockheightExceededError, TransactionExpiredNonceInvalidError, TransactionExpiredTimeoutError, TransactionInstruction, TransactionMessage, TransactionStatus, VALIDATOR_INFO_KEY, VERSION_PREFIX_MASK, VOTE_PROGRAM_ID, ValidatorInfo, VersionedMessage, VersionedTransaction, VoteAccount, VoteAuthorizationLayout, VoteInit, VoteInstruction, VoteProgram, clusterApiUrl, sendAndConfirmRawTransaction, sendAndConfirmTransaction };\n//# sourceMappingURL=index.browser.esm.js.map\n","\"use strict\";\n(self[\"webpackChunk_N_E\"] = self[\"webpackChunk_N_E\"] || []).push([[7357],{\n\n/***/ 72053:\n/***/ (function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {\n\n__webpack_require__.r(__webpack_exports__);\n/* harmony export */ __webpack_require__.d(__webpack_exports__, {\n/* harmony export */ \"Account\": function() { return /* binding */ Account; },\n/* harmony export */ \"AddressLookupTableAccount\": function() { return /* binding */ AddressLookupTableAccount; },\n/* harmony export */ \"AddressLookupTableInstruction\": function() { return /* binding */ AddressLookupTableInstruction; },\n/* harmony export */ \"AddressLookupTableProgram\": function() { return /* binding */ AddressLookupTableProgram; },\n/* harmony export */ \"Authorized\": function() { return /* binding */ Authorized; },\n/* harmony export */ \"BLOCKHASH_CACHE_TIMEOUT_MS\": function() { return /* binding */ BLOCKHASH_CACHE_TIMEOUT_MS; },\n/* harmony export */ \"BPF_LOADER_DEPRECATED_PROGRAM_ID\": function() { return /* binding */ BPF_LOADER_DEPRECATED_PROGRAM_ID; },\n/* harmony export */ \"BPF_LOADER_PROGRAM_ID\": function() { return /* binding */ BPF_LOADER_PROGRAM_ID; },\n/* harmony export */ \"BpfLoader\": function() { return /* binding */ BpfLoader; },\n/* harmony export */ \"COMPUTE_BUDGET_INSTRUCTION_LAYOUTS\": function() { return /* binding */ COMPUTE_BUDGET_INSTRUCTION_LAYOUTS; },\n/* harmony export */ \"ComputeBudgetInstruction\": function() { return /* binding */ ComputeBudgetInstruction; },\n/* harmony export */ \"ComputeBudgetProgram\": function() { return /* binding */ ComputeBudgetProgram; },\n/* harmony export */ \"Connection\": function() { return /* binding */ Connection; },\n/* harmony export */ \"Ed25519Program\": function() { return /* binding */ Ed25519Program; },\n/* harmony export */ \"Enum\": function() { return /* binding */ Enum; },\n/* harmony export */ \"EpochSchedule\": function() { return /* binding */ EpochSchedule; },\n/* harmony export */ \"FeeCalculatorLayout\": function() { return /* binding */ FeeCalculatorLayout; },\n/* harmony export */ \"Keypair\": function() { return /* binding */ Keypair; },\n/* harmony export */ \"LAMPORTS_PER_SOL\": function() { return /* binding */ LAMPORTS_PER_SOL; },\n/* harmony export */ \"LOOKUP_TABLE_INSTRUCTION_LAYOUTS\": function() { return /* binding */ LOOKUP_TABLE_INSTRUCTION_LAYOUTS; },\n/* harmony export */ \"Loader\": function() { return /* binding */ Loader; },\n/* harmony export */ \"Lockup\": function() { return /* binding */ Lockup; },\n/* harmony export */ \"MAX_SEED_LENGTH\": function() { return /* binding */ MAX_SEED_LENGTH; },\n/* harmony export */ \"Message\": function() { return /* binding */ Message; },\n/* harmony export */ \"MessageAccountKeys\": function() { return /* binding */ MessageAccountKeys; },\n/* harmony export */ \"MessageV0\": function() { return /* binding */ MessageV0; },\n/* harmony export */ \"NONCE_ACCOUNT_LENGTH\": function() { return /* binding */ NONCE_ACCOUNT_LENGTH; },\n/* harmony export */ \"NonceAccount\": function() { return /* binding */ NonceAccount; },\n/* harmony export */ \"PACKET_DATA_SIZE\": function() { return /* binding */ PACKET_DATA_SIZE; },\n/* harmony export */ \"PUBLIC_KEY_LENGTH\": function() { return /* binding */ PUBLIC_KEY_LENGTH; },\n/* harmony export */ \"PublicKey\": function() { return /* binding */ PublicKey; },\n/* harmony export */ \"SIGNATURE_LENGTH_IN_BYTES\": function() { return /* binding */ SIGNATURE_LENGTH_IN_BYTES; },\n/* harmony export */ \"SOLANA_SCHEMA\": function() { return /* binding */ SOLANA_SCHEMA; },\n/* harmony export */ \"STAKE_CONFIG_ID\": function() { return /* binding */ STAKE_CONFIG_ID; },\n/* harmony export */ \"STAKE_INSTRUCTION_LAYOUTS\": function() { return /* binding */ STAKE_INSTRUCTION_LAYOUTS; },\n/* harmony export */ \"SYSTEM_INSTRUCTION_LAYOUTS\": function() { return /* binding */ SYSTEM_INSTRUCTION_LAYOUTS; },\n/* harmony export */ \"SYSVAR_CLOCK_PUBKEY\": function() { return /* binding */ SYSVAR_CLOCK_PUBKEY; },\n/* harmony export */ \"SYSVAR_EPOCH_SCHEDULE_PUBKEY\": function() { return /* binding */ SYSVAR_EPOCH_SCHEDULE_PUBKEY; },\n/* harmony export */ \"SYSVAR_INSTRUCTIONS_PUBKEY\": function() { return /* binding */ SYSVAR_INSTRUCTIONS_PUBKEY; },\n/* harmony export */ \"SYSVAR_RECENT_BLOCKHASHES_PUBKEY\": function() { return /* binding */ SYSVAR_RECENT_BLOCKHASHES_PUBKEY; },\n/* harmony export */ \"SYSVAR_RENT_PUBKEY\": function() { return /* binding */ SYSVAR_RENT_PUBKEY; },\n/* harmony export */ \"SYSVAR_REWARDS_PUBKEY\": function() { return /* binding */ SYSVAR_REWARDS_PUBKEY; },\n/* harmony export */ \"SYSVAR_SLOT_HASHES_PUBKEY\": function() { return /* binding */ SYSVAR_SLOT_HASHES_PUBKEY; },\n/* harmony export */ \"SYSVAR_SLOT_HISTORY_PUBKEY\": function() { return /* binding */ SYSVAR_SLOT_HISTORY_PUBKEY; },\n/* harmony export */ \"SYSVAR_STAKE_HISTORY_PUBKEY\": function() { return /* binding */ SYSVAR_STAKE_HISTORY_PUBKEY; },\n/* harmony export */ \"Secp256k1Program\": function() { return /* binding */ Secp256k1Program; },\n/* harmony export */ \"SendTransactionError\": function() { return /* binding */ SendTransactionError; },\n/* harmony export */ \"SolanaJSONRPCError\": function() { return /* binding */ SolanaJSONRPCError; },\n/* harmony export */ \"SolanaJSONRPCErrorCode\": function() { return /* binding */ SolanaJSONRPCErrorCode; },\n/* harmony export */ \"StakeAuthorizationLayout\": function() { return /* binding */ StakeAuthorizationLayout; },\n/* harmony export */ \"StakeInstruction\": function() { return /* binding */ StakeInstruction; },\n/* harmony export */ \"StakeProgram\": function() { return /* binding */ StakeProgram; },\n/* harmony export */ \"Struct\": function() { return /* binding */ Struct; },\n/* harmony export */ \"SystemInstruction\": function() { return /* binding */ SystemInstruction; },\n/* harmony export */ \"SystemProgram\": function() { return /* binding */ SystemProgram; },\n/* harmony export */ \"Transaction\": function() { return /* binding */ Transaction; },\n/* harmony export */ \"TransactionExpiredBlockheightExceededError\": function() { return /* binding */ TransactionExpiredBlockheightExceededError; },\n/* harmony export */ \"TransactionExpiredNonceInvalidError\": function() { return /* binding */ TransactionExpiredNonceInvalidError; },\n/* harmony export */ \"TransactionExpiredTimeoutError\": function() { return /* binding */ TransactionExpiredTimeoutError; },\n/* harmony export */ \"TransactionInstruction\": function() { return /* binding */ TransactionInstruction; },\n/* harmony export */ \"TransactionMessage\": function() { return /* binding */ TransactionMessage; },\n/* harmony export */ \"TransactionStatus\": function() { return /* binding */ TransactionStatus; },\n/* harmony export */ \"VALIDATOR_INFO_KEY\": function() { return /* binding */ VALIDATOR_INFO_KEY; },\n/* harmony export */ \"VERSION_PREFIX_MASK\": function() { return /* binding */ VERSION_PREFIX_MASK; },\n/* harmony export */ \"VOTE_PROGRAM_ID\": function() { return /* binding */ VOTE_PROGRAM_ID; },\n/* harmony export */ \"ValidatorInfo\": function() { return /* binding */ ValidatorInfo; },\n/* harmony export */ \"VersionedMessage\": function() { return /* binding */ VersionedMessage; },\n/* harmony export */ \"VersionedTransaction\": function() { return /* binding */ VersionedTransaction; },\n/* harmony export */ \"VoteAccount\": function() { return /* binding */ VoteAccount; },\n/* harmony export */ \"VoteAuthorizationLayout\": function() { return /* binding */ VoteAuthorizationLayout; },\n/* harmony export */ \"VoteInit\": function() { return /* binding */ VoteInit; },\n/* harmony export */ \"VoteInstruction\": function() { return /* binding */ VoteInstruction; },\n/* harmony export */ \"VoteProgram\": function() { return /* binding */ VoteProgram; },\n/* harmony export */ \"clusterApiUrl\": function() { return /* binding */ clusterApiUrl; },\n/* harmony export */ \"sendAndConfirmRawTransaction\": function() { return /* binding */ sendAndConfirmRawTransaction; },\n/* harmony export */ \"sendAndConfirmTransaction\": function() { return /* binding */ sendAndConfirmTransaction; }\n/* harmony export */ });\n/* harmony import */ var buffer__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(48764);\n/* harmony import */ var _noble_curves_ed25519__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(16612);\n/* harmony import */ var bn_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(13550);\n/* harmony import */ var bn_js__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(bn_js__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var bs58__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(54459);\n/* harmony import */ var bs58__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(bs58__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _noble_hashes_sha256__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(22587);\n/* harmony import */ var borsh__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(25532);\n/* harmony import */ var borsh__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(borsh__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(39386);\n/* harmony import */ var bigint_buffer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(40475);\n/* harmony import */ var superstruct__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(53471);\n/* harmony import */ var jayson_lib_client_browser__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(31198);\n/* harmony import */ var jayson_lib_client_browser__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(jayson_lib_client_browser__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var rpc_websockets_dist_lib_client__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(66855);\n/* harmony import */ var rpc_websockets_dist_lib_client_websocket_browser__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(89062);\n/* harmony import */ var _noble_hashes_sha3__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(51438);\n/* harmony import */ var _noble_curves_secp256k1__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(9578);\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * A 64 byte secret key, the first 32 bytes of which is the\n * private scalar and the last 32 bytes is the public key.\n * Read more: https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/\n */\n\n/**\n * Ed25519 Keypair\n */\n\nconst generatePrivateKey = _noble_curves_ed25519__WEBPACK_IMPORTED_MODULE_9__/* .ed25519.utils.randomPrivateKey */ .UN.utils.randomPrivateKey;\nconst generateKeypair = () => {\n const privateScalar = _noble_curves_ed25519__WEBPACK_IMPORTED_MODULE_9__/* .ed25519.utils.randomPrivateKey */ .UN.utils.randomPrivateKey();\n const publicKey = getPublicKey(privateScalar);\n const secretKey = new Uint8Array(64);\n secretKey.set(privateScalar);\n secretKey.set(publicKey, 32);\n return {\n publicKey,\n secretKey\n };\n};\nconst getPublicKey = _noble_curves_ed25519__WEBPACK_IMPORTED_MODULE_9__/* .ed25519.getPublicKey */ .UN.getPublicKey;\nfunction isOnCurve(publicKey) {\n try {\n _noble_curves_ed25519__WEBPACK_IMPORTED_MODULE_9__/* .ed25519.ExtendedPoint.fromHex */ .UN.ExtendedPoint.fromHex(publicKey);\n return true;\n } catch {\n return false;\n }\n}\nconst sign = (message, secretKey) => _noble_curves_ed25519__WEBPACK_IMPORTED_MODULE_9__/* .ed25519.sign */ .UN.sign(message, secretKey.slice(0, 32));\nconst verify = _noble_curves_ed25519__WEBPACK_IMPORTED_MODULE_9__/* .ed25519.verify */ .UN.verify;\n\nconst toBuffer = arr => {\n if (buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.isBuffer(arr)) {\n return arr;\n } else if (arr instanceof Uint8Array) {\n return buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(arr.buffer, arr.byteOffset, arr.byteLength);\n } else {\n return buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(arr);\n }\n};\n\n// Class wrapping a plain object\nclass Struct {\n constructor(properties) {\n Object.assign(this, properties);\n }\n encode() {\n return buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from((0,borsh__WEBPACK_IMPORTED_MODULE_3__.serialize)(SOLANA_SCHEMA, this));\n }\n static decode(data) {\n return (0,borsh__WEBPACK_IMPORTED_MODULE_3__.deserialize)(SOLANA_SCHEMA, this, data);\n }\n static decodeUnchecked(data) {\n return (0,borsh__WEBPACK_IMPORTED_MODULE_3__.deserializeUnchecked)(SOLANA_SCHEMA, this, data);\n }\n}\n\n// Class representing a Rust-compatible enum, since enums are only strings or\n// numbers in pure JS\nclass Enum extends Struct {\n constructor(properties) {\n super(properties);\n this.enum = '';\n if (Object.keys(properties).length !== 1) {\n throw new Error('Enum can only take single value');\n }\n Object.keys(properties).map(key => {\n this.enum = key;\n });\n }\n}\nconst SOLANA_SCHEMA = new Map();\n\nvar _class;\nlet _Symbol$toStringTag;\n\n/**\n * Maximum length of derived pubkey seed\n */\nconst MAX_SEED_LENGTH = 32;\n\n/**\n * Size of public key in bytes\n */\nconst PUBLIC_KEY_LENGTH = 32;\n\n/**\n * Value to be converted into public key\n */\n\n/**\n * JSON object representation of PublicKey class\n */\n\nfunction isPublicKeyData(value) {\n return value._bn !== undefined;\n}\n\n// local counter used by PublicKey.unique()\nlet uniquePublicKeyCounter = 1;\n\n/**\n * A public key\n */\n_Symbol$toStringTag = Symbol.toStringTag;\nclass PublicKey extends Struct {\n /**\n * Create a new PublicKey object\n * @param value ed25519 public key as buffer or base-58 encoded string\n */\n constructor(value) {\n super({});\n /** @internal */\n this._bn = void 0;\n if (isPublicKeyData(value)) {\n this._bn = value._bn;\n } else {\n if (typeof value === 'string') {\n // assume base 58 encoding by default\n const decoded = bs58__WEBPACK_IMPORTED_MODULE_2___default().decode(value);\n if (decoded.length != PUBLIC_KEY_LENGTH) {\n throw new Error(`Invalid public key input`);\n }\n this._bn = new (bn_js__WEBPACK_IMPORTED_MODULE_1___default())(decoded);\n } else {\n this._bn = new (bn_js__WEBPACK_IMPORTED_MODULE_1___default())(value);\n }\n if (this._bn.byteLength() > PUBLIC_KEY_LENGTH) {\n throw new Error(`Invalid public key input`);\n }\n }\n }\n\n /**\n * Returns a unique PublicKey for tests and benchmarks using a counter\n */\n static unique() {\n const key = new PublicKey(uniquePublicKeyCounter);\n uniquePublicKeyCounter += 1;\n return new PublicKey(key.toBuffer());\n }\n\n /**\n * Default public key value. The base58-encoded string representation is all ones (as seen below)\n * The underlying BN number is 32 bytes that are all zeros\n */\n\n /**\n * Checks if two publicKeys are equal\n */\n equals(publicKey) {\n return this._bn.eq(publicKey._bn);\n }\n\n /**\n * Return the base-58 representation of the public key\n */\n toBase58() {\n return bs58__WEBPACK_IMPORTED_MODULE_2___default().encode(this.toBytes());\n }\n toJSON() {\n return this.toBase58();\n }\n\n /**\n * Return the byte array representation of the public key in big endian\n */\n toBytes() {\n const buf = this.toBuffer();\n return new Uint8Array(buf.buffer, buf.byteOffset, buf.byteLength);\n }\n\n /**\n * Return the Buffer representation of the public key in big endian\n */\n toBuffer() {\n const b = this._bn.toArrayLike(buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer);\n if (b.length === PUBLIC_KEY_LENGTH) {\n return b;\n }\n const zeroPad = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(32);\n b.copy(zeroPad, 32 - b.length);\n return zeroPad;\n }\n get [_Symbol$toStringTag]() {\n return `PublicKey(${this.toString()})`;\n }\n\n /**\n * Return the base-58 representation of the public key\n */\n toString() {\n return this.toBase58();\n }\n\n /**\n * Derive a public key from another key, a seed, and a program ID.\n * The program ID will also serve as the owner of the public key, giving\n * it permission to write data to the account.\n */\n /* eslint-disable require-await */\n static async createWithSeed(fromPublicKey, seed, programId) {\n const buffer = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.concat([fromPublicKey.toBuffer(), buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(seed), programId.toBuffer()]);\n const publicKeyBytes = (0,_noble_hashes_sha256__WEBPACK_IMPORTED_MODULE_10__/* .sha256 */ .J)(buffer);\n return new PublicKey(publicKeyBytes);\n }\n\n /**\n * Derive a program address from seeds and a program ID.\n */\n /* eslint-disable require-await */\n static createProgramAddressSync(seeds, programId) {\n let buffer = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(0);\n seeds.forEach(function (seed) {\n if (seed.length > MAX_SEED_LENGTH) {\n throw new TypeError(`Max seed length exceeded`);\n }\n buffer = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.concat([buffer, toBuffer(seed)]);\n });\n buffer = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.concat([buffer, programId.toBuffer(), buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from('ProgramDerivedAddress')]);\n const publicKeyBytes = (0,_noble_hashes_sha256__WEBPACK_IMPORTED_MODULE_10__/* .sha256 */ .J)(buffer);\n if (isOnCurve(publicKeyBytes)) {\n throw new Error(`Invalid seeds, address must fall off the curve`);\n }\n return new PublicKey(publicKeyBytes);\n }\n\n /**\n * Async version of createProgramAddressSync\n * For backwards compatibility\n *\n * @deprecated Use {@link createProgramAddressSync} instead\n */\n /* eslint-disable require-await */\n static async createProgramAddress(seeds, programId) {\n return this.createProgramAddressSync(seeds, programId);\n }\n\n /**\n * Find a valid program address\n *\n * Valid program addresses must fall off the ed25519 curve. This function\n * iterates a nonce until it finds one that when combined with the seeds\n * results in a valid program address.\n */\n static findProgramAddressSync(seeds, programId) {\n let nonce = 255;\n let address;\n while (nonce != 0) {\n try {\n const seedsWithNonce = seeds.concat(buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from([nonce]));\n address = this.createProgramAddressSync(seedsWithNonce, programId);\n } catch (err) {\n if (err instanceof TypeError) {\n throw err;\n }\n nonce--;\n continue;\n }\n return [address, nonce];\n }\n throw new Error(`Unable to find a viable program address nonce`);\n }\n\n /**\n * Async version of findProgramAddressSync\n * For backwards compatibility\n *\n * @deprecated Use {@link findProgramAddressSync} instead\n */\n static async findProgramAddress(seeds, programId) {\n return this.findProgramAddressSync(seeds, programId);\n }\n\n /**\n * Check that a pubkey is on the ed25519 curve.\n */\n static isOnCurve(pubkeyData) {\n const pubkey = new PublicKey(pubkeyData);\n return isOnCurve(pubkey.toBytes());\n }\n}\n_class = PublicKey;\nPublicKey.default = new _class('11111111111111111111111111111111');\nSOLANA_SCHEMA.set(PublicKey, {\n kind: 'struct',\n fields: [['_bn', 'u256']]\n});\n\n/**\n * An account key pair (public and secret keys).\n *\n * @deprecated since v1.10.0, please use {@link Keypair} instead.\n */\nclass Account {\n /**\n * Create a new Account object\n *\n * If the secretKey parameter is not provided a new key pair is randomly\n * created for the account\n *\n * @param secretKey Secret key for the account\n */\n constructor(secretKey) {\n /** @internal */\n this._publicKey = void 0;\n /** @internal */\n this._secretKey = void 0;\n if (secretKey) {\n const secretKeyBuffer = toBuffer(secretKey);\n if (secretKey.length !== 64) {\n throw new Error('bad secret key size');\n }\n this._publicKey = secretKeyBuffer.slice(32, 64);\n this._secretKey = secretKeyBuffer.slice(0, 32);\n } else {\n this._secretKey = toBuffer(generatePrivateKey());\n this._publicKey = toBuffer(getPublicKey(this._secretKey));\n }\n }\n\n /**\n * The public key for this account\n */\n get publicKey() {\n return new PublicKey(this._publicKey);\n }\n\n /**\n * The **unencrypted** secret key for this account. The first 32 bytes\n * is the private scalar and the last 32 bytes is the public key.\n * Read more: https://blog.mozilla.org/warner/2011/11/29/ed25519-keys/\n */\n get secretKey() {\n return buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.concat([this._secretKey, this._publicKey], 64);\n }\n}\n\nconst BPF_LOADER_DEPRECATED_PROGRAM_ID = new PublicKey('BPFLoader1111111111111111111111111111111111');\n\n/**\n * Maximum over-the-wire size of a Transaction\n *\n * 1280 is IPv6 minimum MTU\n * 40 bytes is the size of the IPv6 header\n * 8 bytes is the size of the fragment header\n */\nconst PACKET_DATA_SIZE = 1280 - 40 - 8;\nconst VERSION_PREFIX_MASK = 0x7f;\nconst SIGNATURE_LENGTH_IN_BYTES = 64;\n\nclass TransactionExpiredBlockheightExceededError extends Error {\n constructor(signature) {\n super(`Signature ${signature} has expired: block height exceeded.`);\n this.signature = void 0;\n this.signature = signature;\n }\n}\nObject.defineProperty(TransactionExpiredBlockheightExceededError.prototype, 'name', {\n value: 'TransactionExpiredBlockheightExceededError'\n});\nclass TransactionExpiredTimeoutError extends Error {\n constructor(signature, timeoutSeconds) {\n super(`Transaction was not confirmed in ${timeoutSeconds.toFixed(2)} seconds. It is ` + 'unknown if it succeeded or failed. Check signature ' + `${signature} using the Solana Explorer or CLI tools.`);\n this.signature = void 0;\n this.signature = signature;\n }\n}\nObject.defineProperty(TransactionExpiredTimeoutError.prototype, 'name', {\n value: 'TransactionExpiredTimeoutError'\n});\nclass TransactionExpiredNonceInvalidError extends Error {\n constructor(signature) {\n super(`Signature ${signature} has expired: the nonce is no longer valid.`);\n this.signature = void 0;\n this.signature = signature;\n }\n}\nObject.defineProperty(TransactionExpiredNonceInvalidError.prototype, 'name', {\n value: 'TransactionExpiredNonceInvalidError'\n});\n\nclass MessageAccountKeys {\n constructor(staticAccountKeys, accountKeysFromLookups) {\n this.staticAccountKeys = void 0;\n this.accountKeysFromLookups = void 0;\n this.staticAccountKeys = staticAccountKeys;\n this.accountKeysFromLookups = accountKeysFromLookups;\n }\n keySegments() {\n const keySegments = [this.staticAccountKeys];\n if (this.accountKeysFromLookups) {\n keySegments.push(this.accountKeysFromLookups.writable);\n keySegments.push(this.accountKeysFromLookups.readonly);\n }\n return keySegments;\n }\n get(index) {\n for (const keySegment of this.keySegments()) {\n if (index < keySegment.length) {\n return keySegment[index];\n } else {\n index -= keySegment.length;\n }\n }\n return;\n }\n get length() {\n return this.keySegments().flat().length;\n }\n compileInstructions(instructions) {\n // Bail early if any account indexes would overflow a u8\n const U8_MAX = 255;\n if (this.length > U8_MAX + 1) {\n throw new Error('Account index overflow encountered during compilation');\n }\n const keyIndexMap = new Map();\n this.keySegments().flat().forEach((key, index) => {\n keyIndexMap.set(key.toBase58(), index);\n });\n const findKeyIndex = key => {\n const keyIndex = keyIndexMap.get(key.toBase58());\n if (keyIndex === undefined) throw new Error('Encountered an unknown instruction account key during compilation');\n return keyIndex;\n };\n return instructions.map(instruction => {\n return {\n programIdIndex: findKeyIndex(instruction.programId),\n accountKeyIndexes: instruction.keys.map(meta => findKeyIndex(meta.pubkey)),\n data: instruction.data\n };\n });\n }\n}\n\n/**\n * Layout for a public key\n */\nconst publicKey = (property = 'publicKey') => {\n return _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(32, property);\n};\n\n/**\n * Layout for a signature\n */\nconst signature = (property = 'signature') => {\n return _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(64, property);\n};\n/**\n * Layout for a Rust String type\n */\nconst rustString = (property = 'string') => {\n const rsl = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('length'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('lengthPadding'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.offset(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32(), -8), 'chars')], property);\n const _decode = rsl.decode.bind(rsl);\n const _encode = rsl.encode.bind(rsl);\n const rslShim = rsl;\n rslShim.decode = (b, offset) => {\n const data = _decode(b, offset);\n return data['chars'].toString();\n };\n rslShim.encode = (str, b, offset) => {\n const data = {\n chars: buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(str, 'utf8')\n };\n return _encode(data, b, offset);\n };\n rslShim.alloc = str => {\n return _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32().span + _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32().span + buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(str, 'utf8').length;\n };\n return rslShim;\n};\n\n/**\n * Layout for an Authorized object\n */\nconst authorized = (property = 'authorized') => {\n return _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([publicKey('staker'), publicKey('withdrawer')], property);\n};\n\n/**\n * Layout for a Lockup object\n */\nconst lockup = (property = 'lockup') => {\n return _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('unixTimestamp'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('epoch'), publicKey('custodian')], property);\n};\n\n/**\n * Layout for a VoteInit object\n */\nconst voteInit = (property = 'voteInit') => {\n return _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([publicKey('nodePubkey'), publicKey('authorizedVoter'), publicKey('authorizedWithdrawer'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('commission')], property);\n};\n\n/**\n * Layout for a VoteAuthorizeWithSeedArgs object\n */\nconst voteAuthorizeWithSeedArgs = (property = 'voteAuthorizeWithSeedArgs') => {\n return _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('voteAuthorizationType'), publicKey('currentAuthorityDerivedKeyOwnerPubkey'), rustString('currentAuthorityDerivedKeySeed'), publicKey('newAuthorized')], property);\n};\nfunction getAlloc(type, fields) {\n const getItemAlloc = item => {\n if (item.span >= 0) {\n return item.span;\n } else if (typeof item.alloc === 'function') {\n return item.alloc(fields[item.property]);\n } else if ('count' in item && 'elementLayout' in item) {\n const field = fields[item.property];\n if (Array.isArray(field)) {\n return field.length * getItemAlloc(item.elementLayout);\n }\n } else if ('fields' in item) {\n // This is a `Structure` whose size needs to be recursively measured.\n return getAlloc({\n layout: item\n }, fields[item.property]);\n }\n // Couldn't determine allocated size of layout\n return 0;\n };\n let alloc = 0;\n type.layout.fields.forEach(item => {\n alloc += getItemAlloc(item);\n });\n return alloc;\n}\n\nfunction decodeLength(bytes) {\n let len = 0;\n let size = 0;\n for (;;) {\n let elem = bytes.shift();\n len |= (elem & 0x7f) << size * 7;\n size += 1;\n if ((elem & 0x80) === 0) {\n break;\n }\n }\n return len;\n}\nfunction encodeLength(bytes, len) {\n let rem_len = len;\n for (;;) {\n let elem = rem_len & 0x7f;\n rem_len >>= 7;\n if (rem_len == 0) {\n bytes.push(elem);\n break;\n } else {\n elem |= 0x80;\n bytes.push(elem);\n }\n }\n}\n\nfunction assert (condition, message) {\n if (!condition) {\n throw new Error(message || 'Assertion failed');\n }\n}\n\nclass CompiledKeys {\n constructor(payer, keyMetaMap) {\n this.payer = void 0;\n this.keyMetaMap = void 0;\n this.payer = payer;\n this.keyMetaMap = keyMetaMap;\n }\n static compile(instructions, payer) {\n const keyMetaMap = new Map();\n const getOrInsertDefault = pubkey => {\n const address = pubkey.toBase58();\n let keyMeta = keyMetaMap.get(address);\n if (keyMeta === undefined) {\n keyMeta = {\n isSigner: false,\n isWritable: false,\n isInvoked: false\n };\n keyMetaMap.set(address, keyMeta);\n }\n return keyMeta;\n };\n const payerKeyMeta = getOrInsertDefault(payer);\n payerKeyMeta.isSigner = true;\n payerKeyMeta.isWritable = true;\n for (const ix of instructions) {\n getOrInsertDefault(ix.programId).isInvoked = true;\n for (const accountMeta of ix.keys) {\n const keyMeta = getOrInsertDefault(accountMeta.pubkey);\n keyMeta.isSigner ||= accountMeta.isSigner;\n keyMeta.isWritable ||= accountMeta.isWritable;\n }\n }\n return new CompiledKeys(payer, keyMetaMap);\n }\n getMessageComponents() {\n const mapEntries = [...this.keyMetaMap.entries()];\n assert(mapEntries.length <= 256, 'Max static account keys length exceeded');\n const writableSigners = mapEntries.filter(([, meta]) => meta.isSigner && meta.isWritable);\n const readonlySigners = mapEntries.filter(([, meta]) => meta.isSigner && !meta.isWritable);\n const writableNonSigners = mapEntries.filter(([, meta]) => !meta.isSigner && meta.isWritable);\n const readonlyNonSigners = mapEntries.filter(([, meta]) => !meta.isSigner && !meta.isWritable);\n const header = {\n numRequiredSignatures: writableSigners.length + readonlySigners.length,\n numReadonlySignedAccounts: readonlySigners.length,\n numReadonlyUnsignedAccounts: readonlyNonSigners.length\n };\n\n // sanity checks\n {\n assert(writableSigners.length > 0, 'Expected at least one writable signer key');\n const [payerAddress] = writableSigners[0];\n assert(payerAddress === this.payer.toBase58(), 'Expected first writable signer key to be the fee payer');\n }\n const staticAccountKeys = [...writableSigners.map(([address]) => new PublicKey(address)), ...readonlySigners.map(([address]) => new PublicKey(address)), ...writableNonSigners.map(([address]) => new PublicKey(address)), ...readonlyNonSigners.map(([address]) => new PublicKey(address))];\n return [header, staticAccountKeys];\n }\n extractTableLookup(lookupTable) {\n const [writableIndexes, drainedWritableKeys] = this.drainKeysFoundInLookupTable(lookupTable.state.addresses, keyMeta => !keyMeta.isSigner && !keyMeta.isInvoked && keyMeta.isWritable);\n const [readonlyIndexes, drainedReadonlyKeys] = this.drainKeysFoundInLookupTable(lookupTable.state.addresses, keyMeta => !keyMeta.isSigner && !keyMeta.isInvoked && !keyMeta.isWritable);\n\n // Don't extract lookup if no keys were found\n if (writableIndexes.length === 0 && readonlyIndexes.length === 0) {\n return;\n }\n return [{\n accountKey: lookupTable.key,\n writableIndexes,\n readonlyIndexes\n }, {\n writable: drainedWritableKeys,\n readonly: drainedReadonlyKeys\n }];\n }\n\n /** @internal */\n drainKeysFoundInLookupTable(lookupTableEntries, keyMetaFilter) {\n const lookupTableIndexes = new Array();\n const drainedKeys = new Array();\n for (const [address, keyMeta] of this.keyMetaMap.entries()) {\n if (keyMetaFilter(keyMeta)) {\n const key = new PublicKey(address);\n const lookupTableIndex = lookupTableEntries.findIndex(entry => entry.equals(key));\n if (lookupTableIndex >= 0) {\n assert(lookupTableIndex < 256, 'Max lookup table index exceeded');\n lookupTableIndexes.push(lookupTableIndex);\n drainedKeys.push(key);\n this.keyMetaMap.delete(address);\n }\n }\n }\n return [lookupTableIndexes, drainedKeys];\n }\n}\n\n/**\n * An instruction to execute by a program\n *\n * @property {number} programIdIndex\n * @property {number[]} accounts\n * @property {string} data\n */\n\n/**\n * Message constructor arguments\n */\n\n/**\n * List of instructions to be processed atomically\n */\nclass Message {\n constructor(args) {\n this.header = void 0;\n this.accountKeys = void 0;\n this.recentBlockhash = void 0;\n this.instructions = void 0;\n this.indexToProgramIds = new Map();\n this.header = args.header;\n this.accountKeys = args.accountKeys.map(account => new PublicKey(account));\n this.recentBlockhash = args.recentBlockhash;\n this.instructions = args.instructions;\n this.instructions.forEach(ix => this.indexToProgramIds.set(ix.programIdIndex, this.accountKeys[ix.programIdIndex]));\n }\n get version() {\n return 'legacy';\n }\n get staticAccountKeys() {\n return this.accountKeys;\n }\n get compiledInstructions() {\n return this.instructions.map(ix => ({\n programIdIndex: ix.programIdIndex,\n accountKeyIndexes: ix.accounts,\n data: bs58__WEBPACK_IMPORTED_MODULE_2___default().decode(ix.data)\n }));\n }\n get addressTableLookups() {\n return [];\n }\n getAccountKeys() {\n return new MessageAccountKeys(this.staticAccountKeys);\n }\n static compile(args) {\n const compiledKeys = CompiledKeys.compile(args.instructions, args.payerKey);\n const [header, staticAccountKeys] = compiledKeys.getMessageComponents();\n const accountKeys = new MessageAccountKeys(staticAccountKeys);\n const instructions = accountKeys.compileInstructions(args.instructions).map(ix => ({\n programIdIndex: ix.programIdIndex,\n accounts: ix.accountKeyIndexes,\n data: bs58__WEBPACK_IMPORTED_MODULE_2___default().encode(ix.data)\n }));\n return new Message({\n header,\n accountKeys: staticAccountKeys,\n recentBlockhash: args.recentBlockhash,\n instructions\n });\n }\n isAccountSigner(index) {\n return index < this.header.numRequiredSignatures;\n }\n isAccountWritable(index) {\n const numSignedAccounts = this.header.numRequiredSignatures;\n if (index >= this.header.numRequiredSignatures) {\n const unsignedAccountIndex = index - numSignedAccounts;\n const numUnsignedAccounts = this.accountKeys.length - numSignedAccounts;\n const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;\n return unsignedAccountIndex < numWritableUnsignedAccounts;\n } else {\n const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;\n return index < numWritableSignedAccounts;\n }\n }\n isProgramId(index) {\n return this.indexToProgramIds.has(index);\n }\n programIds() {\n return [...this.indexToProgramIds.values()];\n }\n nonProgramIds() {\n return this.accountKeys.filter((_, index) => !this.isProgramId(index));\n }\n serialize() {\n const numKeys = this.accountKeys.length;\n let keyCount = [];\n encodeLength(keyCount, numKeys);\n const instructions = this.instructions.map(instruction => {\n const {\n accounts,\n programIdIndex\n } = instruction;\n const data = Array.from(bs58__WEBPACK_IMPORTED_MODULE_2___default().decode(instruction.data));\n let keyIndicesCount = [];\n encodeLength(keyIndicesCount, accounts.length);\n let dataCount = [];\n encodeLength(dataCount, data.length);\n return {\n programIdIndex,\n keyIndicesCount: buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(keyIndicesCount),\n keyIndices: accounts,\n dataLength: buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(dataCount),\n data\n };\n });\n let instructionCount = [];\n encodeLength(instructionCount, instructions.length);\n let instructionBuffer = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(PACKET_DATA_SIZE);\n buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(instructionCount).copy(instructionBuffer);\n let instructionBufferLength = instructionCount.length;\n instructions.forEach(instruction => {\n const instructionLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('programIdIndex'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(instruction.keyIndicesCount.length, 'keyIndicesCount'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('keyIndex'), instruction.keyIndices.length, 'keyIndices'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(instruction.dataLength.length, 'dataLength'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('userdatum'), instruction.data.length, 'data')]);\n const length = instructionLayout.encode(instruction, instructionBuffer, instructionBufferLength);\n instructionBufferLength += length;\n });\n instructionBuffer = instructionBuffer.slice(0, instructionBufferLength);\n const signDataLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(1, 'numRequiredSignatures'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(1, 'numReadonlySignedAccounts'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(1, 'numReadonlyUnsignedAccounts'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(keyCount.length, 'keyCount'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(publicKey('key'), numKeys, 'keys'), publicKey('recentBlockhash')]);\n const transaction = {\n numRequiredSignatures: buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from([this.header.numRequiredSignatures]),\n numReadonlySignedAccounts: buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from([this.header.numReadonlySignedAccounts]),\n numReadonlyUnsignedAccounts: buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from([this.header.numReadonlyUnsignedAccounts]),\n keyCount: buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(keyCount),\n keys: this.accountKeys.map(key => toBuffer(key.toBytes())),\n recentBlockhash: bs58__WEBPACK_IMPORTED_MODULE_2___default().decode(this.recentBlockhash)\n };\n let signData = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(2048);\n const length = signDataLayout.encode(transaction, signData);\n instructionBuffer.copy(signData, length);\n return signData.slice(0, length + instructionBuffer.length);\n }\n\n /**\n * Decode a compiled message into a Message object.\n */\n static from(buffer) {\n // Slice up wire data\n let byteArray = [...buffer];\n const numRequiredSignatures = byteArray.shift();\n if (numRequiredSignatures !== (numRequiredSignatures & VERSION_PREFIX_MASK)) {\n throw new Error('Versioned messages must be deserialized with VersionedMessage.deserialize()');\n }\n const numReadonlySignedAccounts = byteArray.shift();\n const numReadonlyUnsignedAccounts = byteArray.shift();\n const accountCount = decodeLength(byteArray);\n let accountKeys = [];\n for (let i = 0; i < accountCount; i++) {\n const account = byteArray.slice(0, PUBLIC_KEY_LENGTH);\n byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);\n accountKeys.push(new PublicKey(buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(account)));\n }\n const recentBlockhash = byteArray.slice(0, PUBLIC_KEY_LENGTH);\n byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);\n const instructionCount = decodeLength(byteArray);\n let instructions = [];\n for (let i = 0; i < instructionCount; i++) {\n const programIdIndex = byteArray.shift();\n const accountCount = decodeLength(byteArray);\n const accounts = byteArray.slice(0, accountCount);\n byteArray = byteArray.slice(accountCount);\n const dataLength = decodeLength(byteArray);\n const dataSlice = byteArray.slice(0, dataLength);\n const data = bs58__WEBPACK_IMPORTED_MODULE_2___default().encode(buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(dataSlice));\n byteArray = byteArray.slice(dataLength);\n instructions.push({\n programIdIndex,\n accounts,\n data\n });\n }\n const messageArgs = {\n header: {\n numRequiredSignatures,\n numReadonlySignedAccounts,\n numReadonlyUnsignedAccounts\n },\n recentBlockhash: bs58__WEBPACK_IMPORTED_MODULE_2___default().encode(buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(recentBlockhash)),\n accountKeys,\n instructions\n };\n return new Message(messageArgs);\n }\n}\n\n/**\n * Message constructor arguments\n */\n\nclass MessageV0 {\n constructor(args) {\n this.header = void 0;\n this.staticAccountKeys = void 0;\n this.recentBlockhash = void 0;\n this.compiledInstructions = void 0;\n this.addressTableLookups = void 0;\n this.header = args.header;\n this.staticAccountKeys = args.staticAccountKeys;\n this.recentBlockhash = args.recentBlockhash;\n this.compiledInstructions = args.compiledInstructions;\n this.addressTableLookups = args.addressTableLookups;\n }\n get version() {\n return 0;\n }\n get numAccountKeysFromLookups() {\n let count = 0;\n for (const lookup of this.addressTableLookups) {\n count += lookup.readonlyIndexes.length + lookup.writableIndexes.length;\n }\n return count;\n }\n getAccountKeys(args) {\n let accountKeysFromLookups;\n if (args && 'accountKeysFromLookups' in args && args.accountKeysFromLookups) {\n if (this.numAccountKeysFromLookups != args.accountKeysFromLookups.writable.length + args.accountKeysFromLookups.readonly.length) {\n throw new Error('Failed to get account keys because of a mismatch in the number of account keys from lookups');\n }\n accountKeysFromLookups = args.accountKeysFromLookups;\n } else if (args && 'addressLookupTableAccounts' in args && args.addressLookupTableAccounts) {\n accountKeysFromLookups = this.resolveAddressTableLookups(args.addressLookupTableAccounts);\n } else if (this.addressTableLookups.length > 0) {\n throw new Error('Failed to get account keys because address table lookups were not resolved');\n }\n return new MessageAccountKeys(this.staticAccountKeys, accountKeysFromLookups);\n }\n isAccountSigner(index) {\n return index < this.header.numRequiredSignatures;\n }\n isAccountWritable(index) {\n const numSignedAccounts = this.header.numRequiredSignatures;\n const numStaticAccountKeys = this.staticAccountKeys.length;\n if (index >= numStaticAccountKeys) {\n const lookupAccountKeysIndex = index - numStaticAccountKeys;\n const numWritableLookupAccountKeys = this.addressTableLookups.reduce((count, lookup) => count + lookup.writableIndexes.length, 0);\n return lookupAccountKeysIndex < numWritableLookupAccountKeys;\n } else if (index >= this.header.numRequiredSignatures) {\n const unsignedAccountIndex = index - numSignedAccounts;\n const numUnsignedAccounts = numStaticAccountKeys - numSignedAccounts;\n const numWritableUnsignedAccounts = numUnsignedAccounts - this.header.numReadonlyUnsignedAccounts;\n return unsignedAccountIndex < numWritableUnsignedAccounts;\n } else {\n const numWritableSignedAccounts = numSignedAccounts - this.header.numReadonlySignedAccounts;\n return index < numWritableSignedAccounts;\n }\n }\n resolveAddressTableLookups(addressLookupTableAccounts) {\n const accountKeysFromLookups = {\n writable: [],\n readonly: []\n };\n for (const tableLookup of this.addressTableLookups) {\n const tableAccount = addressLookupTableAccounts.find(account => account.key.equals(tableLookup.accountKey));\n if (!tableAccount) {\n throw new Error(`Failed to find address lookup table account for table key ${tableLookup.accountKey.toBase58()}`);\n }\n for (const index of tableLookup.writableIndexes) {\n if (index < tableAccount.state.addresses.length) {\n accountKeysFromLookups.writable.push(tableAccount.state.addresses[index]);\n } else {\n throw new Error(`Failed to find address for index ${index} in address lookup table ${tableLookup.accountKey.toBase58()}`);\n }\n }\n for (const index of tableLookup.readonlyIndexes) {\n if (index < tableAccount.state.addresses.length) {\n accountKeysFromLookups.readonly.push(tableAccount.state.addresses[index]);\n } else {\n throw new Error(`Failed to find address for index ${index} in address lookup table ${tableLookup.accountKey.toBase58()}`);\n }\n }\n }\n return accountKeysFromLookups;\n }\n static compile(args) {\n const compiledKeys = CompiledKeys.compile(args.instructions, args.payerKey);\n const addressTableLookups = new Array();\n const accountKeysFromLookups = {\n writable: new Array(),\n readonly: new Array()\n };\n const lookupTableAccounts = args.addressLookupTableAccounts || [];\n for (const lookupTable of lookupTableAccounts) {\n const extractResult = compiledKeys.extractTableLookup(lookupTable);\n if (extractResult !== undefined) {\n const [addressTableLookup, {\n writable,\n readonly\n }] = extractResult;\n addressTableLookups.push(addressTableLookup);\n accountKeysFromLookups.writable.push(...writable);\n accountKeysFromLookups.readonly.push(...readonly);\n }\n }\n const [header, staticAccountKeys] = compiledKeys.getMessageComponents();\n const accountKeys = new MessageAccountKeys(staticAccountKeys, accountKeysFromLookups);\n const compiledInstructions = accountKeys.compileInstructions(args.instructions);\n return new MessageV0({\n header,\n staticAccountKeys,\n recentBlockhash: args.recentBlockhash,\n compiledInstructions,\n addressTableLookups\n });\n }\n serialize() {\n const encodedStaticAccountKeysLength = Array();\n encodeLength(encodedStaticAccountKeysLength, this.staticAccountKeys.length);\n const serializedInstructions = this.serializeInstructions();\n const encodedInstructionsLength = Array();\n encodeLength(encodedInstructionsLength, this.compiledInstructions.length);\n const serializedAddressTableLookups = this.serializeAddressTableLookups();\n const encodedAddressTableLookupsLength = Array();\n encodeLength(encodedAddressTableLookupsLength, this.addressTableLookups.length);\n const messageLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('prefix'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('numRequiredSignatures'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('numReadonlySignedAccounts'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('numReadonlyUnsignedAccounts')], 'header'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(encodedStaticAccountKeysLength.length, 'staticAccountKeysLength'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(publicKey(), this.staticAccountKeys.length, 'staticAccountKeys'), publicKey('recentBlockhash'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(encodedInstructionsLength.length, 'instructionsLength'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(serializedInstructions.length, 'serializedInstructions'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(encodedAddressTableLookupsLength.length, 'addressTableLookupsLength'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(serializedAddressTableLookups.length, 'serializedAddressTableLookups')]);\n const serializedMessage = new Uint8Array(PACKET_DATA_SIZE);\n const MESSAGE_VERSION_0_PREFIX = 1 << 7;\n const serializedMessageLength = messageLayout.encode({\n prefix: MESSAGE_VERSION_0_PREFIX,\n header: this.header,\n staticAccountKeysLength: new Uint8Array(encodedStaticAccountKeysLength),\n staticAccountKeys: this.staticAccountKeys.map(key => key.toBytes()),\n recentBlockhash: bs58__WEBPACK_IMPORTED_MODULE_2___default().decode(this.recentBlockhash),\n instructionsLength: new Uint8Array(encodedInstructionsLength),\n serializedInstructions,\n addressTableLookupsLength: new Uint8Array(encodedAddressTableLookupsLength),\n serializedAddressTableLookups\n }, serializedMessage);\n return serializedMessage.slice(0, serializedMessageLength);\n }\n serializeInstructions() {\n let serializedLength = 0;\n const serializedInstructions = new Uint8Array(PACKET_DATA_SIZE);\n for (const instruction of this.compiledInstructions) {\n const encodedAccountKeyIndexesLength = Array();\n encodeLength(encodedAccountKeyIndexesLength, instruction.accountKeyIndexes.length);\n const encodedDataLength = Array();\n encodeLength(encodedDataLength, instruction.data.length);\n const instructionLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('programIdIndex'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(encodedAccountKeyIndexesLength.length, 'encodedAccountKeyIndexesLength'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8(), instruction.accountKeyIndexes.length, 'accountKeyIndexes'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(encodedDataLength.length, 'encodedDataLength'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(instruction.data.length, 'data')]);\n serializedLength += instructionLayout.encode({\n programIdIndex: instruction.programIdIndex,\n encodedAccountKeyIndexesLength: new Uint8Array(encodedAccountKeyIndexesLength),\n accountKeyIndexes: instruction.accountKeyIndexes,\n encodedDataLength: new Uint8Array(encodedDataLength),\n data: instruction.data\n }, serializedInstructions, serializedLength);\n }\n return serializedInstructions.slice(0, serializedLength);\n }\n serializeAddressTableLookups() {\n let serializedLength = 0;\n const serializedAddressTableLookups = new Uint8Array(PACKET_DATA_SIZE);\n for (const lookup of this.addressTableLookups) {\n const encodedWritableIndexesLength = Array();\n encodeLength(encodedWritableIndexesLength, lookup.writableIndexes.length);\n const encodedReadonlyIndexesLength = Array();\n encodeLength(encodedReadonlyIndexesLength, lookup.readonlyIndexes.length);\n const addressTableLookupLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([publicKey('accountKey'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(encodedWritableIndexesLength.length, 'encodedWritableIndexesLength'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8(), lookup.writableIndexes.length, 'writableIndexes'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(encodedReadonlyIndexesLength.length, 'encodedReadonlyIndexesLength'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8(), lookup.readonlyIndexes.length, 'readonlyIndexes')]);\n serializedLength += addressTableLookupLayout.encode({\n accountKey: lookup.accountKey.toBytes(),\n encodedWritableIndexesLength: new Uint8Array(encodedWritableIndexesLength),\n writableIndexes: lookup.writableIndexes,\n encodedReadonlyIndexesLength: new Uint8Array(encodedReadonlyIndexesLength),\n readonlyIndexes: lookup.readonlyIndexes\n }, serializedAddressTableLookups, serializedLength);\n }\n return serializedAddressTableLookups.slice(0, serializedLength);\n }\n static deserialize(serializedMessage) {\n let byteArray = [...serializedMessage];\n const prefix = byteArray.shift();\n const maskedPrefix = prefix & VERSION_PREFIX_MASK;\n assert(prefix !== maskedPrefix, `Expected versioned message but received legacy message`);\n const version = maskedPrefix;\n assert(version === 0, `Expected versioned message with version 0 but found version ${version}`);\n const header = {\n numRequiredSignatures: byteArray.shift(),\n numReadonlySignedAccounts: byteArray.shift(),\n numReadonlyUnsignedAccounts: byteArray.shift()\n };\n const staticAccountKeys = [];\n const staticAccountKeysLength = decodeLength(byteArray);\n for (let i = 0; i < staticAccountKeysLength; i++) {\n staticAccountKeys.push(new PublicKey(byteArray.splice(0, PUBLIC_KEY_LENGTH)));\n }\n const recentBlockhash = bs58__WEBPACK_IMPORTED_MODULE_2___default().encode(byteArray.splice(0, PUBLIC_KEY_LENGTH));\n const instructionCount = decodeLength(byteArray);\n const compiledInstructions = [];\n for (let i = 0; i < instructionCount; i++) {\n const programIdIndex = byteArray.shift();\n const accountKeyIndexesLength = decodeLength(byteArray);\n const accountKeyIndexes = byteArray.splice(0, accountKeyIndexesLength);\n const dataLength = decodeLength(byteArray);\n const data = new Uint8Array(byteArray.splice(0, dataLength));\n compiledInstructions.push({\n programIdIndex,\n accountKeyIndexes,\n data\n });\n }\n const addressTableLookupsCount = decodeLength(byteArray);\n const addressTableLookups = [];\n for (let i = 0; i < addressTableLookupsCount; i++) {\n const accountKey = new PublicKey(byteArray.splice(0, PUBLIC_KEY_LENGTH));\n const writableIndexesLength = decodeLength(byteArray);\n const writableIndexes = byteArray.splice(0, writableIndexesLength);\n const readonlyIndexesLength = decodeLength(byteArray);\n const readonlyIndexes = byteArray.splice(0, readonlyIndexesLength);\n addressTableLookups.push({\n accountKey,\n writableIndexes,\n readonlyIndexes\n });\n }\n return new MessageV0({\n header,\n staticAccountKeys,\n recentBlockhash,\n compiledInstructions,\n addressTableLookups\n });\n }\n}\n\n// eslint-disable-next-line no-redeclare\nconst VersionedMessage = {\n deserializeMessageVersion(serializedMessage) {\n const prefix = serializedMessage[0];\n const maskedPrefix = prefix & VERSION_PREFIX_MASK;\n\n // if the highest bit of the prefix is not set, the message is not versioned\n if (maskedPrefix === prefix) {\n return 'legacy';\n }\n\n // the lower 7 bits of the prefix indicate the message version\n return maskedPrefix;\n },\n deserialize: serializedMessage => {\n const version = VersionedMessage.deserializeMessageVersion(serializedMessage);\n if (version === 'legacy') {\n return Message.from(serializedMessage);\n }\n if (version === 0) {\n return MessageV0.deserialize(serializedMessage);\n } else {\n throw new Error(`Transaction message version ${version} deserialization is not supported`);\n }\n }\n};\n\n/** @internal */\n\n/**\n * Transaction signature as base-58 encoded string\n */\n\nlet TransactionStatus = /*#__PURE__*/function (TransactionStatus) {\n TransactionStatus[TransactionStatus[\"BLOCKHEIGHT_EXCEEDED\"] = 0] = \"BLOCKHEIGHT_EXCEEDED\";\n TransactionStatus[TransactionStatus[\"PROCESSED\"] = 1] = \"PROCESSED\";\n TransactionStatus[TransactionStatus[\"TIMED_OUT\"] = 2] = \"TIMED_OUT\";\n TransactionStatus[TransactionStatus[\"NONCE_INVALID\"] = 3] = \"NONCE_INVALID\";\n return TransactionStatus;\n}({});\n\n/**\n * Default (empty) signature\n */\nconst DEFAULT_SIGNATURE = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(SIGNATURE_LENGTH_IN_BYTES).fill(0);\n\n/**\n * Account metadata used to define instructions\n */\n\n/**\n * List of TransactionInstruction object fields that may be initialized at construction\n */\n\n/**\n * Configuration object for Transaction.serialize()\n */\n\n/**\n * @internal\n */\n\n/**\n * Transaction Instruction class\n */\nclass TransactionInstruction {\n constructor(opts) {\n /**\n * Public keys to include in this transaction\n * Boolean represents whether this pubkey needs to sign the transaction\n */\n this.keys = void 0;\n /**\n * Program Id to execute\n */\n this.programId = void 0;\n /**\n * Program input\n */\n this.data = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(0);\n this.programId = opts.programId;\n this.keys = opts.keys;\n if (opts.data) {\n this.data = opts.data;\n }\n }\n\n /**\n * @internal\n */\n toJSON() {\n return {\n keys: this.keys.map(({\n pubkey,\n isSigner,\n isWritable\n }) => ({\n pubkey: pubkey.toJSON(),\n isSigner,\n isWritable\n })),\n programId: this.programId.toJSON(),\n data: [...this.data]\n };\n }\n}\n\n/**\n * Pair of signature and corresponding public key\n */\n\n/**\n * List of Transaction object fields that may be initialized at construction\n */\n\n// For backward compatibility; an unfortunate consequence of being\n// forced to over-export types by the documentation generator.\n// See https://github.com/solana-labs/solana/pull/25820\n\n/**\n * Blockhash-based transactions have a lifetime that are defined by\n * the blockhash they include. Any transaction whose blockhash is\n * too old will be rejected.\n */\n\n/**\n * Use these options to construct a durable nonce transaction.\n */\n\n/**\n * Nonce information to be used to build an offline Transaction.\n */\n\n/**\n * @internal\n */\n\n/**\n * Transaction class\n */\nclass Transaction {\n /**\n * The first (payer) Transaction signature\n *\n * @returns {Buffer | null} Buffer of payer's signature\n */\n get signature() {\n if (this.signatures.length > 0) {\n return this.signatures[0].signature;\n }\n return null;\n }\n\n /**\n * The transaction fee payer\n */\n\n // Construct a transaction with a blockhash and lastValidBlockHeight\n\n // Construct a transaction using a durable nonce\n\n /**\n * @deprecated `TransactionCtorFields` has been deprecated and will be removed in a future version.\n * Please supply a `TransactionBlockhashCtor` instead.\n */\n\n /**\n * Construct an empty Transaction\n */\n constructor(opts) {\n /**\n * Signatures for the transaction. Typically created by invoking the\n * `sign()` method\n */\n this.signatures = [];\n this.feePayer = void 0;\n /**\n * The instructions to atomically execute\n */\n this.instructions = [];\n /**\n * A recent transaction id. Must be populated by the caller\n */\n this.recentBlockhash = void 0;\n /**\n * the last block chain can advance to before tx is declared expired\n * */\n this.lastValidBlockHeight = void 0;\n /**\n * Optional Nonce information. If populated, transaction will use a durable\n * Nonce hash instead of a recentBlockhash. Must be populated by the caller\n */\n this.nonceInfo = void 0;\n /**\n * If this is a nonce transaction this represents the minimum slot from which\n * to evaluate if the nonce has advanced when attempting to confirm the\n * transaction. This protects against a case where the transaction confirmation\n * logic loads the nonce account from an old slot and assumes the mismatch in\n * nonce value implies that the nonce has been advanced.\n */\n this.minNonceContextSlot = void 0;\n /**\n * @internal\n */\n this._message = void 0;\n /**\n * @internal\n */\n this._json = void 0;\n if (!opts) {\n return;\n }\n if (opts.feePayer) {\n this.feePayer = opts.feePayer;\n }\n if (opts.signatures) {\n this.signatures = opts.signatures;\n }\n if (Object.prototype.hasOwnProperty.call(opts, 'nonceInfo')) {\n const {\n minContextSlot,\n nonceInfo\n } = opts;\n this.minNonceContextSlot = minContextSlot;\n this.nonceInfo = nonceInfo;\n } else if (Object.prototype.hasOwnProperty.call(opts, 'lastValidBlockHeight')) {\n const {\n blockhash,\n lastValidBlockHeight\n } = opts;\n this.recentBlockhash = blockhash;\n this.lastValidBlockHeight = lastValidBlockHeight;\n } else {\n const {\n recentBlockhash,\n nonceInfo\n } = opts;\n if (nonceInfo) {\n this.nonceInfo = nonceInfo;\n }\n this.recentBlockhash = recentBlockhash;\n }\n }\n\n /**\n * @internal\n */\n toJSON() {\n return {\n recentBlockhash: this.recentBlockhash || null,\n feePayer: this.feePayer ? this.feePayer.toJSON() : null,\n nonceInfo: this.nonceInfo ? {\n nonce: this.nonceInfo.nonce,\n nonceInstruction: this.nonceInfo.nonceInstruction.toJSON()\n } : null,\n instructions: this.instructions.map(instruction => instruction.toJSON()),\n signers: this.signatures.map(({\n publicKey\n }) => {\n return publicKey.toJSON();\n })\n };\n }\n\n /**\n * Add one or more instructions to this Transaction\n *\n * @param {Array< Transaction | TransactionInstruction | TransactionInstructionCtorFields >} items - Instructions to add to the Transaction\n */\n add(...items) {\n if (items.length === 0) {\n throw new Error('No instructions');\n }\n items.forEach(item => {\n if ('instructions' in item) {\n this.instructions = this.instructions.concat(item.instructions);\n } else if ('data' in item && 'programId' in item && 'keys' in item) {\n this.instructions.push(item);\n } else {\n this.instructions.push(new TransactionInstruction(item));\n }\n });\n return this;\n }\n\n /**\n * Compile transaction data\n */\n compileMessage() {\n if (this._message && JSON.stringify(this.toJSON()) === JSON.stringify(this._json)) {\n return this._message;\n }\n let recentBlockhash;\n let instructions;\n if (this.nonceInfo) {\n recentBlockhash = this.nonceInfo.nonce;\n if (this.instructions[0] != this.nonceInfo.nonceInstruction) {\n instructions = [this.nonceInfo.nonceInstruction, ...this.instructions];\n } else {\n instructions = this.instructions;\n }\n } else {\n recentBlockhash = this.recentBlockhash;\n instructions = this.instructions;\n }\n if (!recentBlockhash) {\n throw new Error('Transaction recentBlockhash required');\n }\n if (instructions.length < 1) {\n console.warn('No instructions provided');\n }\n let feePayer;\n if (this.feePayer) {\n feePayer = this.feePayer;\n } else if (this.signatures.length > 0 && this.signatures[0].publicKey) {\n // Use implicit fee payer\n feePayer = this.signatures[0].publicKey;\n } else {\n throw new Error('Transaction fee payer required');\n }\n for (let i = 0; i < instructions.length; i++) {\n if (instructions[i].programId === undefined) {\n throw new Error(`Transaction instruction index ${i} has undefined program id`);\n }\n }\n const programIds = [];\n const accountMetas = [];\n instructions.forEach(instruction => {\n instruction.keys.forEach(accountMeta => {\n accountMetas.push({\n ...accountMeta\n });\n });\n const programId = instruction.programId.toString();\n if (!programIds.includes(programId)) {\n programIds.push(programId);\n }\n });\n\n // Append programID account metas\n programIds.forEach(programId => {\n accountMetas.push({\n pubkey: new PublicKey(programId),\n isSigner: false,\n isWritable: false\n });\n });\n\n // Cull duplicate account metas\n const uniqueMetas = [];\n accountMetas.forEach(accountMeta => {\n const pubkeyString = accountMeta.pubkey.toString();\n const uniqueIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.toString() === pubkeyString;\n });\n if (uniqueIndex > -1) {\n uniqueMetas[uniqueIndex].isWritable = uniqueMetas[uniqueIndex].isWritable || accountMeta.isWritable;\n uniqueMetas[uniqueIndex].isSigner = uniqueMetas[uniqueIndex].isSigner || accountMeta.isSigner;\n } else {\n uniqueMetas.push(accountMeta);\n }\n });\n\n // Sort. Prioritizing first by signer, then by writable\n uniqueMetas.sort(function (x, y) {\n if (x.isSigner !== y.isSigner) {\n // Signers always come before non-signers\n return x.isSigner ? -1 : 1;\n }\n if (x.isWritable !== y.isWritable) {\n // Writable accounts always come before read-only accounts\n return x.isWritable ? -1 : 1;\n }\n // Otherwise, sort by pubkey, stringwise.\n const options = {\n localeMatcher: 'best fit',\n usage: 'sort',\n sensitivity: 'variant',\n ignorePunctuation: false,\n numeric: false,\n caseFirst: 'lower'\n };\n return x.pubkey.toBase58().localeCompare(y.pubkey.toBase58(), 'en', options);\n });\n\n // Move fee payer to the front\n const feePayerIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.equals(feePayer);\n });\n if (feePayerIndex > -1) {\n const [payerMeta] = uniqueMetas.splice(feePayerIndex, 1);\n payerMeta.isSigner = true;\n payerMeta.isWritable = true;\n uniqueMetas.unshift(payerMeta);\n } else {\n uniqueMetas.unshift({\n pubkey: feePayer,\n isSigner: true,\n isWritable: true\n });\n }\n\n // Disallow unknown signers\n for (const signature of this.signatures) {\n const uniqueIndex = uniqueMetas.findIndex(x => {\n return x.pubkey.equals(signature.publicKey);\n });\n if (uniqueIndex > -1) {\n if (!uniqueMetas[uniqueIndex].isSigner) {\n uniqueMetas[uniqueIndex].isSigner = true;\n console.warn('Transaction references a signature that is unnecessary, ' + 'only the fee payer and instruction signer accounts should sign a transaction. ' + 'This behavior is deprecated and will throw an error in the next major version release.');\n }\n } else {\n throw new Error(`unknown signer: ${signature.publicKey.toString()}`);\n }\n }\n let numRequiredSignatures = 0;\n let numReadonlySignedAccounts = 0;\n let numReadonlyUnsignedAccounts = 0;\n\n // Split out signing from non-signing keys and count header values\n const signedKeys = [];\n const unsignedKeys = [];\n uniqueMetas.forEach(({\n pubkey,\n isSigner,\n isWritable\n }) => {\n if (isSigner) {\n signedKeys.push(pubkey.toString());\n numRequiredSignatures += 1;\n if (!isWritable) {\n numReadonlySignedAccounts += 1;\n }\n } else {\n unsignedKeys.push(pubkey.toString());\n if (!isWritable) {\n numReadonlyUnsignedAccounts += 1;\n }\n }\n });\n const accountKeys = signedKeys.concat(unsignedKeys);\n const compiledInstructions = instructions.map(instruction => {\n const {\n data,\n programId\n } = instruction;\n return {\n programIdIndex: accountKeys.indexOf(programId.toString()),\n accounts: instruction.keys.map(meta => accountKeys.indexOf(meta.pubkey.toString())),\n data: bs58__WEBPACK_IMPORTED_MODULE_2___default().encode(data)\n };\n });\n compiledInstructions.forEach(instruction => {\n assert(instruction.programIdIndex >= 0);\n instruction.accounts.forEach(keyIndex => assert(keyIndex >= 0));\n });\n return new Message({\n header: {\n numRequiredSignatures,\n numReadonlySignedAccounts,\n numReadonlyUnsignedAccounts\n },\n accountKeys,\n recentBlockhash,\n instructions: compiledInstructions\n });\n }\n\n /**\n * @internal\n */\n _compile() {\n const message = this.compileMessage();\n const signedKeys = message.accountKeys.slice(0, message.header.numRequiredSignatures);\n if (this.signatures.length === signedKeys.length) {\n const valid = this.signatures.every((pair, index) => {\n return signedKeys[index].equals(pair.publicKey);\n });\n if (valid) return message;\n }\n this.signatures = signedKeys.map(publicKey => ({\n signature: null,\n publicKey\n }));\n return message;\n }\n\n /**\n * Get a buffer of the Transaction data that need to be covered by signatures\n */\n serializeMessage() {\n return this._compile().serialize();\n }\n\n /**\n * Get the estimated fee associated with a transaction\n *\n * @param {Connection} connection Connection to RPC Endpoint.\n *\n * @returns {Promise} The estimated fee for the transaction\n */\n async getEstimatedFee(connection) {\n return (await connection.getFeeForMessage(this.compileMessage())).value;\n }\n\n /**\n * Specify the public keys which will be used to sign the Transaction.\n * The first signer will be used as the transaction fee payer account.\n *\n * Signatures can be added with either `partialSign` or `addSignature`\n *\n * @deprecated Deprecated since v0.84.0. Only the fee payer needs to be\n * specified and it can be set in the Transaction constructor or with the\n * `feePayer` property.\n */\n setSigners(...signers) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n const seen = new Set();\n this.signatures = signers.filter(publicKey => {\n const key = publicKey.toString();\n if (seen.has(key)) {\n return false;\n } else {\n seen.add(key);\n return true;\n }\n }).map(publicKey => ({\n signature: null,\n publicKey\n }));\n }\n\n /**\n * Sign the Transaction with the specified signers. Multiple signatures may\n * be applied to a Transaction. The first signature is considered \"primary\"\n * and is used identify and confirm transactions.\n *\n * If the Transaction `feePayer` is not set, the first signer will be used\n * as the transaction fee payer account.\n *\n * Transaction fields should not be modified after the first call to `sign`,\n * as doing so may invalidate the signature and cause the Transaction to be\n * rejected.\n *\n * The Transaction must be assigned a valid `recentBlockhash` before invoking this method\n *\n * @param {Array} signers Array of signers that will sign the transaction\n */\n sign(...signers) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n\n // Dedupe signers\n const seen = new Set();\n const uniqueSigners = [];\n for (const signer of signers) {\n const key = signer.publicKey.toString();\n if (seen.has(key)) {\n continue;\n } else {\n seen.add(key);\n uniqueSigners.push(signer);\n }\n }\n this.signatures = uniqueSigners.map(signer => ({\n signature: null,\n publicKey: signer.publicKey\n }));\n const message = this._compile();\n this._partialSign(message, ...uniqueSigners);\n }\n\n /**\n * Partially sign a transaction with the specified accounts. All accounts must\n * correspond to either the fee payer or a signer account in the transaction\n * instructions.\n *\n * All the caveats from the `sign` method apply to `partialSign`\n *\n * @param {Array} signers Array of signers that will sign the transaction\n */\n partialSign(...signers) {\n if (signers.length === 0) {\n throw new Error('No signers');\n }\n\n // Dedupe signers\n const seen = new Set();\n const uniqueSigners = [];\n for (const signer of signers) {\n const key = signer.publicKey.toString();\n if (seen.has(key)) {\n continue;\n } else {\n seen.add(key);\n uniqueSigners.push(signer);\n }\n }\n const message = this._compile();\n this._partialSign(message, ...uniqueSigners);\n }\n\n /**\n * @internal\n */\n _partialSign(message, ...signers) {\n const signData = message.serialize();\n signers.forEach(signer => {\n const signature = sign(signData, signer.secretKey);\n this._addSignature(signer.publicKey, toBuffer(signature));\n });\n }\n\n /**\n * Add an externally created signature to a transaction. The public key\n * must correspond to either the fee payer or a signer account in the transaction\n * instructions.\n *\n * @param {PublicKey} pubkey Public key that will be added to the transaction.\n * @param {Buffer} signature An externally created signature to add to the transaction.\n */\n addSignature(pubkey, signature) {\n this._compile(); // Ensure signatures array is populated\n this._addSignature(pubkey, signature);\n }\n\n /**\n * @internal\n */\n _addSignature(pubkey, signature) {\n assert(signature.length === 64);\n const index = this.signatures.findIndex(sigpair => pubkey.equals(sigpair.publicKey));\n if (index < 0) {\n throw new Error(`unknown signer: ${pubkey.toString()}`);\n }\n this.signatures[index].signature = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(signature);\n }\n\n /**\n * Verify signatures of a Transaction\n * Optional parameter specifies if we're expecting a fully signed Transaction or a partially signed one.\n * If no boolean is provided, we expect a fully signed Transaction by default.\n *\n * @param {boolean} [requireAllSignatures=true] Require a fully signed Transaction\n */\n verifySignatures(requireAllSignatures = true) {\n const signatureErrors = this._getMessageSignednessErrors(this.serializeMessage(), requireAllSignatures);\n return !signatureErrors;\n }\n\n /**\n * @internal\n */\n _getMessageSignednessErrors(message, requireAllSignatures) {\n const errors = {};\n for (const {\n signature,\n publicKey\n } of this.signatures) {\n if (signature === null) {\n if (requireAllSignatures) {\n (errors.missing ||= []).push(publicKey);\n }\n } else {\n if (!verify(signature, message, publicKey.toBytes())) {\n (errors.invalid ||= []).push(publicKey);\n }\n }\n }\n return errors.invalid || errors.missing ? errors : undefined;\n }\n\n /**\n * Serialize the Transaction in the wire format.\n *\n * @param {Buffer} [config] Config of transaction.\n *\n * @returns {Buffer} Signature of transaction in wire format.\n */\n serialize(config) {\n const {\n requireAllSignatures,\n verifySignatures\n } = Object.assign({\n requireAllSignatures: true,\n verifySignatures: true\n }, config);\n const signData = this.serializeMessage();\n if (verifySignatures) {\n const sigErrors = this._getMessageSignednessErrors(signData, requireAllSignatures);\n if (sigErrors) {\n let errorMessage = 'Signature verification failed.';\n if (sigErrors.invalid) {\n errorMessage += `\\nInvalid signature for public key${sigErrors.invalid.length === 1 ? '' : '(s)'} [\\`${sigErrors.invalid.map(p => p.toBase58()).join('`, `')}\\`].`;\n }\n if (sigErrors.missing) {\n errorMessage += `\\nMissing signature for public key${sigErrors.missing.length === 1 ? '' : '(s)'} [\\`${sigErrors.missing.map(p => p.toBase58()).join('`, `')}\\`].`;\n }\n throw new Error(errorMessage);\n }\n }\n return this._serialize(signData);\n }\n\n /**\n * @internal\n */\n _serialize(signData) {\n const {\n signatures\n } = this;\n const signatureCount = [];\n encodeLength(signatureCount, signatures.length);\n const transactionLength = signatureCount.length + signatures.length * 64 + signData.length;\n const wireTransaction = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(transactionLength);\n assert(signatures.length < 256);\n buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(signatureCount).copy(wireTransaction, 0);\n signatures.forEach(({\n signature\n }, index) => {\n if (signature !== null) {\n assert(signature.length === 64, `signature has invalid length`);\n buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(signature).copy(wireTransaction, signatureCount.length + index * 64);\n }\n });\n signData.copy(wireTransaction, signatureCount.length + signatures.length * 64);\n assert(wireTransaction.length <= PACKET_DATA_SIZE, `Transaction too large: ${wireTransaction.length} > ${PACKET_DATA_SIZE}`);\n return wireTransaction;\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get keys() {\n assert(this.instructions.length === 1);\n return this.instructions[0].keys.map(keyObj => keyObj.pubkey);\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get programId() {\n assert(this.instructions.length === 1);\n return this.instructions[0].programId;\n }\n\n /**\n * Deprecated method\n * @internal\n */\n get data() {\n assert(this.instructions.length === 1);\n return this.instructions[0].data;\n }\n\n /**\n * Parse a wire transaction into a Transaction object.\n *\n * @param {Buffer | Uint8Array | Array} buffer Signature of wire Transaction\n *\n * @returns {Transaction} Transaction associated with the signature\n */\n static from(buffer) {\n // Slice up wire data\n let byteArray = [...buffer];\n const signatureCount = decodeLength(byteArray);\n let signatures = [];\n for (let i = 0; i < signatureCount; i++) {\n const signature = byteArray.slice(0, SIGNATURE_LENGTH_IN_BYTES);\n byteArray = byteArray.slice(SIGNATURE_LENGTH_IN_BYTES);\n signatures.push(bs58__WEBPACK_IMPORTED_MODULE_2___default().encode(buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(signature)));\n }\n return Transaction.populate(Message.from(byteArray), signatures);\n }\n\n /**\n * Populate Transaction object from message and signatures\n *\n * @param {Message} message Message of transaction\n * @param {Array} signatures List of signatures to assign to the transaction\n *\n * @returns {Transaction} The populated Transaction\n */\n static populate(message, signatures = []) {\n const transaction = new Transaction();\n transaction.recentBlockhash = message.recentBlockhash;\n if (message.header.numRequiredSignatures > 0) {\n transaction.feePayer = message.accountKeys[0];\n }\n signatures.forEach((signature, index) => {\n const sigPubkeyPair = {\n signature: signature == bs58__WEBPACK_IMPORTED_MODULE_2___default().encode(DEFAULT_SIGNATURE) ? null : bs58__WEBPACK_IMPORTED_MODULE_2___default().decode(signature),\n publicKey: message.accountKeys[index]\n };\n transaction.signatures.push(sigPubkeyPair);\n });\n message.instructions.forEach(instruction => {\n const keys = instruction.accounts.map(account => {\n const pubkey = message.accountKeys[account];\n return {\n pubkey,\n isSigner: transaction.signatures.some(keyObj => keyObj.publicKey.toString() === pubkey.toString()) || message.isAccountSigner(account),\n isWritable: message.isAccountWritable(account)\n };\n });\n transaction.instructions.push(new TransactionInstruction({\n keys,\n programId: message.accountKeys[instruction.programIdIndex],\n data: bs58__WEBPACK_IMPORTED_MODULE_2___default().decode(instruction.data)\n }));\n });\n transaction._message = message;\n transaction._json = transaction.toJSON();\n return transaction;\n }\n}\n\nclass TransactionMessage {\n constructor(args) {\n this.payerKey = void 0;\n this.instructions = void 0;\n this.recentBlockhash = void 0;\n this.payerKey = args.payerKey;\n this.instructions = args.instructions;\n this.recentBlockhash = args.recentBlockhash;\n }\n static decompile(message, args) {\n const {\n header,\n compiledInstructions,\n recentBlockhash\n } = message;\n const {\n numRequiredSignatures,\n numReadonlySignedAccounts,\n numReadonlyUnsignedAccounts\n } = header;\n const numWritableSignedAccounts = numRequiredSignatures - numReadonlySignedAccounts;\n assert(numWritableSignedAccounts > 0, 'Message header is invalid');\n const numWritableUnsignedAccounts = message.staticAccountKeys.length - numRequiredSignatures - numReadonlyUnsignedAccounts;\n assert(numWritableUnsignedAccounts >= 0, 'Message header is invalid');\n const accountKeys = message.getAccountKeys(args);\n const payerKey = accountKeys.get(0);\n if (payerKey === undefined) {\n throw new Error('Failed to decompile message because no account keys were found');\n }\n const instructions = [];\n for (const compiledIx of compiledInstructions) {\n const keys = [];\n for (const keyIndex of compiledIx.accountKeyIndexes) {\n const pubkey = accountKeys.get(keyIndex);\n if (pubkey === undefined) {\n throw new Error(`Failed to find key for account key index ${keyIndex}`);\n }\n const isSigner = keyIndex < numRequiredSignatures;\n let isWritable;\n if (isSigner) {\n isWritable = keyIndex < numWritableSignedAccounts;\n } else if (keyIndex < accountKeys.staticAccountKeys.length) {\n isWritable = keyIndex - numRequiredSignatures < numWritableUnsignedAccounts;\n } else {\n isWritable = keyIndex - accountKeys.staticAccountKeys.length <\n // accountKeysFromLookups cannot be undefined because we already found a pubkey for this index above\n accountKeys.accountKeysFromLookups.writable.length;\n }\n keys.push({\n pubkey,\n isSigner: keyIndex < header.numRequiredSignatures,\n isWritable\n });\n }\n const programId = accountKeys.get(compiledIx.programIdIndex);\n if (programId === undefined) {\n throw new Error(`Failed to find program id for program id index ${compiledIx.programIdIndex}`);\n }\n instructions.push(new TransactionInstruction({\n programId,\n data: toBuffer(compiledIx.data),\n keys\n }));\n }\n return new TransactionMessage({\n payerKey,\n instructions,\n recentBlockhash\n });\n }\n compileToLegacyMessage() {\n return Message.compile({\n payerKey: this.payerKey,\n recentBlockhash: this.recentBlockhash,\n instructions: this.instructions\n });\n }\n compileToV0Message(addressLookupTableAccounts) {\n return MessageV0.compile({\n payerKey: this.payerKey,\n recentBlockhash: this.recentBlockhash,\n instructions: this.instructions,\n addressLookupTableAccounts\n });\n }\n}\n\n/**\n * Versioned transaction class\n */\nclass VersionedTransaction {\n get version() {\n return this.message.version;\n }\n constructor(message, signatures) {\n this.signatures = void 0;\n this.message = void 0;\n if (signatures !== undefined) {\n assert(signatures.length === message.header.numRequiredSignatures, 'Expected signatures length to be equal to the number of required signatures');\n this.signatures = signatures;\n } else {\n const defaultSignatures = [];\n for (let i = 0; i < message.header.numRequiredSignatures; i++) {\n defaultSignatures.push(new Uint8Array(SIGNATURE_LENGTH_IN_BYTES));\n }\n this.signatures = defaultSignatures;\n }\n this.message = message;\n }\n serialize() {\n const serializedMessage = this.message.serialize();\n const encodedSignaturesLength = Array();\n encodeLength(encodedSignaturesLength, this.signatures.length);\n const transactionLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(encodedSignaturesLength.length, 'encodedSignaturesLength'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(signature(), this.signatures.length, 'signatures'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(serializedMessage.length, 'serializedMessage')]);\n const serializedTransaction = new Uint8Array(2048);\n const serializedTransactionLength = transactionLayout.encode({\n encodedSignaturesLength: new Uint8Array(encodedSignaturesLength),\n signatures: this.signatures,\n serializedMessage\n }, serializedTransaction);\n return serializedTransaction.slice(0, serializedTransactionLength);\n }\n static deserialize(serializedTransaction) {\n let byteArray = [...serializedTransaction];\n const signatures = [];\n const signaturesLength = decodeLength(byteArray);\n for (let i = 0; i < signaturesLength; i++) {\n signatures.push(new Uint8Array(byteArray.splice(0, SIGNATURE_LENGTH_IN_BYTES)));\n }\n const message = VersionedMessage.deserialize(new Uint8Array(byteArray));\n return new VersionedTransaction(message, signatures);\n }\n sign(signers) {\n const messageData = this.message.serialize();\n const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures);\n for (const signer of signers) {\n const signerIndex = signerPubkeys.findIndex(pubkey => pubkey.equals(signer.publicKey));\n assert(signerIndex >= 0, `Cannot sign with non signer key ${signer.publicKey.toBase58()}`);\n this.signatures[signerIndex] = sign(messageData, signer.secretKey);\n }\n }\n addSignature(publicKey, signature) {\n assert(signature.byteLength === 64, 'Signature must be 64 bytes long');\n const signerPubkeys = this.message.staticAccountKeys.slice(0, this.message.header.numRequiredSignatures);\n const signerIndex = signerPubkeys.findIndex(pubkey => pubkey.equals(publicKey));\n assert(signerIndex >= 0, `Can not add signature; \\`${publicKey.toBase58()}\\` is not required to sign this transaction`);\n this.signatures[signerIndex] = signature;\n }\n}\n\n// TODO: These constants should be removed in favor of reading them out of a\n// Syscall account\n\n/**\n * @internal\n */\nconst NUM_TICKS_PER_SECOND = 160;\n\n/**\n * @internal\n */\nconst DEFAULT_TICKS_PER_SLOT = 64;\n\n/**\n * @internal\n */\nconst NUM_SLOTS_PER_SECOND = NUM_TICKS_PER_SECOND / DEFAULT_TICKS_PER_SLOT;\n\n/**\n * @internal\n */\nconst MS_PER_SLOT = 1000 / NUM_SLOTS_PER_SECOND;\n\nconst SYSVAR_CLOCK_PUBKEY = new PublicKey('SysvarC1ock11111111111111111111111111111111');\nconst SYSVAR_EPOCH_SCHEDULE_PUBKEY = new PublicKey('SysvarEpochSchedu1e111111111111111111111111');\nconst SYSVAR_INSTRUCTIONS_PUBKEY = new PublicKey('Sysvar1nstructions1111111111111111111111111');\nconst SYSVAR_RECENT_BLOCKHASHES_PUBKEY = new PublicKey('SysvarRecentB1ockHashes11111111111111111111');\nconst SYSVAR_RENT_PUBKEY = new PublicKey('SysvarRent111111111111111111111111111111111');\nconst SYSVAR_REWARDS_PUBKEY = new PublicKey('SysvarRewards111111111111111111111111111111');\nconst SYSVAR_SLOT_HASHES_PUBKEY = new PublicKey('SysvarS1otHashes111111111111111111111111111');\nconst SYSVAR_SLOT_HISTORY_PUBKEY = new PublicKey('SysvarS1otHistory11111111111111111111111111');\nconst SYSVAR_STAKE_HISTORY_PUBKEY = new PublicKey('SysvarStakeHistory1111111111111111111111111');\n\n/**\n * Sign, send and confirm a transaction.\n *\n * If `commitment` option is not specified, defaults to 'max' commitment.\n *\n * @param {Connection} connection\n * @param {Transaction} transaction\n * @param {Array} signers\n * @param {ConfirmOptions} [options]\n * @returns {Promise}\n */\nasync function sendAndConfirmTransaction(connection, transaction, signers, options) {\n const sendOptions = options && {\n skipPreflight: options.skipPreflight,\n preflightCommitment: options.preflightCommitment || options.commitment,\n maxRetries: options.maxRetries,\n minContextSlot: options.minContextSlot\n };\n const signature = await connection.sendTransaction(transaction, signers, sendOptions);\n let status;\n if (transaction.recentBlockhash != null && transaction.lastValidBlockHeight != null) {\n status = (await connection.confirmTransaction({\n abortSignal: options?.abortSignal,\n signature: signature,\n blockhash: transaction.recentBlockhash,\n lastValidBlockHeight: transaction.lastValidBlockHeight\n }, options && options.commitment)).value;\n } else if (transaction.minNonceContextSlot != null && transaction.nonceInfo != null) {\n const {\n nonceInstruction\n } = transaction.nonceInfo;\n const nonceAccountPubkey = nonceInstruction.keys[0].pubkey;\n status = (await connection.confirmTransaction({\n abortSignal: options?.abortSignal,\n minContextSlot: transaction.minNonceContextSlot,\n nonceAccountPubkey,\n nonceValue: transaction.nonceInfo.nonce,\n signature\n }, options && options.commitment)).value;\n } else {\n if (options?.abortSignal != null) {\n console.warn('sendAndConfirmTransaction(): A transaction with a deprecated confirmation strategy was ' + 'supplied along with an `abortSignal`. Only transactions having `lastValidBlockHeight` ' + 'or a combination of `nonceInfo` and `minNonceContextSlot` are abortable.');\n }\n status = (await connection.confirmTransaction(signature, options && options.commitment)).value;\n }\n if (status.err) {\n throw new Error(`Transaction ${signature} failed (${JSON.stringify(status)})`);\n }\n return signature;\n}\n\n// zzz\nfunction sleep(ms) {\n return new Promise(resolve => setTimeout(resolve, ms));\n}\n\n/**\n * @internal\n */\n\n/**\n * Populate a buffer of instruction data using an InstructionType\n * @internal\n */\nfunction encodeData(type, fields) {\n const allocLength = type.layout.span >= 0 ? type.layout.span : getAlloc(type, fields);\n const data = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(allocLength);\n const layoutFields = Object.assign({\n instruction: type.index\n }, fields);\n type.layout.encode(layoutFields, data);\n return data;\n}\n\n/**\n * Decode instruction data buffer using an InstructionType\n * @internal\n */\nfunction decodeData$1(type, buffer) {\n let data;\n try {\n data = type.layout.decode(buffer);\n } catch (err) {\n throw new Error('invalid instruction; ' + err);\n }\n if (data.instruction !== type.index) {\n throw new Error(`invalid instruction; instruction index mismatch ${data.instruction} != ${type.index}`);\n }\n return data;\n}\n\n/**\n * https://github.com/solana-labs/solana/blob/90bedd7e067b5b8f3ddbb45da00a4e9cabb22c62/sdk/src/fee_calculator.rs#L7-L11\n *\n * @internal\n */\nconst FeeCalculatorLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('lamportsPerSignature');\n\n/**\n * Calculator for transaction fees.\n *\n * @deprecated Deprecated since Solana v1.8.0.\n */\n\n/**\n * See https://github.com/solana-labs/solana/blob/0ea2843ec9cdc517572b8e62c959f41b55cf4453/sdk/src/nonce_state.rs#L29-L32\n *\n * @internal\n */\nconst NonceAccountLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('version'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('state'), publicKey('authorizedPubkey'), publicKey('nonce'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([FeeCalculatorLayout], 'feeCalculator')]);\nconst NONCE_ACCOUNT_LENGTH = NonceAccountLayout.span;\n\n/**\n * A durable nonce is a 32 byte value encoded as a base58 string.\n */\n\n/**\n * NonceAccount class\n */\nclass NonceAccount {\n /**\n * @internal\n */\n constructor(args) {\n this.authorizedPubkey = void 0;\n this.nonce = void 0;\n this.feeCalculator = void 0;\n this.authorizedPubkey = args.authorizedPubkey;\n this.nonce = args.nonce;\n this.feeCalculator = args.feeCalculator;\n }\n\n /**\n * Deserialize NonceAccount from the account data.\n *\n * @param buffer account data\n * @return NonceAccount\n */\n static fromAccountData(buffer) {\n const nonceAccount = NonceAccountLayout.decode(toBuffer(buffer), 0);\n return new NonceAccount({\n authorizedPubkey: new PublicKey(nonceAccount.authorizedPubkey),\n nonce: new PublicKey(nonceAccount.nonce).toString(),\n feeCalculator: nonceAccount.feeCalculator\n });\n }\n}\n\nconst encodeDecode = layout => {\n const decode = layout.decode.bind(layout);\n const encode = layout.encode.bind(layout);\n return {\n decode,\n encode\n };\n};\nconst bigInt = length => property => {\n const layout = (0,_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob)(length, property);\n const {\n encode,\n decode\n } = encodeDecode(layout);\n const bigIntLayout = layout;\n bigIntLayout.decode = (buffer, offset) => {\n const src = decode(buffer, offset);\n return (0,bigint_buffer__WEBPACK_IMPORTED_MODULE_5__.toBigIntLE)(buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(src));\n };\n bigIntLayout.encode = (bigInt, buffer, offset) => {\n const src = (0,bigint_buffer__WEBPACK_IMPORTED_MODULE_5__.toBufferLE)(bigInt, length);\n return encode(src, buffer, offset);\n };\n return bigIntLayout;\n};\nconst u64 = bigInt(8);\n\n/**\n * Create account system transaction params\n */\n\n/**\n * Transfer system transaction params\n */\n\n/**\n * Assign system transaction params\n */\n\n/**\n * Create account with seed system transaction params\n */\n\n/**\n * Create nonce account system transaction params\n */\n\n/**\n * Create nonce account with seed system transaction params\n */\n\n/**\n * Initialize nonce account system instruction params\n */\n\n/**\n * Advance nonce account system instruction params\n */\n\n/**\n * Withdraw nonce account system transaction params\n */\n\n/**\n * Authorize nonce account system transaction params\n */\n\n/**\n * Allocate account system transaction params\n */\n\n/**\n * Allocate account with seed system transaction params\n */\n\n/**\n * Assign account with seed system transaction params\n */\n\n/**\n * Transfer with seed system transaction params\n */\n\n/** Decoded transfer system transaction instruction */\n\n/** Decoded transferWithSeed system transaction instruction */\n\n/**\n * System Instruction class\n */\nclass SystemInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a system instruction and retrieve the instruction type.\n */\n static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n let type;\n for (const [ixType, layout] of Object.entries(SYSTEM_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType;\n break;\n }\n }\n if (!type) {\n throw new Error('Instruction type incorrect; not a SystemInstruction');\n }\n return type;\n }\n\n /**\n * Decode a create account system instruction and retrieve the instruction params.\n */\n static decodeCreateAccount(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n lamports,\n space,\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Create, instruction.data);\n return {\n fromPubkey: instruction.keys[0].pubkey,\n newAccountPubkey: instruction.keys[1].pubkey,\n lamports,\n space,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode a transfer system instruction and retrieve the instruction params.\n */\n static decodeTransfer(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n lamports\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Transfer, instruction.data);\n return {\n fromPubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n lamports\n };\n }\n\n /**\n * Decode a transfer with seed system instruction and retrieve the instruction params.\n */\n static decodeTransferWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n lamports,\n seed,\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed, instruction.data);\n return {\n fromPubkey: instruction.keys[0].pubkey,\n basePubkey: instruction.keys[1].pubkey,\n toPubkey: instruction.keys[2].pubkey,\n lamports,\n seed,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode an allocate system instruction and retrieve the instruction params.\n */\n static decodeAllocate(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n const {\n space\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Allocate, instruction.data);\n return {\n accountPubkey: instruction.keys[0].pubkey,\n space\n };\n }\n\n /**\n * Decode an allocate with seed system instruction and retrieve the instruction params.\n */\n static decodeAllocateWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n const {\n base,\n seed,\n space,\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed, instruction.data);\n return {\n accountPubkey: instruction.keys[0].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n space,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode an assign system instruction and retrieve the instruction params.\n */\n static decodeAssign(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n const {\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.Assign, instruction.data);\n return {\n accountPubkey: instruction.keys[0].pubkey,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode an assign with seed system instruction and retrieve the instruction params.\n */\n static decodeAssignWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 1);\n const {\n base,\n seed,\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed, instruction.data);\n return {\n accountPubkey: instruction.keys[0].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode a create account with seed system instruction and retrieve the instruction params.\n */\n static decodeCreateWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n base,\n seed,\n lamports,\n space,\n programId\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed, instruction.data);\n return {\n fromPubkey: instruction.keys[0].pubkey,\n newAccountPubkey: instruction.keys[1].pubkey,\n basePubkey: new PublicKey(base),\n seed,\n lamports,\n space,\n programId: new PublicKey(programId)\n };\n }\n\n /**\n * Decode a nonce initialize system instruction and retrieve the instruction params.\n */\n static decodeNonceInitialize(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n authorized\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount, instruction.data);\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: new PublicKey(authorized)\n };\n }\n\n /**\n * Decode a nonce advance system instruction and retrieve the instruction params.\n */\n static decodeNonceAdvance(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount, instruction.data);\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey\n };\n }\n\n /**\n * Decode a nonce withdraw system instruction and retrieve the instruction params.\n */\n static decodeNonceWithdraw(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 5);\n const {\n lamports\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount, instruction.data);\n return {\n noncePubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey,\n lamports\n };\n }\n\n /**\n * Decode a nonce authorize system instruction and retrieve the instruction params.\n */\n static decodeNonceAuthorize(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n authorized\n } = decodeData$1(SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount, instruction.data);\n return {\n noncePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[1].pubkey,\n newAuthorizedPubkey: new PublicKey(authorized)\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId) {\n if (!programId.equals(SystemProgram.programId)) {\n throw new Error('invalid instruction; programId is not SystemProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys, expectedLength) {\n if (keys.length < expectedLength) {\n throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`);\n }\n }\n}\n\n/**\n * An enumeration of valid SystemInstructionType's\n */\n\n/**\n * An enumeration of valid system InstructionType's\n * @internal\n */\nconst SYSTEM_INSTRUCTION_LAYOUTS = Object.freeze({\n Create: {\n index: 0,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('lamports'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('space'), publicKey('programId')])\n },\n Assign: {\n index: 1,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), publicKey('programId')])\n },\n Transfer: {\n index: 2,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), u64('lamports')])\n },\n CreateWithSeed: {\n index: 3,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), publicKey('base'), rustString('seed'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('lamports'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('space'), publicKey('programId')])\n },\n AdvanceNonceAccount: {\n index: 4,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction')])\n },\n WithdrawNonceAccount: {\n index: 5,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('lamports')])\n },\n InitializeNonceAccount: {\n index: 6,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), publicKey('authorized')])\n },\n AuthorizeNonceAccount: {\n index: 7,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), publicKey('authorized')])\n },\n Allocate: {\n index: 8,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('space')])\n },\n AllocateWithSeed: {\n index: 9,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), publicKey('base'), rustString('seed'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('space'), publicKey('programId')])\n },\n AssignWithSeed: {\n index: 10,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), publicKey('base'), rustString('seed'), publicKey('programId')])\n },\n TransferWithSeed: {\n index: 11,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), u64('lamports'), rustString('seed'), publicKey('programId')])\n },\n UpgradeNonceAccount: {\n index: 12,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction')])\n }\n});\n\n/**\n * Factory class for transactions to interact with the System program\n */\nclass SystemProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the System program\n */\n\n /**\n * Generate a transaction instruction that creates a new account\n */\n static createAccount(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Create;\n const data = encodeData(type, {\n lamports: params.lamports,\n space: params.space,\n programId: toBuffer(params.programId.toBuffer())\n });\n return new TransactionInstruction({\n keys: [{\n pubkey: params.fromPubkey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: params.newAccountPubkey,\n isSigner: true,\n isWritable: true\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction instruction that transfers lamports from one account to another\n */\n static transfer(params) {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.TransferWithSeed;\n data = encodeData(type, {\n lamports: BigInt(params.lamports),\n seed: params.seed,\n programId: toBuffer(params.programId.toBuffer())\n });\n keys = [{\n pubkey: params.fromPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.basePubkey,\n isSigner: true,\n isWritable: false\n }, {\n pubkey: params.toPubkey,\n isSigner: false,\n isWritable: true\n }];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Transfer;\n data = encodeData(type, {\n lamports: BigInt(params.lamports)\n });\n keys = [{\n pubkey: params.fromPubkey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: params.toPubkey,\n isSigner: false,\n isWritable: true\n }];\n }\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction instruction that assigns an account to a program\n */\n static assign(params) {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AssignWithSeed;\n data = encodeData(type, {\n base: toBuffer(params.basePubkey.toBuffer()),\n seed: params.seed,\n programId: toBuffer(params.programId.toBuffer())\n });\n keys = [{\n pubkey: params.accountPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.basePubkey,\n isSigner: true,\n isWritable: false\n }];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Assign;\n data = encodeData(type, {\n programId: toBuffer(params.programId.toBuffer())\n });\n keys = [{\n pubkey: params.accountPubkey,\n isSigner: true,\n isWritable: true\n }];\n }\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction instruction that creates a new account at\n * an address generated with `from`, a seed, and programId\n */\n static createAccountWithSeed(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.CreateWithSeed;\n const data = encodeData(type, {\n base: toBuffer(params.basePubkey.toBuffer()),\n seed: params.seed,\n lamports: params.lamports,\n space: params.space,\n programId: toBuffer(params.programId.toBuffer())\n });\n let keys = [{\n pubkey: params.fromPubkey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: params.newAccountPubkey,\n isSigner: false,\n isWritable: true\n }];\n if (params.basePubkey != params.fromPubkey) {\n keys.push({\n pubkey: params.basePubkey,\n isSigner: true,\n isWritable: false\n });\n }\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction that creates a new Nonce account\n */\n static createNonceAccount(params) {\n const transaction = new Transaction();\n if ('basePubkey' in params && 'seed' in params) {\n transaction.add(SystemProgram.createAccountWithSeed({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.noncePubkey,\n basePubkey: params.basePubkey,\n seed: params.seed,\n lamports: params.lamports,\n space: NONCE_ACCOUNT_LENGTH,\n programId: this.programId\n }));\n } else {\n transaction.add(SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.noncePubkey,\n lamports: params.lamports,\n space: NONCE_ACCOUNT_LENGTH,\n programId: this.programId\n }));\n }\n const initParams = {\n noncePubkey: params.noncePubkey,\n authorizedPubkey: params.authorizedPubkey\n };\n transaction.add(this.nonceInitialize(initParams));\n return transaction;\n }\n\n /**\n * Generate an instruction to initialize a Nonce account\n */\n static nonceInitialize(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.InitializeNonceAccount;\n const data = encodeData(type, {\n authorized: toBuffer(params.authorizedPubkey.toBuffer())\n });\n const instructionData = {\n keys: [{\n pubkey: params.noncePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false\n }],\n programId: this.programId,\n data\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate an instruction to advance the nonce in a Nonce account\n */\n static nonceAdvance(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AdvanceNonceAccount;\n const data = encodeData(type);\n const instructionData = {\n keys: [{\n pubkey: params.noncePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: params.authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a transaction instruction that withdraws lamports from a Nonce account\n */\n static nonceWithdraw(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.WithdrawNonceAccount;\n const data = encodeData(type, {\n lamports: params.lamports\n });\n return new TransactionInstruction({\n keys: [{\n pubkey: params.noncePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.toPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_RECENT_BLOCKHASHES_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: params.authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction instruction that authorizes a new PublicKey as the authority\n * on a Nonce account.\n */\n static nonceAuthorize(params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AuthorizeNonceAccount;\n const data = encodeData(type, {\n authorized: toBuffer(params.newAuthorizedPubkey.toBuffer())\n });\n return new TransactionInstruction({\n keys: [{\n pubkey: params.noncePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction instruction that allocates space in an account without funding\n */\n static allocate(params) {\n let data;\n let keys;\n if ('basePubkey' in params) {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.AllocateWithSeed;\n data = encodeData(type, {\n base: toBuffer(params.basePubkey.toBuffer()),\n seed: params.seed,\n space: params.space,\n programId: toBuffer(params.programId.toBuffer())\n });\n keys = [{\n pubkey: params.accountPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.basePubkey,\n isSigner: true,\n isWritable: false\n }];\n } else {\n const type = SYSTEM_INSTRUCTION_LAYOUTS.Allocate;\n data = encodeData(type, {\n space: params.space\n });\n keys = [{\n pubkey: params.accountPubkey,\n isSigner: true,\n isWritable: true\n }];\n }\n return new TransactionInstruction({\n keys,\n programId: this.programId,\n data\n });\n }\n}\nSystemProgram.programId = new PublicKey('11111111111111111111111111111111');\n\n// Keep program chunks under PACKET_DATA_SIZE, leaving enough room for the\n// rest of the Transaction fields\n//\n// TODO: replace 300 with a proper constant for the size of the other\n// Transaction fields\nconst CHUNK_SIZE = PACKET_DATA_SIZE - 300;\n\n/**\n * Program loader interface\n */\nclass Loader {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Amount of program data placed in each load Transaction\n */\n\n /**\n * Minimum number of signatures required to load a program not including\n * retries\n *\n * Can be used to calculate transaction fees\n */\n static getMinNumSignatures(dataLength) {\n return 2 * (\n // Every transaction requires two signatures (payer + program)\n Math.ceil(dataLength / Loader.chunkSize) + 1 +\n // Add one for Create transaction\n 1) // Add one for Finalize transaction\n ;\n }\n\n /**\n * Loads a generic program\n *\n * @param connection The connection to use\n * @param payer System account that pays to load the program\n * @param program Account to load the program into\n * @param programId Public key that identifies the loader\n * @param data Program octets\n * @return true if program was loaded successfully, false if program was already loaded\n */\n static async load(connection, payer, program, programId, data) {\n {\n const balanceNeeded = await connection.getMinimumBalanceForRentExemption(data.length);\n\n // Fetch program account info to check if it has already been created\n const programInfo = await connection.getAccountInfo(program.publicKey, 'confirmed');\n let transaction = null;\n if (programInfo !== null) {\n if (programInfo.executable) {\n console.error('Program load failed, account is already executable');\n return false;\n }\n if (programInfo.data.length !== data.length) {\n transaction = transaction || new Transaction();\n transaction.add(SystemProgram.allocate({\n accountPubkey: program.publicKey,\n space: data.length\n }));\n }\n if (!programInfo.owner.equals(programId)) {\n transaction = transaction || new Transaction();\n transaction.add(SystemProgram.assign({\n accountPubkey: program.publicKey,\n programId\n }));\n }\n if (programInfo.lamports < balanceNeeded) {\n transaction = transaction || new Transaction();\n transaction.add(SystemProgram.transfer({\n fromPubkey: payer.publicKey,\n toPubkey: program.publicKey,\n lamports: balanceNeeded - programInfo.lamports\n }));\n }\n } else {\n transaction = new Transaction().add(SystemProgram.createAccount({\n fromPubkey: payer.publicKey,\n newAccountPubkey: program.publicKey,\n lamports: balanceNeeded > 0 ? balanceNeeded : 1,\n space: data.length,\n programId\n }));\n }\n\n // If the account is already created correctly, skip this step\n // and proceed directly to loading instructions\n if (transaction !== null) {\n await sendAndConfirmTransaction(connection, transaction, [payer, program], {\n commitment: 'confirmed'\n });\n }\n }\n const dataLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('offset'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('bytesLength'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('bytesLengthPadding'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('byte'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.offset(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32(), -8), 'bytes')]);\n const chunkSize = Loader.chunkSize;\n let offset = 0;\n let array = data;\n let transactions = [];\n while (array.length > 0) {\n const bytes = array.slice(0, chunkSize);\n const data = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(chunkSize + 16);\n dataLayout.encode({\n instruction: 0,\n // Load instruction\n offset,\n bytes: bytes,\n bytesLength: 0,\n bytesLengthPadding: 0\n }, data);\n const transaction = new Transaction().add({\n keys: [{\n pubkey: program.publicKey,\n isSigner: true,\n isWritable: true\n }],\n programId,\n data\n });\n transactions.push(sendAndConfirmTransaction(connection, transaction, [payer, program], {\n commitment: 'confirmed'\n }));\n\n // Delay between sends in an attempt to reduce rate limit errors\n if (connection._rpcEndpoint.includes('solana.com')) {\n const REQUESTS_PER_SECOND = 4;\n await sleep(1000 / REQUESTS_PER_SECOND);\n }\n offset += chunkSize;\n array = array.slice(chunkSize);\n }\n await Promise.all(transactions);\n\n // Finalize the account loaded with program data for execution\n {\n const dataLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction')]);\n const data = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(dataLayout.span);\n dataLayout.encode({\n instruction: 1 // Finalize instruction\n }, data);\n const transaction = new Transaction().add({\n keys: [{\n pubkey: program.publicKey,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false\n }],\n programId,\n data\n });\n const deployCommitment = 'processed';\n const finalizeSignature = await connection.sendTransaction(transaction, [payer, program], {\n preflightCommitment: deployCommitment\n });\n const {\n context,\n value\n } = await connection.confirmTransaction({\n signature: finalizeSignature,\n lastValidBlockHeight: transaction.lastValidBlockHeight,\n blockhash: transaction.recentBlockhash\n }, deployCommitment);\n if (value.err) {\n throw new Error(`Transaction ${finalizeSignature} failed (${JSON.stringify(value)})`);\n }\n // We prevent programs from being usable until the slot after their deployment.\n // See https://github.com/solana-labs/solana/pull/29654\n while (true // eslint-disable-line no-constant-condition\n ) {\n try {\n const currentSlot = await connection.getSlot({\n commitment: deployCommitment\n });\n if (currentSlot > context.slot) {\n break;\n }\n } catch {\n /* empty */\n }\n await new Promise(resolve => setTimeout(resolve, Math.round(MS_PER_SLOT / 2)));\n }\n }\n\n // success\n return true;\n }\n}\nLoader.chunkSize = CHUNK_SIZE;\n\n/**\n * @deprecated Deprecated since Solana v1.17.20.\n */\nconst BPF_LOADER_PROGRAM_ID = new PublicKey('BPFLoader2111111111111111111111111111111111');\n\n/**\n * Factory class for transactions to interact with a program loader\n *\n * @deprecated Deprecated since Solana v1.17.20.\n */\nclass BpfLoader {\n /**\n * Minimum number of signatures required to load a program not including\n * retries\n *\n * Can be used to calculate transaction fees\n */\n static getMinNumSignatures(dataLength) {\n return Loader.getMinNumSignatures(dataLength);\n }\n\n /**\n * Load a SBF program\n *\n * @param connection The connection to use\n * @param payer Account that will pay program loading fees\n * @param program Account to load the program into\n * @param elf The entire ELF containing the SBF program\n * @param loaderProgramId The program id of the BPF loader to use\n * @return true if program was loaded successfully, false if program was already loaded\n */\n static load(connection, payer, program, elf, loaderProgramId) {\n return Loader.load(connection, payer, program, loaderProgramId, elf);\n }\n}\n\nfunction getDefaultExportFromCjs (x) {\n\treturn x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;\n}\n\nvar objToString = Object.prototype.toString;\nvar objKeys = Object.keys || function(obj) {\n\t\tvar keys = [];\n\t\tfor (var name in obj) {\n\t\t\tkeys.push(name);\n\t\t}\n\t\treturn keys;\n\t};\n\nfunction stringify(val, isArrayProp) {\n\tvar i, max, str, keys, key, propVal, toStr;\n\tif (val === true) {\n\t\treturn \"true\";\n\t}\n\tif (val === false) {\n\t\treturn \"false\";\n\t}\n\tswitch (typeof val) {\n\t\tcase \"object\":\n\t\t\tif (val === null) {\n\t\t\t\treturn null;\n\t\t\t} else if (val.toJSON && typeof val.toJSON === \"function\") {\n\t\t\t\treturn stringify(val.toJSON(), isArrayProp);\n\t\t\t} else {\n\t\t\t\ttoStr = objToString.call(val);\n\t\t\t\tif (toStr === \"[object Array]\") {\n\t\t\t\t\tstr = '[';\n\t\t\t\t\tmax = val.length - 1;\n\t\t\t\t\tfor(i = 0; i < max; i++) {\n\t\t\t\t\t\tstr += stringify(val[i], true) + ',';\n\t\t\t\t\t}\n\t\t\t\t\tif (max > -1) {\n\t\t\t\t\t\tstr += stringify(val[i], true);\n\t\t\t\t\t}\n\t\t\t\t\treturn str + ']';\n\t\t\t\t} else if (toStr === \"[object Object]\") {\n\t\t\t\t\t// only object is left\n\t\t\t\t\tkeys = objKeys(val).sort();\n\t\t\t\t\tmax = keys.length;\n\t\t\t\t\tstr = \"\";\n\t\t\t\t\ti = 0;\n\t\t\t\t\twhile (i < max) {\n\t\t\t\t\t\tkey = keys[i];\n\t\t\t\t\t\tpropVal = stringify(val[key], false);\n\t\t\t\t\t\tif (propVal !== undefined) {\n\t\t\t\t\t\t\tif (str) {\n\t\t\t\t\t\t\t\tstr += ',';\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\tstr += JSON.stringify(key) + ':' + propVal;\n\t\t\t\t\t\t}\n\t\t\t\t\t\ti++;\n\t\t\t\t\t}\n\t\t\t\t\treturn '{' + str + '}';\n\t\t\t\t} else {\n\t\t\t\t\treturn JSON.stringify(val);\n\t\t\t\t}\n\t\t\t}\n\t\tcase \"function\":\n\t\tcase \"undefined\":\n\t\t\treturn isArrayProp ? null : undefined;\n\t\tcase \"string\":\n\t\t\treturn JSON.stringify(val);\n\t\tdefault:\n\t\t\treturn isFinite(val) ? val : null;\n\t}\n}\n\nvar fastStableStringify = function(val) {\n\tvar returnVal = stringify(val, false);\n\tif (returnVal !== undefined) {\n\t\treturn ''+ returnVal;\n\t}\n};\n\nvar fastStableStringify$1 = /*@__PURE__*/getDefaultExportFromCjs(fastStableStringify);\n\nconst MINIMUM_SLOT_PER_EPOCH = 32;\n\n// Returns the number of trailing zeros in the binary representation of self.\nfunction trailingZeros(n) {\n let trailingZeros = 0;\n while (n > 1) {\n n /= 2;\n trailingZeros++;\n }\n return trailingZeros;\n}\n\n// Returns the smallest power of two greater than or equal to n\nfunction nextPowerOfTwo(n) {\n if (n === 0) return 1;\n n--;\n n |= n >> 1;\n n |= n >> 2;\n n |= n >> 4;\n n |= n >> 8;\n n |= n >> 16;\n n |= n >> 32;\n return n + 1;\n}\n\n/**\n * Epoch schedule\n * (see https://docs.solana.com/terminology#epoch)\n * Can be retrieved with the {@link Connection.getEpochSchedule} method\n */\nclass EpochSchedule {\n constructor(slotsPerEpoch, leaderScheduleSlotOffset, warmup, firstNormalEpoch, firstNormalSlot) {\n /** The maximum number of slots in each epoch */\n this.slotsPerEpoch = void 0;\n /** The number of slots before beginning of an epoch to calculate a leader schedule for that epoch */\n this.leaderScheduleSlotOffset = void 0;\n /** Indicates whether epochs start short and grow */\n this.warmup = void 0;\n /** The first epoch with `slotsPerEpoch` slots */\n this.firstNormalEpoch = void 0;\n /** The first slot of `firstNormalEpoch` */\n this.firstNormalSlot = void 0;\n this.slotsPerEpoch = slotsPerEpoch;\n this.leaderScheduleSlotOffset = leaderScheduleSlotOffset;\n this.warmup = warmup;\n this.firstNormalEpoch = firstNormalEpoch;\n this.firstNormalSlot = firstNormalSlot;\n }\n getEpoch(slot) {\n return this.getEpochAndSlotIndex(slot)[0];\n }\n getEpochAndSlotIndex(slot) {\n if (slot < this.firstNormalSlot) {\n const epoch = trailingZeros(nextPowerOfTwo(slot + MINIMUM_SLOT_PER_EPOCH + 1)) - trailingZeros(MINIMUM_SLOT_PER_EPOCH) - 1;\n const epochLen = this.getSlotsInEpoch(epoch);\n const slotIndex = slot - (epochLen - MINIMUM_SLOT_PER_EPOCH);\n return [epoch, slotIndex];\n } else {\n const normalSlotIndex = slot - this.firstNormalSlot;\n const normalEpochIndex = Math.floor(normalSlotIndex / this.slotsPerEpoch);\n const epoch = this.firstNormalEpoch + normalEpochIndex;\n const slotIndex = normalSlotIndex % this.slotsPerEpoch;\n return [epoch, slotIndex];\n }\n }\n getFirstSlotInEpoch(epoch) {\n if (epoch <= this.firstNormalEpoch) {\n return (Math.pow(2, epoch) - 1) * MINIMUM_SLOT_PER_EPOCH;\n } else {\n return (epoch - this.firstNormalEpoch) * this.slotsPerEpoch + this.firstNormalSlot;\n }\n }\n getLastSlotInEpoch(epoch) {\n return this.getFirstSlotInEpoch(epoch) + this.getSlotsInEpoch(epoch) - 1;\n }\n getSlotsInEpoch(epoch) {\n if (epoch < this.firstNormalEpoch) {\n return Math.pow(2, epoch + trailingZeros(MINIMUM_SLOT_PER_EPOCH));\n } else {\n return this.slotsPerEpoch;\n }\n }\n}\n\nclass SendTransactionError extends Error {\n constructor(message, logs) {\n super(message);\n this.logs = void 0;\n this.logs = logs;\n }\n}\n\n// Keep in sync with client/src/rpc_custom_errors.rs\n// Typescript `enums` thwart tree-shaking. See https://bargsten.org/jsts/enums/\nconst SolanaJSONRPCErrorCode = {\n JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP: -32001,\n JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE: -32002,\n JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE: -32003,\n JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE: -32004,\n JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY: -32005,\n JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE: -32006,\n JSON_RPC_SERVER_ERROR_SLOT_SKIPPED: -32007,\n JSON_RPC_SERVER_ERROR_NO_SNAPSHOT: -32008,\n JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED: -32009,\n JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX: -32010,\n JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE: -32011,\n JSON_RPC_SCAN_ERROR: -32012,\n JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH: -32013,\n JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET: -32014,\n JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION: -32015,\n JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED: -32016\n};\nclass SolanaJSONRPCError extends Error {\n constructor({\n code,\n message,\n data\n }, customMessage) {\n super(customMessage != null ? `${customMessage}: ${message}` : message);\n this.code = void 0;\n this.data = void 0;\n this.code = code;\n this.data = data;\n this.name = 'SolanaJSONRPCError';\n }\n}\n\nvar fetchImpl = globalThis.fetch;\n\nclass RpcWebSocketClient extends rpc_websockets_dist_lib_client__WEBPACK_IMPORTED_MODULE_7__[\"default\"] {\n constructor(address, options, generate_request_id) {\n const webSocketFactory = url => {\n const rpc = (0,rpc_websockets_dist_lib_client_websocket_browser__WEBPACK_IMPORTED_MODULE_8__[\"default\"])(url, {\n autoconnect: true,\n max_reconnects: 5,\n reconnect: true,\n reconnect_interval: 1000,\n ...options\n });\n if ('socket' in rpc) {\n this.underlyingSocket = rpc.socket;\n } else {\n this.underlyingSocket = rpc;\n }\n return rpc;\n };\n super(webSocketFactory, address, options, generate_request_id);\n this.underlyingSocket = void 0;\n }\n call(...args) {\n const readyState = this.underlyingSocket?.readyState;\n if (readyState === 1 /* WebSocket.OPEN */) {\n return super.call(...args);\n }\n return Promise.reject(new Error('Tried to call a JSON-RPC method `' + args[0] + '` but the socket was not `CONNECTING` or `OPEN` (`readyState` was ' + readyState + ')'));\n }\n notify(...args) {\n const readyState = this.underlyingSocket?.readyState;\n if (readyState === 1 /* WebSocket.OPEN */) {\n return super.notify(...args);\n }\n return Promise.reject(new Error('Tried to send a JSON-RPC notification `' + args[0] + '` but the socket was not `CONNECTING` or `OPEN` (`readyState` was ' + readyState + ')'));\n }\n}\n\n/**\n * @internal\n */\n\n/**\n * Decode account data buffer using an AccountType\n * @internal\n */\nfunction decodeData(type, data) {\n let decoded;\n try {\n decoded = type.layout.decode(data);\n } catch (err) {\n throw new Error('invalid instruction; ' + err);\n }\n if (decoded.typeIndex !== type.index) {\n throw new Error(`invalid account data; account type mismatch ${decoded.typeIndex} != ${type.index}`);\n }\n return decoded;\n}\n\n/// The serialized size of lookup table metadata\nconst LOOKUP_TABLE_META_SIZE = 56;\nclass AddressLookupTableAccount {\n constructor(args) {\n this.key = void 0;\n this.state = void 0;\n this.key = args.key;\n this.state = args.state;\n }\n isActive() {\n const U64_MAX = BigInt('0xffffffffffffffff');\n return this.state.deactivationSlot === U64_MAX;\n }\n static deserialize(accountData) {\n const meta = decodeData(LookupTableMetaLayout, accountData);\n const serializedAddressesLen = accountData.length - LOOKUP_TABLE_META_SIZE;\n assert(serializedAddressesLen >= 0, 'lookup table is invalid');\n assert(serializedAddressesLen % 32 === 0, 'lookup table is invalid');\n const numSerializedAddresses = serializedAddressesLen / 32;\n const {\n addresses\n } = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(publicKey(), numSerializedAddresses, 'addresses')]).decode(accountData.slice(LOOKUP_TABLE_META_SIZE));\n return {\n deactivationSlot: meta.deactivationSlot,\n lastExtendedSlot: meta.lastExtendedSlot,\n lastExtendedSlotStartIndex: meta.lastExtendedStartIndex,\n authority: meta.authority.length !== 0 ? new PublicKey(meta.authority[0]) : undefined,\n addresses: addresses.map(address => new PublicKey(address))\n };\n }\n}\nconst LookupTableMetaLayout = {\n index: 1,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('typeIndex'), u64('deactivationSlot'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('lastExtendedSlot'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('lastExtendedStartIndex'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8(),\n // option\n _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(publicKey(), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.offset(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8(), -1), 'authority')])\n};\n\nconst URL_RE = /^[^:]+:\\/\\/([^:[]+|\\[[^\\]]+\\])(:\\d+)?(.*)/i;\nfunction makeWebsocketUrl(endpoint) {\n const matches = endpoint.match(URL_RE);\n if (matches == null) {\n throw TypeError(`Failed to validate endpoint URL \\`${endpoint}\\``);\n }\n const [_,\n // eslint-disable-line @typescript-eslint/no-unused-vars\n hostish, portWithColon, rest] = matches;\n const protocol = endpoint.startsWith('https:') ? 'wss:' : 'ws:';\n const startPort = portWithColon == null ? null : parseInt(portWithColon.slice(1), 10);\n const websocketPort =\n // Only shift the port by +1 as a convention for ws(s) only if given endpoint\n // is explicitly specifying the endpoint port (HTTP-based RPC), assuming\n // we're directly trying to connect to solana-validator's ws listening port.\n // When the endpoint omits the port, we're connecting to the protocol\n // default ports: http(80) or https(443) and it's assumed we're behind a reverse\n // proxy which manages WebSocket upgrade and backend port redirection.\n startPort == null ? '' : `:${startPort + 1}`;\n return `${protocol}//${hostish}${websocketPort}${rest}`;\n}\n\nconst PublicKeyFromString = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .coerce */ .oQ)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .instance */ .eE)(PublicKey), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(), value => new PublicKey(value));\nconst RawAccountDataResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .tuple */ .bc)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('base64')]);\nconst BufferFromRawAccountData = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .coerce */ .oQ)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .instance */ .eE)(buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer), RawAccountDataResult, value => buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(value[0], 'base64'));\n\n/**\n * Attempt to use a recent blockhash for up to 30 seconds\n * @internal\n */\nconst BLOCKHASH_CACHE_TIMEOUT_MS = 30 * 1000;\n\n/**\n * HACK.\n * Copied from rpc-websockets/dist/lib/client.\n * Otherwise, `yarn build` fails with:\n * https://gist.github.com/steveluscher/c057eca81d479ef705cdb53162f9971d\n */\n\n/** @internal */\n/** @internal */\n/** @internal */\n/** @internal */\n\n/** @internal */\n/**\n * @internal\n * Every subscription contains the args used to open the subscription with\n * the server, and a list of callers interested in notifications.\n */\n\n/**\n * @internal\n * A subscription may be in various states of connectedness. Only when it is\n * fully connected will it have a server subscription id associated with it.\n * This id can be returned to the server to unsubscribe the client entirely.\n */\n\n/**\n * A type that encapsulates a subscription's RPC method\n * names and notification (callback) signature.\n */\n\n/**\n * @internal\n * Utility type that keeps tagged unions intact while omitting properties.\n */\n\n/**\n * @internal\n * This type represents a single subscribable 'topic.' It's made up of:\n *\n * - The args used to open the subscription with the server,\n * - The state of the subscription, in terms of its connectedness, and\n * - The set of callbacks to call when the server publishes notifications\n *\n * This record gets indexed by `SubscriptionConfigHash` and is used to\n * set up subscriptions, fan out notifications, and track subscription state.\n */\n\n/**\n * @internal\n */\n\n/**\n * Extra contextual information for RPC responses\n */\n\n/**\n * Options for sending transactions\n */\n\n/**\n * Options for confirming transactions\n */\n\n/**\n * Options for getConfirmedSignaturesForAddress2\n */\n\n/**\n * Options for getSignaturesForAddress\n */\n\n/**\n * RPC Response with extra contextual information\n */\n\n/**\n * A strategy for confirming transactions that uses the last valid\n * block height for a given blockhash to check for transaction expiration.\n */\n\n/**\n * A strategy for confirming durable nonce transactions.\n */\n\n/**\n * Properties shared by all transaction confirmation strategies\n */\n\n/**\n * This type represents all transaction confirmation strategies\n */\n\n/* @internal */\nfunction assertEndpointUrl(putativeUrl) {\n if (/^https?:/.test(putativeUrl) === false) {\n throw new TypeError('Endpoint URL must start with `http:` or `https:`.');\n }\n return putativeUrl;\n}\n\n/** @internal */\nfunction extractCommitmentFromConfig(commitmentOrConfig) {\n let commitment;\n let config;\n if (typeof commitmentOrConfig === 'string') {\n commitment = commitmentOrConfig;\n } else if (commitmentOrConfig) {\n const {\n commitment: specifiedCommitment,\n ...specifiedConfig\n } = commitmentOrConfig;\n commitment = specifiedCommitment;\n config = specifiedConfig;\n }\n return {\n commitment,\n config\n };\n}\n\n/**\n * @internal\n */\nfunction createRpcResult(result) {\n return (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n jsonrpc: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('2.0'),\n id: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n result\n }), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n jsonrpc: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('2.0'),\n id: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n error: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n code: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .unknown */ ._4)(),\n message: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n data: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .any */ .Yj)())\n })\n })]);\n}\nconst UnknownRpcResult = createRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .unknown */ ._4)());\n\n/**\n * @internal\n */\nfunction jsonRpcResult(schema) {\n return (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .coerce */ .oQ)(createRpcResult(schema), UnknownRpcResult, value => {\n if ('error' in value) {\n return value;\n } else {\n return {\n ...value,\n result: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(value.result, schema)\n };\n }\n });\n}\n\n/**\n * @internal\n */\nfunction jsonRpcResultAndContext(value) {\n return jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n context: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n }),\n value\n }));\n}\n\n/**\n * @internal\n */\nfunction notificationResultAndContext(value) {\n return (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n context: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n }),\n value\n });\n}\n\n/**\n * @internal\n */\nfunction versionedMessageFromResponse(version, response) {\n if (version === 0) {\n return new MessageV0({\n header: response.header,\n staticAccountKeys: response.accountKeys.map(accountKey => new PublicKey(accountKey)),\n recentBlockhash: response.recentBlockhash,\n compiledInstructions: response.instructions.map(ix => ({\n programIdIndex: ix.programIdIndex,\n accountKeyIndexes: ix.accounts,\n data: bs58__WEBPACK_IMPORTED_MODULE_2___default().decode(ix.data)\n })),\n addressTableLookups: response.addressTableLookups\n });\n } else {\n return new Message(response);\n }\n}\n\n/**\n * The level of commitment desired when querying state\n *
\n *   'processed': Query the most recent block which has reached 1 confirmation by the connected node\n *   'confirmed': Query the most recent block which has reached 1 confirmation by the cluster\n *   'finalized': Query the most recent block which has been finalized by the cluster\n * 
\n */\n\n// Deprecated as of v1.5.5\n\n/**\n * A subset of Commitment levels, which are at least optimistically confirmed\n *
\n *   'confirmed': Query the most recent block which has reached 1 confirmation by the cluster\n *   'finalized': Query the most recent block which has been finalized by the cluster\n * 
\n */\n\n/**\n * Filter for largest accounts query\n *
\n *   'circulating':    Return the largest accounts that are part of the circulating supply\n *   'nonCirculating': Return the largest accounts that are not part of the circulating supply\n * 
\n */\n\n/**\n * Configuration object for changing `getAccountInfo` query behavior\n */\n\n/**\n * Configuration object for changing `getBalance` query behavior\n */\n\n/**\n * Configuration object for changing `getBlock` query behavior\n */\n\n/**\n * Configuration object for changing `getBlock` query behavior\n */\n\n/**\n * Configuration object for changing `getStakeMinimumDelegation` query behavior\n */\n\n/**\n * Configuration object for changing `getBlockHeight` query behavior\n */\n\n/**\n * Configuration object for changing `getEpochInfo` query behavior\n */\n\n/**\n * Configuration object for changing `getInflationReward` query behavior\n */\n\n/**\n * Configuration object for changing `getLatestBlockhash` query behavior\n */\n\n/**\n * Configuration object for changing `isBlockhashValid` query behavior\n */\n\n/**\n * Configuration object for changing `getSlot` query behavior\n */\n\n/**\n * Configuration object for changing `getSlotLeader` query behavior\n */\n\n/**\n * Configuration object for changing `getTransaction` query behavior\n */\n\n/**\n * Configuration object for changing `getTransaction` query behavior\n */\n\n/**\n * Configuration object for changing `getLargestAccounts` query behavior\n */\n\n/**\n * Configuration object for changing `getSupply` request behavior\n */\n\n/**\n * Configuration object for changing query behavior\n */\n\n/**\n * Information describing a cluster node\n */\n\n/**\n * Information describing a vote account\n */\n\n/**\n * A collection of cluster vote accounts\n */\n\n/**\n * Network Inflation\n * (see https://docs.solana.com/implemented-proposals/ed_overview)\n */\n\nconst GetInflationGovernorResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n foundation: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n foundationTerm: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n initial: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n taper: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n terminal: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\n\n/**\n * The inflation reward for an epoch\n */\n\n/**\n * Expected JSON RPC response for the \"getInflationReward\" message\n */\nconst GetInflationRewardResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n epoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n effectiveSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n amount: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n postBalance: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n commission: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()))\n}))));\n\n/**\n * Configuration object for changing `getRecentPrioritizationFees` query behavior\n */\n\n/**\n * Expected JSON RPC response for the \"getRecentPrioritizationFees\" message\n */\nconst GetRecentPrioritizationFeesResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n prioritizationFee: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n}));\n/**\n * Expected JSON RPC response for the \"getInflationRate\" message\n */\nconst GetInflationRateResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n total: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n validator: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n foundation: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n epoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\n\n/**\n * Information about the current epoch\n */\n\nconst GetEpochInfoResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n epoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n slotIndex: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n slotsInEpoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n absoluteSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n blockHeight: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n transactionCount: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n});\nconst GetEpochScheduleResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n slotsPerEpoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n leaderScheduleSlotOffset: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n warmup: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .boolean */ .O7)(),\n firstNormalEpoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n firstNormalSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\n\n/**\n * Leader schedule\n * (see https://docs.solana.com/terminology#leader-schedule)\n */\n\nconst GetLeaderScheduleResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .record */ .IM)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()));\n\n/**\n * Transaction error or null\n */\nconst TransactionErrorResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({}), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()]));\n\n/**\n * Signature status for a transaction\n */\nconst SignatureStatusResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n err: TransactionErrorResult\n});\n\n/**\n * Transaction signature received notification\n */\nconst SignatureReceivedResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('receivedSignature');\n\n/**\n * Version info for a node\n */\n\nconst VersionResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n 'solana-core': (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n 'feature-set': (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n});\nconst SimulatedTransactionResponseStruct = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n err: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({}), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()])),\n logs: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)())),\n accounts: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n executable: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .boolean */ .O7)(),\n owner: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n lamports: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n data: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n rentEpoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n }))))),\n unitsConsumed: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n returnData: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n programId: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n data: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .tuple */ .bc)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('base64')])\n })))\n}));\n\n/**\n * Metadata for a parsed confirmed transaction on the ledger\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionMeta} instead.\n */\n\n/**\n * Collection of addresses loaded by a transaction using address table lookups\n */\n\n/**\n * Metadata for a parsed transaction on the ledger\n */\n\n/**\n * Metadata for a confirmed transaction on the ledger\n */\n\n/**\n * A processed transaction from the RPC API\n */\n\n/**\n * A processed transaction from the RPC API\n */\n\n/**\n * A processed transaction message from the RPC API\n */\n\n/**\n * A confirmed transaction on the ledger\n *\n * @deprecated Deprecated since Solana v1.8.0.\n */\n\n/**\n * A partially decoded transaction instruction\n */\n\n/**\n * A parsed transaction message account\n */\n\n/**\n * A parsed transaction instruction\n */\n\n/**\n * A parsed address table lookup\n */\n\n/**\n * A parsed transaction message\n */\n\n/**\n * A parsed transaction\n */\n\n/**\n * A parsed and confirmed transaction on the ledger\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link ParsedTransactionWithMeta} instead.\n */\n\n/**\n * A parsed transaction on the ledger with meta\n */\n\n/**\n * A processed block fetched from the RPC API\n */\n\n/**\n * A processed block fetched from the RPC API where the `transactionDetails` mode is `accounts`\n */\n\n/**\n * A processed block fetched from the RPC API where the `transactionDetails` mode is `none`\n */\n\n/**\n * A block with parsed transactions\n */\n\n/**\n * A block with parsed transactions where the `transactionDetails` mode is `accounts`\n */\n\n/**\n * A block with parsed transactions where the `transactionDetails` mode is `none`\n */\n\n/**\n * A processed block fetched from the RPC API\n */\n\n/**\n * A processed block fetched from the RPC API where the `transactionDetails` mode is `accounts`\n */\n\n/**\n * A processed block fetched from the RPC API where the `transactionDetails` mode is `none`\n */\n\n/**\n * A confirmed block on the ledger\n *\n * @deprecated Deprecated since Solana v1.8.0.\n */\n\n/**\n * A Block on the ledger with signatures only\n */\n\n/**\n * recent block production information\n */\n\n/**\n * Expected JSON RPC response for the \"getBlockProduction\" message\n */\nconst BlockProductionResponseStruct = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n byIdentity: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .record */ .IM)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())),\n range: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n firstSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n lastSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n })\n}));\n\n/**\n * A performance sample\n */\n\nfunction createRpcClient(url, httpHeaders, customFetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent) {\n const fetch = customFetch ? customFetch : fetchImpl;\n let agent;\n {\n if (httpAgent != null) {\n console.warn('You have supplied an `httpAgent` when creating a `Connection` in a browser environment.' + 'It has been ignored; `httpAgent` is only used in Node environments.');\n }\n }\n let fetchWithMiddleware;\n if (fetchMiddleware) {\n fetchWithMiddleware = async (info, init) => {\n const modifiedFetchArgs = await new Promise((resolve, reject) => {\n try {\n fetchMiddleware(info, init, (modifiedInfo, modifiedInit) => resolve([modifiedInfo, modifiedInit]));\n } catch (error) {\n reject(error);\n }\n });\n return await fetch(...modifiedFetchArgs);\n };\n }\n const clientBrowser = new (jayson_lib_client_browser__WEBPACK_IMPORTED_MODULE_6___default())(async (request, callback) => {\n const options = {\n method: 'POST',\n body: request,\n agent,\n headers: Object.assign({\n 'Content-Type': 'application/json'\n }, httpHeaders || {}, COMMON_HTTP_HEADERS)\n };\n try {\n let too_many_requests_retries = 5;\n let res;\n let waitTime = 500;\n for (;;) {\n if (fetchWithMiddleware) {\n res = await fetchWithMiddleware(url, options);\n } else {\n res = await fetch(url, options);\n }\n if (res.status !== 429 /* Too many requests */) {\n break;\n }\n if (disableRetryOnRateLimit === true) {\n break;\n }\n too_many_requests_retries -= 1;\n if (too_many_requests_retries === 0) {\n break;\n }\n console.error(`Server responded with ${res.status} ${res.statusText}. Retrying after ${waitTime}ms delay...`);\n await sleep(waitTime);\n waitTime *= 2;\n }\n const text = await res.text();\n if (res.ok) {\n callback(null, text);\n } else {\n callback(new Error(`${res.status} ${res.statusText}: ${text}`));\n }\n } catch (err) {\n if (err instanceof Error) callback(err);\n }\n }, {});\n return clientBrowser;\n}\nfunction createRpcRequest(client) {\n return (method, args) => {\n return new Promise((resolve, reject) => {\n client.request(method, args, (err, response) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(response);\n });\n });\n };\n}\nfunction createRpcBatchRequest(client) {\n return requests => {\n return new Promise((resolve, reject) => {\n // Do nothing if requests is empty\n if (requests.length === 0) resolve([]);\n const batch = requests.map(params => {\n return client.request(params.methodName, params.args);\n });\n client.request(batch, (err, response) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(response);\n });\n });\n };\n}\n\n/**\n * Expected JSON RPC response for the \"getInflationGovernor\" message\n */\nconst GetInflationGovernorRpcResult = jsonRpcResult(GetInflationGovernorResult);\n\n/**\n * Expected JSON RPC response for the \"getInflationRate\" message\n */\nconst GetInflationRateRpcResult = jsonRpcResult(GetInflationRateResult);\n\n/**\n * Expected JSON RPC response for the \"getRecentPrioritizationFees\" message\n */\nconst GetRecentPrioritizationFeesRpcResult = jsonRpcResult(GetRecentPrioritizationFeesResult);\n\n/**\n * Expected JSON RPC response for the \"getEpochInfo\" message\n */\nconst GetEpochInfoRpcResult = jsonRpcResult(GetEpochInfoResult);\n\n/**\n * Expected JSON RPC response for the \"getEpochSchedule\" message\n */\nconst GetEpochScheduleRpcResult = jsonRpcResult(GetEpochScheduleResult);\n\n/**\n * Expected JSON RPC response for the \"getLeaderSchedule\" message\n */\nconst GetLeaderScheduleRpcResult = jsonRpcResult(GetLeaderScheduleResult);\n\n/**\n * Expected JSON RPC response for the \"minimumLedgerSlot\" and \"getFirstAvailableBlock\" messages\n */\nconst SlotRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)());\n\n/**\n * Supply\n */\n\n/**\n * Expected JSON RPC response for the \"getSupply\" message\n */\nconst GetSupplyRpcResult = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n total: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n circulating: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n nonCirculating: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n nonCirculatingAccounts: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(PublicKeyFromString)\n}));\n\n/**\n * Token amount object which returns a token amount in different formats\n * for various client use cases.\n */\n\n/**\n * Expected JSON RPC structure for token amounts\n */\nconst TokenAmountResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n amount: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n uiAmount: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n decimals: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n uiAmountString: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)())\n});\n\n/**\n * Token address and balance.\n */\n\n/**\n * Expected JSON RPC response for the \"getTokenLargestAccounts\" message\n */\nconst GetTokenLargestAccountsResult = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n address: PublicKeyFromString,\n amount: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n uiAmount: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n decimals: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n uiAmountString: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)())\n})));\n\n/**\n * Expected JSON RPC response for the \"getTokenAccountsByOwner\" message\n */\nconst GetTokenAccountsByOwner = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n pubkey: PublicKeyFromString,\n account: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n executable: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .boolean */ .O7)(),\n owner: PublicKeyFromString,\n lamports: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n data: BufferFromRawAccountData,\n rentEpoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n })\n})));\nconst ParsedAccountDataResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n program: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n parsed: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .unknown */ ._4)(),\n space: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\n\n/**\n * Expected JSON RPC response for the \"getTokenAccountsByOwner\" message with parsed data\n */\nconst GetParsedTokenAccountsByOwner = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n pubkey: PublicKeyFromString,\n account: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n executable: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .boolean */ .O7)(),\n owner: PublicKeyFromString,\n lamports: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n data: ParsedAccountDataResult,\n rentEpoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n })\n})));\n\n/**\n * Pair of an account address and its balance\n */\n\n/**\n * Expected JSON RPC response for the \"getLargestAccounts\" message\n */\nconst GetLargestAccountsRpcResult = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n lamports: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n address: PublicKeyFromString\n})));\n\n/**\n * @internal\n */\nconst AccountInfoResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n executable: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .boolean */ .O7)(),\n owner: PublicKeyFromString,\n lamports: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n data: BufferFromRawAccountData,\n rentEpoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\n\n/**\n * @internal\n */\nconst KeyedAccountInfoResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n pubkey: PublicKeyFromString,\n account: AccountInfoResult\n});\nconst ParsedOrRawAccountData = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .coerce */ .oQ)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .instance */ .eE)(buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer), ParsedAccountDataResult]), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([RawAccountDataResult, ParsedAccountDataResult]), value => {\n if (Array.isArray(value)) {\n return (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(value, BufferFromRawAccountData);\n } else {\n return value;\n }\n});\n\n/**\n * @internal\n */\nconst ParsedAccountInfoResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n executable: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .boolean */ .O7)(),\n owner: PublicKeyFromString,\n lamports: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n data: ParsedOrRawAccountData,\n rentEpoch: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\nconst KeyedParsedAccountInfoResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n pubkey: PublicKeyFromString,\n account: ParsedAccountInfoResult\n});\n\n/**\n * @internal\n */\nconst StakeActivationResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n state: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('active'), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('inactive'), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('activating'), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('deactivating')]),\n active: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n inactive: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\n\n/**\n * Expected JSON RPC response for the \"getConfirmedSignaturesForAddress2\" message\n */\n\nconst GetConfirmedSignaturesForAddress2RpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n signature: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n err: TransactionErrorResult,\n memo: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()))\n})));\n\n/**\n * Expected JSON RPC response for the \"getSignaturesForAddress\" message\n */\nconst GetSignaturesForAddressRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n signature: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n err: TransactionErrorResult,\n memo: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()))\n})));\n\n/***\n * Expected JSON RPC response for the \"accountNotification\" message\n */\nconst AccountNotificationResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n subscription: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n result: notificationResultAndContext(AccountInfoResult)\n});\n\n/**\n * @internal\n */\nconst ProgramAccountInfoResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n pubkey: PublicKeyFromString,\n account: AccountInfoResult\n});\n\n/***\n * Expected JSON RPC response for the \"programNotification\" message\n */\nconst ProgramAccountNotificationResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n subscription: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n result: notificationResultAndContext(ProgramAccountInfoResult)\n});\n\n/**\n * @internal\n */\nconst SlotInfoResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n parent: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n root: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\n\n/**\n * Expected JSON RPC response for the \"slotNotification\" message\n */\nconst SlotNotificationResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n subscription: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n result: SlotInfoResult\n});\n\n/**\n * Slot updates which can be used for tracking the live progress of a cluster.\n * - `\"firstShredReceived\"`: connected node received the first shred of a block.\n * Indicates that a new block that is being produced.\n * - `\"completed\"`: connected node has received all shreds of a block. Indicates\n * a block was recently produced.\n * - `\"optimisticConfirmation\"`: block was optimistically confirmed by the\n * cluster. It is not guaranteed that an optimistic confirmation notification\n * will be sent for every finalized blocks.\n * - `\"root\"`: the connected node rooted this block.\n * - `\"createdBank\"`: the connected node has started validating this block.\n * - `\"frozen\"`: the connected node has validated this block.\n * - `\"dead\"`: the connected node failed to validate this block.\n */\n\n/**\n * @internal\n */\nconst SlotUpdateResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n type: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('firstShredReceived'), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('completed'), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('optimisticConfirmation'), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('root')]),\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n timestamp: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n}), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n type: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('createdBank'),\n parent: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n timestamp: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n}), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n type: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('frozen'),\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n timestamp: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n stats: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n numTransactionEntries: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n numSuccessfulTransactions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n numFailedTransactions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n maxTransactionsPerEntry: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n })\n}), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n type: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('dead'),\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n timestamp: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n err: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()\n})]);\n\n/**\n * Expected JSON RPC response for the \"slotsUpdatesNotification\" message\n */\nconst SlotUpdateNotificationResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n subscription: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n result: SlotUpdateResult\n});\n\n/**\n * Expected JSON RPC response for the \"signatureNotification\" message\n */\nconst SignatureNotificationResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n subscription: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n result: notificationResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([SignatureStatusResult, SignatureReceivedResult]))\n});\n\n/**\n * Expected JSON RPC response for the \"rootNotification\" message\n */\nconst RootNotificationResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n subscription: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n result: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\nconst ContactInfoResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n pubkey: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n gossip: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n tpu: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n rpc: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n version: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)())\n});\nconst VoteAccountInfoResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n votePubkey: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n nodePubkey: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n activatedStake: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n epochVoteAccount: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .boolean */ .O7)(),\n epochCredits: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .tuple */ .bc)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()])),\n commission: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n lastVote: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n rootSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n});\n\n/**\n * Expected JSON RPC response for the \"getVoteAccounts\" message\n */\nconst GetVoteAccounts = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n current: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(VoteAccountInfoResult),\n delinquent: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(VoteAccountInfoResult)\n}));\nconst ConfirmationStatus = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('processed'), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('confirmed'), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('finalized')]);\nconst SignatureStatusResponse = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n confirmations: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n err: TransactionErrorResult,\n confirmationStatus: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)(ConfirmationStatus)\n});\n\n/**\n * Expected JSON RPC response for the \"getSignatureStatuses\" message\n */\nconst GetSignatureStatusesRpcResult = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(SignatureStatusResponse)));\n\n/**\n * Expected JSON RPC response for the \"getMinimumBalanceForRentExemption\" message\n */\nconst GetMinimumBalanceForRentExemptionRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)());\nconst AddressTableLookupStruct = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n accountKey: PublicKeyFromString,\n writableIndexes: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n readonlyIndexes: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n});\nconst ConfirmedTransactionResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n signatures: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n message: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n accountKeys: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n header: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n numRequiredSignatures: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n numReadonlySignedAccounts: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n numReadonlyUnsignedAccounts: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n }),\n instructions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n accounts: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n data: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n programIdIndex: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n })),\n recentBlockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n addressTableLookups: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(AddressTableLookupStruct))\n })\n});\nconst AnnotatedAccountKey = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n pubkey: PublicKeyFromString,\n signer: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .boolean */ .O7)(),\n writable: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .boolean */ .O7)(),\n source: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('transaction'), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('lookupTable')]))\n});\nconst ConfirmedTransactionAccountsModeResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n accountKeys: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(AnnotatedAccountKey),\n signatures: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)())\n});\nconst ParsedInstructionResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n parsed: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .unknown */ ._4)(),\n program: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n programId: PublicKeyFromString\n});\nconst RawInstructionResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n accounts: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(PublicKeyFromString),\n data: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n programId: PublicKeyFromString\n});\nconst InstructionResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([RawInstructionResult, ParsedInstructionResult]);\nconst UnknownInstructionResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n parsed: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .unknown */ ._4)(),\n program: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n programId: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()\n}), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n accounts: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n data: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n programId: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()\n})]);\nconst ParsedOrRawInstruction = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .coerce */ .oQ)(InstructionResult, UnknownInstructionResult, value => {\n if ('accounts' in value) {\n return (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(value, RawInstructionResult);\n } else {\n return (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(value, ParsedInstructionResult);\n }\n});\n\n/**\n * @internal\n */\nconst ParsedConfirmedTransactionResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n signatures: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n message: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n accountKeys: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(AnnotatedAccountKey),\n instructions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(ParsedOrRawInstruction),\n recentBlockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n addressTableLookups: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(AddressTableLookupStruct)))\n })\n});\nconst TokenBalanceResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n accountIndex: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n mint: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n owner: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n uiTokenAmount: TokenAmountResult\n});\nconst LoadedAddressesResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n writable: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(PublicKeyFromString),\n readonly: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(PublicKeyFromString)\n});\n\n/**\n * @internal\n */\nconst ConfirmedTransactionMetaResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n err: TransactionErrorResult,\n fee: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n innerInstructions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n index: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n instructions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n accounts: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n data: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n programIdIndex: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n }))\n })))),\n preBalances: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n postBalances: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n logMessages: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()))),\n preTokenBalances: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(TokenBalanceResult))),\n postTokenBalances: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(TokenBalanceResult))),\n loadedAddresses: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)(LoadedAddressesResult),\n computeUnitsConsumed: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n});\n\n/**\n * @internal\n */\nconst ParsedConfirmedTransactionMetaResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n err: TransactionErrorResult,\n fee: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n innerInstructions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n index: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n instructions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(ParsedOrRawInstruction)\n })))),\n preBalances: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n postBalances: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n logMessages: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()))),\n preTokenBalances: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(TokenBalanceResult))),\n postTokenBalances: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(TokenBalanceResult))),\n loadedAddresses: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)(LoadedAddressesResult),\n computeUnitsConsumed: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n});\nconst TransactionVersionStruct = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .union */ .G0)([(0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)(0), (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .literal */ .i0)('legacy')]);\n\n/** @internal */\nconst RewardsResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n pubkey: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n lamports: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n postBalance: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n rewardType: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n commission: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()))\n});\n\n/**\n * Expected JSON RPC response for the \"getBlock\" message\n */\nconst GetBlockRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n blockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n previousBlockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n parentSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n transactions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n transaction: ConfirmedTransactionResult,\n meta: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(ConfirmedTransactionMetaResult),\n version: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)(TransactionVersionStruct)\n })),\n rewards: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(RewardsResult)),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n blockHeight: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n})));\n\n/**\n * Expected JSON RPC response for the \"getBlock\" message when `transactionDetails` is `none`\n */\nconst GetNoneModeBlockRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n blockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n previousBlockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n parentSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n rewards: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(RewardsResult)),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n blockHeight: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n})));\n\n/**\n * Expected JSON RPC response for the \"getBlock\" message when `transactionDetails` is `accounts`\n */\nconst GetAccountsModeBlockRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n blockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n previousBlockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n parentSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n transactions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n transaction: ConfirmedTransactionAccountsModeResult,\n meta: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(ConfirmedTransactionMetaResult),\n version: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)(TransactionVersionStruct)\n })),\n rewards: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(RewardsResult)),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n blockHeight: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n})));\n\n/**\n * Expected parsed JSON RPC response for the \"getBlock\" message\n */\nconst GetParsedBlockRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n blockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n previousBlockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n parentSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n transactions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n transaction: ParsedConfirmedTransactionResult,\n meta: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(ParsedConfirmedTransactionMetaResult),\n version: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)(TransactionVersionStruct)\n })),\n rewards: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(RewardsResult)),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n blockHeight: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n})));\n\n/**\n * Expected parsed JSON RPC response for the \"getBlock\" message when `transactionDetails` is `accounts`\n */\nconst GetParsedAccountsModeBlockRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n blockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n previousBlockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n parentSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n transactions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n transaction: ConfirmedTransactionAccountsModeResult,\n meta: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(ParsedConfirmedTransactionMetaResult),\n version: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)(TransactionVersionStruct)\n })),\n rewards: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(RewardsResult)),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n blockHeight: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n})));\n\n/**\n * Expected parsed JSON RPC response for the \"getBlock\" message when `transactionDetails` is `none`\n */\nconst GetParsedNoneModeBlockRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n blockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n previousBlockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n parentSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n rewards: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(RewardsResult)),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()),\n blockHeight: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n})));\n\n/**\n * Expected JSON RPC response for the \"getConfirmedBlock\" message\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetBlockRpcResult} instead.\n */\nconst GetConfirmedBlockRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n blockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n previousBlockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n parentSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n transactions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n transaction: ConfirmedTransactionResult,\n meta: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(ConfirmedTransactionMetaResult)\n })),\n rewards: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(RewardsResult)),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n})));\n\n/**\n * Expected JSON RPC response for the \"getBlock\" message\n */\nconst GetBlockSignaturesRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n blockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n previousBlockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n parentSlot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n signatures: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())\n})));\n\n/**\n * Expected JSON RPC response for the \"getTransaction\" message\n */\nconst GetTransactionRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n meta: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(ConfirmedTransactionMetaResult),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())),\n transaction: ConfirmedTransactionResult,\n version: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)(TransactionVersionStruct)\n})));\n\n/**\n * Expected parsed JSON RPC response for the \"getTransaction\" message\n */\nconst GetParsedTransactionRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n transaction: ParsedConfirmedTransactionResult,\n meta: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(ParsedConfirmedTransactionMetaResult),\n blockTime: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())),\n version: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)(TransactionVersionStruct)\n})));\n\n/**\n * Expected JSON RPC response for the \"getRecentBlockhash\" message\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link GetLatestBlockhashRpcResult} instead.\n */\nconst GetRecentBlockhashAndContextRpcResult = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n blockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n feeCalculator: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n lamportsPerSignature: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n })\n}));\n\n/**\n * Expected JSON RPC response for the \"getLatestBlockhash\" message\n */\nconst GetLatestBlockhashRpcResult = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n blockhash: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n lastValidBlockHeight: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n}));\n\n/**\n * Expected JSON RPC response for the \"isBlockhashValid\" message\n */\nconst IsBlockhashValidRpcResult = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .boolean */ .O7)());\nconst PerfSampleResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n slot: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n numTransactions: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n numSlots: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)(),\n samplePeriodSecs: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\n\n/*\n * Expected JSON RPC response for \"getRecentPerformanceSamples\" message\n */\nconst GetRecentPerformanceSamplesRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(PerfSampleResult));\n\n/**\n * Expected JSON RPC response for the \"getFeeCalculatorForBlockhash\" message\n */\nconst GetFeeCalculatorRpcResult = jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n feeCalculator: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n lamportsPerSignature: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n })\n})));\n\n/**\n * Expected JSON RPC response for the \"requestAirdrop\" message\n */\nconst RequestAirdropRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)());\n\n/**\n * Expected JSON RPC response for the \"sendTransaction\" message\n */\nconst SendTransactionRpcResult = jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)());\n\n/**\n * Information about the latest slot being processed by a node\n */\n\n/**\n * Parsed account data\n */\n\n/**\n * Stake Activation data\n */\n\n/**\n * Data slice argument for getProgramAccounts\n */\n\n/**\n * Memory comparison filter for getProgramAccounts\n */\n\n/**\n * Data size comparison filter for getProgramAccounts\n */\n\n/**\n * A filter object for getProgramAccounts\n */\n\n/**\n * Configuration object for getProgramAccounts requests\n */\n\n/**\n * Configuration object for getParsedProgramAccounts\n */\n\n/**\n * Configuration object for getMultipleAccounts\n */\n\n/**\n * Configuration object for `getStakeActivation`\n */\n\n/**\n * Configuration object for `getStakeActivation`\n */\n\n/**\n * Configuration object for `getStakeActivation`\n */\n\n/**\n * Configuration object for `getNonce`\n */\n\n/**\n * Configuration object for `getNonceAndContext`\n */\n\n/**\n * Information describing an account\n */\n\n/**\n * Account information identified by pubkey\n */\n\n/**\n * Callback function for account change notifications\n */\n\n/**\n * Callback function for program account change notifications\n */\n\n/**\n * Callback function for slot change notifications\n */\n\n/**\n * Callback function for slot update notifications\n */\n\n/**\n * Callback function for signature status notifications\n */\n\n/**\n * Signature status notification with transaction result\n */\n\n/**\n * Signature received notification\n */\n\n/**\n * Callback function for signature notifications\n */\n\n/**\n * Signature subscription options\n */\n\n/**\n * Callback function for root change notifications\n */\n\n/**\n * @internal\n */\nconst LogsResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n err: TransactionErrorResult,\n logs: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n signature: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()\n});\n\n/**\n * Logs result.\n */\n\n/**\n * Expected JSON RPC response for the \"logsNotification\" message.\n */\nconst LogsNotificationResult = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n result: notificationResultAndContext(LogsResult),\n subscription: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()\n});\n\n/**\n * Filter for log subscriptions.\n */\n\n/**\n * Callback function for log notifications.\n */\n\n/**\n * Signature result\n */\n\n/**\n * Transaction error\n */\n\n/**\n * Transaction confirmation status\n *
\n *   'processed': Transaction landed in a block which has reached 1 confirmation by the connected node\n *   'confirmed': Transaction landed in a block which has reached 1 confirmation by the cluster\n *   'finalized': Transaction landed in a block which has been finalized by the cluster\n * 
\n */\n\n/**\n * Signature status\n */\n\n/**\n * A confirmed signature with its status\n */\n\n/**\n * An object defining headers to be passed to the RPC server\n */\n\n/**\n * The type of the JavaScript `fetch()` API\n */\n\n/**\n * A callback used to augment the outgoing HTTP request\n */\n\n/**\n * Configuration for instantiating a Connection\n */\n\n/** @internal */\nconst COMMON_HTTP_HEADERS = {\n 'solana-client': `js/${\"0.0.0-development\" }`\n};\n\n/**\n * A connection to a fullnode JSON RPC endpoint\n */\nclass Connection {\n /**\n * Establish a JSON RPC connection\n *\n * @param endpoint URL to the fullnode JSON RPC endpoint\n * @param commitmentOrConfig optional default commitment level or optional ConnectionConfig configuration object\n */\n constructor(endpoint, _commitmentOrConfig) {\n /** @internal */\n this._commitment = void 0;\n /** @internal */\n this._confirmTransactionInitialTimeout = void 0;\n /** @internal */\n this._rpcEndpoint = void 0;\n /** @internal */\n this._rpcWsEndpoint = void 0;\n /** @internal */\n this._rpcClient = void 0;\n /** @internal */\n this._rpcRequest = void 0;\n /** @internal */\n this._rpcBatchRequest = void 0;\n /** @internal */\n this._rpcWebSocket = void 0;\n /** @internal */\n this._rpcWebSocketConnected = false;\n /** @internal */\n this._rpcWebSocketHeartbeat = null;\n /** @internal */\n this._rpcWebSocketIdleTimeout = null;\n /** @internal\n * A number that we increment every time an active connection closes.\n * Used to determine whether the same socket connection that was open\n * when an async operation started is the same one that's active when\n * its continuation fires.\n *\n */\n this._rpcWebSocketGeneration = 0;\n /** @internal */\n this._disableBlockhashCaching = false;\n /** @internal */\n this._pollingBlockhash = false;\n /** @internal */\n this._blockhashInfo = {\n latestBlockhash: null,\n lastFetch: 0,\n transactionSignatures: [],\n simulatedSignatures: []\n };\n /** @internal */\n this._nextClientSubscriptionId = 0;\n /** @internal */\n this._subscriptionDisposeFunctionsByClientSubscriptionId = {};\n /** @internal */\n this._subscriptionHashByClientSubscriptionId = {};\n /** @internal */\n this._subscriptionStateChangeCallbacksByHash = {};\n /** @internal */\n this._subscriptionCallbacksByServerSubscriptionId = {};\n /** @internal */\n this._subscriptionsByHash = {};\n /**\n * Special case.\n * After a signature is processed, RPCs automatically dispose of the\n * subscription on the server side. We need to track which of these\n * subscriptions have been disposed in such a way, so that we know\n * whether the client is dealing with a not-yet-processed signature\n * (in which case we must tear down the server subscription) or an\n * already-processed signature (in which case the client can simply\n * clear out the subscription locally without telling the server).\n *\n * NOTE: There is a proposal to eliminate this special case, here:\n * https://github.com/solana-labs/solana/issues/18892\n */\n /** @internal */\n this._subscriptionsAutoDisposedByRpc = new Set();\n /*\n * Returns the current block height of the node\n */\n this.getBlockHeight = (() => {\n const requestPromises = {};\n return async commitmentOrConfig => {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const requestHash = fastStableStringify$1(args);\n requestPromises[requestHash] = requestPromises[requestHash] ?? (async () => {\n try {\n const unsafeRes = await this._rpcRequest('getBlockHeight', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get block height information');\n }\n return res.result;\n } finally {\n delete requestPromises[requestHash];\n }\n })();\n return await requestPromises[requestHash];\n };\n })();\n let wsEndpoint;\n let httpHeaders;\n let fetch;\n let fetchMiddleware;\n let disableRetryOnRateLimit;\n let httpAgent;\n if (_commitmentOrConfig && typeof _commitmentOrConfig === 'string') {\n this._commitment = _commitmentOrConfig;\n } else if (_commitmentOrConfig) {\n this._commitment = _commitmentOrConfig.commitment;\n this._confirmTransactionInitialTimeout = _commitmentOrConfig.confirmTransactionInitialTimeout;\n wsEndpoint = _commitmentOrConfig.wsEndpoint;\n httpHeaders = _commitmentOrConfig.httpHeaders;\n fetch = _commitmentOrConfig.fetch;\n fetchMiddleware = _commitmentOrConfig.fetchMiddleware;\n disableRetryOnRateLimit = _commitmentOrConfig.disableRetryOnRateLimit;\n httpAgent = _commitmentOrConfig.httpAgent;\n }\n this._rpcEndpoint = assertEndpointUrl(endpoint);\n this._rpcWsEndpoint = wsEndpoint || makeWebsocketUrl(endpoint);\n this._rpcClient = createRpcClient(endpoint, httpHeaders, fetch, fetchMiddleware, disableRetryOnRateLimit, httpAgent);\n this._rpcRequest = createRpcRequest(this._rpcClient);\n this._rpcBatchRequest = createRpcBatchRequest(this._rpcClient);\n this._rpcWebSocket = new RpcWebSocketClient(this._rpcWsEndpoint, {\n autoconnect: false,\n max_reconnects: Infinity\n });\n this._rpcWebSocket.on('open', this._wsOnOpen.bind(this));\n this._rpcWebSocket.on('error', this._wsOnError.bind(this));\n this._rpcWebSocket.on('close', this._wsOnClose.bind(this));\n this._rpcWebSocket.on('accountNotification', this._wsOnAccountNotification.bind(this));\n this._rpcWebSocket.on('programNotification', this._wsOnProgramAccountNotification.bind(this));\n this._rpcWebSocket.on('slotNotification', this._wsOnSlotNotification.bind(this));\n this._rpcWebSocket.on('slotsUpdatesNotification', this._wsOnSlotUpdatesNotification.bind(this));\n this._rpcWebSocket.on('signatureNotification', this._wsOnSignatureNotification.bind(this));\n this._rpcWebSocket.on('rootNotification', this._wsOnRootNotification.bind(this));\n this._rpcWebSocket.on('logsNotification', this._wsOnLogsNotification.bind(this));\n }\n\n /**\n * The default commitment used for requests\n */\n get commitment() {\n return this._commitment;\n }\n\n /**\n * The RPC endpoint\n */\n get rpcEndpoint() {\n return this._rpcEndpoint;\n }\n\n /**\n * Fetch the balance for the specified public key, return with context\n */\n async getBalanceAndContext(publicKey, commitmentOrConfig) {\n /** @internal */\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([publicKey.toBase58()], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getBalance', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get balance for ${publicKey.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch the balance for the specified public key\n */\n async getBalance(publicKey, commitmentOrConfig) {\n return await this.getBalanceAndContext(publicKey, commitmentOrConfig).then(x => x.value).catch(e => {\n throw new Error('failed to get balance of account ' + publicKey.toBase58() + ': ' + e);\n });\n }\n\n /**\n * Fetch the estimated production time of a block\n */\n async getBlockTime(slot) {\n const unsafeRes = await this._rpcRequest('getBlockTime', [slot]);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get block time for slot ${slot}`);\n }\n return res.result;\n }\n\n /**\n * Fetch the lowest slot that the node has information about in its ledger.\n * This value may increase over time if the node is configured to purge older ledger data\n */\n async getMinimumLedgerSlot() {\n const unsafeRes = await this._rpcRequest('minimumLedgerSlot', []);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get minimum ledger slot');\n }\n return res.result;\n }\n\n /**\n * Fetch the slot of the lowest confirmed block that has not been purged from the ledger\n */\n async getFirstAvailableBlock() {\n const unsafeRes = await this._rpcRequest('getFirstAvailableBlock', []);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, SlotRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get first available block');\n }\n return res.result;\n }\n\n /**\n * Fetch information about the current supply\n */\n async getSupply(config) {\n let configArg = {};\n if (typeof config === 'string') {\n configArg = {\n commitment: config\n };\n } else if (config) {\n configArg = {\n ...config,\n commitment: config && config.commitment || this.commitment\n };\n } else {\n configArg = {\n commitment: this.commitment\n };\n }\n const unsafeRes = await this._rpcRequest('getSupply', [configArg]);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetSupplyRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get supply');\n }\n return res.result;\n }\n\n /**\n * Fetch the current supply of a token mint\n */\n async getTokenSupply(tokenMintAddress, commitment) {\n const args = this._buildArgs([tokenMintAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenSupply', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get token supply');\n }\n return res.result;\n }\n\n /**\n * Fetch the current balance of a token account\n */\n async getTokenAccountBalance(tokenAddress, commitment) {\n const args = this._buildArgs([tokenAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenAccountBalance', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResultAndContext(TokenAmountResult));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get token account balance');\n }\n return res.result;\n }\n\n /**\n * Fetch all the token accounts owned by the specified account\n *\n * @return {Promise}\n */\n async getTokenAccountsByOwner(ownerAddress, filter, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n let _args = [ownerAddress.toBase58()];\n if ('mint' in filter) {\n _args.push({\n mint: filter.mint.toBase58()\n });\n } else {\n _args.push({\n programId: filter.programId.toBase58()\n });\n }\n const args = this._buildArgs(_args, commitment, 'base64', config);\n const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetTokenAccountsByOwner);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch parsed token accounts owned by the specified account\n *\n * @return {Promise}>>>}\n */\n async getParsedTokenAccountsByOwner(ownerAddress, filter, commitment) {\n let _args = [ownerAddress.toBase58()];\n if ('mint' in filter) {\n _args.push({\n mint: filter.mint.toBase58()\n });\n } else {\n _args.push({\n programId: filter.programId.toBase58()\n });\n }\n const args = this._buildArgs(_args, commitment, 'jsonParsed');\n const unsafeRes = await this._rpcRequest('getTokenAccountsByOwner', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetParsedTokenAccountsByOwner);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get token accounts owned by account ${ownerAddress.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch the 20 largest accounts with their current balances\n */\n async getLargestAccounts(config) {\n const arg = {\n ...config,\n commitment: config && config.commitment || this.commitment\n };\n const args = arg.filter || arg.commitment ? [arg] : [];\n const unsafeRes = await this._rpcRequest('getLargestAccounts', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetLargestAccountsRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get largest accounts');\n }\n return res.result;\n }\n\n /**\n * Fetch the 20 largest token accounts with their current balances\n * for a given mint.\n */\n async getTokenLargestAccounts(mintAddress, commitment) {\n const args = this._buildArgs([mintAddress.toBase58()], commitment);\n const unsafeRes = await this._rpcRequest('getTokenLargestAccounts', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetTokenLargestAccountsResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get token largest accounts');\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for the specified public key, return with context\n */\n async getAccountInfoAndContext(publicKey, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([publicKey.toBase58()], commitment, 'base64', config);\n const unsafeRes = await this._rpcRequest('getAccountInfo', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(AccountInfoResult)));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch parsed account info for the specified public key\n */\n async getParsedAccountInfo(publicKey, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([publicKey.toBase58()], commitment, 'jsonParsed', config);\n const unsafeRes = await this._rpcRequest('getAccountInfo', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(ParsedAccountInfoResult)));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get info about account ${publicKey.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for the specified public key\n */\n async getAccountInfo(publicKey, commitmentOrConfig) {\n try {\n const res = await this.getAccountInfoAndContext(publicKey, commitmentOrConfig);\n return res.value;\n } catch (e) {\n throw new Error('failed to get info about account ' + publicKey.toBase58() + ': ' + e);\n }\n }\n\n /**\n * Fetch all the account info for multiple accounts specified by an array of public keys, return with context\n */\n async getMultipleParsedAccounts(publicKeys, rawConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(rawConfig);\n const keys = publicKeys.map(key => key.toBase58());\n const args = this._buildArgs([keys], commitment, 'jsonParsed', config);\n const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(ParsedAccountInfoResult))));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys}`);\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for multiple accounts specified by an array of public keys, return with context\n */\n async getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const keys = publicKeys.map(key => key.toBase58());\n const args = this._buildArgs([keys], commitment, 'base64', config);\n const unsafeRes = await this._rpcRequest('getMultipleAccounts', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)(AccountInfoResult))));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get info for accounts ${keys}`);\n }\n return res.result;\n }\n\n /**\n * Fetch all the account info for multiple accounts specified by an array of public keys\n */\n async getMultipleAccountsInfo(publicKeys, commitmentOrConfig) {\n const res = await this.getMultipleAccountsInfoAndContext(publicKeys, commitmentOrConfig);\n return res.value;\n }\n\n /**\n * Returns epoch activation information for a stake account that has been delegated\n */\n async getStakeActivation(publicKey, commitmentOrConfig, epoch) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([publicKey.toBase58()], commitment, undefined /* encoding */, {\n ...config,\n epoch: epoch != null ? epoch : config?.epoch\n });\n const unsafeRes = await this._rpcRequest('getStakeActivation', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult(StakeActivationResult));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get Stake Activation ${publicKey.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch all the accounts owned by the specified program id\n *\n * @return {Promise}>>}\n */\n\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n async getProgramAccounts(programId, configOrCommitment) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(configOrCommitment);\n const {\n encoding,\n ...configWithoutEncoding\n } = config || {};\n const args = this._buildArgs([programId.toBase58()], commitment, encoding || 'base64', configWithoutEncoding);\n const unsafeRes = await this._rpcRequest('getProgramAccounts', args);\n const baseSchema = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(KeyedAccountInfoResult);\n const res = configWithoutEncoding.withContext === true ? (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResultAndContext(baseSchema)) : (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult(baseSchema));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`);\n }\n return res.result;\n }\n\n /**\n * Fetch and parse all the accounts owned by the specified program id\n *\n * @return {Promise}>>}\n */\n async getParsedProgramAccounts(programId, configOrCommitment) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(configOrCommitment);\n const args = this._buildArgs([programId.toBase58()], commitment, 'jsonParsed', config);\n const unsafeRes = await this._rpcRequest('getProgramAccounts', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(KeyedParsedAccountInfoResult)));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get accounts owned by program ${programId.toBase58()}`);\n }\n return res.result;\n }\n\n /** @deprecated Instead, call `confirmTransaction` and pass in {@link TransactionConfirmationStrategy} */\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n async confirmTransaction(strategy, commitment) {\n let rawSignature;\n if (typeof strategy == 'string') {\n rawSignature = strategy;\n } else {\n const config = strategy;\n if (config.abortSignal?.aborted) {\n return Promise.reject(config.abortSignal.reason);\n }\n rawSignature = config.signature;\n }\n let decodedSignature;\n try {\n decodedSignature = bs58__WEBPACK_IMPORTED_MODULE_2___default().decode(rawSignature);\n } catch (err) {\n throw new Error('signature must be base58 encoded: ' + rawSignature);\n }\n assert(decodedSignature.length === 64, 'signature has invalid length');\n if (typeof strategy === 'string') {\n return await this.confirmTransactionUsingLegacyTimeoutStrategy({\n commitment: commitment || this.commitment,\n signature: rawSignature\n });\n } else if ('lastValidBlockHeight' in strategy) {\n return await this.confirmTransactionUsingBlockHeightExceedanceStrategy({\n commitment: commitment || this.commitment,\n strategy\n });\n } else {\n return await this.confirmTransactionUsingDurableNonceStrategy({\n commitment: commitment || this.commitment,\n strategy\n });\n }\n }\n getCancellationPromise(signal) {\n return new Promise((_, reject) => {\n if (signal == null) {\n return;\n }\n if (signal.aborted) {\n reject(signal.reason);\n } else {\n signal.addEventListener('abort', () => {\n reject(signal.reason);\n });\n }\n });\n }\n getTransactionConfirmationPromise({\n commitment,\n signature\n }) {\n let signatureSubscriptionId;\n let disposeSignatureSubscriptionStateChangeObserver;\n let done = false;\n const confirmationPromise = new Promise((resolve, reject) => {\n try {\n signatureSubscriptionId = this.onSignature(signature, (result, context) => {\n signatureSubscriptionId = undefined;\n const response = {\n context,\n value: result\n };\n resolve({\n __type: TransactionStatus.PROCESSED,\n response\n });\n }, commitment);\n const subscriptionSetupPromise = new Promise(resolveSubscriptionSetup => {\n if (signatureSubscriptionId == null) {\n resolveSubscriptionSetup();\n } else {\n disposeSignatureSubscriptionStateChangeObserver = this._onSubscriptionStateChange(signatureSubscriptionId, nextState => {\n if (nextState === 'subscribed') {\n resolveSubscriptionSetup();\n }\n });\n }\n });\n (async () => {\n await subscriptionSetupPromise;\n if (done) return;\n const response = await this.getSignatureStatus(signature);\n if (done) return;\n if (response == null) {\n return;\n }\n const {\n context,\n value\n } = response;\n if (value == null) {\n return;\n }\n if (value?.err) {\n reject(value.err);\n } else {\n switch (commitment) {\n case 'confirmed':\n case 'single':\n case 'singleGossip':\n {\n if (value.confirmationStatus === 'processed') {\n return;\n }\n break;\n }\n case 'finalized':\n case 'max':\n case 'root':\n {\n if (value.confirmationStatus === 'processed' || value.confirmationStatus === 'confirmed') {\n return;\n }\n break;\n }\n // exhaust enums to ensure full coverage\n case 'processed':\n case 'recent':\n }\n done = true;\n resolve({\n __type: TransactionStatus.PROCESSED,\n response: {\n context,\n value\n }\n });\n }\n })();\n } catch (err) {\n reject(err);\n }\n });\n const abortConfirmation = () => {\n if (disposeSignatureSubscriptionStateChangeObserver) {\n disposeSignatureSubscriptionStateChangeObserver();\n disposeSignatureSubscriptionStateChangeObserver = undefined;\n }\n if (signatureSubscriptionId != null) {\n this.removeSignatureListener(signatureSubscriptionId);\n signatureSubscriptionId = undefined;\n }\n };\n return {\n abortConfirmation,\n confirmationPromise\n };\n }\n async confirmTransactionUsingBlockHeightExceedanceStrategy({\n commitment,\n strategy: {\n abortSignal,\n lastValidBlockHeight,\n signature\n }\n }) {\n let done = false;\n const expiryPromise = new Promise(resolve => {\n const checkBlockHeight = async () => {\n try {\n const blockHeight = await this.getBlockHeight(commitment);\n return blockHeight;\n } catch (_e) {\n return -1;\n }\n };\n (async () => {\n let currentBlockHeight = await checkBlockHeight();\n if (done) return;\n while (currentBlockHeight <= lastValidBlockHeight) {\n await sleep(1000);\n if (done) return;\n currentBlockHeight = await checkBlockHeight();\n if (done) return;\n }\n resolve({\n __type: TransactionStatus.BLOCKHEIGHT_EXCEEDED\n });\n })();\n });\n const {\n abortConfirmation,\n confirmationPromise\n } = this.getTransactionConfirmationPromise({\n commitment,\n signature\n });\n const cancellationPromise = this.getCancellationPromise(abortSignal);\n let result;\n try {\n const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]);\n if (outcome.__type === TransactionStatus.PROCESSED) {\n result = outcome.response;\n } else {\n throw new TransactionExpiredBlockheightExceededError(signature);\n }\n } finally {\n done = true;\n abortConfirmation();\n }\n return result;\n }\n async confirmTransactionUsingDurableNonceStrategy({\n commitment,\n strategy: {\n abortSignal,\n minContextSlot,\n nonceAccountPubkey,\n nonceValue,\n signature\n }\n }) {\n let done = false;\n const expiryPromise = new Promise(resolve => {\n let currentNonceValue = nonceValue;\n let lastCheckedSlot = null;\n const getCurrentNonceValue = async () => {\n try {\n const {\n context,\n value: nonceAccount\n } = await this.getNonceAndContext(nonceAccountPubkey, {\n commitment,\n minContextSlot\n });\n lastCheckedSlot = context.slot;\n return nonceAccount?.nonce;\n } catch (e) {\n // If for whatever reason we can't reach/read the nonce\n // account, just keep using the last-known value.\n return currentNonceValue;\n }\n };\n (async () => {\n currentNonceValue = await getCurrentNonceValue();\n if (done) return;\n while (true // eslint-disable-line no-constant-condition\n ) {\n if (nonceValue !== currentNonceValue) {\n resolve({\n __type: TransactionStatus.NONCE_INVALID,\n slotInWhichNonceDidAdvance: lastCheckedSlot\n });\n return;\n }\n await sleep(2000);\n if (done) return;\n currentNonceValue = await getCurrentNonceValue();\n if (done) return;\n }\n })();\n });\n const {\n abortConfirmation,\n confirmationPromise\n } = this.getTransactionConfirmationPromise({\n commitment,\n signature\n });\n const cancellationPromise = this.getCancellationPromise(abortSignal);\n let result;\n try {\n const outcome = await Promise.race([cancellationPromise, confirmationPromise, expiryPromise]);\n if (outcome.__type === TransactionStatus.PROCESSED) {\n result = outcome.response;\n } else {\n // Double check that the transaction is indeed unconfirmed.\n let signatureStatus;\n while (true // eslint-disable-line no-constant-condition\n ) {\n const status = await this.getSignatureStatus(signature);\n if (status == null) {\n break;\n }\n if (status.context.slot < (outcome.slotInWhichNonceDidAdvance ?? minContextSlot)) {\n await sleep(400);\n continue;\n }\n signatureStatus = status;\n break;\n }\n if (signatureStatus?.value) {\n const commitmentForStatus = commitment || 'finalized';\n const {\n confirmationStatus\n } = signatureStatus.value;\n switch (commitmentForStatus) {\n case 'processed':\n case 'recent':\n if (confirmationStatus !== 'processed' && confirmationStatus !== 'confirmed' && confirmationStatus !== 'finalized') {\n throw new TransactionExpiredNonceInvalidError(signature);\n }\n break;\n case 'confirmed':\n case 'single':\n case 'singleGossip':\n if (confirmationStatus !== 'confirmed' && confirmationStatus !== 'finalized') {\n throw new TransactionExpiredNonceInvalidError(signature);\n }\n break;\n case 'finalized':\n case 'max':\n case 'root':\n if (confirmationStatus !== 'finalized') {\n throw new TransactionExpiredNonceInvalidError(signature);\n }\n break;\n default:\n // Exhaustive switch.\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n (_ => {})(commitmentForStatus);\n }\n result = {\n context: signatureStatus.context,\n value: {\n err: signatureStatus.value.err\n }\n };\n } else {\n throw new TransactionExpiredNonceInvalidError(signature);\n }\n }\n } finally {\n done = true;\n abortConfirmation();\n }\n return result;\n }\n async confirmTransactionUsingLegacyTimeoutStrategy({\n commitment,\n signature\n }) {\n let timeoutId;\n const expiryPromise = new Promise(resolve => {\n let timeoutMs = this._confirmTransactionInitialTimeout || 60 * 1000;\n switch (commitment) {\n case 'processed':\n case 'recent':\n case 'single':\n case 'confirmed':\n case 'singleGossip':\n {\n timeoutMs = this._confirmTransactionInitialTimeout || 30 * 1000;\n break;\n }\n }\n timeoutId = setTimeout(() => resolve({\n __type: TransactionStatus.TIMED_OUT,\n timeoutMs\n }), timeoutMs);\n });\n const {\n abortConfirmation,\n confirmationPromise\n } = this.getTransactionConfirmationPromise({\n commitment,\n signature\n });\n let result;\n try {\n const outcome = await Promise.race([confirmationPromise, expiryPromise]);\n if (outcome.__type === TransactionStatus.PROCESSED) {\n result = outcome.response;\n } else {\n throw new TransactionExpiredTimeoutError(signature, outcome.timeoutMs / 1000);\n }\n } finally {\n clearTimeout(timeoutId);\n abortConfirmation();\n }\n return result;\n }\n\n /**\n * Return the list of nodes that are currently participating in the cluster\n */\n async getClusterNodes() {\n const unsafeRes = await this._rpcRequest('getClusterNodes', []);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(ContactInfoResult)));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get cluster nodes');\n }\n return res.result;\n }\n\n /**\n * Return the list of nodes that are currently participating in the cluster\n */\n async getVoteAccounts(commitment) {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getVoteAccounts', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetVoteAccounts);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get vote accounts');\n }\n return res.result;\n }\n\n /**\n * Fetch the current slot that the node is processing\n */\n async getSlot(commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getSlot', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get slot');\n }\n return res.result;\n }\n\n /**\n * Fetch the current slot leader of the cluster\n */\n async getSlotLeader(commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getSlotLeader', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get slot leader');\n }\n return res.result;\n }\n\n /**\n * Fetch `limit` number of slot leaders starting from `startSlot`\n *\n * @param startSlot fetch slot leaders starting from this slot\n * @param limit number of slot leaders to return\n */\n async getSlotLeaders(startSlot, limit) {\n const args = [startSlot, limit];\n const unsafeRes = await this._rpcRequest('getSlotLeaders', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)(PublicKeyFromString)));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get slot leaders');\n }\n return res.result;\n }\n\n /**\n * Fetch the current status of a signature\n */\n async getSignatureStatus(signature, config) {\n const {\n context,\n value: values\n } = await this.getSignatureStatuses([signature], config);\n assert(values.length === 1);\n const value = values[0];\n return {\n context,\n value\n };\n }\n\n /**\n * Fetch the current statuses of a batch of signatures\n */\n async getSignatureStatuses(signatures, config) {\n const params = [signatures];\n if (config) {\n params.push(config);\n }\n const unsafeRes = await this._rpcRequest('getSignatureStatuses', params);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetSignatureStatusesRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get signature status');\n }\n return res.result;\n }\n\n /**\n * Fetch the current transaction count of the cluster\n */\n async getTransactionCount(commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getTransactionCount', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transaction count');\n }\n return res.result;\n }\n\n /**\n * Fetch the current total currency supply of the cluster in lamports\n *\n * @deprecated Deprecated since v1.2.8. Please use {@link getSupply} instead.\n */\n async getTotalSupply(commitment) {\n const result = await this.getSupply({\n commitment,\n excludeNonCirculatingAccountsList: true\n });\n return result.value.total;\n }\n\n /**\n * Fetch the cluster InflationGovernor parameters\n */\n async getInflationGovernor(commitment) {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getInflationGovernor', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetInflationGovernorRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get inflation');\n }\n return res.result;\n }\n\n /**\n * Fetch the inflation reward for a list of addresses for an epoch\n */\n async getInflationReward(addresses, epoch, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([addresses.map(pubkey => pubkey.toBase58())], commitment, undefined /* encoding */, {\n ...config,\n epoch: epoch != null ? epoch : config?.epoch\n });\n const unsafeRes = await this._rpcRequest('getInflationReward', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetInflationRewardResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get inflation reward');\n }\n return res.result;\n }\n\n /**\n * Fetch the specific inflation values for the current epoch\n */\n async getInflationRate() {\n const unsafeRes = await this._rpcRequest('getInflationRate', []);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetInflationRateRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get inflation rate');\n }\n return res.result;\n }\n\n /**\n * Fetch the Epoch Info parameters\n */\n async getEpochInfo(commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getEpochInfo', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetEpochInfoRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get epoch info');\n }\n return res.result;\n }\n\n /**\n * Fetch the Epoch Schedule parameters\n */\n async getEpochSchedule() {\n const unsafeRes = await this._rpcRequest('getEpochSchedule', []);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetEpochScheduleRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get epoch schedule');\n }\n const epochSchedule = res.result;\n return new EpochSchedule(epochSchedule.slotsPerEpoch, epochSchedule.leaderScheduleSlotOffset, epochSchedule.warmup, epochSchedule.firstNormalEpoch, epochSchedule.firstNormalSlot);\n }\n\n /**\n * Fetch the leader schedule for the current epoch\n * @return {Promise>}\n */\n async getLeaderSchedule() {\n const unsafeRes = await this._rpcRequest('getLeaderSchedule', []);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetLeaderScheduleRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get leader schedule');\n }\n return res.result;\n }\n\n /**\n * Fetch the minimum balance needed to exempt an account of `dataLength`\n * size from rent\n */\n async getMinimumBalanceForRentExemption(dataLength, commitment) {\n const args = this._buildArgs([dataLength], commitment);\n const unsafeRes = await this._rpcRequest('getMinimumBalanceForRentExemption', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetMinimumBalanceForRentExemptionRpcResult);\n if ('error' in res) {\n console.warn('Unable to fetch minimum balance for rent exemption');\n return 0;\n }\n return res.result;\n }\n\n /**\n * Fetch a recent blockhash from the cluster, return with context\n * @return {Promise>}\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.\n */\n async getRecentBlockhashAndContext(commitment) {\n const args = this._buildArgs([], commitment);\n const unsafeRes = await this._rpcRequest('getRecentBlockhash', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetRecentBlockhashAndContextRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get recent blockhash');\n }\n return res.result;\n }\n\n /**\n * Fetch recent performance samples\n * @return {Promise>}\n */\n async getRecentPerformanceSamples(limit) {\n const unsafeRes = await this._rpcRequest('getRecentPerformanceSamples', limit ? [limit] : []);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetRecentPerformanceSamplesRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get recent performance samples');\n }\n return res.result;\n }\n\n /**\n * Fetch the fee calculator for a recent blockhash from the cluster, return with context\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getFeeForMessage} instead.\n */\n async getFeeCalculatorForBlockhash(blockhash, commitment) {\n const args = this._buildArgs([blockhash], commitment);\n const unsafeRes = await this._rpcRequest('getFeeCalculatorForBlockhash', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetFeeCalculatorRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get fee calculator');\n }\n const {\n context,\n value\n } = res.result;\n return {\n context,\n value: value !== null ? value.feeCalculator : null\n };\n }\n\n /**\n * Fetch the fee for a message from the cluster, return with context\n */\n async getFeeForMessage(message, commitment) {\n const wireMessage = toBuffer(message.serialize()).toString('base64');\n const args = this._buildArgs([wireMessage], commitment);\n const unsafeRes = await this._rpcRequest('getFeeForMessage', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .nullable */ .AG)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get fee for message');\n }\n if (res.result === null) {\n throw new Error('invalid blockhash');\n }\n return res.result;\n }\n\n /**\n * Fetch a list of prioritization fees from recent blocks.\n */\n async getRecentPrioritizationFees(config) {\n const accounts = config?.lockedWritableAccounts?.map(key => key.toBase58());\n const args = accounts?.length ? [accounts] : [];\n const unsafeRes = await this._rpcRequest('getRecentPrioritizationFees', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetRecentPrioritizationFeesRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get recent prioritization fees');\n }\n return res.result;\n }\n /**\n * Fetch a recent blockhash from the cluster\n * @return {Promise<{blockhash: Blockhash, feeCalculator: FeeCalculator}>}\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getLatestBlockhash} instead.\n */\n async getRecentBlockhash(commitment) {\n try {\n const res = await this.getRecentBlockhashAndContext(commitment);\n return res.value;\n } catch (e) {\n throw new Error('failed to get recent blockhash: ' + e);\n }\n }\n\n /**\n * Fetch the latest blockhash from the cluster\n * @return {Promise}\n */\n async getLatestBlockhash(commitmentOrConfig) {\n try {\n const res = await this.getLatestBlockhashAndContext(commitmentOrConfig);\n return res.value;\n } catch (e) {\n throw new Error('failed to get recent blockhash: ' + e);\n }\n }\n\n /**\n * Fetch the latest blockhash from the cluster\n * @return {Promise}\n */\n async getLatestBlockhashAndContext(commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgs([], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getLatestBlockhash', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetLatestBlockhashRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get latest blockhash');\n }\n return res.result;\n }\n\n /**\n * Returns whether a blockhash is still valid or not\n */\n async isBlockhashValid(blockhash, rawConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(rawConfig);\n const args = this._buildArgs([blockhash], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('isBlockhashValid', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, IsBlockhashValidRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to determine if the blockhash `' + blockhash + '`is valid');\n }\n return res.result;\n }\n\n /**\n * Fetch the node version\n */\n async getVersion() {\n const unsafeRes = await this._rpcRequest('getVersion', []);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult(VersionResult));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get version');\n }\n return res.result;\n }\n\n /**\n * Fetch the genesis hash\n */\n async getGenesisHash() {\n const unsafeRes = await this._rpcRequest('getGenesisHash', []);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get genesis hash');\n }\n return res.result;\n }\n\n /**\n * Fetch a processed block from the cluster.\n *\n * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by\n * setting the `maxSupportedTransactionVersion` property.\n */\n\n /**\n * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by\n * setting the `maxSupportedTransactionVersion` property.\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * @deprecated Instead, call `getBlock` using a `GetVersionedBlockConfig` by\n * setting the `maxSupportedTransactionVersion` property.\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Fetch a processed block from the cluster.\n */\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Fetch a processed block from the cluster.\n */\n // eslint-disable-next-line no-dupe-class-members\n async getBlock(slot, rawConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(rawConfig);\n const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getBlock', args);\n try {\n switch (config?.transactionDetails) {\n case 'accounts':\n {\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetAccountsModeBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n return res.result;\n }\n case 'none':\n {\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetNoneModeBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n return res.result;\n }\n default:\n {\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n const {\n result\n } = res;\n return result ? {\n ...result,\n transactions: result.transactions.map(({\n transaction,\n meta,\n version\n }) => ({\n meta,\n transaction: {\n ...transaction,\n message: versionedMessageFromResponse(version, transaction.message)\n },\n version\n }))\n } : null;\n }\n }\n } catch (e) {\n throw new SolanaJSONRPCError(e, 'failed to get confirmed block');\n }\n }\n\n /**\n * Fetch parsed transaction details for a confirmed or finalized block\n */\n\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n\n // eslint-disable-next-line no-dupe-class-members\n async getParsedBlock(slot, rawConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(rawConfig);\n const args = this._buildArgsAtLeastConfirmed([slot], commitment, 'jsonParsed', config);\n const unsafeRes = await this._rpcRequest('getBlock', args);\n try {\n switch (config?.transactionDetails) {\n case 'accounts':\n {\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetParsedAccountsModeBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n return res.result;\n }\n case 'none':\n {\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetParsedNoneModeBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n return res.result;\n }\n default:\n {\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetParsedBlockRpcResult);\n if ('error' in res) {\n throw res.error;\n }\n return res.result;\n }\n }\n } catch (e) {\n throw new SolanaJSONRPCError(e, 'failed to get block');\n }\n }\n /*\n * Returns recent block production information from the current or previous epoch\n */\n async getBlockProduction(configOrCommitment) {\n let extra;\n let commitment;\n if (typeof configOrCommitment === 'string') {\n commitment = configOrCommitment;\n } else if (configOrCommitment) {\n const {\n commitment: c,\n ...rest\n } = configOrCommitment;\n commitment = c;\n extra = rest;\n }\n const args = this._buildArgs([], commitment, 'base64', extra);\n const unsafeRes = await this._rpcRequest('getBlockProduction', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, BlockProductionResponseStruct);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get block production information');\n }\n return res.result;\n }\n\n /**\n * Fetch a confirmed or finalized transaction from the cluster.\n *\n * @deprecated Instead, call `getTransaction` using a\n * `GetVersionedTransactionConfig` by setting the\n * `maxSupportedTransactionVersion` property.\n */\n\n /**\n * Fetch a confirmed or finalized transaction from the cluster.\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Fetch a confirmed or finalized transaction from the cluster.\n */\n // eslint-disable-next-line no-dupe-class-members\n async getTransaction(signature, rawConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(rawConfig);\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, undefined /* encoding */, config);\n const unsafeRes = await this._rpcRequest('getTransaction', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transaction');\n }\n const result = res.result;\n if (!result) return result;\n return {\n ...result,\n transaction: {\n ...result.transaction,\n message: versionedMessageFromResponse(result.version, result.transaction.message)\n }\n };\n }\n\n /**\n * Fetch parsed transaction details for a confirmed or finalized transaction\n */\n async getParsedTransaction(signature, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);\n const unsafeRes = await this._rpcRequest('getTransaction', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetParsedTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transaction');\n }\n return res.result;\n }\n\n /**\n * Fetch parsed transaction details for a batch of confirmed transactions\n */\n async getParsedTransactions(signatures, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const batch = signatures.map(signature => {\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed', config);\n return {\n methodName: 'getTransaction',\n args\n };\n });\n const unsafeRes = await this._rpcBatchRequest(batch);\n const res = unsafeRes.map(unsafeRes => {\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetParsedTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transactions');\n }\n return res.result;\n });\n return res;\n }\n\n /**\n * Fetch transaction details for a batch of confirmed transactions.\n * Similar to {@link getParsedTransactions} but returns a {@link TransactionResponse}.\n *\n * @deprecated Instead, call `getTransactions` using a\n * `GetVersionedTransactionConfig` by setting the\n * `maxSupportedTransactionVersion` property.\n */\n\n /**\n * Fetch transaction details for a batch of confirmed transactions.\n * Similar to {@link getParsedTransactions} but returns a {@link\n * VersionedTransactionResponse}.\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Fetch transaction details for a batch of confirmed transactions.\n * Similar to {@link getParsedTransactions} but returns a {@link\n * VersionedTransactionResponse}.\n */\n // eslint-disable-next-line no-dupe-class-members\n async getTransactions(signatures, commitmentOrConfig) {\n const {\n commitment,\n config\n } = extractCommitmentFromConfig(commitmentOrConfig);\n const batch = signatures.map(signature => {\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, undefined /* encoding */, config);\n return {\n methodName: 'getTransaction',\n args\n };\n });\n const unsafeRes = await this._rpcBatchRequest(batch);\n const res = unsafeRes.map(unsafeRes => {\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transactions');\n }\n const result = res.result;\n if (!result) return result;\n return {\n ...result,\n transaction: {\n ...result.transaction,\n message: versionedMessageFromResponse(result.version, result.transaction.message)\n }\n };\n });\n return res;\n }\n\n /**\n * Fetch a list of Transactions and transaction statuses from the cluster\n * for a confirmed block.\n *\n * @deprecated Deprecated since v1.13.0. Please use {@link getBlock} instead.\n */\n async getConfirmedBlock(slot, commitment) {\n const args = this._buildArgsAtLeastConfirmed([slot], commitment);\n const unsafeRes = await this._rpcRequest('getConfirmedBlock', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetConfirmedBlockRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block');\n }\n const result = res.result;\n if (!result) {\n throw new Error('Confirmed block ' + slot + ' not found');\n }\n const block = {\n ...result,\n transactions: result.transactions.map(({\n transaction,\n meta\n }) => {\n const message = new Message(transaction.message);\n return {\n meta,\n transaction: {\n ...transaction,\n message\n }\n };\n })\n };\n return {\n ...block,\n transactions: block.transactions.map(({\n transaction,\n meta\n }) => {\n return {\n meta,\n transaction: Transaction.populate(transaction.message, transaction.signatures)\n };\n })\n };\n }\n\n /**\n * Fetch confirmed blocks between two slots\n */\n async getBlocks(startSlot, endSlot, commitment) {\n const args = this._buildArgsAtLeastConfirmed(endSlot !== undefined ? [startSlot, endSlot] : [startSlot], commitment);\n const unsafeRes = await this._rpcRequest('getBlocks', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResult((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .array */ .IX)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)())));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get blocks');\n }\n return res.result;\n }\n\n /**\n * Fetch a list of Signatures from the cluster for a block, excluding rewards\n */\n async getBlockSignatures(slot, commitment) {\n const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {\n transactionDetails: 'signatures',\n rewards: false\n });\n const unsafeRes = await this._rpcRequest('getBlock', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetBlockSignaturesRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get block');\n }\n const result = res.result;\n if (!result) {\n throw new Error('Block ' + slot + ' not found');\n }\n return result;\n }\n\n /**\n * Fetch a list of Signatures from the cluster for a confirmed block, excluding rewards\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getBlockSignatures} instead.\n */\n async getConfirmedBlockSignatures(slot, commitment) {\n const args = this._buildArgsAtLeastConfirmed([slot], commitment, undefined, {\n transactionDetails: 'signatures',\n rewards: false\n });\n const unsafeRes = await this._rpcRequest('getConfirmedBlock', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetBlockSignaturesRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get confirmed block');\n }\n const result = res.result;\n if (!result) {\n throw new Error('Confirmed block ' + slot + ' not found');\n }\n return result;\n }\n\n /**\n * Fetch a transaction details for a confirmed transaction\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getTransaction} instead.\n */\n async getConfirmedTransaction(signature, commitment) {\n const args = this._buildArgsAtLeastConfirmed([signature], commitment);\n const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get transaction');\n }\n const result = res.result;\n if (!result) return result;\n const message = new Message(result.transaction.message);\n const signatures = result.transaction.signatures;\n return {\n ...result,\n transaction: Transaction.populate(message, signatures)\n };\n }\n\n /**\n * Fetch parsed transaction details for a confirmed transaction\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransaction} instead.\n */\n async getParsedConfirmedTransaction(signature, commitment) {\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');\n const unsafeRes = await this._rpcRequest('getConfirmedTransaction', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetParsedTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transaction');\n }\n return res.result;\n }\n\n /**\n * Fetch parsed transaction details for a batch of confirmed transactions\n *\n * @deprecated Deprecated since Solana v1.8.0. Please use {@link getParsedTransactions} instead.\n */\n async getParsedConfirmedTransactions(signatures, commitment) {\n const batch = signatures.map(signature => {\n const args = this._buildArgsAtLeastConfirmed([signature], commitment, 'jsonParsed');\n return {\n methodName: 'getConfirmedTransaction',\n args\n };\n });\n const unsafeRes = await this._rpcBatchRequest(batch);\n const res = unsafeRes.map(unsafeRes => {\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetParsedTransactionRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get confirmed transactions');\n }\n return res.result;\n });\n return res;\n }\n\n /**\n * Fetch a list of all the confirmed signatures for transactions involving an address\n * within a specified slot range. Max range allowed is 10,000 slots.\n *\n * @deprecated Deprecated since v1.3. Please use {@link getConfirmedSignaturesForAddress2} instead.\n *\n * @param address queried address\n * @param startSlot start slot, inclusive\n * @param endSlot end slot, inclusive\n */\n async getConfirmedSignaturesForAddress(address, startSlot, endSlot) {\n let options = {};\n let firstAvailableBlock = await this.getFirstAvailableBlock();\n while (!('until' in options)) {\n startSlot--;\n if (startSlot <= 0 || startSlot < firstAvailableBlock) {\n break;\n }\n try {\n const block = await this.getConfirmedBlockSignatures(startSlot, 'finalized');\n if (block.signatures.length > 0) {\n options.until = block.signatures[block.signatures.length - 1].toString();\n }\n } catch (err) {\n if (err instanceof Error && err.message.includes('skipped')) {\n continue;\n } else {\n throw err;\n }\n }\n }\n let highestConfirmedRoot = await this.getSlot('finalized');\n while (!('before' in options)) {\n endSlot++;\n if (endSlot > highestConfirmedRoot) {\n break;\n }\n try {\n const block = await this.getConfirmedBlockSignatures(endSlot);\n if (block.signatures.length > 0) {\n options.before = block.signatures[block.signatures.length - 1].toString();\n }\n } catch (err) {\n if (err instanceof Error && err.message.includes('skipped')) {\n continue;\n } else {\n throw err;\n }\n }\n }\n const confirmedSignatureInfo = await this.getConfirmedSignaturesForAddress2(address, options);\n return confirmedSignatureInfo.map(info => info.signature);\n }\n\n /**\n * Returns confirmed signatures for transactions involving an\n * address backwards in time from the provided signature or most recent confirmed block\n *\n *\n * @param address queried address\n * @param options\n */\n async getConfirmedSignaturesForAddress2(address, options, commitment) {\n const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);\n const unsafeRes = await this._rpcRequest('getConfirmedSignaturesForAddress2', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetConfirmedSignaturesForAddress2RpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get confirmed signatures for address');\n }\n return res.result;\n }\n\n /**\n * Returns confirmed signatures for transactions involving an\n * address backwards in time from the provided signature or most recent confirmed block\n *\n *\n * @param address queried address\n * @param options\n */\n async getSignaturesForAddress(address, options, commitment) {\n const args = this._buildArgsAtLeastConfirmed([address.toBase58()], commitment, undefined, options);\n const unsafeRes = await this._rpcRequest('getSignaturesForAddress', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, GetSignaturesForAddressRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, 'failed to get signatures for address');\n }\n return res.result;\n }\n async getAddressLookupTable(accountKey, config) {\n const {\n context,\n value: accountInfo\n } = await this.getAccountInfoAndContext(accountKey, config);\n let value = null;\n if (accountInfo !== null) {\n value = new AddressLookupTableAccount({\n key: accountKey,\n state: AddressLookupTableAccount.deserialize(accountInfo.data)\n });\n }\n return {\n context,\n value\n };\n }\n\n /**\n * Fetch the contents of a Nonce account from the cluster, return with context\n */\n async getNonceAndContext(nonceAccount, commitmentOrConfig) {\n const {\n context,\n value: accountInfo\n } = await this.getAccountInfoAndContext(nonceAccount, commitmentOrConfig);\n let value = null;\n if (accountInfo !== null) {\n value = NonceAccount.fromAccountData(accountInfo.data);\n }\n return {\n context,\n value\n };\n }\n\n /**\n * Fetch the contents of a Nonce account from the cluster\n */\n async getNonce(nonceAccount, commitmentOrConfig) {\n return await this.getNonceAndContext(nonceAccount, commitmentOrConfig).then(x => x.value).catch(e => {\n throw new Error('failed to get nonce for account ' + nonceAccount.toBase58() + ': ' + e);\n });\n }\n\n /**\n * Request an allocation of lamports to the specified address\n *\n * ```typescript\n * import { Connection, PublicKey, LAMPORTS_PER_SOL } from \"@solana/web3.js\";\n *\n * (async () => {\n * const connection = new Connection(\"https://api.testnet.solana.com\", \"confirmed\");\n * const myAddress = new PublicKey(\"2nr1bHFT86W9tGnyvmYW4vcHKsQB3sVQfnddasz4kExM\");\n * const signature = await connection.requestAirdrop(myAddress, LAMPORTS_PER_SOL);\n * await connection.confirmTransaction(signature);\n * })();\n * ```\n */\n async requestAirdrop(to, lamports) {\n const unsafeRes = await this._rpcRequest('requestAirdrop', [to.toBase58(), lamports]);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, RequestAirdropRpcResult);\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `airdrop to ${to.toBase58()} failed`);\n }\n return res.result;\n }\n\n /**\n * @internal\n */\n async _blockhashWithExpiryBlockHeight(disableCache) {\n if (!disableCache) {\n // Wait for polling to finish\n while (this._pollingBlockhash) {\n await sleep(100);\n }\n const timeSinceFetch = Date.now() - this._blockhashInfo.lastFetch;\n const expired = timeSinceFetch >= BLOCKHASH_CACHE_TIMEOUT_MS;\n if (this._blockhashInfo.latestBlockhash !== null && !expired) {\n return this._blockhashInfo.latestBlockhash;\n }\n }\n return await this._pollNewBlockhash();\n }\n\n /**\n * @internal\n */\n async _pollNewBlockhash() {\n this._pollingBlockhash = true;\n try {\n const startTime = Date.now();\n const cachedLatestBlockhash = this._blockhashInfo.latestBlockhash;\n const cachedBlockhash = cachedLatestBlockhash ? cachedLatestBlockhash.blockhash : null;\n for (let i = 0; i < 50; i++) {\n const latestBlockhash = await this.getLatestBlockhash('finalized');\n if (cachedBlockhash !== latestBlockhash.blockhash) {\n this._blockhashInfo = {\n latestBlockhash,\n lastFetch: Date.now(),\n transactionSignatures: [],\n simulatedSignatures: []\n };\n return latestBlockhash;\n }\n\n // Sleep for approximately half a slot\n await sleep(MS_PER_SLOT / 2);\n }\n throw new Error(`Unable to obtain a new blockhash after ${Date.now() - startTime}ms`);\n } finally {\n this._pollingBlockhash = false;\n }\n }\n\n /**\n * get the stake minimum delegation\n */\n async getStakeMinimumDelegation(config) {\n const {\n commitment,\n config: configArg\n } = extractCommitmentFromConfig(config);\n const args = this._buildArgs([], commitment, 'base64', configArg);\n const unsafeRes = await this._rpcRequest('getStakeMinimumDelegation', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, jsonRpcResultAndContext((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .number */ .Rx)()));\n if ('error' in res) {\n throw new SolanaJSONRPCError(res.error, `failed to get stake minimum delegation`);\n }\n return res.result;\n }\n\n /**\n * Simulate a transaction\n *\n * @deprecated Instead, call {@link simulateTransaction} with {@link\n * VersionedTransaction} and {@link SimulateTransactionConfig} parameters\n */\n\n /**\n * Simulate a transaction\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Simulate a transaction\n */\n // eslint-disable-next-line no-dupe-class-members\n async simulateTransaction(transactionOrMessage, configOrSigners, includeAccounts) {\n if ('message' in transactionOrMessage) {\n const versionedTx = transactionOrMessage;\n const wireTransaction = versionedTx.serialize();\n const encodedTransaction = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(wireTransaction).toString('base64');\n if (Array.isArray(configOrSigners) || includeAccounts !== undefined) {\n throw new Error('Invalid arguments');\n }\n const config = configOrSigners || {};\n config.encoding = 'base64';\n if (!('commitment' in config)) {\n config.commitment = this.commitment;\n }\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('simulateTransaction', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, SimulatedTransactionResponseStruct);\n if ('error' in res) {\n throw new Error('failed to simulate transaction: ' + res.error.message);\n }\n return res.result;\n }\n let transaction;\n if (transactionOrMessage instanceof Transaction) {\n let originalTx = transactionOrMessage;\n transaction = new Transaction();\n transaction.feePayer = originalTx.feePayer;\n transaction.instructions = transactionOrMessage.instructions;\n transaction.nonceInfo = originalTx.nonceInfo;\n transaction.signatures = originalTx.signatures;\n } else {\n transaction = Transaction.populate(transactionOrMessage);\n // HACK: this function relies on mutating the populated transaction\n transaction._message = transaction._json = undefined;\n }\n if (configOrSigners !== undefined && !Array.isArray(configOrSigners)) {\n throw new Error('Invalid arguments');\n }\n const signers = configOrSigners;\n if (transaction.nonceInfo && signers) {\n transaction.sign(...signers);\n } else {\n let disableCache = this._disableBlockhashCaching;\n for (;;) {\n const latestBlockhash = await this._blockhashWithExpiryBlockHeight(disableCache);\n transaction.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight;\n transaction.recentBlockhash = latestBlockhash.blockhash;\n if (!signers) break;\n transaction.sign(...signers);\n if (!transaction.signature) {\n throw new Error('!signature'); // should never happen\n }\n const signature = transaction.signature.toString('base64');\n if (!this._blockhashInfo.simulatedSignatures.includes(signature) && !this._blockhashInfo.transactionSignatures.includes(signature)) {\n // The signature of this transaction has not been seen before with the\n // current recentBlockhash, all done. Let's break\n this._blockhashInfo.simulatedSignatures.push(signature);\n break;\n } else {\n // This transaction would be treated as duplicate (its derived signature\n // matched to one of already recorded signatures).\n // So, we must fetch a new blockhash for a different signature by disabling\n // our cache not to wait for the cache expiration (BLOCKHASH_CACHE_TIMEOUT_MS).\n disableCache = true;\n }\n }\n }\n const message = transaction._compile();\n const signData = message.serialize();\n const wireTransaction = transaction._serialize(signData);\n const encodedTransaction = wireTransaction.toString('base64');\n const config = {\n encoding: 'base64',\n commitment: this.commitment\n };\n if (includeAccounts) {\n const addresses = (Array.isArray(includeAccounts) ? includeAccounts : message.nonProgramIds()).map(key => key.toBase58());\n config['accounts'] = {\n encoding: 'base64',\n addresses\n };\n }\n if (signers) {\n config.sigVerify = true;\n }\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('simulateTransaction', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, SimulatedTransactionResponseStruct);\n if ('error' in res) {\n let logs;\n if ('data' in res.error) {\n logs = res.error.data.logs;\n if (logs && Array.isArray(logs)) {\n const traceIndent = '\\n ';\n const logTrace = traceIndent + logs.join(traceIndent);\n console.error(res.error.message, logTrace);\n }\n }\n throw new SendTransactionError('failed to simulate transaction: ' + res.error.message, logs);\n }\n return res.result;\n }\n\n /**\n * Sign and send a transaction\n *\n * @deprecated Instead, call {@link sendTransaction} with a {@link\n * VersionedTransaction}\n */\n\n /**\n * Send a signed transaction\n */\n // eslint-disable-next-line no-dupe-class-members\n\n /**\n * Sign and send a transaction\n */\n // eslint-disable-next-line no-dupe-class-members\n async sendTransaction(transaction, signersOrOptions, options) {\n if ('version' in transaction) {\n if (signersOrOptions && Array.isArray(signersOrOptions)) {\n throw new Error('Invalid arguments');\n }\n const wireTransaction = transaction.serialize();\n return await this.sendRawTransaction(wireTransaction, signersOrOptions);\n }\n if (signersOrOptions === undefined || !Array.isArray(signersOrOptions)) {\n throw new Error('Invalid arguments');\n }\n const signers = signersOrOptions;\n if (transaction.nonceInfo) {\n transaction.sign(...signers);\n } else {\n let disableCache = this._disableBlockhashCaching;\n for (;;) {\n const latestBlockhash = await this._blockhashWithExpiryBlockHeight(disableCache);\n transaction.lastValidBlockHeight = latestBlockhash.lastValidBlockHeight;\n transaction.recentBlockhash = latestBlockhash.blockhash;\n transaction.sign(...signers);\n if (!transaction.signature) {\n throw new Error('!signature'); // should never happen\n }\n const signature = transaction.signature.toString('base64');\n if (!this._blockhashInfo.transactionSignatures.includes(signature)) {\n // The signature of this transaction has not been seen before with the\n // current recentBlockhash, all done. Let's break\n this._blockhashInfo.transactionSignatures.push(signature);\n break;\n } else {\n // This transaction would be treated as duplicate (its derived signature\n // matched to one of already recorded signatures).\n // So, we must fetch a new blockhash for a different signature by disabling\n // our cache not to wait for the cache expiration (BLOCKHASH_CACHE_TIMEOUT_MS).\n disableCache = true;\n }\n }\n }\n const wireTransaction = transaction.serialize();\n return await this.sendRawTransaction(wireTransaction, options);\n }\n\n /**\n * Send a transaction that has already been signed and serialized into the\n * wire format\n */\n async sendRawTransaction(rawTransaction, options) {\n const encodedTransaction = toBuffer(rawTransaction).toString('base64');\n const result = await this.sendEncodedTransaction(encodedTransaction, options);\n return result;\n }\n\n /**\n * Send a transaction that has already been signed, serialized into the\n * wire format, and encoded as a base64 string\n */\n async sendEncodedTransaction(encodedTransaction, options) {\n const config = {\n encoding: 'base64'\n };\n const skipPreflight = options && options.skipPreflight;\n const preflightCommitment = options && options.preflightCommitment || this.commitment;\n if (options && options.maxRetries != null) {\n config.maxRetries = options.maxRetries;\n }\n if (options && options.minContextSlot != null) {\n config.minContextSlot = options.minContextSlot;\n }\n if (skipPreflight) {\n config.skipPreflight = skipPreflight;\n }\n if (preflightCommitment) {\n config.preflightCommitment = preflightCommitment;\n }\n const args = [encodedTransaction, config];\n const unsafeRes = await this._rpcRequest('sendTransaction', args);\n const res = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(unsafeRes, SendTransactionRpcResult);\n if ('error' in res) {\n let logs;\n if ('data' in res.error) {\n logs = res.error.data.logs;\n }\n throw new SendTransactionError('failed to send transaction: ' + res.error.message, logs);\n }\n return res.result;\n }\n\n /**\n * @internal\n */\n _wsOnOpen() {\n this._rpcWebSocketConnected = true;\n this._rpcWebSocketHeartbeat = setInterval(() => {\n // Ping server every 5s to prevent idle timeouts\n (async () => {\n try {\n await this._rpcWebSocket.notify('ping');\n // eslint-disable-next-line no-empty\n } catch {}\n })();\n }, 5000);\n this._updateSubscriptions();\n }\n\n /**\n * @internal\n */\n _wsOnError(err) {\n this._rpcWebSocketConnected = false;\n console.error('ws error:', err.message);\n }\n\n /**\n * @internal\n */\n _wsOnClose(code) {\n this._rpcWebSocketConnected = false;\n this._rpcWebSocketGeneration = (this._rpcWebSocketGeneration + 1) % Number.MAX_SAFE_INTEGER;\n if (this._rpcWebSocketIdleTimeout) {\n clearTimeout(this._rpcWebSocketIdleTimeout);\n this._rpcWebSocketIdleTimeout = null;\n }\n if (this._rpcWebSocketHeartbeat) {\n clearInterval(this._rpcWebSocketHeartbeat);\n this._rpcWebSocketHeartbeat = null;\n }\n if (code === 1000) {\n // explicit close, check if any subscriptions have been made since close\n this._updateSubscriptions();\n return;\n }\n\n // implicit close, prepare subscriptions for auto-reconnect\n this._subscriptionCallbacksByServerSubscriptionId = {};\n Object.entries(this._subscriptionsByHash).forEach(([hash, subscription]) => {\n this._setSubscription(hash, {\n ...subscription,\n state: 'pending'\n });\n });\n }\n\n /**\n * @internal\n */\n _setSubscription(hash, nextSubscription) {\n const prevState = this._subscriptionsByHash[hash]?.state;\n this._subscriptionsByHash[hash] = nextSubscription;\n if (prevState !== nextSubscription.state) {\n const stateChangeCallbacks = this._subscriptionStateChangeCallbacksByHash[hash];\n if (stateChangeCallbacks) {\n stateChangeCallbacks.forEach(cb => {\n try {\n cb(nextSubscription.state);\n // eslint-disable-next-line no-empty\n } catch {}\n });\n }\n }\n }\n\n /**\n * @internal\n */\n _onSubscriptionStateChange(clientSubscriptionId, callback) {\n const hash = this._subscriptionHashByClientSubscriptionId[clientSubscriptionId];\n if (hash == null) {\n return () => {};\n }\n const stateChangeCallbacks = this._subscriptionStateChangeCallbacksByHash[hash] ||= new Set();\n stateChangeCallbacks.add(callback);\n return () => {\n stateChangeCallbacks.delete(callback);\n if (stateChangeCallbacks.size === 0) {\n delete this._subscriptionStateChangeCallbacksByHash[hash];\n }\n };\n }\n\n /**\n * @internal\n */\n async _updateSubscriptions() {\n if (Object.keys(this._subscriptionsByHash).length === 0) {\n if (this._rpcWebSocketConnected) {\n this._rpcWebSocketConnected = false;\n this._rpcWebSocketIdleTimeout = setTimeout(() => {\n this._rpcWebSocketIdleTimeout = null;\n try {\n this._rpcWebSocket.close();\n } catch (err) {\n // swallow error if socket has already been closed.\n if (err instanceof Error) {\n console.log(`Error when closing socket connection: ${err.message}`);\n }\n }\n }, 500);\n }\n return;\n }\n if (this._rpcWebSocketIdleTimeout !== null) {\n clearTimeout(this._rpcWebSocketIdleTimeout);\n this._rpcWebSocketIdleTimeout = null;\n this._rpcWebSocketConnected = true;\n }\n if (!this._rpcWebSocketConnected) {\n this._rpcWebSocket.connect();\n return;\n }\n const activeWebSocketGeneration = this._rpcWebSocketGeneration;\n const isCurrentConnectionStillActive = () => {\n return activeWebSocketGeneration === this._rpcWebSocketGeneration;\n };\n await Promise.all(\n // Don't be tempted to change this to `Object.entries`. We call\n // `_updateSubscriptions` recursively when processing the state,\n // so it's important that we look up the *current* version of\n // each subscription, every time we process a hash.\n Object.keys(this._subscriptionsByHash).map(async hash => {\n const subscription = this._subscriptionsByHash[hash];\n if (subscription === undefined) {\n // This entry has since been deleted. Skip.\n return;\n }\n switch (subscription.state) {\n case 'pending':\n case 'unsubscribed':\n if (subscription.callbacks.size === 0) {\n /**\n * You can end up here when:\n *\n * - a subscription has recently unsubscribed\n * without having new callbacks added to it\n * while the unsubscribe was in flight, or\n * - when a pending subscription has its\n * listeners removed before a request was\n * sent to the server.\n *\n * Being that nobody is interested in this\n * subscription any longer, delete it.\n */\n delete this._subscriptionsByHash[hash];\n if (subscription.state === 'unsubscribed') {\n delete this._subscriptionCallbacksByServerSubscriptionId[subscription.serverSubscriptionId];\n }\n await this._updateSubscriptions();\n return;\n }\n await (async () => {\n const {\n args,\n method\n } = subscription;\n try {\n this._setSubscription(hash, {\n ...subscription,\n state: 'subscribing'\n });\n const serverSubscriptionId = await this._rpcWebSocket.call(method, args);\n this._setSubscription(hash, {\n ...subscription,\n serverSubscriptionId,\n state: 'subscribed'\n });\n this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId] = subscription.callbacks;\n await this._updateSubscriptions();\n } catch (e) {\n if (e instanceof Error) {\n console.error(`${method} error for argument`, args, e.message);\n }\n if (!isCurrentConnectionStillActive()) {\n return;\n }\n // TODO: Maybe add an 'errored' state or a retry limit?\n this._setSubscription(hash, {\n ...subscription,\n state: 'pending'\n });\n await this._updateSubscriptions();\n }\n })();\n break;\n case 'subscribed':\n if (subscription.callbacks.size === 0) {\n // By the time we successfully set up a subscription\n // with the server, the client stopped caring about it.\n // Tear it down now.\n await (async () => {\n const {\n serverSubscriptionId,\n unsubscribeMethod\n } = subscription;\n if (this._subscriptionsAutoDisposedByRpc.has(serverSubscriptionId)) {\n /**\n * Special case.\n * If we're dealing with a subscription that has been auto-\n * disposed by the RPC, then we can skip the RPC call to\n * tear down the subscription here.\n *\n * NOTE: There is a proposal to eliminate this special case, here:\n * https://github.com/solana-labs/solana/issues/18892\n */\n this._subscriptionsAutoDisposedByRpc.delete(serverSubscriptionId);\n } else {\n this._setSubscription(hash, {\n ...subscription,\n state: 'unsubscribing'\n });\n this._setSubscription(hash, {\n ...subscription,\n state: 'unsubscribing'\n });\n try {\n await this._rpcWebSocket.call(unsubscribeMethod, [serverSubscriptionId]);\n } catch (e) {\n if (e instanceof Error) {\n console.error(`${unsubscribeMethod} error:`, e.message);\n }\n if (!isCurrentConnectionStillActive()) {\n return;\n }\n // TODO: Maybe add an 'errored' state or a retry limit?\n this._setSubscription(hash, {\n ...subscription,\n state: 'subscribed'\n });\n await this._updateSubscriptions();\n return;\n }\n }\n this._setSubscription(hash, {\n ...subscription,\n state: 'unsubscribed'\n });\n await this._updateSubscriptions();\n })();\n }\n break;\n }\n }));\n }\n\n /**\n * @internal\n */\n _handleServerNotification(serverSubscriptionId, callbackArgs) {\n const callbacks = this._subscriptionCallbacksByServerSubscriptionId[serverSubscriptionId];\n if (callbacks === undefined) {\n return;\n }\n callbacks.forEach(cb => {\n try {\n cb(\n // I failed to find a way to convince TypeScript that `cb` is of type\n // `TCallback` which is certainly compatible with `Parameters`.\n // See https://github.com/microsoft/TypeScript/issues/47615\n // @ts-ignore\n ...callbackArgs);\n } catch (e) {\n console.error(e);\n }\n });\n }\n\n /**\n * @internal\n */\n _wsOnAccountNotification(notification) {\n const {\n result,\n subscription\n } = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(notification, AccountNotificationResult);\n this._handleServerNotification(subscription, [result.value, result.context]);\n }\n\n /**\n * @internal\n */\n _makeSubscription(subscriptionConfig,\n /**\n * When preparing `args` for a call to `_makeSubscription`, be sure\n * to carefully apply a default `commitment` property, if necessary.\n *\n * - If the user supplied a `commitment` use that.\n * - Otherwise, if the `Connection::commitment` is set, use that.\n * - Otherwise, set it to the RPC server default: `finalized`.\n *\n * This is extremely important to ensure that these two fundamentally\n * identical subscriptions produce the same identifying hash:\n *\n * - A subscription made without specifying a commitment.\n * - A subscription made where the commitment specified is the same\n * as the default applied to the subscription above.\n *\n * Example; these two subscriptions must produce the same hash:\n *\n * - An `accountSubscribe` subscription for `'PUBKEY'`\n * - An `accountSubscribe` subscription for `'PUBKEY'` with commitment\n * `'finalized'`.\n *\n * See the 'making a subscription with defaulted params omitted' test\n * in `connection-subscriptions.ts` for more.\n */\n args) {\n const clientSubscriptionId = this._nextClientSubscriptionId++;\n const hash = fastStableStringify$1([subscriptionConfig.method, args], true /* isArrayProp */);\n const existingSubscription = this._subscriptionsByHash[hash];\n if (existingSubscription === undefined) {\n this._subscriptionsByHash[hash] = {\n ...subscriptionConfig,\n args,\n callbacks: new Set([subscriptionConfig.callback]),\n state: 'pending'\n };\n } else {\n existingSubscription.callbacks.add(subscriptionConfig.callback);\n }\n this._subscriptionHashByClientSubscriptionId[clientSubscriptionId] = hash;\n this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId] = async () => {\n delete this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId];\n delete this._subscriptionHashByClientSubscriptionId[clientSubscriptionId];\n const subscription = this._subscriptionsByHash[hash];\n assert(subscription !== undefined, `Could not find a \\`Subscription\\` when tearing down client subscription #${clientSubscriptionId}`);\n subscription.callbacks.delete(subscriptionConfig.callback);\n await this._updateSubscriptions();\n };\n this._updateSubscriptions();\n return clientSubscriptionId;\n }\n\n /**\n * Register a callback to be invoked whenever the specified account changes\n *\n * @param publicKey Public key of the account to monitor\n * @param callback Function to invoke whenever the account is changed\n * @param commitment Specify the commitment level account changes must reach before notification\n * @return subscription id\n */\n onAccountChange(publicKey, callback, commitment) {\n const args = this._buildArgs([publicKey.toBase58()], commitment || this._commitment || 'finalized',\n // Apply connection/server default.\n 'base64');\n return this._makeSubscription({\n callback,\n method: 'accountSubscribe',\n unsubscribeMethod: 'accountUnsubscribe'\n }, args);\n }\n\n /**\n * Deregister an account notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeAccountChangeListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'account change');\n }\n\n /**\n * @internal\n */\n _wsOnProgramAccountNotification(notification) {\n const {\n result,\n subscription\n } = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(notification, ProgramAccountNotificationResult);\n this._handleServerNotification(subscription, [{\n accountId: result.value.pubkey,\n accountInfo: result.value.account\n }, result.context]);\n }\n\n /**\n * Register a callback to be invoked whenever accounts owned by the\n * specified program change\n *\n * @param programId Public key of the program to monitor\n * @param callback Function to invoke whenever the account is changed\n * @param commitment Specify the commitment level account changes must reach before notification\n * @param filters The program account filters to pass into the RPC method\n * @return subscription id\n */\n onProgramAccountChange(programId, callback, commitment, filters) {\n const args = this._buildArgs([programId.toBase58()], commitment || this._commitment || 'finalized',\n // Apply connection/server default.\n 'base64' /* encoding */, filters ? {\n filters: filters\n } : undefined /* extra */);\n return this._makeSubscription({\n callback,\n method: 'programSubscribe',\n unsubscribeMethod: 'programUnsubscribe'\n }, args);\n }\n\n /**\n * Deregister an account notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeProgramAccountChangeListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'program account change');\n }\n\n /**\n * Registers a callback to be invoked whenever logs are emitted.\n */\n onLogs(filter, callback, commitment) {\n const args = this._buildArgs([typeof filter === 'object' ? {\n mentions: [filter.toString()]\n } : filter], commitment || this._commitment || 'finalized' // Apply connection/server default.\n );\n return this._makeSubscription({\n callback,\n method: 'logsSubscribe',\n unsubscribeMethod: 'logsUnsubscribe'\n }, args);\n }\n\n /**\n * Deregister a logs callback.\n *\n * @param id client subscription id to deregister.\n */\n async removeOnLogsListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'logs');\n }\n\n /**\n * @internal\n */\n _wsOnLogsNotification(notification) {\n const {\n result,\n subscription\n } = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(notification, LogsNotificationResult);\n this._handleServerNotification(subscription, [result.value, result.context]);\n }\n\n /**\n * @internal\n */\n _wsOnSlotNotification(notification) {\n const {\n result,\n subscription\n } = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(notification, SlotNotificationResult);\n this._handleServerNotification(subscription, [result]);\n }\n\n /**\n * Register a callback to be invoked upon slot changes\n *\n * @param callback Function to invoke whenever the slot changes\n * @return subscription id\n */\n onSlotChange(callback) {\n return this._makeSubscription({\n callback,\n method: 'slotSubscribe',\n unsubscribeMethod: 'slotUnsubscribe'\n }, [] /* args */);\n }\n\n /**\n * Deregister a slot notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeSlotChangeListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot change');\n }\n\n /**\n * @internal\n */\n _wsOnSlotUpdatesNotification(notification) {\n const {\n result,\n subscription\n } = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(notification, SlotUpdateNotificationResult);\n this._handleServerNotification(subscription, [result]);\n }\n\n /**\n * Register a callback to be invoked upon slot updates. {@link SlotUpdate}'s\n * may be useful to track live progress of a cluster.\n *\n * @param callback Function to invoke whenever the slot updates\n * @return subscription id\n */\n onSlotUpdate(callback) {\n return this._makeSubscription({\n callback,\n method: 'slotsUpdatesSubscribe',\n unsubscribeMethod: 'slotsUpdatesUnsubscribe'\n }, [] /* args */);\n }\n\n /**\n * Deregister a slot update notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeSlotUpdateListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'slot update');\n }\n\n /**\n * @internal\n */\n\n async _unsubscribeClientSubscription(clientSubscriptionId, subscriptionName) {\n const dispose = this._subscriptionDisposeFunctionsByClientSubscriptionId[clientSubscriptionId];\n if (dispose) {\n await dispose();\n } else {\n console.warn('Ignored unsubscribe request because an active subscription with id ' + `\\`${clientSubscriptionId}\\` for '${subscriptionName}' events ` + 'could not be found.');\n }\n }\n _buildArgs(args, override, encoding, extra) {\n const commitment = override || this._commitment;\n if (commitment || encoding || extra) {\n let options = {};\n if (encoding) {\n options.encoding = encoding;\n }\n if (commitment) {\n options.commitment = commitment;\n }\n if (extra) {\n options = Object.assign(options, extra);\n }\n args.push(options);\n }\n return args;\n }\n\n /**\n * @internal\n */\n _buildArgsAtLeastConfirmed(args, override, encoding, extra) {\n const commitment = override || this._commitment;\n if (commitment && !['confirmed', 'finalized'].includes(commitment)) {\n throw new Error('Using Connection with default commitment: `' + this._commitment + '`, but method requires at least `confirmed`');\n }\n return this._buildArgs(args, override, encoding, extra);\n }\n\n /**\n * @internal\n */\n _wsOnSignatureNotification(notification) {\n const {\n result,\n subscription\n } = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(notification, SignatureNotificationResult);\n if (result.value !== 'receivedSignature') {\n /**\n * Special case.\n * After a signature is processed, RPCs automatically dispose of the\n * subscription on the server side. We need to track which of these\n * subscriptions have been disposed in such a way, so that we know\n * whether the client is dealing with a not-yet-processed signature\n * (in which case we must tear down the server subscription) or an\n * already-processed signature (in which case the client can simply\n * clear out the subscription locally without telling the server).\n *\n * NOTE: There is a proposal to eliminate this special case, here:\n * https://github.com/solana-labs/solana/issues/18892\n */\n this._subscriptionsAutoDisposedByRpc.add(subscription);\n }\n this._handleServerNotification(subscription, result.value === 'receivedSignature' ? [{\n type: 'received'\n }, result.context] : [{\n type: 'status',\n result: result.value\n }, result.context]);\n }\n\n /**\n * Register a callback to be invoked upon signature updates\n *\n * @param signature Transaction signature string in base 58\n * @param callback Function to invoke on signature notifications\n * @param commitment Specify the commitment level signature must reach before notification\n * @return subscription id\n */\n onSignature(signature, callback, commitment) {\n const args = this._buildArgs([signature], commitment || this._commitment || 'finalized' // Apply connection/server default.\n );\n const clientSubscriptionId = this._makeSubscription({\n callback: (notification, context) => {\n if (notification.type === 'status') {\n callback(notification.result, context);\n // Signatures subscriptions are auto-removed by the RPC service\n // so no need to explicitly send an unsubscribe message.\n try {\n this.removeSignatureListener(clientSubscriptionId);\n // eslint-disable-next-line no-empty\n } catch (_err) {\n // Already removed.\n }\n }\n },\n method: 'signatureSubscribe',\n unsubscribeMethod: 'signatureUnsubscribe'\n }, args);\n return clientSubscriptionId;\n }\n\n /**\n * Register a callback to be invoked when a transaction is\n * received and/or processed.\n *\n * @param signature Transaction signature string in base 58\n * @param callback Function to invoke on signature notifications\n * @param options Enable received notifications and set the commitment\n * level that signature must reach before notification\n * @return subscription id\n */\n onSignatureWithOptions(signature, callback, options) {\n const {\n commitment,\n ...extra\n } = {\n ...options,\n commitment: options && options.commitment || this._commitment || 'finalized' // Apply connection/server default.\n };\n const args = this._buildArgs([signature], commitment, undefined /* encoding */, extra);\n const clientSubscriptionId = this._makeSubscription({\n callback: (notification, context) => {\n callback(notification, context);\n // Signatures subscriptions are auto-removed by the RPC service\n // so no need to explicitly send an unsubscribe message.\n try {\n this.removeSignatureListener(clientSubscriptionId);\n // eslint-disable-next-line no-empty\n } catch (_err) {\n // Already removed.\n }\n },\n method: 'signatureSubscribe',\n unsubscribeMethod: 'signatureUnsubscribe'\n }, args);\n return clientSubscriptionId;\n }\n\n /**\n * Deregister a signature notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeSignatureListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'signature result');\n }\n\n /**\n * @internal\n */\n _wsOnRootNotification(notification) {\n const {\n result,\n subscription\n } = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .create */ .Ue)(notification, RootNotificationResult);\n this._handleServerNotification(subscription, [result]);\n }\n\n /**\n * Register a callback to be invoked upon root changes\n *\n * @param callback Function to invoke whenever the root changes\n * @return subscription id\n */\n onRootChange(callback) {\n return this._makeSubscription({\n callback,\n method: 'rootSubscribe',\n unsubscribeMethod: 'rootUnsubscribe'\n }, [] /* args */);\n }\n\n /**\n * Deregister a root notification callback\n *\n * @param id client subscription id to deregister\n */\n async removeRootChangeListener(clientSubscriptionId) {\n await this._unsubscribeClientSubscription(clientSubscriptionId, 'root change');\n }\n}\n\n/**\n * Keypair signer interface\n */\n\n/**\n * An account keypair used for signing transactions.\n */\nclass Keypair {\n /**\n * Create a new keypair instance.\n * Generate random keypair if no {@link Ed25519Keypair} is provided.\n *\n * @param {Ed25519Keypair} keypair ed25519 keypair\n */\n constructor(keypair) {\n this._keypair = void 0;\n this._keypair = keypair ?? generateKeypair();\n }\n\n /**\n * Generate a new random keypair\n *\n * @returns {Keypair} Keypair\n */\n static generate() {\n return new Keypair(generateKeypair());\n }\n\n /**\n * Create a keypair from a raw secret key byte array.\n *\n * This method should only be used to recreate a keypair from a previously\n * generated secret key. Generating keypairs from a random seed should be done\n * with the {@link Keypair.fromSeed} method.\n *\n * @throws error if the provided secret key is invalid and validation is not skipped.\n *\n * @param secretKey secret key byte array\n * @param options skip secret key validation\n *\n * @returns {Keypair} Keypair\n */\n static fromSecretKey(secretKey, options) {\n if (secretKey.byteLength !== 64) {\n throw new Error('bad secret key size');\n }\n const publicKey = secretKey.slice(32, 64);\n if (!options || !options.skipValidation) {\n const privateScalar = secretKey.slice(0, 32);\n const computedPublicKey = getPublicKey(privateScalar);\n for (let ii = 0; ii < 32; ii++) {\n if (publicKey[ii] !== computedPublicKey[ii]) {\n throw new Error('provided secretKey is invalid');\n }\n }\n }\n return new Keypair({\n publicKey,\n secretKey\n });\n }\n\n /**\n * Generate a keypair from a 32 byte seed.\n *\n * @param seed seed byte array\n *\n * @returns {Keypair} Keypair\n */\n static fromSeed(seed) {\n const publicKey = getPublicKey(seed);\n const secretKey = new Uint8Array(64);\n secretKey.set(seed);\n secretKey.set(publicKey, 32);\n return new Keypair({\n publicKey,\n secretKey\n });\n }\n\n /**\n * The public key for this keypair\n *\n * @returns {PublicKey} PublicKey\n */\n get publicKey() {\n return new PublicKey(this._keypair.publicKey);\n }\n\n /**\n * The raw secret key for this keypair\n * @returns {Uint8Array} Secret key in an array of Uint8 bytes\n */\n get secretKey() {\n return new Uint8Array(this._keypair.secretKey);\n }\n}\n\n/**\n * An enumeration of valid LookupTableInstructionType's\n */\n\n/**\n * An enumeration of valid address lookup table InstructionType's\n * @internal\n */\nconst LOOKUP_TABLE_INSTRUCTION_LAYOUTS = Object.freeze({\n CreateLookupTable: {\n index: 0,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), u64('recentSlot'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('bumpSeed')])\n },\n FreezeLookupTable: {\n index: 1,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction')])\n },\n ExtendLookupTable: {\n index: 2,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), u64(), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(publicKey(), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.offset(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32(), -8), 'addresses')])\n },\n DeactivateLookupTable: {\n index: 3,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction')])\n },\n CloseLookupTable: {\n index: 4,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction')])\n }\n});\nclass AddressLookupTableInstruction {\n /**\n * @internal\n */\n constructor() {}\n static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction');\n const index = instructionTypeLayout.decode(instruction.data);\n let type;\n for (const [layoutType, layout] of Object.entries(LOOKUP_TABLE_INSTRUCTION_LAYOUTS)) {\n if (layout.index == index) {\n type = layoutType;\n break;\n }\n }\n if (!type) {\n throw new Error('Invalid Instruction. Should be a LookupTable Instruction');\n }\n return type;\n }\n static decodeCreateLookupTable(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeysLength(instruction.keys, 4);\n const {\n recentSlot\n } = decodeData$1(LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable, instruction.data);\n return {\n authority: instruction.keys[1].pubkey,\n payer: instruction.keys[2].pubkey,\n recentSlot: Number(recentSlot)\n };\n }\n static decodeExtendLookupTable(instruction) {\n this.checkProgramId(instruction.programId);\n if (instruction.keys.length < 2) {\n throw new Error(`invalid instruction; found ${instruction.keys.length} keys, expected at least 2`);\n }\n const {\n addresses\n } = decodeData$1(LOOKUP_TABLE_INSTRUCTION_LAYOUTS.ExtendLookupTable, instruction.data);\n return {\n lookupTable: instruction.keys[0].pubkey,\n authority: instruction.keys[1].pubkey,\n payer: instruction.keys.length > 2 ? instruction.keys[2].pubkey : undefined,\n addresses: addresses.map(buffer => new PublicKey(buffer))\n };\n }\n static decodeCloseLookupTable(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeysLength(instruction.keys, 3);\n return {\n lookupTable: instruction.keys[0].pubkey,\n authority: instruction.keys[1].pubkey,\n recipient: instruction.keys[2].pubkey\n };\n }\n static decodeFreezeLookupTable(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeysLength(instruction.keys, 2);\n return {\n lookupTable: instruction.keys[0].pubkey,\n authority: instruction.keys[1].pubkey\n };\n }\n static decodeDeactivateLookupTable(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeysLength(instruction.keys, 2);\n return {\n lookupTable: instruction.keys[0].pubkey,\n authority: instruction.keys[1].pubkey\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId) {\n if (!programId.equals(AddressLookupTableProgram.programId)) {\n throw new Error('invalid instruction; programId is not AddressLookupTable Program');\n }\n }\n /**\n * @internal\n */\n static checkKeysLength(keys, expectedLength) {\n if (keys.length < expectedLength) {\n throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`);\n }\n }\n}\nclass AddressLookupTableProgram {\n /**\n * @internal\n */\n constructor() {}\n static createLookupTable(params) {\n const [lookupTableAddress, bumpSeed] = PublicKey.findProgramAddressSync([params.authority.toBuffer(), (0,bigint_buffer__WEBPACK_IMPORTED_MODULE_5__.toBufferLE)(BigInt(params.recentSlot), 8)], this.programId);\n const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CreateLookupTable;\n const data = encodeData(type, {\n recentSlot: BigInt(params.recentSlot),\n bumpSeed: bumpSeed\n });\n const keys = [{\n pubkey: lookupTableAddress,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authority,\n isSigner: true,\n isWritable: false\n }, {\n pubkey: params.payer,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: SystemProgram.programId,\n isSigner: false,\n isWritable: false\n }];\n return [new TransactionInstruction({\n programId: this.programId,\n keys: keys,\n data: data\n }), lookupTableAddress];\n }\n static freezeLookupTable(params) {\n const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.FreezeLookupTable;\n const data = encodeData(type);\n const keys = [{\n pubkey: params.lookupTable,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authority,\n isSigner: true,\n isWritable: false\n }];\n return new TransactionInstruction({\n programId: this.programId,\n keys: keys,\n data: data\n });\n }\n static extendLookupTable(params) {\n const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.ExtendLookupTable;\n const data = encodeData(type, {\n addresses: params.addresses.map(addr => addr.toBytes())\n });\n const keys = [{\n pubkey: params.lookupTable,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authority,\n isSigner: true,\n isWritable: false\n }];\n if (params.payer) {\n keys.push({\n pubkey: params.payer,\n isSigner: true,\n isWritable: true\n }, {\n pubkey: SystemProgram.programId,\n isSigner: false,\n isWritable: false\n });\n }\n return new TransactionInstruction({\n programId: this.programId,\n keys: keys,\n data: data\n });\n }\n static deactivateLookupTable(params) {\n const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.DeactivateLookupTable;\n const data = encodeData(type);\n const keys = [{\n pubkey: params.lookupTable,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authority,\n isSigner: true,\n isWritable: false\n }];\n return new TransactionInstruction({\n programId: this.programId,\n keys: keys,\n data: data\n });\n }\n static closeLookupTable(params) {\n const type = LOOKUP_TABLE_INSTRUCTION_LAYOUTS.CloseLookupTable;\n const data = encodeData(type);\n const keys = [{\n pubkey: params.lookupTable,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: params.authority,\n isSigner: true,\n isWritable: false\n }, {\n pubkey: params.recipient,\n isSigner: false,\n isWritable: true\n }];\n return new TransactionInstruction({\n programId: this.programId,\n keys: keys,\n data: data\n });\n }\n}\nAddressLookupTableProgram.programId = new PublicKey('AddressLookupTab1e1111111111111111111111111');\n\n/**\n * Compute Budget Instruction class\n */\nclass ComputeBudgetInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a compute budget instruction and retrieve the instruction type.\n */\n static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n let type;\n for (const [ixType, layout] of Object.entries(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType;\n break;\n }\n }\n if (!type) {\n throw new Error('Instruction type incorrect; not a ComputeBudgetInstruction');\n }\n return type;\n }\n\n /**\n * Decode request units compute budget instruction and retrieve the instruction params.\n */\n static decodeRequestUnits(instruction) {\n this.checkProgramId(instruction.programId);\n const {\n units,\n additionalFee\n } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits, instruction.data);\n return {\n units,\n additionalFee\n };\n }\n\n /**\n * Decode request heap frame compute budget instruction and retrieve the instruction params.\n */\n static decodeRequestHeapFrame(instruction) {\n this.checkProgramId(instruction.programId);\n const {\n bytes\n } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestHeapFrame, instruction.data);\n return {\n bytes\n };\n }\n\n /**\n * Decode set compute unit limit compute budget instruction and retrieve the instruction params.\n */\n static decodeSetComputeUnitLimit(instruction) {\n this.checkProgramId(instruction.programId);\n const {\n units\n } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit, instruction.data);\n return {\n units\n };\n }\n\n /**\n * Decode set compute unit price compute budget instruction and retrieve the instruction params.\n */\n static decodeSetComputeUnitPrice(instruction) {\n this.checkProgramId(instruction.programId);\n const {\n microLamports\n } = decodeData$1(COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice, instruction.data);\n return {\n microLamports\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId) {\n if (!programId.equals(ComputeBudgetProgram.programId)) {\n throw new Error('invalid instruction; programId is not ComputeBudgetProgram');\n }\n }\n}\n\n/**\n * An enumeration of valid ComputeBudgetInstructionType's\n */\n\n/**\n * Request units instruction params\n */\n\n/**\n * Request heap frame instruction params\n */\n\n/**\n * Set compute unit limit instruction params\n */\n\n/**\n * Set compute unit price instruction params\n */\n\n/**\n * An enumeration of valid ComputeBudget InstructionType's\n * @internal\n */\nconst COMPUTE_BUDGET_INSTRUCTION_LAYOUTS = Object.freeze({\n RequestUnits: {\n index: 0,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('instruction'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('units'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('additionalFee')])\n },\n RequestHeapFrame: {\n index: 1,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('instruction'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('bytes')])\n },\n SetComputeUnitLimit: {\n index: 2,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('instruction'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('units')])\n },\n SetComputeUnitPrice: {\n index: 3,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('instruction'), u64('microLamports')])\n }\n});\n\n/**\n * Factory class for transaction instructions to interact with the Compute Budget program\n */\nclass ComputeBudgetProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the Compute Budget program\n */\n\n /**\n * @deprecated Instead, call {@link setComputeUnitLimit} and/or {@link setComputeUnitPrice}\n */\n static requestUnits(params) {\n const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestUnits;\n const data = encodeData(type, params);\n return new TransactionInstruction({\n keys: [],\n programId: this.programId,\n data\n });\n }\n static requestHeapFrame(params) {\n const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.RequestHeapFrame;\n const data = encodeData(type, params);\n return new TransactionInstruction({\n keys: [],\n programId: this.programId,\n data\n });\n }\n static setComputeUnitLimit(params) {\n const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitLimit;\n const data = encodeData(type, params);\n return new TransactionInstruction({\n keys: [],\n programId: this.programId,\n data\n });\n }\n static setComputeUnitPrice(params) {\n const type = COMPUTE_BUDGET_INSTRUCTION_LAYOUTS.SetComputeUnitPrice;\n const data = encodeData(type, {\n microLamports: BigInt(params.microLamports)\n });\n return new TransactionInstruction({\n keys: [],\n programId: this.programId,\n data\n });\n }\n}\nComputeBudgetProgram.programId = new PublicKey('ComputeBudget111111111111111111111111111111');\n\nconst PRIVATE_KEY_BYTES$1 = 64;\nconst PUBLIC_KEY_BYTES$1 = 32;\nconst SIGNATURE_BYTES = 64;\n\n/**\n * Params for creating an ed25519 instruction using a public key\n */\n\n/**\n * Params for creating an ed25519 instruction using a private key\n */\n\nconst ED25519_INSTRUCTION_LAYOUT = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('numSignatures'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('padding'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('signatureOffset'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('signatureInstructionIndex'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('publicKeyOffset'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('publicKeyInstructionIndex'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('messageDataOffset'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('messageDataSize'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('messageInstructionIndex')]);\nclass Ed25519Program {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the ed25519 program\n */\n\n /**\n * Create an ed25519 instruction with a public key and signature. The\n * public key must be a buffer that is 32 bytes long, and the signature\n * must be a buffer of 64 bytes.\n */\n static createInstructionWithPublicKey(params) {\n const {\n publicKey,\n message,\n signature,\n instructionIndex\n } = params;\n assert(publicKey.length === PUBLIC_KEY_BYTES$1, `Public Key must be ${PUBLIC_KEY_BYTES$1} bytes but received ${publicKey.length} bytes`);\n assert(signature.length === SIGNATURE_BYTES, `Signature must be ${SIGNATURE_BYTES} bytes but received ${signature.length} bytes`);\n const publicKeyOffset = ED25519_INSTRUCTION_LAYOUT.span;\n const signatureOffset = publicKeyOffset + publicKey.length;\n const messageDataOffset = signatureOffset + signature.length;\n const numSignatures = 1;\n const instructionData = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(messageDataOffset + message.length);\n const index = instructionIndex == null ? 0xffff // An index of `u16::MAX` makes it default to the current instruction.\n : instructionIndex;\n ED25519_INSTRUCTION_LAYOUT.encode({\n numSignatures,\n padding: 0,\n signatureOffset,\n signatureInstructionIndex: index,\n publicKeyOffset,\n publicKeyInstructionIndex: index,\n messageDataOffset,\n messageDataSize: message.length,\n messageInstructionIndex: index\n }, instructionData);\n instructionData.fill(publicKey, publicKeyOffset);\n instructionData.fill(signature, signatureOffset);\n instructionData.fill(message, messageDataOffset);\n return new TransactionInstruction({\n keys: [],\n programId: Ed25519Program.programId,\n data: instructionData\n });\n }\n\n /**\n * Create an ed25519 instruction with a private key. The private key\n * must be a buffer that is 64 bytes long.\n */\n static createInstructionWithPrivateKey(params) {\n const {\n privateKey,\n message,\n instructionIndex\n } = params;\n assert(privateKey.length === PRIVATE_KEY_BYTES$1, `Private key must be ${PRIVATE_KEY_BYTES$1} bytes but received ${privateKey.length} bytes`);\n try {\n const keypair = Keypair.fromSecretKey(privateKey);\n const publicKey = keypair.publicKey.toBytes();\n const signature = sign(message, keypair.secretKey);\n return this.createInstructionWithPublicKey({\n publicKey,\n message,\n signature,\n instructionIndex\n });\n } catch (error) {\n throw new Error(`Error creating instruction; ${error}`);\n }\n }\n}\nEd25519Program.programId = new PublicKey('Ed25519SigVerify111111111111111111111111111');\n\nconst ecdsaSign = (msgHash, privKey) => {\n const signature = _noble_curves_secp256k1__WEBPACK_IMPORTED_MODULE_12__/* .secp256k1.sign */ .kA.sign(msgHash, privKey);\n return [signature.toCompactRawBytes(), signature.recovery];\n};\n_noble_curves_secp256k1__WEBPACK_IMPORTED_MODULE_12__/* .secp256k1.utils.isValidPrivateKey */ .kA.utils.isValidPrivateKey;\nconst publicKeyCreate = _noble_curves_secp256k1__WEBPACK_IMPORTED_MODULE_12__/* .secp256k1.getPublicKey */ .kA.getPublicKey;\n\nconst PRIVATE_KEY_BYTES = 32;\nconst ETHEREUM_ADDRESS_BYTES = 20;\nconst PUBLIC_KEY_BYTES = 64;\nconst SIGNATURE_OFFSETS_SERIALIZED_SIZE = 11;\n\n/**\n * Params for creating an secp256k1 instruction using a public key\n */\n\n/**\n * Params for creating an secp256k1 instruction using an Ethereum address\n */\n\n/**\n * Params for creating an secp256k1 instruction using a private key\n */\n\nconst SECP256K1_INSTRUCTION_LAYOUT = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('numSignatures'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('signatureOffset'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('signatureInstructionIndex'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('ethAddressOffset'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('ethAddressInstructionIndex'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('messageDataOffset'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u16('messageDataSize'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('messageInstructionIndex'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(20, 'ethAddress'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.blob(64, 'signature'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('recoveryId')]);\nclass Secp256k1Program {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the secp256k1 program\n */\n\n /**\n * Construct an Ethereum address from a secp256k1 public key buffer.\n * @param {Buffer} publicKey a 64 byte secp256k1 public key buffer\n */\n static publicKeyToEthAddress(publicKey) {\n assert(publicKey.length === PUBLIC_KEY_BYTES, `Public key must be ${PUBLIC_KEY_BYTES} bytes but received ${publicKey.length} bytes`);\n try {\n return buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from((0,_noble_hashes_sha3__WEBPACK_IMPORTED_MODULE_13__/* .keccak_256 */ .fr)(toBuffer(publicKey))).slice(-ETHEREUM_ADDRESS_BYTES);\n } catch (error) {\n throw new Error(`Error constructing Ethereum address: ${error}`);\n }\n }\n\n /**\n * Create an secp256k1 instruction with a public key. The public key\n * must be a buffer that is 64 bytes long.\n */\n static createInstructionWithPublicKey(params) {\n const {\n publicKey,\n message,\n signature,\n recoveryId,\n instructionIndex\n } = params;\n return Secp256k1Program.createInstructionWithEthAddress({\n ethAddress: Secp256k1Program.publicKeyToEthAddress(publicKey),\n message,\n signature,\n recoveryId,\n instructionIndex\n });\n }\n\n /**\n * Create an secp256k1 instruction with an Ethereum address. The address\n * must be a hex string or a buffer that is 20 bytes long.\n */\n static createInstructionWithEthAddress(params) {\n const {\n ethAddress: rawAddress,\n message,\n signature,\n recoveryId,\n instructionIndex = 0\n } = params;\n let ethAddress;\n if (typeof rawAddress === 'string') {\n if (rawAddress.startsWith('0x')) {\n ethAddress = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(rawAddress.substr(2), 'hex');\n } else {\n ethAddress = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(rawAddress, 'hex');\n }\n } else {\n ethAddress = rawAddress;\n }\n assert(ethAddress.length === ETHEREUM_ADDRESS_BYTES, `Address must be ${ETHEREUM_ADDRESS_BYTES} bytes but received ${ethAddress.length} bytes`);\n const dataStart = 1 + SIGNATURE_OFFSETS_SERIALIZED_SIZE;\n const ethAddressOffset = dataStart;\n const signatureOffset = dataStart + ethAddress.length;\n const messageDataOffset = signatureOffset + signature.length + 1;\n const numSignatures = 1;\n const instructionData = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.alloc(SECP256K1_INSTRUCTION_LAYOUT.span + message.length);\n SECP256K1_INSTRUCTION_LAYOUT.encode({\n numSignatures,\n signatureOffset,\n signatureInstructionIndex: instructionIndex,\n ethAddressOffset,\n ethAddressInstructionIndex: instructionIndex,\n messageDataOffset,\n messageDataSize: message.length,\n messageInstructionIndex: instructionIndex,\n signature: toBuffer(signature),\n ethAddress: toBuffer(ethAddress),\n recoveryId\n }, instructionData);\n instructionData.fill(toBuffer(message), SECP256K1_INSTRUCTION_LAYOUT.span);\n return new TransactionInstruction({\n keys: [],\n programId: Secp256k1Program.programId,\n data: instructionData\n });\n }\n\n /**\n * Create an secp256k1 instruction with a private key. The private key\n * must be a buffer that is 32 bytes long.\n */\n static createInstructionWithPrivateKey(params) {\n const {\n privateKey: pkey,\n message,\n instructionIndex\n } = params;\n assert(pkey.length === PRIVATE_KEY_BYTES, `Private key must be ${PRIVATE_KEY_BYTES} bytes but received ${pkey.length} bytes`);\n try {\n const privateKey = toBuffer(pkey);\n const publicKey = publicKeyCreate(privateKey, false /* isCompressed */).slice(1); // throw away leading byte\n const messageHash = buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from((0,_noble_hashes_sha3__WEBPACK_IMPORTED_MODULE_13__/* .keccak_256 */ .fr)(toBuffer(message)));\n const [signature, recoveryId] = ecdsaSign(messageHash, privateKey);\n return this.createInstructionWithPublicKey({\n publicKey,\n message,\n signature,\n recoveryId,\n instructionIndex\n });\n } catch (error) {\n throw new Error(`Error creating instruction; ${error}`);\n }\n }\n}\nSecp256k1Program.programId = new PublicKey('KeccakSecp256k11111111111111111111111111111');\n\nvar _class2;\n\n/**\n * Address of the stake config account which configures the rate\n * of stake warmup and cooldown as well as the slashing penalty.\n */\nconst STAKE_CONFIG_ID = new PublicKey('StakeConfig11111111111111111111111111111111');\n\n/**\n * Stake account authority info\n */\nclass Authorized {\n /**\n * Create a new Authorized object\n * @param staker the stake authority\n * @param withdrawer the withdraw authority\n */\n constructor(staker, withdrawer) {\n /** stake authority */\n this.staker = void 0;\n /** withdraw authority */\n this.withdrawer = void 0;\n this.staker = staker;\n this.withdrawer = withdrawer;\n }\n}\n/**\n * Stake account lockup info\n */\nclass Lockup {\n /**\n * Create a new Lockup object\n */\n constructor(unixTimestamp, epoch, custodian) {\n /** Unix timestamp of lockup expiration */\n this.unixTimestamp = void 0;\n /** Epoch of lockup expiration */\n this.epoch = void 0;\n /** Lockup custodian authority */\n this.custodian = void 0;\n this.unixTimestamp = unixTimestamp;\n this.epoch = epoch;\n this.custodian = custodian;\n }\n\n /**\n * Default, inactive Lockup value\n */\n}\n_class2 = Lockup;\nLockup.default = new _class2(0, 0, PublicKey.default);\n/**\n * Create stake account transaction params\n */\n/**\n * Create stake account with seed transaction params\n */\n/**\n * Initialize stake instruction params\n */\n/**\n * Delegate stake instruction params\n */\n/**\n * Authorize stake instruction params\n */\n/**\n * Authorize stake instruction params using a derived key\n */\n/**\n * Split stake instruction params\n */\n/**\n * Split with seed transaction params\n */\n/**\n * Withdraw stake instruction params\n */\n/**\n * Deactivate stake instruction params\n */\n/**\n * Merge stake instruction params\n */\n/**\n * Stake Instruction class\n */\nclass StakeInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a stake instruction and retrieve the instruction type.\n */\n static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n let type;\n for (const [ixType, layout] of Object.entries(STAKE_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType;\n break;\n }\n }\n if (!type) {\n throw new Error('Instruction type incorrect; not a StakeInstruction');\n }\n return type;\n }\n\n /**\n * Decode a initialize stake instruction and retrieve the instruction params.\n */\n static decodeInitialize(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n authorized,\n lockup\n } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Initialize, instruction.data);\n return {\n stakePubkey: instruction.keys[0].pubkey,\n authorized: new Authorized(new PublicKey(authorized.staker), new PublicKey(authorized.withdrawer)),\n lockup: new Lockup(lockup.unixTimestamp, lockup.epoch, new PublicKey(lockup.custodian))\n };\n }\n\n /**\n * Decode a delegate stake instruction and retrieve the instruction params.\n */\n static decodeDelegate(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 6);\n decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Delegate, instruction.data);\n return {\n stakePubkey: instruction.keys[0].pubkey,\n votePubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[5].pubkey\n };\n }\n\n /**\n * Decode an authorize stake instruction and retrieve the instruction params.\n */\n static decodeAuthorize(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n newAuthorized,\n stakeAuthorizationType\n } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Authorize, instruction.data);\n const o = {\n stakePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n stakeAuthorizationType: {\n index: stakeAuthorizationType\n }\n };\n if (instruction.keys.length > 3) {\n o.custodianPubkey = instruction.keys[3].pubkey;\n }\n return o;\n }\n\n /**\n * Decode an authorize-with-seed stake instruction and retrieve the instruction params.\n */\n static decodeAuthorizeWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 2);\n const {\n newAuthorized,\n stakeAuthorizationType,\n authoritySeed,\n authorityOwner\n } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed, instruction.data);\n const o = {\n stakePubkey: instruction.keys[0].pubkey,\n authorityBase: instruction.keys[1].pubkey,\n authoritySeed: authoritySeed,\n authorityOwner: new PublicKey(authorityOwner),\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n stakeAuthorizationType: {\n index: stakeAuthorizationType\n }\n };\n if (instruction.keys.length > 3) {\n o.custodianPubkey = instruction.keys[3].pubkey;\n }\n return o;\n }\n\n /**\n * Decode a split stake instruction and retrieve the instruction params.\n */\n static decodeSplit(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n lamports\n } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Split, instruction.data);\n return {\n stakePubkey: instruction.keys[0].pubkey,\n splitStakePubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n lamports\n };\n }\n\n /**\n * Decode a merge stake instruction and retrieve the instruction params.\n */\n static decodeMerge(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Merge, instruction.data);\n return {\n stakePubkey: instruction.keys[0].pubkey,\n sourceStakePubKey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey\n };\n }\n\n /**\n * Decode a withdraw stake instruction and retrieve the instruction params.\n */\n static decodeWithdraw(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 5);\n const {\n lamports\n } = decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Withdraw, instruction.data);\n const o = {\n stakePubkey: instruction.keys[0].pubkey,\n toPubkey: instruction.keys[1].pubkey,\n authorizedPubkey: instruction.keys[4].pubkey,\n lamports\n };\n if (instruction.keys.length > 5) {\n o.custodianPubkey = instruction.keys[5].pubkey;\n }\n return o;\n }\n\n /**\n * Decode a deactivate stake instruction and retrieve the instruction params.\n */\n static decodeDeactivate(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n decodeData$1(STAKE_INSTRUCTION_LAYOUTS.Deactivate, instruction.data);\n return {\n stakePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId) {\n if (!programId.equals(StakeProgram.programId)) {\n throw new Error('invalid instruction; programId is not StakeProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys, expectedLength) {\n if (keys.length < expectedLength) {\n throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`);\n }\n }\n}\n\n/**\n * An enumeration of valid StakeInstructionType's\n */\n\n/**\n * An enumeration of valid stake InstructionType's\n * @internal\n */\nconst STAKE_INSTRUCTION_LAYOUTS = Object.freeze({\n Initialize: {\n index: 0,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), authorized(), lockup()])\n },\n Authorize: {\n index: 1,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), publicKey('newAuthorized'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('stakeAuthorizationType')])\n },\n Delegate: {\n index: 2,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction')])\n },\n Split: {\n index: 3,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('lamports')])\n },\n Withdraw: {\n index: 4,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('lamports')])\n },\n Deactivate: {\n index: 5,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction')])\n },\n Merge: {\n index: 7,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction')])\n },\n AuthorizeWithSeed: {\n index: 8,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), publicKey('newAuthorized'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('stakeAuthorizationType'), rustString('authoritySeed'), publicKey('authorityOwner')])\n }\n});\n\n/**\n * Stake authorization type\n */\n\n/**\n * An enumeration of valid StakeAuthorizationLayout's\n */\nconst StakeAuthorizationLayout = Object.freeze({\n Staker: {\n index: 0\n },\n Withdrawer: {\n index: 1\n }\n});\n\n/**\n * Factory class for transactions to interact with the Stake program\n */\nclass StakeProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the Stake program\n */\n\n /**\n * Generate an Initialize instruction to add to a Stake Create transaction\n */\n static initialize(params) {\n const {\n stakePubkey,\n authorized,\n lockup: maybeLockup\n } = params;\n const lockup = maybeLockup || Lockup.default;\n const type = STAKE_INSTRUCTION_LAYOUTS.Initialize;\n const data = encodeData(type, {\n authorized: {\n staker: toBuffer(authorized.staker.toBuffer()),\n withdrawer: toBuffer(authorized.withdrawer.toBuffer())\n },\n lockup: {\n unixTimestamp: lockup.unixTimestamp,\n epoch: lockup.epoch,\n custodian: toBuffer(lockup.custodian.toBuffer())\n }\n });\n const instructionData = {\n keys: [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false\n }],\n programId: this.programId,\n data\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a Transaction that creates a new Stake account at\n * an address generated with `from`, a seed, and the Stake programId\n */\n static createAccountWithSeed(params) {\n const transaction = new Transaction();\n transaction.add(SystemProgram.createAccountWithSeed({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n basePubkey: params.basePubkey,\n seed: params.seed,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId\n }));\n const {\n stakePubkey,\n authorized,\n lockup\n } = params;\n return transaction.add(this.initialize({\n stakePubkey,\n authorized,\n lockup\n }));\n }\n\n /**\n * Generate a Transaction that creates a new Stake account\n */\n static createAccount(params) {\n const transaction = new Transaction();\n transaction.add(SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.stakePubkey,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId\n }));\n const {\n stakePubkey,\n authorized,\n lockup\n } = params;\n return transaction.add(this.initialize({\n stakePubkey,\n authorized,\n lockup\n }));\n }\n\n /**\n * Generate a Transaction that delegates Stake tokens to a validator\n * Vote PublicKey. This transaction can also be used to redelegate Stake\n * to a new validator Vote PublicKey.\n */\n static delegate(params) {\n const {\n stakePubkey,\n authorizedPubkey,\n votePubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Delegate;\n const data = encodeData(type);\n return new Transaction().add({\n keys: [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: votePubkey,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: STAKE_CONFIG_ID,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a Transaction that authorizes a new PublicKey as Staker\n * or Withdrawer on the Stake account.\n */\n static authorize(params) {\n const {\n stakePubkey,\n authorizedPubkey,\n newAuthorizedPubkey,\n stakeAuthorizationType,\n custodianPubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Authorize;\n const data = encodeData(type, {\n newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()),\n stakeAuthorizationType: stakeAuthorizationType.index\n });\n const keys = [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }];\n if (custodianPubkey) {\n keys.push({\n pubkey: custodianPubkey,\n isSigner: true,\n isWritable: false\n });\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a Transaction that authorizes a new PublicKey as Staker\n * or Withdrawer on the Stake account.\n */\n static authorizeWithSeed(params) {\n const {\n stakePubkey,\n authorityBase,\n authoritySeed,\n authorityOwner,\n newAuthorizedPubkey,\n stakeAuthorizationType,\n custodianPubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed;\n const data = encodeData(type, {\n newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()),\n stakeAuthorizationType: stakeAuthorizationType.index,\n authoritySeed: authoritySeed,\n authorityOwner: toBuffer(authorityOwner.toBuffer())\n });\n const keys = [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: authorityBase,\n isSigner: true,\n isWritable: false\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }];\n if (custodianPubkey) {\n keys.push({\n pubkey: custodianPubkey,\n isSigner: true,\n isWritable: false\n });\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * @internal\n */\n static splitInstruction(params) {\n const {\n stakePubkey,\n authorizedPubkey,\n splitStakePubkey,\n lamports\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Split;\n const data = encodeData(type, {\n lamports\n });\n return new TransactionInstruction({\n keys: [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: splitStakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a Transaction that splits Stake tokens into another stake account\n */\n static split(params) {\n const transaction = new Transaction();\n transaction.add(SystemProgram.createAccount({\n fromPubkey: params.authorizedPubkey,\n newAccountPubkey: params.splitStakePubkey,\n lamports: 0,\n space: this.space,\n programId: this.programId\n }));\n return transaction.add(this.splitInstruction(params));\n }\n\n /**\n * Generate a Transaction that splits Stake tokens into another account\n * derived from a base public key and seed\n */\n static splitWithSeed(params) {\n const {\n stakePubkey,\n authorizedPubkey,\n splitStakePubkey,\n basePubkey,\n seed,\n lamports\n } = params;\n const transaction = new Transaction();\n transaction.add(SystemProgram.allocate({\n accountPubkey: splitStakePubkey,\n basePubkey,\n seed,\n space: this.space,\n programId: this.programId\n }));\n return transaction.add(this.splitInstruction({\n stakePubkey,\n authorizedPubkey,\n splitStakePubkey,\n lamports\n }));\n }\n\n /**\n * Generate a Transaction that merges Stake accounts.\n */\n static merge(params) {\n const {\n stakePubkey,\n sourceStakePubKey,\n authorizedPubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Merge;\n const data = encodeData(type);\n return new Transaction().add({\n keys: [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: sourceStakePubKey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a Transaction that withdraws deactivated Stake tokens.\n */\n static withdraw(params) {\n const {\n stakePubkey,\n authorizedPubkey,\n toPubkey,\n lamports,\n custodianPubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Withdraw;\n const data = encodeData(type, {\n lamports\n });\n const keys = [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: toPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_STAKE_HISTORY_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }];\n if (custodianPubkey) {\n keys.push({\n pubkey: custodianPubkey,\n isSigner: true,\n isWritable: false\n });\n }\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a Transaction that deactivates Stake tokens.\n */\n static deactivate(params) {\n const {\n stakePubkey,\n authorizedPubkey\n } = params;\n const type = STAKE_INSTRUCTION_LAYOUTS.Deactivate;\n const data = encodeData(type);\n return new Transaction().add({\n keys: [{\n pubkey: stakePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n });\n }\n}\nStakeProgram.programId = new PublicKey('Stake11111111111111111111111111111111111111');\n/**\n * Max space of a Stake account\n *\n * This is generated from the solana-stake-program StakeState struct as\n * `StakeState::size_of()`:\n * https://docs.rs/solana-stake-program/latest/solana_stake_program/stake_state/enum.StakeState.html\n */\nStakeProgram.space = 200;\n\n/**\n * Vote account info\n */\nclass VoteInit {\n /** [0, 100] */\n\n constructor(nodePubkey, authorizedVoter, authorizedWithdrawer, commission) {\n this.nodePubkey = void 0;\n this.authorizedVoter = void 0;\n this.authorizedWithdrawer = void 0;\n this.commission = void 0;\n this.nodePubkey = nodePubkey;\n this.authorizedVoter = authorizedVoter;\n this.authorizedWithdrawer = authorizedWithdrawer;\n this.commission = commission;\n }\n}\n\n/**\n * Create vote account transaction params\n */\n\n/**\n * InitializeAccount instruction params\n */\n\n/**\n * Authorize instruction params\n */\n\n/**\n * AuthorizeWithSeed instruction params\n */\n\n/**\n * Withdraw from vote account transaction params\n */\n\n/**\n * Vote Instruction class\n */\nclass VoteInstruction {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Decode a vote instruction and retrieve the instruction type.\n */\n static decodeInstructionType(instruction) {\n this.checkProgramId(instruction.programId);\n const instructionTypeLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction');\n const typeIndex = instructionTypeLayout.decode(instruction.data);\n let type;\n for (const [ixType, layout] of Object.entries(VOTE_INSTRUCTION_LAYOUTS)) {\n if (layout.index == typeIndex) {\n type = ixType;\n break;\n }\n }\n if (!type) {\n throw new Error('Instruction type incorrect; not a VoteInstruction');\n }\n return type;\n }\n\n /**\n * Decode an initialize vote instruction and retrieve the instruction params.\n */\n static decodeInitializeAccount(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 4);\n const {\n voteInit\n } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.InitializeAccount, instruction.data);\n return {\n votePubkey: instruction.keys[0].pubkey,\n nodePubkey: instruction.keys[3].pubkey,\n voteInit: new VoteInit(new PublicKey(voteInit.nodePubkey), new PublicKey(voteInit.authorizedVoter), new PublicKey(voteInit.authorizedWithdrawer), voteInit.commission)\n };\n }\n\n /**\n * Decode an authorize instruction and retrieve the instruction params.\n */\n static decodeAuthorize(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n newAuthorized,\n voteAuthorizationType\n } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.Authorize, instruction.data);\n return {\n votePubkey: instruction.keys[0].pubkey,\n authorizedPubkey: instruction.keys[2].pubkey,\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n voteAuthorizationType: {\n index: voteAuthorizationType\n }\n };\n }\n\n /**\n * Decode an authorize instruction and retrieve the instruction params.\n */\n static decodeAuthorizeWithSeed(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n voteAuthorizeWithSeedArgs: {\n currentAuthorityDerivedKeyOwnerPubkey,\n currentAuthorityDerivedKeySeed,\n newAuthorized,\n voteAuthorizationType\n }\n } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed, instruction.data);\n return {\n currentAuthorityDerivedKeyBasePubkey: instruction.keys[2].pubkey,\n currentAuthorityDerivedKeyOwnerPubkey: new PublicKey(currentAuthorityDerivedKeyOwnerPubkey),\n currentAuthorityDerivedKeySeed: currentAuthorityDerivedKeySeed,\n newAuthorizedPubkey: new PublicKey(newAuthorized),\n voteAuthorizationType: {\n index: voteAuthorizationType\n },\n votePubkey: instruction.keys[0].pubkey\n };\n }\n\n /**\n * Decode a withdraw instruction and retrieve the instruction params.\n */\n static decodeWithdraw(instruction) {\n this.checkProgramId(instruction.programId);\n this.checkKeyLength(instruction.keys, 3);\n const {\n lamports\n } = decodeData$1(VOTE_INSTRUCTION_LAYOUTS.Withdraw, instruction.data);\n return {\n votePubkey: instruction.keys[0].pubkey,\n authorizedWithdrawerPubkey: instruction.keys[2].pubkey,\n lamports,\n toPubkey: instruction.keys[1].pubkey\n };\n }\n\n /**\n * @internal\n */\n static checkProgramId(programId) {\n if (!programId.equals(VoteProgram.programId)) {\n throw new Error('invalid instruction; programId is not VoteProgram');\n }\n }\n\n /**\n * @internal\n */\n static checkKeyLength(keys, expectedLength) {\n if (keys.length < expectedLength) {\n throw new Error(`invalid instruction; found ${keys.length} keys, expected at least ${expectedLength}`);\n }\n }\n}\n\n/**\n * An enumeration of valid VoteInstructionType's\n */\n\n/** @internal */\n\nconst VOTE_INSTRUCTION_LAYOUTS = Object.freeze({\n InitializeAccount: {\n index: 0,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), voteInit()])\n },\n Authorize: {\n index: 1,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), publicKey('newAuthorized'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('voteAuthorizationType')])\n },\n Withdraw: {\n index: 3,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.ns64('lamports')])\n },\n AuthorizeWithSeed: {\n index: 10,\n layout: _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('instruction'), voteAuthorizeWithSeedArgs()])\n }\n});\n\n/**\n * VoteAuthorize type\n */\n\n/**\n * An enumeration of valid VoteAuthorization layouts.\n */\nconst VoteAuthorizationLayout = Object.freeze({\n Voter: {\n index: 0\n },\n Withdrawer: {\n index: 1\n }\n});\n\n/**\n * Factory class for transactions to interact with the Vote program\n */\nclass VoteProgram {\n /**\n * @internal\n */\n constructor() {}\n\n /**\n * Public key that identifies the Vote program\n */\n\n /**\n * Generate an Initialize instruction.\n */\n static initializeAccount(params) {\n const {\n votePubkey,\n nodePubkey,\n voteInit\n } = params;\n const type = VOTE_INSTRUCTION_LAYOUTS.InitializeAccount;\n const data = encodeData(type, {\n voteInit: {\n nodePubkey: toBuffer(voteInit.nodePubkey.toBuffer()),\n authorizedVoter: toBuffer(voteInit.authorizedVoter.toBuffer()),\n authorizedWithdrawer: toBuffer(voteInit.authorizedWithdrawer.toBuffer()),\n commission: voteInit.commission\n }\n });\n const instructionData = {\n keys: [{\n pubkey: votePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_RENT_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: nodePubkey,\n isSigner: true,\n isWritable: false\n }],\n programId: this.programId,\n data\n };\n return new TransactionInstruction(instructionData);\n }\n\n /**\n * Generate a transaction that creates a new Vote account.\n */\n static createAccount(params) {\n const transaction = new Transaction();\n transaction.add(SystemProgram.createAccount({\n fromPubkey: params.fromPubkey,\n newAccountPubkey: params.votePubkey,\n lamports: params.lamports,\n space: this.space,\n programId: this.programId\n }));\n return transaction.add(this.initializeAccount({\n votePubkey: params.votePubkey,\n nodePubkey: params.voteInit.nodePubkey,\n voteInit: params.voteInit\n }));\n }\n\n /**\n * Generate a transaction that authorizes a new Voter or Withdrawer on the Vote account.\n */\n static authorize(params) {\n const {\n votePubkey,\n authorizedPubkey,\n newAuthorizedPubkey,\n voteAuthorizationType\n } = params;\n const type = VOTE_INSTRUCTION_LAYOUTS.Authorize;\n const data = encodeData(type, {\n newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()),\n voteAuthorizationType: voteAuthorizationType.index\n });\n const keys = [{\n pubkey: votePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: authorizedPubkey,\n isSigner: true,\n isWritable: false\n }];\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction that authorizes a new Voter or Withdrawer on the Vote account\n * where the current Voter or Withdrawer authority is a derived key.\n */\n static authorizeWithSeed(params) {\n const {\n currentAuthorityDerivedKeyBasePubkey,\n currentAuthorityDerivedKeyOwnerPubkey,\n currentAuthorityDerivedKeySeed,\n newAuthorizedPubkey,\n voteAuthorizationType,\n votePubkey\n } = params;\n const type = VOTE_INSTRUCTION_LAYOUTS.AuthorizeWithSeed;\n const data = encodeData(type, {\n voteAuthorizeWithSeedArgs: {\n currentAuthorityDerivedKeyOwnerPubkey: toBuffer(currentAuthorityDerivedKeyOwnerPubkey.toBuffer()),\n currentAuthorityDerivedKeySeed: currentAuthorityDerivedKeySeed,\n newAuthorized: toBuffer(newAuthorizedPubkey.toBuffer()),\n voteAuthorizationType: voteAuthorizationType.index\n }\n });\n const keys = [{\n pubkey: votePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: SYSVAR_CLOCK_PUBKEY,\n isSigner: false,\n isWritable: false\n }, {\n pubkey: currentAuthorityDerivedKeyBasePubkey,\n isSigner: true,\n isWritable: false\n }];\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction to withdraw from a Vote account.\n */\n static withdraw(params) {\n const {\n votePubkey,\n authorizedWithdrawerPubkey,\n lamports,\n toPubkey\n } = params;\n const type = VOTE_INSTRUCTION_LAYOUTS.Withdraw;\n const data = encodeData(type, {\n lamports\n });\n const keys = [{\n pubkey: votePubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: toPubkey,\n isSigner: false,\n isWritable: true\n }, {\n pubkey: authorizedWithdrawerPubkey,\n isSigner: true,\n isWritable: false\n }];\n return new Transaction().add({\n keys,\n programId: this.programId,\n data\n });\n }\n\n /**\n * Generate a transaction to withdraw safely from a Vote account.\n *\n * This function was created as a safeguard for vote accounts running validators, `safeWithdraw`\n * checks that the withdraw amount will not exceed the specified balance while leaving enough left\n * to cover rent. If you wish to close the vote account by withdrawing the full amount, call the\n * `withdraw` method directly.\n */\n static safeWithdraw(params, currentVoteAccountBalance, rentExemptMinimum) {\n if (params.lamports > currentVoteAccountBalance - rentExemptMinimum) {\n throw new Error('Withdraw will leave vote account with insuffcient funds.');\n }\n return VoteProgram.withdraw(params);\n }\n}\nVoteProgram.programId = new PublicKey('Vote111111111111111111111111111111111111111');\n/**\n * Max space of a Vote account\n *\n * This is generated from the solana-vote-program VoteState struct as\n * `VoteState::size_of()`:\n * https://docs.rs/solana-vote-program/1.9.5/solana_vote_program/vote_state/struct.VoteState.html#method.size_of\n *\n * KEEP IN SYNC WITH `VoteState::size_of()` in https://github.com/solana-labs/solana/blob/a474cb24b9238f5edcc982f65c0b37d4a1046f7e/sdk/program/src/vote/state/mod.rs#L340-L342\n */\nVoteProgram.space = 3731;\n\nconst VALIDATOR_INFO_KEY = new PublicKey('Va1idator1nfo111111111111111111111111111111');\n\n/**\n * @internal\n */\n\n/**\n * Info used to identity validators.\n */\n\nconst InfoString = (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .type */ .dt)({\n name: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)(),\n website: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n details: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)()),\n keybaseUsername: (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .optional */ .jt)((0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .string */ .Z_)())\n});\n\n/**\n * ValidatorInfo class\n */\nclass ValidatorInfo {\n /**\n * Construct a valid ValidatorInfo\n *\n * @param key validator public key\n * @param info validator information\n */\n constructor(key, info) {\n /**\n * validator public key\n */\n this.key = void 0;\n /**\n * validator information\n */\n this.info = void 0;\n this.key = key;\n this.info = info;\n }\n\n /**\n * Deserialize ValidatorInfo from the config account data. Exactly two config\n * keys are required in the data.\n *\n * @param buffer config account data\n * @return null if info was not found\n */\n static fromConfigData(buffer) {\n let byteArray = [...buffer];\n const configKeyCount = decodeLength(byteArray);\n if (configKeyCount !== 2) return null;\n const configKeys = [];\n for (let i = 0; i < 2; i++) {\n const publicKey = new PublicKey(byteArray.slice(0, PUBLIC_KEY_LENGTH));\n byteArray = byteArray.slice(PUBLIC_KEY_LENGTH);\n const isSigner = byteArray.slice(0, 1)[0] === 1;\n byteArray = byteArray.slice(1);\n configKeys.push({\n publicKey,\n isSigner\n });\n }\n if (configKeys[0].publicKey.equals(VALIDATOR_INFO_KEY)) {\n if (configKeys[1].isSigner) {\n const rawInfo = rustString().decode(buffer__WEBPACK_IMPORTED_MODULE_0__.Buffer.from(byteArray));\n const info = JSON.parse(rawInfo);\n (0,superstruct__WEBPACK_IMPORTED_MODULE_11__/* .assert */ .hu)(info, InfoString);\n return new ValidatorInfo(configKeys[1].publicKey, info);\n }\n }\n return null;\n }\n}\n\nconst VOTE_PROGRAM_ID = new PublicKey('Vote111111111111111111111111111111111111111');\n\n/**\n * History of how many credits earned by the end of each epoch\n */\n\n/**\n * See https://github.com/solana-labs/solana/blob/8a12ed029cfa38d4a45400916c2463fb82bbec8c/programs/vote_api/src/vote_state.rs#L68-L88\n *\n * @internal\n */\nconst VoteAccountLayout = _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([publicKey('nodePubkey'), publicKey('authorizedWithdrawer'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('commission'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64(),\n// votes.length\n_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('slot'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32('confirmationCount')]), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.offset(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32(), -8), 'votes'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('rootSlotValid'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('rootSlot'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64(),\n// authorizedVoters.length\n_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('epoch'), publicKey('authorizedVoter')]), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.offset(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32(), -8), 'authorizedVoters'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([publicKey('authorizedPubkey'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('epochOfLastAuthorizedSwitch'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('targetEpoch')]), 32, 'buf'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('idx'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u8('isEmpty')], 'priorVoters'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64(),\n// epochCredits.length\n_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.seq(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('epoch'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('credits'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('prevCredits')]), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.offset(_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.u32(), -8), 'epochCredits'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.struct([_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('slot'), _solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__.nu64('timestamp')], 'lastTimestamp')]);\n/**\n * VoteAccount class\n */\nclass VoteAccount {\n /**\n * @internal\n */\n constructor(args) {\n this.nodePubkey = void 0;\n this.authorizedWithdrawer = void 0;\n this.commission = void 0;\n this.rootSlot = void 0;\n this.votes = void 0;\n this.authorizedVoters = void 0;\n this.priorVoters = void 0;\n this.epochCredits = void 0;\n this.lastTimestamp = void 0;\n this.nodePubkey = args.nodePubkey;\n this.authorizedWithdrawer = args.authorizedWithdrawer;\n this.commission = args.commission;\n this.rootSlot = args.rootSlot;\n this.votes = args.votes;\n this.authorizedVoters = args.authorizedVoters;\n this.priorVoters = args.priorVoters;\n this.epochCredits = args.epochCredits;\n this.lastTimestamp = args.lastTimestamp;\n }\n\n /**\n * Deserialize VoteAccount from the account data.\n *\n * @param buffer account data\n * @return VoteAccount\n */\n static fromAccountData(buffer) {\n const versionOffset = 4;\n const va = VoteAccountLayout.decode(toBuffer(buffer), versionOffset);\n let rootSlot = va.rootSlot;\n if (!va.rootSlotValid) {\n rootSlot = null;\n }\n return new VoteAccount({\n nodePubkey: new PublicKey(va.nodePubkey),\n authorizedWithdrawer: new PublicKey(va.authorizedWithdrawer),\n commission: va.commission,\n votes: va.votes,\n rootSlot,\n authorizedVoters: va.authorizedVoters.map(parseAuthorizedVoter),\n priorVoters: getPriorVoters(va.priorVoters),\n epochCredits: va.epochCredits,\n lastTimestamp: va.lastTimestamp\n });\n }\n}\nfunction parseAuthorizedVoter({\n authorizedVoter,\n epoch\n}) {\n return {\n epoch,\n authorizedVoter: new PublicKey(authorizedVoter)\n };\n}\nfunction parsePriorVoters({\n authorizedPubkey,\n epochOfLastAuthorizedSwitch,\n targetEpoch\n}) {\n return {\n authorizedPubkey: new PublicKey(authorizedPubkey),\n epochOfLastAuthorizedSwitch,\n targetEpoch\n };\n}\nfunction getPriorVoters({\n buf,\n idx,\n isEmpty\n}) {\n if (isEmpty) {\n return [];\n }\n return [...buf.slice(idx + 1).map(parsePriorVoters), ...buf.slice(0, idx).map(parsePriorVoters)];\n}\n\nconst endpoint = {\n http: {\n devnet: 'http://api.devnet.solana.com',\n testnet: 'http://api.testnet.solana.com',\n 'mainnet-beta': 'http://api.mainnet-beta.solana.com/'\n },\n https: {\n devnet: 'https://api.devnet.solana.com',\n testnet: 'https://api.testnet.solana.com',\n 'mainnet-beta': 'https://api.mainnet-beta.solana.com/'\n }\n};\n/**\n * Retrieves the RPC API URL for the specified cluster\n * @param {Cluster} [cluster=\"devnet\"] - The cluster name of the RPC API URL to use. Possible options: 'devnet' | 'testnet' | 'mainnet-beta'\n * @param {boolean} [tls=\"http\"] - Use TLS when connecting to cluster.\n *\n * @returns {string} URL string of the RPC endpoint\n */\nfunction clusterApiUrl(cluster, tls) {\n const key = tls === false ? 'http' : 'https';\n if (!cluster) {\n return endpoint[key]['devnet'];\n }\n const url = endpoint[key][cluster];\n if (!url) {\n throw new Error(`Unknown ${key} cluster: ${cluster}`);\n }\n return url;\n}\n\n/**\n * Send and confirm a raw transaction\n *\n * If `commitment` option is not specified, defaults to 'max' commitment.\n *\n * @param {Connection} connection\n * @param {Buffer} rawTransaction\n * @param {TransactionConfirmationStrategy} confirmationStrategy\n * @param {ConfirmOptions} [options]\n * @returns {Promise}\n */\n\n/**\n * @deprecated Calling `sendAndConfirmRawTransaction()` without a `confirmationStrategy`\n * is no longer supported and will be removed in a future version.\n */\n// eslint-disable-next-line no-redeclare\n\n// eslint-disable-next-line no-redeclare\nasync function sendAndConfirmRawTransaction(connection, rawTransaction, confirmationStrategyOrConfirmOptions, maybeConfirmOptions) {\n let confirmationStrategy;\n let options;\n if (confirmationStrategyOrConfirmOptions && Object.prototype.hasOwnProperty.call(confirmationStrategyOrConfirmOptions, 'lastValidBlockHeight')) {\n confirmationStrategy = confirmationStrategyOrConfirmOptions;\n options = maybeConfirmOptions;\n } else if (confirmationStrategyOrConfirmOptions && Object.prototype.hasOwnProperty.call(confirmationStrategyOrConfirmOptions, 'nonceValue')) {\n confirmationStrategy = confirmationStrategyOrConfirmOptions;\n options = maybeConfirmOptions;\n } else {\n options = confirmationStrategyOrConfirmOptions;\n }\n const sendOptions = options && {\n skipPreflight: options.skipPreflight,\n preflightCommitment: options.preflightCommitment || options.commitment,\n minContextSlot: options.minContextSlot\n };\n const signature = await connection.sendRawTransaction(rawTransaction, sendOptions);\n const commitment = options && options.commitment;\n const confirmationPromise = confirmationStrategy ? connection.confirmTransaction(confirmationStrategy, commitment) : connection.confirmTransaction(signature, commitment);\n const status = (await confirmationPromise).value;\n if (status.err) {\n throw new Error(`Raw transaction ${signature} failed (${JSON.stringify(status)})`);\n }\n return signature;\n}\n\n/**\n * There are 1-billion lamports in one SOL\n */\nconst LAMPORTS_PER_SOL = 1000000000;\n\n\n//# sourceMappingURL=index.browser.esm.js.map\n\n\n/***/ })\n\n}]);"],"names":["self","push","__unused_webpack_module","__webpack_exports__","__webpack_require__","_Symbol$toStringTag","r","d","Account","AddressLookupTableAccount","AddressLookupTableInstruction","AddressLookupTableProgram","Authorized","BLOCKHASH_CACHE_TIMEOUT_MS","BPF_LOADER_DEPRECATED_PROGRAM_ID","BPF_LOADER_PROGRAM_ID","BpfLoader","COMPUTE_BUDGET_INSTRUCTION_LAYOUTS","ComputeBudgetInstruction","ComputeBudgetProgram","Connection","Ed25519Program","Enum","EpochSchedule","FeeCalculatorLayout","Keypair","LAMPORTS_PER_SOL","LOOKUP_TABLE_INSTRUCTION_LAYOUTS","Loader","Lockup","MAX_SEED_LENGTH","Message","MessageAccountKeys","MessageV0","NONCE_ACCOUNT_LENGTH","NonceAccount","PACKET_DATA_SIZE","PUBLIC_KEY_LENGTH","PublicKey","SIGNATURE_LENGTH_IN_BYTES","SOLANA_SCHEMA","STAKE_CONFIG_ID","STAKE_INSTRUCTION_LAYOUTS","SYSTEM_INSTRUCTION_LAYOUTS","SYSVAR_CLOCK_PUBKEY","SYSVAR_EPOCH_SCHEDULE_PUBKEY","SYSVAR_INSTRUCTIONS_PUBKEY","SYSVAR_RECENT_BLOCKHASHES_PUBKEY","SYSVAR_RENT_PUBKEY","SYSVAR_REWARDS_PUBKEY","SYSVAR_SLOT_HASHES_PUBKEY","SYSVAR_SLOT_HISTORY_PUBKEY","SYSVAR_STAKE_HISTORY_PUBKEY","Secp256k1Program","SendTransactionError","SolanaJSONRPCError","SolanaJSONRPCErrorCode","StakeAuthorizationLayout","StakeInstruction","StakeProgram","Struct","SystemInstruction","SystemProgram","Transaction","TransactionExpiredBlockheightExceededError","TransactionExpiredNonceInvalidError","TransactionExpiredTimeoutError","TransactionInstruction","TransactionMessage","TransactionStatus","VALIDATOR_INFO_KEY","VERSION_PREFIX_MASK","VOTE_PROGRAM_ID","ValidatorInfo","VersionedMessage","VersionedTransaction","VoteAccount","VoteAuthorizationLayout","VoteInit","VoteInstruction","VoteProgram","clusterApiUrl","sendAndConfirmRawTransaction","sendAndConfirmTransaction","x","buffer__WEBPACK_IMPORTED_MODULE_0__","_noble_curves_ed25519__WEBPACK_IMPORTED_MODULE_9__","bn_js__WEBPACK_IMPORTED_MODULE_1__","bn_js__WEBPACK_IMPORTED_MODULE_1___default","n","bs58__WEBPACK_IMPORTED_MODULE_2__","bs58__WEBPACK_IMPORTED_MODULE_2___default","_noble_hashes_sha256__WEBPACK_IMPORTED_MODULE_10__","borsh__WEBPACK_IMPORTED_MODULE_3__","_solana_buffer_layout__WEBPACK_IMPORTED_MODULE_4__","bigint_buffer__WEBPACK_IMPORTED_MODULE_5__","superstruct__WEBPACK_IMPORTED_MODULE_11__","jayson_lib_client_browser__WEBPACK_IMPORTED_MODULE_6__","jayson_lib_client_browser__WEBPACK_IMPORTED_MODULE_6___default","rpc_websockets_dist_lib_client__WEBPACK_IMPORTED_MODULE_7__","rpc_websockets_dist_lib_client_websocket_browser__WEBPACK_IMPORTED_MODULE_8__","_noble_hashes_sha3__WEBPACK_IMPORTED_MODULE_13__","_noble_curves_secp256k1__WEBPACK_IMPORTED_MODULE_12__","generatePrivateKey","UN","utils","randomPrivateKey","generateKeypair","privateScalar","publicKey","getPublicKey","secretKey","Uint8Array","set","isOnCurve","ExtendedPoint","fromHex","sign","message","slice","verify","toBuffer","arr","Buffer","isBuffer","from","buffer","byteOffset","byteLength","constructor","properties","Object","assign","encode","serialize","decode","data","deserialize","decodeUnchecked","deserializeUnchecked","enum","keys","length","map","key","Map","uniquePublicKeyCounter","Symbol","toStringTag","value","_bn","undefined","decoded","unique","equals","eq","toBase58","toBytes","toJSON","buf","b","toArrayLike","zeroPad","alloc","copy","toString","createWithSeed","fromPublicKey","seed","programId","concat","publicKeyBytes","J","createProgramAddressSync","seeds","forEach","createProgramAddress","findProgramAddressSync","address","nonce","seedsWithNonce","err","TypeError","findProgramAddress","pubkeyData","pubkey","default","kind","fields","_publicKey","_secretKey","secretKeyBuffer","Error","signature","defineProperty","prototype","timeoutSeconds","toFixed","staticAccountKeys","accountKeysFromLookups","keySegments","writable","readonly","get","index","keySegment","flat","compileInstructions","instructions","U8_MAX","keyIndexMap","findKeyIndex","keyIndex","instruction","programIdIndex","accountKeyIndexes","meta","property","blob","rustString","rsl","struct","u32","offset","_decode","bind","_encode","rslShim","str","chars","span","decodeLength","bytes","len","size","elem","shift","encodeLength","rem_len","assert","condition","CompiledKeys","payer","keyMetaMap","compile","getOrInsertDefault","keyMeta","isSigner","isWritable","isInvoked","payerKeyMeta","ix","accountMeta","getMessageComponents","mapEntries","entries","writableSigners","filter","readonlySigners","writableNonSigners","readonlyNonSigners","header","numRequiredSignatures","numReadonlySignedAccounts","numReadonlyUnsignedAccounts","payerAddress","extractTableLookup","lookupTable","writableIndexes","drainedWritableKeys","drainKeysFoundInLookupTable","state","addresses","readonlyIndexes","drainedReadonlyKeys","accountKey","lookupTableEntries","keyMetaFilter","lookupTableIndexes","drainedKeys","lookupTableIndex","findIndex","entry","delete","args","accountKeys","recentBlockhash","indexToProgramIds","account","version","compiledInstructions","accounts","addressTableLookups","getAccountKeys","compiledKeys","payerKey","isAccountSigner","isAccountWritable","numSignedAccounts","numUnsignedAccounts","numWritableUnsignedAccounts","unsignedAccountIndex","numWritableSignedAccounts","isProgramId","has","programIds","values","nonProgramIds","_","numKeys","keyCount","Array","keyIndicesCount","dataCount","keyIndices","dataLength","instructionCount","instructionBuffer","instructionBufferLength","instructionLayout","u8","seq","signDataLayout","transaction","signData","byteArray","accountCount","i","dataSlice","messageArgs","numAccountKeysFromLookups","count","lookup","addressLookupTableAccounts","resolveAddressTableLookups","numStaticAccountKeys","numWritableLookupAccountKeys","reduce","lookupAccountKeysIndex","tableLookup","tableAccount","find","lookupTableAccounts","extractResult","addressTableLookup","encodedStaticAccountKeysLength","serializedInstructions","serializeInstructions","encodedInstructionsLength","serializedAddressTableLookups","serializeAddressTableLookups","encodedAddressTableLookupsLength","messageLayout","serializedMessage","serializedMessageLength","prefix","staticAccountKeysLength","instructionsLength","addressTableLookupsLength","serializedLength","encodedAccountKeyIndexesLength","encodedDataLength","encodedWritableIndexesLength","encodedReadonlyIndexesLength","addressTableLookupLayout","maskedPrefix","splice","accountKeyIndexesLength","addressTableLookupsCount","writableIndexesLength","readonlyIndexesLength","deserializeMessageVersion","DEFAULT_SIGNATURE","fill","opts","signatures","feePayer","lastValidBlockHeight","nonceInfo","minNonceContextSlot","_message","_json","hasOwnProperty","call","minContextSlot","blockhash","nonceInstruction","signers","add","items","item","compileMessage","JSON","stringify","console","warn","accountMetas","includes","uniqueMetas","pubkeyString","uniqueIndex","sort","y","localeCompare","localeMatcher","usage","sensitivity","ignorePunctuation","numeric","caseFirst","feePayerIndex","payerMeta","unshift","signedKeys","unsignedKeys","indexOf","_compile","valid","every","pair","serializeMessage","getEstimatedFee","connection","getFeeForMessage","setSigners","seen","Set","uniqueSigners","signer","_partialSign","partialSign","_addSignature","addSignature","sigpair","verifySignatures","requireAllSignatures","signatureErrors","_getMessageSignednessErrors","errors","missing","invalid","config","sigErrors","errorMessage","p","join","_serialize","signatureCount","transactionLength","wireTransaction","keyObj","populate","sigPubkeyPair","some","decompile","compiledIx","compileToLegacyMessage","compileToV0Message","defaultSignatures","encodedSignaturesLength","transactionLayout","serializedTransaction","serializedTransactionLength","signaturesLength","messageData","signerPubkeys","signerIndex","options","status","sendOptions","skipPreflight","preflightCommitment","commitment","maxRetries","sendTransaction","confirmTransaction","abortSignal","nonceAccountPubkey","nonceValue","sleep","ms","Promise","resolve","setTimeout","encodeData","type","allocLength","layout","getAlloc","getItemAlloc","field","isArray","elementLayout","layoutFields","decodeData$1","nu64","NonceAccountLayout","authorizedPubkey","feeCalculator","fromAccountData","nonceAccount","encodeDecode","u64","bigIntLayout","src","toBigIntLE","bigInt","toBufferLE","decodeInstructionType","checkProgramId","instructionTypeLayout","typeIndex","ixType","decodeCreateAccount","checkKeyLength","lamports","space","Create","fromPubkey","newAccountPubkey","decodeTransfer","Transfer","toPubkey","decodeTransferWithSeed","TransferWithSeed","basePubkey","decodeAllocate","Allocate","accountPubkey","decodeAllocateWithSeed","base","AllocateWithSeed","decodeAssign","Assign","decodeAssignWithSeed","AssignWithSeed","decodeCreateWithSeed","CreateWithSeed","decodeNonceInitialize","authorized","InitializeNonceAccount","noncePubkey","decodeNonceAdvance","AdvanceNonceAccount","decodeNonceWithdraw","WithdrawNonceAccount","decodeNonceAuthorize","AuthorizeNonceAccount","newAuthorizedPubkey","expectedLength","freeze","ns64","UpgradeNonceAccount","createAccount","params","transfer","BigInt","createAccountWithSeed","createNonceAccount","initParams","nonceInitialize","instructionData","nonceAdvance","nonceWithdraw","nonceAuthorize","allocate","getMinNumSignatures","Math","ceil","chunkSize","load","program","balanceNeeded","getMinimumBalanceForRentExemption","programInfo","getAccountInfo","executable","error","owner","dataLayout","array","transactions","bytesLength","bytesLengthPadding","_rpcEndpoint","all","deployCommitment","finalizeSignature","context","currentSlot","getSlot","slot","round","MS_PER_SLOT","elf","loaderProgramId","objToString","objKeys","obj","name","fastStableStringify$1","val","returnVal","isArrayProp","max","propVal","toStr","isFinite","__esModule","trailingZeros","slotsPerEpoch","leaderScheduleSlotOffset","warmup","firstNormalEpoch","firstNormalSlot","getEpoch","getEpochAndSlotIndex","epoch","epochLen","getSlotsInEpoch","normalSlotIndex","normalEpochIndex","floor","slotIndex","getFirstSlotInEpoch","pow","getLastSlotInEpoch","logs","JSON_RPC_SERVER_ERROR_BLOCK_CLEANED_UP","JSON_RPC_SERVER_ERROR_SEND_TRANSACTION_PREFLIGHT_FAILURE","JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_VERIFICATION_FAILURE","JSON_RPC_SERVER_ERROR_BLOCK_NOT_AVAILABLE","JSON_RPC_SERVER_ERROR_NODE_UNHEALTHY","JSON_RPC_SERVER_ERROR_TRANSACTION_PRECOMPILE_VERIFICATION_FAILURE","JSON_RPC_SERVER_ERROR_SLOT_SKIPPED","JSON_RPC_SERVER_ERROR_NO_SNAPSHOT","JSON_RPC_SERVER_ERROR_LONG_TERM_STORAGE_SLOT_SKIPPED","JSON_RPC_SERVER_ERROR_KEY_EXCLUDED_FROM_SECONDARY_INDEX","JSON_RPC_SERVER_ERROR_TRANSACTION_HISTORY_NOT_AVAILABLE","JSON_RPC_SCAN_ERROR","JSON_RPC_SERVER_ERROR_TRANSACTION_SIGNATURE_LEN_MISMATCH","JSON_RPC_SERVER_ERROR_BLOCK_STATUS_NOT_AVAILABLE_YET","JSON_RPC_SERVER_ERROR_UNSUPPORTED_TRANSACTION_VERSION","JSON_RPC_SERVER_ERROR_MIN_CONTEXT_SLOT_NOT_REACHED","code","customMessage","fetchImpl","globalThis","fetch","RpcWebSocketClient","generate_request_id","webSocketFactory","url","rpc","autoconnect","max_reconnects","reconnect","reconnect_interval","underlyingSocket","socket","readyState","reject","notify","isActive","U64_MAX","deactivationSlot","accountData","decodeData","LookupTableMetaLayout","serializedAddressesLen","lastExtendedSlot","lastExtendedSlotStartIndex","lastExtendedStartIndex","authority","URL_RE","PublicKeyFromString","oQ","eE","Z_","RawAccountDataResult","bc","i0","BufferFromRawAccountData","extractCommitmentFromConfig","commitmentOrConfig","specifiedCommitment","specifiedConfig","createRpcResult","result","G0","dt","jsonrpc","id","_4","jt","Yj","UnknownRpcResult","jsonRpcResult","schema","Ue","jsonRpcResultAndContext","Rx","notificationResultAndContext","versionedMessageFromResponse","response","GetInflationGovernorResult","foundation","foundationTerm","initial","taper","terminal","GetInflationRewardResult","IX","AG","effectiveSlot","amount","postBalance","commission","GetRecentPrioritizationFeesResult","prioritizationFee","GetInflationRateResult","total","validator","GetEpochInfoResult","slotsInEpoch","absoluteSlot","blockHeight","transactionCount","GetEpochScheduleResult","O7","GetLeaderScheduleResult","IM","TransactionErrorResult","SignatureStatusResult","SignatureReceivedResult","VersionResult","SimulatedTransactionResponseStruct","rentEpoch","unitsConsumed","returnData","BlockProductionResponseStruct","byIdentity","range","firstSlot","lastSlot","GetInflationGovernorRpcResult","GetInflationRateRpcResult","GetRecentPrioritizationFeesRpcResult","GetEpochInfoRpcResult","GetEpochScheduleRpcResult","GetLeaderScheduleRpcResult","SlotRpcResult","GetSupplyRpcResult","circulating","nonCirculating","nonCirculatingAccounts","TokenAmountResult","uiAmount","decimals","uiAmountString","GetTokenLargestAccountsResult","GetTokenAccountsByOwner","ParsedAccountDataResult","parsed","GetParsedTokenAccountsByOwner","GetLargestAccountsRpcResult","AccountInfoResult","KeyedAccountInfoResult","ParsedOrRawAccountData","ParsedAccountInfoResult","KeyedParsedAccountInfoResult","StakeActivationResult","active","inactive","GetConfirmedSignaturesForAddress2RpcResult","memo","blockTime","GetSignaturesForAddressRpcResult","AccountNotificationResult","subscription","ProgramAccountInfoResult","ProgramAccountNotificationResult","SlotInfoResult","parent","root","SlotNotificationResult","SlotUpdateResult","timestamp","stats","numTransactionEntries","numSuccessfulTransactions","numFailedTransactions","maxTransactionsPerEntry","SlotUpdateNotificationResult","SignatureNotificationResult","RootNotificationResult","ContactInfoResult","gossip","tpu","VoteAccountInfoResult","votePubkey","nodePubkey","activatedStake","epochVoteAccount","epochCredits","lastVote","rootSlot","GetVoteAccounts","current","delinquent","ConfirmationStatus","SignatureStatusResponse","confirmations","confirmationStatus","GetSignatureStatusesRpcResult","GetMinimumBalanceForRentExemptionRpcResult","AddressTableLookupStruct","ConfirmedTransactionResult","AnnotatedAccountKey","source","ConfirmedTransactionAccountsModeResult","ParsedInstructionResult","RawInstructionResult","InstructionResult","UnknownInstructionResult","ParsedOrRawInstruction","ParsedConfirmedTransactionResult","TokenBalanceResult","accountIndex","mint","uiTokenAmount","LoadedAddressesResult","ConfirmedTransactionMetaResult","fee","innerInstructions","preBalances","postBalances","logMessages","preTokenBalances","postTokenBalances","loadedAddresses","computeUnitsConsumed","ParsedConfirmedTransactionMetaResult","TransactionVersionStruct","RewardsResult","rewardType","GetBlockRpcResult","previousBlockhash","parentSlot","rewards","GetNoneModeBlockRpcResult","GetAccountsModeBlockRpcResult","GetParsedBlockRpcResult","GetParsedAccountsModeBlockRpcResult","GetParsedNoneModeBlockRpcResult","GetConfirmedBlockRpcResult","GetBlockSignaturesRpcResult","GetTransactionRpcResult","GetParsedTransactionRpcResult","GetRecentBlockhashAndContextRpcResult","lamportsPerSignature","GetLatestBlockhashRpcResult","IsBlockhashValidRpcResult","PerfSampleResult","numTransactions","numSlots","samplePeriodSecs","GetRecentPerformanceSamplesRpcResult","GetFeeCalculatorRpcResult","RequestAirdropRpcResult","SendTransactionRpcResult","LogsResult","LogsNotificationResult","COMMON_HTTP_HEADERS","endpoint","_commitmentOrConfig","client","wsEndpoint","httpHeaders","fetchMiddleware","disableRetryOnRateLimit","httpAgent","_commitment","_confirmTransactionInitialTimeout","_rpcWsEndpoint","_rpcClient","_rpcRequest","_rpcBatchRequest","_rpcWebSocket","_rpcWebSocketConnected","_rpcWebSocketHeartbeat","_rpcWebSocketIdleTimeout","_rpcWebSocketGeneration","_disableBlockhashCaching","_pollingBlockhash","_blockhashInfo","latestBlockhash","lastFetch","transactionSignatures","simulatedSignatures","_nextClientSubscriptionId","_subscriptionDisposeFunctionsByClientSubscriptionId","_subscriptionHashByClientSubscriptionId","_subscriptionStateChangeCallbacksByHash","_subscriptionCallbacksByServerSubscriptionId","_subscriptionsByHash","_subscriptionsAutoDisposedByRpc","getBlockHeight","requestPromises","_buildArgs","requestHash","unsafeRes","res","confirmTransactionInitialTimeout","assertEndpointUrl","putativeUrl","test","makeWebsocketUrl","matches","match","hostish","portWithColon","rest","protocol","startsWith","startPort","parseInt","websocketPort","createRpcClient","customFetch","agent","fetchWithMiddleware","info","init","modifiedFetchArgs","modifiedInfo","modifiedInit","clientBrowser","request","callback","method","body","headers","too_many_requests_retries","waitTime","statusText","text","ok","requests","batch","methodName","Infinity","on","_wsOnOpen","_wsOnError","_wsOnClose","_wsOnAccountNotification","_wsOnProgramAccountNotification","_wsOnSlotNotification","_wsOnSlotUpdatesNotification","_wsOnSignatureNotification","_wsOnRootNotification","_wsOnLogsNotification","rpcEndpoint","getBalanceAndContext","getBalance","then","catch","e","getBlockTime","getMinimumLedgerSlot","getFirstAvailableBlock","getSupply","configArg","getTokenSupply","tokenMintAddress","getTokenAccountBalance","tokenAddress","getTokenAccountsByOwner","ownerAddress","_args","getParsedTokenAccountsByOwner","getLargestAccounts","arg","getTokenLargestAccounts","mintAddress","getAccountInfoAndContext","getParsedAccountInfo","getMultipleParsedAccounts","publicKeys","rawConfig","getMultipleAccountsInfoAndContext","getMultipleAccountsInfo","getStakeActivation","getProgramAccounts","configOrCommitment","encoding","configWithoutEncoding","baseSchema","withContext","getParsedProgramAccounts","strategy","rawSignature","decodedSignature","aborted","reason","confirmTransactionUsingLegacyTimeoutStrategy","confirmTransactionUsingBlockHeightExceedanceStrategy","confirmTransactionUsingDurableNonceStrategy","getCancellationPromise","signal","addEventListener","getTransactionConfirmationPromise","signatureSubscriptionId","disposeSignatureSubscriptionStateChangeObserver","done","confirmationPromise","onSignature","__type","PROCESSED","subscriptionSetupPromise","resolveSubscriptionSetup","_onSubscriptionStateChange","nextState","getSignatureStatus","abortConfirmation","removeSignatureListener","expiryPromise","checkBlockHeight","_e","currentBlockHeight","BLOCKHEIGHT_EXCEEDED","cancellationPromise","outcome","race","currentNonceValue","lastCheckedSlot","getCurrentNonceValue","getNonceAndContext","NONCE_INVALID","slotInWhichNonceDidAdvance","signatureStatus","timeoutId","timeoutMs","TIMED_OUT","clearTimeout","getClusterNodes","getVoteAccounts","getSlotLeader","getSlotLeaders","startSlot","limit","getSignatureStatuses","getTransactionCount","getTotalSupply","excludeNonCirculatingAccountsList","getInflationGovernor","getInflationReward","getInflationRate","getEpochInfo","getEpochSchedule","epochSchedule","getLeaderSchedule","getRecentBlockhashAndContext","getRecentPerformanceSamples","getFeeCalculatorForBlockhash","wireMessage","getRecentPrioritizationFees","lockedWritableAccounts","getRecentBlockhash","getLatestBlockhash","getLatestBlockhashAndContext","isBlockhashValid","getVersion","getGenesisHash","getBlock","_buildArgsAtLeastConfirmed","transactionDetails","getParsedBlock","getBlockProduction","extra","c","getTransaction","getParsedTransaction","getParsedTransactions","getTransactions","getConfirmedBlock","block","getBlocks","endSlot","getBlockSignatures","getConfirmedBlockSignatures","getConfirmedTransaction","getParsedConfirmedTransaction","getParsedConfirmedTransactions","getConfirmedSignaturesForAddress","firstAvailableBlock","until","highestConfirmedRoot","before","confirmedSignatureInfo","getConfirmedSignaturesForAddress2","getSignaturesForAddress","getAddressLookupTable","accountInfo","getNonce","requestAirdrop","to","_blockhashWithExpiryBlockHeight","disableCache","timeSinceFetch","Date","now","_pollNewBlockhash","startTime","cachedLatestBlockhash","cachedBlockhash","getStakeMinimumDelegation","simulateTransaction","transactionOrMessage","configOrSigners","includeAccounts","versionedTx","encodedTransaction","originalTx","sigVerify","traceIndent","logTrace","signersOrOptions","sendRawTransaction","rawTransaction","sendEncodedTransaction","setInterval","_updateSubscriptions","Number","MAX_SAFE_INTEGER","clearInterval","hash","_setSubscription","nextSubscription","prevState","stateChangeCallbacks","cb","clientSubscriptionId","close","log","connect","activeWebSocketGeneration","isCurrentConnectionStillActive","callbacks","serverSubscriptionId","unsubscribeMethod","_handleServerNotification","callbackArgs","notification","_makeSubscription","subscriptionConfig","existingSubscription","onAccountChange","removeAccountChangeListener","_unsubscribeClientSubscription","accountId","onProgramAccountChange","filters","removeProgramAccountChangeListener","onLogs","mentions","removeOnLogsListener","onSlotChange","removeSlotChangeListener","onSlotUpdate","removeSlotUpdateListener","subscriptionName","dispose","override","_err","onSignatureWithOptions","onRootChange","removeRootChangeListener","keypair","_keypair","generate","fromSecretKey","skipValidation","computedPublicKey","ii","fromSeed","CreateLookupTable","FreezeLookupTable","ExtendLookupTable","DeactivateLookupTable","CloseLookupTable","layoutType","decodeCreateLookupTable","checkKeysLength","recentSlot","decodeExtendLookupTable","decodeCloseLookupTable","recipient","decodeFreezeLookupTable","decodeDeactivateLookupTable","createLookupTable","lookupTableAddress","bumpSeed","freezeLookupTable","extendLookupTable","addr","deactivateLookupTable","closeLookupTable","decodeRequestUnits","units","additionalFee","RequestUnits","decodeRequestHeapFrame","RequestHeapFrame","decodeSetComputeUnitLimit","SetComputeUnitLimit","decodeSetComputeUnitPrice","microLamports","SetComputeUnitPrice","requestUnits","requestHeapFrame","setComputeUnitLimit","setComputeUnitPrice","ED25519_INSTRUCTION_LAYOUT","u16","createInstructionWithPublicKey","instructionIndex","publicKeyOffset","signatureOffset","messageDataOffset","numSignatures","padding","signatureInstructionIndex","publicKeyInstructionIndex","messageDataSize","messageInstructionIndex","createInstructionWithPrivateKey","privateKey","ecdsaSign","msgHash","privKey","kA","toCompactRawBytes","recovery","isValidPrivateKey","publicKeyCreate","SECP256K1_INSTRUCTION_LAYOUT","publicKeyToEthAddress","fr","recoveryId","createInstructionWithEthAddress","ethAddress","rawAddress","substr","dataStart","ethAddressOffset","ethAddressInstructionIndex","pkey","messageHash","staker","withdrawer","unixTimestamp","custodian","decodeInitialize","lockup","Initialize","stakePubkey","decodeDelegate","Delegate","decodeAuthorize","newAuthorized","stakeAuthorizationType","Authorize","o","custodianPubkey","decodeAuthorizeWithSeed","authoritySeed","authorityOwner","AuthorizeWithSeed","authorityBase","decodeSplit","Split","splitStakePubkey","decodeMerge","Merge","sourceStakePubKey","decodeWithdraw","Withdraw","decodeDeactivate","Deactivate","Staker","Withdrawer","initialize","maybeLockup","delegate","authorize","authorizeWithSeed","splitInstruction","split","splitWithSeed","merge","withdraw","deactivate","authorizedVoter","authorizedWithdrawer","VOTE_INSTRUCTION_LAYOUTS","decodeInitializeAccount","voteInit","InitializeAccount","voteAuthorizationType","voteAuthorizeWithSeedArgs","currentAuthorityDerivedKeyOwnerPubkey","currentAuthorityDerivedKeySeed","currentAuthorityDerivedKeyBasePubkey","authorizedWithdrawerPubkey","Voter","initializeAccount","safeWithdraw","currentVoteAccountBalance","rentExemptMinimum","InfoString","website","details","keybaseUsername","fromConfigData","configKeyCount","configKeys","rawInfo","parse","hu","VoteAccountLayout","votes","authorizedVoters","priorVoters","lastTimestamp","va","rootSlotValid","parseAuthorizedVoter","getPriorVoters","idx","isEmpty","parsePriorVoters","epochOfLastAuthorizedSwitch","targetEpoch","http","devnet","testnet","https","cluster","tls","confirmationStrategyOrConfirmOptions","maybeConfirmOptions","confirmationStrategy"],"sourceRoot":""}