@layerzerolabs/lz-solana-sdk-v2 2.3.31 → 2.3.33
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 +28 -0
- package/dist/index.cjs +4 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.mjs +3 -11
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -6581,7 +6581,7 @@ declare class Endpoint {
|
|
|
6581
6581
|
isDefault: boolean;
|
|
6582
6582
|
timeout: {
|
|
6583
6583
|
msgLib: PublicKey;
|
|
6584
|
-
|
|
6584
|
+
expiry: bigint;
|
|
6585
6585
|
} | null;
|
|
6586
6586
|
} | null>;
|
|
6587
6587
|
getInboundPayloadHash(connection: Connection, receiver: PublicKey, srcEid: number, sender: Uint8Array, nonce: number, _payloadHash: Uint8Array, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<PayloadHash | null>;
|
package/dist/index.d.ts
CHANGED
|
@@ -6581,7 +6581,7 @@ declare class Endpoint {
|
|
|
6581
6581
|
isDefault: boolean;
|
|
6582
6582
|
timeout: {
|
|
6583
6583
|
msgLib: PublicKey;
|
|
6584
|
-
|
|
6584
|
+
expiry: bigint;
|
|
6585
6585
|
} | null;
|
|
6586
6586
|
} | null>;
|
|
6587
6587
|
getInboundPayloadHash(connection: Connection, receiver: PublicKey, srcEid: number, sender: Uint8Array, nonce: number, _payloadHash: Uint8Array, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<PayloadHash | null>;
|
package/dist/index.mjs
CHANGED
|
@@ -14,7 +14,6 @@ import base58 from 'bs58';
|
|
|
14
14
|
import '@ethersproject/abi';
|
|
15
15
|
import { BigNumber } from '@ethersproject/bignumber';
|
|
16
16
|
import '@ethersproject/solidity';
|
|
17
|
-
import { signWithECDSA } from '@layerzerolabs/lz-corekit-solana';
|
|
18
17
|
import { Environment, EndpointId } from '@layerzerolabs/lz-definitions';
|
|
19
18
|
import crypto from 'crypto';
|
|
20
19
|
import { sha256 } from '@ethersproject/sha2';
|
|
@@ -9088,15 +9087,11 @@ var Endpoint = class {
|
|
|
9088
9087
|
if (messageLibInfo2) {
|
|
9089
9088
|
const { timeout: timeout2 } = defaultInfo;
|
|
9090
9089
|
if (timeout2) {
|
|
9091
|
-
const slot = await connection.getSlot();
|
|
9092
|
-
const timestamp = await connection.getBlockTime(slot);
|
|
9093
|
-
invariant5(timestamp, "timestamp should not be null");
|
|
9094
|
-
const isValid = parseInt(timeout2.expiry.toString()) > timestamp;
|
|
9095
9090
|
return {
|
|
9096
9091
|
programId: defaultInfo.messageLib,
|
|
9097
9092
|
msgLib: defaultInfo.messageLib,
|
|
9098
9093
|
isDefault: true,
|
|
9099
|
-
timeout: { msgLib: timeout2.messageLib,
|
|
9094
|
+
timeout: { msgLib: timeout2.messageLib, expiry: BigInt(timeout2.expiry.toString()) }
|
|
9100
9095
|
};
|
|
9101
9096
|
}
|
|
9102
9097
|
}
|
|
@@ -9111,15 +9106,11 @@ var Endpoint = class {
|
|
|
9111
9106
|
invariant5(messageLibInfo, "messageLibInfo should not be null");
|
|
9112
9107
|
const { timeout } = info;
|
|
9113
9108
|
if (timeout) {
|
|
9114
|
-
const slot = await connection.getSlot();
|
|
9115
|
-
const timestamp = await connection.getBlockTime(slot);
|
|
9116
|
-
invariant5(timestamp, "timestamp should not be null");
|
|
9117
|
-
const isValid = parseInt(timeout.expiry.toString()) > timestamp;
|
|
9118
9109
|
return {
|
|
9119
9110
|
programId: messageLibInfo.owner,
|
|
9120
9111
|
msgLib: info.messageLib,
|
|
9121
9112
|
isDefault: false,
|
|
9122
|
-
timeout: { msgLib: timeout.messageLib,
|
|
9113
|
+
timeout: { msgLib: timeout.messageLib, expiry: BigInt(timeout.expiry.toString()) }
|
|
9123
9114
|
};
|
|
9124
9115
|
}
|
|
9125
9116
|
return { programId: messageLibInfo.owner, msgLib: info.messageLib, isDefault: false, timeout: null };
|
|
@@ -13122,6 +13113,7 @@ var SolanaSignerExt = class _SolanaSignerExt {
|
|
|
13122
13113
|
return new _SolanaSignerExt(signers);
|
|
13123
13114
|
}
|
|
13124
13115
|
async sign(message) {
|
|
13116
|
+
const { signWithECDSA } = await import('@layerzerolabs/lz-corekit-solana');
|
|
13125
13117
|
return Promise.all(this.signers.map(async (s) => signWithECDSA(message, s.ECDSAPrivateKey)));
|
|
13126
13118
|
}
|
|
13127
13119
|
};
|