flash-sdk 2.40.9 → 2.40.10
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/PerpetualsClient.d.ts +43 -43
- package/dist/PerpetualsClient.js +33 -32
- package/dist/idl/perpetuals.d.ts +393 -11
- package/dist/idl/perpetuals.js +393 -11
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/types/index.d.ts +9 -0
- package/dist/utils/alt.d.ts +1 -0
- package/package.json +1 -1
@@ -343,11 +343,11 @@ export declare class PerpetualsClient {
|
|
343
343
|
sizeDecimals: number;
|
344
344
|
lockedDecimals: number;
|
345
345
|
collateralDecimals: number;
|
346
|
-
|
346
|
+
refererTokenStakeAccount: PublicKey;
|
347
347
|
refererBoosterAccount: PublicKey;
|
348
348
|
level: number;
|
349
|
-
|
350
|
-
|
349
|
+
withdrawRequestCount: number;
|
350
|
+
withdrawRequest: unknown;
|
351
351
|
activeStakeAmount: BN;
|
352
352
|
updateTimestamp: BN;
|
353
353
|
tradeTimestamp: BN;
|
@@ -660,11 +660,11 @@ export declare class PerpetualsClient {
|
|
660
660
|
sizeDecimals: number;
|
661
661
|
lockedDecimals: number;
|
662
662
|
collateralDecimals: number;
|
663
|
-
|
663
|
+
refererTokenStakeAccount: PublicKey;
|
664
664
|
refererBoosterAccount: PublicKey;
|
665
665
|
level: number;
|
666
|
-
|
667
|
-
|
666
|
+
withdrawRequestCount: number;
|
667
|
+
withdrawRequest: unknown;
|
668
668
|
activeStakeAmount: BN;
|
669
669
|
updateTimestamp: BN;
|
670
670
|
tradeTimestamp: BN;
|
@@ -976,11 +976,11 @@ export declare class PerpetualsClient {
|
|
976
976
|
sizeDecimals: number;
|
977
977
|
lockedDecimals: number;
|
978
978
|
collateralDecimals: number;
|
979
|
-
|
979
|
+
refererTokenStakeAccount: PublicKey;
|
980
980
|
refererBoosterAccount: PublicKey;
|
981
981
|
level: number;
|
982
|
-
|
983
|
-
|
982
|
+
withdrawRequestCount: number;
|
983
|
+
withdrawRequest: unknown;
|
984
984
|
activeStakeAmount: BN;
|
985
985
|
updateTimestamp: BN;
|
986
986
|
tradeTimestamp: BN;
|
@@ -1296,11 +1296,11 @@ export declare class PerpetualsClient {
|
|
1296
1296
|
sizeDecimals: number;
|
1297
1297
|
lockedDecimals: number;
|
1298
1298
|
collateralDecimals: number;
|
1299
|
-
|
1299
|
+
refererTokenStakeAccount: PublicKey;
|
1300
1300
|
refererBoosterAccount: PublicKey;
|
1301
1301
|
level: number;
|
1302
|
-
|
1303
|
-
|
1302
|
+
withdrawRequestCount: number;
|
1303
|
+
withdrawRequest: unknown;
|
1304
1304
|
activeStakeAmount: BN;
|
1305
1305
|
updateTimestamp: BN;
|
1306
1306
|
tradeTimestamp: BN;
|
@@ -1615,11 +1615,11 @@ export declare class PerpetualsClient {
|
|
1615
1615
|
sizeDecimals: number;
|
1616
1616
|
lockedDecimals: number;
|
1617
1617
|
collateralDecimals: number;
|
1618
|
-
|
1618
|
+
refererTokenStakeAccount: PublicKey;
|
1619
1619
|
refererBoosterAccount: PublicKey;
|
1620
1620
|
level: number;
|
1621
|
-
|
1622
|
-
|
1621
|
+
withdrawRequestCount: number;
|
1622
|
+
withdrawRequest: unknown;
|
1623
1623
|
activeStakeAmount: BN;
|
1624
1624
|
updateTimestamp: BN;
|
1625
1625
|
tradeTimestamp: BN;
|
@@ -1931,11 +1931,11 @@ export declare class PerpetualsClient {
|
|
1931
1931
|
sizeDecimals: number;
|
1932
1932
|
lockedDecimals: number;
|
1933
1933
|
collateralDecimals: number;
|
1934
|
-
|
1934
|
+
refererTokenStakeAccount: PublicKey;
|
1935
1935
|
refererBoosterAccount: PublicKey;
|
1936
1936
|
level: number;
|
1937
|
-
|
1938
|
-
|
1937
|
+
withdrawRequestCount: number;
|
1938
|
+
withdrawRequest: unknown;
|
1939
1939
|
activeStakeAmount: BN;
|
1940
1940
|
updateTimestamp: BN;
|
1941
1941
|
tradeTimestamp: BN;
|
@@ -2247,11 +2247,11 @@ export declare class PerpetualsClient {
|
|
2247
2247
|
sizeDecimals: number;
|
2248
2248
|
lockedDecimals: number;
|
2249
2249
|
collateralDecimals: number;
|
2250
|
-
|
2250
|
+
refererTokenStakeAccount: PublicKey;
|
2251
2251
|
refererBoosterAccount: PublicKey;
|
2252
2252
|
level: number;
|
2253
|
-
|
2254
|
-
|
2253
|
+
withdrawRequestCount: number;
|
2254
|
+
withdrawRequest: unknown;
|
2255
2255
|
activeStakeAmount: BN;
|
2256
2256
|
updateTimestamp: BN;
|
2257
2257
|
tradeTimestamp: BN;
|
@@ -2563,11 +2563,11 @@ export declare class PerpetualsClient {
|
|
2563
2563
|
sizeDecimals: number;
|
2564
2564
|
lockedDecimals: number;
|
2565
2565
|
collateralDecimals: number;
|
2566
|
-
|
2566
|
+
refererTokenStakeAccount: PublicKey;
|
2567
2567
|
refererBoosterAccount: PublicKey;
|
2568
2568
|
level: number;
|
2569
|
-
|
2570
|
-
|
2569
|
+
withdrawRequestCount: number;
|
2570
|
+
withdrawRequest: unknown;
|
2571
2571
|
activeStakeAmount: BN;
|
2572
2572
|
updateTimestamp: BN;
|
2573
2573
|
tradeTimestamp: BN;
|
@@ -2929,11 +2929,11 @@ export declare class PerpetualsClient {
|
|
2929
2929
|
sizeDecimals: number;
|
2930
2930
|
lockedDecimals: number;
|
2931
2931
|
collateralDecimals: number;
|
2932
|
-
|
2932
|
+
refererTokenStakeAccount: PublicKey;
|
2933
2933
|
refererBoosterAccount: PublicKey;
|
2934
2934
|
level: number;
|
2935
|
-
|
2936
|
-
|
2935
|
+
withdrawRequestCount: number;
|
2936
|
+
withdrawRequest: unknown;
|
2937
2937
|
activeStakeAmount: BN;
|
2938
2938
|
updateTimestamp: BN;
|
2939
2939
|
tradeTimestamp: BN;
|
@@ -3245,11 +3245,11 @@ export declare class PerpetualsClient {
|
|
3245
3245
|
sizeDecimals: number;
|
3246
3246
|
lockedDecimals: number;
|
3247
3247
|
collateralDecimals: number;
|
3248
|
-
|
3248
|
+
refererTokenStakeAccount: PublicKey;
|
3249
3249
|
refererBoosterAccount: PublicKey;
|
3250
3250
|
level: number;
|
3251
|
-
|
3252
|
-
|
3251
|
+
withdrawRequestCount: number;
|
3252
|
+
withdrawRequest: unknown;
|
3253
3253
|
activeStakeAmount: BN;
|
3254
3254
|
updateTimestamp: BN;
|
3255
3255
|
tradeTimestamp: BN;
|
@@ -3561,11 +3561,11 @@ export declare class PerpetualsClient {
|
|
3561
3561
|
sizeDecimals: number;
|
3562
3562
|
lockedDecimals: number;
|
3563
3563
|
collateralDecimals: number;
|
3564
|
-
|
3564
|
+
refererTokenStakeAccount: PublicKey;
|
3565
3565
|
refererBoosterAccount: PublicKey;
|
3566
3566
|
level: number;
|
3567
|
-
|
3568
|
-
|
3567
|
+
withdrawRequestCount: number;
|
3568
|
+
withdrawRequest: unknown;
|
3569
3569
|
activeStakeAmount: BN;
|
3570
3570
|
updateTimestamp: BN;
|
3571
3571
|
tradeTimestamp: BN;
|
@@ -3877,11 +3877,11 @@ export declare class PerpetualsClient {
|
|
3877
3877
|
sizeDecimals: number;
|
3878
3878
|
lockedDecimals: number;
|
3879
3879
|
collateralDecimals: number;
|
3880
|
-
|
3880
|
+
refererTokenStakeAccount: PublicKey;
|
3881
3881
|
refererBoosterAccount: PublicKey;
|
3882
3882
|
level: number;
|
3883
|
-
|
3884
|
-
|
3883
|
+
withdrawRequestCount: number;
|
3884
|
+
withdrawRequest: unknown;
|
3885
3885
|
activeStakeAmount: BN;
|
3886
3886
|
updateTimestamp: BN;
|
3887
3887
|
tradeTimestamp: BN;
|
@@ -4193,11 +4193,11 @@ export declare class PerpetualsClient {
|
|
4193
4193
|
sizeDecimals: number;
|
4194
4194
|
lockedDecimals: number;
|
4195
4195
|
collateralDecimals: number;
|
4196
|
-
|
4196
|
+
refererTokenStakeAccount: PublicKey;
|
4197
4197
|
refererBoosterAccount: PublicKey;
|
4198
4198
|
level: number;
|
4199
|
-
|
4200
|
-
|
4199
|
+
withdrawRequestCount: number;
|
4200
|
+
withdrawRequest: unknown;
|
4201
4201
|
activeStakeAmount: BN;
|
4202
4202
|
updateTimestamp: BN;
|
4203
4203
|
tradeTimestamp: BN;
|
@@ -4481,11 +4481,11 @@ export declare class PerpetualsClient {
|
|
4481
4481
|
instructions: TransactionInstruction[];
|
4482
4482
|
additionalSigners: Signer[];
|
4483
4483
|
}>;
|
4484
|
-
withdrawToken: (owner: PublicKey,
|
4484
|
+
withdrawToken: (owner: PublicKey, withdrawRequestId: number, poolConfig: PoolConfig) => Promise<{
|
4485
4485
|
instructions: TransactionInstruction[];
|
4486
4486
|
additionalSigners: Signer[];
|
4487
4487
|
}>;
|
4488
|
-
cancelUnstakeRequest: (owner: PublicKey,
|
4488
|
+
cancelUnstakeRequest: (owner: PublicKey, withdrawRequestId: number, poolConfig: PoolConfig) => Promise<{
|
4489
4489
|
instructions: TransactionInstruction[];
|
4490
4490
|
additionalSigners: Signer[];
|
4491
4491
|
}>;
|
@@ -4541,11 +4541,11 @@ export declare class PerpetualsClient {
|
|
4541
4541
|
instructions: TransactionInstruction[];
|
4542
4542
|
additionalSigners: Signer[];
|
4543
4543
|
}>;
|
4544
|
-
executeTriggerWithSwap: (owner: PublicKey, targetSymbol: string, collateralSymbol: string, receivingSymbol: string, side: Side, orderId: number, isStopLoss: boolean, poolConfig: PoolConfig, createUserATA?: boolean, ephemeralSignerPubkey?: any) => Promise<{
|
4544
|
+
executeTriggerWithSwap: (owner: PublicKey, targetSymbol: string, collateralSymbol: string, receivingSymbol: string, side: Side, orderId: number, isStopLoss: boolean, privilege: Privilege, poolConfig: PoolConfig, createUserATA?: boolean, ephemeralSignerPubkey?: any, nftTradingAccount?: PublicKey, nftReferralAccount?: PublicKey, nftRebateTokenAccount?: PublicKey) => Promise<{
|
4545
4545
|
instructions: TransactionInstruction[];
|
4546
4546
|
additionalSigners: Signer[];
|
4547
4547
|
}>;
|
4548
|
-
executeTriggerOrder: (owner: PublicKey, targetSymbol: string, collateralSymbol: string, side: Side, orderId: number, isStopLoss: boolean, poolConfig: PoolConfig, createUserATA?: boolean, ephemeralSignerPubkey?: any) => Promise<{
|
4548
|
+
executeTriggerOrder: (owner: PublicKey, targetSymbol: string, collateralSymbol: string, side: Side, orderId: number, isStopLoss: boolean, privilege: Privilege, poolConfig: PoolConfig, createUserATA?: boolean, ephemeralSignerPubkey?: any, nftTradingAccount?: PublicKey, nftReferralAccount?: PublicKey, nftRebateTokenAccount?: PublicKey) => Promise<{
|
4549
4549
|
instructions: TransactionInstruction[];
|
4550
4550
|
additionalSigners: Signer[];
|
4551
4551
|
}>;
|
package/dist/PerpetualsClient.js
CHANGED
@@ -5409,7 +5409,7 @@ var PerpetualsClient = (function () {
|
|
5409
5409
|
}
|
5410
5410
|
});
|
5411
5411
|
}); };
|
5412
|
-
this.withdrawToken = function (owner,
|
5412
|
+
this.withdrawToken = function (owner, withdrawRequestId, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
5413
5413
|
var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, userTokenAccount, withdrawTokenInstruction, err_29;
|
5414
5414
|
return __generator(this, function (_a) {
|
5415
5415
|
switch (_a.label) {
|
@@ -5430,7 +5430,7 @@ var PerpetualsClient = (function () {
|
|
5430
5430
|
}
|
5431
5431
|
return [4, this.program.methods
|
5432
5432
|
.withdrawToken({
|
5433
|
-
|
5433
|
+
withdrawRequestId: withdrawRequestId
|
5434
5434
|
})
|
5435
5435
|
.accounts({
|
5436
5436
|
owner: owner,
|
@@ -5460,7 +5460,7 @@ var PerpetualsClient = (function () {
|
|
5460
5460
|
}
|
5461
5461
|
});
|
5462
5462
|
}); };
|
5463
|
-
this.cancelUnstakeRequest = function (owner,
|
5463
|
+
this.cancelUnstakeRequest = function (owner, withdrawRequestId, poolConfig) { return __awaiter(_this, void 0, void 0, function () {
|
5464
5464
|
var preInstructions, instructions, postInstructions, additionalSigners, tokenStakeAccount, cancelUnstakeRequestInstruction, err_30;
|
5465
5465
|
return __generator(this, function (_a) {
|
5466
5466
|
switch (_a.label) {
|
@@ -5475,7 +5475,7 @@ var PerpetualsClient = (function () {
|
|
5475
5475
|
tokenStakeAccount = web3_js_1.PublicKey.findProgramAddressSync([Buffer.from("token_stake"), owner.toBuffer()], this.programId)[0];
|
5476
5476
|
return [4, this.program.methods
|
5477
5477
|
.cancelUnstakeTokenRequest({
|
5478
|
-
|
5478
|
+
withdrawRequestId: withdrawRequestId
|
5479
5479
|
})
|
5480
5480
|
.accounts({
|
5481
5481
|
owner: owner,
|
@@ -6107,7 +6107,9 @@ var PerpetualsClient = (function () {
|
|
6107
6107
|
privilege: privilege
|
6108
6108
|
})
|
6109
6109
|
.accounts({
|
6110
|
+
positionOwner: userPubkey,
|
6110
6111
|
feePayer: publicKey,
|
6112
|
+
transferAuthority: poolConfig.transferAuthority,
|
6111
6113
|
perpetuals: poolConfig.perpetuals,
|
6112
6114
|
pool: poolConfig.poolAddress,
|
6113
6115
|
position: positionAccount,
|
@@ -6117,6 +6119,7 @@ var PerpetualsClient = (function () {
|
|
6117
6119
|
targetOracleAccount: this.useExtOracleAccount ? targetCustodyConfig.extOracleAccount : targetCustodyConfig.intOracleAccount,
|
6118
6120
|
collateralCustody: collateralCustodyConfig.custodyAccount,
|
6119
6121
|
collateralOracleAccount: this.useExtOracleAccount ? collateralCustodyConfig.extOracleAccount : collateralCustodyConfig.intOracleAccount,
|
6122
|
+
collateralCustodyTokenAccount: collateralCustodyConfig.tokenAccount,
|
6120
6123
|
systemProgram: web3_js_1.SystemProgram.programId,
|
6121
6124
|
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
6122
6125
|
eventAuthority: this.eventAuthority.publicKey,
|
@@ -6146,9 +6149,9 @@ var PerpetualsClient = (function () {
|
|
6146
6149
|
if (nftReferralAccount === void 0) { nftReferralAccount = web3_js_1.PublicKey.default; }
|
6147
6150
|
if (nftRebateTokenAccount === void 0) { nftRebateTokenAccount = web3_js_1.PublicKey.default; }
|
6148
6151
|
return __awaiter(_this, void 0, void 0, function () {
|
6149
|
-
var publicKey, targetCustodyConfig, collateralCustodyConfig, reserveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners,
|
6150
|
-
return __generator(this, function (
|
6151
|
-
switch (
|
6152
|
+
var publicKey, targetCustodyConfig, collateralCustodyConfig, reserveCustodyConfig, marketAccount, preInstructions, instructions, postInstructions, additionalSigners, positionAccount, orderAccount, executeLimitWithSwap, err_40;
|
6153
|
+
return __generator(this, function (_a) {
|
6154
|
+
switch (_a.label) {
|
6152
6155
|
case 0:
|
6153
6156
|
publicKey = this.provider.wallet.publicKey;
|
6154
6157
|
targetCustodyConfig = poolConfig.custodies.find(function (i) { return i.mintKey.equals(poolConfig.getTokenFromSymbol(targetSymbol).mintKey); });
|
@@ -6159,24 +6162,9 @@ var PerpetualsClient = (function () {
|
|
6159
6162
|
instructions = [];
|
6160
6163
|
postInstructions = [];
|
6161
6164
|
additionalSigners = [];
|
6162
|
-
|
6163
|
-
custodyOracleAccountMetas = [];
|
6164
|
-
for (_i = 0, _a = poolConfig.custodies; _i < _a.length; _i++) {
|
6165
|
-
custody = _a[_i];
|
6166
|
-
custodyAccountMetas.push({
|
6167
|
-
pubkey: custody.custodyAccount,
|
6168
|
-
isSigner: false,
|
6169
|
-
isWritable: false,
|
6170
|
-
});
|
6171
|
-
custodyOracleAccountMetas.push({
|
6172
|
-
pubkey: this.useExtOracleAccount ? custody.extOracleAccount : custody.intOracleAccount,
|
6173
|
-
isSigner: false,
|
6174
|
-
isWritable: false,
|
6175
|
-
});
|
6176
|
-
}
|
6177
|
-
_b.label = 1;
|
6165
|
+
_a.label = 1;
|
6178
6166
|
case 1:
|
6179
|
-
|
6167
|
+
_a.trys.push([1, 3, , 4]);
|
6180
6168
|
positionAccount = poolConfig.getPositionFromMarketPk(userPubkey, marketAccount);
|
6181
6169
|
orderAccount = poolConfig.getOrderFromMarketPk(userPubkey, marketAccount);
|
6182
6170
|
return [4, this.program.methods
|
@@ -6185,7 +6173,9 @@ var PerpetualsClient = (function () {
|
|
6185
6173
|
privilege: privilege
|
6186
6174
|
})
|
6187
6175
|
.accounts({
|
6176
|
+
positionOwner: userPubkey,
|
6188
6177
|
feePayer: publicKey,
|
6178
|
+
transferAuthority: poolConfig.transferAuthority,
|
6189
6179
|
perpetuals: poolConfig.perpetuals,
|
6190
6180
|
pool: poolConfig.poolAddress,
|
6191
6181
|
reserveCustody: reserveCustodyConfig.custodyAccount,
|
@@ -6197,20 +6187,21 @@ var PerpetualsClient = (function () {
|
|
6197
6187
|
targetOracleAccount: this.useExtOracleAccount ? targetCustodyConfig.extOracleAccount : targetCustodyConfig.intOracleAccount,
|
6198
6188
|
collateralCustody: collateralCustodyConfig.custodyAccount,
|
6199
6189
|
collateralOracleAccount: this.useExtOracleAccount ? collateralCustodyConfig.extOracleAccount : collateralCustodyConfig.intOracleAccount,
|
6190
|
+
collateralCustodyTokenAccount: collateralCustodyConfig.tokenAccount,
|
6200
6191
|
systemProgram: web3_js_1.SystemProgram.programId,
|
6201
6192
|
tokenProgram: spl_token_1.TOKEN_PROGRAM_ID,
|
6202
6193
|
eventAuthority: this.eventAuthority.publicKey,
|
6203
6194
|
program: this.programId,
|
6204
6195
|
ixSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY
|
6205
6196
|
})
|
6206
|
-
.remainingAccounts(__spreadArray(
|
6197
|
+
.remainingAccounts(__spreadArray([], (0, getNftAccounts_1.getNftAccounts)(nftTradingAccount, nftReferralAccount, nftRebateTokenAccount, privilege), true))
|
6207
6198
|
.instruction()];
|
6208
6199
|
case 2:
|
6209
|
-
executeLimitWithSwap =
|
6200
|
+
executeLimitWithSwap = _a.sent();
|
6210
6201
|
instructions.push(executeLimitWithSwap);
|
6211
6202
|
return [3, 4];
|
6212
6203
|
case 3:
|
6213
|
-
err_40 =
|
6204
|
+
err_40 = _a.sent();
|
6214
6205
|
console.log("perpClient executeLimitWithSwap error:: ", err_40);
|
6215
6206
|
throw err_40;
|
6216
6207
|
case 4: return [2, {
|
@@ -6379,9 +6370,12 @@ var PerpetualsClient = (function () {
|
|
6379
6370
|
}
|
6380
6371
|
});
|
6381
6372
|
}); };
|
6382
|
-
this.executeTriggerWithSwap = function (owner, targetSymbol, collateralSymbol, receivingSymbol, side, orderId, isStopLoss, poolConfig, createUserATA, ephemeralSignerPubkey) {
|
6373
|
+
this.executeTriggerWithSwap = function (owner, targetSymbol, collateralSymbol, receivingSymbol, side, orderId, isStopLoss, privilege, poolConfig, createUserATA, ephemeralSignerPubkey, nftTradingAccount, nftReferralAccount, nftRebateTokenAccount) {
|
6383
6374
|
if (createUserATA === void 0) { createUserATA = true; }
|
6384
6375
|
if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
|
6376
|
+
if (nftTradingAccount === void 0) { nftTradingAccount = web3_js_1.PublicKey.default; }
|
6377
|
+
if (nftReferralAccount === void 0) { nftReferralAccount = web3_js_1.PublicKey.default; }
|
6378
|
+
if (nftRebateTokenAccount === void 0) { nftRebateTokenAccount = web3_js_1.PublicKey.default; }
|
6385
6379
|
return __awaiter(_this, void 0, void 0, function () {
|
6386
6380
|
var payerPubkey, targetCustodyConfig, collateralCustodyConfig, receivingCustodyConfig, marketAccount, userReceivingTokenAccount, userReceivingTokenAccountCollateral, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, _b, positionAccount, orderAccount, custodyAccountMetas, custodyOracleAccountMetas, _i, _c, custody, executeTriggerWithSwap, err_44;
|
6387
6381
|
return __generator(this, function (_d) {
|
@@ -6446,9 +6440,11 @@ var PerpetualsClient = (function () {
|
|
6446
6440
|
return [4, this.program.methods
|
6447
6441
|
.executeTriggerWithSwap({
|
6448
6442
|
isStopLoss: isStopLoss,
|
6449
|
-
orderId: orderId
|
6443
|
+
orderId: orderId,
|
6444
|
+
privilege: privilege
|
6450
6445
|
})
|
6451
6446
|
.accounts({
|
6447
|
+
positionOwner: owner,
|
6452
6448
|
feePayer: payerPubkey,
|
6453
6449
|
receivingAccount: userReceivingTokenAccount,
|
6454
6450
|
collateralAccount: userReceivingTokenAccountCollateral,
|
@@ -6471,7 +6467,7 @@ var PerpetualsClient = (function () {
|
|
6471
6467
|
program: this.programId,
|
6472
6468
|
ixSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY
|
6473
6469
|
})
|
6474
|
-
.remainingAccounts(__spreadArray(
|
6470
|
+
.remainingAccounts(__spreadArray([], (0, getNftAccounts_1.getNftAccounts)(nftTradingAccount, nftReferralAccount, nftRebateTokenAccount, privilege), true))
|
6475
6471
|
.instruction()];
|
6476
6472
|
case 8:
|
6477
6473
|
executeTriggerWithSwap = _d.sent();
|
@@ -6489,9 +6485,12 @@ var PerpetualsClient = (function () {
|
|
6489
6485
|
});
|
6490
6486
|
});
|
6491
6487
|
};
|
6492
|
-
this.executeTriggerOrder = function (owner, targetSymbol, collateralSymbol, side, orderId, isStopLoss, poolConfig, createUserATA, ephemeralSignerPubkey) {
|
6488
|
+
this.executeTriggerOrder = function (owner, targetSymbol, collateralSymbol, side, orderId, isStopLoss, privilege, poolConfig, createUserATA, ephemeralSignerPubkey, nftTradingAccount, nftReferralAccount, nftRebateTokenAccount) {
|
6493
6489
|
if (createUserATA === void 0) { createUserATA = true; }
|
6494
6490
|
if (ephemeralSignerPubkey === void 0) { ephemeralSignerPubkey = undefined; }
|
6491
|
+
if (nftTradingAccount === void 0) { nftTradingAccount = web3_js_1.PublicKey.default; }
|
6492
|
+
if (nftReferralAccount === void 0) { nftReferralAccount = web3_js_1.PublicKey.default; }
|
6493
|
+
if (nftRebateTokenAccount === void 0) { nftRebateTokenAccount = web3_js_1.PublicKey.default; }
|
6495
6494
|
return __awaiter(_this, void 0, void 0, function () {
|
6496
6495
|
var payerPubkey, targetCustodyConfig, collateralCustodyConfig, marketAccount, userReceivingTokenAccount, wrappedSolAccount, preInstructions, instructions, postInstructions, additionalSigners, _a, positionAccount, orderAccount, executeTriggerOrder, err_45;
|
6497
6496
|
return __generator(this, function (_b) {
|
@@ -6529,7 +6528,8 @@ var PerpetualsClient = (function () {
|
|
6529
6528
|
return [4, this.program.methods
|
6530
6529
|
.executeTriggerOrder({
|
6531
6530
|
isStopLoss: isStopLoss,
|
6532
|
-
orderId: orderId
|
6531
|
+
orderId: orderId,
|
6532
|
+
privilege: privilege
|
6533
6533
|
})
|
6534
6534
|
.accounts({
|
6535
6535
|
feePayer: payerPubkey,
|
@@ -6550,6 +6550,7 @@ var PerpetualsClient = (function () {
|
|
6550
6550
|
program: this.programId,
|
6551
6551
|
ixSysvar: web3_js_1.SYSVAR_INSTRUCTIONS_PUBKEY
|
6552
6552
|
})
|
6553
|
+
.remainingAccounts(__spreadArray([], (0, getNftAccounts_1.getNftAccounts)(nftTradingAccount, nftReferralAccount, nftRebateTokenAccount, privilege), true))
|
6553
6554
|
.instruction()];
|
6554
6555
|
case 6:
|
6555
6556
|
executeTriggerOrder = _b.sent();
|