@liquid-af/sdk 0.9.0 → 0.10.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/client.d.ts +0 -5
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +1 -5
- package/dist/client.js.map +1 -1
- package/dist/events/index.d.ts +1 -1
- package/dist/events/index.d.ts.map +1 -1
- package/dist/events/index.js +1 -1
- package/dist/events/index.js.map +1 -1
- package/dist/events/parser.d.ts +12 -19
- package/dist/events/parser.d.ts.map +1 -1
- package/dist/events/parser.js +115 -91
- package/dist/events/parser.js.map +1 -1
- package/dist/idl/liquid.d.ts +61 -0
- package/dist/idl/liquid.d.ts.map +1 -1
- package/dist/idl/liquid.json +61 -0
- package/dist/idl/liquid_events.d.ts +258 -724
- package/dist/idl/liquid_events.d.ts.map +1 -1
- package/dist/idl/liquid_events.json +287 -753
- package/dist/idl/liquid_state.d.ts +18 -5
- package/dist/idl/liquid_state.d.ts.map +1 -1
- package/dist/idl/liquid_state.json +18 -5
- package/dist/instructions/index.d.ts +2 -2
- package/dist/instructions/index.d.ts.map +1 -1
- package/dist/instructions/index.js +1 -1
- package/dist/instructions/index.js.map +1 -1
- package/dist/instructions/liquid-state.d.ts +0 -13
- package/dist/instructions/liquid-state.d.ts.map +1 -1
- package/dist/instructions/liquid-state.js +0 -15
- package/dist/instructions/liquid-state.js.map +1 -1
- package/dist/types.d.ts +6 -3
- package/dist/types.d.ts.map +1 -1
- package/package.json +8 -8
- package/src/client.ts +0 -8
- package/src/events/index.ts +1 -5
- package/src/events/parser.ts +137 -107
- package/src/idl/liquid.json +61 -0
- package/src/idl/liquid.ts +61 -0
- package/src/idl/liquid_events.json +287 -753
- package/src/idl/liquid_events.ts +258 -724
- package/src/idl/liquid_state.json +18 -5
- package/src/idl/liquid_state.ts +18 -5
- package/src/instructions/index.ts +0 -2
- package/src/instructions/liquid-state.ts +0 -25
- package/src/types.ts +6 -3
|
@@ -1203,6 +1203,14 @@
|
|
|
1203
1203
|
"name": "user",
|
|
1204
1204
|
"signer": true
|
|
1205
1205
|
},
|
|
1206
|
+
{
|
|
1207
|
+
"name": "cosigner",
|
|
1208
|
+
"docs": [
|
|
1209
|
+
"Protocol co-signer required to authorize referrer assignment."
|
|
1210
|
+
],
|
|
1211
|
+
"signer": true,
|
|
1212
|
+
"address": "Ref1fKLFiWDro19Am4aSRhXgbWovG6nJFQDH9AhSBzE"
|
|
1213
|
+
},
|
|
1206
1214
|
{
|
|
1207
1215
|
"name": "user_properties",
|
|
1208
1216
|
"writable": true,
|
|
@@ -2375,31 +2383,36 @@
|
|
|
2375
2383
|
},
|
|
2376
2384
|
{
|
|
2377
2385
|
"code": 6008,
|
|
2386
|
+
"name": "InvalidCosigner",
|
|
2387
|
+
"msg": "Invalid co-signer: this instruction requires protocol co-signer approval"
|
|
2388
|
+
},
|
|
2389
|
+
{
|
|
2390
|
+
"code": 6009,
|
|
2378
2391
|
"name": "ReferrerNotSet",
|
|
2379
2392
|
"msg": "User does not have a referrer set"
|
|
2380
2393
|
},
|
|
2381
2394
|
{
|
|
2382
|
-
"code":
|
|
2395
|
+
"code": 6010,
|
|
2383
2396
|
"name": "DealReferrerMismatch",
|
|
2384
2397
|
"msg": "Deal does not belong to the user's referrer"
|
|
2385
2398
|
},
|
|
2386
2399
|
{
|
|
2387
|
-
"code":
|
|
2400
|
+
"code": 6011,
|
|
2388
2401
|
"name": "InvalidMultiplier",
|
|
2389
2402
|
"msg": "Invalid cashback multiplier value"
|
|
2390
2403
|
},
|
|
2391
2404
|
{
|
|
2392
|
-
"code":
|
|
2405
|
+
"code": 6012,
|
|
2393
2406
|
"name": "InvalidAdminAuthority",
|
|
2394
2407
|
"msg": "The provided admin authority is invalid"
|
|
2395
2408
|
},
|
|
2396
2409
|
{
|
|
2397
|
-
"code":
|
|
2410
|
+
"code": 6013,
|
|
2398
2411
|
"name": "NoPendingAdminTransfer",
|
|
2399
2412
|
"msg": "No pending admin transfer exists"
|
|
2400
2413
|
},
|
|
2401
2414
|
{
|
|
2402
|
-
"code":
|
|
2415
|
+
"code": 6014,
|
|
2403
2416
|
"name": "NotPendingAdmin",
|
|
2404
2417
|
"msg": "Caller is not the pending admin"
|
|
2405
2418
|
}
|
package/src/idl/liquid_state.ts
CHANGED
|
@@ -1209,6 +1209,14 @@ export type LiquidState = {
|
|
|
1209
1209
|
"name": "user",
|
|
1210
1210
|
"signer": true
|
|
1211
1211
|
},
|
|
1212
|
+
{
|
|
1213
|
+
"name": "cosigner",
|
|
1214
|
+
"docs": [
|
|
1215
|
+
"Protocol co-signer required to authorize referrer assignment."
|
|
1216
|
+
],
|
|
1217
|
+
"signer": true,
|
|
1218
|
+
"address": "Ref1fKLFiWDro19Am4aSRhXgbWovG6nJFQDH9AhSBzE"
|
|
1219
|
+
},
|
|
1212
1220
|
{
|
|
1213
1221
|
"name": "userProperties",
|
|
1214
1222
|
"writable": true,
|
|
@@ -2381,31 +2389,36 @@ export type LiquidState = {
|
|
|
2381
2389
|
},
|
|
2382
2390
|
{
|
|
2383
2391
|
"code": 6008,
|
|
2392
|
+
"name": "invalidCosigner",
|
|
2393
|
+
"msg": "Invalid co-signer: this instruction requires protocol co-signer approval"
|
|
2394
|
+
},
|
|
2395
|
+
{
|
|
2396
|
+
"code": 6009,
|
|
2384
2397
|
"name": "referrerNotSet",
|
|
2385
2398
|
"msg": "User does not have a referrer set"
|
|
2386
2399
|
},
|
|
2387
2400
|
{
|
|
2388
|
-
"code":
|
|
2401
|
+
"code": 6010,
|
|
2389
2402
|
"name": "dealReferrerMismatch",
|
|
2390
2403
|
"msg": "Deal does not belong to the user's referrer"
|
|
2391
2404
|
},
|
|
2392
2405
|
{
|
|
2393
|
-
"code":
|
|
2406
|
+
"code": 6011,
|
|
2394
2407
|
"name": "invalidMultiplier",
|
|
2395
2408
|
"msg": "Invalid cashback multiplier value"
|
|
2396
2409
|
},
|
|
2397
2410
|
{
|
|
2398
|
-
"code":
|
|
2411
|
+
"code": 6012,
|
|
2399
2412
|
"name": "invalidAdminAuthority",
|
|
2400
2413
|
"msg": "The provided admin authority is invalid"
|
|
2401
2414
|
},
|
|
2402
2415
|
{
|
|
2403
|
-
"code":
|
|
2416
|
+
"code": 6013,
|
|
2404
2417
|
"name": "noPendingAdminTransfer",
|
|
2405
2418
|
"msg": "No pending admin transfer exists"
|
|
2406
2419
|
},
|
|
2407
2420
|
{
|
|
2408
|
-
"code":
|
|
2421
|
+
"code": 6014,
|
|
2409
2422
|
"name": "notPendingAdmin",
|
|
2410
2423
|
"msg": "Caller is not the pending admin"
|
|
2411
2424
|
}
|
|
@@ -97,13 +97,11 @@ export type {
|
|
|
97
97
|
|
|
98
98
|
export {
|
|
99
99
|
buildInitializeUser,
|
|
100
|
-
buildSetReferrer,
|
|
101
100
|
buildSetCashbackMode,
|
|
102
101
|
buildRedeemDeal,
|
|
103
102
|
} from "./liquid-state.js";
|
|
104
103
|
export type {
|
|
105
104
|
BuildInitializeUserParams,
|
|
106
|
-
BuildSetReferrerParams,
|
|
107
105
|
BuildSetCashbackModeParams,
|
|
108
106
|
BuildRedeemDealParams,
|
|
109
107
|
} from "./liquid-state.js";
|
|
@@ -24,31 +24,6 @@ export function buildInitializeUser(
|
|
|
24
24
|
return program.methods.initializeUser().accounts({ user }).instruction();
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
export interface BuildSetReferrerParams {
|
|
28
|
-
user: PublicKey;
|
|
29
|
-
referrer: PublicKey;
|
|
30
|
-
config: LiquidConfig;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Builds a setReferrer instruction.
|
|
35
|
-
* One-time operation — referrer cannot be changed once set.
|
|
36
|
-
*
|
|
37
|
-
* @param params - {@link BuildSetReferrerParams}
|
|
38
|
-
* @returns Transaction instruction
|
|
39
|
-
*/
|
|
40
|
-
export function buildSetReferrer(
|
|
41
|
-
params: BuildSetReferrerParams,
|
|
42
|
-
): Promise<TransactionInstruction> {
|
|
43
|
-
const { user, referrer, config } = params;
|
|
44
|
-
const program = getCachedStateProgram(config);
|
|
45
|
-
|
|
46
|
-
return program.methods
|
|
47
|
-
.setReferrer(referrer)
|
|
48
|
-
.accounts({ user })
|
|
49
|
-
.instruction();
|
|
50
|
-
}
|
|
51
|
-
|
|
52
27
|
export interface BuildSetCashbackModeParams {
|
|
53
28
|
user: PublicKey;
|
|
54
29
|
config: LiquidConfig;
|
package/src/types.ts
CHANGED
|
@@ -75,17 +75,20 @@ export const feeModeEquals = (
|
|
|
75
75
|
/** Global configuration for the bonding curve program */
|
|
76
76
|
export interface GlobalConfiguration {
|
|
77
77
|
adminAuthority: PublicKey;
|
|
78
|
+
initialVirtualReserveUsd: BN;
|
|
79
|
+
migrationMarketCapUsd: BN;
|
|
78
80
|
initialVirtualTokenReserves: BN;
|
|
79
|
-
initialVirtualSolReserves: BN;
|
|
80
81
|
initialRealTokenReserves: BN;
|
|
81
82
|
tokenTotalSupply: BN;
|
|
82
|
-
traderCashbackBasisPoints: number;
|
|
83
83
|
creatorFeeBasisPoints: number;
|
|
84
84
|
creatorReferralRewardBasisPoints: number;
|
|
85
85
|
traderReferralRewardBasisPoints: number;
|
|
86
86
|
protocolFeeBasisPoints: number;
|
|
87
87
|
feeRecipients: PublicKey[];
|
|
88
88
|
quoteMints: PublicKey[];
|
|
89
|
+
solUsdPriceFeed: PublicKey;
|
|
90
|
+
pendingAdmin: PublicKey | null;
|
|
91
|
+
bump: number;
|
|
89
92
|
paused: boolean;
|
|
90
93
|
}
|
|
91
94
|
|
|
@@ -96,8 +99,8 @@ export interface BondingCurveState {
|
|
|
96
99
|
realTokenReserves: BN;
|
|
97
100
|
virtualTokenReserves: BN;
|
|
98
101
|
realSolReserves: BN;
|
|
99
|
-
virtualSolReserves: BN;
|
|
100
102
|
tokenTotalSupply: BN;
|
|
103
|
+
initialVirtualReserveUsd: BN;
|
|
101
104
|
status: CurveStatusAnchor;
|
|
102
105
|
bump: number;
|
|
103
106
|
}
|