@send-fun/sdk 1.2.0 → 2.0.0
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.
- package/dist/index.cjs +281 -365
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +125 -166
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +125 -166
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +281 -365
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
- package/src/dex/generated/accounts/pool.ts +19 -7
- package/src/dex/generated/errors/sendDex.ts +16 -8
- package/src/dex/generated/events/creatorClaimEvent.ts +3 -2
- package/src/dex/generated/events/poolCreateEvent.ts +8 -2
- package/src/dex/generated/events/tokenCreateEvent.ts +8 -9
- package/src/dex/generated/events/tradeEvent.ts +9 -2
- package/src/dex/generated/instructions/claimCreatorFees.ts +21 -5
- package/src/{nexus → dex}/generated/pdas/creatorFeeConfig.ts +6 -6
- package/src/dex/generated/pdas/index.ts +1 -0
- package/src/dex/generated/plugins/sendDex.ts +3 -0
- package/src/launchpad/create.ts +9 -34
- package/src/launchpad/generated/accounts/bondingCurve.ts +23 -7
- package/src/launchpad/generated/errors/sendLaunchpad.ts +12 -4
- package/src/launchpad/generated/events/completeEvent.ts +3 -2
- package/src/launchpad/generated/events/creatorClaimEvent.ts +3 -2
- package/src/launchpad/generated/events/migrateEvent.ts +3 -2
- package/src/launchpad/generated/events/tokenCreateEvent.ts +10 -9
- package/src/launchpad/generated/events/tradeEvent.ts +9 -2
- package/src/launchpad/generated/instructions/claimCreatorFees.ts +17 -4
- package/src/launchpad/generated/instructions/createToken.ts +32 -50
- package/src/launchpad/generated/instructions/migrate.ts +79 -12
- package/src/launchpad/generated/pdas/creatorFeeConfig.ts +39 -0
- package/src/launchpad/generated/pdas/index.ts +1 -0
- package/src/launchpad/generated/plugins/sendLaunchpad.ts +3 -0
- package/src/launchpad/migrate.ts +7 -4
- package/src/nexus/fee-helpers.ts +8 -5
- package/src/nexus/generated/accounts/feePreset.ts +2 -2
- package/src/nexus/generated/accounts/index.ts +0 -1
- package/src/nexus/generated/accounts/partnerConfig.ts +9 -3
- package/src/nexus/generated/accounts/sendNexus.accounts.ts +0 -5
- package/src/nexus/generated/accounts/userRewardDebt.ts +3 -3
- package/src/nexus/generated/accounts/userStakePosition.ts +3 -3
- package/src/nexus/generated/errors/sendNexus.ts +12 -4
- package/src/nexus/generated/pdas/index.ts +0 -1
- package/src/nexus/generated/plugins/sendNexus.ts +0 -35
- package/src/nexus/generated/types/dexFees.ts +4 -4
- package/src/nexus/generated/types/index.ts +0 -1
- package/src/nexus/generated/types/launchpadFees.ts +4 -4
- package/src/utils/index.ts +0 -5
- package/src/nexus/generated/accounts/creatorFeeConfig.ts +0 -237
- package/src/nexus/generated/types/callerType.ts +0 -38
- package/src/utils/creator-hash.ts +0 -60
package/dist/index.cjs
CHANGED
|
@@ -276,7 +276,7 @@ function getPoolEncoder() {
|
|
|
276
276
|
["quoteMint", (0, _solana_kit.getAddressEncoder)()],
|
|
277
277
|
["quoteDecimals", (0, _solana_kit.getU8Encoder)()],
|
|
278
278
|
["coinCreator", (0, _solana_kit.getAddressEncoder)()],
|
|
279
|
-
["
|
|
279
|
+
["padding0", (0, _solana_kit.getArrayEncoder)((0, _solana_kit.getU64Encoder)(), { size: 4 })],
|
|
280
280
|
["baseVault", (0, _solana_kit.getAddressEncoder)()],
|
|
281
281
|
["quoteVault", (0, _solana_kit.getAddressEncoder)()],
|
|
282
282
|
["lpMint", (0, _solana_kit.getAddressEncoder)()],
|
|
@@ -288,7 +288,9 @@ function getPoolEncoder() {
|
|
|
288
288
|
["protocolOwed", (0, _solana_kit.getU64Encoder)()],
|
|
289
289
|
["creatorOwed", (0, _solana_kit.getU64Encoder)()],
|
|
290
290
|
["platformConfig", (0, _solana_kit.getAddressEncoder)()],
|
|
291
|
-
["
|
|
291
|
+
["creatorFeeMode", (0, _solana_kit.getU8Encoder)()],
|
|
292
|
+
["creatorFeeBps", (0, _solana_kit.getU16Encoder)()],
|
|
293
|
+
["reserved", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 256)]
|
|
292
294
|
]), (value) => ({
|
|
293
295
|
...value,
|
|
294
296
|
discriminator: POOL_DISCRIMINATOR
|
|
@@ -306,7 +308,7 @@ function getPoolDecoder() {
|
|
|
306
308
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
307
309
|
["quoteDecimals", (0, _solana_kit.getU8Decoder)()],
|
|
308
310
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
309
|
-
["
|
|
311
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 4 })],
|
|
310
312
|
["baseVault", (0, _solana_kit.getAddressDecoder)()],
|
|
311
313
|
["quoteVault", (0, _solana_kit.getAddressDecoder)()],
|
|
312
314
|
["lpMint", (0, _solana_kit.getAddressDecoder)()],
|
|
@@ -318,7 +320,9 @@ function getPoolDecoder() {
|
|
|
318
320
|
["protocolOwed", (0, _solana_kit.getU64Decoder)()],
|
|
319
321
|
["creatorOwed", (0, _solana_kit.getU64Decoder)()],
|
|
320
322
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
321
|
-
["
|
|
323
|
+
["creatorFeeMode", (0, _solana_kit.getU8Decoder)()],
|
|
324
|
+
["creatorFeeBps", (0, _solana_kit.getU16Decoder)()],
|
|
325
|
+
["reserved", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(), 256)]
|
|
322
326
|
]);
|
|
323
327
|
}
|
|
324
328
|
/** Gets the codec for {@link Pool} account data. */
|
|
@@ -376,7 +380,7 @@ async function fetchAllMaybePool(rpc, addresses, config) {
|
|
|
376
380
|
}));
|
|
377
381
|
}
|
|
378
382
|
function getPoolSize() {
|
|
379
|
-
return
|
|
383
|
+
return 584;
|
|
380
384
|
}
|
|
381
385
|
//#endregion
|
|
382
386
|
//#region src/dex/generated/accounts/rewardAccrual.ts
|
|
@@ -574,8 +578,8 @@ const SEND_DEX_ERROR__INVALID_POOL_BALANCE = 6008;
|
|
|
574
578
|
const SEND_DEX_ERROR__INSUFFICIENT_POOL_BALANCE = 6009;
|
|
575
579
|
/** InvalidAuthority: Invalid authority */
|
|
576
580
|
const SEND_DEX_ERROR__INVALID_AUTHORITY = 6010;
|
|
577
|
-
/**
|
|
578
|
-
const
|
|
581
|
+
/** InvalidCoinCreator: Invalid coin creator */
|
|
582
|
+
const SEND_DEX_ERROR__INVALID_COIN_CREATOR = 6011;
|
|
579
583
|
/** InvalidPlatformConfig: Platform config cannot be the default address */
|
|
580
584
|
const SEND_DEX_ERROR__INVALID_PLATFORM_CONFIG = 6012;
|
|
581
585
|
/** ProgramPaused: Program is paused */
|
|
@@ -602,26 +606,31 @@ const SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT = 7009;
|
|
|
602
606
|
const SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY = 7010;
|
|
603
607
|
/** NothingToClaim: Nothing to claim */
|
|
604
608
|
const SEND_DEX_ERROR__NOTHING_TO_CLAIM = 7011;
|
|
605
|
-
/**
|
|
606
|
-
const
|
|
609
|
+
/** Unused7012: Unused */
|
|
610
|
+
const SEND_DEX_ERROR__UNUSED7012 = 7012;
|
|
607
611
|
/** QuoteMintPriceUnset: Quote mint has no USDC price on its nexus reward state */
|
|
608
612
|
const SEND_DEX_ERROR__QUOTE_MINT_PRICE_UNSET = 7013;
|
|
609
613
|
/** TransferFeeNotSettleable: Token-2022 transfer fee schedule cannot settle the exact amount */
|
|
610
614
|
const SEND_DEX_ERROR__TRANSFER_FEE_NOT_SETTLEABLE = 7014;
|
|
615
|
+
/** CreatorFeeTooHigh: Creator fee exceeds the partner's maximum */
|
|
616
|
+
const SEND_DEX_ERROR__CREATOR_FEE_TOO_HIGH = 7015;
|
|
617
|
+
/** CreatorFeeModeNotAllowed: Creator fee mode is not allowed by the partner config */
|
|
618
|
+
const SEND_DEX_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED = 7016;
|
|
611
619
|
/** InsufficientLiquidity: Insufficient liquidity */
|
|
612
620
|
const SEND_DEX_ERROR__INSUFFICIENT_LIQUIDITY = 7100;
|
|
613
621
|
/** InvalidAmount: Invalid amount */
|
|
614
622
|
const SEND_DEX_ERROR__INVALID_AMOUNT = 7101;
|
|
615
623
|
const sendDexErrorMessages = {
|
|
616
624
|
[SEND_DEX_ERROR__ARITHMETIC_OVERFLOW]: `Arithmetic overflow`,
|
|
625
|
+
[SEND_DEX_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED]: `Creator fee mode is not allowed by the partner config`,
|
|
626
|
+
[SEND_DEX_ERROR__CREATOR_FEE_TOO_HIGH]: `Creator fee exceeds the partner's maximum`,
|
|
617
627
|
[SEND_DEX_ERROR__INSUFFICIENT_BALANCE]: `Insufficient balance in source account`,
|
|
618
628
|
[SEND_DEX_ERROR__INSUFFICIENT_LIQUIDITY]: `Insufficient liquidity`,
|
|
619
629
|
[SEND_DEX_ERROR__INSUFFICIENT_POOL_BALANCE]: `Insufficient pool balance`,
|
|
620
630
|
[SEND_DEX_ERROR__INVALID_AMOUNT]: `Invalid amount`,
|
|
621
631
|
[SEND_DEX_ERROR__INVALID_AUTHORITY]: `Invalid authority`,
|
|
622
632
|
[SEND_DEX_ERROR__INVALID_BASE_MINT]: `Invalid base mint`,
|
|
623
|
-
[
|
|
624
|
-
[SEND_DEX_ERROR__INVALID_CREATOR_ID]: `Creator identity is not a decodable wallet address`,
|
|
633
|
+
[SEND_DEX_ERROR__INVALID_COIN_CREATOR]: `Invalid coin creator`,
|
|
625
634
|
[SEND_DEX_ERROR__INVALID_DEPOSIT]: `Invalid deposit`,
|
|
626
635
|
[SEND_DEX_ERROR__INVALID_PLATFORM_CONFIG]: `Platform config cannot be the default address`,
|
|
627
636
|
[SEND_DEX_ERROR__INVALID_POOL_BALANCE]: `Invalid pool balance`,
|
|
@@ -639,6 +648,7 @@ const sendDexErrorMessages = {
|
|
|
639
648
|
[SEND_DEX_ERROR__TEXT_TOO_LONG]: `Text too long`,
|
|
640
649
|
[SEND_DEX_ERROR__TRANSFER_FEE_NOT_SETTLEABLE]: `Token-2022 transfer fee schedule cannot settle the exact amount`,
|
|
641
650
|
[SEND_DEX_ERROR__UNAUTHORIZED]: `Unauthorized`,
|
|
651
|
+
[SEND_DEX_ERROR__UNUSED7012]: `Unused`,
|
|
642
652
|
[SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_INVALID]: `User token account is not an initialized token account`,
|
|
643
653
|
[SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY]: `User token account is not owned by the trading user`,
|
|
644
654
|
[SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT]: `User token account mint does not match the trade`,
|
|
@@ -654,14 +664,15 @@ function isSendDexError(error, transactionMessage, code) {
|
|
|
654
664
|
//#region src/dex/generated/errors/index.ts
|
|
655
665
|
var errors_exports$2 = /* @__PURE__ */ __exportAll({
|
|
656
666
|
SEND_DEX_ERROR__ARITHMETIC_OVERFLOW: () => SEND_DEX_ERROR__ARITHMETIC_OVERFLOW,
|
|
667
|
+
SEND_DEX_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED: () => SEND_DEX_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED,
|
|
668
|
+
SEND_DEX_ERROR__CREATOR_FEE_TOO_HIGH: () => SEND_DEX_ERROR__CREATOR_FEE_TOO_HIGH,
|
|
657
669
|
SEND_DEX_ERROR__INSUFFICIENT_BALANCE: () => SEND_DEX_ERROR__INSUFFICIENT_BALANCE,
|
|
658
670
|
SEND_DEX_ERROR__INSUFFICIENT_LIQUIDITY: () => SEND_DEX_ERROR__INSUFFICIENT_LIQUIDITY,
|
|
659
671
|
SEND_DEX_ERROR__INSUFFICIENT_POOL_BALANCE: () => SEND_DEX_ERROR__INSUFFICIENT_POOL_BALANCE,
|
|
660
672
|
SEND_DEX_ERROR__INVALID_AMOUNT: () => SEND_DEX_ERROR__INVALID_AMOUNT,
|
|
661
673
|
SEND_DEX_ERROR__INVALID_AUTHORITY: () => SEND_DEX_ERROR__INVALID_AUTHORITY,
|
|
662
674
|
SEND_DEX_ERROR__INVALID_BASE_MINT: () => SEND_DEX_ERROR__INVALID_BASE_MINT,
|
|
663
|
-
|
|
664
|
-
SEND_DEX_ERROR__INVALID_CREATOR_ID: () => SEND_DEX_ERROR__INVALID_CREATOR_ID,
|
|
675
|
+
SEND_DEX_ERROR__INVALID_COIN_CREATOR: () => SEND_DEX_ERROR__INVALID_COIN_CREATOR,
|
|
665
676
|
SEND_DEX_ERROR__INVALID_DEPOSIT: () => SEND_DEX_ERROR__INVALID_DEPOSIT,
|
|
666
677
|
SEND_DEX_ERROR__INVALID_PLATFORM_CONFIG: () => SEND_DEX_ERROR__INVALID_PLATFORM_CONFIG,
|
|
667
678
|
SEND_DEX_ERROR__INVALID_POOL_BALANCE: () => SEND_DEX_ERROR__INVALID_POOL_BALANCE,
|
|
@@ -679,6 +690,7 @@ var errors_exports$2 = /* @__PURE__ */ __exportAll({
|
|
|
679
690
|
SEND_DEX_ERROR__TEXT_TOO_LONG: () => SEND_DEX_ERROR__TEXT_TOO_LONG,
|
|
680
691
|
SEND_DEX_ERROR__TRANSFER_FEE_NOT_SETTLEABLE: () => SEND_DEX_ERROR__TRANSFER_FEE_NOT_SETTLEABLE,
|
|
681
692
|
SEND_DEX_ERROR__UNAUTHORIZED: () => SEND_DEX_ERROR__UNAUTHORIZED,
|
|
693
|
+
SEND_DEX_ERROR__UNUSED7012: () => SEND_DEX_ERROR__UNUSED7012,
|
|
682
694
|
SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_INVALID: () => SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_INVALID,
|
|
683
695
|
SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY: () => SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY,
|
|
684
696
|
SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT: () => SEND_DEX_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT,
|
|
@@ -688,6 +700,44 @@ var errors_exports$2 = /* @__PURE__ */ __exportAll({
|
|
|
688
700
|
sendDexErrorMessages: () => sendDexErrorMessages
|
|
689
701
|
});
|
|
690
702
|
//#endregion
|
|
703
|
+
//#region src/dex/generated/pdas/creatorFeeConfig.ts
|
|
704
|
+
/**
|
|
705
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
706
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
707
|
+
* to add features, then rerun Codama to update it.
|
|
708
|
+
*
|
|
709
|
+
* @see https://github.com/codama-idl/codama
|
|
710
|
+
*/
|
|
711
|
+
async function findCreatorFeeConfigPda$1(seeds) {
|
|
712
|
+
return await (0, _solana_kit.getProgramDerivedAddress)({
|
|
713
|
+
programAddress: SEND_DEX_PROGRAM_ADDRESS,
|
|
714
|
+
seeds: [
|
|
715
|
+
(0, _solana_kit.getBytesEncoder)().encode(new Uint8Array([
|
|
716
|
+
99,
|
|
717
|
+
114,
|
|
718
|
+
101,
|
|
719
|
+
97,
|
|
720
|
+
116,
|
|
721
|
+
111,
|
|
722
|
+
114,
|
|
723
|
+
95,
|
|
724
|
+
102,
|
|
725
|
+
101,
|
|
726
|
+
101,
|
|
727
|
+
95,
|
|
728
|
+
99,
|
|
729
|
+
111,
|
|
730
|
+
110,
|
|
731
|
+
102,
|
|
732
|
+
105,
|
|
733
|
+
103
|
|
734
|
+
])),
|
|
735
|
+
(0, _solana_kit.getAddressEncoder)().encode(seeds.baseMint),
|
|
736
|
+
(0, _solana_kit.getAddressEncoder)().encode(seeds.quoteMint)
|
|
737
|
+
]
|
|
738
|
+
});
|
|
739
|
+
}
|
|
740
|
+
//#endregion
|
|
691
741
|
//#region src/dex/generated/pdas/eventAuthority.ts
|
|
692
742
|
const EVENT_AUTHORITY_PDA_ADDRESS$2 = "4pTDYKRFdmxTQYFceGZkzPGd3kb8ShMA9n6XKRaPZn8t";
|
|
693
743
|
function findEventAuthorityPda$2() {
|
|
@@ -792,6 +842,7 @@ var pdas_exports$2 = /* @__PURE__ */ __exportAll({
|
|
|
792
842
|
EVENT_AUTHORITY_PDA_ADDRESS: () => EVENT_AUTHORITY_PDA_ADDRESS$2,
|
|
793
843
|
GLOBAL_CONFIG_PDA_ADDRESS: () => GLOBAL_CONFIG_PDA_ADDRESS$2,
|
|
794
844
|
WSOL_REWARD_ACCRUAL_PDA_ADDRESS: () => WSOL_REWARD_ACCRUAL_PDA_ADDRESS$1,
|
|
845
|
+
findCreatorFeeConfigPda: () => findCreatorFeeConfigPda$1,
|
|
795
846
|
findEventAuthorityPda: () => findEventAuthorityPda$2,
|
|
796
847
|
findGlobalConfigPda: () => findGlobalConfigPda$2,
|
|
797
848
|
findLpMintPda: () => findLpMintPda,
|
|
@@ -857,7 +908,7 @@ function getCreatorClaimEventDecoder$1() {
|
|
|
857
908
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
858
909
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
859
910
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
860
|
-
["
|
|
911
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 4 })],
|
|
861
912
|
["claimer", (0, _solana_kit.getAddressDecoder)()],
|
|
862
913
|
["destinationOwner", (0, _solana_kit.getAddressDecoder)()],
|
|
863
914
|
["amount", (0, _solana_kit.getU64Decoder)()],
|
|
@@ -1000,7 +1051,7 @@ function getPoolCreateEventDecoder() {
|
|
|
1000
1051
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
1001
1052
|
["quoteDecimals", (0, _solana_kit.getU8Decoder)()],
|
|
1002
1053
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
1003
|
-
["
|
|
1054
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 4 })],
|
|
1004
1055
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
1005
1056
|
["baseVault", (0, _solana_kit.getAddressDecoder)()],
|
|
1006
1057
|
["quoteVault", (0, _solana_kit.getAddressDecoder)()],
|
|
@@ -1008,7 +1059,9 @@ function getPoolCreateEventDecoder() {
|
|
|
1008
1059
|
["lpMinted", (0, _solana_kit.getU64Decoder)()],
|
|
1009
1060
|
["baseReserves", (0, _solana_kit.getU64Decoder)()],
|
|
1010
1061
|
["quoteReserves", (0, _solana_kit.getU64Decoder)()],
|
|
1011
|
-
["timestamp", (0, _solana_kit.getI64Decoder)()]
|
|
1062
|
+
["timestamp", (0, _solana_kit.getI64Decoder)()],
|
|
1063
|
+
["creatorFeeMode", (0, _solana_kit.getU8Decoder)()],
|
|
1064
|
+
["creatorFeeBps", (0, _solana_kit.getU16Decoder)()]
|
|
1012
1065
|
]);
|
|
1013
1066
|
}
|
|
1014
1067
|
/**
|
|
@@ -1145,9 +1198,7 @@ function getTokenCreateEventDecoder$1() {
|
|
|
1145
1198
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
1146
1199
|
["quoteDecimals", (0, _solana_kit.getU8Decoder)()],
|
|
1147
1200
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
1148
|
-
["
|
|
1149
|
-
["creatorId", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
1150
|
-
["creatorFeeConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
1201
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 5 })],
|
|
1151
1202
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
1152
1203
|
["name", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
1153
1204
|
["symbol", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
@@ -1157,7 +1208,9 @@ function getTokenCreateEventDecoder$1() {
|
|
|
1157
1208
|
["creationFee", (0, _solana_kit.getU64Decoder)()],
|
|
1158
1209
|
["baseReserves", (0, _solana_kit.getU64Decoder)()],
|
|
1159
1210
|
["quoteReserves", (0, _solana_kit.getU64Decoder)()],
|
|
1160
|
-
["timestamp", (0, _solana_kit.getI64Decoder)()]
|
|
1211
|
+
["timestamp", (0, _solana_kit.getI64Decoder)()],
|
|
1212
|
+
["creatorFeeMode", (0, _solana_kit.getU8Decoder)()],
|
|
1213
|
+
["creatorFeeBps", (0, _solana_kit.getU16Decoder)()]
|
|
1161
1214
|
]);
|
|
1162
1215
|
}
|
|
1163
1216
|
/**
|
|
@@ -1224,7 +1277,7 @@ function getTradeEventDecoder$1() {
|
|
|
1224
1277
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
1225
1278
|
["user", (0, _solana_kit.getAddressDecoder)()],
|
|
1226
1279
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
1227
|
-
["
|
|
1280
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 4 })],
|
|
1228
1281
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
1229
1282
|
["baseAmount", (0, _solana_kit.getU64Decoder)()],
|
|
1230
1283
|
["quoteAmountGross", (0, _solana_kit.getU64Decoder)()],
|
|
@@ -1239,7 +1292,9 @@ function getTradeEventDecoder$1() {
|
|
|
1239
1292
|
["quoteTransferFee", (0, _solana_kit.getU64Decoder)()],
|
|
1240
1293
|
["baseReserves", (0, _solana_kit.getU64Decoder)()],
|
|
1241
1294
|
["quoteReserves", (0, _solana_kit.getU64Decoder)()],
|
|
1242
|
-
["timestamp", (0, _solana_kit.getI64Decoder)()]
|
|
1295
|
+
["timestamp", (0, _solana_kit.getI64Decoder)()],
|
|
1296
|
+
["creatorFeeMode", (0, _solana_kit.getU8Decoder)()],
|
|
1297
|
+
["creatorFeeBps", (0, _solana_kit.getU16Decoder)()]
|
|
1243
1298
|
]);
|
|
1244
1299
|
}
|
|
1245
1300
|
/**
|
|
@@ -2118,7 +2173,7 @@ async function getClaimCreatorFeesInstructionAsync$1(input) {
|
|
|
2118
2173
|
},
|
|
2119
2174
|
creatorFeeConfig: {
|
|
2120
2175
|
value: input.creatorFeeConfig ?? null,
|
|
2121
|
-
isWritable:
|
|
2176
|
+
isWritable: true
|
|
2122
2177
|
},
|
|
2123
2178
|
nexusGlobalConfig: {
|
|
2124
2179
|
value: null,
|
|
@@ -2169,6 +2224,10 @@ async function getClaimCreatorFeesInstructionAsync$1(input) {
|
|
|
2169
2224
|
baseMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("baseMint", accounts.baseMint.value),
|
|
2170
2225
|
quoteMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("quoteMint", accounts.quoteMint.value)
|
|
2171
2226
|
});
|
|
2227
|
+
if (!accounts.creatorFeeConfig.value) accounts.creatorFeeConfig.value = await findCreatorFeeConfigPda$1({
|
|
2228
|
+
baseMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("baseMint", accounts.baseMint.value),
|
|
2229
|
+
quoteMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("quoteMint", accounts.quoteMint.value)
|
|
2230
|
+
});
|
|
2172
2231
|
if (!accounts.nexusGlobalConfig.value) accounts.nexusGlobalConfig.value = "3bycfBeRULfXYqcg3DmiYFBjv6mMVidMuqKdFZJTGdNr";
|
|
2173
2232
|
if (!accounts.quoteVault.value) accounts.quoteVault.value = await (0, _solana_kit.getProgramDerivedAddress)({
|
|
2174
2233
|
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
@@ -2230,7 +2289,7 @@ function getClaimCreatorFeesInstruction$1(input) {
|
|
|
2230
2289
|
},
|
|
2231
2290
|
creatorFeeConfig: {
|
|
2232
2291
|
value: input.creatorFeeConfig ?? null,
|
|
2233
|
-
isWritable:
|
|
2292
|
+
isWritable: true
|
|
2234
2293
|
},
|
|
2235
2294
|
nexusGlobalConfig: {
|
|
2236
2295
|
value: null,
|
|
@@ -3493,6 +3552,7 @@ function sendDexProgram() {
|
|
|
3493
3552
|
pdas: {
|
|
3494
3553
|
pool: findPoolPda,
|
|
3495
3554
|
eventAuthority: findEventAuthorityPda$2,
|
|
3555
|
+
creatorFeeConfig: findCreatorFeeConfigPda$1,
|
|
3496
3556
|
rewardAccrual: findRewardAccrualPda$1,
|
|
3497
3557
|
globalConfig: findGlobalConfigPda$2,
|
|
3498
3558
|
lpMint: findLpMintPda,
|
|
@@ -4055,7 +4115,7 @@ function getBondingCurveEncoder() {
|
|
|
4055
4115
|
["quoteMint", (0, _solana_kit.getAddressEncoder)()],
|
|
4056
4116
|
["quoteDecimals", (0, _solana_kit.getU8Encoder)()],
|
|
4057
4117
|
["coinCreator", (0, _solana_kit.getAddressEncoder)()],
|
|
4058
|
-
["
|
|
4118
|
+
["padding0", (0, _solana_kit.getArrayEncoder)((0, _solana_kit.getU64Encoder)(), { size: 4 })],
|
|
4059
4119
|
["partner", (0, _solana_kit.getAddressEncoder)()],
|
|
4060
4120
|
["baseVault", (0, _solana_kit.getAddressEncoder)()],
|
|
4061
4121
|
["quoteVault", (0, _solana_kit.getAddressEncoder)()],
|
|
@@ -4067,7 +4127,10 @@ function getBondingCurveEncoder() {
|
|
|
4067
4127
|
["protocolOwed", (0, _solana_kit.getU64Encoder)()],
|
|
4068
4128
|
["creatorOwed", (0, _solana_kit.getU64Encoder)()],
|
|
4069
4129
|
["platformConfig", (0, _solana_kit.getAddressEncoder)()],
|
|
4070
|
-
["
|
|
4130
|
+
["creatorFeeMode", (0, _solana_kit.getU8Encoder)()],
|
|
4131
|
+
["creatorFeeBps", (0, _solana_kit.getU16Encoder)()],
|
|
4132
|
+
["dexCreatorFeeBps", (0, _solana_kit.getU16Encoder)()],
|
|
4133
|
+
["reserved", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 256)]
|
|
4071
4134
|
]), (value) => ({
|
|
4072
4135
|
...value,
|
|
4073
4136
|
discriminator: BONDING_CURVE_DISCRIMINATOR
|
|
@@ -4089,7 +4152,7 @@ function getBondingCurveDecoder() {
|
|
|
4089
4152
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
4090
4153
|
["quoteDecimals", (0, _solana_kit.getU8Decoder)()],
|
|
4091
4154
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
4092
|
-
["
|
|
4155
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 4 })],
|
|
4093
4156
|
["partner", (0, _solana_kit.getAddressDecoder)()],
|
|
4094
4157
|
["baseVault", (0, _solana_kit.getAddressDecoder)()],
|
|
4095
4158
|
["quoteVault", (0, _solana_kit.getAddressDecoder)()],
|
|
@@ -4101,7 +4164,10 @@ function getBondingCurveDecoder() {
|
|
|
4101
4164
|
["protocolOwed", (0, _solana_kit.getU64Decoder)()],
|
|
4102
4165
|
["creatorOwed", (0, _solana_kit.getU64Decoder)()],
|
|
4103
4166
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
4104
|
-
["
|
|
4167
|
+
["creatorFeeMode", (0, _solana_kit.getU8Decoder)()],
|
|
4168
|
+
["creatorFeeBps", (0, _solana_kit.getU16Decoder)()],
|
|
4169
|
+
["dexCreatorFeeBps", (0, _solana_kit.getU16Decoder)()],
|
|
4170
|
+
["reserved", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(), 256)]
|
|
4105
4171
|
]);
|
|
4106
4172
|
}
|
|
4107
4173
|
/** Gets the codec for {@link BondingCurve} account data. */
|
|
@@ -4159,7 +4225,7 @@ async function fetchAllMaybeBondingCurve(rpc, addresses, config) {
|
|
|
4159
4225
|
}));
|
|
4160
4226
|
}
|
|
4161
4227
|
function getBondingCurveSize() {
|
|
4162
|
-
return
|
|
4228
|
+
return 618;
|
|
4163
4229
|
}
|
|
4164
4230
|
//#endregion
|
|
4165
4231
|
//#region src/launchpad/generated/accounts/globalConfig.ts
|
|
@@ -4507,12 +4573,16 @@ const SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT = 7009;
|
|
|
4507
4573
|
const SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY = 7010;
|
|
4508
4574
|
/** NothingToClaim: Nothing to claim */
|
|
4509
4575
|
const SEND_LAUNCHPAD_ERROR__NOTHING_TO_CLAIM = 7011;
|
|
4510
|
-
/**
|
|
4511
|
-
const
|
|
4576
|
+
/** Unused7012: Unused */
|
|
4577
|
+
const SEND_LAUNCHPAD_ERROR__UNUSED7012 = 7012;
|
|
4512
4578
|
/** QuoteMintPriceUnset: Quote mint has no USDC price on its nexus reward state */
|
|
4513
4579
|
const SEND_LAUNCHPAD_ERROR__QUOTE_MINT_PRICE_UNSET = 7013;
|
|
4514
4580
|
/** TransferFeeNotSettleable: Token-2022 transfer fee schedule cannot settle the exact amount */
|
|
4515
4581
|
const SEND_LAUNCHPAD_ERROR__TRANSFER_FEE_NOT_SETTLEABLE = 7014;
|
|
4582
|
+
/** CreatorFeeTooHigh: Creator fee exceeds the partner's maximum */
|
|
4583
|
+
const SEND_LAUNCHPAD_ERROR__CREATOR_FEE_TOO_HIGH = 7015;
|
|
4584
|
+
/** CreatorFeeModeNotAllowed: Creator fee mode is not allowed by the partner config */
|
|
4585
|
+
const SEND_LAUNCHPAD_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED = 7016;
|
|
4516
4586
|
/** InsufficientLiquidity: Insufficient liquidity */
|
|
4517
4587
|
const SEND_LAUNCHPAD_ERROR__INSUFFICIENT_LIQUIDITY = 7100;
|
|
4518
4588
|
/** InvalidAmount: Invalid amount */
|
|
@@ -4522,6 +4592,8 @@ const sendLaunchpadErrorMessages = {
|
|
|
4522
4592
|
[SEND_LAUNCHPAD_ERROR__ARITHMETIC_OVERFLOW]: `Arithmetic overflow`,
|
|
4523
4593
|
[SEND_LAUNCHPAD_ERROR__BASE_MINT_NOT_FOUND]: `Base mint not found`,
|
|
4524
4594
|
[SEND_LAUNCHPAD_ERROR__BLOCKED_BY_HELD_SUPPLY]: `Blocked by held supply`,
|
|
4595
|
+
[SEND_LAUNCHPAD_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED]: `Creator fee mode is not allowed by the partner config`,
|
|
4596
|
+
[SEND_LAUNCHPAD_ERROR__CREATOR_FEE_TOO_HIGH]: `Creator fee exceeds the partner's maximum`,
|
|
4525
4597
|
[SEND_LAUNCHPAD_ERROR__CURVE_IS_LIVE]: `Curve is live`,
|
|
4526
4598
|
[SEND_LAUNCHPAD_ERROR__INSUFFICIENT_BALANCE]: `Insufficient balance in source account`,
|
|
4527
4599
|
[SEND_LAUNCHPAD_ERROR__INSUFFICIENT_LIQUIDITY]: `Insufficient liquidity`,
|
|
@@ -4529,7 +4601,6 @@ const sendLaunchpadErrorMessages = {
|
|
|
4529
4601
|
[SEND_LAUNCHPAD_ERROR__INVALID_AUTHORITY]: `Invalid authority`,
|
|
4530
4602
|
[SEND_LAUNCHPAD_ERROR__INVALID_BASE_MINT]: `Invalid base mint`,
|
|
4531
4603
|
[SEND_LAUNCHPAD_ERROR__INVALID_COIN_CREATOR]: `Invalid coin creator`,
|
|
4532
|
-
[SEND_LAUNCHPAD_ERROR__INVALID_CREATOR_ID]: `Creator identity is not a decodable wallet address`,
|
|
4533
4604
|
[SEND_LAUNCHPAD_ERROR__INVALID_PYTH_ACCOUNT]: `Invalid Pyth price account`,
|
|
4534
4605
|
[SEND_LAUNCHPAD_ERROR__INVALID_PYTH_FEED]: `Invalid Pyth feed ID`,
|
|
4535
4606
|
[SEND_LAUNCHPAD_ERROR__INVALID_QUOTE_MINT]: `Invalid quote mint`,
|
|
@@ -4547,6 +4618,7 @@ const sendLaunchpadErrorMessages = {
|
|
|
4547
4618
|
[SEND_LAUNCHPAD_ERROR__TOKEN_CREATION_DISABLED]: `Token creation is disabled`,
|
|
4548
4619
|
[SEND_LAUNCHPAD_ERROR__TRANSFER_FEE_NOT_SETTLEABLE]: `Token-2022 transfer fee schedule cannot settle the exact amount`,
|
|
4549
4620
|
[SEND_LAUNCHPAD_ERROR__UNAUTHORIZED]: `Unauthorized`,
|
|
4621
|
+
[SEND_LAUNCHPAD_ERROR__UNUSED7012]: `Unused`,
|
|
4550
4622
|
[SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_INVALID]: `User token account is not an initialized token account`,
|
|
4551
4623
|
[SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY]: `User token account is not owned by the trading user`,
|
|
4552
4624
|
[SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT]: `User token account mint does not match the trade`,
|
|
@@ -4565,6 +4637,8 @@ var errors_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
4565
4637
|
SEND_LAUNCHPAD_ERROR__ARITHMETIC_OVERFLOW: () => SEND_LAUNCHPAD_ERROR__ARITHMETIC_OVERFLOW,
|
|
4566
4638
|
SEND_LAUNCHPAD_ERROR__BASE_MINT_NOT_FOUND: () => SEND_LAUNCHPAD_ERROR__BASE_MINT_NOT_FOUND,
|
|
4567
4639
|
SEND_LAUNCHPAD_ERROR__BLOCKED_BY_HELD_SUPPLY: () => SEND_LAUNCHPAD_ERROR__BLOCKED_BY_HELD_SUPPLY,
|
|
4640
|
+
SEND_LAUNCHPAD_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED: () => SEND_LAUNCHPAD_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED,
|
|
4641
|
+
SEND_LAUNCHPAD_ERROR__CREATOR_FEE_TOO_HIGH: () => SEND_LAUNCHPAD_ERROR__CREATOR_FEE_TOO_HIGH,
|
|
4568
4642
|
SEND_LAUNCHPAD_ERROR__CURVE_IS_LIVE: () => SEND_LAUNCHPAD_ERROR__CURVE_IS_LIVE,
|
|
4569
4643
|
SEND_LAUNCHPAD_ERROR__INSUFFICIENT_BALANCE: () => SEND_LAUNCHPAD_ERROR__INSUFFICIENT_BALANCE,
|
|
4570
4644
|
SEND_LAUNCHPAD_ERROR__INSUFFICIENT_LIQUIDITY: () => SEND_LAUNCHPAD_ERROR__INSUFFICIENT_LIQUIDITY,
|
|
@@ -4572,7 +4646,6 @@ var errors_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
4572
4646
|
SEND_LAUNCHPAD_ERROR__INVALID_AUTHORITY: () => SEND_LAUNCHPAD_ERROR__INVALID_AUTHORITY,
|
|
4573
4647
|
SEND_LAUNCHPAD_ERROR__INVALID_BASE_MINT: () => SEND_LAUNCHPAD_ERROR__INVALID_BASE_MINT,
|
|
4574
4648
|
SEND_LAUNCHPAD_ERROR__INVALID_COIN_CREATOR: () => SEND_LAUNCHPAD_ERROR__INVALID_COIN_CREATOR,
|
|
4575
|
-
SEND_LAUNCHPAD_ERROR__INVALID_CREATOR_ID: () => SEND_LAUNCHPAD_ERROR__INVALID_CREATOR_ID,
|
|
4576
4649
|
SEND_LAUNCHPAD_ERROR__INVALID_PYTH_ACCOUNT: () => SEND_LAUNCHPAD_ERROR__INVALID_PYTH_ACCOUNT,
|
|
4577
4650
|
SEND_LAUNCHPAD_ERROR__INVALID_PYTH_FEED: () => SEND_LAUNCHPAD_ERROR__INVALID_PYTH_FEED,
|
|
4578
4651
|
SEND_LAUNCHPAD_ERROR__INVALID_QUOTE_MINT: () => SEND_LAUNCHPAD_ERROR__INVALID_QUOTE_MINT,
|
|
@@ -4590,6 +4663,7 @@ var errors_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
4590
4663
|
SEND_LAUNCHPAD_ERROR__TOKEN_CREATION_DISABLED: () => SEND_LAUNCHPAD_ERROR__TOKEN_CREATION_DISABLED,
|
|
4591
4664
|
SEND_LAUNCHPAD_ERROR__TRANSFER_FEE_NOT_SETTLEABLE: () => SEND_LAUNCHPAD_ERROR__TRANSFER_FEE_NOT_SETTLEABLE,
|
|
4592
4665
|
SEND_LAUNCHPAD_ERROR__UNAUTHORIZED: () => SEND_LAUNCHPAD_ERROR__UNAUTHORIZED,
|
|
4666
|
+
SEND_LAUNCHPAD_ERROR__UNUSED7012: () => SEND_LAUNCHPAD_ERROR__UNUSED7012,
|
|
4593
4667
|
SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_INVALID: () => SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_INVALID,
|
|
4594
4668
|
SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY: () => SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY,
|
|
4595
4669
|
SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT: () => SEND_LAUNCHPAD_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT,
|
|
@@ -4632,6 +4706,44 @@ async function findBondingCurvePda(seeds) {
|
|
|
4632
4706
|
});
|
|
4633
4707
|
}
|
|
4634
4708
|
//#endregion
|
|
4709
|
+
//#region src/launchpad/generated/pdas/creatorFeeConfig.ts
|
|
4710
|
+
/**
|
|
4711
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
4712
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4713
|
+
* to add features, then rerun Codama to update it.
|
|
4714
|
+
*
|
|
4715
|
+
* @see https://github.com/codama-idl/codama
|
|
4716
|
+
*/
|
|
4717
|
+
async function findCreatorFeeConfigPda(seeds) {
|
|
4718
|
+
return await (0, _solana_kit.getProgramDerivedAddress)({
|
|
4719
|
+
programAddress: SEND_LAUNCHPAD_PROGRAM_ADDRESS,
|
|
4720
|
+
seeds: [
|
|
4721
|
+
(0, _solana_kit.getBytesEncoder)().encode(new Uint8Array([
|
|
4722
|
+
99,
|
|
4723
|
+
114,
|
|
4724
|
+
101,
|
|
4725
|
+
97,
|
|
4726
|
+
116,
|
|
4727
|
+
111,
|
|
4728
|
+
114,
|
|
4729
|
+
95,
|
|
4730
|
+
102,
|
|
4731
|
+
101,
|
|
4732
|
+
101,
|
|
4733
|
+
95,
|
|
4734
|
+
99,
|
|
4735
|
+
111,
|
|
4736
|
+
110,
|
|
4737
|
+
102,
|
|
4738
|
+
105,
|
|
4739
|
+
103
|
|
4740
|
+
])),
|
|
4741
|
+
(0, _solana_kit.getAddressEncoder)().encode(seeds.baseMint),
|
|
4742
|
+
(0, _solana_kit.getAddressEncoder)().encode(seeds.quoteMint)
|
|
4743
|
+
]
|
|
4744
|
+
});
|
|
4745
|
+
}
|
|
4746
|
+
//#endregion
|
|
4635
4747
|
//#region src/launchpad/generated/pdas/eventAuthority.ts
|
|
4636
4748
|
const EVENT_AUTHORITY_PDA_ADDRESS$1 = "FJVebqCthxH6JM8vvkJb7yRYA7Emsib1C1vu4ZePSP3T";
|
|
4637
4749
|
function findEventAuthorityPda$1() {
|
|
@@ -4693,6 +4805,7 @@ var pdas_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
4693
4805
|
MIGRATION_AUTHORITY_PDA_ADDRESS: () => MIGRATION_AUTHORITY_PDA_ADDRESS,
|
|
4694
4806
|
WSOL_REWARD_ACCRUAL_PDA_ADDRESS: () => WSOL_REWARD_ACCRUAL_PDA_ADDRESS,
|
|
4695
4807
|
findBondingCurvePda: () => findBondingCurvePda,
|
|
4808
|
+
findCreatorFeeConfigPda: () => findCreatorFeeConfigPda,
|
|
4696
4809
|
findEventAuthorityPda: () => findEventAuthorityPda$1,
|
|
4697
4810
|
findGlobalConfigPda: () => findGlobalConfigPda$1,
|
|
4698
4811
|
findMigrationAuthorityPda: () => findMigrationAuthorityPda,
|
|
@@ -4700,83 +4813,6 @@ var pdas_exports$1 = /* @__PURE__ */ __exportAll({
|
|
|
4700
4813
|
findWsolRewardAccrualPda: () => findWsolRewardAccrualPda
|
|
4701
4814
|
});
|
|
4702
4815
|
//#endregion
|
|
4703
|
-
//#region src/utils/creator-hash.ts
|
|
4704
|
-
const MAX_CREATOR_PLATFORM_LEN = 32;
|
|
4705
|
-
/** Returns the SHA-256 of `creatorPlatform` and `creatorId`, each prefixed with its byte length as a
|
|
4706
|
-
* little-endian u32. Throws `RangeError` if `creatorPlatform` is more than 32 bytes. */
|
|
4707
|
-
async function creatorHashFromId(creatorPlatform, creatorId) {
|
|
4708
|
-
const encoder = new TextEncoder();
|
|
4709
|
-
const platformBuf = encoder.encode(creatorPlatform);
|
|
4710
|
-
const idBuf = encoder.encode(creatorId);
|
|
4711
|
-
if (platformBuf.length > MAX_CREATOR_PLATFORM_LEN) throw new RangeError(`creatorPlatform exceeds ${MAX_CREATOR_PLATFORM_LEN} bytes (got ${platformBuf.length})`);
|
|
4712
|
-
const platformLength = /* @__PURE__ */ new Uint8Array(4);
|
|
4713
|
-
new DataView(platformLength.buffer).setUint32(0, platformBuf.length, true);
|
|
4714
|
-
const idLength = /* @__PURE__ */ new Uint8Array(4);
|
|
4715
|
-
new DataView(idLength.buffer).setUint32(0, idBuf.length, true);
|
|
4716
|
-
const buf = new Uint8Array(4 + platformBuf.length + 4 + idBuf.length);
|
|
4717
|
-
buf.set(platformLength, 0);
|
|
4718
|
-
buf.set(platformBuf, 4);
|
|
4719
|
-
buf.set(idLength, 4 + platformBuf.length);
|
|
4720
|
-
buf.set(idBuf, 4 + platformBuf.length + 4);
|
|
4721
|
-
const hash = new Uint8Array(await crypto.subtle.digest("SHA-256", buf));
|
|
4722
|
-
return (0, _solana_kit.getAddressDecoder)().decode(hash);
|
|
4723
|
-
}
|
|
4724
|
-
/** Pads `text` with NUL bytes to `length` bytes, the form of `CreatorFeeConfig.platformId`.
|
|
4725
|
-
* Throws `RangeError` if `text` is longer. */
|
|
4726
|
-
function encodeCreatorId(text, length) {
|
|
4727
|
-
const bytes = new TextEncoder().encode(text);
|
|
4728
|
-
if (bytes.length > length) throw new RangeError(`text exceeds ${length} bytes (got ${bytes.length})`);
|
|
4729
|
-
const out = new Uint8Array(length);
|
|
4730
|
-
out.set(bytes, 0);
|
|
4731
|
-
return out;
|
|
4732
|
-
}
|
|
4733
|
-
/** Removes the trailing NUL bytes and decodes the rest as UTF-8. Pass the result, not the padded
|
|
4734
|
-
* bytes, to {@link creatorHashFromId}. */
|
|
4735
|
-
function decodeCreatorId(bytes) {
|
|
4736
|
-
let end = bytes.length;
|
|
4737
|
-
while (end > 0 && bytes[end - 1] === 0) end -= 1;
|
|
4738
|
-
return new TextDecoder().decode(bytes.slice(0, end));
|
|
4739
|
-
}
|
|
4740
|
-
//#endregion
|
|
4741
|
-
//#region src/nexus/generated/pdas/creatorFeeConfig.ts
|
|
4742
|
-
/**
|
|
4743
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
4744
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4745
|
-
* to add features, then rerun Codama to update it.
|
|
4746
|
-
*
|
|
4747
|
-
* @see https://github.com/codama-idl/codama
|
|
4748
|
-
*/
|
|
4749
|
-
async function findCreatorFeeConfigPda(seeds) {
|
|
4750
|
-
return await (0, _solana_kit.getProgramDerivedAddress)({
|
|
4751
|
-
programAddress: SEND_NEXUS_PROGRAM_ADDRESS,
|
|
4752
|
-
seeds: [
|
|
4753
|
-
(0, _solana_kit.getBytesEncoder)().encode(new Uint8Array([
|
|
4754
|
-
99,
|
|
4755
|
-
114,
|
|
4756
|
-
101,
|
|
4757
|
-
97,
|
|
4758
|
-
116,
|
|
4759
|
-
111,
|
|
4760
|
-
114,
|
|
4761
|
-
95,
|
|
4762
|
-
102,
|
|
4763
|
-
101,
|
|
4764
|
-
101,
|
|
4765
|
-
95,
|
|
4766
|
-
98,
|
|
4767
|
-
97,
|
|
4768
|
-
108,
|
|
4769
|
-
97,
|
|
4770
|
-
110,
|
|
4771
|
-
99,
|
|
4772
|
-
101
|
|
4773
|
-
])),
|
|
4774
|
-
(0, _solana_kit.getAddressEncoder)().encode(seeds.creatorHash),
|
|
4775
|
-
(0, _solana_kit.getAddressEncoder)().encode(seeds.quoteMint)
|
|
4776
|
-
]
|
|
4777
|
-
});
|
|
4778
|
-
}
|
|
4779
|
-
//#endregion
|
|
4780
4816
|
//#region src/launchpad/generated/instructions/createToken.ts
|
|
4781
4817
|
/**
|
|
4782
4818
|
* This code was AUTOGENERATED using the Codama library.
|
|
@@ -4802,12 +4838,12 @@ function getCreateTokenInstructionDataEncoder() {
|
|
|
4802
4838
|
return (0, _solana_kit.transformEncoder)((0, _solana_kit.getStructEncoder)([
|
|
4803
4839
|
["discriminator", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 8)],
|
|
4804
4840
|
["platformConfig", (0, _solana_kit.getAddressEncoder)()],
|
|
4805
|
-
["creatorPlatform", (0, _solana_kit.addEncoderSizePrefix)((0, _solana_kit.getUtf8Encoder)(), (0, _solana_kit.getU32Encoder)())],
|
|
4806
|
-
["creatorId", (0, _solana_kit.addEncoderSizePrefix)((0, _solana_kit.getUtf8Encoder)(), (0, _solana_kit.getU32Encoder)())],
|
|
4807
|
-
["creatorHash", (0, _solana_kit.getAddressEncoder)()],
|
|
4808
4841
|
["name", (0, _solana_kit.addEncoderSizePrefix)((0, _solana_kit.getUtf8Encoder)(), (0, _solana_kit.getU32Encoder)())],
|
|
4809
4842
|
["symbol", (0, _solana_kit.addEncoderSizePrefix)((0, _solana_kit.getUtf8Encoder)(), (0, _solana_kit.getU32Encoder)())],
|
|
4810
|
-
["uri", (0, _solana_kit.addEncoderSizePrefix)((0, _solana_kit.getUtf8Encoder)(), (0, _solana_kit.getU32Encoder)())]
|
|
4843
|
+
["uri", (0, _solana_kit.addEncoderSizePrefix)((0, _solana_kit.getUtf8Encoder)(), (0, _solana_kit.getU32Encoder)())],
|
|
4844
|
+
["creatorFeeMode", (0, _solana_kit.getU8Encoder)()],
|
|
4845
|
+
["creatorFeeBps", (0, _solana_kit.getU16Encoder)()],
|
|
4846
|
+
["dexCreatorFeeBps", (0, _solana_kit.getU16Encoder)()]
|
|
4811
4847
|
]), (value) => ({
|
|
4812
4848
|
...value,
|
|
4813
4849
|
discriminator: CREATE_TOKEN_DISCRIMINATOR
|
|
@@ -4817,12 +4853,12 @@ function getCreateTokenInstructionDataDecoder() {
|
|
|
4817
4853
|
return (0, _solana_kit.getStructDecoder)([
|
|
4818
4854
|
["discriminator", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(), 8)],
|
|
4819
4855
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
4820
|
-
["creatorPlatform", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
4821
|
-
["creatorId", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
4822
|
-
["creatorHash", (0, _solana_kit.getAddressDecoder)()],
|
|
4823
4856
|
["name", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
4824
4857
|
["symbol", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
4825
|
-
["uri", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())]
|
|
4858
|
+
["uri", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
4859
|
+
["creatorFeeMode", (0, _solana_kit.getU8Decoder)()],
|
|
4860
|
+
["creatorFeeBps", (0, _solana_kit.getU16Decoder)()],
|
|
4861
|
+
["dexCreatorFeeBps", (0, _solana_kit.getU16Decoder)()]
|
|
4826
4862
|
]);
|
|
4827
4863
|
}
|
|
4828
4864
|
function getCreateTokenInstructionDataCodec() {
|
|
@@ -4966,33 +5002,9 @@ async function getCreateTokenInstructionAsync(input) {
|
|
|
4966
5002
|
(0, _solana_kit.getAddressEncoder)().encode((0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("quoteMint", accounts.quoteMint.value))
|
|
4967
5003
|
]
|
|
4968
5004
|
});
|
|
4969
|
-
if (!accounts.creatorFeeConfig.value) accounts.creatorFeeConfig.value = await (
|
|
4970
|
-
|
|
4971
|
-
|
|
4972
|
-
(0, _solana_kit.getBytesEncoder)().encode(new Uint8Array([
|
|
4973
|
-
99,
|
|
4974
|
-
114,
|
|
4975
|
-
101,
|
|
4976
|
-
97,
|
|
4977
|
-
116,
|
|
4978
|
-
111,
|
|
4979
|
-
114,
|
|
4980
|
-
95,
|
|
4981
|
-
102,
|
|
4982
|
-
101,
|
|
4983
|
-
101,
|
|
4984
|
-
95,
|
|
4985
|
-
98,
|
|
4986
|
-
97,
|
|
4987
|
-
108,
|
|
4988
|
-
97,
|
|
4989
|
-
110,
|
|
4990
|
-
99,
|
|
4991
|
-
101
|
|
4992
|
-
])),
|
|
4993
|
-
(0, _solana_kit.getAddressEncoder)().encode((0, _solana_kit_program_client_core.getNonNullResolvedInstructionInput)("creatorHash", args.creatorHash)),
|
|
4994
|
-
(0, _solana_kit.getAddressEncoder)().encode((0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("quoteMint", accounts.quoteMint.value))
|
|
4995
|
-
]
|
|
5005
|
+
if (!accounts.creatorFeeConfig.value) accounts.creatorFeeConfig.value = await findCreatorFeeConfigPda({
|
|
5006
|
+
baseMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("baseMint", accounts.baseMint.value),
|
|
5007
|
+
quoteMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("quoteMint", accounts.quoteMint.value)
|
|
4996
5008
|
});
|
|
4997
5009
|
if (!accounts.nexusProgram.value) accounts.nexusProgram.value = "7rrCurqdWFesbzwtYPo95fM8waTtVXgXwCom45x1sfNX";
|
|
4998
5010
|
if (!accounts.nexusGlobalConfig.value) accounts.nexusGlobalConfig.value = "3bycfBeRULfXYqcg3DmiYFBjv6mMVidMuqKdFZJTGdNr";
|
|
@@ -6813,33 +6825,25 @@ var create_exports = /* @__PURE__ */ __exportAll({
|
|
|
6813
6825
|
buildCreateTokenInstruction: () => buildCreateTokenInstruction
|
|
6814
6826
|
});
|
|
6815
6827
|
async function buildCreateTokenInstruction(params) {
|
|
6816
|
-
return buildCreateTokenInstructionWithHash(params, await creatorHashFromId(params.creatorPlatform, params.creatorId));
|
|
6817
|
-
}
|
|
6818
|
-
async function buildCreateTokenInstructionWithHash(params, creatorHash) {
|
|
6819
|
-
const [creatorFeeConfig] = await findCreatorFeeConfigPda({
|
|
6820
|
-
creatorHash,
|
|
6821
|
-
quoteMint: params.quoteMint
|
|
6822
|
-
});
|
|
6823
6828
|
return getCreateTokenInstructionAsync({
|
|
6824
6829
|
user: params.user,
|
|
6825
6830
|
payer: params.payer ?? params.user,
|
|
6826
6831
|
coinCreator: params.coinCreator,
|
|
6827
6832
|
baseMint: params.baseMint,
|
|
6828
6833
|
quoteMint: params.quoteMint,
|
|
6829
|
-
creatorFeeConfig,
|
|
6830
6834
|
partner: params.partner,
|
|
6831
6835
|
platformConfig: params.platformConfig,
|
|
6832
6836
|
quoteTokenProgram: params.quoteTokenProgram,
|
|
6833
|
-
creatorPlatform: params.creatorPlatform,
|
|
6834
|
-
creatorId: params.creatorId,
|
|
6835
|
-
creatorHash,
|
|
6836
6837
|
name: params.name,
|
|
6837
6838
|
symbol: params.symbol,
|
|
6838
|
-
uri: params.uri
|
|
6839
|
+
uri: params.uri,
|
|
6840
|
+
creatorFeeMode: params.creatorFeeMode,
|
|
6841
|
+
creatorFeeBps: params.creatorFeeBps,
|
|
6842
|
+
dexCreatorFeeBps: params.dexCreatorFeeBps
|
|
6839
6843
|
});
|
|
6840
6844
|
}
|
|
6841
6845
|
async function buildCreateAndBuyInstructions(params) {
|
|
6842
|
-
const instructions = [await
|
|
6846
|
+
const instructions = [await buildCreateTokenInstruction(params)];
|
|
6843
6847
|
let quote;
|
|
6844
6848
|
if (params.buyQuoteAmount > 0n) {
|
|
6845
6849
|
const buyResult = await buyExactIn({
|
|
@@ -6923,7 +6927,7 @@ function getCompleteEventDecoder() {
|
|
|
6923
6927
|
["baseMint", (0, _solana_kit.getAddressDecoder)()],
|
|
6924
6928
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
6925
6929
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
6926
|
-
["
|
|
6930
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 4 })],
|
|
6927
6931
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
6928
6932
|
["curvePartner", (0, _solana_kit.getAddressDecoder)()],
|
|
6929
6933
|
["isPartner", (0, _solana_kit.getBooleanDecoder)()],
|
|
@@ -6995,7 +6999,7 @@ function getCreatorClaimEventDecoder() {
|
|
|
6995
6999
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
6996
7000
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
6997
7001
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
6998
|
-
["
|
|
7002
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 4 })],
|
|
6999
7003
|
["claimer", (0, _solana_kit.getAddressDecoder)()],
|
|
7000
7004
|
["destinationOwner", (0, _solana_kit.getAddressDecoder)()],
|
|
7001
7005
|
["amount", (0, _solana_kit.getU64Decoder)()],
|
|
@@ -7067,7 +7071,7 @@ function getMigrateEventDecoder() {
|
|
|
7067
7071
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
7068
7072
|
["pool", (0, _solana_kit.getAddressDecoder)()],
|
|
7069
7073
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
7070
|
-
["
|
|
7074
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 4 })],
|
|
7071
7075
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
7072
7076
|
["baseAmount", (0, _solana_kit.getU64Decoder)()],
|
|
7073
7077
|
["quoteAmount", (0, _solana_kit.getU64Decoder)()],
|
|
@@ -7280,9 +7284,7 @@ function getTokenCreateEventDecoder() {
|
|
|
7280
7284
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
7281
7285
|
["quoteDecimals", (0, _solana_kit.getU8Decoder)()],
|
|
7282
7286
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
7283
|
-
["
|
|
7284
|
-
["creatorId", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
7285
|
-
["creatorFeeConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
7287
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 5 })],
|
|
7286
7288
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
7287
7289
|
["name", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
7288
7290
|
["symbol", (0, _solana_kit.addDecoderSizePrefix)((0, _solana_kit.getUtf8Decoder)(), (0, _solana_kit.getU32Decoder)())],
|
|
@@ -7294,7 +7296,10 @@ function getTokenCreateEventDecoder() {
|
|
|
7294
7296
|
["virtualQuoteReserves", (0, _solana_kit.getU64Decoder)()],
|
|
7295
7297
|
["realBaseReserves", (0, _solana_kit.getU64Decoder)()],
|
|
7296
7298
|
["realQuoteReserves", (0, _solana_kit.getU64Decoder)()],
|
|
7297
|
-
["timestamp", (0, _solana_kit.getI64Decoder)()]
|
|
7299
|
+
["timestamp", (0, _solana_kit.getI64Decoder)()],
|
|
7300
|
+
["creatorFeeMode", (0, _solana_kit.getU8Decoder)()],
|
|
7301
|
+
["creatorFeeBps", (0, _solana_kit.getU16Decoder)()],
|
|
7302
|
+
["dexCreatorFeeBps", (0, _solana_kit.getU16Decoder)()]
|
|
7298
7303
|
]);
|
|
7299
7304
|
}
|
|
7300
7305
|
/**
|
|
@@ -7361,7 +7366,7 @@ function getTradeEventDecoder() {
|
|
|
7361
7366
|
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
7362
7367
|
["user", (0, _solana_kit.getAddressDecoder)()],
|
|
7363
7368
|
["coinCreator", (0, _solana_kit.getAddressDecoder)()],
|
|
7364
|
-
["
|
|
7369
|
+
["padding0", (0, _solana_kit.getArrayDecoder)((0, _solana_kit.getU64Decoder)(), { size: 4 })],
|
|
7365
7370
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
7366
7371
|
["baseAmount", (0, _solana_kit.getU64Decoder)()],
|
|
7367
7372
|
["quoteAmountGross", (0, _solana_kit.getU64Decoder)()],
|
|
@@ -7377,7 +7382,9 @@ function getTradeEventDecoder() {
|
|
|
7377
7382
|
["virtualQuoteReserves", (0, _solana_kit.getU64Decoder)()],
|
|
7378
7383
|
["realBaseReserves", (0, _solana_kit.getU64Decoder)()],
|
|
7379
7384
|
["realQuoteReserves", (0, _solana_kit.getU64Decoder)()],
|
|
7380
|
-
["timestamp", (0, _solana_kit.getI64Decoder)()]
|
|
7385
|
+
["timestamp", (0, _solana_kit.getI64Decoder)()],
|
|
7386
|
+
["creatorFeeMode", (0, _solana_kit.getU8Decoder)()],
|
|
7387
|
+
["creatorFeeBps", (0, _solana_kit.getU16Decoder)()]
|
|
7381
7388
|
]);
|
|
7382
7389
|
}
|
|
7383
7390
|
/**
|
|
@@ -7584,7 +7591,7 @@ async function getClaimCreatorFeesInstructionAsync(input) {
|
|
|
7584
7591
|
},
|
|
7585
7592
|
creatorFeeConfig: {
|
|
7586
7593
|
value: input.creatorFeeConfig ?? null,
|
|
7587
|
-
isWritable:
|
|
7594
|
+
isWritable: true
|
|
7588
7595
|
},
|
|
7589
7596
|
nexusGlobalConfig: {
|
|
7590
7597
|
value: null,
|
|
@@ -7635,6 +7642,10 @@ async function getClaimCreatorFeesInstructionAsync(input) {
|
|
|
7635
7642
|
baseMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("baseMint", accounts.baseMint.value),
|
|
7636
7643
|
quoteMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("quoteMint", accounts.quoteMint.value)
|
|
7637
7644
|
});
|
|
7645
|
+
if (!accounts.creatorFeeConfig.value) accounts.creatorFeeConfig.value = await findCreatorFeeConfigPda({
|
|
7646
|
+
baseMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("baseMint", accounts.baseMint.value),
|
|
7647
|
+
quoteMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("quoteMint", accounts.quoteMint.value)
|
|
7648
|
+
});
|
|
7638
7649
|
if (!accounts.nexusGlobalConfig.value) accounts.nexusGlobalConfig.value = "3bycfBeRULfXYqcg3DmiYFBjv6mMVidMuqKdFZJTGdNr";
|
|
7639
7650
|
if (!accounts.quoteVault.value) accounts.quoteVault.value = await (0, _solana_kit.getProgramDerivedAddress)({
|
|
7640
7651
|
programAddress: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL",
|
|
@@ -7696,7 +7707,7 @@ function getClaimCreatorFeesInstruction(input) {
|
|
|
7696
7707
|
},
|
|
7697
7708
|
creatorFeeConfig: {
|
|
7698
7709
|
value: input.creatorFeeConfig ?? null,
|
|
7699
|
-
isWritable:
|
|
7710
|
+
isWritable: true
|
|
7700
7711
|
},
|
|
7701
7712
|
nexusGlobalConfig: {
|
|
7702
7713
|
value: null,
|
|
@@ -8178,7 +8189,7 @@ async function getMigrateInstructionAsync(input) {
|
|
|
8178
8189
|
},
|
|
8179
8190
|
creatorFeeConfig: {
|
|
8180
8191
|
value: input.creatorFeeConfig ?? null,
|
|
8181
|
-
isWritable:
|
|
8192
|
+
isWritable: true
|
|
8182
8193
|
},
|
|
8183
8194
|
baseTokenProgram: {
|
|
8184
8195
|
value: null,
|
|
@@ -8203,6 +8214,10 @@ async function getMigrateInstructionAsync(input) {
|
|
|
8203
8214
|
program: {
|
|
8204
8215
|
value: null,
|
|
8205
8216
|
isWritable: false
|
|
8217
|
+
},
|
|
8218
|
+
dexCreatorFeeConfig: {
|
|
8219
|
+
value: input.dexCreatorFeeConfig ?? null,
|
|
8220
|
+
isWritable: true
|
|
8206
8221
|
}
|
|
8207
8222
|
};
|
|
8208
8223
|
if (!accounts.bondingCurve.value) accounts.bondingCurve.value = await findBondingCurvePda({
|
|
@@ -8258,11 +8273,42 @@ async function getMigrateInstructionAsync(input) {
|
|
|
8258
8273
|
});
|
|
8259
8274
|
if (!accounts.dexEventAuthority.value) accounts.dexEventAuthority.value = "4pTDYKRFdmxTQYFceGZkzPGd3kb8ShMA9n6XKRaPZn8t";
|
|
8260
8275
|
if (!accounts.nexusProgram.value) accounts.nexusProgram.value = "7rrCurqdWFesbzwtYPo95fM8waTtVXgXwCom45x1sfNX";
|
|
8276
|
+
if (!accounts.creatorFeeConfig.value) accounts.creatorFeeConfig.value = await findCreatorFeeConfigPda({
|
|
8277
|
+
baseMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("baseMint", accounts.baseMint.value),
|
|
8278
|
+
quoteMint: (0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("quoteMint", accounts.quoteMint.value)
|
|
8279
|
+
});
|
|
8261
8280
|
if (!accounts.baseTokenProgram.value) accounts.baseTokenProgram.value = "TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb";
|
|
8262
8281
|
if (!accounts.associatedTokenProgram.value) accounts.associatedTokenProgram.value = "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL";
|
|
8263
8282
|
if (!accounts.systemProgram.value) accounts.systemProgram.value = "11111111111111111111111111111111";
|
|
8264
8283
|
if (!accounts.eventAuthority.value) accounts.eventAuthority.value = EVENT_AUTHORITY_PDA_ADDRESS$1;
|
|
8265
8284
|
if (!accounts.program.value) accounts.program.value = "5R1uFyEE4oxqkm7hJDqHq6gXaLVF9dxeF3LF4yz1sfLP";
|
|
8285
|
+
if (!accounts.dexCreatorFeeConfig.value) accounts.dexCreatorFeeConfig.value = await (0, _solana_kit.getProgramDerivedAddress)({
|
|
8286
|
+
programAddress: "84qj5FPZZdXkQy8mfowyg6RBZ3XKuTds6XS4ZYT1sfDX",
|
|
8287
|
+
seeds: [
|
|
8288
|
+
(0, _solana_kit.getBytesEncoder)().encode(new Uint8Array([
|
|
8289
|
+
99,
|
|
8290
|
+
114,
|
|
8291
|
+
101,
|
|
8292
|
+
97,
|
|
8293
|
+
116,
|
|
8294
|
+
111,
|
|
8295
|
+
114,
|
|
8296
|
+
95,
|
|
8297
|
+
102,
|
|
8298
|
+
101,
|
|
8299
|
+
101,
|
|
8300
|
+
95,
|
|
8301
|
+
99,
|
|
8302
|
+
111,
|
|
8303
|
+
110,
|
|
8304
|
+
102,
|
|
8305
|
+
105,
|
|
8306
|
+
103
|
|
8307
|
+
])),
|
|
8308
|
+
(0, _solana_kit.getAddressEncoder)().encode((0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("baseMint", accounts.baseMint.value)),
|
|
8309
|
+
(0, _solana_kit.getAddressEncoder)().encode((0, _solana_kit_program_client_core.getAddressFromResolvedInstructionAccount)("quoteMint", accounts.quoteMint.value))
|
|
8310
|
+
]
|
|
8311
|
+
});
|
|
8266
8312
|
const getAccountMeta = (0, _solana_kit_program_client_core.getAccountMetaFactory)(programAddress, "programId");
|
|
8267
8313
|
return Object.freeze({
|
|
8268
8314
|
accounts: [
|
|
@@ -8287,7 +8333,8 @@ async function getMigrateInstructionAsync(input) {
|
|
|
8287
8333
|
getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
|
|
8288
8334
|
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
8289
8335
|
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
8290
|
-
getAccountMeta("program", accounts.program)
|
|
8336
|
+
getAccountMeta("program", accounts.program),
|
|
8337
|
+
getAccountMeta("dexCreatorFeeConfig", accounts.dexCreatorFeeConfig)
|
|
8291
8338
|
],
|
|
8292
8339
|
data: getMigrateInstructionDataEncoder().encode({}),
|
|
8293
8340
|
programAddress
|
|
@@ -8358,7 +8405,7 @@ function getMigrateInstruction(input) {
|
|
|
8358
8405
|
},
|
|
8359
8406
|
creatorFeeConfig: {
|
|
8360
8407
|
value: input.creatorFeeConfig ?? null,
|
|
8361
|
-
isWritable:
|
|
8408
|
+
isWritable: true
|
|
8362
8409
|
},
|
|
8363
8410
|
baseTokenProgram: {
|
|
8364
8411
|
value: null,
|
|
@@ -8383,6 +8430,10 @@ function getMigrateInstruction(input) {
|
|
|
8383
8430
|
program: {
|
|
8384
8431
|
value: null,
|
|
8385
8432
|
isWritable: false
|
|
8433
|
+
},
|
|
8434
|
+
dexCreatorFeeConfig: {
|
|
8435
|
+
value: input.dexCreatorFeeConfig ?? null,
|
|
8436
|
+
isWritable: true
|
|
8386
8437
|
}
|
|
8387
8438
|
};
|
|
8388
8439
|
if (!accounts.dexProgram.value) accounts.dexProgram.value = "84qj5FPZZdXkQy8mfowyg6RBZ3XKuTds6XS4ZYT1sfDX";
|
|
@@ -8418,7 +8469,8 @@ function getMigrateInstruction(input) {
|
|
|
8418
8469
|
getAccountMeta("associatedTokenProgram", accounts.associatedTokenProgram),
|
|
8419
8470
|
getAccountMeta("systemProgram", accounts.systemProgram),
|
|
8420
8471
|
getAccountMeta("eventAuthority", accounts.eventAuthority),
|
|
8421
|
-
getAccountMeta("program", accounts.program)
|
|
8472
|
+
getAccountMeta("program", accounts.program),
|
|
8473
|
+
getAccountMeta("dexCreatorFeeConfig", accounts.dexCreatorFeeConfig)
|
|
8422
8474
|
],
|
|
8423
8475
|
data: getMigrateInstructionDataEncoder().encode({}),
|
|
8424
8476
|
programAddress
|
|
@@ -8431,9 +8483,9 @@ function parseMigrateInstruction(instruction) {
|
|
|
8431
8483
|
error.name = "InstructionDiscriminatorMismatchError";
|
|
8432
8484
|
throw error;
|
|
8433
8485
|
}
|
|
8434
|
-
if (instruction.accounts.length <
|
|
8486
|
+
if (instruction.accounts.length < 23) throw new _solana_kit.SolanaError(_solana_kit.SOLANA_ERROR__PROGRAM_CLIENTS__INSUFFICIENT_ACCOUNT_METAS, {
|
|
8435
8487
|
actualAccountMetas: instruction.accounts.length,
|
|
8436
|
-
expectedAccountMetas:
|
|
8488
|
+
expectedAccountMetas: 23
|
|
8437
8489
|
});
|
|
8438
8490
|
let accountIndex = 0;
|
|
8439
8491
|
const getNextAccount = () => {
|
|
@@ -8465,7 +8517,8 @@ function parseMigrateInstruction(instruction) {
|
|
|
8465
8517
|
associatedTokenProgram: getNextAccount(),
|
|
8466
8518
|
systemProgram: getNextAccount(),
|
|
8467
8519
|
eventAuthority: getNextAccount(),
|
|
8468
|
-
program: getNextAccount()
|
|
8520
|
+
program: getNextAccount(),
|
|
8521
|
+
dexCreatorFeeConfig: getNextAccount()
|
|
8469
8522
|
},
|
|
8470
8523
|
data: getMigrateInstructionDataDecoder().decode(instruction.data)
|
|
8471
8524
|
};
|
|
@@ -8704,6 +8757,7 @@ function sendLaunchpadProgram() {
|
|
|
8704
8757
|
pdas: {
|
|
8705
8758
|
bondingCurve: findBondingCurvePda,
|
|
8706
8759
|
eventAuthority: findEventAuthorityPda$1,
|
|
8760
|
+
creatorFeeConfig: findCreatorFeeConfigPda,
|
|
8707
8761
|
rewardAccrual: findRewardAccrualPda,
|
|
8708
8762
|
globalConfig: findGlobalConfigPda$1,
|
|
8709
8763
|
wsolRewardAccrual: findWsolRewardAccrualPda,
|
|
@@ -8737,13 +8791,20 @@ async function findAssociatedTokenPda(wallet, mint, tokenProgram = TOKEN_PROGRAM
|
|
|
8737
8791
|
var migrate_exports = /* @__PURE__ */ __exportAll({ buildMigrateInstruction: () => buildMigrateInstruction });
|
|
8738
8792
|
async function buildMigrateInstruction(params) {
|
|
8739
8793
|
const { quoteTokenProgram } = params;
|
|
8740
|
-
const [[pool], [lpMint]] = await Promise.all([
|
|
8741
|
-
|
|
8742
|
-
|
|
8743
|
-
|
|
8744
|
-
|
|
8745
|
-
|
|
8746
|
-
|
|
8794
|
+
const [[pool], [lpMint], [dexCreatorFeeConfig]] = await Promise.all([
|
|
8795
|
+
findPoolPda({
|
|
8796
|
+
baseMint: params.baseMint,
|
|
8797
|
+
quoteMint: params.quoteMint
|
|
8798
|
+
}),
|
|
8799
|
+
findLpMintPda({
|
|
8800
|
+
baseMint: params.baseMint,
|
|
8801
|
+
quoteMint: params.quoteMint
|
|
8802
|
+
}),
|
|
8803
|
+
findCreatorFeeConfigPda$1({
|
|
8804
|
+
baseMint: params.baseMint,
|
|
8805
|
+
quoteMint: params.quoteMint
|
|
8806
|
+
})
|
|
8807
|
+
]);
|
|
8747
8808
|
const [[poolBaseVault], [poolQuoteVault], [poolLpAccount]] = await Promise.all([
|
|
8748
8809
|
findAssociatedTokenPda(pool, params.baseMint, TOKEN_2022_PROGRAM_ADDRESS),
|
|
8749
8810
|
findAssociatedTokenPda(pool, params.quoteMint, quoteTokenProgram),
|
|
@@ -8753,7 +8814,7 @@ async function buildMigrateInstruction(params) {
|
|
|
8753
8814
|
caller: params.caller,
|
|
8754
8815
|
baseMint: params.baseMint,
|
|
8755
8816
|
quoteMint: params.quoteMint,
|
|
8756
|
-
|
|
8817
|
+
dexCreatorFeeConfig,
|
|
8757
8818
|
poolBaseVault,
|
|
8758
8819
|
poolQuoteVault,
|
|
8759
8820
|
poolLpAccount,
|
|
@@ -8982,112 +9043,6 @@ function getAltRegistrySize() {
|
|
|
8982
9043
|
return 74;
|
|
8983
9044
|
}
|
|
8984
9045
|
//#endregion
|
|
8985
|
-
//#region src/nexus/generated/accounts/creatorFeeConfig.ts
|
|
8986
|
-
/**
|
|
8987
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
8988
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
8989
|
-
* to add features, then rerun Codama to update it.
|
|
8990
|
-
*
|
|
8991
|
-
* @see https://github.com/codama-idl/codama
|
|
8992
|
-
*/
|
|
8993
|
-
const CREATOR_FEE_CONFIG_DISCRIMINATOR = new Uint8Array([
|
|
8994
|
-
160,
|
|
8995
|
-
88,
|
|
8996
|
-
34,
|
|
8997
|
-
74,
|
|
8998
|
-
215,
|
|
8999
|
-
196,
|
|
9000
|
-
130,
|
|
9001
|
-
32
|
|
9002
|
-
]);
|
|
9003
|
-
function getCreatorFeeConfigDiscriminatorBytes() {
|
|
9004
|
-
return (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 8).encode(CREATOR_FEE_CONFIG_DISCRIMINATOR);
|
|
9005
|
-
}
|
|
9006
|
-
/** Gets the encoder for {@link CreatorFeeConfigArgs} account data. */
|
|
9007
|
-
function getCreatorFeeConfigEncoder() {
|
|
9008
|
-
return (0, _solana_kit.transformEncoder)((0, _solana_kit.getStructEncoder)([
|
|
9009
|
-
["discriminator", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 8)],
|
|
9010
|
-
["version", (0, _solana_kit.getU8Encoder)()],
|
|
9011
|
-
["bump", (0, _solana_kit.getU8Encoder)()],
|
|
9012
|
-
["platformIndex", (0, _solana_kit.getU8Encoder)()],
|
|
9013
|
-
["platformId", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 44)],
|
|
9014
|
-
["quoteMint", (0, _solana_kit.getAddressEncoder)()],
|
|
9015
|
-
["reserved", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 64)]
|
|
9016
|
-
]), (value) => ({
|
|
9017
|
-
...value,
|
|
9018
|
-
discriminator: CREATOR_FEE_CONFIG_DISCRIMINATOR
|
|
9019
|
-
}));
|
|
9020
|
-
}
|
|
9021
|
-
/** Gets the decoder for {@link CreatorFeeConfig} account data. */
|
|
9022
|
-
function getCreatorFeeConfigDecoder() {
|
|
9023
|
-
return (0, _solana_kit.getStructDecoder)([
|
|
9024
|
-
["discriminator", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(), 8)],
|
|
9025
|
-
["version", (0, _solana_kit.getU8Decoder)()],
|
|
9026
|
-
["bump", (0, _solana_kit.getU8Decoder)()],
|
|
9027
|
-
["platformIndex", (0, _solana_kit.getU8Decoder)()],
|
|
9028
|
-
["platformId", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(), 44)],
|
|
9029
|
-
["quoteMint", (0, _solana_kit.getAddressDecoder)()],
|
|
9030
|
-
["reserved", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(), 64)]
|
|
9031
|
-
]);
|
|
9032
|
-
}
|
|
9033
|
-
/** Gets the codec for {@link CreatorFeeConfig} account data. */
|
|
9034
|
-
function getCreatorFeeConfigCodec() {
|
|
9035
|
-
return (0, _solana_kit.combineCodec)(getCreatorFeeConfigEncoder(), getCreatorFeeConfigDecoder());
|
|
9036
|
-
}
|
|
9037
|
-
function decodeCreatorFeeConfig(encodedAccount) {
|
|
9038
|
-
if (!("exists" in encodedAccount) || encodedAccount.exists) {
|
|
9039
|
-
if (encodedAccount.programAddress !== "7rrCurqdWFesbzwtYPo95fM8waTtVXgXwCom45x1sfNX") {
|
|
9040
|
-
const error = /* @__PURE__ */ new Error(`decodeCreatorFeeConfig: account ${encodedAccount.address} is owned by ${encodedAccount.programAddress}, expected ${SEND_NEXUS_PROGRAM_ADDRESS}`);
|
|
9041
|
-
error.name = "AccountOwnerMismatchError";
|
|
9042
|
-
throw error;
|
|
9043
|
-
}
|
|
9044
|
-
if (!(0, _solana_kit.containsBytes)(encodedAccount.data, CREATOR_FEE_CONFIG_DISCRIMINATOR, 0)) {
|
|
9045
|
-
const error = /* @__PURE__ */ new Error(`decodeCreatorFeeConfig: account ${encodedAccount.address} does not match the CreatorFeeConfig discriminator`);
|
|
9046
|
-
error.name = "AccountDiscriminatorMismatchError";
|
|
9047
|
-
throw error;
|
|
9048
|
-
}
|
|
9049
|
-
}
|
|
9050
|
-
return (0, _solana_kit.decodeAccount)(encodedAccount, getCreatorFeeConfigDecoder());
|
|
9051
|
-
}
|
|
9052
|
-
/** Fetches a `CreatorFeeConfig` account, throwing when it does not exist or only holds lamports. */
|
|
9053
|
-
async function fetchCreatorFeeConfig(rpc, address, config) {
|
|
9054
|
-
const maybeAccount = await fetchMaybeCreatorFeeConfig(rpc, address, config);
|
|
9055
|
-
(0, _solana_kit.assertAccountExists)(maybeAccount);
|
|
9056
|
-
return maybeAccount;
|
|
9057
|
-
}
|
|
9058
|
-
/**
|
|
9059
|
-
* Fetches a `CreatorFeeConfig` account, or the non-existing variant when the address holds no
|
|
9060
|
-
* account or only lamports (see {@link accountIsCreated}).
|
|
9061
|
-
* {@link decodeCreatorFeeConfig} throws for a lamports-only account instead.
|
|
9062
|
-
*/
|
|
9063
|
-
async function fetchMaybeCreatorFeeConfig(rpc, address, config) {
|
|
9064
|
-
const maybeAccount = await (0, _solana_kit.fetchEncodedAccount)(rpc, address, config);
|
|
9065
|
-
return decodeCreatorFeeConfig(accountIsCreated(maybeAccount) ? maybeAccount : {
|
|
9066
|
-
address,
|
|
9067
|
-
exists: false
|
|
9068
|
-
});
|
|
9069
|
-
}
|
|
9070
|
-
/** Fetches `CreatorFeeConfig` accounts, throwing when any does not exist or only holds lamports. */
|
|
9071
|
-
async function fetchAllCreatorFeeConfig(rpc, addresses, config) {
|
|
9072
|
-
const maybeAccounts = await fetchAllMaybeCreatorFeeConfig(rpc, addresses, config);
|
|
9073
|
-
(0, _solana_kit.assertAccountsExist)(maybeAccounts);
|
|
9074
|
-
return maybeAccounts;
|
|
9075
|
-
}
|
|
9076
|
-
/**
|
|
9077
|
-
* Fetches `CreatorFeeConfig` accounts, with the non-existing variant for each address that holds
|
|
9078
|
-
* no account or only lamports (see {@link accountIsCreated}).
|
|
9079
|
-
* {@link decodeCreatorFeeConfig} throws for a lamports-only account instead.
|
|
9080
|
-
*/
|
|
9081
|
-
async function fetchAllMaybeCreatorFeeConfig(rpc, addresses, config) {
|
|
9082
|
-
return (await (0, _solana_kit.fetchEncodedAccounts)(rpc, addresses, config)).map((maybeAccount) => decodeCreatorFeeConfig(accountIsCreated(maybeAccount) ? maybeAccount : {
|
|
9083
|
-
address: maybeAccount.address,
|
|
9084
|
-
exists: false
|
|
9085
|
-
}));
|
|
9086
|
-
}
|
|
9087
|
-
function getCreatorFeeConfigSize() {
|
|
9088
|
-
return 151;
|
|
9089
|
-
}
|
|
9090
|
-
//#endregion
|
|
9091
9046
|
//#region src/nexus/generated/types/authPlatformEntry.ts
|
|
9092
9047
|
/**
|
|
9093
9048
|
* This code was AUTOGENERATED using the Codama library.
|
|
@@ -9106,29 +9061,6 @@ function getAuthPlatformEntryCodec() {
|
|
|
9106
9061
|
return (0, _solana_kit.combineCodec)(getAuthPlatformEntryEncoder(), getAuthPlatformEntryDecoder());
|
|
9107
9062
|
}
|
|
9108
9063
|
//#endregion
|
|
9109
|
-
//#region src/nexus/generated/types/callerType.ts
|
|
9110
|
-
/**
|
|
9111
|
-
* This code was AUTOGENERATED using the Codama library.
|
|
9112
|
-
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
9113
|
-
* to add features, then rerun Codama to update it.
|
|
9114
|
-
*
|
|
9115
|
-
* @see https://github.com/codama-idl/codama
|
|
9116
|
-
*/
|
|
9117
|
-
let CallerType = /* @__PURE__ */ function(CallerType) {
|
|
9118
|
-
CallerType[CallerType["PlatformBondingCurve"] = 0] = "PlatformBondingCurve";
|
|
9119
|
-
CallerType[CallerType["PlatformPool"] = 1] = "PlatformPool";
|
|
9120
|
-
return CallerType;
|
|
9121
|
-
}({});
|
|
9122
|
-
function getCallerTypeEncoder() {
|
|
9123
|
-
return (0, _solana_kit.getEnumEncoder)(CallerType);
|
|
9124
|
-
}
|
|
9125
|
-
function getCallerTypeDecoder() {
|
|
9126
|
-
return (0, _solana_kit.getEnumDecoder)(CallerType);
|
|
9127
|
-
}
|
|
9128
|
-
function getCallerTypeCodec() {
|
|
9129
|
-
return (0, _solana_kit.combineCodec)(getCallerTypeEncoder(), getCallerTypeDecoder());
|
|
9130
|
-
}
|
|
9131
|
-
//#endregion
|
|
9132
9064
|
//#region src/nexus/generated/types/dexFees.ts
|
|
9133
9065
|
/**
|
|
9134
9066
|
* This code was AUTOGENERATED using the Codama library.
|
|
@@ -9142,7 +9074,7 @@ function getDexFeesEncoder() {
|
|
|
9142
9074
|
["creationFeeCents", (0, _solana_kit.getU64Encoder)()],
|
|
9143
9075
|
["protocolFeeBps", (0, _solana_kit.getU16Encoder)()],
|
|
9144
9076
|
["lpFeeBps", (0, _solana_kit.getU16Encoder)()],
|
|
9145
|
-
["
|
|
9077
|
+
["maxCreatorFeeBps", (0, _solana_kit.getU16Encoder)()],
|
|
9146
9078
|
["feeDecaySeconds", (0, _solana_kit.getU16Encoder)()],
|
|
9147
9079
|
["feeDecayStartBps", (0, _solana_kit.getU16Encoder)()]
|
|
9148
9080
|
]);
|
|
@@ -9152,7 +9084,7 @@ function getDexFeesDecoder() {
|
|
|
9152
9084
|
["creationFeeCents", (0, _solana_kit.getU64Decoder)()],
|
|
9153
9085
|
["protocolFeeBps", (0, _solana_kit.getU16Decoder)()],
|
|
9154
9086
|
["lpFeeBps", (0, _solana_kit.getU16Decoder)()],
|
|
9155
|
-
["
|
|
9087
|
+
["maxCreatorFeeBps", (0, _solana_kit.getU16Decoder)()],
|
|
9156
9088
|
["feeDecaySeconds", (0, _solana_kit.getU16Decoder)()],
|
|
9157
9089
|
["feeDecayStartBps", (0, _solana_kit.getU16Decoder)()]
|
|
9158
9090
|
]);
|
|
@@ -9201,7 +9133,7 @@ function getLaunchpadFeesEncoder() {
|
|
|
9201
9133
|
return (0, _solana_kit.getStructEncoder)([
|
|
9202
9134
|
["creationFeeCents", (0, _solana_kit.getU64Encoder)()],
|
|
9203
9135
|
["protocolFeeBps", (0, _solana_kit.getU16Encoder)()],
|
|
9204
|
-
["
|
|
9136
|
+
["maxCreatorFeeBps", (0, _solana_kit.getU16Encoder)()],
|
|
9205
9137
|
["feeDecaySeconds", (0, _solana_kit.getU16Encoder)()],
|
|
9206
9138
|
["feeDecayStartBps", (0, _solana_kit.getU16Encoder)()]
|
|
9207
9139
|
]);
|
|
@@ -9210,7 +9142,7 @@ function getLaunchpadFeesDecoder() {
|
|
|
9210
9142
|
return (0, _solana_kit.getStructDecoder)([
|
|
9211
9143
|
["creationFeeCents", (0, _solana_kit.getU64Decoder)()],
|
|
9212
9144
|
["protocolFeeBps", (0, _solana_kit.getU16Decoder)()],
|
|
9213
|
-
["
|
|
9145
|
+
["maxCreatorFeeBps", (0, _solana_kit.getU16Decoder)()],
|
|
9214
9146
|
["feeDecaySeconds", (0, _solana_kit.getU16Decoder)()],
|
|
9215
9147
|
["feeDecayStartBps", (0, _solana_kit.getU16Decoder)()]
|
|
9216
9148
|
]);
|
|
@@ -9221,13 +9153,9 @@ function getLaunchpadFeesCodec() {
|
|
|
9221
9153
|
//#endregion
|
|
9222
9154
|
//#region src/nexus/generated/types/index.ts
|
|
9223
9155
|
var types_exports = /* @__PURE__ */ __exportAll({
|
|
9224
|
-
CallerType: () => CallerType,
|
|
9225
9156
|
getAuthPlatformEntryCodec: () => getAuthPlatformEntryCodec,
|
|
9226
9157
|
getAuthPlatformEntryDecoder: () => getAuthPlatformEntryDecoder,
|
|
9227
9158
|
getAuthPlatformEntryEncoder: () => getAuthPlatformEntryEncoder,
|
|
9228
|
-
getCallerTypeCodec: () => getCallerTypeCodec,
|
|
9229
|
-
getCallerTypeDecoder: () => getCallerTypeDecoder,
|
|
9230
|
-
getCallerTypeEncoder: () => getCallerTypeEncoder,
|
|
9231
9159
|
getDexFeesCodec: () => getDexFeesCodec,
|
|
9232
9160
|
getDexFeesDecoder: () => getDexFeesDecoder,
|
|
9233
9161
|
getDexFeesEncoder: () => getDexFeesEncoder,
|
|
@@ -9271,7 +9199,7 @@ function getFeePresetEncoder() {
|
|
|
9271
9199
|
["launchpad", getLaunchpadFeesEncoder()],
|
|
9272
9200
|
["dex", getDexFeesEncoder()],
|
|
9273
9201
|
["platformConfig", (0, _solana_kit.getAddressEncoder)()],
|
|
9274
|
-
["reserved", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(),
|
|
9202
|
+
["reserved", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 64)]
|
|
9275
9203
|
]), (value) => ({
|
|
9276
9204
|
...value,
|
|
9277
9205
|
discriminator: FEE_PRESET_DISCRIMINATOR
|
|
@@ -9288,7 +9216,7 @@ function getFeePresetDecoder() {
|
|
|
9288
9216
|
["launchpad", getLaunchpadFeesDecoder()],
|
|
9289
9217
|
["dex", getDexFeesDecoder()],
|
|
9290
9218
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
9291
|
-
["reserved", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(),
|
|
9219
|
+
["reserved", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(), 64)]
|
|
9292
9220
|
]);
|
|
9293
9221
|
}
|
|
9294
9222
|
/** Gets the codec for {@link FeePreset} account data. */
|
|
@@ -9482,7 +9410,8 @@ function getPartnerConfigEncoder() {
|
|
|
9482
9410
|
["launchpad", getLaunchpadFeesEncoder()],
|
|
9483
9411
|
["dex", getDexFeesEncoder()],
|
|
9484
9412
|
["platformConfig", (0, _solana_kit.getAddressEncoder)()],
|
|
9485
|
-
["
|
|
9413
|
+
["allowedCreatorFeeModes", (0, _solana_kit.getU16Encoder)()],
|
|
9414
|
+
["reserved", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 256)]
|
|
9486
9415
|
]), (value) => ({
|
|
9487
9416
|
...value,
|
|
9488
9417
|
discriminator: PARTNER_CONFIG_DISCRIMINATOR
|
|
@@ -9500,7 +9429,8 @@ function getPartnerConfigDecoder() {
|
|
|
9500
9429
|
["launchpad", getLaunchpadFeesDecoder()],
|
|
9501
9430
|
["dex", getDexFeesDecoder()],
|
|
9502
9431
|
["platformConfig", (0, _solana_kit.getAddressDecoder)()],
|
|
9503
|
-
["
|
|
9432
|
+
["allowedCreatorFeeModes", (0, _solana_kit.getU16Decoder)()],
|
|
9433
|
+
["reserved", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(), 256)]
|
|
9504
9434
|
]);
|
|
9505
9435
|
}
|
|
9506
9436
|
/** Gets the codec for {@link PartnerConfig} account data. */
|
|
@@ -9558,7 +9488,7 @@ async function fetchAllMaybePartnerConfig(rpc, addresses, config) {
|
|
|
9558
9488
|
}));
|
|
9559
9489
|
}
|
|
9560
9490
|
function getPartnerConfigSize() {
|
|
9561
|
-
return
|
|
9491
|
+
return 399;
|
|
9562
9492
|
}
|
|
9563
9493
|
//#endregion
|
|
9564
9494
|
//#region src/nexus/generated/accounts/partnerMetadata.ts
|
|
@@ -9929,7 +9859,7 @@ function getUserRewardDebtEncoder() {
|
|
|
9929
9859
|
["amountSnapshot", (0, _solana_kit.getU64Encoder)()],
|
|
9930
9860
|
["settledVersion", (0, _solana_kit.getU32Encoder)()],
|
|
9931
9861
|
["owed", (0, _solana_kit.getU64Encoder)()],
|
|
9932
|
-
["reserved", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(),
|
|
9862
|
+
["reserved", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 64)]
|
|
9933
9863
|
]), (value) => ({
|
|
9934
9864
|
...value,
|
|
9935
9865
|
discriminator: USER_REWARD_DEBT_DISCRIMINATOR
|
|
@@ -9949,7 +9879,7 @@ function getUserRewardDebtDecoder() {
|
|
|
9949
9879
|
["amountSnapshot", (0, _solana_kit.getU64Decoder)()],
|
|
9950
9880
|
["settledVersion", (0, _solana_kit.getU32Decoder)()],
|
|
9951
9881
|
["owed", (0, _solana_kit.getU64Decoder)()],
|
|
9952
|
-
["reserved", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(),
|
|
9882
|
+
["reserved", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(), 64)]
|
|
9953
9883
|
]);
|
|
9954
9884
|
}
|
|
9955
9885
|
/** Gets the codec for {@link UserRewardDebt} account data. */
|
|
@@ -10007,7 +9937,7 @@ async function fetchAllMaybeUserRewardDebt(rpc, addresses, config) {
|
|
|
10007
9937
|
}));
|
|
10008
9938
|
}
|
|
10009
9939
|
function getUserRewardDebtSize() {
|
|
10010
|
-
return
|
|
9940
|
+
return 214;
|
|
10011
9941
|
}
|
|
10012
9942
|
//#endregion
|
|
10013
9943
|
//#region src/nexus/generated/accounts/userStakePosition.ts
|
|
@@ -10042,7 +9972,7 @@ function getUserStakePositionEncoder() {
|
|
|
10042
9972
|
["amount", (0, _solana_kit.getU64Encoder)()],
|
|
10043
9973
|
["stakeVersion", (0, _solana_kit.getU32Encoder)()],
|
|
10044
9974
|
["settledCount", (0, _solana_kit.getU16Encoder)()],
|
|
10045
|
-
["reserved", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(),
|
|
9975
|
+
["reserved", (0, _solana_kit.fixEncoderSize)((0, _solana_kit.getBytesEncoder)(), 128)]
|
|
10046
9976
|
]), (value) => ({
|
|
10047
9977
|
...value,
|
|
10048
9978
|
discriminator: USER_STAKE_POSITION_DISCRIMINATOR
|
|
@@ -10059,7 +9989,7 @@ function getUserStakePositionDecoder() {
|
|
|
10059
9989
|
["amount", (0, _solana_kit.getU64Decoder)()],
|
|
10060
9990
|
["stakeVersion", (0, _solana_kit.getU32Decoder)()],
|
|
10061
9991
|
["settledCount", (0, _solana_kit.getU16Decoder)()],
|
|
10062
|
-
["reserved", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(),
|
|
9992
|
+
["reserved", (0, _solana_kit.fixDecoderSize)((0, _solana_kit.getBytesDecoder)(), 128)]
|
|
10063
9993
|
]);
|
|
10064
9994
|
}
|
|
10065
9995
|
/** Gets the codec for {@link UserStakePosition} account data. */
|
|
@@ -10117,7 +10047,7 @@ async function fetchAllMaybeUserStakePosition(rpc, addresses, config) {
|
|
|
10117
10047
|
}));
|
|
10118
10048
|
}
|
|
10119
10049
|
function getUserStakePositionSize() {
|
|
10120
|
-
return
|
|
10050
|
+
return 216;
|
|
10121
10051
|
}
|
|
10122
10052
|
//#endregion
|
|
10123
10053
|
//#region src/nexus/generated/accounts/sendNexus.accounts.ts
|
|
@@ -10136,7 +10066,6 @@ function identifySendNexusAccount(account) {
|
|
|
10136
10066
|
if ("data" in account && account.programAddress !== "7rrCurqdWFesbzwtYPo95fM8waTtVXgXwCom45x1sfNX") return null;
|
|
10137
10067
|
const data = "data" in account ? account.data : account;
|
|
10138
10068
|
if ((0, _solana_kit.containsBytes)(data, ALT_REGISTRY_DISCRIMINATOR, 0)) return "altRegistry";
|
|
10139
|
-
if ((0, _solana_kit.containsBytes)(data, CREATOR_FEE_CONFIG_DISCRIMINATOR, 0)) return "creatorFeeConfig";
|
|
10140
10069
|
if ((0, _solana_kit.containsBytes)(data, FEE_PRESET_DISCRIMINATOR, 0)) return "feePreset";
|
|
10141
10070
|
if ((0, _solana_kit.containsBytes)(data, GLOBAL_CONFIG_DISCRIMINATOR, 0)) return "globalConfig";
|
|
10142
10071
|
if ((0, _solana_kit.containsBytes)(data, PARTNER_CONFIG_DISCRIMINATOR, 0)) return "partnerConfig";
|
|
@@ -10151,7 +10080,6 @@ function identifySendNexusAccount(account) {
|
|
|
10151
10080
|
//#region src/nexus/generated/accounts/index.ts
|
|
10152
10081
|
var accounts_exports = /* @__PURE__ */ __exportAll({
|
|
10153
10082
|
ALT_REGISTRY_DISCRIMINATOR: () => ALT_REGISTRY_DISCRIMINATOR,
|
|
10154
|
-
CREATOR_FEE_CONFIG_DISCRIMINATOR: () => CREATOR_FEE_CONFIG_DISCRIMINATOR,
|
|
10155
10083
|
FEE_PRESET_DISCRIMINATOR: () => FEE_PRESET_DISCRIMINATOR,
|
|
10156
10084
|
GLOBAL_CONFIG_DISCRIMINATOR: () => GLOBAL_CONFIG_DISCRIMINATOR,
|
|
10157
10085
|
PARTNER_CONFIG_DISCRIMINATOR: () => PARTNER_CONFIG_DISCRIMINATOR,
|
|
@@ -10161,7 +10089,6 @@ var accounts_exports = /* @__PURE__ */ __exportAll({
|
|
|
10161
10089
|
USER_REWARD_DEBT_DISCRIMINATOR: () => USER_REWARD_DEBT_DISCRIMINATOR,
|
|
10162
10090
|
USER_STAKE_POSITION_DISCRIMINATOR: () => USER_STAKE_POSITION_DISCRIMINATOR,
|
|
10163
10091
|
decodeAltRegistry: () => decodeAltRegistry,
|
|
10164
|
-
decodeCreatorFeeConfig: () => decodeCreatorFeeConfig,
|
|
10165
10092
|
decodeFeePreset: () => decodeFeePreset,
|
|
10166
10093
|
decodeGlobalConfig: () => decodeGlobalConfig,
|
|
10167
10094
|
decodePartnerConfig: () => decodePartnerConfig,
|
|
@@ -10171,11 +10098,9 @@ var accounts_exports = /* @__PURE__ */ __exportAll({
|
|
|
10171
10098
|
decodeUserRewardDebt: () => decodeUserRewardDebt,
|
|
10172
10099
|
decodeUserStakePosition: () => decodeUserStakePosition,
|
|
10173
10100
|
fetchAllAltRegistry: () => fetchAllAltRegistry,
|
|
10174
|
-
fetchAllCreatorFeeConfig: () => fetchAllCreatorFeeConfig,
|
|
10175
10101
|
fetchAllFeePreset: () => fetchAllFeePreset,
|
|
10176
10102
|
fetchAllGlobalConfig: () => fetchAllGlobalConfig,
|
|
10177
10103
|
fetchAllMaybeAltRegistry: () => fetchAllMaybeAltRegistry,
|
|
10178
|
-
fetchAllMaybeCreatorFeeConfig: () => fetchAllMaybeCreatorFeeConfig,
|
|
10179
10104
|
fetchAllMaybeFeePreset: () => fetchAllMaybeFeePreset,
|
|
10180
10105
|
fetchAllMaybeGlobalConfig: () => fetchAllMaybeGlobalConfig,
|
|
10181
10106
|
fetchAllMaybePartnerConfig: () => fetchAllMaybePartnerConfig,
|
|
@@ -10191,11 +10116,9 @@ var accounts_exports = /* @__PURE__ */ __exportAll({
|
|
|
10191
10116
|
fetchAllUserRewardDebt: () => fetchAllUserRewardDebt,
|
|
10192
10117
|
fetchAllUserStakePosition: () => fetchAllUserStakePosition,
|
|
10193
10118
|
fetchAltRegistry: () => fetchAltRegistry,
|
|
10194
|
-
fetchCreatorFeeConfig: () => fetchCreatorFeeConfig,
|
|
10195
10119
|
fetchFeePreset: () => fetchFeePreset,
|
|
10196
10120
|
fetchGlobalConfig: () => fetchGlobalConfig,
|
|
10197
10121
|
fetchMaybeAltRegistry: () => fetchMaybeAltRegistry,
|
|
10198
|
-
fetchMaybeCreatorFeeConfig: () => fetchMaybeCreatorFeeConfig,
|
|
10199
10122
|
fetchMaybeFeePreset: () => fetchMaybeFeePreset,
|
|
10200
10123
|
fetchMaybeGlobalConfig: () => fetchMaybeGlobalConfig,
|
|
10201
10124
|
fetchMaybePartnerConfig: () => fetchMaybePartnerConfig,
|
|
@@ -10215,11 +10138,6 @@ var accounts_exports = /* @__PURE__ */ __exportAll({
|
|
|
10215
10138
|
getAltRegistryDiscriminatorBytes: () => getAltRegistryDiscriminatorBytes,
|
|
10216
10139
|
getAltRegistryEncoder: () => getAltRegistryEncoder,
|
|
10217
10140
|
getAltRegistrySize: () => getAltRegistrySize,
|
|
10218
|
-
getCreatorFeeConfigCodec: () => getCreatorFeeConfigCodec,
|
|
10219
|
-
getCreatorFeeConfigDecoder: () => getCreatorFeeConfigDecoder,
|
|
10220
|
-
getCreatorFeeConfigDiscriminatorBytes: () => getCreatorFeeConfigDiscriminatorBytes,
|
|
10221
|
-
getCreatorFeeConfigEncoder: () => getCreatorFeeConfigEncoder,
|
|
10222
|
-
getCreatorFeeConfigSize: () => getCreatorFeeConfigSize,
|
|
10223
10141
|
getFeePresetCodec: () => getFeePresetCodec,
|
|
10224
10142
|
getFeePresetDecoder: () => getFeePresetDecoder,
|
|
10225
10143
|
getFeePresetDiscriminatorBytes: () => getFeePresetDiscriminatorBytes,
|
|
@@ -10657,12 +10575,16 @@ const SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT = 7009;
|
|
|
10657
10575
|
const SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY = 7010;
|
|
10658
10576
|
/** NothingToClaim: Nothing to claim */
|
|
10659
10577
|
const SEND_NEXUS_ERROR__NOTHING_TO_CLAIM = 7011;
|
|
10660
|
-
/**
|
|
10661
|
-
const
|
|
10578
|
+
/** Unused7012: Unused */
|
|
10579
|
+
const SEND_NEXUS_ERROR__UNUSED7012 = 7012;
|
|
10662
10580
|
/** QuoteMintPriceUnset: Quote mint has no USDC price on its nexus reward state */
|
|
10663
10581
|
const SEND_NEXUS_ERROR__QUOTE_MINT_PRICE_UNSET = 7013;
|
|
10664
10582
|
/** TransferFeeNotSettleable: Token-2022 transfer fee schedule cannot settle the exact amount */
|
|
10665
10583
|
const SEND_NEXUS_ERROR__TRANSFER_FEE_NOT_SETTLEABLE = 7014;
|
|
10584
|
+
/** CreatorFeeTooHigh: Creator fee exceeds the partner's maximum */
|
|
10585
|
+
const SEND_NEXUS_ERROR__CREATOR_FEE_TOO_HIGH = 7015;
|
|
10586
|
+
/** CreatorFeeModeNotAllowed: Creator fee mode is not allowed by the partner config */
|
|
10587
|
+
const SEND_NEXUS_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED = 7016;
|
|
10666
10588
|
/** InsufficientLiquidity: Insufficient liquidity */
|
|
10667
10589
|
const SEND_NEXUS_ERROR__INSUFFICIENT_LIQUIDITY = 7100;
|
|
10668
10590
|
/** InvalidAmount: Invalid amount */
|
|
@@ -10670,6 +10592,8 @@ const SEND_NEXUS_ERROR__INVALID_AMOUNT = 7101;
|
|
|
10670
10592
|
const sendNexusErrorMessages = {
|
|
10671
10593
|
[SEND_NEXUS_ERROR__AMBIGUOUS_FEE_SOURCE]: `Cannot specify both fee_preset and custom_fees`,
|
|
10672
10594
|
[SEND_NEXUS_ERROR__ARITHMETIC_OVERFLOW]: `Arithmetic overflow`,
|
|
10595
|
+
[SEND_NEXUS_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED]: `Creator fee mode is not allowed by the partner config`,
|
|
10596
|
+
[SEND_NEXUS_ERROR__CREATOR_FEE_TOO_HIGH]: `Creator fee exceeds the partner's maximum`,
|
|
10673
10597
|
[SEND_NEXUS_ERROR__DUPLICATE_AUTH_PLATFORM_NAME]: `Duplicate auth platform name`,
|
|
10674
10598
|
[SEND_NEXUS_ERROR__INSUFFICIENT_LIQUIDITY]: `Insufficient liquidity`,
|
|
10675
10599
|
[SEND_NEXUS_ERROR__INSUFFICIENT_STAKE]: `Insufficient stake balance`,
|
|
@@ -10677,7 +10601,6 @@ const sendNexusErrorMessages = {
|
|
|
10677
10601
|
[SEND_NEXUS_ERROR__INVALID_AUTHORITY]: `Invalid authority`,
|
|
10678
10602
|
[SEND_NEXUS_ERROR__INVALID_AUTH_PLATFORM_INDEX]: `Invalid auth platform index`,
|
|
10679
10603
|
[SEND_NEXUS_ERROR__INVALID_AUTH_PLATFORM_NAME]: `Invalid auth platform name`,
|
|
10680
|
-
[SEND_NEXUS_ERROR__INVALID_CREATOR_ID]: `Creator identity is not a decodable wallet address`,
|
|
10681
10604
|
[SEND_NEXUS_ERROR__INVALID_DESTINATION]: `Invalid destination account`,
|
|
10682
10605
|
[SEND_NEXUS_ERROR__INVALID_FEE_PRESET]: `Invalid fee configuration`,
|
|
10683
10606
|
[SEND_NEXUS_ERROR__INVALID_MINT]: `Invalid mint`,
|
|
@@ -10711,6 +10634,7 @@ const sendNexusErrorMessages = {
|
|
|
10711
10634
|
[SEND_NEXUS_ERROR__TOO_MANY_AUTH_PLATFORMS]: `Too many auth platforms (max 255)`,
|
|
10712
10635
|
[SEND_NEXUS_ERROR__TRANSFER_FEE_NOT_SETTLEABLE]: `Token-2022 transfer fee schedule cannot settle the exact amount`,
|
|
10713
10636
|
[SEND_NEXUS_ERROR__UNAUTHORIZED]: `Unauthorized`,
|
|
10637
|
+
[SEND_NEXUS_ERROR__UNUSED7012]: `Unused`,
|
|
10714
10638
|
[SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_INVALID]: `User token account is not an initialized token account`,
|
|
10715
10639
|
[SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY]: `User token account is not owned by the trading user`,
|
|
10716
10640
|
[SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT]: `User token account mint does not match the trade`,
|
|
@@ -10727,6 +10651,8 @@ function isSendNexusError(error, transactionMessage, code) {
|
|
|
10727
10651
|
var errors_exports = /* @__PURE__ */ __exportAll({
|
|
10728
10652
|
SEND_NEXUS_ERROR__AMBIGUOUS_FEE_SOURCE: () => SEND_NEXUS_ERROR__AMBIGUOUS_FEE_SOURCE,
|
|
10729
10653
|
SEND_NEXUS_ERROR__ARITHMETIC_OVERFLOW: () => SEND_NEXUS_ERROR__ARITHMETIC_OVERFLOW,
|
|
10654
|
+
SEND_NEXUS_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED: () => SEND_NEXUS_ERROR__CREATOR_FEE_MODE_NOT_ALLOWED,
|
|
10655
|
+
SEND_NEXUS_ERROR__CREATOR_FEE_TOO_HIGH: () => SEND_NEXUS_ERROR__CREATOR_FEE_TOO_HIGH,
|
|
10730
10656
|
SEND_NEXUS_ERROR__DUPLICATE_AUTH_PLATFORM_NAME: () => SEND_NEXUS_ERROR__DUPLICATE_AUTH_PLATFORM_NAME,
|
|
10731
10657
|
SEND_NEXUS_ERROR__INSUFFICIENT_LIQUIDITY: () => SEND_NEXUS_ERROR__INSUFFICIENT_LIQUIDITY,
|
|
10732
10658
|
SEND_NEXUS_ERROR__INSUFFICIENT_STAKE: () => SEND_NEXUS_ERROR__INSUFFICIENT_STAKE,
|
|
@@ -10734,7 +10660,6 @@ var errors_exports = /* @__PURE__ */ __exportAll({
|
|
|
10734
10660
|
SEND_NEXUS_ERROR__INVALID_AUTHORITY: () => SEND_NEXUS_ERROR__INVALID_AUTHORITY,
|
|
10735
10661
|
SEND_NEXUS_ERROR__INVALID_AUTH_PLATFORM_INDEX: () => SEND_NEXUS_ERROR__INVALID_AUTH_PLATFORM_INDEX,
|
|
10736
10662
|
SEND_NEXUS_ERROR__INVALID_AUTH_PLATFORM_NAME: () => SEND_NEXUS_ERROR__INVALID_AUTH_PLATFORM_NAME,
|
|
10737
|
-
SEND_NEXUS_ERROR__INVALID_CREATOR_ID: () => SEND_NEXUS_ERROR__INVALID_CREATOR_ID,
|
|
10738
10663
|
SEND_NEXUS_ERROR__INVALID_DESTINATION: () => SEND_NEXUS_ERROR__INVALID_DESTINATION,
|
|
10739
10664
|
SEND_NEXUS_ERROR__INVALID_FEE_PRESET: () => SEND_NEXUS_ERROR__INVALID_FEE_PRESET,
|
|
10740
10665
|
SEND_NEXUS_ERROR__INVALID_MINT: () => SEND_NEXUS_ERROR__INVALID_MINT,
|
|
@@ -10768,6 +10693,7 @@ var errors_exports = /* @__PURE__ */ __exportAll({
|
|
|
10768
10693
|
SEND_NEXUS_ERROR__TOO_MANY_AUTH_PLATFORMS: () => SEND_NEXUS_ERROR__TOO_MANY_AUTH_PLATFORMS,
|
|
10769
10694
|
SEND_NEXUS_ERROR__TRANSFER_FEE_NOT_SETTLEABLE: () => SEND_NEXUS_ERROR__TRANSFER_FEE_NOT_SETTLEABLE,
|
|
10770
10695
|
SEND_NEXUS_ERROR__UNAUTHORIZED: () => SEND_NEXUS_ERROR__UNAUTHORIZED,
|
|
10696
|
+
SEND_NEXUS_ERROR__UNUSED7012: () => SEND_NEXUS_ERROR__UNUSED7012,
|
|
10771
10697
|
SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_INVALID: () => SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_INVALID,
|
|
10772
10698
|
SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY: () => SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_WRONG_AUTHORITY,
|
|
10773
10699
|
SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT: () => SEND_NEXUS_ERROR__USER_TOKEN_ACCOUNT_WRONG_MINT,
|
|
@@ -11154,7 +11080,6 @@ var pdas_exports = /* @__PURE__ */ __exportAll({
|
|
|
11154
11080
|
GLOBAL_CONFIG_PDA_ADDRESS: () => GLOBAL_CONFIG_PDA_ADDRESS,
|
|
11155
11081
|
STAKING_CONFIG_PDA_ADDRESS: () => STAKING_CONFIG_PDA_ADDRESS,
|
|
11156
11082
|
findAltRegistryPda: () => findAltRegistryPda,
|
|
11157
|
-
findCreatorFeeConfigPda: () => findCreatorFeeConfigPda,
|
|
11158
11083
|
findDefaultFeePresetPda: () => findDefaultFeePresetPda,
|
|
11159
11084
|
findDefaultPartnerMetadataPda: () => findDefaultPartnerMetadataPda,
|
|
11160
11085
|
findDefaultPartnerPda: () => findDefaultPartnerPda,
|
|
@@ -12568,13 +12493,6 @@ function sendNexusProgram() {
|
|
|
12568
12493
|
fetchAllMaybe: (addresses, config) => fetchAllMaybeAltRegistry(client.rpc, addresses, config),
|
|
12569
12494
|
fetchMaybe: (address, config) => fetchMaybeAltRegistry(client.rpc, address, config)
|
|
12570
12495
|
}),
|
|
12571
|
-
creatorFeeConfig: Object.freeze({
|
|
12572
|
-
...getCreatorFeeConfigCodec(),
|
|
12573
|
-
fetch: (address, config) => fetchCreatorFeeConfig(client.rpc, address, config),
|
|
12574
|
-
fetchAll: (addresses, config) => fetchAllCreatorFeeConfig(client.rpc, addresses, config),
|
|
12575
|
-
fetchAllMaybe: (addresses, config) => fetchAllMaybeCreatorFeeConfig(client.rpc, addresses, config),
|
|
12576
|
-
fetchMaybe: (address, config) => fetchMaybeCreatorFeeConfig(client.rpc, address, config)
|
|
12577
|
-
}),
|
|
12578
12496
|
feePreset: Object.freeze({
|
|
12579
12497
|
...getFeePresetCodec(),
|
|
12580
12498
|
fetch: (address, config) => fetchFeePreset(client.rpc, address, config),
|
|
@@ -12672,7 +12590,6 @@ function sendNexusProgram() {
|
|
|
12672
12590
|
userStakePosition: findUserStakePositionPda,
|
|
12673
12591
|
userRewardDebt: findUserRewardDebtPda,
|
|
12674
12592
|
eventAuthority: findEventAuthorityPda,
|
|
12675
|
-
creatorFeeConfig: findCreatorFeeConfigPda,
|
|
12676
12593
|
altRegistry: findAltRegistryPda
|
|
12677
12594
|
},
|
|
12678
12595
|
identifyAccount: identifySendNexusAccount,
|
|
@@ -12701,11 +12618,13 @@ async function fetchPartnerFees(rpc, partner, platformConfig) {
|
|
|
12701
12618
|
if (!maybeAccount.exists) throw new Error(`No fee config for partner ${partner} on platform ${platformConfig}`);
|
|
12702
12619
|
return maybeAccount.data;
|
|
12703
12620
|
}
|
|
12704
|
-
/** Returns the `feeBps` a trade pays: the standard rate plus the decay premium.
|
|
12705
|
-
*
|
|
12706
|
-
*
|
|
12707
|
-
|
|
12708
|
-
|
|
12621
|
+
/** Returns the `feeBps` a trade pays: the standard rate plus the decay premium. The standard rate
|
|
12622
|
+
* is the protocol and LP rates of `schedule` plus `creatorFeeBps`. `schedule` is the
|
|
12623
|
+
* `PartnerConfig`'s `launchpad` for a curve or `dex` for a pool. `creatorFeeBps` and `createdAt`
|
|
12624
|
+
* are the curve's or pool's. `schedule.maxCreatorFeeBps` has no effect. `createdAt` and `now`
|
|
12625
|
+
* are in unix seconds. */
|
|
12626
|
+
function effectiveFeeBps(schedule, createdAt, now, creatorFeeBps) {
|
|
12627
|
+
const standardFeeBps = schedule.protocolFeeBps + ("lpFeeBps" in schedule ? schedule.lpFeeBps : 0) + creatorFeeBps;
|
|
12709
12628
|
const premium = calculateFeeDecayPremium({
|
|
12710
12629
|
currentTimestamp: now,
|
|
12711
12630
|
createdAtTimestamp: createdAt,
|
|
@@ -13178,9 +13097,6 @@ async function fetchQuoteMintInfos(rpc, mints, commitment) {
|
|
|
13178
13097
|
//#region src/utils/index.ts
|
|
13179
13098
|
var utils_exports = /* @__PURE__ */ __exportAll({
|
|
13180
13099
|
accountIsCreated: () => accountIsCreated,
|
|
13181
|
-
creatorHashFromId: () => creatorHashFromId,
|
|
13182
|
-
decodeCreatorId: () => decodeCreatorId,
|
|
13183
|
-
encodeCreatorId: () => encodeCreatorId,
|
|
13184
13100
|
fetchQuoteMintInfo: () => fetchQuoteMintInfo,
|
|
13185
13101
|
fetchQuoteMintInfos: () => fetchQuoteMintInfos,
|
|
13186
13102
|
findAssociatedTokenPda: () => findAssociatedTokenPda
|