@layerzerolabs/lz-solana-sdk-v2 2.3.26 → 2.3.28
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/CHANGELOG.md +30 -0
- package/deployments/solana-mainnet/dvn-nethermind.json +9 -0
- package/deployments/solana-sandbox-local/blocked_messagelib.json +1 -1
- package/dist/index.cjs +51 -29
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +15 -2
- package/dist/index.d.ts +15 -2
- package/dist/index.mjs +51 -29
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
- package/deployments/solana-sandbox-local/omnicounter.json +0 -9
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,35 @@
|
|
|
1
1
|
# @layerzerolabs/lz-solana-sdk-v2
|
|
2
2
|
|
|
3
|
+
## 2.3.28
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 23d7ea0: endpoints, including flare mainnet
|
|
8
|
+
- 23d7ea0: zklink mainnet, and testnets
|
|
9
|
+
- 8a40261: Fix some known issues in Solana
|
|
10
|
+
- 23d7ea0: testnet endpoints
|
|
11
|
+
- Updated dependencies [23d7ea0]
|
|
12
|
+
- Updated dependencies [23d7ea0]
|
|
13
|
+
- Updated dependencies [8a40261]
|
|
14
|
+
- Updated dependencies [23d7ea0]
|
|
15
|
+
- @layerzerolabs/lz-corekit-solana@2.3.28
|
|
16
|
+
- @layerzerolabs/lz-definitions@2.3.28
|
|
17
|
+
- @layerzerolabs/lz-v2-utilities@2.3.28
|
|
18
|
+
|
|
19
|
+
## 2.3.27
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- e382bef: Update the access property of the `hardhat-tron` package
|
|
24
|
+
- d41cbe9: endpoints, including flare mainnet
|
|
25
|
+
- d41cbe9: testnet endpoints
|
|
26
|
+
- Updated dependencies [e382bef]
|
|
27
|
+
- Updated dependencies [d41cbe9]
|
|
28
|
+
- Updated dependencies [d41cbe9]
|
|
29
|
+
- @layerzerolabs/lz-corekit-solana@2.3.27
|
|
30
|
+
- @layerzerolabs/lz-definitions@2.3.27
|
|
31
|
+
- @layerzerolabs/lz-v2-utilities@2.3.27
|
|
32
|
+
|
|
3
33
|
## 2.3.26
|
|
4
34
|
|
|
5
35
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -20526,25 +20526,40 @@ var Oft = class {
|
|
|
20526
20526
|
const peerInfo = await Peer.fromAccountAddress(connection, peer);
|
|
20527
20527
|
peerAddr = peerInfo.address;
|
|
20528
20528
|
}
|
|
20529
|
-
|
|
20530
|
-
|
|
20531
|
-
|
|
20532
|
-
|
|
20533
|
-
|
|
20534
|
-
|
|
20535
|
-
|
|
20536
|
-
|
|
20537
|
-
|
|
20538
|
-
|
|
20539
|
-
|
|
20540
|
-
|
|
20541
|
-
|
|
20542
|
-
await isAccountInitialized(
|
|
20529
|
+
if (remainingAccounts === void 0 || remainingAccounts.length === 0) {
|
|
20530
|
+
const msgLibProgram = await this.getSendLibraryProgram(connection, payer, dstEid);
|
|
20531
|
+
const [endpointSettings] = this.endpoint.deriver.setting();
|
|
20532
|
+
const packetPath = {
|
|
20533
|
+
srcEid: 0,
|
|
20534
|
+
dstEid,
|
|
20535
|
+
sender: bytes.hexlify(oftConfig.toBytes()),
|
|
20536
|
+
receiver: bytes.hexlify(peerAddr)
|
|
20537
|
+
};
|
|
20538
|
+
invariant5__default.default(
|
|
20539
|
+
await isAccountInitialized(connection, endpointSettings),
|
|
20540
|
+
"endpointSettings account not initialized"
|
|
20541
|
+
);
|
|
20542
|
+
invariant5__default.default(await isAccountInitialized(connection, peer), "peer account not initialized");
|
|
20543
|
+
invariant5__default.default(
|
|
20544
|
+
await isAccountInitialized(connection, enforcedOptions),
|
|
20545
|
+
"enforcedOptions account not initialized"
|
|
20546
|
+
);
|
|
20547
|
+
invariant5__default.default(await isAccountInitialized(connection, payer), "payer account not initialized");
|
|
20548
|
+
invariant5__default.default(
|
|
20549
|
+
await isAccountInitialized(
|
|
20550
|
+
connection,
|
|
20551
|
+
this.endpoint.deriver.nonce(oftConfig, dstEid, Uint8Array.from(peerAddr))[0]
|
|
20552
|
+
),
|
|
20553
|
+
"nonce account not initialized"
|
|
20554
|
+
);
|
|
20555
|
+
remainingAccounts = await this.endpoint.getSendIXAccountMetaForCPI(
|
|
20543
20556
|
connection,
|
|
20544
|
-
|
|
20545
|
-
|
|
20546
|
-
|
|
20547
|
-
|
|
20557
|
+
payer,
|
|
20558
|
+
packetPath,
|
|
20559
|
+
msgLibProgram,
|
|
20560
|
+
commitmentOrConfig
|
|
20561
|
+
);
|
|
20562
|
+
}
|
|
20548
20563
|
return createSendInstruction(
|
|
20549
20564
|
{
|
|
20550
20565
|
signer: payer,
|
|
@@ -20558,13 +20573,7 @@ var Oft = class {
|
|
|
20558
20573
|
eventAuthority: this.eventAuthorityPDA,
|
|
20559
20574
|
program: this.program,
|
|
20560
20575
|
// Get remaining accounts from msgLib(simple_msgLib or uln)
|
|
20561
|
-
anchorRemainingAccounts: remainingAccounts
|
|
20562
|
-
connection,
|
|
20563
|
-
payer,
|
|
20564
|
-
packetPath,
|
|
20565
|
-
msgLibProgram,
|
|
20566
|
-
commitmentOrConfig
|
|
20567
|
-
)
|
|
20576
|
+
anchorRemainingAccounts: remainingAccounts
|
|
20568
20577
|
},
|
|
20569
20578
|
{
|
|
20570
20579
|
params: {
|
|
@@ -20709,7 +20718,7 @@ async function createSetPeerIx(admin, oftConfig, dstEid, peer, oftProgramId = PR
|
|
|
20709
20718
|
{
|
|
20710
20719
|
params: {
|
|
20711
20720
|
dstEid,
|
|
20712
|
-
peer
|
|
20721
|
+
peer: Array.from(peer)
|
|
20713
20722
|
}
|
|
20714
20723
|
},
|
|
20715
20724
|
oftProgramId
|
|
@@ -20905,15 +20914,28 @@ async function quoteOft(connection, payer, tokenMint, dstEid, amountLd, minAmoun
|
|
|
20905
20914
|
oftProgramId
|
|
20906
20915
|
);
|
|
20907
20916
|
const returnedValues = await simulateTransaction(connection, [ix], ix.programId, payer, "confirmed");
|
|
20908
|
-
const [
|
|
20909
|
-
return
|
|
20917
|
+
const [resultInBeet] = types_exports.quoteOftResultBeet.deserialize(returnedValues, 0);
|
|
20918
|
+
return {
|
|
20919
|
+
oftLimits: {
|
|
20920
|
+
minAmountLd: BigInt(resultInBeet.oftLimits.minAmountLd.toString()),
|
|
20921
|
+
maxAmountLd: BigInt(resultInBeet.oftLimits.maxAmountLd.toString())
|
|
20922
|
+
},
|
|
20923
|
+
oftFeeDetails: resultInBeet.oftFeeDetails.map((fee) => ({
|
|
20924
|
+
feeAmountLd: BigInt(fee.feeAmountLd.toString()),
|
|
20925
|
+
description: fee.description
|
|
20926
|
+
})),
|
|
20927
|
+
oftReceipt: {
|
|
20928
|
+
amountSentLd: BigInt(resultInBeet.oftReceipt.amountSentLd.toString()),
|
|
20929
|
+
amountReceivedLd: BigInt(resultInBeet.oftReceipt.amountReceivedLd.toString())
|
|
20930
|
+
}
|
|
20931
|
+
};
|
|
20910
20932
|
}
|
|
20911
20933
|
async function quoteWithUln(connection, payer, tokenMint, dstEid, amountLd, minAmountLd, options, to, payInLzToken = false, tokenEscrow, composeMsg, peerAddr, remainingAccounts, tokenProgram = splToken.TOKEN_PROGRAM_ID, oftProgramId = PROGRAM_ID, msgLibProgram = PROGRAM_ID6, endpointProgram = PROGRAM_ID2) {
|
|
20912
20934
|
const oft = new Oft(oftProgramId, endpointProgram, tokenProgram, tokenMint, tokenEscrow);
|
|
20913
20935
|
const oftInstance = oft.getOftConfig();
|
|
20914
20936
|
const [enforcedOptions] = oft.deriver.enforcedOptions(oftInstance, dstEid);
|
|
20915
20937
|
const [peer] = oft.deriver.peer(oftInstance, dstEid);
|
|
20916
|
-
if (peerAddr
|
|
20938
|
+
if (peerAddr === void 0) {
|
|
20917
20939
|
const peerInfo = await accounts_exports.Peer.fromAccountAddress(connection, peer);
|
|
20918
20940
|
peerAddr = peerInfo.address;
|
|
20919
20941
|
}
|