@send-fun/sdk 1.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/LICENSE +21 -0
- package/README.md +32 -0
- package/dist/index.cjs +12808 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +4406 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.mts +4405 -0
- package/dist/index.d.mts.map +1 -0
- package/dist/index.mjs +12749 -0
- package/dist/index.mjs.map +1 -0
- package/dist/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/package.json +72 -0
- package/src/constants.ts +38 -0
- package/src/dex/generated/accounts/globalConfig.ts +189 -0
- package/src/dex/generated/accounts/index.ts +12 -0
- package/src/dex/generated/accounts/pool.ts +244 -0
- package/src/dex/generated/accounts/rewardAccrual.ts +191 -0
- package/src/dex/generated/accounts/sendDex.accounts.ts +47 -0
- package/src/dex/generated/errors/index.ts +9 -0
- package/src/dex/generated/errors/sendDex.ts +161 -0
- package/src/dex/generated/events/anchorEventCpiDiscriminator.framing.ts +28 -0
- package/src/dex/generated/events/creatorClaimEvent.ts +119 -0
- package/src/dex/generated/events/depositQuoteEvent.ts +115 -0
- package/src/dex/generated/events/index.ts +16 -0
- package/src/dex/generated/events/poolCreateEvent.ts +128 -0
- package/src/dex/generated/events/protocolClaimEvent.ts +111 -0
- package/src/dex/generated/events/sendDex.events.ts +184 -0
- package/src/dex/generated/events/tokenCreateEvent.ts +143 -0
- package/src/dex/generated/events/tradeEvent.ts +143 -0
- package/src/dex/generated/index.ts +16 -0
- package/src/dex/generated/instructions/buyExactIn.ts +815 -0
- package/src/dex/generated/instructions/buyExactOut.ts +815 -0
- package/src/dex/generated/instructions/claimCreatorFees.ts +648 -0
- package/src/dex/generated/instructions/claimProtocolFees.ts +640 -0
- package/src/dex/generated/instructions/index.ts +15 -0
- package/src/dex/generated/instructions/sellExactIn.ts +815 -0
- package/src/dex/generated/instructions/sellExactOut.ts +815 -0
- package/src/dex/generated/instructions/sendDex.instructions.ts +173 -0
- package/src/dex/generated/pdas/eventAuthority.ts +20 -0
- package/src/dex/generated/pdas/globalConfig.ts +20 -0
- package/src/dex/generated/pdas/index.ts +14 -0
- package/src/dex/generated/pdas/lpMint.ts +36 -0
- package/src/dex/generated/pdas/pool.ts +34 -0
- package/src/dex/generated/pdas/rewardAccrual.ts +37 -0
- package/src/dex/generated/pdas/wsolRewardAccrual.ts +20 -0
- package/src/dex/generated/plugins/index.ts +9 -0
- package/src/dex/generated/plugins/sendDex.ts +282 -0
- package/src/dex/generated/programs/index.ts +9 -0
- package/src/dex/generated/programs/sendDex.ts +12 -0
- package/src/dex/generated/types/index.ts +10 -0
- package/src/dex/generated/types/poolStatus.ts +38 -0
- package/src/dex/generated/types/tradeDirection.ts +38 -0
- package/src/dex/index.ts +8 -0
- package/src/dex/trade.ts +215 -0
- package/src/index.ts +8 -0
- package/src/launchpad/create.ts +116 -0
- package/src/launchpad/generated/accounts/bondingCurve.ts +273 -0
- package/src/launchpad/generated/accounts/globalConfig.ts +211 -0
- package/src/launchpad/generated/accounts/index.ts +12 -0
- package/src/launchpad/generated/accounts/rewardAccrual.ts +191 -0
- package/src/launchpad/generated/accounts/sendLaunchpad.accounts.ts +50 -0
- package/src/launchpad/generated/errors/index.ts +9 -0
- package/src/launchpad/generated/errors/sendLaunchpad.ts +175 -0
- package/src/launchpad/generated/events/anchorEventCpiDiscriminator.framing.ts +28 -0
- package/src/launchpad/generated/events/completeEvent.ts +120 -0
- package/src/launchpad/generated/events/creatorClaimEvent.ts +122 -0
- package/src/launchpad/generated/events/index.ts +17 -0
- package/src/launchpad/generated/events/migrateEvent.ts +121 -0
- package/src/launchpad/generated/events/protocolClaimEvent.ts +114 -0
- package/src/launchpad/generated/events/recycleEvent.ts +113 -0
- package/src/launchpad/generated/events/sendLaunchpad.events.ts +207 -0
- package/src/launchpad/generated/events/tokenCreateEvent.ts +156 -0
- package/src/launchpad/generated/events/tradeEvent.ts +148 -0
- package/src/launchpad/generated/index.ts +16 -0
- package/src/launchpad/generated/instructions/buyExactIn.ts +818 -0
- package/src/launchpad/generated/instructions/buyExactOut.ts +818 -0
- package/src/launchpad/generated/instructions/claimCreatorFees.ts +651 -0
- package/src/launchpad/generated/instructions/claimProtocolFees.ts +640 -0
- package/src/launchpad/generated/instructions/createToken.ts +1150 -0
- package/src/launchpad/generated/instructions/index.ts +17 -0
- package/src/launchpad/generated/instructions/migrate.ts +840 -0
- package/src/launchpad/generated/instructions/sellExactIn.ts +818 -0
- package/src/launchpad/generated/instructions/sellExactOut.ts +818 -0
- package/src/launchpad/generated/instructions/sendLaunchpad.instructions.ts +210 -0
- package/src/launchpad/generated/pdas/bondingCurve.ts +39 -0
- package/src/launchpad/generated/pdas/eventAuthority.ts +20 -0
- package/src/launchpad/generated/pdas/globalConfig.ts +20 -0
- package/src/launchpad/generated/pdas/index.ts +14 -0
- package/src/launchpad/generated/pdas/migrationAuthority.ts +20 -0
- package/src/launchpad/generated/pdas/rewardAccrual.ts +37 -0
- package/src/launchpad/generated/pdas/wsolRewardAccrual.ts +20 -0
- package/src/launchpad/generated/plugins/index.ts +9 -0
- package/src/launchpad/generated/plugins/sendLaunchpad.ts +315 -0
- package/src/launchpad/generated/programs/index.ts +9 -0
- package/src/launchpad/generated/programs/sendLaunchpad.ts +12 -0
- package/src/launchpad/generated/types/bondingCurveStatus.ts +43 -0
- package/src/launchpad/generated/types/index.ts +10 -0
- package/src/launchpad/generated/types/tradeDirection.ts +38 -0
- package/src/launchpad/index.ts +10 -0
- package/src/launchpad/migrate.ts +54 -0
- package/src/launchpad/trade.ts +247 -0
- package/src/math/amm.ts +511 -0
- package/src/math/fee-decay.ts +49 -0
- package/src/math/fees.ts +75 -0
- package/src/math/index.ts +3 -0
- package/src/math/internal.ts +16 -0
- package/src/nexus/fee-helpers.ts +49 -0
- package/src/nexus/generated/accounts/altRegistry.ts +177 -0
- package/src/nexus/generated/accounts/creatorFeeConfig.ts +200 -0
- package/src/nexus/generated/accounts/feePreset.ts +196 -0
- package/src/nexus/generated/accounts/globalConfig.ts +188 -0
- package/src/nexus/generated/accounts/index.ts +19 -0
- package/src/nexus/generated/accounts/partnerConfig.ts +209 -0
- package/src/nexus/generated/accounts/partnerMetadata.ts +216 -0
- package/src/nexus/generated/accounts/rewardState.ts +209 -0
- package/src/nexus/generated/accounts/sendNexus.accounts.ts +85 -0
- package/src/nexus/generated/accounts/stakingConfig.ts +197 -0
- package/src/nexus/generated/accounts/userRewardDebt.ts +221 -0
- package/src/nexus/generated/accounts/userStakePosition.ts +218 -0
- package/src/nexus/generated/constants/index.ts +9 -0
- package/src/nexus/generated/constants/sendNexus.ts +13 -0
- package/src/nexus/generated/errors/index.ts +9 -0
- package/src/nexus/generated/errors/sendNexus.ts +229 -0
- package/src/nexus/generated/events/anchorEventCpiDiscriminator.framing.ts +28 -0
- package/src/nexus/generated/events/claimEvent.ts +106 -0
- package/src/nexus/generated/events/index.ts +13 -0
- package/src/nexus/generated/events/sendNexus.events.ts +121 -0
- package/src/nexus/generated/events/stakeEvent.ts +106 -0
- package/src/nexus/generated/events/unstakeEvent.ts +106 -0
- package/src/nexus/generated/index.ts +17 -0
- package/src/nexus/generated/instructions/claim.ts +740 -0
- package/src/nexus/generated/instructions/createUserRewardDebt.ts +498 -0
- package/src/nexus/generated/instructions/index.ts +14 -0
- package/src/nexus/generated/instructions/sendNexus.instructions.ts +146 -0
- package/src/nexus/generated/instructions/settle.ts +517 -0
- package/src/nexus/generated/instructions/stake.ts +615 -0
- package/src/nexus/generated/instructions/unstake.ts +593 -0
- package/src/nexus/generated/pdas/altRegistry.ts +20 -0
- package/src/nexus/generated/pdas/creatorFeeConfig.ts +39 -0
- package/src/nexus/generated/pdas/defaultFeePreset.ts +37 -0
- package/src/nexus/generated/pdas/defaultPartner.ts +40 -0
- package/src/nexus/generated/pdas/defaultPartnerMetadata.ts +42 -0
- package/src/nexus/generated/pdas/eventAuthority.ts +20 -0
- package/src/nexus/generated/pdas/feePreset.ts +39 -0
- package/src/nexus/generated/pdas/globalConfig.ts +20 -0
- package/src/nexus/generated/pdas/index.ts +22 -0
- package/src/nexus/generated/pdas/partnerConfig.ts +36 -0
- package/src/nexus/generated/pdas/partnerMetadata.ts +38 -0
- package/src/nexus/generated/pdas/rewardState.ts +36 -0
- package/src/nexus/generated/pdas/stakingConfig.ts +20 -0
- package/src/nexus/generated/pdas/userRewardDebt.ts +41 -0
- package/src/nexus/generated/pdas/userStakePosition.ts +39 -0
- package/src/nexus/generated/plugins/index.ts +9 -0
- package/src/nexus/generated/plugins/sendNexus.ts +494 -0
- package/src/nexus/generated/programs/index.ts +9 -0
- package/src/nexus/generated/programs/sendNexus.ts +12 -0
- package/src/nexus/generated/types/authPlatformEntry.ts +52 -0
- package/src/nexus/generated/types/callerType.ts +38 -0
- package/src/nexus/generated/types/dexFees.ts +64 -0
- package/src/nexus/generated/types/feeConfig.ts +73 -0
- package/src/nexus/generated/types/index.ts +13 -0
- package/src/nexus/generated/types/launchpadFees.ts +63 -0
- package/src/nexus/index.ts +9 -0
- package/src/nexus/staking.ts +581 -0
- package/src/platform.ts +19 -0
- package/src/transfer-fee.ts +216 -0
- package/src/utils/chunk.ts +21 -0
- package/src/utils/creator-hash.ts +57 -0
- package/src/utils/index.ts +9 -0
- package/src/utils/mint-info.ts +102 -0
- package/src/utils/partner.ts +5 -0
- package/src/utils/pda.ts +24 -0
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
assertIsInstructionWithAccounts,
|
|
11
|
+
containsBytes,
|
|
12
|
+
type Address,
|
|
13
|
+
type Instruction,
|
|
14
|
+
type InstructionWithData,
|
|
15
|
+
type ReadonlyUint8Array,
|
|
16
|
+
} from '@solana/kit';
|
|
17
|
+
import { SEND_LAUNCHPAD_PROGRAM_ADDRESS } from '../programs/index.js';
|
|
18
|
+
import {
|
|
19
|
+
BUY_EXACT_IN_DISCRIMINATOR,
|
|
20
|
+
parseBuyExactInInstruction,
|
|
21
|
+
type ParsedBuyExactInInstruction,
|
|
22
|
+
} from './buyExactIn.js';
|
|
23
|
+
import {
|
|
24
|
+
BUY_EXACT_OUT_DISCRIMINATOR,
|
|
25
|
+
parseBuyExactOutInstruction,
|
|
26
|
+
type ParsedBuyExactOutInstruction,
|
|
27
|
+
} from './buyExactOut.js';
|
|
28
|
+
import {
|
|
29
|
+
CLAIM_CREATOR_FEES_DISCRIMINATOR,
|
|
30
|
+
parseClaimCreatorFeesInstruction,
|
|
31
|
+
type ParsedClaimCreatorFeesInstruction,
|
|
32
|
+
} from './claimCreatorFees.js';
|
|
33
|
+
import {
|
|
34
|
+
CLAIM_PROTOCOL_FEES_DISCRIMINATOR,
|
|
35
|
+
parseClaimProtocolFeesInstruction,
|
|
36
|
+
type ParsedClaimProtocolFeesInstruction,
|
|
37
|
+
} from './claimProtocolFees.js';
|
|
38
|
+
import {
|
|
39
|
+
CREATE_TOKEN_DISCRIMINATOR,
|
|
40
|
+
parseCreateTokenInstruction,
|
|
41
|
+
type ParsedCreateTokenInstruction,
|
|
42
|
+
} from './createToken.js';
|
|
43
|
+
import {
|
|
44
|
+
MIGRATE_DISCRIMINATOR,
|
|
45
|
+
parseMigrateInstruction,
|
|
46
|
+
type ParsedMigrateInstruction,
|
|
47
|
+
} from './migrate.js';
|
|
48
|
+
import {
|
|
49
|
+
parseSellExactInInstruction,
|
|
50
|
+
SELL_EXACT_IN_DISCRIMINATOR,
|
|
51
|
+
type ParsedSellExactInInstruction,
|
|
52
|
+
} from './sellExactIn.js';
|
|
53
|
+
import {
|
|
54
|
+
parseSellExactOutInstruction,
|
|
55
|
+
SELL_EXACT_OUT_DISCRIMINATOR,
|
|
56
|
+
type ParsedSellExactOutInstruction,
|
|
57
|
+
} from './sellExactOut.js';
|
|
58
|
+
|
|
59
|
+
/** Instruction kinds of the sendLaunchpad program. */
|
|
60
|
+
export type SendLaunchpadInstructionType =
|
|
61
|
+
| 'buyExactIn'
|
|
62
|
+
| 'buyExactOut'
|
|
63
|
+
| 'claimCreatorFees'
|
|
64
|
+
| 'claimProtocolFees'
|
|
65
|
+
| 'createToken'
|
|
66
|
+
| 'migrate'
|
|
67
|
+
| 'sellExactIn'
|
|
68
|
+
| 'sellExactOut';
|
|
69
|
+
|
|
70
|
+
/**
|
|
71
|
+
* Identifies sendLaunchpad instruction data by its discriminators.
|
|
72
|
+
* Returns `null` when the instruction is for another program or the data matches no known instruction.
|
|
73
|
+
*/
|
|
74
|
+
export function identifySendLaunchpadInstruction(
|
|
75
|
+
instruction:
|
|
76
|
+
| { data: ReadonlyUint8Array; programAddress: Address }
|
|
77
|
+
| ReadonlyUint8Array,
|
|
78
|
+
): SendLaunchpadInstructionType | null {
|
|
79
|
+
if (
|
|
80
|
+
'data' in instruction &&
|
|
81
|
+
instruction.programAddress !== SEND_LAUNCHPAD_PROGRAM_ADDRESS
|
|
82
|
+
)
|
|
83
|
+
return null;
|
|
84
|
+
const data = 'data' in instruction ? instruction.data : instruction;
|
|
85
|
+
if (containsBytes(data, BUY_EXACT_IN_DISCRIMINATOR, 0)) {
|
|
86
|
+
return 'buyExactIn';
|
|
87
|
+
}
|
|
88
|
+
if (containsBytes(data, BUY_EXACT_OUT_DISCRIMINATOR, 0)) {
|
|
89
|
+
return 'buyExactOut';
|
|
90
|
+
}
|
|
91
|
+
if (containsBytes(data, CLAIM_CREATOR_FEES_DISCRIMINATOR, 0)) {
|
|
92
|
+
return 'claimCreatorFees';
|
|
93
|
+
}
|
|
94
|
+
if (containsBytes(data, CLAIM_PROTOCOL_FEES_DISCRIMINATOR, 0)) {
|
|
95
|
+
return 'claimProtocolFees';
|
|
96
|
+
}
|
|
97
|
+
if (containsBytes(data, CREATE_TOKEN_DISCRIMINATOR, 0)) {
|
|
98
|
+
return 'createToken';
|
|
99
|
+
}
|
|
100
|
+
if (containsBytes(data, MIGRATE_DISCRIMINATOR, 0)) {
|
|
101
|
+
return 'migrate';
|
|
102
|
+
}
|
|
103
|
+
if (containsBytes(data, SELL_EXACT_IN_DISCRIMINATOR, 0)) {
|
|
104
|
+
return 'sellExactIn';
|
|
105
|
+
}
|
|
106
|
+
if (containsBytes(data, SELL_EXACT_OUT_DISCRIMINATOR, 0)) {
|
|
107
|
+
return 'sellExactOut';
|
|
108
|
+
}
|
|
109
|
+
return null;
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** Parsed sendLaunchpad instruction: the instruction kind tag plus its parsed accounts and data. */
|
|
113
|
+
export type ParsedSendLaunchpadInstruction<
|
|
114
|
+
TProgram extends string = '5R1uFyEE4oxqkm7hJDqHq6gXaLVF9dxeF3LF4yz1sfLP',
|
|
115
|
+
> =
|
|
116
|
+
| ({
|
|
117
|
+
instructionType: 'buyExactIn';
|
|
118
|
+
} & ParsedBuyExactInInstruction<TProgram>)
|
|
119
|
+
| ({
|
|
120
|
+
instructionType: 'buyExactOut';
|
|
121
|
+
} & ParsedBuyExactOutInstruction<TProgram>)
|
|
122
|
+
| ({
|
|
123
|
+
instructionType: 'claimCreatorFees';
|
|
124
|
+
} & ParsedClaimCreatorFeesInstruction<TProgram>)
|
|
125
|
+
| ({
|
|
126
|
+
instructionType: 'claimProtocolFees';
|
|
127
|
+
} & ParsedClaimProtocolFeesInstruction<TProgram>)
|
|
128
|
+
| ({
|
|
129
|
+
instructionType: 'createToken';
|
|
130
|
+
} & ParsedCreateTokenInstruction<TProgram>)
|
|
131
|
+
| ({ instructionType: 'migrate' } & ParsedMigrateInstruction<TProgram>)
|
|
132
|
+
| ({
|
|
133
|
+
instructionType: 'sellExactIn';
|
|
134
|
+
} & ParsedSellExactInInstruction<TProgram>)
|
|
135
|
+
| ({
|
|
136
|
+
instructionType: 'sellExactOut';
|
|
137
|
+
} & ParsedSellExactOutInstruction<TProgram>);
|
|
138
|
+
|
|
139
|
+
/**
|
|
140
|
+
* Parses a sendLaunchpad instruction into its kind tag plus parsed accounts and data.
|
|
141
|
+
* Returns `null` when the instruction is for another program or no known instruction matches;
|
|
142
|
+
* throws if a matched instruction fails to parse.
|
|
143
|
+
*/
|
|
144
|
+
export function parseSendLaunchpadInstruction<TProgram extends string>(
|
|
145
|
+
instruction: Instruction<TProgram> &
|
|
146
|
+
InstructionWithData<ReadonlyUint8Array>,
|
|
147
|
+
): ParsedSendLaunchpadInstruction<TProgram> | null {
|
|
148
|
+
if (instruction.programAddress !== SEND_LAUNCHPAD_PROGRAM_ADDRESS)
|
|
149
|
+
return null;
|
|
150
|
+
const instructionType = identifySendLaunchpadInstruction(instruction);
|
|
151
|
+
if (instructionType === null) return null;
|
|
152
|
+
switch (instructionType) {
|
|
153
|
+
case 'buyExactIn': {
|
|
154
|
+
assertIsInstructionWithAccounts(instruction);
|
|
155
|
+
return {
|
|
156
|
+
instructionType: 'buyExactIn',
|
|
157
|
+
...parseBuyExactInInstruction(instruction),
|
|
158
|
+
};
|
|
159
|
+
}
|
|
160
|
+
case 'buyExactOut': {
|
|
161
|
+
assertIsInstructionWithAccounts(instruction);
|
|
162
|
+
return {
|
|
163
|
+
instructionType: 'buyExactOut',
|
|
164
|
+
...parseBuyExactOutInstruction(instruction),
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
case 'claimCreatorFees': {
|
|
168
|
+
assertIsInstructionWithAccounts(instruction);
|
|
169
|
+
return {
|
|
170
|
+
instructionType: 'claimCreatorFees',
|
|
171
|
+
...parseClaimCreatorFeesInstruction(instruction),
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
case 'claimProtocolFees': {
|
|
175
|
+
assertIsInstructionWithAccounts(instruction);
|
|
176
|
+
return {
|
|
177
|
+
instructionType: 'claimProtocolFees',
|
|
178
|
+
...parseClaimProtocolFeesInstruction(instruction),
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
case 'createToken': {
|
|
182
|
+
assertIsInstructionWithAccounts(instruction);
|
|
183
|
+
return {
|
|
184
|
+
instructionType: 'createToken',
|
|
185
|
+
...parseCreateTokenInstruction(instruction),
|
|
186
|
+
};
|
|
187
|
+
}
|
|
188
|
+
case 'migrate': {
|
|
189
|
+
assertIsInstructionWithAccounts(instruction);
|
|
190
|
+
return {
|
|
191
|
+
instructionType: 'migrate',
|
|
192
|
+
...parseMigrateInstruction(instruction),
|
|
193
|
+
};
|
|
194
|
+
}
|
|
195
|
+
case 'sellExactIn': {
|
|
196
|
+
assertIsInstructionWithAccounts(instruction);
|
|
197
|
+
return {
|
|
198
|
+
instructionType: 'sellExactIn',
|
|
199
|
+
...parseSellExactInInstruction(instruction),
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
case 'sellExactOut': {
|
|
203
|
+
assertIsInstructionWithAccounts(instruction);
|
|
204
|
+
return {
|
|
205
|
+
instructionType: 'sellExactOut',
|
|
206
|
+
...parseSellExactOutInstruction(instruction),
|
|
207
|
+
};
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
getAddressEncoder,
|
|
11
|
+
getBytesEncoder,
|
|
12
|
+
getProgramDerivedAddress,
|
|
13
|
+
type Address,
|
|
14
|
+
type ProgramDerivedAddress,
|
|
15
|
+
} from '@solana/kit';
|
|
16
|
+
import { SEND_LAUNCHPAD_PROGRAM_ADDRESS } from '../programs/index.js';
|
|
17
|
+
|
|
18
|
+
export type BondingCurveSeeds = {
|
|
19
|
+
baseMint: Address;
|
|
20
|
+
quoteMint: Address;
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
export async function findBondingCurvePda(
|
|
24
|
+
seeds: BondingCurveSeeds,
|
|
25
|
+
): Promise<ProgramDerivedAddress> {
|
|
26
|
+
return await getProgramDerivedAddress({
|
|
27
|
+
programAddress: SEND_LAUNCHPAD_PROGRAM_ADDRESS,
|
|
28
|
+
seeds: [
|
|
29
|
+
getBytesEncoder().encode(
|
|
30
|
+
new Uint8Array([
|
|
31
|
+
98, 111, 110, 100, 105, 110, 103, 95, 99, 117, 114, 118,
|
|
32
|
+
101,
|
|
33
|
+
]),
|
|
34
|
+
),
|
|
35
|
+
getAddressEncoder().encode(seeds.baseMint),
|
|
36
|
+
getAddressEncoder().encode(seeds.quoteMint),
|
|
37
|
+
],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type {
|
|
10
|
+
Address,
|
|
11
|
+
ProgramDerivedAddress,
|
|
12
|
+
ProgramDerivedAddressBump,
|
|
13
|
+
} from '@solana/kit';
|
|
14
|
+
|
|
15
|
+
export const EVENT_AUTHORITY_PDA_ADDRESS =
|
|
16
|
+
'FJVebqCthxH6JM8vvkJb7yRYA7Emsib1C1vu4ZePSP3T' as Address<'FJVebqCthxH6JM8vvkJb7yRYA7Emsib1C1vu4ZePSP3T'>;
|
|
17
|
+
|
|
18
|
+
export function findEventAuthorityPda(): ProgramDerivedAddress {
|
|
19
|
+
return [EVENT_AUTHORITY_PDA_ADDRESS, 255 as ProgramDerivedAddressBump];
|
|
20
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type {
|
|
10
|
+
Address,
|
|
11
|
+
ProgramDerivedAddress,
|
|
12
|
+
ProgramDerivedAddressBump,
|
|
13
|
+
} from '@solana/kit';
|
|
14
|
+
|
|
15
|
+
export const GLOBAL_CONFIG_PDA_ADDRESS =
|
|
16
|
+
'H3csa1cgR7zPJdxCzNbS5chYymHMKS3XivDA5nRx4Bdq' as Address<'H3csa1cgR7zPJdxCzNbS5chYymHMKS3XivDA5nRx4Bdq'>;
|
|
17
|
+
|
|
18
|
+
export function findGlobalConfigPda(): ProgramDerivedAddress {
|
|
19
|
+
return [GLOBAL_CONFIG_PDA_ADDRESS, 248 as ProgramDerivedAddressBump];
|
|
20
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from './bondingCurve.js';
|
|
10
|
+
export * from './eventAuthority.js';
|
|
11
|
+
export * from './globalConfig.js';
|
|
12
|
+
export * from './migrationAuthority.js';
|
|
13
|
+
export * from './rewardAccrual.js';
|
|
14
|
+
export * from './wsolRewardAccrual.js';
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type {
|
|
10
|
+
Address,
|
|
11
|
+
ProgramDerivedAddress,
|
|
12
|
+
ProgramDerivedAddressBump,
|
|
13
|
+
} from '@solana/kit';
|
|
14
|
+
|
|
15
|
+
export const MIGRATION_AUTHORITY_PDA_ADDRESS =
|
|
16
|
+
'932vp5VTARoqoAKNgLSawfCsAx43jUJ5YURggmXBX6V' as Address<'932vp5VTARoqoAKNgLSawfCsAx43jUJ5YURggmXBX6V'>;
|
|
17
|
+
|
|
18
|
+
export function findMigrationAuthorityPda(): ProgramDerivedAddress {
|
|
19
|
+
return [MIGRATION_AUTHORITY_PDA_ADDRESS, 251 as ProgramDerivedAddressBump];
|
|
20
|
+
}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
getAddressEncoder,
|
|
11
|
+
getBytesEncoder,
|
|
12
|
+
getProgramDerivedAddress,
|
|
13
|
+
type Address,
|
|
14
|
+
type ProgramDerivedAddress,
|
|
15
|
+
} from '@solana/kit';
|
|
16
|
+
import { SEND_LAUNCHPAD_PROGRAM_ADDRESS } from '../programs/index.js';
|
|
17
|
+
|
|
18
|
+
export type RewardAccrualSeeds = {
|
|
19
|
+
quoteMint: Address;
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
export async function findRewardAccrualPda(
|
|
23
|
+
seeds: RewardAccrualSeeds,
|
|
24
|
+
): Promise<ProgramDerivedAddress> {
|
|
25
|
+
return await getProgramDerivedAddress({
|
|
26
|
+
programAddress: SEND_LAUNCHPAD_PROGRAM_ADDRESS,
|
|
27
|
+
seeds: [
|
|
28
|
+
getBytesEncoder().encode(
|
|
29
|
+
new Uint8Array([
|
|
30
|
+
114, 101, 119, 97, 114, 100, 95, 97, 99, 99, 114, 117, 97,
|
|
31
|
+
108,
|
|
32
|
+
]),
|
|
33
|
+
),
|
|
34
|
+
getAddressEncoder().encode(seeds.quoteMint),
|
|
35
|
+
],
|
|
36
|
+
});
|
|
37
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import type {
|
|
10
|
+
Address,
|
|
11
|
+
ProgramDerivedAddress,
|
|
12
|
+
ProgramDerivedAddressBump,
|
|
13
|
+
} from '@solana/kit';
|
|
14
|
+
|
|
15
|
+
export const WSOL_REWARD_ACCRUAL_PDA_ADDRESS =
|
|
16
|
+
'91AVurtPdUC2yG3joLoujzC216KAfH5HEKnZEELFMmVH' as Address<'91AVurtPdUC2yG3joLoujzC216KAfH5HEKnZEELFMmVH'>;
|
|
17
|
+
|
|
18
|
+
export function findWsolRewardAccrualPda(): ProgramDerivedAddress {
|
|
19
|
+
return [WSOL_REWARD_ACCRUAL_PDA_ADDRESS, 255 as ProgramDerivedAddressBump];
|
|
20
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the Codama library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun Codama to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/codama-idl/codama
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
export * from './sendLaunchpad.js';
|