@theliem/xmarket-sdk 3.3.1 → 3.4.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.d.mts +62 -2
- package/dist/index.d.ts +62 -2
- package/dist/index.js +1302 -93
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1302 -94
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -33,7 +33,10 @@ var SEEDS = {
|
|
|
33
33
|
userBuy: Buffer.from("user_buy"),
|
|
34
34
|
// Market Oracle
|
|
35
35
|
marketOracle: Buffer.from("market_oracle"),
|
|
36
|
-
userClaim: Buffer.from("user_claim")
|
|
36
|
+
userClaim: Buffer.from("user_claim"),
|
|
37
|
+
// Admin Contract
|
|
38
|
+
adminConfig: Buffer.from("admin_config"),
|
|
39
|
+
claimRecord: Buffer.from("claim_record")
|
|
37
40
|
};
|
|
38
41
|
var PDA = class {
|
|
39
42
|
// ─── Question Market ────────────────────────────────────────────────────────
|
|
@@ -221,6 +224,21 @@ var PDA = class {
|
|
|
221
224
|
programIds.marketOracle
|
|
222
225
|
);
|
|
223
226
|
}
|
|
227
|
+
// ─── Admin Contract ──────────────────────────────────────────────────────
|
|
228
|
+
static adminConfig(owner, programIds) {
|
|
229
|
+
if (!programIds.adminContract) throw new Error("adminContract program ID not configured");
|
|
230
|
+
return PublicKey.findProgramAddressSync(
|
|
231
|
+
[SEEDS.adminConfig, owner.toBuffer()],
|
|
232
|
+
programIds.adminContract
|
|
233
|
+
);
|
|
234
|
+
}
|
|
235
|
+
static claimRecord(conditionId, programIds) {
|
|
236
|
+
if (!programIds.adminContract) throw new Error("adminContract program ID not configured");
|
|
237
|
+
return PublicKey.findProgramAddressSync(
|
|
238
|
+
[SEEDS.claimRecord, conditionId],
|
|
239
|
+
programIds.adminContract
|
|
240
|
+
);
|
|
241
|
+
}
|
|
224
242
|
};
|
|
225
243
|
function generateQuestionId(content, salt) {
|
|
226
244
|
const input = content + (salt ?? Date.now());
|
|
@@ -823,13 +841,26 @@ var MarketClient = class {
|
|
|
823
841
|
* Whitelist-only: distribute presale vault → 10% agents + 10% company + 80% botmm.
|
|
824
842
|
* Closes presale_vault ATA and presale PDA after distribution; lamports returned to payer.
|
|
825
843
|
*/
|
|
826
|
-
async collectPresaleRevenue(
|
|
844
|
+
async collectPresaleRevenue(params) {
|
|
845
|
+
const {
|
|
846
|
+
presalePda,
|
|
847
|
+
currencyMint,
|
|
848
|
+
conditionId,
|
|
849
|
+
referralAddress,
|
|
850
|
+
companyAddress,
|
|
851
|
+
adminOwner
|
|
852
|
+
} = params;
|
|
853
|
+
const caller = params.caller ?? this.walletPubkey;
|
|
854
|
+
const payer = params.payer ?? this.walletPubkey;
|
|
827
855
|
if (!this.programIds.presale) throw new Error("presale program ID not configured");
|
|
856
|
+
if (!this.programIds.adminContract) throw new Error("adminContract program ID not configured");
|
|
828
857
|
const presaleVault = getAssociatedTokenAddressSync(currencyMint, presalePda, true);
|
|
829
858
|
const referralTokenAccount = getAssociatedTokenAddressSync(currencyMint, referralAddress);
|
|
830
859
|
const companyTokenAccount = getAssociatedTokenAddressSync(currencyMint, companyAddress);
|
|
831
|
-
const
|
|
832
|
-
|
|
860
|
+
const [adminConfig] = PDA.adminConfig(adminOwner, this.programIds);
|
|
861
|
+
const [claimRecord] = PDA.claimRecord(conditionId, this.programIds);
|
|
862
|
+
const adminVault = getAssociatedTokenAddressSync(currencyMint, adminConfig, true);
|
|
863
|
+
return this.program.methods.collectPresaleRevenue(Array.from(conditionId)).accounts({
|
|
833
864
|
caller,
|
|
834
865
|
config: this.configPda,
|
|
835
866
|
presale: presalePda,
|
|
@@ -837,9 +868,12 @@ var MarketClient = class {
|
|
|
837
868
|
currencyMint,
|
|
838
869
|
referralTokenAccount,
|
|
839
870
|
companyTokenAccount,
|
|
840
|
-
|
|
871
|
+
adminVault,
|
|
872
|
+
adminConfig,
|
|
873
|
+
claimRecord,
|
|
841
874
|
payer,
|
|
842
875
|
presaleProgram: this.programIds.presale,
|
|
876
|
+
adminProgram: this.programIds.adminContract,
|
|
843
877
|
tokenProgram: TOKEN_PROGRAM_ID,
|
|
844
878
|
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
845
879
|
systemProgram: SystemProgram.programId
|
|
@@ -1406,8 +1440,8 @@ var ClobClient = class {
|
|
|
1406
1440
|
async _sendLegacyTxSig(instructions) {
|
|
1407
1441
|
const { connection } = this.provider;
|
|
1408
1442
|
const { blockhash, lastValidBlockHeight } = await connection.getLatestBlockhash();
|
|
1409
|
-
const { Transaction:
|
|
1410
|
-
const tx = new
|
|
1443
|
+
const { Transaction: Transaction8 } = await import('@solana/web3.js');
|
|
1444
|
+
const tx = new Transaction8();
|
|
1411
1445
|
tx.recentBlockhash = blockhash;
|
|
1412
1446
|
tx.feePayer = this.walletPubkey;
|
|
1413
1447
|
tx.add(...instructions);
|
|
@@ -1834,7 +1868,10 @@ ${logs.join("\n")}`);
|
|
|
1834
1868
|
if (t.side === SIDE_BUY && makers.every((m) => m.order.side === SIDE_SELL)) {
|
|
1835
1869
|
return this.matchComplementary(taker, makers, collateralMint, feeRecipient, operatorWallet, alt, opts);
|
|
1836
1870
|
}
|
|
1837
|
-
|
|
1871
|
+
if (t.side === SIDE_SELL && makers.every((m) => m.order.side === SIDE_BUY)) {
|
|
1872
|
+
return this.matchComplementary(makers[0], [taker, ...makers.slice(1)], collateralMint, feeRecipient, operatorWallet, alt, opts);
|
|
1873
|
+
}
|
|
1874
|
+
throw new InvalidParamError("COMPLEMENTARY requires one BUY and one SELL on same tokenId");
|
|
1838
1875
|
}
|
|
1839
1876
|
const allBuy = t.side === SIDE_BUY && makers.every((m) => m.order.side === SIDE_BUY);
|
|
1840
1877
|
const allSell = t.side === SIDE_SELL && makers.every((m) => m.order.side === SIDE_SELL);
|
|
@@ -2228,6 +2265,139 @@ var MarketOracleClient = class {
|
|
|
2228
2265
|
}
|
|
2229
2266
|
}
|
|
2230
2267
|
};
|
|
2268
|
+
var AdminClient = class {
|
|
2269
|
+
constructor(program, provider, programIds) {
|
|
2270
|
+
this.program = program;
|
|
2271
|
+
this.provider = provider;
|
|
2272
|
+
this.programIds = programIds;
|
|
2273
|
+
}
|
|
2274
|
+
get walletPubkey() {
|
|
2275
|
+
return this.provider.wallet.publicKey;
|
|
2276
|
+
}
|
|
2277
|
+
get configPda() {
|
|
2278
|
+
const [pda] = PDA.adminConfig(this.walletPubkey, this.programIds);
|
|
2279
|
+
return pda;
|
|
2280
|
+
}
|
|
2281
|
+
configPdaFor(owner) {
|
|
2282
|
+
const [pda] = PDA.adminConfig(owner, this.programIds);
|
|
2283
|
+
return pda;
|
|
2284
|
+
}
|
|
2285
|
+
adminVault(owner, collateralMint) {
|
|
2286
|
+
const configPda = this.configPdaFor(owner);
|
|
2287
|
+
return getAssociatedTokenAddressSync(collateralMint, configPda, true);
|
|
2288
|
+
}
|
|
2289
|
+
// ─── Fetch ────────────────────────────────────────────────────────────────
|
|
2290
|
+
async fetchConfig(owner = this.walletPubkey) {
|
|
2291
|
+
const [configPda] = PDA.adminConfig(owner, this.programIds);
|
|
2292
|
+
try {
|
|
2293
|
+
const acc = await this.program.account.adminConfig.fetch(configPda);
|
|
2294
|
+
return {
|
|
2295
|
+
version: acc.version,
|
|
2296
|
+
owner: acc.owner,
|
|
2297
|
+
collateralMint: acc.collateralMint,
|
|
2298
|
+
authorizedCaller: acc.authorizedCaller,
|
|
2299
|
+
adminWhitelist: acc.adminWhitelist.slice(0, acc.adminWhitelistLen),
|
|
2300
|
+
whitelist: acc.whitelist.slice(0, acc.whitelistLen),
|
|
2301
|
+
bump: acc.bump
|
|
2302
|
+
};
|
|
2303
|
+
} catch {
|
|
2304
|
+
return null;
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
async fetchClaimRecord(conditionId) {
|
|
2308
|
+
const [pda] = PDA.claimRecord(conditionId, this.programIds);
|
|
2309
|
+
try {
|
|
2310
|
+
const acc = await this.program.account.claimRecord.fetch(pda);
|
|
2311
|
+
return {
|
|
2312
|
+
conditionId: acc.conditionId,
|
|
2313
|
+
amount: acc.amount,
|
|
2314
|
+
bump: acc.bump
|
|
2315
|
+
};
|
|
2316
|
+
} catch {
|
|
2317
|
+
return null;
|
|
2318
|
+
}
|
|
2319
|
+
}
|
|
2320
|
+
// ─── Instructions ─────────────────────────────────────────────────────────
|
|
2321
|
+
async initialize(authorizedCaller, collateralMint, owner = this.walletPubkey) {
|
|
2322
|
+
const [configPda] = PDA.adminConfig(owner, this.programIds);
|
|
2323
|
+
const vault = getAssociatedTokenAddressSync(collateralMint, configPda, true);
|
|
2324
|
+
return this.program.methods.initialize(authorizedCaller).accounts({
|
|
2325
|
+
owner,
|
|
2326
|
+
config: configPda,
|
|
2327
|
+
collateralMint,
|
|
2328
|
+
adminVault: vault,
|
|
2329
|
+
tokenProgram: TOKEN_PROGRAM_ID,
|
|
2330
|
+
associatedTokenProgram: ASSOCIATED_TOKEN_PROGRAM_ID,
|
|
2331
|
+
systemProgram: SystemProgram.programId
|
|
2332
|
+
}).transaction();
|
|
2333
|
+
}
|
|
2334
|
+
async addAdmin(address, owner = this.walletPubkey) {
|
|
2335
|
+
const [configPda] = PDA.adminConfig(owner, this.programIds);
|
|
2336
|
+
return this.program.methods.addAdmin(address).accounts({ owner, config: configPda }).transaction();
|
|
2337
|
+
}
|
|
2338
|
+
async removeAdmin(address, owner = this.walletPubkey) {
|
|
2339
|
+
const [configPda] = PDA.adminConfig(owner, this.programIds);
|
|
2340
|
+
return this.program.methods.removeAdmin(address).accounts({ owner, config: configPda }).transaction();
|
|
2341
|
+
}
|
|
2342
|
+
async addToWhitelist(address, owner, admin = this.walletPubkey, payer = admin) {
|
|
2343
|
+
const [configPda] = PDA.adminConfig(owner, this.programIds);
|
|
2344
|
+
return this.program.methods.addToWhitelist(address).accounts({ admin, payer, config: configPda }).transaction();
|
|
2345
|
+
}
|
|
2346
|
+
async removeFromWhitelist(address, owner, admin = this.walletPubkey, payer = admin) {
|
|
2347
|
+
const [configPda] = PDA.adminConfig(owner, this.programIds);
|
|
2348
|
+
return this.program.methods.removeFromWhitelist(address).accounts({ admin, payer, config: configPda }).transaction();
|
|
2349
|
+
}
|
|
2350
|
+
/**
|
|
2351
|
+
* Normally called via CPI from question_market (authorized_caller signs).
|
|
2352
|
+
* For testing: initialize with authorizedCaller = wallet, call directly.
|
|
2353
|
+
*/
|
|
2354
|
+
async setPresaleAmount(conditionId, amount, owner = this.walletPubkey, caller = this.walletPubkey, payer = caller) {
|
|
2355
|
+
const [configPda] = PDA.adminConfig(owner, this.programIds);
|
|
2356
|
+
const [claimRecord] = PDA.claimRecord(conditionId, this.programIds);
|
|
2357
|
+
return this.program.methods.setPresaleAmount(Array.from(conditionId), amount).accounts({
|
|
2358
|
+
caller,
|
|
2359
|
+
payer,
|
|
2360
|
+
config: configPda,
|
|
2361
|
+
claimRecord,
|
|
2362
|
+
systemProgram: SystemProgram.programId
|
|
2363
|
+
}).transaction();
|
|
2364
|
+
}
|
|
2365
|
+
async claim(conditionId, collateralMint, owner, claimer = this.walletPubkey, payer = claimer) {
|
|
2366
|
+
const [configPda] = PDA.adminConfig(owner, this.programIds);
|
|
2367
|
+
const [claimRecord] = PDA.claimRecord(conditionId, this.programIds);
|
|
2368
|
+
const vault = getAssociatedTokenAddressSync(collateralMint, configPda, true);
|
|
2369
|
+
const claimerAta = getAssociatedTokenAddressSync(collateralMint, claimer);
|
|
2370
|
+
return this.program.methods.claim(Array.from(conditionId)).accounts({
|
|
2371
|
+
claimer,
|
|
2372
|
+
payer,
|
|
2373
|
+
config: configPda,
|
|
2374
|
+
adminVault: vault,
|
|
2375
|
+
claimRecord,
|
|
2376
|
+
claimerTokenAccount: claimerAta,
|
|
2377
|
+
tokenProgram: TOKEN_PROGRAM_ID
|
|
2378
|
+
}).transaction();
|
|
2379
|
+
}
|
|
2380
|
+
async updateConfig(authorizedCaller, owner = this.walletPubkey) {
|
|
2381
|
+
const [configPda] = PDA.adminConfig(owner, this.programIds);
|
|
2382
|
+
return this.program.methods.updateConfig(authorizedCaller).accounts({ owner, config: configPda }).transaction();
|
|
2383
|
+
}
|
|
2384
|
+
/**
|
|
2385
|
+
* BOTMM sends USDC from their wallet to the market_oracle vault for a condition.
|
|
2386
|
+
* Whitelist-only. No amount validation — caller responsible.
|
|
2387
|
+
*/
|
|
2388
|
+
async distributeMarket(conditionId, amount, collateralMint, marketOracleVault, owner, claimer = this.walletPubkey, payer = claimer) {
|
|
2389
|
+
const [configPda] = PDA.adminConfig(owner, this.programIds);
|
|
2390
|
+
const claimerTokenAcct = getAssociatedTokenAddressSync(collateralMint, claimer);
|
|
2391
|
+
return this.program.methods.distributeMarket(Array.from(conditionId), amount).accounts({
|
|
2392
|
+
claimer,
|
|
2393
|
+
payer,
|
|
2394
|
+
config: configPda,
|
|
2395
|
+
claimerTokenAccount: claimerTokenAcct,
|
|
2396
|
+
marketOracleVault,
|
|
2397
|
+
tokenProgram: TOKEN_PROGRAM_ID
|
|
2398
|
+
}).transaction();
|
|
2399
|
+
}
|
|
2400
|
+
};
|
|
2231
2401
|
|
|
2232
2402
|
// src/idls/oracle.json
|
|
2233
2403
|
var oracle_default = {
|
|
@@ -3794,7 +3964,7 @@ var question_market_default = {
|
|
|
3794
3964
|
{
|
|
3795
3965
|
name: "presale_vault",
|
|
3796
3966
|
docs: [
|
|
3797
|
-
"Presale USDC vault \u2014 closed inside presale program"
|
|
3967
|
+
"Presale USDC vault \u2014 read balance before CPI, closed inside presale program"
|
|
3798
3968
|
],
|
|
3799
3969
|
writable: true
|
|
3800
3970
|
},
|
|
@@ -3804,24 +3974,66 @@ var question_market_default = {
|
|
|
3804
3974
|
{
|
|
3805
3975
|
name: "referral_token_account",
|
|
3806
3976
|
docs: [
|
|
3807
|
-
"Referral address USDC token account"
|
|
3977
|
+
"Referral address USDC token account (10%)"
|
|
3808
3978
|
],
|
|
3809
3979
|
writable: true
|
|
3810
3980
|
},
|
|
3811
3981
|
{
|
|
3812
3982
|
name: "company_token_account",
|
|
3813
3983
|
docs: [
|
|
3814
|
-
"Company address USDC token account"
|
|
3984
|
+
"Company address USDC token account (10%)"
|
|
3815
3985
|
],
|
|
3816
3986
|
writable: true
|
|
3817
3987
|
},
|
|
3818
3988
|
{
|
|
3819
|
-
name: "
|
|
3989
|
+
name: "admin_vault",
|
|
3820
3990
|
docs: [
|
|
3821
|
-
"
|
|
3991
|
+
"admin_contract vault ATA \u2014 receives 80% instead of BOTMM wallet directly"
|
|
3822
3992
|
],
|
|
3823
3993
|
writable: true
|
|
3824
3994
|
},
|
|
3995
|
+
{
|
|
3996
|
+
name: "admin_config",
|
|
3997
|
+
docs: [
|
|
3998
|
+
"admin_contract config PDA"
|
|
3999
|
+
]
|
|
4000
|
+
},
|
|
4001
|
+
{
|
|
4002
|
+
name: "claim_record",
|
|
4003
|
+
docs: [
|
|
4004
|
+
"ClaimRecord PDA for this conditionId (created by admin_contract CPI)"
|
|
4005
|
+
],
|
|
4006
|
+
writable: true,
|
|
4007
|
+
pda: {
|
|
4008
|
+
seeds: [
|
|
4009
|
+
{
|
|
4010
|
+
kind: "const",
|
|
4011
|
+
value: [
|
|
4012
|
+
99,
|
|
4013
|
+
108,
|
|
4014
|
+
97,
|
|
4015
|
+
105,
|
|
4016
|
+
109,
|
|
4017
|
+
95,
|
|
4018
|
+
114,
|
|
4019
|
+
101,
|
|
4020
|
+
99,
|
|
4021
|
+
111,
|
|
4022
|
+
114,
|
|
4023
|
+
100
|
|
4024
|
+
]
|
|
4025
|
+
},
|
|
4026
|
+
{
|
|
4027
|
+
kind: "arg",
|
|
4028
|
+
path: "condition_id"
|
|
4029
|
+
}
|
|
4030
|
+
],
|
|
4031
|
+
program: {
|
|
4032
|
+
kind: "account",
|
|
4033
|
+
path: "admin_program"
|
|
4034
|
+
}
|
|
4035
|
+
}
|
|
4036
|
+
},
|
|
3825
4037
|
{
|
|
3826
4038
|
name: "payer",
|
|
3827
4039
|
docs: [
|
|
@@ -3833,6 +4045,10 @@ var question_market_default = {
|
|
|
3833
4045
|
name: "presale_program",
|
|
3834
4046
|
address: "2Rnw1VoEtsUMQ7wkvYZjDehqSqRob6uNkeymDfvKrquB"
|
|
3835
4047
|
},
|
|
4048
|
+
{
|
|
4049
|
+
name: "admin_program",
|
|
4050
|
+
address: "4NdD5962SfGqofmeyjfifJpdGnwTAiKaUKB5Z42UDc9T"
|
|
4051
|
+
},
|
|
3836
4052
|
{
|
|
3837
4053
|
name: "token_program",
|
|
3838
4054
|
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
@@ -3846,7 +4062,17 @@ var question_market_default = {
|
|
|
3846
4062
|
address: "11111111111111111111111111111111"
|
|
3847
4063
|
}
|
|
3848
4064
|
],
|
|
3849
|
-
args: [
|
|
4065
|
+
args: [
|
|
4066
|
+
{
|
|
4067
|
+
name: "condition_id",
|
|
4068
|
+
type: {
|
|
4069
|
+
array: [
|
|
4070
|
+
"u8",
|
|
4071
|
+
32
|
|
4072
|
+
]
|
|
4073
|
+
}
|
|
4074
|
+
}
|
|
4075
|
+
]
|
|
3850
4076
|
},
|
|
3851
4077
|
{
|
|
3852
4078
|
name: "collect_trading_fee",
|
|
@@ -13194,85 +13420,1067 @@ var market_oracle_default = {
|
|
|
13194
13420
|
]
|
|
13195
13421
|
};
|
|
13196
13422
|
|
|
13197
|
-
// src/
|
|
13198
|
-
var
|
|
13199
|
-
|
|
13200
|
-
|
|
13201
|
-
|
|
13202
|
-
|
|
13203
|
-
|
|
13204
|
-
|
|
13205
|
-
|
|
13206
|
-
|
|
13207
|
-
|
|
13208
|
-
|
|
13209
|
-
|
|
13210
|
-
|
|
13211
|
-
|
|
13212
|
-
|
|
13213
|
-
|
|
13214
|
-
|
|
13215
|
-
|
|
13216
|
-
|
|
13217
|
-
|
|
13218
|
-
|
|
13219
|
-
|
|
13220
|
-
|
|
13221
|
-
|
|
13222
|
-
|
|
13223
|
-
|
|
13224
|
-
|
|
13225
|
-
|
|
13226
|
-
|
|
13227
|
-
|
|
13228
|
-
|
|
13229
|
-
|
|
13230
|
-
|
|
13231
|
-
|
|
13232
|
-
|
|
13233
|
-
|
|
13234
|
-
|
|
13235
|
-
|
|
13236
|
-
|
|
13237
|
-
|
|
13238
|
-
|
|
13239
|
-
|
|
13240
|
-
|
|
13241
|
-
|
|
13242
|
-
|
|
13243
|
-
|
|
13244
|
-
|
|
13245
|
-
|
|
13246
|
-
|
|
13247
|
-
|
|
13248
|
-
|
|
13249
|
-
|
|
13250
|
-
|
|
13251
|
-
|
|
13252
|
-
|
|
13253
|
-
|
|
13254
|
-
|
|
13255
|
-
|
|
13256
|
-
|
|
13257
|
-
|
|
13258
|
-
|
|
13259
|
-
|
|
13260
|
-
|
|
13261
|
-
|
|
13262
|
-
|
|
13263
|
-
|
|
13264
|
-
|
|
13265
|
-
|
|
13266
|
-
|
|
13267
|
-
|
|
13268
|
-
|
|
13269
|
-
|
|
13270
|
-
|
|
13271
|
-
|
|
13272
|
-
|
|
13273
|
-
|
|
13274
|
-
|
|
13275
|
-
|
|
13423
|
+
// src/idls/admin_contract.json
|
|
13424
|
+
var admin_contract_default = {
|
|
13425
|
+
address: "4NdD5962SfGqofmeyjfifJpdGnwTAiKaUKB5Z42UDc9T",
|
|
13426
|
+
metadata: {
|
|
13427
|
+
name: "admin_contract",
|
|
13428
|
+
version: "0.1.0",
|
|
13429
|
+
spec: "0.1.0",
|
|
13430
|
+
description: "Admin contract for XMarket \u2014 whitelist, presale revenue custody, claim"
|
|
13431
|
+
},
|
|
13432
|
+
instructions: [
|
|
13433
|
+
{
|
|
13434
|
+
name: "add_admin",
|
|
13435
|
+
discriminator: [
|
|
13436
|
+
177,
|
|
13437
|
+
236,
|
|
13438
|
+
33,
|
|
13439
|
+
205,
|
|
13440
|
+
124,
|
|
13441
|
+
152,
|
|
13442
|
+
55,
|
|
13443
|
+
186
|
|
13444
|
+
],
|
|
13445
|
+
accounts: [
|
|
13446
|
+
{
|
|
13447
|
+
name: "owner",
|
|
13448
|
+
signer: true
|
|
13449
|
+
},
|
|
13450
|
+
{
|
|
13451
|
+
name: "config",
|
|
13452
|
+
writable: true,
|
|
13453
|
+
pda: {
|
|
13454
|
+
seeds: [
|
|
13455
|
+
{
|
|
13456
|
+
kind: "const",
|
|
13457
|
+
value: [
|
|
13458
|
+
97,
|
|
13459
|
+
100,
|
|
13460
|
+
109,
|
|
13461
|
+
105,
|
|
13462
|
+
110,
|
|
13463
|
+
95,
|
|
13464
|
+
99,
|
|
13465
|
+
111,
|
|
13466
|
+
110,
|
|
13467
|
+
102,
|
|
13468
|
+
105,
|
|
13469
|
+
103
|
|
13470
|
+
]
|
|
13471
|
+
},
|
|
13472
|
+
{
|
|
13473
|
+
kind: "account",
|
|
13474
|
+
path: "config.owner",
|
|
13475
|
+
account: "AdminConfig"
|
|
13476
|
+
}
|
|
13477
|
+
]
|
|
13478
|
+
}
|
|
13479
|
+
}
|
|
13480
|
+
],
|
|
13481
|
+
args: [
|
|
13482
|
+
{
|
|
13483
|
+
name: "address",
|
|
13484
|
+
type: "pubkey"
|
|
13485
|
+
}
|
|
13486
|
+
]
|
|
13487
|
+
},
|
|
13488
|
+
{
|
|
13489
|
+
name: "add_to_whitelist",
|
|
13490
|
+
discriminator: [
|
|
13491
|
+
157,
|
|
13492
|
+
211,
|
|
13493
|
+
52,
|
|
13494
|
+
54,
|
|
13495
|
+
144,
|
|
13496
|
+
81,
|
|
13497
|
+
5,
|
|
13498
|
+
55
|
|
13499
|
+
],
|
|
13500
|
+
accounts: [
|
|
13501
|
+
{
|
|
13502
|
+
name: "admin",
|
|
13503
|
+
signer: true
|
|
13504
|
+
},
|
|
13505
|
+
{
|
|
13506
|
+
name: "payer",
|
|
13507
|
+
writable: true,
|
|
13508
|
+
signer: true
|
|
13509
|
+
},
|
|
13510
|
+
{
|
|
13511
|
+
name: "config",
|
|
13512
|
+
writable: true,
|
|
13513
|
+
pda: {
|
|
13514
|
+
seeds: [
|
|
13515
|
+
{
|
|
13516
|
+
kind: "const",
|
|
13517
|
+
value: [
|
|
13518
|
+
97,
|
|
13519
|
+
100,
|
|
13520
|
+
109,
|
|
13521
|
+
105,
|
|
13522
|
+
110,
|
|
13523
|
+
95,
|
|
13524
|
+
99,
|
|
13525
|
+
111,
|
|
13526
|
+
110,
|
|
13527
|
+
102,
|
|
13528
|
+
105,
|
|
13529
|
+
103
|
|
13530
|
+
]
|
|
13531
|
+
},
|
|
13532
|
+
{
|
|
13533
|
+
kind: "account",
|
|
13534
|
+
path: "config.owner",
|
|
13535
|
+
account: "AdminConfig"
|
|
13536
|
+
}
|
|
13537
|
+
]
|
|
13538
|
+
}
|
|
13539
|
+
}
|
|
13540
|
+
],
|
|
13541
|
+
args: [
|
|
13542
|
+
{
|
|
13543
|
+
name: "address",
|
|
13544
|
+
type: "pubkey"
|
|
13545
|
+
}
|
|
13546
|
+
]
|
|
13547
|
+
},
|
|
13548
|
+
{
|
|
13549
|
+
name: "claim",
|
|
13550
|
+
discriminator: [
|
|
13551
|
+
62,
|
|
13552
|
+
198,
|
|
13553
|
+
214,
|
|
13554
|
+
193,
|
|
13555
|
+
213,
|
|
13556
|
+
159,
|
|
13557
|
+
108,
|
|
13558
|
+
210
|
|
13559
|
+
],
|
|
13560
|
+
accounts: [
|
|
13561
|
+
{
|
|
13562
|
+
name: "claimer",
|
|
13563
|
+
signer: true
|
|
13564
|
+
},
|
|
13565
|
+
{
|
|
13566
|
+
name: "payer",
|
|
13567
|
+
writable: true,
|
|
13568
|
+
signer: true
|
|
13569
|
+
},
|
|
13570
|
+
{
|
|
13571
|
+
name: "config",
|
|
13572
|
+
pda: {
|
|
13573
|
+
seeds: [
|
|
13574
|
+
{
|
|
13575
|
+
kind: "const",
|
|
13576
|
+
value: [
|
|
13577
|
+
97,
|
|
13578
|
+
100,
|
|
13579
|
+
109,
|
|
13580
|
+
105,
|
|
13581
|
+
110,
|
|
13582
|
+
95,
|
|
13583
|
+
99,
|
|
13584
|
+
111,
|
|
13585
|
+
110,
|
|
13586
|
+
102,
|
|
13587
|
+
105,
|
|
13588
|
+
103
|
|
13589
|
+
]
|
|
13590
|
+
},
|
|
13591
|
+
{
|
|
13592
|
+
kind: "account",
|
|
13593
|
+
path: "config.owner",
|
|
13594
|
+
account: "AdminConfig"
|
|
13595
|
+
}
|
|
13596
|
+
]
|
|
13597
|
+
}
|
|
13598
|
+
},
|
|
13599
|
+
{
|
|
13600
|
+
name: "admin_vault",
|
|
13601
|
+
docs: [
|
|
13602
|
+
"ATA owned by config PDA"
|
|
13603
|
+
],
|
|
13604
|
+
writable: true,
|
|
13605
|
+
pda: {
|
|
13606
|
+
seeds: [
|
|
13607
|
+
{
|
|
13608
|
+
kind: "account",
|
|
13609
|
+
path: "config"
|
|
13610
|
+
},
|
|
13611
|
+
{
|
|
13612
|
+
kind: "const",
|
|
13613
|
+
value: [
|
|
13614
|
+
6,
|
|
13615
|
+
221,
|
|
13616
|
+
246,
|
|
13617
|
+
225,
|
|
13618
|
+
215,
|
|
13619
|
+
101,
|
|
13620
|
+
161,
|
|
13621
|
+
147,
|
|
13622
|
+
217,
|
|
13623
|
+
203,
|
|
13624
|
+
225,
|
|
13625
|
+
70,
|
|
13626
|
+
206,
|
|
13627
|
+
235,
|
|
13628
|
+
121,
|
|
13629
|
+
172,
|
|
13630
|
+
28,
|
|
13631
|
+
180,
|
|
13632
|
+
133,
|
|
13633
|
+
237,
|
|
13634
|
+
95,
|
|
13635
|
+
91,
|
|
13636
|
+
55,
|
|
13637
|
+
145,
|
|
13638
|
+
58,
|
|
13639
|
+
140,
|
|
13640
|
+
245,
|
|
13641
|
+
133,
|
|
13642
|
+
126,
|
|
13643
|
+
255,
|
|
13644
|
+
0,
|
|
13645
|
+
169
|
|
13646
|
+
]
|
|
13647
|
+
},
|
|
13648
|
+
{
|
|
13649
|
+
kind: "account",
|
|
13650
|
+
path: "config.collateral_mint",
|
|
13651
|
+
account: "AdminConfig"
|
|
13652
|
+
}
|
|
13653
|
+
],
|
|
13654
|
+
program: {
|
|
13655
|
+
kind: "const",
|
|
13656
|
+
value: [
|
|
13657
|
+
140,
|
|
13658
|
+
151,
|
|
13659
|
+
37,
|
|
13660
|
+
143,
|
|
13661
|
+
78,
|
|
13662
|
+
36,
|
|
13663
|
+
137,
|
|
13664
|
+
241,
|
|
13665
|
+
187,
|
|
13666
|
+
61,
|
|
13667
|
+
16,
|
|
13668
|
+
41,
|
|
13669
|
+
20,
|
|
13670
|
+
142,
|
|
13671
|
+
13,
|
|
13672
|
+
131,
|
|
13673
|
+
11,
|
|
13674
|
+
90,
|
|
13675
|
+
19,
|
|
13676
|
+
153,
|
|
13677
|
+
218,
|
|
13678
|
+
255,
|
|
13679
|
+
16,
|
|
13680
|
+
132,
|
|
13681
|
+
4,
|
|
13682
|
+
142,
|
|
13683
|
+
123,
|
|
13684
|
+
216,
|
|
13685
|
+
219,
|
|
13686
|
+
233,
|
|
13687
|
+
248,
|
|
13688
|
+
89
|
|
13689
|
+
]
|
|
13690
|
+
}
|
|
13691
|
+
}
|
|
13692
|
+
},
|
|
13693
|
+
{
|
|
13694
|
+
name: "claim_record",
|
|
13695
|
+
writable: true,
|
|
13696
|
+
pda: {
|
|
13697
|
+
seeds: [
|
|
13698
|
+
{
|
|
13699
|
+
kind: "const",
|
|
13700
|
+
value: [
|
|
13701
|
+
99,
|
|
13702
|
+
108,
|
|
13703
|
+
97,
|
|
13704
|
+
105,
|
|
13705
|
+
109,
|
|
13706
|
+
95,
|
|
13707
|
+
114,
|
|
13708
|
+
101,
|
|
13709
|
+
99,
|
|
13710
|
+
111,
|
|
13711
|
+
114,
|
|
13712
|
+
100
|
|
13713
|
+
]
|
|
13714
|
+
},
|
|
13715
|
+
{
|
|
13716
|
+
kind: "arg",
|
|
13717
|
+
path: "condition_id"
|
|
13718
|
+
}
|
|
13719
|
+
]
|
|
13720
|
+
}
|
|
13721
|
+
},
|
|
13722
|
+
{
|
|
13723
|
+
name: "claimer_token_account",
|
|
13724
|
+
docs: [
|
|
13725
|
+
"Claimer's USDC token account (receives payout)"
|
|
13726
|
+
],
|
|
13727
|
+
writable: true
|
|
13728
|
+
},
|
|
13729
|
+
{
|
|
13730
|
+
name: "token_program",
|
|
13731
|
+
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
13732
|
+
}
|
|
13733
|
+
],
|
|
13734
|
+
args: [
|
|
13735
|
+
{
|
|
13736
|
+
name: "condition_id",
|
|
13737
|
+
type: {
|
|
13738
|
+
array: [
|
|
13739
|
+
"u8",
|
|
13740
|
+
32
|
|
13741
|
+
]
|
|
13742
|
+
}
|
|
13743
|
+
}
|
|
13744
|
+
]
|
|
13745
|
+
},
|
|
13746
|
+
{
|
|
13747
|
+
name: "distribute_market",
|
|
13748
|
+
discriminator: [
|
|
13749
|
+
130,
|
|
13750
|
+
221,
|
|
13751
|
+
123,
|
|
13752
|
+
201,
|
|
13753
|
+
185,
|
|
13754
|
+
168,
|
|
13755
|
+
63,
|
|
13756
|
+
19
|
|
13757
|
+
],
|
|
13758
|
+
accounts: [
|
|
13759
|
+
{
|
|
13760
|
+
name: "claimer",
|
|
13761
|
+
docs: [
|
|
13762
|
+
"BOTMM \u2014 must be in whitelist"
|
|
13763
|
+
],
|
|
13764
|
+
signer: true
|
|
13765
|
+
},
|
|
13766
|
+
{
|
|
13767
|
+
name: "payer",
|
|
13768
|
+
writable: true,
|
|
13769
|
+
signer: true
|
|
13770
|
+
},
|
|
13771
|
+
{
|
|
13772
|
+
name: "config",
|
|
13773
|
+
pda: {
|
|
13774
|
+
seeds: [
|
|
13775
|
+
{
|
|
13776
|
+
kind: "const",
|
|
13777
|
+
value: [
|
|
13778
|
+
97,
|
|
13779
|
+
100,
|
|
13780
|
+
109,
|
|
13781
|
+
105,
|
|
13782
|
+
110,
|
|
13783
|
+
95,
|
|
13784
|
+
99,
|
|
13785
|
+
111,
|
|
13786
|
+
110,
|
|
13787
|
+
102,
|
|
13788
|
+
105,
|
|
13789
|
+
103
|
|
13790
|
+
]
|
|
13791
|
+
},
|
|
13792
|
+
{
|
|
13793
|
+
kind: "account",
|
|
13794
|
+
path: "config.owner",
|
|
13795
|
+
account: "AdminConfig"
|
|
13796
|
+
}
|
|
13797
|
+
]
|
|
13798
|
+
}
|
|
13799
|
+
},
|
|
13800
|
+
{
|
|
13801
|
+
name: "claimer_token_account",
|
|
13802
|
+
docs: [
|
|
13803
|
+
"BOTMM's USDC token account (source \u2014 claimer signs)"
|
|
13804
|
+
],
|
|
13805
|
+
writable: true
|
|
13806
|
+
},
|
|
13807
|
+
{
|
|
13808
|
+
name: "market_oracle_vault",
|
|
13809
|
+
docs: [
|
|
13810
|
+
"market_oracle vault \u2014 MST holder reward pool for this condition"
|
|
13811
|
+
],
|
|
13812
|
+
writable: true
|
|
13813
|
+
},
|
|
13814
|
+
{
|
|
13815
|
+
name: "token_program",
|
|
13816
|
+
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
13817
|
+
}
|
|
13818
|
+
],
|
|
13819
|
+
args: [
|
|
13820
|
+
{
|
|
13821
|
+
name: "condition_id",
|
|
13822
|
+
type: {
|
|
13823
|
+
array: [
|
|
13824
|
+
"u8",
|
|
13825
|
+
32
|
|
13826
|
+
]
|
|
13827
|
+
}
|
|
13828
|
+
},
|
|
13829
|
+
{
|
|
13830
|
+
name: "amount",
|
|
13831
|
+
type: "u64"
|
|
13832
|
+
}
|
|
13833
|
+
]
|
|
13834
|
+
},
|
|
13835
|
+
{
|
|
13836
|
+
name: "initialize",
|
|
13837
|
+
discriminator: [
|
|
13838
|
+
175,
|
|
13839
|
+
175,
|
|
13840
|
+
109,
|
|
13841
|
+
31,
|
|
13842
|
+
13,
|
|
13843
|
+
152,
|
|
13844
|
+
155,
|
|
13845
|
+
237
|
|
13846
|
+
],
|
|
13847
|
+
accounts: [
|
|
13848
|
+
{
|
|
13849
|
+
name: "owner",
|
|
13850
|
+
writable: true,
|
|
13851
|
+
signer: true
|
|
13852
|
+
},
|
|
13853
|
+
{
|
|
13854
|
+
name: "config",
|
|
13855
|
+
writable: true,
|
|
13856
|
+
pda: {
|
|
13857
|
+
seeds: [
|
|
13858
|
+
{
|
|
13859
|
+
kind: "const",
|
|
13860
|
+
value: [
|
|
13861
|
+
97,
|
|
13862
|
+
100,
|
|
13863
|
+
109,
|
|
13864
|
+
105,
|
|
13865
|
+
110,
|
|
13866
|
+
95,
|
|
13867
|
+
99,
|
|
13868
|
+
111,
|
|
13869
|
+
110,
|
|
13870
|
+
102,
|
|
13871
|
+
105,
|
|
13872
|
+
103
|
|
13873
|
+
]
|
|
13874
|
+
},
|
|
13875
|
+
{
|
|
13876
|
+
kind: "account",
|
|
13877
|
+
path: "owner"
|
|
13878
|
+
}
|
|
13879
|
+
]
|
|
13880
|
+
}
|
|
13881
|
+
},
|
|
13882
|
+
{
|
|
13883
|
+
name: "collateral_mint"
|
|
13884
|
+
},
|
|
13885
|
+
{
|
|
13886
|
+
name: "admin_vault",
|
|
13887
|
+
docs: [
|
|
13888
|
+
"ATA owned by config PDA \u2014 holds USDC for unclaimed presale revenue"
|
|
13889
|
+
],
|
|
13890
|
+
writable: true,
|
|
13891
|
+
pda: {
|
|
13892
|
+
seeds: [
|
|
13893
|
+
{
|
|
13894
|
+
kind: "account",
|
|
13895
|
+
path: "config"
|
|
13896
|
+
},
|
|
13897
|
+
{
|
|
13898
|
+
kind: "const",
|
|
13899
|
+
value: [
|
|
13900
|
+
6,
|
|
13901
|
+
221,
|
|
13902
|
+
246,
|
|
13903
|
+
225,
|
|
13904
|
+
215,
|
|
13905
|
+
101,
|
|
13906
|
+
161,
|
|
13907
|
+
147,
|
|
13908
|
+
217,
|
|
13909
|
+
203,
|
|
13910
|
+
225,
|
|
13911
|
+
70,
|
|
13912
|
+
206,
|
|
13913
|
+
235,
|
|
13914
|
+
121,
|
|
13915
|
+
172,
|
|
13916
|
+
28,
|
|
13917
|
+
180,
|
|
13918
|
+
133,
|
|
13919
|
+
237,
|
|
13920
|
+
95,
|
|
13921
|
+
91,
|
|
13922
|
+
55,
|
|
13923
|
+
145,
|
|
13924
|
+
58,
|
|
13925
|
+
140,
|
|
13926
|
+
245,
|
|
13927
|
+
133,
|
|
13928
|
+
126,
|
|
13929
|
+
255,
|
|
13930
|
+
0,
|
|
13931
|
+
169
|
|
13932
|
+
]
|
|
13933
|
+
},
|
|
13934
|
+
{
|
|
13935
|
+
kind: "account",
|
|
13936
|
+
path: "collateral_mint"
|
|
13937
|
+
}
|
|
13938
|
+
],
|
|
13939
|
+
program: {
|
|
13940
|
+
kind: "const",
|
|
13941
|
+
value: [
|
|
13942
|
+
140,
|
|
13943
|
+
151,
|
|
13944
|
+
37,
|
|
13945
|
+
143,
|
|
13946
|
+
78,
|
|
13947
|
+
36,
|
|
13948
|
+
137,
|
|
13949
|
+
241,
|
|
13950
|
+
187,
|
|
13951
|
+
61,
|
|
13952
|
+
16,
|
|
13953
|
+
41,
|
|
13954
|
+
20,
|
|
13955
|
+
142,
|
|
13956
|
+
13,
|
|
13957
|
+
131,
|
|
13958
|
+
11,
|
|
13959
|
+
90,
|
|
13960
|
+
19,
|
|
13961
|
+
153,
|
|
13962
|
+
218,
|
|
13963
|
+
255,
|
|
13964
|
+
16,
|
|
13965
|
+
132,
|
|
13966
|
+
4,
|
|
13967
|
+
142,
|
|
13968
|
+
123,
|
|
13969
|
+
216,
|
|
13970
|
+
219,
|
|
13971
|
+
233,
|
|
13972
|
+
248,
|
|
13973
|
+
89
|
|
13974
|
+
]
|
|
13975
|
+
}
|
|
13976
|
+
}
|
|
13977
|
+
},
|
|
13978
|
+
{
|
|
13979
|
+
name: "token_program",
|
|
13980
|
+
address: "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"
|
|
13981
|
+
},
|
|
13982
|
+
{
|
|
13983
|
+
name: "associated_token_program",
|
|
13984
|
+
address: "ATokenGPvbdGVxr1b2hvZbsiqW5xWH25efTNsLJA8knL"
|
|
13985
|
+
},
|
|
13986
|
+
{
|
|
13987
|
+
name: "system_program",
|
|
13988
|
+
address: "11111111111111111111111111111111"
|
|
13989
|
+
}
|
|
13990
|
+
],
|
|
13991
|
+
args: [
|
|
13992
|
+
{
|
|
13993
|
+
name: "authorized_caller",
|
|
13994
|
+
type: "pubkey"
|
|
13995
|
+
}
|
|
13996
|
+
]
|
|
13997
|
+
},
|
|
13998
|
+
{
|
|
13999
|
+
name: "remove_admin",
|
|
14000
|
+
discriminator: [
|
|
14001
|
+
74,
|
|
14002
|
+
202,
|
|
14003
|
+
71,
|
|
14004
|
+
106,
|
|
14005
|
+
252,
|
|
14006
|
+
31,
|
|
14007
|
+
72,
|
|
14008
|
+
183
|
|
14009
|
+
],
|
|
14010
|
+
accounts: [
|
|
14011
|
+
{
|
|
14012
|
+
name: "owner",
|
|
14013
|
+
signer: true
|
|
14014
|
+
},
|
|
14015
|
+
{
|
|
14016
|
+
name: "config",
|
|
14017
|
+
writable: true,
|
|
14018
|
+
pda: {
|
|
14019
|
+
seeds: [
|
|
14020
|
+
{
|
|
14021
|
+
kind: "const",
|
|
14022
|
+
value: [
|
|
14023
|
+
97,
|
|
14024
|
+
100,
|
|
14025
|
+
109,
|
|
14026
|
+
105,
|
|
14027
|
+
110,
|
|
14028
|
+
95,
|
|
14029
|
+
99,
|
|
14030
|
+
111,
|
|
14031
|
+
110,
|
|
14032
|
+
102,
|
|
14033
|
+
105,
|
|
14034
|
+
103
|
|
14035
|
+
]
|
|
14036
|
+
},
|
|
14037
|
+
{
|
|
14038
|
+
kind: "account",
|
|
14039
|
+
path: "config.owner",
|
|
14040
|
+
account: "AdminConfig"
|
|
14041
|
+
}
|
|
14042
|
+
]
|
|
14043
|
+
}
|
|
14044
|
+
}
|
|
14045
|
+
],
|
|
14046
|
+
args: [
|
|
14047
|
+
{
|
|
14048
|
+
name: "address",
|
|
14049
|
+
type: "pubkey"
|
|
14050
|
+
}
|
|
14051
|
+
]
|
|
14052
|
+
},
|
|
14053
|
+
{
|
|
14054
|
+
name: "remove_from_whitelist",
|
|
14055
|
+
discriminator: [
|
|
14056
|
+
7,
|
|
14057
|
+
144,
|
|
14058
|
+
216,
|
|
14059
|
+
239,
|
|
14060
|
+
243,
|
|
14061
|
+
236,
|
|
14062
|
+
193,
|
|
14063
|
+
235
|
|
14064
|
+
],
|
|
14065
|
+
accounts: [
|
|
14066
|
+
{
|
|
14067
|
+
name: "admin",
|
|
14068
|
+
signer: true
|
|
14069
|
+
},
|
|
14070
|
+
{
|
|
14071
|
+
name: "payer",
|
|
14072
|
+
writable: true,
|
|
14073
|
+
signer: true
|
|
14074
|
+
},
|
|
14075
|
+
{
|
|
14076
|
+
name: "config",
|
|
14077
|
+
writable: true,
|
|
14078
|
+
pda: {
|
|
14079
|
+
seeds: [
|
|
14080
|
+
{
|
|
14081
|
+
kind: "const",
|
|
14082
|
+
value: [
|
|
14083
|
+
97,
|
|
14084
|
+
100,
|
|
14085
|
+
109,
|
|
14086
|
+
105,
|
|
14087
|
+
110,
|
|
14088
|
+
95,
|
|
14089
|
+
99,
|
|
14090
|
+
111,
|
|
14091
|
+
110,
|
|
14092
|
+
102,
|
|
14093
|
+
105,
|
|
14094
|
+
103
|
|
14095
|
+
]
|
|
14096
|
+
},
|
|
14097
|
+
{
|
|
14098
|
+
kind: "account",
|
|
14099
|
+
path: "config.owner",
|
|
14100
|
+
account: "AdminConfig"
|
|
14101
|
+
}
|
|
14102
|
+
]
|
|
14103
|
+
}
|
|
14104
|
+
}
|
|
14105
|
+
],
|
|
14106
|
+
args: [
|
|
14107
|
+
{
|
|
14108
|
+
name: "address",
|
|
14109
|
+
type: "pubkey"
|
|
14110
|
+
}
|
|
14111
|
+
]
|
|
14112
|
+
},
|
|
14113
|
+
{
|
|
14114
|
+
name: "set_presale_amount",
|
|
14115
|
+
discriminator: [
|
|
14116
|
+
73,
|
|
14117
|
+
71,
|
|
14118
|
+
238,
|
|
14119
|
+
3,
|
|
14120
|
+
202,
|
|
14121
|
+
163,
|
|
14122
|
+
8,
|
|
14123
|
+
254
|
|
14124
|
+
],
|
|
14125
|
+
accounts: [
|
|
14126
|
+
{
|
|
14127
|
+
name: "caller",
|
|
14128
|
+
docs: [
|
|
14129
|
+
"question_market config PDA \u2014 signs this CPI call via seeds"
|
|
14130
|
+
],
|
|
14131
|
+
signer: true
|
|
14132
|
+
},
|
|
14133
|
+
{
|
|
14134
|
+
name: "payer",
|
|
14135
|
+
writable: true,
|
|
14136
|
+
signer: true
|
|
14137
|
+
},
|
|
14138
|
+
{
|
|
14139
|
+
name: "config",
|
|
14140
|
+
pda: {
|
|
14141
|
+
seeds: [
|
|
14142
|
+
{
|
|
14143
|
+
kind: "const",
|
|
14144
|
+
value: [
|
|
14145
|
+
97,
|
|
14146
|
+
100,
|
|
14147
|
+
109,
|
|
14148
|
+
105,
|
|
14149
|
+
110,
|
|
14150
|
+
95,
|
|
14151
|
+
99,
|
|
14152
|
+
111,
|
|
14153
|
+
110,
|
|
14154
|
+
102,
|
|
14155
|
+
105,
|
|
14156
|
+
103
|
|
14157
|
+
]
|
|
14158
|
+
},
|
|
14159
|
+
{
|
|
14160
|
+
kind: "account",
|
|
14161
|
+
path: "config.owner",
|
|
14162
|
+
account: "AdminConfig"
|
|
14163
|
+
}
|
|
14164
|
+
]
|
|
14165
|
+
}
|
|
14166
|
+
},
|
|
14167
|
+
{
|
|
14168
|
+
name: "claim_record",
|
|
14169
|
+
writable: true,
|
|
14170
|
+
pda: {
|
|
14171
|
+
seeds: [
|
|
14172
|
+
{
|
|
14173
|
+
kind: "const",
|
|
14174
|
+
value: [
|
|
14175
|
+
99,
|
|
14176
|
+
108,
|
|
14177
|
+
97,
|
|
14178
|
+
105,
|
|
14179
|
+
109,
|
|
14180
|
+
95,
|
|
14181
|
+
114,
|
|
14182
|
+
101,
|
|
14183
|
+
99,
|
|
14184
|
+
111,
|
|
14185
|
+
114,
|
|
14186
|
+
100
|
|
14187
|
+
]
|
|
14188
|
+
},
|
|
14189
|
+
{
|
|
14190
|
+
kind: "arg",
|
|
14191
|
+
path: "condition_id"
|
|
14192
|
+
}
|
|
14193
|
+
]
|
|
14194
|
+
}
|
|
14195
|
+
},
|
|
14196
|
+
{
|
|
14197
|
+
name: "system_program",
|
|
14198
|
+
address: "11111111111111111111111111111111"
|
|
14199
|
+
}
|
|
14200
|
+
],
|
|
14201
|
+
args: [
|
|
14202
|
+
{
|
|
14203
|
+
name: "condition_id",
|
|
14204
|
+
type: {
|
|
14205
|
+
array: [
|
|
14206
|
+
"u8",
|
|
14207
|
+
32
|
|
14208
|
+
]
|
|
14209
|
+
}
|
|
14210
|
+
},
|
|
14211
|
+
{
|
|
14212
|
+
name: "amount",
|
|
14213
|
+
type: "u64"
|
|
14214
|
+
}
|
|
14215
|
+
]
|
|
14216
|
+
},
|
|
14217
|
+
{
|
|
14218
|
+
name: "update_config",
|
|
14219
|
+
discriminator: [
|
|
14220
|
+
29,
|
|
14221
|
+
158,
|
|
14222
|
+
252,
|
|
14223
|
+
191,
|
|
14224
|
+
10,
|
|
14225
|
+
83,
|
|
14226
|
+
219,
|
|
14227
|
+
99
|
|
14228
|
+
],
|
|
14229
|
+
accounts: [
|
|
14230
|
+
{
|
|
14231
|
+
name: "owner",
|
|
14232
|
+
signer: true
|
|
14233
|
+
},
|
|
14234
|
+
{
|
|
14235
|
+
name: "config",
|
|
14236
|
+
writable: true,
|
|
14237
|
+
pda: {
|
|
14238
|
+
seeds: [
|
|
14239
|
+
{
|
|
14240
|
+
kind: "const",
|
|
14241
|
+
value: [
|
|
14242
|
+
97,
|
|
14243
|
+
100,
|
|
14244
|
+
109,
|
|
14245
|
+
105,
|
|
14246
|
+
110,
|
|
14247
|
+
95,
|
|
14248
|
+
99,
|
|
14249
|
+
111,
|
|
14250
|
+
110,
|
|
14251
|
+
102,
|
|
14252
|
+
105,
|
|
14253
|
+
103
|
|
14254
|
+
]
|
|
14255
|
+
},
|
|
14256
|
+
{
|
|
14257
|
+
kind: "account",
|
|
14258
|
+
path: "config.owner",
|
|
14259
|
+
account: "AdminConfig"
|
|
14260
|
+
}
|
|
14261
|
+
]
|
|
14262
|
+
}
|
|
14263
|
+
}
|
|
14264
|
+
],
|
|
14265
|
+
args: [
|
|
14266
|
+
{
|
|
14267
|
+
name: "authorized_caller",
|
|
14268
|
+
type: "pubkey"
|
|
14269
|
+
}
|
|
14270
|
+
]
|
|
14271
|
+
}
|
|
14272
|
+
],
|
|
14273
|
+
accounts: [
|
|
14274
|
+
{
|
|
14275
|
+
name: "AdminConfig",
|
|
14276
|
+
discriminator: [
|
|
14277
|
+
156,
|
|
14278
|
+
10,
|
|
14279
|
+
79,
|
|
14280
|
+
161,
|
|
14281
|
+
71,
|
|
14282
|
+
9,
|
|
14283
|
+
62,
|
|
14284
|
+
77
|
|
14285
|
+
]
|
|
14286
|
+
},
|
|
14287
|
+
{
|
|
14288
|
+
name: "ClaimRecord",
|
|
14289
|
+
discriminator: [
|
|
14290
|
+
57,
|
|
14291
|
+
229,
|
|
14292
|
+
0,
|
|
14293
|
+
9,
|
|
14294
|
+
65,
|
|
14295
|
+
62,
|
|
14296
|
+
96,
|
|
14297
|
+
7
|
|
14298
|
+
]
|
|
14299
|
+
}
|
|
14300
|
+
],
|
|
14301
|
+
types: [
|
|
14302
|
+
{
|
|
14303
|
+
name: "AdminConfig",
|
|
14304
|
+
type: {
|
|
14305
|
+
kind: "struct",
|
|
14306
|
+
fields: [
|
|
14307
|
+
{
|
|
14308
|
+
name: "version",
|
|
14309
|
+
type: "u8"
|
|
14310
|
+
},
|
|
14311
|
+
{
|
|
14312
|
+
name: "owner",
|
|
14313
|
+
type: "pubkey"
|
|
14314
|
+
},
|
|
14315
|
+
{
|
|
14316
|
+
name: "collateral_mint",
|
|
14317
|
+
type: "pubkey"
|
|
14318
|
+
},
|
|
14319
|
+
{
|
|
14320
|
+
name: "authorized_caller",
|
|
14321
|
+
docs: [
|
|
14322
|
+
"question_market config PDA \u2014 only this can call set_presale_amount"
|
|
14323
|
+
],
|
|
14324
|
+
type: "pubkey"
|
|
14325
|
+
},
|
|
14326
|
+
{
|
|
14327
|
+
name: "admin_whitelist",
|
|
14328
|
+
type: {
|
|
14329
|
+
array: [
|
|
14330
|
+
"pubkey",
|
|
14331
|
+
10
|
|
14332
|
+
]
|
|
14333
|
+
}
|
|
14334
|
+
},
|
|
14335
|
+
{
|
|
14336
|
+
name: "admin_whitelist_len",
|
|
14337
|
+
type: "u8"
|
|
14338
|
+
},
|
|
14339
|
+
{
|
|
14340
|
+
name: "whitelist",
|
|
14341
|
+
type: {
|
|
14342
|
+
array: [
|
|
14343
|
+
"pubkey",
|
|
14344
|
+
30
|
|
14345
|
+
]
|
|
14346
|
+
}
|
|
14347
|
+
},
|
|
14348
|
+
{
|
|
14349
|
+
name: "whitelist_len",
|
|
14350
|
+
type: "u8"
|
|
14351
|
+
},
|
|
14352
|
+
{
|
|
14353
|
+
name: "bump",
|
|
14354
|
+
type: "u8"
|
|
14355
|
+
},
|
|
14356
|
+
{
|
|
14357
|
+
name: "_reserved",
|
|
14358
|
+
type: {
|
|
14359
|
+
array: [
|
|
14360
|
+
"u8",
|
|
14361
|
+
64
|
|
14362
|
+
]
|
|
14363
|
+
}
|
|
14364
|
+
}
|
|
14365
|
+
]
|
|
14366
|
+
}
|
|
14367
|
+
},
|
|
14368
|
+
{
|
|
14369
|
+
name: "ClaimRecord",
|
|
14370
|
+
type: {
|
|
14371
|
+
kind: "struct",
|
|
14372
|
+
fields: [
|
|
14373
|
+
{
|
|
14374
|
+
name: "condition_id",
|
|
14375
|
+
type: {
|
|
14376
|
+
array: [
|
|
14377
|
+
"u8",
|
|
14378
|
+
32
|
|
14379
|
+
]
|
|
14380
|
+
}
|
|
14381
|
+
},
|
|
14382
|
+
{
|
|
14383
|
+
name: "amount",
|
|
14384
|
+
type: "u64"
|
|
14385
|
+
},
|
|
14386
|
+
{
|
|
14387
|
+
name: "bump",
|
|
14388
|
+
type: "u8"
|
|
14389
|
+
}
|
|
14390
|
+
]
|
|
14391
|
+
}
|
|
14392
|
+
}
|
|
14393
|
+
]
|
|
14394
|
+
};
|
|
14395
|
+
|
|
14396
|
+
// src/sdk.ts
|
|
14397
|
+
var XMarketSDK = class {
|
|
14398
|
+
// lazy-init in get admin()
|
|
14399
|
+
constructor(config, wallet, marketOwner) {
|
|
14400
|
+
this.networkConfig = config;
|
|
14401
|
+
this.provider = new anchor5.AnchorProvider(
|
|
14402
|
+
new Connection(config.rpcUrl, "confirmed"),
|
|
14403
|
+
wallet,
|
|
14404
|
+
{ commitment: "confirmed", preflightCommitment: "confirmed" }
|
|
14405
|
+
);
|
|
14406
|
+
anchor5.setProvider(this.provider);
|
|
14407
|
+
this._programIds = config.programIds;
|
|
14408
|
+
this._marketOwner = marketOwner ?? wallet.publicKey;
|
|
14409
|
+
}
|
|
14410
|
+
_withAddress(idl, address) {
|
|
14411
|
+
return { ...idl, address: address.toBase58() };
|
|
14412
|
+
}
|
|
14413
|
+
get oracle() {
|
|
14414
|
+
if (!this._oracle) {
|
|
14415
|
+
const program = new anchor5.Program(this._withAddress(oracle_default, this._programIds.oracle), this.provider);
|
|
14416
|
+
this._oracle = new OracleClient(program, this.provider, this._programIds);
|
|
14417
|
+
}
|
|
14418
|
+
return this._oracle;
|
|
14419
|
+
}
|
|
14420
|
+
get hook() {
|
|
14421
|
+
if (!this._hook) {
|
|
14422
|
+
const program = new anchor5.Program(this._withAddress(hook_default, this._programIds.hook), this.provider);
|
|
14423
|
+
this._hook = new HookClient(program, this.provider, this._programIds);
|
|
14424
|
+
}
|
|
14425
|
+
return this._hook;
|
|
14426
|
+
}
|
|
14427
|
+
get market() {
|
|
14428
|
+
if (!this._market) {
|
|
14429
|
+
const program = new anchor5.Program(this._withAddress(question_market_default, this._programIds.questionMarket), this.provider);
|
|
14430
|
+
this._market = new MarketClient(program, this.provider, this._programIds, this._marketOwner);
|
|
14431
|
+
this._market.ctfClient = this.ctf;
|
|
14432
|
+
}
|
|
14433
|
+
return this._market;
|
|
14434
|
+
}
|
|
14435
|
+
get ctf() {
|
|
14436
|
+
if (!this._ctf) {
|
|
14437
|
+
const program = new anchor5.Program(this._withAddress(conditional_tokens_default, this._programIds.conditionalTokens), this.provider);
|
|
14438
|
+
this._ctf = new CtfClient(program, this.provider, this._programIds);
|
|
14439
|
+
}
|
|
14440
|
+
return this._ctf;
|
|
14441
|
+
}
|
|
14442
|
+
get clob() {
|
|
14443
|
+
if (!this._clob) {
|
|
14444
|
+
const program = new anchor5.Program(this._withAddress(clob_exchange_default, this._programIds.clobExchange), this.provider);
|
|
14445
|
+
this._clob = new ClobClient(program, this.provider, this._programIds, this.networkConfig);
|
|
14446
|
+
if (this.networkConfig.feeConfigOwner && this._programIds.feeManagement) {
|
|
14447
|
+
this._clob.feeConfigOwner = this.networkConfig.feeConfigOwner;
|
|
14448
|
+
this._clob.feeClient = this.fee;
|
|
14449
|
+
}
|
|
14450
|
+
}
|
|
14451
|
+
return this._clob;
|
|
14452
|
+
}
|
|
14453
|
+
get fee() {
|
|
14454
|
+
if (!this._fee) {
|
|
14455
|
+
if (!this._programIds.feeManagement) throw new Error("feeManagement program ID not configured in NetworkConfig");
|
|
14456
|
+
const program = new anchor5.Program(this._withAddress(fee_management_default, this._programIds.feeManagement), this.provider);
|
|
14457
|
+
this._fee = new FeeManagementClient(program, this.provider, this._programIds);
|
|
14458
|
+
}
|
|
14459
|
+
return this._fee;
|
|
14460
|
+
}
|
|
14461
|
+
get presale() {
|
|
14462
|
+
if (!this._presale) {
|
|
14463
|
+
if (!this._programIds.presale) throw new Error("presale program ID not configured in NetworkConfig");
|
|
14464
|
+
const program = new anchor5.Program(this._withAddress(presale_default, this._programIds.presale), this.provider);
|
|
14465
|
+
this._presale = new PresaleClient(program, this.provider, this._programIds);
|
|
14466
|
+
}
|
|
14467
|
+
return this._presale;
|
|
14468
|
+
}
|
|
14469
|
+
get marketOracle() {
|
|
14470
|
+
if (!this._marketOracle) {
|
|
14471
|
+
if (!this._programIds.marketOracle) throw new Error("marketOracle program ID not configured in NetworkConfig");
|
|
14472
|
+
const program = new anchor5.Program(this._withAddress(market_oracle_default, this._programIds.marketOracle), this.provider);
|
|
14473
|
+
this._marketOracle = new MarketOracleClient(program, this.provider, this._programIds);
|
|
14474
|
+
}
|
|
14475
|
+
return this._marketOracle;
|
|
14476
|
+
}
|
|
14477
|
+
get admin() {
|
|
14478
|
+
if (!this._admin) {
|
|
14479
|
+
if (!this._programIds.adminContract) throw new Error("adminContract program ID not configured in NetworkConfig");
|
|
14480
|
+
const program = new anchor5.Program(this._withAddress(admin_contract_default, this._programIds.adminContract), this.provider);
|
|
14481
|
+
this._admin = new AdminClient(program, this.provider, this._programIds);
|
|
14482
|
+
}
|
|
14483
|
+
return this._admin;
|
|
13276
14484
|
}
|
|
13277
14485
|
};
|
|
13278
14486
|
function buildOrder(params) {
|
|
@@ -13403,6 +14611,6 @@ function buildApproveAllOutcomeTokensTx(condition, signer, payer, delegate, prog
|
|
|
13403
14611
|
return tx;
|
|
13404
14612
|
}
|
|
13405
14613
|
|
|
13406
|
-
export { AccountNotFoundError, ClobClient, CtfClient, FEE_DENOMINATOR, FeeManagementClient, HookClient, IX_SYSVAR, InvalidParamError, MAX_APPROVE_AMOUNT, MarketClient, MarketOracleClient, OracleClient, PDA, PresaleClient, QuestionStatus, SEEDS, UnauthorizedError, XMarketError, XMarketSDK, buildApproveAllOutcomeTokensTx, buildApproveCollateralTx, buildBatchedEd25519Instruction, buildOrder, deserializeSignedOrder, detectMatchType, generateContentHash, generateQuestionId, getOrderSignBytes, serializeOrderToBytes, serializeSignedOrder, signOrder, signOrderWithKeypair, verifySignedOrder };
|
|
14614
|
+
export { AccountNotFoundError, AdminClient, ClobClient, CtfClient, FEE_DENOMINATOR, FeeManagementClient, HookClient, IX_SYSVAR, InvalidParamError, MAX_APPROVE_AMOUNT, MarketClient, MarketOracleClient, OracleClient, PDA, PresaleClient, QuestionStatus, SEEDS, UnauthorizedError, XMarketError, XMarketSDK, buildApproveAllOutcomeTokensTx, buildApproveCollateralTx, buildBatchedEd25519Instruction, buildOrder, deserializeSignedOrder, detectMatchType, generateContentHash, generateQuestionId, getOrderSignBytes, serializeOrderToBytes, serializeSignedOrder, signOrder, signOrderWithKeypair, verifySignedOrder };
|
|
13407
14615
|
//# sourceMappingURL=index.mjs.map
|
|
13408
14616
|
//# sourceMappingURL=index.mjs.map
|