@orderly.network/default-solana-adapter 2.12.2 → 2.12.3-alpha.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 +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.mjs
CHANGED
|
@@ -42,9 +42,9 @@ var __async = (__this, __arguments, generator) => {
|
|
|
42
42
|
// src/version.ts
|
|
43
43
|
if (typeof window !== "undefined") {
|
|
44
44
|
window.__ORDERLY_VERSION__ = window.__ORDERLY_VERSION__ || {};
|
|
45
|
-
window.__ORDERLY_VERSION__["@orderly.network/default-solana-adapter"] = "2.12.
|
|
45
|
+
window.__ORDERLY_VERSION__["@orderly.network/default-solana-adapter"] = "2.12.3-alpha.0";
|
|
46
46
|
}
|
|
47
|
-
var version_default = "2.12.
|
|
47
|
+
var version_default = "2.12.3-alpha.0";
|
|
48
48
|
|
|
49
49
|
// src/walletAdapter.ts
|
|
50
50
|
import * as ed from "@noble/ed25519";
|
|
@@ -110,6 +110,22 @@ var TREASURY_PROGRAM_ID = SEND_LIB_PROGRAM_ID;
|
|
|
110
110
|
var DVN_PROGRAM_ID = new PublicKey(
|
|
111
111
|
"HtEYV4xB4wvsj5fgTkcfuChYpvGYzgzwvNhgDZQNh7wW"
|
|
112
112
|
);
|
|
113
|
+
var LZ_DVN_PROGRAM_ID = DVN_PROGRAM_ID;
|
|
114
|
+
var CANARY_DVN_PROGRAM_ID = new PublicKey(
|
|
115
|
+
"5KAALa8AEEKnW6p6AacdnqNDmGMpfhwR7AEyWs1gUvsT"
|
|
116
|
+
);
|
|
117
|
+
var NEVERMIND_DVN_PROGRAM_ID = new PublicKey(
|
|
118
|
+
"4fs6aL12L18K5giDy9Dgxgrb3aNRYiuRV2a7JPPj3e7F"
|
|
119
|
+
);
|
|
120
|
+
var LZ_DVN_PDA = new PublicKey(
|
|
121
|
+
"4VDjp6XQaxoZf5RGwiPU9NR1EXSZn2TP4ATMmiSzLfhb"
|
|
122
|
+
);
|
|
123
|
+
var CANARY_DVN_PDA = new PublicKey(
|
|
124
|
+
"7jMeX5mzXnSSKYd8DxBDP4xMnkNFZZZm5W28FWUTbwU3"
|
|
125
|
+
);
|
|
126
|
+
var NEVERMIND_DVN_PDA = new PublicKey(
|
|
127
|
+
"GPjyWr8vCotGuFubDpTxDxy9Vj1ZeEN4F2dwRmFiaGab"
|
|
128
|
+
);
|
|
113
129
|
var VAULT_AUTHORITY_SEED = "VaultAuthority";
|
|
114
130
|
var BROKER_SEED = "Broker";
|
|
115
131
|
var TOKEN_SEED = "Token";
|
|
@@ -2546,11 +2562,103 @@ function getPriceFeedPda() {
|
|
|
2546
2562
|
PRICE_FEED_PROGRAM_ID
|
|
2547
2563
|
)[0];
|
|
2548
2564
|
}
|
|
2549
|
-
function
|
|
2550
|
-
|
|
2551
|
-
|
|
2552
|
-
|
|
2553
|
-
|
|
2565
|
+
function appendThreeDvnQuoteRemainingAccounts(priceFeedPda) {
|
|
2566
|
+
const priceFeedPair = () => [
|
|
2567
|
+
{
|
|
2568
|
+
pubkey: PRICE_FEED_PROGRAM_ID,
|
|
2569
|
+
isWritable: false,
|
|
2570
|
+
isSigner: false
|
|
2571
|
+
},
|
|
2572
|
+
{
|
|
2573
|
+
pubkey: priceFeedPda,
|
|
2574
|
+
isWritable: false,
|
|
2575
|
+
isSigner: false
|
|
2576
|
+
}
|
|
2577
|
+
];
|
|
2578
|
+
return [
|
|
2579
|
+
{
|
|
2580
|
+
pubkey: LZ_DVN_PROGRAM_ID,
|
|
2581
|
+
isWritable: false,
|
|
2582
|
+
isSigner: false
|
|
2583
|
+
},
|
|
2584
|
+
{
|
|
2585
|
+
pubkey: LZ_DVN_PDA,
|
|
2586
|
+
isWritable: false,
|
|
2587
|
+
isSigner: false
|
|
2588
|
+
},
|
|
2589
|
+
...priceFeedPair(),
|
|
2590
|
+
{
|
|
2591
|
+
pubkey: CANARY_DVN_PROGRAM_ID,
|
|
2592
|
+
isWritable: false,
|
|
2593
|
+
isSigner: false
|
|
2594
|
+
},
|
|
2595
|
+
{
|
|
2596
|
+
pubkey: CANARY_DVN_PDA,
|
|
2597
|
+
isWritable: false,
|
|
2598
|
+
isSigner: false
|
|
2599
|
+
},
|
|
2600
|
+
...priceFeedPair(),
|
|
2601
|
+
{
|
|
2602
|
+
pubkey: NEVERMIND_DVN_PROGRAM_ID,
|
|
2603
|
+
isWritable: false,
|
|
2604
|
+
isSigner: false
|
|
2605
|
+
},
|
|
2606
|
+
{
|
|
2607
|
+
pubkey: NEVERMIND_DVN_PDA,
|
|
2608
|
+
isWritable: false,
|
|
2609
|
+
isSigner: false
|
|
2610
|
+
},
|
|
2611
|
+
...priceFeedPair()
|
|
2612
|
+
];
|
|
2613
|
+
}
|
|
2614
|
+
function appendThreeDvnDepositRemainingAccounts(priceFeedPda) {
|
|
2615
|
+
const priceFeedPair = () => [
|
|
2616
|
+
{
|
|
2617
|
+
pubkey: PRICE_FEED_PROGRAM_ID,
|
|
2618
|
+
isWritable: false,
|
|
2619
|
+
isSigner: false
|
|
2620
|
+
},
|
|
2621
|
+
{
|
|
2622
|
+
pubkey: priceFeedPda,
|
|
2623
|
+
isWritable: false,
|
|
2624
|
+
isSigner: false
|
|
2625
|
+
}
|
|
2626
|
+
];
|
|
2627
|
+
return [
|
|
2628
|
+
{
|
|
2629
|
+
pubkey: LZ_DVN_PROGRAM_ID,
|
|
2630
|
+
isWritable: false,
|
|
2631
|
+
isSigner: false
|
|
2632
|
+
},
|
|
2633
|
+
{
|
|
2634
|
+
pubkey: LZ_DVN_PDA,
|
|
2635
|
+
isWritable: true,
|
|
2636
|
+
isSigner: false
|
|
2637
|
+
},
|
|
2638
|
+
...priceFeedPair(),
|
|
2639
|
+
{
|
|
2640
|
+
pubkey: CANARY_DVN_PROGRAM_ID,
|
|
2641
|
+
isWritable: false,
|
|
2642
|
+
isSigner: false
|
|
2643
|
+
},
|
|
2644
|
+
{
|
|
2645
|
+
pubkey: CANARY_DVN_PDA,
|
|
2646
|
+
isWritable: true,
|
|
2647
|
+
isSigner: false
|
|
2648
|
+
},
|
|
2649
|
+
...priceFeedPair(),
|
|
2650
|
+
{
|
|
2651
|
+
pubkey: NEVERMIND_DVN_PROGRAM_ID,
|
|
2652
|
+
isWritable: false,
|
|
2653
|
+
isSigner: false
|
|
2654
|
+
},
|
|
2655
|
+
{
|
|
2656
|
+
pubkey: NEVERMIND_DVN_PDA,
|
|
2657
|
+
isWritable: true,
|
|
2658
|
+
isSigner: false
|
|
2659
|
+
},
|
|
2660
|
+
...priceFeedPair()
|
|
2661
|
+
];
|
|
2554
2662
|
}
|
|
2555
2663
|
function getDstEID(OAPP_PROGRAM_ID) {
|
|
2556
2664
|
if (OAPP_PROGRAM_ID.toBase58() === MAINNET_OAPP_PROGRAM_ID.toBase58()) {
|
|
@@ -2881,7 +2989,6 @@ function getDepositQuoteFee(_0) {
|
|
|
2881
2989
|
const defaultSendConfigPDA = getDefaultSendConfigPda(DST_EID);
|
|
2882
2990
|
const executorConfigPDA = getExecutorConfigPda();
|
|
2883
2991
|
const priceFeedPDA = getPriceFeedPda();
|
|
2884
|
-
const dvnConfigPDA = getDvnConfigPda();
|
|
2885
2992
|
const messageLibPDA = getMessageLibPda(SEND_LIB_PROGRAM_ID);
|
|
2886
2993
|
const messageLibInfoPDA = getMessageLibInfoPda(messageLibPDA);
|
|
2887
2994
|
const vaultAuthorityPDA = getVaultAuthorityPda(appProgramId);
|
|
@@ -2968,26 +3075,7 @@ function getDepositQuoteFee(_0) {
|
|
|
2968
3075
|
isWritable: false,
|
|
2969
3076
|
isSigner: false
|
|
2970
3077
|
},
|
|
2971
|
-
|
|
2972
|
-
pubkey: DVN_PROGRAM_ID,
|
|
2973
|
-
isWritable: false,
|
|
2974
|
-
isSigner: false
|
|
2975
|
-
},
|
|
2976
|
-
{
|
|
2977
|
-
pubkey: dvnConfigPDA,
|
|
2978
|
-
isWritable: false,
|
|
2979
|
-
isSigner: false
|
|
2980
|
-
},
|
|
2981
|
-
{
|
|
2982
|
-
pubkey: PRICE_FEED_PROGRAM_ID,
|
|
2983
|
-
isWritable: false,
|
|
2984
|
-
isSigner: false
|
|
2985
|
-
},
|
|
2986
|
-
{
|
|
2987
|
-
pubkey: priceFeedPDA,
|
|
2988
|
-
isWritable: false,
|
|
2989
|
-
isSigner: false
|
|
2990
|
-
}
|
|
3078
|
+
...appendThreeDvnQuoteRemainingAccounts(priceFeedPDA)
|
|
2991
3079
|
]).instruction();
|
|
2992
3080
|
const lastBlockHash = yield connection.getLatestBlockhash();
|
|
2993
3081
|
const lookupTableAddress = getLookupTableAddress(appProgramId);
|
|
@@ -2999,10 +3087,13 @@ function getDepositQuoteFee(_0) {
|
|
|
2999
3087
|
console.log("-- lookup table account error");
|
|
3000
3088
|
throw new Error("-- lookup table account error");
|
|
3001
3089
|
}
|
|
3090
|
+
const ixQuoteComputeBudget = ComputeBudgetProgram.setComputeUnitLimit({
|
|
3091
|
+
units: 6e5
|
|
3092
|
+
});
|
|
3002
3093
|
const feeMsg = new TransactionMessage({
|
|
3003
3094
|
payerKey: userPublicKey,
|
|
3004
3095
|
recentBlockhash: lastBlockHash.blockhash,
|
|
3005
|
-
instructions: [quoteFee]
|
|
3096
|
+
instructions: [ixQuoteComputeBudget, quoteFee]
|
|
3006
3097
|
}).compileToV0Message([lookupTableAccount]);
|
|
3007
3098
|
const feeTx = new VersionedTransaction(feeMsg);
|
|
3008
3099
|
const feeRes = yield connection.simulateTransaction(feeTx);
|
|
@@ -3088,7 +3179,6 @@ function deposit(_0) {
|
|
|
3088
3179
|
const ulnEventAuthorityPDA = getUlnEventAuthorityPda();
|
|
3089
3180
|
const executorConfigPDA = getExecutorConfigPda();
|
|
3090
3181
|
const priceFeedPDA = getPriceFeedPda();
|
|
3091
|
-
const dvnConfigPDA = getDvnConfigPda();
|
|
3092
3182
|
const vaultDepositParams = getDepositParams(userAddress, depositData);
|
|
3093
3183
|
const buildSendRemainingAccounts = () => [
|
|
3094
3184
|
// ENDPOINT solana/programs/programs/uln/src/instructions/endpoint/send.rs
|
|
@@ -3216,28 +3306,7 @@ function deposit(_0) {
|
|
|
3216
3306
|
// 17
|
|
3217
3307
|
pubkey: priceFeedPDA
|
|
3218
3308
|
},
|
|
3219
|
-
|
|
3220
|
-
isSigner: false,
|
|
3221
|
-
isWritable: false,
|
|
3222
|
-
pubkey: DVN_PROGRAM_ID
|
|
3223
|
-
},
|
|
3224
|
-
{
|
|
3225
|
-
isSigner: false,
|
|
3226
|
-
isWritable: true,
|
|
3227
|
-
// 18
|
|
3228
|
-
pubkey: dvnConfigPDA
|
|
3229
|
-
},
|
|
3230
|
-
{
|
|
3231
|
-
isSigner: false,
|
|
3232
|
-
isWritable: false,
|
|
3233
|
-
pubkey: PRICE_FEED_PROGRAM_ID
|
|
3234
|
-
},
|
|
3235
|
-
{
|
|
3236
|
-
isSigner: false,
|
|
3237
|
-
isWritable: false,
|
|
3238
|
-
// 17
|
|
3239
|
-
pubkey: priceFeedPDA
|
|
3240
|
-
}
|
|
3309
|
+
...appendThreeDvnDepositRemainingAccounts(priceFeedPDA)
|
|
3241
3310
|
];
|
|
3242
3311
|
const fee = yield getDepositQuoteFee({
|
|
3243
3312
|
vaultAddress,
|
|
@@ -3284,7 +3353,7 @@ function deposit(_0) {
|
|
|
3284
3353
|
return;
|
|
3285
3354
|
}
|
|
3286
3355
|
const ixAddComputeBudget = ComputeBudgetProgram.setComputeUnitLimit({
|
|
3287
|
-
units:
|
|
3356
|
+
units: 8e5
|
|
3288
3357
|
});
|
|
3289
3358
|
const lastBlockHash = yield connection.getLatestBlockhash();
|
|
3290
3359
|
const msg = new TransactionMessage({
|