UNPKG

@orca-so/wavebreak

Version:

The wavebreak JS client for interacting with the wavebreak program.

1,366 lines (1,363 loc) 397 kB
var YB = 1, OB = 2, bB = 3, KB = 4, pB = 5, HB = 6, qB = 7, PB = 8, vB = 9, VB = 10, xB = -32700, WB = -32603, ZB = -32602, XB = -32601, zB = -32600, jB = -32016, $B = -32015, AE = -32014, gE = -32013, IE = -32012, CE = -32011, BE = -32010, EE = -32009, QE = -32008, eE = -32007, iE = -32006, oE = -32005, tE = -32004, nE = -32003, aE = -32002, rE = -32001, Mg = 28e5, Gg = 2800001, sE = 2800002, cE = 2800003, DE = 2800004, uE = 2800005, yg = 2800006, fg = 2800007, gg = 2800008, _g = 2800009, RE = 2800010, lE = 2800011, kg = 323e4, Fg = 32300001, Ug = 3230002, wE = 3230003, NE = 3230004, dE = 361e4, mg = 3610001, hE = 3610002, SE = 3610003, ME = 3610004, GE = 3610005, yE = 3610006, fE = 3610007, _E = 3611e3, kE = 3704e3, FE = 3704001, UE = 3704002, mE = 3704003, JE = 3704004, LE = 4128e3, TE = 4128001, YE = 4128002, OE = 4615e3, bE = 4615001, KE = 4615002, pE = 4615003, HE = 4615004, qE = 4615005, PE = 4615006, vE = 4615007, VE = 4615008, xE = 4615009, WE = 4615010, ZE = 4615011, XE = 4615012, zE = 4615013, jE = 4615014, $E = 4615015, AQ = 4615016, gQ = 4615017, IQ = 4615018, CQ = 4615019, BQ = 4615020, EQ = 4615021, QQ = 4615022, eQ = 4615023, iQ = 4615024, oQ = 4615025, Jg = 4615026, tQ = 4615027, nQ = 4615028, aQ = 4615029, rQ = 4615030, sQ = 4615031, cQ = 4615032, DQ = 4615033, uQ = 4615034, RQ = 4615035, lQ = 4615036, wQ = 4615037, NQ = 4615038, dQ = 4615039, hQ = 4615040, SQ = 4615041, MQ = 4615042, GQ = 4615043, yQ = 4615044, fQ = 4615045, _Q = 4615046, kQ = 4615047, FQ = 4615048, UQ = 4615049, mQ = 4615050, JQ = 4615051, LQ = 4615052, TQ = 4615053, YQ = 4615054, OQ = 5508e3, bQ = 5508001, KQ = 5508002, pQ = 5508003, HQ = 5508004, qQ = 5508005, PQ = 5508006, vQ = 5508007, VQ = 5508008, xQ = 5508009, WQ = 5508010, ZQ = 5508011, XQ = 5663e3, zQ = 5663001, jQ = 5663002, $Q = 5663003, Ae = 5663004, ge = 5663005, Ie = 5663006, Ce = 5663007, Be = 5663008, Ee = 5663009, Qe = 5663010, ee = 5663011, ie = 5663012, oe = 5663013, te = 5663014, ne = 5663015, ae = 5663016, re = 5663017, se = 5663018, ce = 5663019, De = 5663020, ue = 705e4, Re = 7050001, le = 7050002, we = 7050003, Ne = 7050004, de = 7050005, he = 7050006, Se = 7050007, Me = 7050008, Ge = 7050009, ye = 7050010, fe = 7050011, _e = 7050012, ke = 7050013, Fe = 7050014, Ue = 7050015, me = 7050016, Je = 7050017, Le = 7050018, Te = 7050019, Ye = 7050020, Oe = 7050021, be = 7050022, Ke = 7050023, pe = 7050024, He = 7050025, qe = 7050026, Pe = 7050027, ve = 7050028, Ve = 7050029, xe = 7050030, We = 7050031, Ze = 7050032, Xe = 7050033, ze = 7050034, je = 7050035, $e = 7050036, Lg = 8078e3, Tg = 8078001, Yg = 8078002, Ai = 8078003, Og = 8078004, bg = 8078005, Kg = 8078006, pg = 8078007, Hg = 8078008, qg = 8078009, Pg = 8078010, vg = 8078011, bA = 8078012, gi = 8078013, Ii = 8078014, Ci = 8078015, Bi = 8078016, Vg = 8078017, xg = 8078018, Ei = 8078019, Qi = 8078020, ei = 8078021, Ig = 8078022, ii = 81e5, oi = 8100001, ti = 8100002, ni = 8100003, ai = 819e4, ri = 8190001, si = 8190002, ci = 8190003, Di = 8190004, ui = 99e5, Ri = 9900001, li = 9900002, wi = 9900003, Ni = 9900004; function Wg(A) { return Array.isArray(A) ? "%5B" + A.map(Wg).join( "%2C%20" /* ", " */ ) + /* "]" */ "%5D" : typeof A == "bigint" ? `${A}n` : encodeURIComponent( String( A != null && Object.getPrototypeOf(A) === null ? ( // Plain objects with no prototype don't have a `toString` method. // Convert them before stringifying them. { ...A } ) : A ) ); } function di([A, g]) { return `${A}=${Wg(g)}`; } function hi(A) { const g = Object.entries(A).map(di).join("&"); return btoa(g); } var Si = { [kg]: "Account not found at address: $address", [NE]: "Not all accounts were decoded. Encoded accounts found at addresses: $addresses.", [wE]: "Expected decoded account at address: $address", [Ug]: "Failed to decode account data at address: $address", [Fg]: "Accounts not found at addresses: $addresses", [_g]: "Unable to find a viable program address bump seed.", [sE]: "$putativeAddress is not a base58-encoded address.", [Mg]: "Expected base58 encoded address to decode to a byte array of length 32. Actual length: $actualLength.", [cE]: "The `CryptoKey` must be an `Ed25519` public key.", [lE]: "$putativeOffCurveAddress is not a base58-encoded off-curve address.", [gg]: "Invalid seeds; point must fall off the Ed25519 curve.", [DE]: "Expected given program derived address to have the following format: [Address, ProgramDerivedAddressBump].", [yg]: "A maximum of $maxSeeds seeds, including the bump seed, may be supplied when creating an address. Received: $actual.", [fg]: "The seed at index $index with length $actual exceeds the maximum length of $maxSeedLength bytes.", [uE]: "Expected program derived address bump to be in the range [0, 255], got: $bump.", [RE]: "Program address cannot end with PDA marker.", [Gg]: "Expected base58-encoded address string of length in the range [32, 44]. Actual length: $actualLength.", [KB]: "Expected base58-encoded blockash string of length in the range [32, 44]. Actual length: $actualLength.", [YB]: "The network has progressed past the last block for which this transaction could have been committed.", [Lg]: "Codec [$codecDescription] cannot decode empty byte arrays.", [Ig]: "Enum codec cannot use lexical values [$stringValues] as discriminators. Either remove all lexical values or set `useValuesAsDiscriminators` to `false`.", [Qi]: "Sentinel [$hexSentinel] must not be present in encoded bytes [$hexEncodedBytes].", [bg]: "Encoder and decoder must have the same fixed size, got [$encoderFixedSize] and [$decoderFixedSize].", [Kg]: "Encoder and decoder must have the same max size, got [$encoderMaxSize] and [$decoderMaxSize].", [Og]: "Encoder and decoder must either both be fixed-size or variable-size.", [Hg]: "Enum discriminator out of range. Expected a number in [$formattedValidDiscriminators], got $discriminator.", [Yg]: "Expected a fixed-size codec, got a variable-size one.", [gi]: "Codec [$codecDescription] expected a positive byte length, got $bytesLength.", [Ai]: "Expected a variable-size codec, got a fixed-size one.", [Ei]: "Codec [$codecDescription] expected zero-value [$hexZeroValue] to have the same size as the provided fixed-size item [$expectedSize bytes].", [Tg]: "Codec [$codecDescription] expected $expected bytes, got $bytesLength.", [xg]: "Expected byte array constant [$hexConstant] to be present in data [$hexData] at offset [$offset].", [qg]: "Invalid discriminated union variant. Expected one of [$variants], got $value.", [Pg]: "Invalid enum variant. Expected one of [$stringValues] or a number in [$formattedNumericalValues], got $variant.", [Ci]: "Invalid literal union variant. Expected one of [$variants], got $value.", [pg]: "Expected [$codecDescription] to have $expected items, got $actual.", [bA]: "Invalid value $value for base $base with alphabet $alphabet.", [Bi]: "Literal union discriminator out of range. Expected a number between $minRange and $maxRange, got $discriminator.", [vg]: "Codec [$codecDescription] expected number to be in the range [$min, $max], got $value.", [Ii]: "Codec [$codecDescription] expected offset to be in the range [0, $bytesLength], got $offset.", [ei]: "Expected sentinel [$hexSentinel] to be present in decoded bytes [$hexDecodedBytes].", [Vg]: "Union variant out of range. Expected an index between $minRange and $maxRange, got $variant.", [_E]: "No random values implementation could be found.", [xE]: "instruction requires an uninitialized account", [eQ]: "instruction tries to borrow reference for an account which is already borrowed", [iQ]: "instruction left account with an outstanding borrowed reference", [EQ]: "program other than the account's owner changed the size of the account data", [qE]: "account data too small for instruction", [QQ]: "instruction expected an executable account", [_Q]: "An account does not have enough lamports to be rent-exempt", [FQ]: "Program arithmetic overflowed", [fQ]: "Failed to serialize or deserialize account data: $encodedData", [YQ]: "Builtin programs must consume compute units", [cQ]: "Cross-program invocation call depth too deep", [NQ]: "Computational budget exceeded", [Jg]: "custom program error: #$code", [gQ]: "instruction contains duplicate accounts", [oQ]: "instruction modifications of multiply-passed account differ", [rQ]: "executable accounts must be rent exempt", [nQ]: "instruction changed executable accounts data", [aQ]: "instruction changed the balance of an executable account", [IQ]: "instruction changed executable bit of an account", [jE]: "instruction modified data of an account it does not own", [zE]: "instruction spent from the balance of an account it does not own", [bE]: "generic instruction error", [mQ]: "Provided owner is not allowed", [GQ]: "Account is immutable", [yQ]: "Incorrect authority provided", [vE]: "incorrect program id for instruction", [PE]: "insufficient funds for instruction", [HE]: "invalid account data for instruction", [kQ]: "Invalid account owner", [KE]: "invalid program argument", [tQ]: "program returned invalid error code", [pE]: "invalid instruction data", [wQ]: "Failed to reallocate account data", [lQ]: "Provided seeds do not result in a valid address", [JQ]: "Accounts data allocations exceeded the maximum allowed per transaction", [LQ]: "Max accounts exceeded", [TQ]: "Max instruction trace length exceeded", [RQ]: "Length of the seed is too long for address generation", [DQ]: "An account required by the instruction is missing", [VE]: "missing required signature for instruction", [XE]: "instruction illegally modified the program id of an account", [BQ]: "insufficient account keys for instruction", [dQ]: "Cross-program invocation with unauthorized signer or writable account", [hQ]: "Failed to create program execution environment", [MQ]: "Program failed to compile", [SQ]: "Program failed to complete", [AQ]: "instruction modified data of a read-only account", [$E]: "instruction changed the balance of a read-only account", [uQ]: "Cross-program invocation reentrancy not allowed for this instruction", [CQ]: "instruction modified rent epoch of an account", [ZE]: "sum of account balances before and after instruction do not match", [WE]: "instruction requires an initialized account", [OE]: "", [sQ]: "Unsupported program id", [UQ]: "Unsupported sysvar", [LE]: "The instruction does not have any accounts.", [TE]: "The instruction does not have any data.", [YE]: "Expected instruction to have progress address $expectedProgramAddress, got $actualProgramAddress.", [pB]: "Expected base58 encoded blockhash to decode to a byte array of length 32. Actual length: $actualLength.", [OB]: "The nonce `$expectedNonceValue` is no longer valid. It has advanced to `$actualNonceValue`", [li]: "Invariant violation: Found no abortable iterable cache entry for key `$cacheKey`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", [Ni]: "Invariant violation: This data publisher does not publish to the channel named `$channelName`. Supported channels include $supportedChannelNames.", [Ri]: "Invariant violation: WebSocket message iterator state is corrupt; iterated without first resolving existing message promise. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", [ui]: "Invariant violation: WebSocket message iterator is missing state storage. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", [wi]: "Invariant violation: Switch statement non-exhaustive. Received unexpected value `$unexpectedValue`. It should be impossible to hit this error; please file an issue at https://sola.na/web3invariant", [WB]: "JSON-RPC error: Internal JSON-RPC error ($__serverMessage)", [ZB]: "JSON-RPC error: Invalid method parameter(s) ($__serverMessage)", [zB]: "JSON-RPC error: The JSON sent is not a valid `Request` object ($__serverMessage)", [XB]: "JSON-RPC error: The method does not exist / is not available ($__serverMessage)", [xB]: "JSON-RPC error: An error occurred on the server while parsing the JSON text ($__serverMessage)", [IE]: "$__serverMessage", [rE]: "$__serverMessage", [tE]: "$__serverMessage", [AE]: "$__serverMessage", [BE]: "$__serverMessage", [EE]: "$__serverMessage", [jB]: "Minimum context slot has not been reached", [oE]: "Node is unhealthy; behind by $numSlotsBehind slots", [QE]: "No snapshot", [aE]: "Transaction simulation failed", [eE]: "$__serverMessage", [CE]: "Transaction history is not available from this node", [iE]: "$__serverMessage", [gE]: "Transaction signature length mismatch", [nE]: "Transaction signature verification failure", [$B]: "$__serverMessage", [kE]: "Key pair bytes must be of length 64, got $byteLength.", [FE]: "Expected private key bytes with length 32. Actual length: $actualLength.", [UE]: "Expected base58-encoded signature to decode to a byte array of length 64. Actual length: $actualLength.", [JE]: "The provided private key does not match the provided public key.", [mE]: "Expected base58-encoded signature string of length in the range [64, 88]. Actual length: $actualLength.", [HB]: "Lamports value must be in the range [0, 2e64-1]", [qB]: "`$value` cannot be parsed as a `BigInt`", [VB]: "$message", [PB]: "`$value` cannot be parsed as a `Number`", [bB]: "No nonce account could be found at address `$nonceAccountAddress`", [ai]: "The notification name must end in 'Notifications' and the API must supply a subscription plan creator function for the notification '$notificationName'.", [si]: "WebSocket was closed before payload could be added to the send buffer", [ci]: "WebSocket connection closed", [Di]: "WebSocket failed to connect", [ri]: "Failed to obtain a subscription id from the server", [ni]: "Could not find an API plan for RPC method: `$method`", [ii]: "The $argumentLabel argument to the `$methodName` RPC method$optionalPathLabel was `$value`. This number is unsafe for use with the Solana JSON-RPC because it exceeds `Number.MAX_SAFE_INTEGER`.", [ti]: "HTTP error ($statusCode): $message", [oi]: "HTTP header(s) forbidden: $headers. Learn more at https://developer.mozilla.org/en-US/docs/Glossary/Forbidden_header_name.", [OQ]: "Multiple distinct signers were identified for address `$address`. Please ensure that you are using the same signer instance for each address.", [bQ]: "The provided value does not implement the `KeyPairSigner` interface", [pQ]: "The provided value does not implement the `MessageModifyingSigner` interface", [HQ]: "The provided value does not implement the `MessagePartialSigner` interface", [KQ]: "The provided value does not implement any of the `MessageSigner` interfaces", [PQ]: "The provided value does not implement the `TransactionModifyingSigner` interface", [vQ]: "The provided value does not implement the `TransactionPartialSigner` interface", [VQ]: "The provided value does not implement the `TransactionSendingSigner` interface", [qQ]: "The provided value does not implement any of the `TransactionSigner` interfaces", [xQ]: "More than one `TransactionSendingSigner` was identified.", [WQ]: "No `TransactionSendingSigner` was identified. Please provide a valid `TransactionWithSingleSendingSigner` transaction.", [ZQ]: "Wallet account signers do not support signing multiple messages/transactions in a single operation", [fE]: "Cannot export a non-extractable key.", [mg]: "No digest implementation could be found.", [dE]: "Cryptographic operations are only allowed in secure browser contexts. Read more here: https://developer.mozilla.org/en-US/docs/Web/Security/Secure_Contexts.", [hE]: `This runtime does not support the generation of Ed25519 key pairs. Install @solana/webcrypto-ed25519-polyfill and call its \`install\` function before generating keys in environments that do not support Ed25519. For a list of runtimes that currently support Ed25519 operations, visit https://github.com/WICG/webcrypto-secure-curves/issues/20.`, [SE]: "No signature verification implementation could be found.", [ME]: "No key generation implementation could be found.", [GE]: "No signing implementation could be found.", [yE]: "No key export implementation could be found.", [vB]: "Timestamp value must be in the range [-(2n ** 63n), (2n ** 63n) - 1]. `$value` given", [me]: "Transaction processing left an account with an outstanding borrowed reference", [Re]: "Account in use", [le]: "Account loaded twice", [we]: "Attempt to debit an account but found no record of a prior credit.", [Ke]: "Transaction loads an address table account that doesn't exist", [Se]: "This transaction has already been processed", [Me]: "Blockhash not found", [Ge]: "Loader call chain is too deep", [Ue]: "Transactions are currently disabled due to cluster maintenance", [xe]: "Transaction contains a duplicate instruction ($index) that is not allowed", [de]: "Insufficient funds for fee", [We]: "Transaction results in an account ($accountIndex) with insufficient funds for rent", [he]: "This account may not be used to pay transaction fees", [fe]: "Transaction contains an invalid account reference", [He]: "Transaction loads an address table account with invalid data", [qe]: "Transaction address table lookup uses an invalid index", [pe]: "Transaction loads an address table account with an invalid owner", [Xe]: "LoadedAccountsDataSizeLimit set for transaction must be greater than 0.", [ke]: "This program may not be used for executing instructions", [Pe]: "Transaction leaves an account with a lower balance than rent-exempt minimum", [Te]: "Transaction loads a writable account that cannot be written", [Ze]: "Transaction exceeded max loaded accounts data size cap", [ye]: "Transaction requires a fee but has no signature present", [Ne]: "Attempt to load a program that does not exist", [je]: "Execution of the program referenced by account at index $accountIndex is temporarily restricted.", [ze]: "ResanitizationNeeded", [Fe]: "Transaction failed to sanitize accounts offsets correctly", [_e]: "Transaction did not pass signature verification", [be]: "Transaction locked too many accounts", [$e]: "Sum of account balances before and after transaction do not match", [ue]: "The transaction failed with the error `$errorName`", [Le]: "Transaction version is unsupported", [Oe]: "Transaction would exceed account data limit within the block", [Ve]: "Transaction would exceed total account data limit", [Ye]: "Transaction would exceed max account limit within the block", [Je]: "Transaction would exceed max Block Cost Limit", [ve]: "Transaction would exceed max Vote Cost Limit", [ne]: "Attempted to sign a transaction with an address that is not a signer for it", [Qe]: "Transaction is missing an address at index: $index.", [ae]: "Transaction has no expected signers therefore it cannot be encoded", [De]: "Transaction size $transactionSize exceeds limit of $transactionSizeLimit bytes", [jQ]: "Transaction does not have a blockhash lifetime", [$Q]: "Transaction is not a durable nonce transaction", [ge]: "Contents of these address lookup tables unknown: $lookupTableAddresses", [Ie]: "Lookup of address at index $highestRequestedIndex failed for lookup table `$lookupTableAddress`. Highest known index is $highestKnownIndex. The lookup table may have been extended since its contents were retrieved", [Be]: "No fee payer set in CompiledTransaction", [Ce]: "Could not find program address at index $index", [se]: "Failed to estimate the compute unit consumption for this transaction message. This is likely because simulating the transaction failed. Inspect the `cause` property of this error to learn more", [ce]: "Transaction failed when it was simulated in order to estimate the compute unit consumption. The compute unit estimate provided is for a transaction that failed when simulated and may not be representative of the compute units this transaction would consume if successful. Inspect the `cause` property of this error to learn more", [ee]: "Transaction is missing a fee payer.", [ie]: "Could not determine this transaction's signature. Make sure that the transaction has been signed by its fee payer.", [te]: "Transaction first instruction is not advance nonce account instruction.", [oe]: "Transaction with no instructions cannot be durable nonce transaction.", [XQ]: "This transaction includes an address (`$programAddress`) which is both invoked and set as the fee payer. Program addresses may not pay fees", [zQ]: "This transaction includes an address (`$programAddress`) which is both invoked and marked writable. Program addresses may not be writable", [re]: "The transaction message expected the transaction to have $signerAddressesLength signatures, got $signaturesLength.", [Ee]: "Transaction is missing signatures for addresses: $addresses.", [Ae]: "Transaction version must be in the range [0, 127]. `$actualVersion` given" }, eA = "i", BA = "t"; function Mi(A, g = {}) { const I = Si[A]; if (I.length === 0) return ""; let B; function C(Q) { if (B[BA] === 2) { const e = I.slice(B[eA] + 1, Q); E.push( e in g ? ( // eslint-disable-next-line @typescript-eslint/restrict-template-expressions `${g[e]}` ) : `$${e}` ); } else B[BA] === 1 && E.push(I.slice(B[eA], Q)); } const E = []; return I.split("").forEach((Q, e) => { if (e === 0) { B = { [eA]: 0, [BA]: I[0] === "\\" ? 0 : I[0] === "$" ? 2 : 1 /* Text */ }; return; } let r; switch (B[BA]) { case 0: r = { [eA]: e, [BA]: 1 /* Text */ }; break; case 1: Q === "\\" ? r = { [eA]: e, [BA]: 0 /* EscapeSequence */ } : Q === "$" && (r = { [eA]: e, [BA]: 2 /* Variable */ }); break; case 2: Q === "\\" ? r = { [eA]: e, [BA]: 0 /* EscapeSequence */ } : Q === "$" ? r = { [eA]: e, [BA]: 2 /* Variable */ } : Q.match(/\w/) || (r = { [eA]: e, [BA]: 1 /* Text */ }); break; } r && (B !== r && C(e), B = r); }), C(), E.join(""); } function Gi(A, g = {}) { if (process.env.NODE_ENV !== "production") return Mi(A, g); { let I = `Solana error #${A}; Decode this error by running \`npx @solana/errors decode -- ${A}`; return Object.keys(g).length && (I += ` '${hi(g)}'`), `${I}\``; } } function Zg(A, g) { return A instanceof Error && A.name === "SolanaError" ? g !== void 0 ? A.context.__code === g : !0 : !1; } var J = class extends Error { /** * Indicates the root cause of this {@link SolanaError}, if any. * * For example, a transaction error might have an instruction error as its root cause. In this * case, you will be able to access the instruction error on the transaction error as `cause`. */ cause = this.cause; /** * Contains context that can assist in understanding or recovering from a {@link SolanaError}. */ context; constructor(...[A, g]) { let I, B; if (g) { const { cause: E, ...Q } = g; E && (B = { cause: E }), Object.keys(Q).length > 0 && (I = Q); } const C = Gi(A, I); super(C, B), this.context = { __code: A, ...I }, this.name = "SolanaError"; } }, yi = (A, g) => { if (A.length >= g) return A; const I = new Uint8Array(g).fill(0); return I.set(A), I; }, fi = (A, g) => yi(A.length <= g ? A : A.slice(0, g), g); function S(A, g, I) { const B = I === 0 && A.length === g.length ? A : A.slice(I, I + g.length); return B.length !== g.length ? !1 : g.every((C, E) => C === B[E]); } function oA(A, g) { return "fixedSize" in g ? g.fixedSize : g.getSizeFromValue(A); } function j(A) { return Object.freeze({ ...A, encode: (g) => { const I = new Uint8Array(oA(g, A)); return A.write(g, I, 0), I; } }); } function $(A) { return Object.freeze({ ...A, decode: (g, I = 0) => A.read(g, I)[0] }); } function v(A) { return "fixedSize" in A && typeof A.fixedSize == "number"; } function Xg(A) { if (!v(A)) throw new J(Yg); } function _i(A) { return !v(A); } function D(A, g) { if (v(A) !== v(g)) throw new J(Og); if (v(A) && v(g) && A.fixedSize !== g.fixedSize) throw new J(bg, { decoderFixedSize: g.fixedSize, encoderFixedSize: A.fixedSize }); if (!v(A) && !v(g) && A.maxSize !== g.maxSize) throw new J(Kg, { decoderMaxSize: g.maxSize, encoderMaxSize: A.maxSize }); return { ...g, ...A, decode: g.decode, encode: A.encode, read: g.read, write: A.write }; } function ki(A, g, I = 0) { if (g.length - I <= 0) throw new J(Lg, { codecDescription: A }); } function Cg(A, g, I, B = 0) { const C = I.length - B; if (C < g) throw new J(Tg, { bytesLength: C, codecDescription: A, expected: g }); } function V(A, g) { const I = (Q, e, r) => { const h = A.encode(Q); return r = g.write(h.length, e, r), e.set(h, r), r + h.length; }; if (v(g) && v(A)) return j({ ...A, fixedSize: g.fixedSize + A.fixedSize, write: I }); const B = v(g) ? g.fixedSize : g.maxSize ?? null, C = v(A) ? A.fixedSize : A.maxSize ?? null, E = B !== null && C !== null ? B + C : null; return j({ ...A, ...E !== null ? { maxSize: E } : {}, getSizeFromValue: (Q) => { const e = oA(Q, A); return oA(e, g) + e; }, write: I }); } function x(A, g) { const I = (Q, e) => { const [r, h] = g.read(Q, e), W = Number(r); return e = h, (e > 0 || Q.length > W) && (Q = Q.slice(e, e + W)), Cg("addDecoderSizePrefix", W, Q), [A.decode(Q), e + W]; }; if (v(g) && v(A)) return $({ ...A, fixedSize: g.fixedSize + A.fixedSize, read: I }); const B = v(g) ? g.fixedSize : g.maxSize ?? null, C = v(A) ? A.fixedSize : A.maxSize ?? null, E = B !== null && C !== null ? B + C : null; return $({ ...A, ...E !== null ? { maxSize: E } : {}, read: I }); } function M(A, g) { return j({ fixedSize: g, write: (I, B, C) => { const E = A.encode(I), Q = E.length > g ? E.slice(0, g) : E; return B.set(Q, C), C + g; } }); } function G(A, g) { return $({ fixedSize: g, read: (I, B) => { Cg("fixCodecSize", g, I, B), (B > 0 || I.length > g) && (I = I.slice(B, B + g)), v(A) && (I = fi(I, A.fixedSize)); const [C] = A.read(I, 0); return [C, B + g]; } }); } function d(A, g) { return j({ ..._i(A) ? { ...A, getSizeFromValue: (I) => A.getSizeFromValue(g(I)) } : A, write: (I, B, C) => A.write(g(I), B, C) }); } function lA(A, g) { return $({ ...A, read: (I, B) => { const [C, E] = A.read(I, B); return [g(C, I, B), E]; } }); } function Fi(A, g, I = g) { if (!g.match(new RegExp(`^[${A}]*$`))) throw new J(bA, { alphabet: A, base: A.length, value: I }); } var Ui = (A) => j({ getSizeFromValue: (g) => { const [I, B] = cg(g, A[0]); if (!B) return g.length; const C = Dg(B, A); return I.length + Math.ceil(C.toString(16).length / 2); }, write(g, I, B) { if (Fi(A, g), g === "") return B; const [C, E] = cg(g, A[0]); if (!E) return I.set(new Uint8Array(C.length).fill(0), B), B + C.length; let Q = Dg(E, A); const e = []; for (; Q > 0n; ) e.unshift(Number(Q % 256n)), Q /= 256n; const r = [...Array(C.length).fill(0), ...e]; return I.set(r, B), B + r.length; } }), mi = (A) => $({ read(g, I) { const B = I === 0 ? g : g.slice(I); if (B.length === 0) return ["", 0]; let C = B.findIndex((r) => r !== 0); C = C === -1 ? B.length : C; const E = A[0].repeat(C); if (C === B.length) return [E, g.length]; const Q = B.slice(C).reduce((r, h) => r * 256n + BigInt(h), 0n), e = Ji(Q, A); return [E + e, g.length]; } }); function cg(A, g) { const [I, B] = A.split(new RegExp(`((?!${g}).*)`)); return [I, B]; } function Dg(A, g) { const I = BigInt(g.length); let B = 0n; for (const C of A) B *= I, B += BigInt(g.indexOf(C)); return B; } function Ji(A, g) { const I = BigInt(g.length), B = []; for (; A > 0n; ) B.unshift(g[Number(A % I)]), A /= I; return B.join(""); } var zg = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz", Li = () => Ui(zg), Ti = () => mi(zg), ug = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/", Yi = () => j({ getSizeFromValue: (A) => { try { return atob(A).length; } catch { throw new J(bA, { alphabet: ug, base: 64, value: A }); } }, write(A, g, I) { try { const B = atob(A).split("").map((C) => C.charCodeAt(0)); return g.set(B, I), B.length + I; } catch { throw new J(bA, { alphabet: ug, base: 64, value: A }); } } }), Oi = (A) => ( // eslint-disable-next-line no-control-regex A.replace(/\u0000/g, "") ), bi = globalThis.TextDecoder, Rg = globalThis.TextEncoder, Z = () => { let A; return j({ getSizeFromValue: (g) => (A ||= new Rg()).encode(g).length, write: (g, I, B) => { const C = (A ||= new Rg()).encode(g); return I.set(C, B), B + C.length; } }); }, X = () => { let A; return $({ read(g, I) { const B = (A ||= new bi()).decode(g.slice(I)); return [Oi(B), g.length]; } }); }; function GA(A, g) { try { return "exists" in A && !A.exists ? A : Object.freeze({ ...A, data: g.decode(A.data) }); } catch { throw new J(Ug, { address: A.address }); } } function jg(A, g) { if (!g) return Object.freeze({ address: A, exists: !1 }); const I = Yi().encode(g.data[0]); return Object.freeze({ ...Ki(g), address: A, data: I, exists: !0 }); } function Ki(A) { return Object.freeze({ executable: A.executable, lamports: A.lamports, programAddress: A.owner, space: A.space }); } async function yA(A, g, I = {}) { const { abortSignal: B, ...C } = I, E = await A.getAccountInfo(g, { ...C, encoding: "base64" }).send({ abortSignal: B }); return jg(g, E.value); } async function fA(A, g, I = {}) { const { abortSignal: B, ...C } = I; return (await A.getMultipleAccounts(g, { ...C, encoding: "base64" }).send({ abortSignal: B })).value.map((Q, e) => jg(g[e], Q)); } function _A(A) { if (!A.exists) throw new J(kg, { address: A.address }); } function kA(A) { const g = A.filter((I) => !I.exists); if (g.length > 0) { const I = g.map((B) => B.address); throw new J(Fg, { addresses: I }); } } function pi() { if (typeof globalThis.crypto > "u" || typeof globalThis.crypto.subtle?.digest != "function") throw new J(mg); } var zA, jA; function $g() { return zA || (zA = Li()), zA; } function Hi() { return jA || (jA = Ti()), jA; } function qi(A) { if ( // Lowest address (32 bytes of zeroes) A.length < 32 || // Highest address (32 bytes of 255) A.length > 44 ) throw new J(Gg, { actualLength: A.length }); const B = $g().encode(A).byteLength; if (B !== 32) throw new J(Mg, { actualLength: B }); } function Pi(A) { return qi(A), A; } function s() { return d( M($g(), 32), (A) => Pi(A) ); } function c() { return G(Hi(), 32); } function vi() { return D(s(), c()); } var Vi = 37095705934669439343138083508754565189542113879843219016388785533085940283555n, AA = 57896044618658097711785492504343953926634992332820282019728792003956564819949n, lg = 19681161376707505956807079304988542015446066515923890162744021073123829784752n; function CA(A) { const g = A % AA; return g >= 0n ? g : AA + g; } function EA(A, g) { let I = A; for (; g-- > 0n; ) I *= I, I %= AA; return I; } function xi(A) { const I = A * A % AA * A % AA, B = EA(I, 2n) * I % AA, C = EA(B, 1n) * A % AA, E = EA(C, 5n) * C % AA, Q = EA(E, 10n) * E % AA, e = EA(Q, 20n) * Q % AA, r = EA(e, 40n) * e % AA, h = EA(r, 80n) * r % AA, W = EA(h, 80n) * r % AA, IA = EA(W, 10n) * E % AA; return EA(IA, 2n) * A % AA; } function Wi(A, g) { const I = CA(g * g * g), B = CA(I * I * g), C = xi(A * B); let E = CA(A * I * C); const Q = CA(g * E * E), e = E, r = CA(E * lg), h = Q === A, W = Q === CA(-A), IA = Q === CA(-A * lg); return h && (E = e), (W || IA) && (E = r), (CA(E) & 1n) === 1n && (E = CA(-E)), !h && !W ? null : E; } function Zi(A, g) { const I = CA(A * A), B = CA(I - 1n), C = CA(Vi * I + 1n), E = Wi(B, C); if (E === null) return !1; const Q = (g & 128) !== 0; return !(E === 0n && Q); } function Xi(A) { const g = A.toString(16); return g.length === 1 ? `0${g}` : g; } function zi(A) { const I = `0x${A.reduce((B, C, E) => `${Xi(E === 31 ? C & -129 : C)}${B}`, "")}`; return BigInt(I); } function ji(A) { if (A.byteLength !== 32) return !1; const g = zi(A); return Zi(g, A[31]); } var wg = 32, Ng = 16, $i = [ // The string 'ProgramDerivedAddress' 80, 114, 111, 103, 114, 97, 109, 68, 101, 114, 105, 118, 101, 100, 65, 100, 100, 114, 101, 115, 115 ]; async function Ao({ programAddress: A, seeds: g }) { if (pi(), g.length > Ng) throw new J(yg, { actual: g.length, maxSeeds: Ng }); let I; const B = g.reduce((r, h, W) => { const IA = typeof h == "string" ? (I ||= new TextEncoder()).encode(h) : h; if (IA.byteLength > wg) throw new J(fg, { actual: IA.byteLength, index: W, maxSeedLength: wg }); return r.push(...IA), r; }, []), C = vi(), E = C.encode(A), Q = await crypto.subtle.digest( "SHA-256", new Uint8Array([...B, ...E, ...$i]) ), e = new Uint8Array(Q); if (ji(e)) throw new J(gg); return C.decode(e); } async function FA({ programAddress: A, seeds: g }) { let I = 255; for (; I > 0; ) try { return [await Ao({ programAddress: A, seeds: [...g, new Uint8Array([I])] }), I]; } catch (B) { if (Zg(B, gg)) I--; else throw B; } throw new J(_g); } function go(A, g, I, B) { if (B < g || B > I) throw new J(vg, { codecDescription: A, max: I, min: g, value: B }); } function AI(A) { return A?.endian !== 1; } function wA(A) { return j({ fixedSize: A.size, write(g, I, B) { A.range && go(A.name, A.range[0], A.range[1], g); const C = new ArrayBuffer(A.size); return A.set(new DataView(C), g, AI(A.config)), I.set(new Uint8Array(C), B), B + A.size; } }); } function NA(A) { return $({ fixedSize: A.size, read(g, I = 0) { ki(A.name, g, I), Cg(A.name, A.size, g, I); const B = new DataView(Io(g, I, A.size)); return [A.get(B, AI(A.config)), I + A.size]; } }); } function Io(A, g, I) { const B = A.byteOffset + (g ?? 0), C = I ?? A.byteLength; return A.buffer.slice(B, B + C); } var KA = (A = {}) => wA({ config: A, name: "i32", range: [-+"0x7fffffff" - 1, +"0x7fffffff"], set: (g, I, B) => g.setInt32(0, Number(I), B), size: 4 }), pA = (A = {}) => NA({ config: A, get: (g, I) => g.getInt32(0, I), name: "i32", size: 4 }), U = (A = {}) => wA({ config: A, name: "u128", range: [0n, BigInt("0xffffffffffffffffffffffffffffffff")], set: (g, I, B) => { const C = B ? 8 : 0, E = B ? 0 : 8, Q = 0xffffffffffffffffn; g.setBigUint64(C, BigInt(I) >> 64n, B), g.setBigUint64(E, BigInt(I) & Q, B); }, size: 16 }), m = (A = {}) => NA({ config: A, get: (g, I) => { const B = I ? 8 : 0, C = I ? 0 : 8, E = g.getBigUint64(B, I), Q = g.getBigUint64(C, I); return (E << 64n) + Q; }, name: "u128", size: 16 }), R = (A = {}) => wA({ config: A, name: "u16", range: [0, +"0xffff"], set: (g, I, B) => g.setUint16(0, Number(I), B), size: 2 }), l = (A = {}) => NA({ config: A, get: (g, I) => g.getUint16(0, I), name: "u16", size: 2 }), L = (A = {}) => wA({ config: A, name: "u32", range: [0, +"0xffffffff"], set: (g, I, B) => g.setUint32(0, Number(I), B), size: 4 }), T = (A = {}) => NA({ config: A, get: (g, I) => g.getUint32(0, I), name: "u32", size: 4 }), o = (A = {}) => wA({ config: A, name: "u64", range: [0n, BigInt("0xffffffffffffffff")], set: (g, I, B) => g.setBigUint64(0, BigInt(I), B), size: 8 }), t = (A = {}) => NA({ config: A, get: (g, I) => g.getBigUint64(0, I), name: "u64", size: 8 }), i = () => wA({ name: "u8", range: [0, +"0xff"], set: (A, g) => A.setUint8(0, Number(g)), size: 1 }), N = () => NA({ get: (A) => A.getUint8(0), name: "u8", size: 1 }); function gI(A, g, I) { if (g !== I) throw new J(pg, { actual: I, codecDescription: A, expected: g }); } function Co(A) { return A.reduce( (g, I) => g === null || I === null ? null : Math.max(g, I), 0 ); } function tA(A) { return A.reduce((g, I) => g === null || I === null ? null : g + I, 0); } function dA(A) { return v(A) ? A.fixedSize : null; } function cA(A) { return v(A) ? A.fixedSize : A.maxSize ?? null; } function q(A, g = {}) { const I = g.size ?? L(), B = HA(I, dA(A)), C = HA(I, cA(A)) ?? void 0; return j({ ...B !== null ? { fixedSize: B } : { getSizeFromValue: (E) => (typeof I == "object" ? oA(E.length, I) : 0) + [...E].reduce((e, r) => e + oA(r, A), 0), maxSize: C }, write: (E, Q, e) => (typeof I == "number" && gI("array", I, E.length), typeof I == "object" && (e = I.write(E.length, Q, e)), E.forEach((r) => { e = A.write(r, Q, e); }), e) }); } function P(A, g = {}) { const I = g.size ?? T(), B = dA(A), C = HA(I, B), E = HA(I, cA(A)) ?? void 0; return $({ ...C !== null ? { fixedSize: C } : { maxSize: E }, read: (Q, e) => { const r = []; if (typeof I == "object" && Q.slice(e).length === 0) return [r, e]; if (I === "remainder") { for (; e < Q.length; ) { const [IA, UA] = A.read(Q, e); e = UA, r.push(IA); } return [r, e]; } const [h, W] = typeof I == "number" ? [I, e] : I.read(Q, e); e = W; for (let IA = 0; IA < h; IA += 1) { const [UA, TB] = A.read(Q, e); e = TB, r.push(UA); } return [r, e]; } }); } function HA(A, g) { return typeof A != "number" ? null : A === 0 ? 0 : g === null ? null : g * A; } function b(A = {}) { return d(A.size ?? i(), (g) => g ? 1 : 0); } function K(A = {}) { return lA(A.size ?? N(), (g) => Number(g) === 1); } function y() { return j({ getSizeFromValue: (A) => A.length, write: (A, g, I) => (g.set(A, I), I + A.length) }); } function f() { return $({ read: (A, g) => { const I = A.slice(g); return [I, g + I.length]; } }); } var Bo = () => $({ read(A, g) { return [A.slice(g).reduce((B, C) => B + C.toString(16).padStart(2, "0"), ""), A.length]; } }); function Eo(A) { return j({ fixedSize: A.length, write: (g, I, B) => (I.set(A, B), B + A.length) }); } function Qo(A) { return $({ fixedSize: A.length, read: (g, I) => { const B = Bo(); if (!S(g, A, I)) throw new J(xg, { constant: A, data: g, hexConstant: B.decode(A), hexData: B.decode(g), offset: I }); return [void 0, I + A.length]; } }); } function p(A) { const g = tA(A.map(dA)), I = tA(A.map(cA)) ?? void 0; return j({ ...g === null ? { getSizeFromValue: (B) => A.map((C, E) => oA(B[E], C)).reduce((C, E) => C + E, 0), maxSize: I } : { fixedSize: g }, write: (B, C, E) => (gI("tuple", A.length, B.length), A.forEach((Q, e) => { E = Q.write(B[e], C, E); }), E) }); } function H(A) { const g = tA(A.map(dA)), I = tA(A.map(cA)) ?? void 0; return $({ ...g === null ? { maxSize: I } : { fixedSize: g }, read: (B, C) => { const E = []; return A.forEach((Q) => { const [e, r] = Q.read(B, C); E.push(e), C = r; }), [E, C]; } }); } function II(A, g) { const I = BI(A), B = (E, Q, e) => { const r = g(E); return $A(A, r), A[r].write(E, Q, e); }; if (I !== null) return j({ fixedSize: I, write: B }); const C = EI(A); return j({ ...C !== null ? { maxSize: C } : {}, getSizeFromValue: (E) => { const Q = g(E); return $A(A, Q), oA(E, A[Q]); }, write: B }); } function CI(A, g) { const I = BI(A), B = (E, Q) => { const e = g(E, Q); return $A(A, e), A[e].read(E, Q); }; if (I !== null) return $({ fixedSize: I, read: B }); const C = EI(A); return $({ ...C !== null ? { maxSize: C } : {}, read: B }); } function $A(A, g) { if (typeof A[g] > "u") throw new J(Vg, { maxRange: A.length - 1, minRange: 0, variant: g }); } function BI(A) { if (A.length === 0) return 0; if (!v(A[0])) return null; const g = A[0].fixedSize; return A.every((B) => v(B) && B.fixedSize === g) ? g : null; } function EI(A) { return Co(A.map((g) => cA(g))); } function DA(A, g = {}) { const I = g.discriminator ?? "__kind", B = g.size ?? i(); return II( A.map( ([, C], E) => d(p([B, C]), (Q) => [E, Q]) ), (C) => eo(A, C[I]) ); } function uA(A, g = {}) { const I = g.discriminator ?? "__kind", B = g.size ?? N(); return CI( A.map( ([C, E]) => lA(H([B, E]), ([, Q]) => ({ [I]: C, ...Q })) ), (C, E) => Number(B.read(C, E)[0]) ); } function eo(A, g) { const I = A.findIndex(([B]) => g === B); if (I < 0) throw new J(qg, { value: g, variants: A.map(([B]) => B) }); return I; } function QI(A) { const g = [...new Set(Object.values(A).filter((Q) => typeof Q == "number"))].sort(), I = Object.fromEntries(Object.entries(A).slice(g.length)), B = Object.keys(I), C = Object.values(I), E = [ .../* @__PURE__ */ new Set([...B, ...C.filter((Q) => typeof Q == "string")]) ]; return { enumKeys: B, enumRecord: I, enumValues: C, numericalValues: g, stringValues: E }; } function io({ enumKeys: A, enumValues: g, variant: I }) { const B = eI(g, (C) => C === I); return B >= 0 ? B : A.findIndex((C) => C === I); } function oo({ discriminator: A, enumKeys: g, enumValues: I, useValuesAsDiscriminators: B }) { return B ? eI(I, (C) => C === A) : A >= 0 && A < g.length ? A : -1; } function eI(A, g) { let I = A.length; for (; I--; ) if (g(A[I], I, A)) return I; return -1; } function iI(A) { if (A.length === 0) return ""; let g = [A[0], A[0]]; const I = []; for (let B = 1; B < A.length; B++) { const C = A[B]; g[1] + 1 === C ? g[1] = C : (I.push(g[0] === g[1] ? `${g[0]}` : `${g[0]}-${g[1]}`), g = [C, C]); } return I.push(g[0] === g[1] ? `${g[0]}` : `${g[0]}-${g[1]}`), I.join(", "); } function nA(A, g = {}) { const I = g.size ?? i(), B = g.useValuesAsDiscriminators ?? !1, { enumKeys: C, enumValues: E, numericalValues: Q, stringValues: e } = QI(A); if (B && E.some((r) => typeof r == "string")) throw new J(Ig, { stringValues: E.filter((r) => typeof r == "string") }); return d(I, (r) => { const h = io({ enumKeys: C, enumValues: E, variant: r }); if (h < 0) throw new J(Pg, { formattedNumericalValues: iI(Q), numericalValues: Q, stringValues: e, variant: r }); return B ? E[h] : h; }); } function aA(A, g = {}) { const I = g.size ?? N(), B = g.useValuesAsDiscriminators ?? !1, { enumKeys: C, enumValues: E, numericalValues: Q } = QI(A); if (B && E.some((e) => typeof e == "string")) throw new J(Ig, { stringValues: E.filter((e) => typeof e == "string") }); return lA(I, (e) => { const r = Number(e), h = oo({ discriminator: r, enumKeys: C, enumValues: E, useValuesAsDiscriminators: B }); if (h < 0) { const W = B ? Q : [...Array(C.length).keys()]; throw new J(Hg, { discriminator: r, formattedValidDiscriminators: iI(W), validDiscriminators: W }); } return E[h]; }); } function JA() { return j({ fixedSize: 0, write: (A, g, I) => I }); } function LA() { return $({ fixedSize: 0, read: (A, g) => [void 0, g] }); } function n(A) { const g = A.map(([, C]) => C), I = tA(g.map(dA)), B = tA(g.map(cA)) ?? void 0; return j({ ...I === null ? { getSizeFromValue: (C) => A.map(([E, Q]) => oA(C[E], Q)).reduce((E, Q) => E + Q, 0), maxSize: B } : { fixedSize: I }, write: (C, E, Q) => (A.forEach(([e, r]) => { Q = r.write(C[e], E, Q); }), Q) }); } function a(A) { const g = A.map(([, C]) => C), I = tA(g.map(dA)), B = tA(g.map(cA)) ?? void 0; return $({ ...I === null ? { maxSize: B } : { fixedSize: I }, read: (C, E) => { const Q = {}; return A.forEach(([e, r]) => { const [h, W] = r.read(C, E); E = W, Q[e] = h; }), [Q, E]; } }); } var oI = (A) => ({ __option: "Some", value: A }), tI = () => ({ __option: "None" }), dg = (A) => !!(A && typeof A == "object" && "__option" in A && (A.__option === "Some" && "value" in A || A.__option === "None")), hg = (A) => A.__option === "Some", to = (A) => A !== null ? oI(A) : tI(); function k(A, g = {}) { const I = g.prefix === null ? d(JA(), (C) => { }) : b({ size: g.prefix ?? i() }), B = g.noneValue === "zeroes" ? (Xg(A), M(JA(), A.fixedSize)) : g.noneValue ? Eo(g.noneValue) : JA(); return II( [ d(p([I, B]), (C) => [ !1, void 0 ]), d(p([I, A]), (C) => [ !0, dg(C) && hg(C) ? C.value : C ]) ], (C) => { const E = dg(C) ? C : to(C); return Number(hg(E)); } ); } function F(A, g = {}) { const I = g.prefix === null ? lA(LA(), () => !1) : K({ size: g.prefix ?? N() }), B = g.noneValue === "zeroes" ? (Xg(A), G(LA(), A.fixedSize)) : g.noneValue ? Qo(g.noneValue) : LA(); return CI( [ lA(H([I, B]), () => tI()), lA(H([I, A]), ([, C]) => oI(C)) ], (C, E) => { if (g.prefix === null && !g.noneValue) return +(E < C.length); if (g.prefix === null && g.noneValue != null) { const Q = g.noneValue === "zeroes" ? new Uint8Array(B.fixedSize).fill(0) : g.noneValue; return S(C, Q, E) ? 0 : 1; } return Number(I.read(C, E)[0]); } ); } var TA = /* @__PURE__ */ ((A) => (A[A.WRITABLE_SIGNER = /* 3 */ 3] = "WRITABLE_SIGNER", A[A.READONLY_SIGNER = /* 2 */ 2] = "READONLY_SIGNER", A[A.WRITABLE = /* 1 */ 1] = "WRITABLE", A[A.READONLY = /* 0 */ 0] = "READONLY", A))(TA || {}), no = 2; function ao(A) { return A | no; } function ro(A, g, I, B) { if (!Zg(A, Jg)) return !1; const C = g.instructions[A.context.index]?.programAddress; return !C || C !== I ? !1 : typeof B > "u" || A.context.code === B; } function so(A) { return "modifyAndSignTransactions" in A && typeof A.modifyAndSignTransactions == "function"; } function co(A) { return "signTransactions" in A && typeof A.signTransactions == "function"; } function Do(A) { return "signAndSendTransactions" in A && typeof A.signAndSendTransactions == "function"; } function uo(A) { return co(A) || so(A) || Do(A); } var gA = /* @__PURE__ */ ((A) => (A[A.Uninitialized = 0] = "Uninitialized", A[A.Closed = 1] = "Closed", A[A.BondingCurve = 2] = "BondingCurve", A[A.AuthorityConfig = 3] = "AuthorityConfig", A[A.PermissionConfig = 4] = "PermissionConfig", A[A.ConsumedPermission = 5] = "ConsumedPermission", A[A.MintConfig = 6] = "MintConfig", A))(gA || {}); function z() { return nA(gA); } function hA() { return aA(gA); } function Ja() { return D( z(), hA() ); } var Bg = /* @__PURE__ */ ((A) => (A[A.Manual = 0] = "Manual", A[A.Launch = 1] = "Launch", A[A.Lockedlaunch = 2] = "Lockedlaunch", A[A.Presale = 3] = "Presale", A))(Bg || {}); function nI() { return nA(Bg); } function aI() { return aA(Bg); } function La() { return D( nI(), aI() ); } function Ro() { return DA([ [ "BondingCurveCreated", n([ ["creationType", nI()], ["baseMint", s()], ["quoteMint", s()], ["creator", s()], ["startPrice", U()], ["endPrice", U()], ["controlPoints", q(R(), { size: 4 })], ["swapFeeBps", R()], ["quoteFeeBps", R()], ["baseFeeBps", R()], ["baseAllocationBps", R()], ["launchSlot", o()], ["creatorReward", o()], [ "graduationMethods", q(qA(), { size: 8 }) ], ["graduationTarget", o()], ["graduationSlot", o()], ["graduationReward", o()], ["retainMintAuthority", b()], ["minReserveBps", R()], ["buyRequiresPermission", b()], ["buyPermissionBitmap", M(y(), 32)], ["maxBuyAmount", o()], ["sellRequiresPermission", b()], ["sellPermissionBitmap", M(y(), 32)], ["maxSellAmount", o()], ["quoteTokenProgram", s()], ["baseTokenProgram", s()], ["quoteTokenDecimals", i()], ["baseTokenDecimals", i()] ]) ], [ "TokenBought", n([ ["buyer", s()], ["baseMint", s()], ["quoteMint", s()], ["amountIn", o()], ["amountOut", o()], ["priceBefore", U()], ["priceAfter", U()], ["quoteAmountBefore", o()], ["quoteAmountAfter", o()], ["baseAmountBefore", o()], ["baseAmountAfter", o()], ["protocolFee", o()] ]) ],