@orderly.network/default-solana-adapter 2.12.2 → 2.12.3
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 +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +122 -53
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +122 -53
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -76,9 +76,9 @@ module.exports = __toCommonJS(index_exports);
|
|
|
76
76
|
// src/version.ts
|
|
77
77
|
if (typeof window !== "undefined") {
|
|
78
78
|
window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
|
|
79
|
-
window.__ORDERLY_VERSION__["@orderly.network/default-solana-adapter"] = "2.12.
|
|
79
|
+
window.__ORDERLY_VERSION__["@orderly.network/default-solana-adapter"] = "2.12.3";
|
|
80
80
|
}
|
|
81
|
-
var version_default = "2.12.
|
|
81
|
+
var version_default = "2.12.3";
|
|
82
82
|
|
|
83
83
|
// src/walletAdapter.ts
|
|
84
84
|
var ed = __toESM(require("@noble/ed25519"));
|
|
@@ -120,6 +120,22 @@ var TREASURY_PROGRAM_ID = SEND_LIB_PROGRAM_ID;
|
|
|
120
120
|
var DVN_PROGRAM_ID = new import_web3.PublicKey(
|
|
121
121
|
"HtEYV4xB4wvsj5fgTkcfuChYpvGYzgzwvNhgDZQNh7wW"
|
|
122
122
|
);
|
|
123
|
+
var LZ_DVN_PROGRAM_ID = DVN_PROGRAM_ID;
|
|
124
|
+
var CANARY_DVN_PROGRAM_ID = new import_web3.PublicKey(
|
|
125
|
+
"5KAALa8AEEKnW6p6AacdnqNDmGMpfhwR7AEyWs1gUvsT"
|
|
126
|
+
);
|
|
127
|
+
var NEVERMIND_DVN_PROGRAM_ID = new import_web3.PublicKey(
|
|
128
|
+
"4fs6aL12L18K5giDy9Dgxgrb3aNRYiuRV2a7JPPj3e7F"
|
|
129
|
+
);
|
|
130
|
+
var LZ_DVN_PDA = new import_web3.PublicKey(
|
|
131
|
+
"4VDjp6XQaxoZf5RGwiPU9NR1EXSZn2TP4ATMmiSzLfhb"
|
|
132
|
+
);
|
|
133
|
+
var CANARY_DVN_PDA = new import_web3.PublicKey(
|
|
134
|
+
"7jMeX5mzXnSSKYd8DxBDP4xMnkNFZZZm5W28FWUTbwU3"
|
|
135
|
+
);
|
|
136
|
+
var NEVERMIND_DVN_PDA = new import_web3.PublicKey(
|
|
137
|
+
"GPjyWr8vCotGuFubDpTxDxy9Vj1ZeEN4F2dwRmFiaGab"
|
|
138
|
+
);
|
|
123
139
|
var VAULT_AUTHORITY_SEED = "VaultAuthority";
|
|
124
140
|
var BROKER_SEED = "Broker";
|
|
125
141
|
var TOKEN_SEED = "Token";
|
|
@@ -2541,11 +2557,103 @@ function getPriceFeedPda() {
|
|
|
2541
2557
|
PRICE_FEED_PROGRAM_ID
|
|
2542
2558
|
)[0];
|
|
2543
2559
|
}
|
|
2544
|
-
function
|
|
2545
|
-
|
|
2546
|
-
|
|
2547
|
-
|
|
2548
|
-
|
|
2560
|
+
function appendThreeDvnQuoteRemainingAccounts(priceFeedPda) {
|
|
2561
|
+
const priceFeedPair = () => [
|
|
2562
|
+
{
|
|
2563
|
+
pubkey: PRICE_FEED_PROGRAM_ID,
|
|
2564
|
+
isWritable: false,
|
|
2565
|
+
isSigner: false
|
|
2566
|
+
},
|
|
2567
|
+
{
|
|
2568
|
+
pubkey: priceFeedPda,
|
|
2569
|
+
isWritable: false,
|
|
2570
|
+
isSigner: false
|
|
2571
|
+
}
|
|
2572
|
+
];
|
|
2573
|
+
return [
|
|
2574
|
+
{
|
|
2575
|
+
pubkey: LZ_DVN_PROGRAM_ID,
|
|
2576
|
+
isWritable: false,
|
|
2577
|
+
isSigner: false
|
|
2578
|
+
},
|
|
2579
|
+
{
|
|
2580
|
+
pubkey: LZ_DVN_PDA,
|
|
2581
|
+
isWritable: false,
|
|
2582
|
+
isSigner: false
|
|
2583
|
+
},
|
|
2584
|
+
...priceFeedPair(),
|
|
2585
|
+
{
|
|
2586
|
+
pubkey: CANARY_DVN_PROGRAM_ID,
|
|
2587
|
+
isWritable: false,
|
|
2588
|
+
isSigner: false
|
|
2589
|
+
},
|
|
2590
|
+
{
|
|
2591
|
+
pubkey: CANARY_DVN_PDA,
|
|
2592
|
+
isWritable: false,
|
|
2593
|
+
isSigner: false
|
|
2594
|
+
},
|
|
2595
|
+
...priceFeedPair(),
|
|
2596
|
+
{
|
|
2597
|
+
pubkey: NEVERMIND_DVN_PROGRAM_ID,
|
|
2598
|
+
isWritable: false,
|
|
2599
|
+
isSigner: false
|
|
2600
|
+
},
|
|
2601
|
+
{
|
|
2602
|
+
pubkey: NEVERMIND_DVN_PDA,
|
|
2603
|
+
isWritable: false,
|
|
2604
|
+
isSigner: false
|
|
2605
|
+
},
|
|
2606
|
+
...priceFeedPair()
|
|
2607
|
+
];
|
|
2608
|
+
}
|
|
2609
|
+
function appendThreeDvnDepositRemainingAccounts(priceFeedPda) {
|
|
2610
|
+
const priceFeedPair = () => [
|
|
2611
|
+
{
|
|
2612
|
+
pubkey: PRICE_FEED_PROGRAM_ID,
|
|
2613
|
+
isWritable: false,
|
|
2614
|
+
isSigner: false
|
|
2615
|
+
},
|
|
2616
|
+
{
|
|
2617
|
+
pubkey: priceFeedPda,
|
|
2618
|
+
isWritable: false,
|
|
2619
|
+
isSigner: false
|
|
2620
|
+
}
|
|
2621
|
+
];
|
|
2622
|
+
return [
|
|
2623
|
+
{
|
|
2624
|
+
pubkey: LZ_DVN_PROGRAM_ID,
|
|
2625
|
+
isWritable: false,
|
|
2626
|
+
isSigner: false
|
|
2627
|
+
},
|
|
2628
|
+
{
|
|
2629
|
+
pubkey: LZ_DVN_PDA,
|
|
2630
|
+
isWritable: true,
|
|
2631
|
+
isSigner: false
|
|
2632
|
+
},
|
|
2633
|
+
...priceFeedPair(),
|
|
2634
|
+
{
|
|
2635
|
+
pubkey: CANARY_DVN_PROGRAM_ID,
|
|
2636
|
+
isWritable: false,
|
|
2637
|
+
isSigner: false
|
|
2638
|
+
},
|
|
2639
|
+
{
|
|
2640
|
+
pubkey: CANARY_DVN_PDA,
|
|
2641
|
+
isWritable: true,
|
|
2642
|
+
isSigner: false
|
|
2643
|
+
},
|
|
2644
|
+
...priceFeedPair(),
|
|
2645
|
+
{
|
|
2646
|
+
pubkey: NEVERMIND_DVN_PROGRAM_ID,
|
|
2647
|
+
isWritable: false,
|
|
2648
|
+
isSigner: false
|
|
2649
|
+
},
|
|
2650
|
+
{
|
|
2651
|
+
pubkey: NEVERMIND_DVN_PDA,
|
|
2652
|
+
isWritable: true,
|
|
2653
|
+
isSigner: false
|
|
2654
|
+
},
|
|
2655
|
+
...priceFeedPair()
|
|
2656
|
+
];
|
|
2549
2657
|
}
|
|
2550
2658
|
function getDstEID(OAPP_PROGRAM_ID) {
|
|
2551
2659
|
if (OAPP_PROGRAM_ID.toBase58() === MAINNET_OAPP_PROGRAM_ID.toBase58()) {
|
|
@@ -2876,7 +2984,6 @@ function getDepositQuoteFee(_0) {
|
|
|
2876
2984
|
const defaultSendConfigPDA = getDefaultSendConfigPda(DST_EID);
|
|
2877
2985
|
const executorConfigPDA = getExecutorConfigPda();
|
|
2878
2986
|
const priceFeedPDA = getPriceFeedPda();
|
|
2879
|
-
const dvnConfigPDA = getDvnConfigPda();
|
|
2880
2987
|
const messageLibPDA = getMessageLibPda(SEND_LIB_PROGRAM_ID);
|
|
2881
2988
|
const messageLibInfoPDA = getMessageLibInfoPda(messageLibPDA);
|
|
2882
2989
|
const vaultAuthorityPDA = getVaultAuthorityPda(appProgramId);
|
|
@@ -2963,26 +3070,7 @@ function getDepositQuoteFee(_0) {
|
|
|
2963
3070
|
isWritable: false,
|
|
2964
3071
|
isSigner: false
|
|
2965
3072
|
},
|
|
2966
|
-
|
|
2967
|
-
pubkey: DVN_PROGRAM_ID,
|
|
2968
|
-
isWritable: false,
|
|
2969
|
-
isSigner: false
|
|
2970
|
-
},
|
|
2971
|
-
{
|
|
2972
|
-
pubkey: dvnConfigPDA,
|
|
2973
|
-
isWritable: false,
|
|
2974
|
-
isSigner: false
|
|
2975
|
-
},
|
|
2976
|
-
{
|
|
2977
|
-
pubkey: PRICE_FEED_PROGRAM_ID,
|
|
2978
|
-
isWritable: false,
|
|
2979
|
-
isSigner: false
|
|
2980
|
-
},
|
|
2981
|
-
{
|
|
2982
|
-
pubkey: priceFeedPDA,
|
|
2983
|
-
isWritable: false,
|
|
2984
|
-
isSigner: false
|
|
2985
|
-
}
|
|
3073
|
+
...appendThreeDvnQuoteRemainingAccounts(priceFeedPDA)
|
|
2986
3074
|
]).instruction();
|
|
2987
3075
|
const lastBlockHash = yield connection.getLatestBlockhash();
|
|
2988
3076
|
const lookupTableAddress = getLookupTableAddress(appProgramId);
|
|
@@ -2994,10 +3082,13 @@ function getDepositQuoteFee(_0) {
|
|
|
2994
3082
|
console.log("-- lookup table account error");
|
|
2995
3083
|
throw new Error("-- lookup table account error");
|
|
2996
3084
|
}
|
|
3085
|
+
const ixQuoteComputeBudget = import_web33.ComputeBudgetProgram.setComputeUnitLimit({
|
|
3086
|
+
units: 6e5
|
|
3087
|
+
});
|
|
2997
3088
|
const feeMsg = new import_web33.TransactionMessage({
|
|
2998
3089
|
payerKey: userPublicKey,
|
|
2999
3090
|
recentBlockhash: lastBlockHash.blockhash,
|
|
3000
|
-
instructions: [quoteFee]
|
|
3091
|
+
instructions: [ixQuoteComputeBudget, quoteFee]
|
|
3001
3092
|
}).compileToV0Message([lookupTableAccount]);
|
|
3002
3093
|
const feeTx = new import_web33.VersionedTransaction(feeMsg);
|
|
3003
3094
|
const feeRes = yield connection.simulateTransaction(feeTx);
|
|
@@ -3083,7 +3174,6 @@ function deposit(_0) {
|
|
|
3083
3174
|
const ulnEventAuthorityPDA = getUlnEventAuthorityPda();
|
|
3084
3175
|
const executorConfigPDA = getExecutorConfigPda();
|
|
3085
3176
|
const priceFeedPDA = getPriceFeedPda();
|
|
3086
|
-
const dvnConfigPDA = getDvnConfigPda();
|
|
3087
3177
|
const vaultDepositParams = getDepositParams(userAddress, depositData);
|
|
3088
3178
|
const buildSendRemainingAccounts = () => [
|
|
3089
3179
|
// ENDPOINT solana/programs/programs/uln/src/instructions/endpoint/send.rs
|
|
@@ -3211,28 +3301,7 @@ function deposit(_0) {
|
|
|
3211
3301
|
// 17
|
|
3212
3302
|
pubkey: priceFeedPDA
|
|
3213
3303
|
},
|
|
3214
|
-
|
|
3215
|
-
isSigner: false,
|
|
3216
|
-
isWritable: false,
|
|
3217
|
-
pubkey: DVN_PROGRAM_ID
|
|
3218
|
-
},
|
|
3219
|
-
{
|
|
3220
|
-
isSigner: false,
|
|
3221
|
-
isWritable: true,
|
|
3222
|
-
// 18
|
|
3223
|
-
pubkey: dvnConfigPDA
|
|
3224
|
-
},
|
|
3225
|
-
{
|
|
3226
|
-
isSigner: false,
|
|
3227
|
-
isWritable: false,
|
|
3228
|
-
pubkey: PRICE_FEED_PROGRAM_ID
|
|
3229
|
-
},
|
|
3230
|
-
{
|
|
3231
|
-
isSigner: false,
|
|
3232
|
-
isWritable: false,
|
|
3233
|
-
// 17
|
|
3234
|
-
pubkey: priceFeedPDA
|
|
3235
|
-
}
|
|
3304
|
+
...appendThreeDvnDepositRemainingAccounts(priceFeedPDA)
|
|
3236
3305
|
];
|
|
3237
3306
|
const fee = yield getDepositQuoteFee({
|
|
3238
3307
|
vaultAddress,
|
|
@@ -3279,7 +3348,7 @@ function deposit(_0) {
|
|
|
3279
3348
|
return;
|
|
3280
3349
|
}
|
|
3281
3350
|
const ixAddComputeBudget = import_web33.ComputeBudgetProgram.setComputeUnitLimit({
|
|
3282
|
-
units:
|
|
3351
|
+
units: 8e5
|
|
3283
3352
|
});
|
|
3284
3353
|
const lastBlockHash = yield connection.getLatestBlockhash();
|
|
3285
3354
|
const msg = new import_web33.TransactionMessage({
|