@theliem/xmarket-sdk 3.16.0 → 3.19.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 +10 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +62 -52
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +62 -52
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.d.mts
CHANGED
|
@@ -606,6 +606,16 @@ declare class FeeManagementClient {
|
|
|
606
606
|
buildEditMarketFeeTx(conditionPda: PublicKey, mergeFee: BN, redeemFee: BN, swapFee: BN, feeConfigOwner: PublicKey, authority: PublicKey, payer?: PublicKey): Promise<Transaction>;
|
|
607
607
|
/** @deprecated use buildEditMarketFeeTx */
|
|
608
608
|
setQuestionFee(conditionPda: PublicKey, mergeFee: BN, redeemFee: BN, swapFee: BN, feeConfigOwner: PublicKey, authority: PublicKey, payer: PublicKey): Promise<TxResult>;
|
|
609
|
+
/**
|
|
610
|
+
* Build addToWhitelist tx — authority (admin/owner) signs externally.
|
|
611
|
+
* Whitelist members can call editMarketFee / setQuestionFee.
|
|
612
|
+
*/
|
|
613
|
+
/** Build addToWhitelist tx — authority (admin/owner) signs externally. */
|
|
614
|
+
buildAddToWhitelistTx(address: PublicKey, feeConfigOwner: PublicKey, authority: PublicKey): Promise<Transaction>;
|
|
615
|
+
/** Build removeFromWhitelist tx — authority (admin/owner) signs externally. */
|
|
616
|
+
buildRemoveFromWhitelistTx(address: PublicKey, feeConfigOwner: PublicKey, authority: PublicKey): Promise<Transaction>;
|
|
617
|
+
/** Build setAdmin tx — only owner signs externally. */
|
|
618
|
+
buildSetAdminTx(newAdmin: PublicKey, feeConfigOwner: PublicKey, authority: PublicKey): Promise<Transaction>;
|
|
609
619
|
}
|
|
610
620
|
|
|
611
621
|
declare class ClobClient {
|
package/dist/index.d.ts
CHANGED
|
@@ -606,6 +606,16 @@ declare class FeeManagementClient {
|
|
|
606
606
|
buildEditMarketFeeTx(conditionPda: PublicKey, mergeFee: BN, redeemFee: BN, swapFee: BN, feeConfigOwner: PublicKey, authority: PublicKey, payer?: PublicKey): Promise<Transaction>;
|
|
607
607
|
/** @deprecated use buildEditMarketFeeTx */
|
|
608
608
|
setQuestionFee(conditionPda: PublicKey, mergeFee: BN, redeemFee: BN, swapFee: BN, feeConfigOwner: PublicKey, authority: PublicKey, payer: PublicKey): Promise<TxResult>;
|
|
609
|
+
/**
|
|
610
|
+
* Build addToWhitelist tx — authority (admin/owner) signs externally.
|
|
611
|
+
* Whitelist members can call editMarketFee / setQuestionFee.
|
|
612
|
+
*/
|
|
613
|
+
/** Build addToWhitelist tx — authority (admin/owner) signs externally. */
|
|
614
|
+
buildAddToWhitelistTx(address: PublicKey, feeConfigOwner: PublicKey, authority: PublicKey): Promise<Transaction>;
|
|
615
|
+
/** Build removeFromWhitelist tx — authority (admin/owner) signs externally. */
|
|
616
|
+
buildRemoveFromWhitelistTx(address: PublicKey, feeConfigOwner: PublicKey, authority: PublicKey): Promise<Transaction>;
|
|
617
|
+
/** Build setAdmin tx — only owner signs externally. */
|
|
618
|
+
buildSetAdminTx(newAdmin: PublicKey, feeConfigOwner: PublicKey, authority: PublicKey): Promise<Transaction>;
|
|
609
619
|
}
|
|
610
620
|
|
|
611
621
|
declare class ClobClient {
|
package/dist/index.js
CHANGED
|
@@ -2752,6 +2752,25 @@ var FeeManagementClient = class {
|
|
|
2752
2752
|
}).signers([]).rpc();
|
|
2753
2753
|
return { signature: sig };
|
|
2754
2754
|
}
|
|
2755
|
+
/**
|
|
2756
|
+
* Build addToWhitelist tx — authority (admin/owner) signs externally.
|
|
2757
|
+
* Whitelist members can call editMarketFee / setQuestionFee.
|
|
2758
|
+
*/
|
|
2759
|
+
/** Build addToWhitelist tx — authority (admin/owner) signs externally. */
|
|
2760
|
+
async buildAddToWhitelistTx(address, feeConfigOwner, authority) {
|
|
2761
|
+
const [feeConfigPda] = PDA.feeConfig(feeConfigOwner, this.programIds);
|
|
2762
|
+
return this.program.methods.addToWhitelist(address).accounts({ authority, feeConfig: feeConfigPda }).transaction();
|
|
2763
|
+
}
|
|
2764
|
+
/** Build removeFromWhitelist tx — authority (admin/owner) signs externally. */
|
|
2765
|
+
async buildRemoveFromWhitelistTx(address, feeConfigOwner, authority) {
|
|
2766
|
+
const [feeConfigPda] = PDA.feeConfig(feeConfigOwner, this.programIds);
|
|
2767
|
+
return this.program.methods.removeFromWhitelist(address).accounts({ authority, feeConfig: feeConfigPda }).transaction();
|
|
2768
|
+
}
|
|
2769
|
+
/** Build setAdmin tx — only owner signs externally. */
|
|
2770
|
+
async buildSetAdminTx(newAdmin, feeConfigOwner, authority) {
|
|
2771
|
+
const [feeConfigPda] = PDA.feeConfig(feeConfigOwner, this.programIds);
|
|
2772
|
+
return this.program.methods.setAdmin(newAdmin).accounts({ authority, feeConfig: feeConfigPda }).transaction();
|
|
2773
|
+
}
|
|
2755
2774
|
};
|
|
2756
2775
|
var PresaleClient = class {
|
|
2757
2776
|
constructor(program, provider, programIds) {
|
|
@@ -3852,7 +3871,7 @@ var oracle_default = {
|
|
|
3852
3871
|
|
|
3853
3872
|
// src/idls/hook.json
|
|
3854
3873
|
var hook_default = {
|
|
3855
|
-
address: "
|
|
3874
|
+
address: "5DnFGrt8BGjybNA3EMFKwV1Yvw9iVzJXC7zqP94R7iEV",
|
|
3856
3875
|
metadata: {
|
|
3857
3876
|
name: "hook",
|
|
3858
3877
|
version: "0.1.0",
|
|
@@ -3877,12 +3896,7 @@ var hook_default = {
|
|
|
3877
3896
|
],
|
|
3878
3897
|
accounts: [
|
|
3879
3898
|
{
|
|
3880
|
-
name: "
|
|
3881
|
-
signer: true
|
|
3882
|
-
},
|
|
3883
|
-
{
|
|
3884
|
-
name: "payer",
|
|
3885
|
-
writable: true,
|
|
3899
|
+
name: "admin",
|
|
3886
3900
|
signer: true
|
|
3887
3901
|
},
|
|
3888
3902
|
{
|
|
@@ -4013,12 +4027,7 @@ var hook_default = {
|
|
|
4013
4027
|
],
|
|
4014
4028
|
accounts: [
|
|
4015
4029
|
{
|
|
4016
|
-
name: "
|
|
4017
|
-
signer: true
|
|
4018
|
-
},
|
|
4019
|
-
{
|
|
4020
|
-
name: "payer",
|
|
4021
|
-
writable: true,
|
|
4030
|
+
name: "admin",
|
|
4022
4031
|
signer: true
|
|
4023
4032
|
},
|
|
4024
4033
|
{
|
|
@@ -4167,7 +4176,7 @@ var hook_default = {
|
|
|
4167
4176
|
],
|
|
4168
4177
|
accounts: [
|
|
4169
4178
|
{
|
|
4170
|
-
name: "
|
|
4179
|
+
name: "admin",
|
|
4171
4180
|
writable: true,
|
|
4172
4181
|
signer: true
|
|
4173
4182
|
},
|
|
@@ -4226,12 +4235,7 @@ var hook_default = {
|
|
|
4226
4235
|
],
|
|
4227
4236
|
accounts: [
|
|
4228
4237
|
{
|
|
4229
|
-
name: "
|
|
4230
|
-
signer: true
|
|
4231
|
-
},
|
|
4232
|
-
{
|
|
4233
|
-
name: "payer",
|
|
4234
|
-
writable: true,
|
|
4238
|
+
name: "admin",
|
|
4235
4239
|
signer: true
|
|
4236
4240
|
},
|
|
4237
4241
|
{
|
|
@@ -4285,36 +4289,42 @@ var hook_default = {
|
|
|
4285
4289
|
types: [
|
|
4286
4290
|
{
|
|
4287
4291
|
name: "HookConfig",
|
|
4292
|
+
docs: [
|
|
4293
|
+
"Global config for the Hook program.",
|
|
4294
|
+
"Stores the whitelist of programs allowed to transfer YES/NO Token-2022 tokens."
|
|
4295
|
+
],
|
|
4288
4296
|
type: {
|
|
4289
4297
|
kind: "struct",
|
|
4290
4298
|
fields: [
|
|
4291
4299
|
{
|
|
4292
|
-
name: "
|
|
4293
|
-
|
|
4294
|
-
|
|
4295
|
-
|
|
4296
|
-
name: "owner",
|
|
4300
|
+
name: "admin",
|
|
4301
|
+
docs: [
|
|
4302
|
+
"Admin who can update the whitelist (should be a multisig)"
|
|
4303
|
+
],
|
|
4297
4304
|
type: "pubkey"
|
|
4298
4305
|
},
|
|
4299
4306
|
{
|
|
4300
4307
|
name: "whitelist",
|
|
4308
|
+
docs: [
|
|
4309
|
+
"Programs allowed to initiate or receive YES/NO token transfers.",
|
|
4310
|
+
"Typically: CTF program PDA, CLOB program PDA."
|
|
4311
|
+
],
|
|
4301
4312
|
type: {
|
|
4302
|
-
|
|
4303
|
-
"pubkey",
|
|
4304
|
-
10
|
|
4305
|
-
]
|
|
4313
|
+
vec: "pubkey"
|
|
4306
4314
|
}
|
|
4307
4315
|
},
|
|
4308
|
-
{
|
|
4309
|
-
name: "whitelist_len",
|
|
4310
|
-
type: "u8"
|
|
4311
|
-
},
|
|
4312
4316
|
{
|
|
4313
4317
|
name: "is_frozen",
|
|
4318
|
+
docs: [
|
|
4319
|
+
"If true, whitelist can no longer be modified (locked forever)"
|
|
4320
|
+
],
|
|
4314
4321
|
type: "bool"
|
|
4315
4322
|
},
|
|
4316
4323
|
{
|
|
4317
4324
|
name: "bump",
|
|
4325
|
+
docs: [
|
|
4326
|
+
"Bump for this PDA"
|
|
4327
|
+
],
|
|
4318
4328
|
type: "u8"
|
|
4319
4329
|
},
|
|
4320
4330
|
{
|
|
@@ -4322,7 +4332,7 @@ var hook_default = {
|
|
|
4322
4332
|
type: {
|
|
4323
4333
|
array: [
|
|
4324
4334
|
"u8",
|
|
4325
|
-
|
|
4335
|
+
32
|
|
4326
4336
|
]
|
|
4327
4337
|
}
|
|
4328
4338
|
}
|
|
@@ -6318,7 +6328,8 @@ var question_market_default = {
|
|
|
6318
6328
|
{
|
|
6319
6329
|
name: "investors_market_rev",
|
|
6320
6330
|
docs: [
|
|
6321
|
-
"Market revenue split
|
|
6331
|
+
"Market revenue split \u2014 three parts must sum to FEE_DENOMINATOR (10_000).",
|
|
6332
|
+
"investors_market_rev + company_market_rev + referral_market_rev == 10_000"
|
|
6322
6333
|
],
|
|
6323
6334
|
type: "u32"
|
|
6324
6335
|
},
|
|
@@ -6329,7 +6340,7 @@ var question_market_default = {
|
|
|
6329
6340
|
{
|
|
6330
6341
|
name: "agents_presale_rev",
|
|
6331
6342
|
docs: [
|
|
6332
|
-
"Presale revenue split: agents + company (out of FEE_DENOMINATOR =
|
|
6343
|
+
"Presale revenue split: agents + company (out of FEE_DENOMINATOR = 10_000)"
|
|
6333
6344
|
],
|
|
6334
6345
|
type: "u32"
|
|
6335
6346
|
},
|
|
@@ -6354,12 +6365,26 @@ var question_market_default = {
|
|
|
6354
6365
|
name: "bump",
|
|
6355
6366
|
type: "u8"
|
|
6356
6367
|
},
|
|
6368
|
+
{
|
|
6369
|
+
name: "referral_market_rev",
|
|
6370
|
+
docs: [
|
|
6371
|
+
"Share of market trading fees routed to referral_vault (e.g. 2_000 = 20%)"
|
|
6372
|
+
],
|
|
6373
|
+
type: "u32"
|
|
6374
|
+
},
|
|
6375
|
+
{
|
|
6376
|
+
name: "referral_vault",
|
|
6377
|
+
docs: [
|
|
6378
|
+
"ATA of referral program config PDA \u2014 receives referral_market_rev% of trading fees"
|
|
6379
|
+
],
|
|
6380
|
+
type: "pubkey"
|
|
6381
|
+
},
|
|
6357
6382
|
{
|
|
6358
6383
|
name: "_reserved",
|
|
6359
6384
|
type: {
|
|
6360
6385
|
array: [
|
|
6361
6386
|
"u8",
|
|
6362
|
-
|
|
6387
|
+
28
|
|
6363
6388
|
]
|
|
6364
6389
|
}
|
|
6365
6390
|
}
|
|
@@ -10977,11 +11002,6 @@ var fee_management_default = {
|
|
|
10977
11002
|
name: "authority",
|
|
10978
11003
|
signer: true
|
|
10979
11004
|
},
|
|
10980
|
-
{
|
|
10981
|
-
name: "payer",
|
|
10982
|
-
writable: true,
|
|
10983
|
-
signer: true
|
|
10984
|
-
},
|
|
10985
11005
|
{
|
|
10986
11006
|
name: "fee_config",
|
|
10987
11007
|
writable: true,
|
|
@@ -11273,11 +11293,6 @@ var fee_management_default = {
|
|
|
11273
11293
|
name: "authority",
|
|
11274
11294
|
signer: true
|
|
11275
11295
|
},
|
|
11276
|
-
{
|
|
11277
|
-
name: "payer",
|
|
11278
|
-
writable: true,
|
|
11279
|
-
signer: true
|
|
11280
|
-
},
|
|
11281
11296
|
{
|
|
11282
11297
|
name: "fee_config",
|
|
11283
11298
|
writable: true,
|
|
@@ -11331,11 +11346,6 @@ var fee_management_default = {
|
|
|
11331
11346
|
name: "authority",
|
|
11332
11347
|
signer: true
|
|
11333
11348
|
},
|
|
11334
|
-
{
|
|
11335
|
-
name: "payer",
|
|
11336
|
-
writable: true,
|
|
11337
|
-
signer: true
|
|
11338
|
-
},
|
|
11339
11349
|
{
|
|
11340
11350
|
name: "fee_config",
|
|
11341
11351
|
writable: true,
|