@gabox-labs/sdk 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","names":[],"sources":["../../src/generated/events/drawResolved.ts","../../src/generated/events/packBought.ts","../../src/generated/events/poolCreated.ts","../../src/generated/events/prizeRedeemed.ts","../../src/generated/events/prizesFunded.ts","../../src/generated/events/randomnessRetried.ts","../../src/generated/events/tokensSold.ts","../../src/generated/errors/gaboxV2.ts","../../src/generated/events/referralBound.ts","../../src/generated/events/referralClaimed.ts","../../src/generated/index.ts"],"sourcesContent":["/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { combineCodec, containsBytes, fixDecoderSize, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBooleanDecoder, getBooleanEncoder, getBytesDecoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from '@solana/kit';\n\nexport const DRAW_RESOLVED_EVENT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([127, 177, 62, 146, 164, 90, 185, 218]);\n\nexport function getDrawResolvedEventDiscriminatorBytes(): ReadonlyUint8Array { return fixEncoderSize(getBytesEncoder(), 8).encode(DRAW_RESOLVED_EVENT_DISCRIMINATOR); }\n\nexport type DrawResolvedEvent = { pool: Address; seq: bigint; purchaser: Address; amount: bigint; randomness: ReadonlyUint8Array; timedOut: boolean; };\n\nexport type DrawResolvedEventArgs = { pool: Address; seq: number | bigint; purchaser: Address; amount: number | bigint; randomness: ReadonlyUint8Array; timedOut: boolean; };\n\n/** Gets the encoder for {@link DrawResolvedEventArgs} event data. */\nexport function getDrawResolvedEventEncoder(): FixedSizeEncoder<DrawResolvedEventArgs> {\n return getHiddenPrefixEncoder(getStructEncoder([['pool', getAddressEncoder()], ['seq', getU64Encoder()], ['purchaser', getAddressEncoder()], ['amount', getU64Encoder()], ['randomness', fixEncoderSize(getBytesEncoder(), 32)], ['timedOut', getBooleanEncoder()]]), [getConstantEncoder(DRAW_RESOLVED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the decoder for {@link DrawResolvedEvent} event data. */\nexport function getDrawResolvedEventDecoder(): FixedSizeDecoder<DrawResolvedEvent> {\n return getHiddenPrefixDecoder(getStructDecoder([['pool', getAddressDecoder()], ['seq', getU64Decoder()], ['purchaser', getAddressDecoder()], ['amount', getU64Decoder()], ['randomness', fixDecoderSize(getBytesDecoder(), 32)], ['timedOut', getBooleanDecoder()]]), [getConstantDecoder(DRAW_RESOLVED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the codec for {@link DrawResolvedEvent} event data. */\nexport function getDrawResolvedEventCodec(): FixedSizeCodec<DrawResolvedEventArgs, DrawResolvedEvent> {\n return combineCodec(getDrawResolvedEventEncoder(), getDrawResolvedEventDecoder());\n}\n\n/** Parses the provided bytes into {@link DrawResolvedEvent} event data. */\nexport function parseDrawResolvedEvent(data: ReadonlyUint8Array | Uint8Array): DrawResolvedEvent {\n if (containsBytes(data, DRAW_RESOLVED_EVENT_DISCRIMINATOR, 0)) { return getDrawResolvedEventDecoder().decode(data); }\n throw new Error('The provided data does not match the \"DrawResolvedEvent\" event discriminators.');\n}","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { combineCodec, containsBytes, fixEncoderSize, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from '@solana/kit';\nimport { getPrizeDecoder, getPrizeEncoder, type Prize, type PrizeArgs } from '../types';\n\nexport const PACK_BOUGHT_EVENT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([220, 208, 74, 75, 42, 144, 231, 69]);\n\nexport function getPackBoughtEventDiscriminatorBytes(): ReadonlyUint8Array { return fixEncoderSize(getBytesEncoder(), 8).encode(PACK_BOUGHT_EVENT_DISCRIMINATOR); }\n\nexport type PackBoughtEvent = { pool: Address; seq: bigint; purchaser: Address; venue: Address;\n/** Always `pool.pack_tokens`. The trade is exact-tokens-out. */\ntokensBought: bigint;\n/**\n * What the pack cost: venue quote spend plus venue account rent; SOL + WSOL,\n * without double counting. Both fees below are a share of this number.\n */\nvenueDebit: bigint;\n/** The creator's `fee_bps` share of `venue_debit`, paid on top of it. */\nfeeLamports: bigint;\n/** The referrer's share of `fee_lamports`, deducted from the creator fee. */\nreferralLamports: bigint;\n/** The protocol's 1% of `venue_debit`, paid on top of it. */\nprotocolLamports: bigint; vrfDebit: bigint; prizes: Array<Prize>; };\n\nexport type PackBoughtEventArgs = { pool: Address; seq: number | bigint; purchaser: Address; venue: Address;\n/** Always `pool.pack_tokens`. The trade is exact-tokens-out. */\ntokensBought: number | bigint;\n/**\n * What the pack cost: venue quote spend plus venue account rent; SOL + WSOL,\n * without double counting. Both fees below are a share of this number.\n */\nvenueDebit: number | bigint;\n/** The creator's `fee_bps` share of `venue_debit`, paid on top of it. */\nfeeLamports: number | bigint;\n/** The referrer's share of `fee_lamports`, deducted from the creator fee. */\nreferralLamports: number | bigint;\n/** The protocol's 1% of `venue_debit`, paid on top of it. */\nprotocolLamports: number | bigint; vrfDebit: number | bigint; prizes: Array<PrizeArgs>; };\n\n/** Gets the encoder for {@link PackBoughtEventArgs} event data. */\nexport function getPackBoughtEventEncoder(): FixedSizeEncoder<PackBoughtEventArgs> {\n return getHiddenPrefixEncoder(getStructEncoder([['pool', getAddressEncoder()], ['seq', getU64Encoder()], ['purchaser', getAddressEncoder()], ['venue', getAddressEncoder()], ['tokensBought', getU64Encoder()], ['venueDebit', getU64Encoder()], ['feeLamports', getU64Encoder()], ['referralLamports', getU64Encoder()], ['protocolLamports', getU64Encoder()], ['vrfDebit', getU64Encoder()], ['prizes', getArrayEncoder(getPrizeEncoder(), { size: 8 })]]), [getConstantEncoder(PACK_BOUGHT_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the decoder for {@link PackBoughtEvent} event data. */\nexport function getPackBoughtEventDecoder(): FixedSizeDecoder<PackBoughtEvent> {\n return getHiddenPrefixDecoder(getStructDecoder([['pool', getAddressDecoder()], ['seq', getU64Decoder()], ['purchaser', getAddressDecoder()], ['venue', getAddressDecoder()], ['tokensBought', getU64Decoder()], ['venueDebit', getU64Decoder()], ['feeLamports', getU64Decoder()], ['referralLamports', getU64Decoder()], ['protocolLamports', getU64Decoder()], ['vrfDebit', getU64Decoder()], ['prizes', getArrayDecoder(getPrizeDecoder(), { size: 8 })]]), [getConstantDecoder(PACK_BOUGHT_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the codec for {@link PackBoughtEvent} event data. */\nexport function getPackBoughtEventCodec(): FixedSizeCodec<PackBoughtEventArgs, PackBoughtEvent> {\n return combineCodec(getPackBoughtEventEncoder(), getPackBoughtEventDecoder());\n}\n\n/** Parses the provided bytes into {@link PackBoughtEvent} event data. */\nexport function parsePackBoughtEvent(data: ReadonlyUint8Array | Uint8Array): PackBoughtEvent {\n if (containsBytes(data, PACK_BOUGHT_EVENT_DISCRIMINATOR, 0)) { return getPackBoughtEventDecoder().decode(data); }\n throw new Error('The provided data does not match the \"PackBoughtEvent\" event discriminators.');\n}","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { combineCodec, containsBytes, fixEncoderSize, getAddressDecoder, getAddressEncoder, getArrayDecoder, getArrayEncoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getStructDecoder, getStructEncoder, getU16Decoder, getU16Encoder, getU64Decoder, getU64Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from '@solana/kit';\nimport { getTierDecoder, getTierEncoder, type Tier, type TierArgs } from '../types';\n\nexport const POOL_CREATED_EVENT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([202, 44, 41, 88, 104, 220, 157, 82]);\n\nexport function getPoolCreatedEventDiscriminatorBytes(): ReadonlyUint8Array { return fixEncoderSize(getBytesEncoder(), 8).encode(POOL_CREATED_EVENT_DISCRIMINATOR); }\n\nexport type PoolCreatedEvent = { pool: Address; mint: Address; creator: Address; packTokens: bigint; feeBps: number; tiers: Array<Tier>;\n/** Tokens the creator donated at creation. Nobody can withdraw them. */\nseedTokens: bigint;\n/** Lamports the creator spent on the curve to buy that seed. */\nseedLamports: bigint; };\n\nexport type PoolCreatedEventArgs = { pool: Address; mint: Address; creator: Address; packTokens: number | bigint; feeBps: number; tiers: Array<TierArgs>;\n/** Tokens the creator donated at creation. Nobody can withdraw them. */\nseedTokens: number | bigint;\n/** Lamports the creator spent on the curve to buy that seed. */\nseedLamports: number | bigint; };\n\n/** Gets the encoder for {@link PoolCreatedEventArgs} event data. */\nexport function getPoolCreatedEventEncoder(): FixedSizeEncoder<PoolCreatedEventArgs> {\n return getHiddenPrefixEncoder(getStructEncoder([['pool', getAddressEncoder()], ['mint', getAddressEncoder()], ['creator', getAddressEncoder()], ['packTokens', getU64Encoder()], ['feeBps', getU16Encoder()], ['tiers', getArrayEncoder(getTierEncoder(), { size: 8 })], ['seedTokens', getU64Encoder()], ['seedLamports', getU64Encoder()]]), [getConstantEncoder(POOL_CREATED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the decoder for {@link PoolCreatedEvent} event data. */\nexport function getPoolCreatedEventDecoder(): FixedSizeDecoder<PoolCreatedEvent> {\n return getHiddenPrefixDecoder(getStructDecoder([['pool', getAddressDecoder()], ['mint', getAddressDecoder()], ['creator', getAddressDecoder()], ['packTokens', getU64Decoder()], ['feeBps', getU16Decoder()], ['tiers', getArrayDecoder(getTierDecoder(), { size: 8 })], ['seedTokens', getU64Decoder()], ['seedLamports', getU64Decoder()]]), [getConstantDecoder(POOL_CREATED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the codec for {@link PoolCreatedEvent} event data. */\nexport function getPoolCreatedEventCodec(): FixedSizeCodec<PoolCreatedEventArgs, PoolCreatedEvent> {\n return combineCodec(getPoolCreatedEventEncoder(), getPoolCreatedEventDecoder());\n}\n\n/** Parses the provided bytes into {@link PoolCreatedEvent} event data. */\nexport function parsePoolCreatedEvent(data: ReadonlyUint8Array | Uint8Array): PoolCreatedEvent {\n if (containsBytes(data, POOL_CREATED_EVENT_DISCRIMINATOR, 0)) { return getPoolCreatedEventDecoder().decode(data); }\n throw new Error('The provided data does not match the \"PoolCreatedEvent\" event discriminators.');\n}","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { combineCodec, containsBytes, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBooleanDecoder, getBooleanEncoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from '@solana/kit';\n\nexport const PRIZE_REDEEMED_EVENT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([243, 193, 245, 166, 160, 101, 182, 207]);\n\nexport function getPrizeRedeemedEventDiscriminatorBytes(): ReadonlyUint8Array { return fixEncoderSize(getBytesEncoder(), 8).encode(PRIZE_REDEEMED_EVENT_DISCRIMINATOR); }\n\nexport type PrizeRedeemedEvent = { pool: Address; seq: bigint; purchaser: Address; amount: bigint; sold: boolean; };\n\nexport type PrizeRedeemedEventArgs = { pool: Address; seq: number | bigint; purchaser: Address; amount: number | bigint; sold: boolean; };\n\n/** Gets the encoder for {@link PrizeRedeemedEventArgs} event data. */\nexport function getPrizeRedeemedEventEncoder(): FixedSizeEncoder<PrizeRedeemedEventArgs> {\n return getHiddenPrefixEncoder(getStructEncoder([['pool', getAddressEncoder()], ['seq', getU64Encoder()], ['purchaser', getAddressEncoder()], ['amount', getU64Encoder()], ['sold', getBooleanEncoder()]]), [getConstantEncoder(PRIZE_REDEEMED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the decoder for {@link PrizeRedeemedEvent} event data. */\nexport function getPrizeRedeemedEventDecoder(): FixedSizeDecoder<PrizeRedeemedEvent> {\n return getHiddenPrefixDecoder(getStructDecoder([['pool', getAddressDecoder()], ['seq', getU64Decoder()], ['purchaser', getAddressDecoder()], ['amount', getU64Decoder()], ['sold', getBooleanDecoder()]]), [getConstantDecoder(PRIZE_REDEEMED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the codec for {@link PrizeRedeemedEvent} event data. */\nexport function getPrizeRedeemedEventCodec(): FixedSizeCodec<PrizeRedeemedEventArgs, PrizeRedeemedEvent> {\n return combineCodec(getPrizeRedeemedEventEncoder(), getPrizeRedeemedEventDecoder());\n}\n\n/** Parses the provided bytes into {@link PrizeRedeemedEvent} event data. */\nexport function parsePrizeRedeemedEvent(data: ReadonlyUint8Array | Uint8Array): PrizeRedeemedEvent {\n if (containsBytes(data, PRIZE_REDEEMED_EVENT_DISCRIMINATOR, 0)) { return getPrizeRedeemedEventDecoder().decode(data); }\n throw new Error('The provided data does not match the \"PrizeRedeemedEvent\" event discriminators.');\n}","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { combineCodec, containsBytes, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from '@solana/kit';\n\nexport const PRIZES_FUNDED_EVENT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([188, 129, 185, 44, 234, 71, 53, 60]);\n\nexport function getPrizesFundedEventDiscriminatorBytes(): ReadonlyUint8Array { return fixEncoderSize(getBytesEncoder(), 8).encode(PRIZES_FUNDED_EVENT_DISCRIMINATOR); }\n\nexport type PrizesFundedEvent = { pool: Address; funder: Address; amount: bigint; };\n\nexport type PrizesFundedEventArgs = { pool: Address; funder: Address; amount: number | bigint; };\n\n/** Gets the encoder for {@link PrizesFundedEventArgs} event data. */\nexport function getPrizesFundedEventEncoder(): FixedSizeEncoder<PrizesFundedEventArgs> {\n return getHiddenPrefixEncoder(getStructEncoder([['pool', getAddressEncoder()], ['funder', getAddressEncoder()], ['amount', getU64Encoder()]]), [getConstantEncoder(PRIZES_FUNDED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the decoder for {@link PrizesFundedEvent} event data. */\nexport function getPrizesFundedEventDecoder(): FixedSizeDecoder<PrizesFundedEvent> {\n return getHiddenPrefixDecoder(getStructDecoder([['pool', getAddressDecoder()], ['funder', getAddressDecoder()], ['amount', getU64Decoder()]]), [getConstantDecoder(PRIZES_FUNDED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the codec for {@link PrizesFundedEvent} event data. */\nexport function getPrizesFundedEventCodec(): FixedSizeCodec<PrizesFundedEventArgs, PrizesFundedEvent> {\n return combineCodec(getPrizesFundedEventEncoder(), getPrizesFundedEventDecoder());\n}\n\n/** Parses the provided bytes into {@link PrizesFundedEvent} event data. */\nexport function parsePrizesFundedEvent(data: ReadonlyUint8Array | Uint8Array): PrizesFundedEvent {\n if (containsBytes(data, PRIZES_FUNDED_EVENT_DISCRIMINATOR, 0)) { return getPrizesFundedEventDecoder().decode(data); }\n throw new Error('The provided data does not match the \"PrizesFundedEvent\" event discriminators.');\n}","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { combineCodec, containsBytes, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, getU8Decoder, getU8Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from '@solana/kit';\n\nexport const RANDOMNESS_RETRIED_EVENT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([243, 30, 148, 22, 14, 127, 52, 140]);\n\nexport function getRandomnessRetriedEventDiscriminatorBytes(): ReadonlyUint8Array { return fixEncoderSize(getBytesEncoder(), 8).encode(RANDOMNESS_RETRIED_EVENT_DISCRIMINATOR); }\n\nexport type RandomnessRetriedEvent = { pool: Address; seq: bigint; attempt: number; };\n\nexport type RandomnessRetriedEventArgs = { pool: Address; seq: number | bigint; attempt: number; };\n\n/** Gets the encoder for {@link RandomnessRetriedEventArgs} event data. */\nexport function getRandomnessRetriedEventEncoder(): FixedSizeEncoder<RandomnessRetriedEventArgs> {\n return getHiddenPrefixEncoder(getStructEncoder([['pool', getAddressEncoder()], ['seq', getU64Encoder()], ['attempt', getU8Encoder()]]), [getConstantEncoder(RANDOMNESS_RETRIED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the decoder for {@link RandomnessRetriedEvent} event data. */\nexport function getRandomnessRetriedEventDecoder(): FixedSizeDecoder<RandomnessRetriedEvent> {\n return getHiddenPrefixDecoder(getStructDecoder([['pool', getAddressDecoder()], ['seq', getU64Decoder()], ['attempt', getU8Decoder()]]), [getConstantDecoder(RANDOMNESS_RETRIED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the codec for {@link RandomnessRetriedEvent} event data. */\nexport function getRandomnessRetriedEventCodec(): FixedSizeCodec<RandomnessRetriedEventArgs, RandomnessRetriedEvent> {\n return combineCodec(getRandomnessRetriedEventEncoder(), getRandomnessRetriedEventDecoder());\n}\n\n/** Parses the provided bytes into {@link RandomnessRetriedEvent} event data. */\nexport function parseRandomnessRetriedEvent(data: ReadonlyUint8Array | Uint8Array): RandomnessRetriedEvent {\n if (containsBytes(data, RANDOMNESS_RETRIED_EVENT_DISCRIMINATOR, 0)) { return getRandomnessRetriedEventDecoder().decode(data); }\n throw new Error('The provided data does not match the \"RandomnessRetriedEvent\" event discriminators.');\n}","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { combineCodec, containsBytes, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from '@solana/kit';\n\nexport const TOKENS_SOLD_EVENT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([217, 83, 68, 137, 134, 225, 94, 45]);\n\nexport function getTokensSoldEventDiscriminatorBytes(): ReadonlyUint8Array { return fixEncoderSize(getBytesEncoder(), 8).encode(TOKENS_SOLD_EVENT_DISCRIMINATOR); }\n\nexport type TokensSoldEvent = { pool: Address; seller: Address; venue: Address; amount: bigint;\n/** SOL plus WSOL the venue paid the seller, before the protocol fee. */\nproceeds: bigint;\n/** The protocol's 1% of `proceeds`, SOL plus WSOL. */\nprotocolFee: bigint; };\n\nexport type TokensSoldEventArgs = { pool: Address; seller: Address; venue: Address; amount: number | bigint;\n/** SOL plus WSOL the venue paid the seller, before the protocol fee. */\nproceeds: number | bigint;\n/** The protocol's 1% of `proceeds`, SOL plus WSOL. */\nprotocolFee: number | bigint; };\n\n/** Gets the encoder for {@link TokensSoldEventArgs} event data. */\nexport function getTokensSoldEventEncoder(): FixedSizeEncoder<TokensSoldEventArgs> {\n return getHiddenPrefixEncoder(getStructEncoder([['pool', getAddressEncoder()], ['seller', getAddressEncoder()], ['venue', getAddressEncoder()], ['amount', getU64Encoder()], ['proceeds', getU64Encoder()], ['protocolFee', getU64Encoder()]]), [getConstantEncoder(TOKENS_SOLD_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the decoder for {@link TokensSoldEvent} event data. */\nexport function getTokensSoldEventDecoder(): FixedSizeDecoder<TokensSoldEvent> {\n return getHiddenPrefixDecoder(getStructDecoder([['pool', getAddressDecoder()], ['seller', getAddressDecoder()], ['venue', getAddressDecoder()], ['amount', getU64Decoder()], ['proceeds', getU64Decoder()], ['protocolFee', getU64Decoder()]]), [getConstantDecoder(TOKENS_SOLD_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the codec for {@link TokensSoldEvent} event data. */\nexport function getTokensSoldEventCodec(): FixedSizeCodec<TokensSoldEventArgs, TokensSoldEvent> {\n return combineCodec(getTokensSoldEventEncoder(), getTokensSoldEventDecoder());\n}\n\n/** Parses the provided bytes into {@link TokensSoldEvent} event data. */\nexport function parseTokensSoldEvent(data: ReadonlyUint8Array | Uint8Array): TokensSoldEvent {\n if (containsBytes(data, TOKENS_SOLD_EVENT_DISCRIMINATOR, 0)) { return getTokensSoldEventDecoder().decode(data); }\n throw new Error('The provided data does not match the \"TokensSoldEvent\" event discriminators.');\n}","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { isProgramError, type Address, type SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM, type SolanaError } from '@solana/kit';\nimport { GABOX_V2_PROGRAM_ADDRESS } from '../programs';\n\n/** Arithmetic: Arithmetic overflow or inconsistent accounting */\nexport const GABOX_V2_ERROR__ARITHMETIC = 0x1770; // 6000\n/** InvalidDistribution: Invalid prize distribution */\nexport const GABOX_V2_ERROR__INVALID_DISTRIBUTION = 0x1771; // 6001\n/** UnfundedExpectation: Expected token award exceeds tokens purchased */\nexport const GABOX_V2_ERROR__UNFUNDED_EXPECTATION = 0x1772; // 6002\n/** UnsupportedMint: Mint must have no mint/freeze authority and only supported extensions */\nexport const GABOX_V2_ERROR__UNSUPPORTED_MINT = 0x1773; // 6003\n/** InsolventInventory: Prize inventory does not cover reservations */\nexport const GABOX_V2_ERROR__INSOLVENT_INVENTORY = 0x1774; // 6004\n/** PrizeCapChanged: Top prize is below the signed minimum; refresh the offer */\nexport const GABOX_V2_ERROR__PRIZE_CAP_CHANGED = 0x1775; // 6005\n/** PackTooSmall: A pack pays zero tokens on some tier */\nexport const GABOX_V2_ERROR__PACK_TOO_SMALL = 0x1776; // 6006\n/** JackpotBelowOnePack: The largest tier must pay at least one pack */\nexport const GABOX_V2_ERROR__JACKPOT_BELOW_ONE_PACK = 0x1777; // 6007\n/** InvalidVenue: Incorrect trade program, account order, or token binding */\nexport const GABOX_V2_ERROR__INVALID_VENUE = 0x1778; // 6008\n/** IncorrectTokenDelta: Trade did not move the exact token amount */\nexport const GABOX_V2_ERROR__INCORRECT_TOKEN_DELTA = 0x1779; // 6009\n/** SlippageExceeded: Spend exceeds the signed limit */\nexport const GABOX_V2_ERROR__SLIPPAGE_EXCEEDED = 0x177a; // 6010\n/** NotPending: Draw is not awaiting randomness */\nexport const GABOX_V2_ERROR__NOT_PENDING = 0x177b; // 6011\n/** NotReady: Draw has not resolved */\nexport const GABOX_V2_ERROR__NOT_READY = 0x177c; // 6012\n/** RetryTooSoon: Retry interval has not elapsed */\nexport const GABOX_V2_ERROR__RETRY_TOO_SOON = 0x177d; // 6013\n/** RetryUnavailable: Retry limit reached or draw expired */\nexport const GABOX_V2_ERROR__RETRY_UNAVAILABLE = 0x177e; // 6014\n/** NotExpired: Oracle timeout has not elapsed */\nexport const GABOX_V2_ERROR__NOT_EXPIRED = 0x177f; // 6015\n/** ZeroAmount: Amount must be positive */\nexport const GABOX_V2_ERROR__ZERO_AMOUNT = 0x1780; // 6016\n/** InvalidFee: Creator fee exceeds the limit */\nexport const GABOX_V2_ERROR__INVALID_FEE = 0x1781; // 6017\n/** CoinNotCreatedHere: A pool must be created in the same transaction that creates the coin */\nexport const GABOX_V2_ERROR__COIN_NOT_CREATED_HERE = 0x1782; // 6018\n/** InvalidReferral: Referral account is missing or inconsistent */\nexport const GABOX_V2_ERROR__INVALID_REFERRAL = 0x1783; // 6019\n/** NothingOwedToReferrer: No referral revenue is owed */\nexport const GABOX_V2_ERROR__NOTHING_OWED_TO_REFERRER = 0x1784; // 6020\n/** InvalidFeeCollector: Fee account is not the protocol fee collector's */\nexport const GABOX_V2_ERROR__INVALID_FEE_COLLECTOR = 0x1785; // 6021\n\nexport type GaboxV2Error = typeof GABOX_V2_ERROR__ARITHMETIC | typeof GABOX_V2_ERROR__COIN_NOT_CREATED_HERE | typeof GABOX_V2_ERROR__INCORRECT_TOKEN_DELTA | typeof GABOX_V2_ERROR__INSOLVENT_INVENTORY | typeof GABOX_V2_ERROR__INVALID_DISTRIBUTION | typeof GABOX_V2_ERROR__INVALID_FEE | typeof GABOX_V2_ERROR__INVALID_FEE_COLLECTOR | typeof GABOX_V2_ERROR__INVALID_REFERRAL | typeof GABOX_V2_ERROR__INVALID_VENUE | typeof GABOX_V2_ERROR__JACKPOT_BELOW_ONE_PACK | typeof GABOX_V2_ERROR__NOT_EXPIRED | typeof GABOX_V2_ERROR__NOTHING_OWED_TO_REFERRER | typeof GABOX_V2_ERROR__NOT_PENDING | typeof GABOX_V2_ERROR__NOT_READY | typeof GABOX_V2_ERROR__PACK_TOO_SMALL | typeof GABOX_V2_ERROR__PRIZE_CAP_CHANGED | typeof GABOX_V2_ERROR__RETRY_TOO_SOON | typeof GABOX_V2_ERROR__RETRY_UNAVAILABLE | typeof GABOX_V2_ERROR__SLIPPAGE_EXCEEDED | typeof GABOX_V2_ERROR__UNFUNDED_EXPECTATION | typeof GABOX_V2_ERROR__UNSUPPORTED_MINT | typeof GABOX_V2_ERROR__ZERO_AMOUNT;\n\nlet gaboxV2ErrorMessages: Record<GaboxV2Error, string> | undefined;\nif (process.env['NODE_ENV'] !== 'production') {\n gaboxV2ErrorMessages = { [GABOX_V2_ERROR__ARITHMETIC]: `Arithmetic overflow or inconsistent accounting`, [GABOX_V2_ERROR__COIN_NOT_CREATED_HERE]: `A pool must be created in the same transaction that creates the coin`, [GABOX_V2_ERROR__INCORRECT_TOKEN_DELTA]: `Trade did not move the exact token amount`, [GABOX_V2_ERROR__INSOLVENT_INVENTORY]: `Prize inventory does not cover reservations`, [GABOX_V2_ERROR__INVALID_DISTRIBUTION]: `Invalid prize distribution`, [GABOX_V2_ERROR__INVALID_FEE]: `Creator fee exceeds the limit`, [GABOX_V2_ERROR__INVALID_FEE_COLLECTOR]: `Fee account is not the protocol fee collector's`, [GABOX_V2_ERROR__INVALID_REFERRAL]: `Referral account is missing or inconsistent`, [GABOX_V2_ERROR__INVALID_VENUE]: `Incorrect trade program, account order, or token binding`, [GABOX_V2_ERROR__JACKPOT_BELOW_ONE_PACK]: `The largest tier must pay at least one pack`, [GABOX_V2_ERROR__NOT_EXPIRED]: `Oracle timeout has not elapsed`, [GABOX_V2_ERROR__NOTHING_OWED_TO_REFERRER]: `No referral revenue is owed`, [GABOX_V2_ERROR__NOT_PENDING]: `Draw is not awaiting randomness`, [GABOX_V2_ERROR__NOT_READY]: `Draw has not resolved`, [GABOX_V2_ERROR__PACK_TOO_SMALL]: `A pack pays zero tokens on some tier`, [GABOX_V2_ERROR__PRIZE_CAP_CHANGED]: `Top prize is below the signed minimum; refresh the offer`, [GABOX_V2_ERROR__RETRY_TOO_SOON]: `Retry interval has not elapsed`, [GABOX_V2_ERROR__RETRY_UNAVAILABLE]: `Retry limit reached or draw expired`, [GABOX_V2_ERROR__SLIPPAGE_EXCEEDED]: `Spend exceeds the signed limit`, [GABOX_V2_ERROR__UNFUNDED_EXPECTATION]: `Expected token award exceeds tokens purchased`, [GABOX_V2_ERROR__UNSUPPORTED_MINT]: `Mint must have no mint/freeze authority and only supported extensions`, [GABOX_V2_ERROR__ZERO_AMOUNT]: `Amount must be positive` };\n}\n\nexport function getGaboxV2ErrorMessage(code: GaboxV2Error): string {\n if (process.env['NODE_ENV'] !== 'production') {\n return (gaboxV2ErrorMessages as Record<GaboxV2Error, string>)[code];\n }\n\n return 'Error message not available in production bundles.';\n}\n\nexport function isGaboxV2Error<TProgramErrorCode extends GaboxV2Error>(\n error: unknown,\n transactionMessage: { instructions: Record<number, { programAddress: Address }> },\n code?: TProgramErrorCode,\n): error is SolanaError<typeof SOLANA_ERROR__INSTRUCTION_ERROR__CUSTOM> & Readonly<{ context: Readonly<{ code: TProgramErrorCode }> }> {\n return isProgramError<TProgramErrorCode>(error, transactionMessage, GABOX_V2_PROGRAM_ADDRESS, code);\n}","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { combineCodec, containsBytes, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getStructDecoder, getStructEncoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from '@solana/kit';\n\nexport const REFERRAL_BOUND_EVENT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([12, 28, 152, 148, 55, 210, 102, 190]);\n\nexport function getReferralBoundEventDiscriminatorBytes(): ReadonlyUint8Array { return fixEncoderSize(getBytesEncoder(), 8).encode(REFERRAL_BOUND_EVENT_DISCRIMINATOR); }\n\nexport type ReferralBoundEvent = { referee: Address; referrer: Address; };\n\nexport type ReferralBoundEventArgs = ReferralBoundEvent;\n\n/** Gets the encoder for {@link ReferralBoundEventArgs} event data. */\nexport function getReferralBoundEventEncoder(): FixedSizeEncoder<ReferralBoundEventArgs> {\n return getHiddenPrefixEncoder(getStructEncoder([['referee', getAddressEncoder()], ['referrer', getAddressEncoder()]]), [getConstantEncoder(REFERRAL_BOUND_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the decoder for {@link ReferralBoundEvent} event data. */\nexport function getReferralBoundEventDecoder(): FixedSizeDecoder<ReferralBoundEvent> {\n return getHiddenPrefixDecoder(getStructDecoder([['referee', getAddressDecoder()], ['referrer', getAddressDecoder()]]), [getConstantDecoder(REFERRAL_BOUND_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the codec for {@link ReferralBoundEvent} event data. */\nexport function getReferralBoundEventCodec(): FixedSizeCodec<ReferralBoundEventArgs, ReferralBoundEvent> {\n return combineCodec(getReferralBoundEventEncoder(), getReferralBoundEventDecoder());\n}\n\n/** Parses the provided bytes into {@link ReferralBoundEvent} event data. */\nexport function parseReferralBoundEvent(data: ReadonlyUint8Array | Uint8Array): ReferralBoundEvent {\n if (containsBytes(data, REFERRAL_BOUND_EVENT_DISCRIMINATOR, 0)) { return getReferralBoundEventDecoder().decode(data); }\n throw new Error('The provided data does not match the \"ReferralBoundEvent\" event discriminators.');\n}","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nimport { combineCodec, containsBytes, fixEncoderSize, getAddressDecoder, getAddressEncoder, getBytesEncoder, getConstantDecoder, getConstantEncoder, getHiddenPrefixDecoder, getHiddenPrefixEncoder, getStructDecoder, getStructEncoder, getU64Decoder, getU64Encoder, type Address, type FixedSizeCodec, type FixedSizeDecoder, type FixedSizeEncoder, type ReadonlyUint8Array } from '@solana/kit';\n\nexport const REFERRAL_CLAIMED_EVENT_DISCRIMINATOR: ReadonlyUint8Array = new Uint8Array([195, 109, 77, 196, 134, 226, 78, 108]);\n\nexport function getReferralClaimedEventDiscriminatorBytes(): ReadonlyUint8Array { return fixEncoderSize(getBytesEncoder(), 8).encode(REFERRAL_CLAIMED_EVENT_DISCRIMINATOR); }\n\nexport type ReferralClaimedEvent = { pool: Address; referrer: Address; amount: bigint; };\n\nexport type ReferralClaimedEventArgs = { pool: Address; referrer: Address; amount: number | bigint; };\n\n/** Gets the encoder for {@link ReferralClaimedEventArgs} event data. */\nexport function getReferralClaimedEventEncoder(): FixedSizeEncoder<ReferralClaimedEventArgs> {\n return getHiddenPrefixEncoder(getStructEncoder([['pool', getAddressEncoder()], ['referrer', getAddressEncoder()], ['amount', getU64Encoder()]]), [getConstantEncoder(REFERRAL_CLAIMED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the decoder for {@link ReferralClaimedEvent} event data. */\nexport function getReferralClaimedEventDecoder(): FixedSizeDecoder<ReferralClaimedEvent> {\n return getHiddenPrefixDecoder(getStructDecoder([['pool', getAddressDecoder()], ['referrer', getAddressDecoder()], ['amount', getU64Decoder()]]), [getConstantDecoder(REFERRAL_CLAIMED_EVENT_DISCRIMINATOR)]);\n}\n\n/** Gets the codec for {@link ReferralClaimedEvent} event data. */\nexport function getReferralClaimedEventCodec(): FixedSizeCodec<ReferralClaimedEventArgs, ReferralClaimedEvent> {\n return combineCodec(getReferralClaimedEventEncoder(), getReferralClaimedEventDecoder());\n}\n\n/** Parses the provided bytes into {@link ReferralClaimedEvent} event data. */\nexport function parseReferralClaimedEvent(data: ReadonlyUint8Array | Uint8Array): ReferralClaimedEvent {\n if (containsBytes(data, REFERRAL_CLAIMED_EVENT_DISCRIMINATOR, 0)) { return getReferralClaimedEventDecoder().decode(data); }\n throw new Error('The provided data does not match the \"ReferralClaimedEvent\" event discriminators.');\n}","/**\n * This code was AUTOGENERATED using the Codama library.\n * Please DO NOT EDIT THIS FILE, instead use visitors\n * to add features, then rerun Codama to update it.\n *\n * @see https://github.com/codama-idl/codama\n */\n\nexport * from './accounts';\nexport * from './errors';\nexport * from './events';\nexport * from './instructions';\nexport * from './pdas';\nexport * from './programs';\nexport * from './types';"],"mappings":";;;;;;;;;;;AAUA,MAAa,oCAAwD,IAAI,WAAW;CAAC;CAAK;CAAK;CAAI;CAAK;CAAK;CAAI;CAAK;AAAG,CAAC;AAE1H,SAAgB,yCAA6D;CAAE,OAAO,eAAe,gBAAgB,GAAG,CAAC,CAAC,CAAC,OAAO,iCAAiC;AAAG;;AAOtK,SAAgB,8BAAuE;CACnF,OAAO,uBAAuB,iBAAiB;EAAC,CAAC,QAAQ,kBAAkB,CAAC;EAAG,CAAC,OAAO,cAAc,CAAC;EAAG,CAAC,aAAa,kBAAkB,CAAC;EAAG,CAAC,UAAU,cAAc,CAAC;EAAG,CAAC,cAAc,eAAe,gBAAgB,GAAG,EAAE,CAAC;EAAG,CAAC,YAAY,kBAAkB,CAAC;CAAC,CAAC,GAAG,CAAC,mBAAmB,iCAAiC,CAAC,CAAC;AACjU;;AAGA,SAAgB,8BAAmE;CAC/E,OAAO,uBAAuB,iBAAiB;EAAC,CAAC,QAAQ,kBAAkB,CAAC;EAAG,CAAC,OAAO,cAAc,CAAC;EAAG,CAAC,aAAa,kBAAkB,CAAC;EAAG,CAAC,UAAU,cAAc,CAAC;EAAG,CAAC,cAAc,eAAe,gBAAgB,GAAG,EAAE,CAAC;EAAG,CAAC,YAAY,kBAAkB,CAAC;CAAC,CAAC,GAAG,CAAC,mBAAmB,iCAAiC,CAAC,CAAC;AACjU;;AAGA,SAAgB,4BAAsF;CAClG,OAAO,aAAa,4BAA4B,GAAG,4BAA4B,CAAC;AACpF;;AAGA,SAAgB,uBAAuB,MAA0D;CAC7F,IAAI,cAAc,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AAkB,CAAC;EAAG,CAAC,YAAY,kBAAkB,CAAC;EAAG,CAAC,UAAU,cAAc,CAAC;CAAC,CAAC,GAAG,CAAC,mBAAmB,oCAAoC,CAAC,CAAC;AAC/M;;AAGA,SAAgB,iCAAyE;CACrF,OAAO,uBAAuB,iBAAiB;EAAC,CAAC,QAAQ,kBAAkB,CAAC;EAAG,CAAC,YAAY,kBAAkB,CAAC;EAAG,CAAC,UAAU,cAAc,CAAC;CAAC,CAAC,GAAG,CAAC,mBAAmB,oCAAoC,CAAC,CAAC;AAC/M;;AAGA,SAAgB,+BAA+F;CAC3G,OAAO,aAAa,+BAA+B,GAAG,+BAA+B,CAAC;AAC1F;;AAGA,SAAgB,0BAA0B,MAA6D;CACnG,IAAI,cAAc,MAAM,sCAAsC,CAAC,GAAK,OAAO,+BAA+B,CAAC,CAAC,OAAO,IAAI;CACvH,MAAM,IAAI,MAAM,qFAAmF;AACvG"}
@@ -0,0 +1,471 @@
1
+ import { AccountMeta, Address, AddressesByLookupTableAddress, Instruction, Rpc, RpcSubscriptions, SolanaRpcApi, SolanaRpcSubscriptionsApi, TransactionSigner } from "@solana/kit";
2
+ //#region src/rpc.d.ts
3
+ type Cluster = 'devnet' | 'mainnet-beta' | 'localnet';
4
+ /** Solana's public endpoints, and the test validator's default ports. */
5
+ declare const CLUSTER_ENDPOINTS: Readonly<Record<Cluster, {
6
+ url: string;
7
+ wsUrl: string;
8
+ }>>;
9
+ declare const DEVNET_HTTP: string;
10
+ declare const DEVNET_WS: string;
11
+ type GaboxRpc = Rpc<SolanaRpcApi>;
12
+ type GaboxRpcSubscriptions = RpcSubscriptions<SolanaRpcSubscriptionsApi>;
13
+ type ClientConfig = {
14
+ /** The cluster this client talks to. Required: see the file comment. */
15
+ cluster: Cluster;
16
+ /** HTTP endpoint. Defaults to the cluster's entry in `CLUSTER_ENDPOINTS`. */
17
+ url?: string;
18
+ /**
19
+ * WebSocket endpoint. Left out, it follows `url`: `https` becomes `wss`, `http` becomes `ws`.
20
+ * When `url` is left out too, it is the cluster's default.
21
+ */
22
+ wsUrl?: string;
23
+ /**
24
+ * Address lookup tables every builder compresses with. Defaults to the cluster's shared table,
25
+ * which only devnet has today; other clusters default to none. Pass `{}` to disable compression.
26
+ */
27
+ addressLookupTables?: AddressesByLookupTableAddress;
28
+ };
29
+ /**
30
+ * Everything the SDK needs to talk to one cluster. Pass it to every chain-touching function.
31
+ *
32
+ * A plain object, so a caller who needs a custom transport can spread it:
33
+ * `{ ...createClient({ cluster }), rpc: createSolanaRpcFromTransport(transport) }`.
34
+ */
35
+ type GaboxClient = Readonly<{
36
+ cluster: Cluster;
37
+ url: string;
38
+ wsUrl: string;
39
+ rpc: GaboxRpc;
40
+ rpcSubscriptions: GaboxRpcSubscriptions;
41
+ addressLookupTables: AddressesByLookupTableAddress;
42
+ }>;
43
+ /**
44
+ * The cluster a URL names, from its text alone. A substring check, deliberately: providers spell
45
+ * it many ways. `null` when the URL names none, which is a local validator or a private endpoint.
46
+ */
47
+ declare function clusterNamedBy(url: string): Cluster | 'testnet' | null;
48
+ /**
49
+ * Refuse a URL that contradicts the declared cluster. Exported so a script can check a URL before
50
+ * it does anything else with it. The rules are in the file comment.
51
+ */
52
+ declare function assertClusterUrl(cluster: Cluster, url: string): void;
53
+ /** `https://x` becomes `wss://x`, `http://x` becomes `ws://x`. Anything else is returned as is. */
54
+ declare function websocketUrlFor(url: string): string;
55
+ /**
56
+ * The SDK's init step. Call it once and pass the result everywhere.
57
+ *
58
+ * Both RPC clients are created together because everything in this SDK that watches a draw needs
59
+ * the pair: the subscription reports the change, and the RPC reads the account that changed.
60
+ */
61
+ declare function createClient(config: ClientConfig): GaboxClient;
62
+ //#endregion
63
+ //#region src/pump/abi.d.ts
64
+ /**
65
+ * Program addresses, taken from the two IDLs rather than typed here. `fee_program` and
66
+ * `mayhem_program_id` are `address` constraints on accounts, so the IDL states them exactly.
67
+ */
68
+ declare const PUMP_PROGRAM_ADDRESS: Address;
69
+ declare const PUMP_SWAP_PROGRAM_ADDRESS: Address;
70
+ declare const PUMP_FEE_PROGRAM_ADDRESS: Address;
71
+ declare const MAYHEM_PROGRAM_ADDRESS: Address;
72
+ /** Pump `create_v2` always mints Token-2022. The IDL pins the program on the account. */
73
+ declare const PUMP_CREATE_TOKEN_PROGRAM_ADDRESS: Address;
74
+ declare const ASSOCIATED_TOKEN_PROGRAM_ADDRESS: Address;
75
+ declare const SYSTEM_PROGRAM_ADDRESS: Address;
76
+ /** One account slot: its IDL name and the privileges the venue's own ABI gives it. */
77
+ type VenueAccountSpec = {
78
+ readonly name: string;
79
+ readonly writable: boolean;
80
+ readonly signer: boolean;
81
+ };
82
+ type VenueInstructionAbi = {
83
+ readonly name: string;
84
+ readonly discriminator: Uint8Array;
85
+ readonly accounts: readonly VenueAccountSpec[];
86
+ };
87
+ /** `create_v2` on `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` — not in interfaces.json (create only, the program reads two slots of it). */
88
+ declare const PUMP_CREATE_V2: VenueInstructionAbi;
89
+ /** `buy_v2` on `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` — cross-checked against interfaces.json. */
90
+ declare const PUMP_BUY: VenueInstructionAbi;
91
+ /** `sell_v2` on `6EF8rrecthR5Dkzon8Nwu78hRvfCKubJ14M5uBEwF6P` — cross-checked against interfaces.json. */
92
+ declare const PUMP_SELL: VenueInstructionAbi;
93
+ /** `buy` on `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` — cross-checked against interfaces.json. */
94
+ declare const SWAP_BUY: VenueInstructionAbi;
95
+ /** `sell` on `pAMMBay6oceH9fJKBRHGP5D4bD4sWpmSwMn52FMfXEA` — cross-checked against interfaces.json. */
96
+ declare const SWAP_SELL: VenueInstructionAbi;
97
+ //#endregion
98
+ //#region src/pump/venue.d.ts
99
+ type VenueKind = 'pump' | 'pumpswap';
100
+ /** Everything `resolveVenue` learned, plus the pure functions that follow from it. */
101
+ type ResolvedVenue = {
102
+ kind: VenueKind;
103
+ /** The program to pass as `venue`. */
104
+ program: Address;
105
+ mint: Address;
106
+ /** The base mint's own token program. Token-2022 for a Pump `create_v2` coin. */
107
+ tokenProgram: Address;
108
+ /** `true` once the coin has graduated off the curve. */
109
+ complete: boolean;
110
+ /** The coin's creator, from the bonding curve. The venue pays it a share of each trade. */
111
+ creator: Address;
112
+ /** The ordered account list for an exact-tokens-out buy, in `remainingAccounts` order. */
113
+ buyAccounts: AccountMeta[];
114
+ /** The ordered account list for a sale. */
115
+ sellAccounts: AccountMeta[];
116
+ /** Lamports (or WSOL, on PumpSwap) an exact-tokens-out buy of `tokens` costs right now, fees included. */
117
+ quoteBuy(tokens: bigint): bigint;
118
+ /** Lamports (or WSOL, on PumpSwap) a sale of `tokens` returns right now, net of fees. */
119
+ quoteSell(tokens: bigint): bigint;
120
+ };
121
+ type ResolveVenueOptions = {
122
+ mint: Address;
123
+ /** The wallet that will sign the trade. Its ATAs appear in the account list. */
124
+ user: Address;
125
+ /** Force a venue instead of reading the `complete` flag. */
126
+ venue?: VenueKind;
127
+ /**
128
+ * Which fee recipient to use, as an index into the on-chain list. Left out, one is picked at
129
+ * random, which is what Pump's own client does to spread load. Pass an index for a reproducible
130
+ * account list.
131
+ */
132
+ feeRecipientIndex?: number;
133
+ /** Same, for Pump's separate buyback recipient list. */
134
+ buybackRecipientIndex?: number;
135
+ };
136
+ /**
137
+ * The `amount` field of an SPL or Token-2022 token account: bytes 64..72, little-endian.
138
+ *
139
+ * Both layouts share their first 165 bytes, so one reader covers both. Token-2022 extensions live
140
+ * past that and do not move this field.
141
+ */
142
+ declare function tokenAccountAmount(data: Uint8Array): bigint;
143
+ declare function resolveVenue(client: GaboxClient, options: ResolveVenueOptions): Promise<ResolvedVenue>;
144
+ /**
145
+ * Lamports an exact-tokens-out buy of `tokens` costs right now, on whichever venue the coin trades.
146
+ * Pass `pool.packTokens` for the pack price.
147
+ *
148
+ * One read and one number. Use `resolveVenue` when you also need the account list, which every
149
+ * transaction builder does — this is for a price display.
150
+ */
151
+ declare function curveQuote(client: GaboxClient, mint: Address, tokens: bigint, options?: {
152
+ user?: Address;
153
+ venue?: VenueKind;
154
+ }): Promise<bigint>;
155
+ /**
156
+ * Lamports an exact-tokens-out buy of `tokens` would cost on a curve that does not exist yet,
157
+ * fees included. This is what the seed costs: `initialize_pool` buys it in the same transaction
158
+ * that creates the coin, so the curve is Pump's default new curve at that moment.
159
+ */
160
+ declare function newCurveBuyCost(client: GaboxClient, tokens: bigint): Promise<bigint>;
161
+ /** Lamports a sale of `tokens` returns right now, net of the venue's fees. */
162
+ declare function sellQuote(client: GaboxClient, mint: Address, tokens: bigint, options?: {
163
+ user?: Address;
164
+ venue?: VenueKind;
165
+ }): Promise<bigint>;
166
+ /**
167
+ * The user's WSOL associated token account. PumpSwap spends WSOL rather than native SOL, so this
168
+ * account must exist and hold enough before a pack is bought on a graduated coin.
169
+ */
170
+ declare function wsolAccountFor(user: Address): Address;
171
+ //#endregion
172
+ //#region src/pump/accounts.d.ts
173
+ type PumpCreateAccountsInput = {
174
+ mint: Address;
175
+ /** The wallet paying and signing. `initialize_pool` requires this to be the pool creator. */
176
+ user: Address;
177
+ /** Token-2022. `create_v2` pins it in the IDL, so there is nothing else it can be. */
178
+ tokenProgram: Address;
179
+ };
180
+ /**
181
+ * `create_v2` on Pump. The mint is a fresh keypair and signs; the user pays.
182
+ *
183
+ * The four mayhem accounts are always present even with mayhem mode off. `create_v2` takes them
184
+ * unconditionally, so a client cannot skip them.
185
+ */
186
+ declare function pumpCreateV2Accounts(input: PumpCreateAccountsInput): AccountMeta[];
187
+ type PumpTradeAccountsInput = {
188
+ mint: Address;
189
+ /** The purchaser or seller. The one signing slot in the list. */
190
+ user: Address;
191
+ /** The base mint's own program. Token-2022 for every Pump `create_v2` coin. */
192
+ tokenProgram: Address;
193
+ /** `bondingCurve.creator`. The creator vault is derived from it. */
194
+ creator: Address;
195
+ /** One of `global.feeRecipients`, chosen by the caller. */
196
+ feeRecipient: Address;
197
+ /** One of `global.buybackFeeRecipients`, chosen by the caller. */
198
+ buybackFeeRecipient: Address;
199
+ /** Defaults to WSOL, the only quote `market.rs` accepts. */
200
+ quoteMint?: Address;
201
+ /** Defaults to classic SPL Token, because the quote is WSOL. */
202
+ quoteTokenProgram?: Address;
203
+ };
204
+ /** `buy_v2`. The first argument is tokens to receive; the second is the most SOL to pay. */
205
+ declare const pumpBuyAccounts: (input: PumpTradeAccountsInput) => AccountMeta[];
206
+ /** `sell_v2`. One account shorter than the buy: it has no `global_volume_accumulator`. */
207
+ declare const pumpSellAccounts: (input: PumpTradeAccountsInput) => AccountMeta[];
208
+ type SwapTradeAccountsInput = {
209
+ /** The AMM pool. Use the canonical one for a graduated Pump coin. */
210
+ pool: Address;
211
+ mint: Address;
212
+ user: Address;
213
+ tokenProgram: Address;
214
+ /** `pool.poolBaseTokenAccount`, read off the pool account. */
215
+ poolBaseTokenAccount: Address;
216
+ /** `pool.poolQuoteTokenAccount`, read off the pool account. */
217
+ poolQuoteTokenAccount: Address;
218
+ /** `pool.coinCreator`. The creator vault authority is derived from it. */
219
+ coinCreator: Address;
220
+ /** One of `globalConfig.protocolFeeRecipients`, chosen by the caller. */
221
+ protocolFeeRecipient: Address;
222
+ quoteMint?: Address;
223
+ quoteTokenProgram?: Address;
224
+ };
225
+ /** `buy` on PumpSwap. The spend is WSOL, so fund the user's WSOL ATA with `max_quote_in` first. */
226
+ declare const swapBuyAccounts: (input: SwapTradeAccountsInput) => AccountMeta[];
227
+ /** `sell` on PumpSwap. Proceeds land in the user's WSOL ATA; unwrap separately if wanted. */
228
+ declare const swapSellAccounts: (input: SwapTradeAccountsInput) => AccountMeta[];
229
+ /**
230
+ * PumpSwap's optional cashback account, appended after the ABI list.
231
+ *
232
+ * `market.rs` allows exactly one extra account past the end of a PumpSwap list, and checks it is
233
+ * this address and that it is writable. It is the WSOL ATA of the user's own volume accumulator.
234
+ * Append it only when the coin is a cashback coin; otherwise leave the list at its ABI length.
235
+ */
236
+ declare function swapCashbackAccount(user: Address): AccountMeta;
237
+ //#endregion
238
+ //#region src/pump/create.d.ts
239
+ type PumpCreateV2Input = {
240
+ /** The coin's mint. A brand-new keypair, and it signs. */
241
+ mint: TransactionSigner;
242
+ /** The wallet paying. `initialize_pool` requires this to be the same wallet as its creator. */
243
+ user: TransactionSigner;
244
+ name: string;
245
+ symbol: string;
246
+ /** The metadata URI. Pump stores it on the mint's Token-2022 metadata extension. */
247
+ uri: string;
248
+ /**
249
+ * The address Pump records as the coin's creator and pays creator fees to. Defaults to `user`.
250
+ * It does not have to be the payer, and gabox does not read it.
251
+ */
252
+ creator?: Address;
253
+ /** Mayhem mode. Off for every gabox machine — the coin must behave like an ordinary Pump coin. */
254
+ mayhemMode?: boolean;
255
+ /** Cashback. Off, for the same reason. A cashback coin adds an account PumpSwap buys must carry. */
256
+ cashback?: boolean;
257
+ };
258
+ /**
259
+ * `create_v2`. Put it **before** `initialize_pool` in the transaction.
260
+ *
261
+ * `market::require_created_here` reads the Instructions sysvar and looks for this instruction by
262
+ * discriminator, checking that account 0 is the mint and that account 5 — the `user` slot — is the
263
+ * gabox creator and signs. The order matters for a second reason too: the mint account has to exist
264
+ * and deserialize before `initialize_pool`'s own account validation runs.
265
+ */
266
+ declare function getPumpCreateV2Instruction(input: PumpCreateV2Input): Instruction;
267
+ //#endregion
268
+ //#region src/pump/trade.d.ts
269
+ type VenueBuyInput = {
270
+ /** The venue `resolveVenue` returned. Its `buyAccounts` list is used unchanged. */
271
+ venue: ResolvedVenue;
272
+ /** The wallet spending. Must be the `user` slot of `venue.buyAccounts`, and it signs. */
273
+ user: TransactionSigner;
274
+ /** Exact tokens to receive. The venue decides what that costs. */
275
+ tokens: bigint;
276
+ /** The buyer's slippage cap on that cost, in lamports (or WSOL, on PumpSwap). */
277
+ maxQuoteIn: bigint;
278
+ };
279
+ /**
280
+ * Buy tokens at the venue, as a standalone instruction.
281
+ *
282
+ * The signer is attached to the one slot the ABI marks as a signer, and only when its address
283
+ * matches — the same rule `create.ts` follows. Passing a `user` that is not in the account list is
284
+ * a mistake this catches here rather than on chain.
285
+ */
286
+ declare function venueBuyInstruction(input: VenueBuyInput): Instruction;
287
+ type VenueSellInput = {
288
+ /** The venue `resolveVenue` returned. Its `sellAccounts` list is used unchanged. */
289
+ venue: ResolvedVenue;
290
+ /** The wallet whose token ATA is being sold. */
291
+ user: TransactionSigner;
292
+ /** Exact base-token amount to sell. */
293
+ amount: bigint;
294
+ /** Floor on the venue's net SOL or WSOL output. */
295
+ minQuoteOutput: bigint;
296
+ };
297
+ /** Sell tokens the wallet already holds, as a standalone venue instruction. */
298
+ declare function venueSellInstruction(input: VenueSellInput): Instruction;
299
+ //#endregion
300
+ //#region src/pump/adapter.d.ts
301
+ declare const RAW: unique symbol;
302
+ /**
303
+ * A decoded value from one of Pump's packages, carried opaquely.
304
+ *
305
+ * The quote functions need the package's own object back — it holds `PublicKey`s and `BN`s the fee
306
+ * math reads. Typing it as the real thing would name web3.js in this SDK's public surface. So it
307
+ * goes out branded and comes back branded, and only this file ever looks inside.
308
+ */
309
+ type PumpRaw<K extends string> = {
310
+ readonly [RAW]: K;
311
+ };
312
+ type PumpRawGlobal = PumpRaw<'pumpGlobal'>;
313
+ type PumpRawBondingCurve = PumpRaw<'pumpBondingCurve'>;
314
+ type PumpRawFeeConfig = PumpRaw<'pumpFeeConfig'>;
315
+ type AmmRawPool = PumpRaw<'ammPool'>;
316
+ type AmmRawGlobalConfig = PumpRaw<'ammGlobalConfig'>;
317
+ type AmmRawFeeConfig = PumpRaw<'ammFeeConfig'>;
318
+ /** `["global"]` under Pump. Holds the fee recipient lists and the curve's initial reserves. */
319
+ declare const PUMP_GLOBAL: Address;
320
+ declare const PUMP_EVENT_AUTHORITY: Address;
321
+ /** `["fee_config", pump_program_id]` under the Pump fee program. */
322
+ declare const PUMP_FEE_CONFIG: Address;
323
+ declare const PUMP_GLOBAL_VOLUME_ACCUMULATOR: Address;
324
+ /**
325
+ * Mayhem mode is off for every gabox coin, but `create_v2` still takes all four accounts.
326
+ *
327
+ * The four mayhem accounts are derived under the **mayhem** program
328
+ * (`MAyhSmzXzV1pTf7LsNkrNwkWKTo4ougAJ1PPg47MD4e`), not under Pump. Pump's IDL states the seeds but
329
+ * omits the program on `global_params`, `sol_vault` and `mayhem_state`, so read literally it would
330
+ * put all three under Pump and every `create_v2` would fail. `@pump-fun/pump-sdk`'s own
331
+ * `createV2Instruction` derives them under the mayhem program, and that is what these follow.
332
+ * Confirmed by a successful seeded machine creation on devnet on 2026-09-10.
333
+ */
334
+ declare const MAYHEM_GLOBAL_PARAMS: Address;
335
+ declare const MAYHEM_SOL_VAULT: Address;
336
+ declare const pumpBondingCurve: (mint: Address) => Address;
337
+ declare const pumpCreatorVault: (creator: Address) => Address;
338
+ declare const pumpSharingConfig: (mint: Address) => Address;
339
+ declare const pumpUserVolumeAccumulator: (user: Address) => Address;
340
+ declare const pumpMayhemState: (mint: Address) => Address;
341
+ declare const pumpMayhemTokenVault: (mint: Address) => Address;
342
+ /**
343
+ * `["mint-authority"]` under Pump.
344
+ *
345
+ * The one address here that comes from the IDL rather than the package: `pda.ts` has no helper for
346
+ * it. The seed is in `create_v2`'s own `pda` metadata, so it is not a guess.
347
+ */
348
+ declare const PUMP_MINT_AUTHORITY: Address;
349
+ declare const AMM_GLOBAL_CONFIG: Address;
350
+ declare const AMM_EVENT_AUTHORITY: Address;
351
+ declare const AMM_FEE_CONFIG: Address;
352
+ declare const AMM_GLOBAL_VOLUME_ACCUMULATOR: Address;
353
+ /**
354
+ * The canonical PumpSwap pool for a graduated Pump coin: index 0, owned by the coin's
355
+ * `["pool-authority", mint]` PDA, quoted in WSOL. A coin can have other pools; the program lets the
356
+ * user sign whichever pool they pass, and a client should pick this one.
357
+ */
358
+ declare const ammCanonicalPool: (mint: Address) => Address;
359
+ declare const ammUserVolumeAccumulator: (user: Address) => Address;
360
+ declare const ammCoinCreatorVaultAuthority: (coinCreator: Address) => Address;
361
+ declare const ammCoinCreatorVaultAta: (vaultAuthority: Address, quoteMint: Address, quoteTokenProgram: Address) => Address;
362
+ /** An ATA, off-curve owners allowed. Pool PDAs and vault authorities are all off-curve. */
363
+ declare const ata: (owner: Address, mint: Address, tokenProgram: Address) => Address;
364
+ /** Pump's `Global`, with the two fee-recipient lists a buy needs. Amounts stay `BN` internally. */
365
+ type PumpGlobalState = {
366
+ feeRecipient: Address;
367
+ feeRecipients: Address[];
368
+ buybackFeeRecipients: Address[];
369
+ reservedFeeRecipient: Address;
370
+ reservedFeeRecipients: Address[];
371
+ createV2Enabled: boolean;
372
+ mayhemModeEnabled: boolean;
373
+ isCashbackEnabled: boolean;
374
+ feeBasisPoints: bigint;
375
+ creatorFeeBasisPoints: bigint;
376
+ tokenTotalSupply: bigint;
377
+ initialVirtualTokenReserves: bigint;
378
+ initialVirtualSolReserves: bigint;
379
+ initialRealTokenReserves: bigint;
380
+ /** Opaque. Hand it back to the quote functions; there is nothing to read here. */
381
+ raw: PumpRawGlobal;
382
+ };
383
+ declare function decodePumpGlobal(data: Uint8Array): PumpGlobalState;
384
+ type PumpBondingCurveState = {
385
+ virtualTokenReserves: bigint;
386
+ virtualQuoteReserves: bigint;
387
+ realTokenReserves: bigint;
388
+ realQuoteReserves: bigint;
389
+ tokenTotalSupply: bigint;
390
+ /** `true` once the coin has graduated. Then trade on PumpSwap, not the curve. */
391
+ complete: boolean;
392
+ creator: Address;
393
+ isMayhemMode: boolean;
394
+ isCashbackCoin: boolean;
395
+ quoteMint: Address;
396
+ /** Opaque. Hand it back to the quote functions. */
397
+ raw: PumpRawBondingCurve;
398
+ };
399
+ declare function decodeBondingCurve(data: Uint8Array): PumpBondingCurveState;
400
+ declare function decodePumpFeeConfig(data: Uint8Array): PumpRawFeeConfig;
401
+ type AmmPoolState = {
402
+ index: number;
403
+ creator: Address;
404
+ baseMint: Address;
405
+ quoteMint: Address;
406
+ poolBaseTokenAccount: Address;
407
+ poolQuoteTokenAccount: Address;
408
+ coinCreator: Address;
409
+ virtualQuoteReserves: bigint;
410
+ /** Opaque. Hand it back to the quote functions. */
411
+ raw: AmmRawPool;
412
+ };
413
+ declare function decodeAmmPool(data: Uint8Array): AmmPoolState;
414
+ type AmmGlobalConfigState = {
415
+ protocolFeeRecipients: Address[];
416
+ /** Opaque. Hand it back to the quote functions. */
417
+ raw: AmmRawGlobalConfig;
418
+ };
419
+ declare function decodeAmmGlobalConfig(data: Uint8Array): AmmGlobalConfigState;
420
+ declare function decodeAmmFeeConfig(data: Uint8Array): AmmRawFeeConfig;
421
+ /** Total supply of an SPL or Token-2022 mint. The AMM fee tiers are a function of it. */
422
+ declare function decodeMintSupply(data: Uint8Array, mint: Address, owner: Address): bigint;
423
+ /**
424
+ * Lamports an exact-tokens-out buy of `tokens` costs on the Pump curve, fees included.
425
+ *
426
+ * This is the same function the Pump front end uses. The result is the whole debit — the curve's
427
+ * price plus the venue's protocol and creator fees — which is what `buy_v2`'s `max_sol_cost` has
428
+ * to cover, and what `buy_pack`'s `max_quote_in` caps.
429
+ */
430
+ declare function curveBuyCost({ global, bondingCurve, feeConfig, mintSupply, tokens, quoteMint }: {
431
+ global: PumpGlobalState;
432
+ bondingCurve: PumpBondingCurveState | null;
433
+ feeConfig: PumpRawFeeConfig | null;
434
+ mintSupply: bigint | null;
435
+ tokens: bigint;
436
+ quoteMint: Address;
437
+ }): bigint;
438
+ /** Lamports a curve sale of `tokens` returns, net of fees. */
439
+ declare function curveSellQuote({ global, bondingCurve, feeConfig, mintSupply, tokens }: {
440
+ global: PumpGlobalState;
441
+ bondingCurve: PumpBondingCurveState;
442
+ feeConfig: PumpRawFeeConfig | null;
443
+ mintSupply: bigint;
444
+ tokens: bigint;
445
+ }): bigint;
446
+ /** WSOL a PumpSwap exact-base-out buy of `tokens` costs, LP and protocol fees included. */
447
+ declare function ammBuyCost({ pool, globalConfig, feeConfig, baseReserve, quoteReserve, baseMintSupply, tokens }: {
448
+ pool: AmmPoolState;
449
+ globalConfig: AmmGlobalConfigState;
450
+ feeConfig: AmmRawFeeConfig | null;
451
+ baseReserve: bigint;
452
+ quoteReserve: bigint;
453
+ baseMintSupply: bigint;
454
+ tokens: bigint;
455
+ }): bigint;
456
+ /** WSOL a PumpSwap sale of `tokens` returns, net of fees. */
457
+ declare function ammSellQuote({ pool, globalConfig, feeConfig, baseReserve, quoteReserve, baseMintSupply, tokens }: {
458
+ pool: AmmPoolState;
459
+ globalConfig: AmmGlobalConfigState;
460
+ feeConfig: AmmRawFeeConfig | null;
461
+ baseReserve: bigint;
462
+ quoteReserve: bigint;
463
+ baseMintSupply: bigint;
464
+ tokens: bigint;
465
+ }): bigint;
466
+ declare namespace index_d_exports {
467
+ export { AMM_EVENT_AUTHORITY, AMM_FEE_CONFIG, AMM_GLOBAL_CONFIG, AMM_GLOBAL_VOLUME_ACCUMULATOR, ASSOCIATED_TOKEN_PROGRAM_ADDRESS, AmmGlobalConfigState, AmmPoolState, AmmRawFeeConfig, AmmRawGlobalConfig, AmmRawPool, MAYHEM_GLOBAL_PARAMS, MAYHEM_PROGRAM_ADDRESS, MAYHEM_SOL_VAULT, PUMP_BUY, PUMP_CREATE_TOKEN_PROGRAM_ADDRESS, PUMP_CREATE_V2, PUMP_EVENT_AUTHORITY, PUMP_FEE_CONFIG, PUMP_FEE_PROGRAM_ADDRESS, PUMP_GLOBAL, PUMP_GLOBAL_VOLUME_ACCUMULATOR, PUMP_MINT_AUTHORITY, PUMP_PROGRAM_ADDRESS, PUMP_SELL, PUMP_SWAP_PROGRAM_ADDRESS, PumpBondingCurveState, PumpCreateAccountsInput, PumpCreateV2Input, PumpGlobalState, PumpRaw, PumpRawBondingCurve, PumpRawFeeConfig, PumpTradeAccountsInput, ResolveVenueOptions, ResolvedVenue, SWAP_BUY, SWAP_SELL, SYSTEM_PROGRAM_ADDRESS, SwapTradeAccountsInput, VenueAccountSpec, VenueBuyInput, VenueInstructionAbi, VenueKind, VenueSellInput, ammBuyCost, ammCanonicalPool, ammCoinCreatorVaultAta, ammCoinCreatorVaultAuthority, ammSellQuote, ammUserVolumeAccumulator, ata, curveBuyCost, curveQuote, curveSellQuote, decodeAmmFeeConfig, decodeAmmGlobalConfig, decodeAmmPool, decodeBondingCurve, decodeMintSupply, decodePumpFeeConfig, decodePumpGlobal, getPumpCreateV2Instruction, newCurveBuyCost, pumpBondingCurve, pumpBuyAccounts, pumpCreateV2Accounts, pumpCreatorVault, pumpMayhemState, pumpMayhemTokenVault, pumpSellAccounts, pumpSharingConfig, pumpUserVolumeAccumulator, resolveVenue, sellQuote, swapBuyAccounts, swapCashbackAccount, swapSellAccounts, tokenAccountAmount, venueBuyInstruction, venueSellInstruction, wsolAccountFor };
468
+ }
469
+ //#endregion
470
+ export { SwapTradeAccountsInput as $, curveBuyCost as A, ClientConfig as At, pumpCreatorVault as B, websocketUrlFor as Bt, ammBuyCost as C, PUMP_SWAP_PROGRAM_ADDRESS as Ct, ammSellQuote as D, VenueAccountSpec as Dt, ammCoinCreatorVaultAuthority as E, SYSTEM_PROGRAM_ADDRESS as Et, decodeBondingCurve as F, GaboxRpc as Ft, VenueBuyInput as G, pumpMayhemTokenVault as H, decodeMintSupply as I, GaboxRpcSubscriptions as It, venueSellInstruction as J, VenueSellInput as K, decodePumpFeeConfig as L, assertClusterUrl as Lt, decodeAmmFeeConfig as M, DEVNET_HTTP as Mt, decodeAmmGlobalConfig as N, DEVNET_WS as Nt, ammUserVolumeAccumulator as O, VenueInstructionAbi as Ot, decodeAmmPool as P, GaboxClient as Pt, PumpTradeAccountsInput as Q, decodePumpGlobal as R, clusterNamedBy as Rt, PumpRawFeeConfig as S, PUMP_SELL as St, ammCoinCreatorVaultAta as T, SWAP_SELL as Tt, pumpSharingConfig as U, pumpMayhemState as V, pumpUserVolumeAccumulator as W, getPumpCreateV2Instruction as X, PumpCreateV2Input as Y, PumpCreateAccountsInput as Z, PUMP_MINT_AUTHORITY as _, PUMP_BUY as _t, AMM_GLOBAL_VOLUME_ACCUMULATOR as a, swapSellAccounts as at, PumpRaw as b, PUMP_FEE_PROGRAM_ADDRESS as bt, AmmRawFeeConfig as c, VenueKind as ct, MAYHEM_GLOBAL_PARAMS as d, resolveVenue as dt, pumpBuyAccounts as et, MAYHEM_SOL_VAULT as f, sellQuote as ft, PUMP_GLOBAL_VOLUME_ACCUMULATOR as g, MAYHEM_PROGRAM_ADDRESS as gt, PUMP_GLOBAL as h, ASSOCIATED_TOKEN_PROGRAM_ADDRESS as ht, AMM_GLOBAL_CONFIG as i, swapCashbackAccount as it, curveSellQuote as j, Cluster as jt, ata as k, CLUSTER_ENDPOINTS as kt, AmmRawGlobalConfig as l, curveQuote as lt, PUMP_FEE_CONFIG as m, wsolAccountFor as mt, AMM_EVENT_AUTHORITY as n, pumpSellAccounts as nt, AmmGlobalConfigState as o, ResolveVenueOptions as ot, PUMP_EVENT_AUTHORITY as p, tokenAccountAmount as pt, venueBuyInstruction as q, AMM_FEE_CONFIG as r, swapBuyAccounts as rt, AmmPoolState as s, ResolvedVenue as st, index_d_exports as t, pumpCreateV2Accounts as tt, AmmRawPool as u, newCurveBuyCost as ut, PumpBondingCurveState as v, PUMP_CREATE_TOKEN_PROGRAM_ADDRESS as vt, ammCanonicalPool as w, SWAP_BUY as wt, PumpRawBondingCurve as x, PUMP_PROGRAM_ADDRESS as xt, PumpGlobalState as y, PUMP_CREATE_V2 as yt, pumpBondingCurve as z, createClient as zt };
471
+ //# sourceMappingURL=index-BxvSkzCO.d.ts.map