@layerzerolabs/lz-solana-sdk-v2 2.3.17 → 2.3.19
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 +20 -0
- package/deployments/solana-mainnet/blocked_messagelib.json +9 -0
- package/deployments/solana-mainnet/dvn.json +9 -0
- package/deployments/solana-mainnet/endpoint.json +9 -0
- package/deployments/solana-mainnet/executor.json +9 -0
- package/deployments/solana-mainnet/oft.json +9 -0
- package/deployments/solana-mainnet/pricefeed.json +9 -0
- package/deployments/solana-mainnet/uln.json +9 -0
- package/deployments/solana-testnet/oft.json +9 -0
- package/dist/index.cjs +25 -9
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +9 -8
- package/dist/index.d.ts +9 -8
- package/dist/index.mjs +24 -8
- package/dist/index.mjs.map +1 -1
- package/package.json +6 -7
package/dist/index.d.mts
CHANGED
|
@@ -52,7 +52,7 @@ declare class EndpointPDADeriver {
|
|
|
52
52
|
messageLibraryInfo(messageLibrary: PublicKey): [PublicKey, number];
|
|
53
53
|
defaultReceiveLibraryConfig(srcEndpointId: number): [PublicKey, number];
|
|
54
54
|
receiveLibraryConfig(receiver: PublicKey, srcEndpointId: number): [PublicKey, number];
|
|
55
|
-
receiveLibraryTimeout(
|
|
55
|
+
receiveLibraryTimeout(_dstEndpointId: number): [PublicKey, number];
|
|
56
56
|
defaultMessageLib(): [PublicKey, number];
|
|
57
57
|
blockMessageLib(blockMsgLib: PublicKey): [PublicKey, number];
|
|
58
58
|
/**
|
|
@@ -6512,9 +6512,9 @@ declare class Endpoint {
|
|
|
6512
6512
|
initOAppNonce(connection: Connection, delegate: PublicKey, // payer
|
|
6513
6513
|
dstEid: number, oappIDPDA: PublicKey, remoteOappAddr: Uint8Array): Promise<TransactionInstruction | null>;
|
|
6514
6514
|
initSendLibrary(connection: Connection, delegate: PublicKey, sender: PublicKey, dstEid: number, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<TransactionInstruction | null>;
|
|
6515
|
-
setSendLibrary(
|
|
6515
|
+
setSendLibrary(_connection: Connection, oappAdmin: PublicKey, oappIDPDA: PublicKey, newSendLibProgram: PublicKey, dstEid: number): Promise<TransactionInstruction | null>;
|
|
6516
6516
|
initReceiveLibrary(connection: Connection, delegate: PublicKey, receiver: PublicKey, srcEid: number, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<TransactionInstruction | null>;
|
|
6517
|
-
setReceiveLibrary(
|
|
6517
|
+
setReceiveLibrary(_connection: Connection, oappAdmin: PublicKey, oappIDPDA: PublicKey, newReceiveLibProgram: PublicKey, srcEid: number, gracePeriod?: number): Promise<TransactionInstruction | null>;
|
|
6518
6518
|
setOappConfig(connection: Connection, oappDelegate: PublicKey, oappID: PublicKey, msgLibProgram: PublicKey, eid: number, config: {
|
|
6519
6519
|
configType: SetConfigType;
|
|
6520
6520
|
value: ExecutorConfig$1 | UlnConfig$1;
|
|
@@ -6542,7 +6542,7 @@ declare class Endpoint {
|
|
|
6542
6542
|
/***
|
|
6543
6543
|
* setConfig is only supported by ULN
|
|
6544
6544
|
*/
|
|
6545
|
-
getSetConfigIXAccountMetaForCPI(
|
|
6545
|
+
getSetConfigIXAccountMetaForCPI(_connection: Connection, msgLibProgram: PublicKey, oappID: PublicKey, eid: number, commitmentOrConfig?: Commitment | GetAccountInfoConfig): AccountMeta[];
|
|
6546
6546
|
/***
|
|
6547
6547
|
* resetConfig is only supported by ULN
|
|
6548
6548
|
*/
|
|
@@ -6592,7 +6592,7 @@ declare class Endpoint {
|
|
|
6592
6592
|
isValid: boolean;
|
|
6593
6593
|
} | null;
|
|
6594
6594
|
} | null>;
|
|
6595
|
-
getInboundPayloadHash(connection: Connection, receiver: PublicKey, srcEid: number, sender: Uint8Array, nonce: number,
|
|
6595
|
+
getInboundPayloadHash(connection: Connection, receiver: PublicKey, srcEid: number, sender: Uint8Array, nonce: number, _payloadHash: Uint8Array, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<PayloadHash | null>;
|
|
6596
6596
|
getComposedMessageState(connection: Connection, from: PublicKey, params: SendComposeParams, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<ComposeMessageState | null>;
|
|
6597
6597
|
getNonce(connection: Connection, oappIDPDA: PublicKey, remoteEid: number, remoteOappAddr: Uint8Array, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<Nonce$1 | null>;
|
|
6598
6598
|
getPendingInboundNonce(connection: Connection, oappIDPDA: PublicKey, remoteEid: number, remoteOappAddr: Uint8Array, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<PendingInboundNonce | null>;
|
|
@@ -6616,7 +6616,7 @@ declare class SimpleMessageLib implements MessageLibInterface {
|
|
|
6616
6616
|
setWhitelistCaller(admin: PublicKey, newCaller: PublicKey): TransactionInstruction;
|
|
6617
6617
|
isWhiteListed(connection: Connection, caller: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<boolean>;
|
|
6618
6618
|
getWhiteListCaller(connection: Connection, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<PublicKey>;
|
|
6619
|
-
validatePacket(
|
|
6619
|
+
validatePacket(_connection: Connection, endpointProgram: PublicKey, payer: PublicKey, encodedPacket: Uint8Array): TransactionInstruction;
|
|
6620
6620
|
/***
|
|
6621
6621
|
* Get the account meta of the send instruction for CPI(Cross-Program Invocation )
|
|
6622
6622
|
*/
|
|
@@ -6626,7 +6626,7 @@ declare class SimpleMessageLib implements MessageLibInterface {
|
|
|
6626
6626
|
* Get the account meta of the send instruction for CPI(Cross-Program Invocation )
|
|
6627
6627
|
*/
|
|
6628
6628
|
getInitConfigIXAccountMetaForCPI(payer: PublicKey, oappID: PublicKey, eid: number): Promise<AccountMeta[]>;
|
|
6629
|
-
getSetConfigIXAccountMetaForCPI(
|
|
6629
|
+
getSetConfigIXAccountMetaForCPI(_endpointProgram: PublicKey, _oappID: PublicKey, _eid: number): Promise<AccountMeta[]>;
|
|
6630
6630
|
}
|
|
6631
6631
|
|
|
6632
6632
|
type simpleMessageLib_SimpleMessageLib = SimpleMessageLib;
|
|
@@ -11016,6 +11016,7 @@ declare class Executor {
|
|
|
11016
11016
|
setAllowList(owner: PublicKey, allowlist: PublicKey[]): TransactionInstruction;
|
|
11017
11017
|
setDenyList(owner: PublicKey, denylist: PublicKey[]): TransactionInstruction;
|
|
11018
11018
|
setPaused(owner: PublicKey, paused: boolean): TransactionInstruction;
|
|
11019
|
+
setExecutors(owner: PublicKey, executors: PublicKey[]): TransactionInstruction;
|
|
11019
11020
|
setMsglibs(owner: PublicKey, msglibPrograms: PublicKey[]): TransactionInstruction;
|
|
11020
11021
|
setDefaultMultiplierBps(admin: PublicKey, defaultMultiplierBps: number): TransactionInstruction;
|
|
11021
11022
|
setDstConfig(admin: PublicKey, dstConfigs: DstConfig$1[]): TransactionInstruction;
|
|
@@ -13810,7 +13811,7 @@ declare function quoteWithUln(connection: Connection, payer: PublicKey, tokenMin
|
|
|
13810
13811
|
nativeFee: bigint;
|
|
13811
13812
|
lzTokenFee: bigint;
|
|
13812
13813
|
}>;
|
|
13813
|
-
declare function createSetMintAuthorityIx(signer: PublicKey, oftInstance: PublicKey, newAuthority: PublicKey): Promise<TransactionInstruction>;
|
|
13814
|
+
declare function createSetMintAuthorityIx(signer: PublicKey, oftInstance: PublicKey, newAuthority: PublicKey | null): Promise<TransactionInstruction>;
|
|
13814
13815
|
declare function getEndpointConfig(connection: Connection, oftInstance: PublicKey, dstEid: number): Promise<{
|
|
13815
13816
|
sendLibraryConfig: SendLibraryConfig & {
|
|
13816
13817
|
ulnSendConfig?: SendConfig;
|
package/dist/index.d.ts
CHANGED
|
@@ -52,7 +52,7 @@ declare class EndpointPDADeriver {
|
|
|
52
52
|
messageLibraryInfo(messageLibrary: PublicKey): [PublicKey, number];
|
|
53
53
|
defaultReceiveLibraryConfig(srcEndpointId: number): [PublicKey, number];
|
|
54
54
|
receiveLibraryConfig(receiver: PublicKey, srcEndpointId: number): [PublicKey, number];
|
|
55
|
-
receiveLibraryTimeout(
|
|
55
|
+
receiveLibraryTimeout(_dstEndpointId: number): [PublicKey, number];
|
|
56
56
|
defaultMessageLib(): [PublicKey, number];
|
|
57
57
|
blockMessageLib(blockMsgLib: PublicKey): [PublicKey, number];
|
|
58
58
|
/**
|
|
@@ -6512,9 +6512,9 @@ declare class Endpoint {
|
|
|
6512
6512
|
initOAppNonce(connection: Connection, delegate: PublicKey, // payer
|
|
6513
6513
|
dstEid: number, oappIDPDA: PublicKey, remoteOappAddr: Uint8Array): Promise<TransactionInstruction | null>;
|
|
6514
6514
|
initSendLibrary(connection: Connection, delegate: PublicKey, sender: PublicKey, dstEid: number, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<TransactionInstruction | null>;
|
|
6515
|
-
setSendLibrary(
|
|
6515
|
+
setSendLibrary(_connection: Connection, oappAdmin: PublicKey, oappIDPDA: PublicKey, newSendLibProgram: PublicKey, dstEid: number): Promise<TransactionInstruction | null>;
|
|
6516
6516
|
initReceiveLibrary(connection: Connection, delegate: PublicKey, receiver: PublicKey, srcEid: number, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<TransactionInstruction | null>;
|
|
6517
|
-
setReceiveLibrary(
|
|
6517
|
+
setReceiveLibrary(_connection: Connection, oappAdmin: PublicKey, oappIDPDA: PublicKey, newReceiveLibProgram: PublicKey, srcEid: number, gracePeriod?: number): Promise<TransactionInstruction | null>;
|
|
6518
6518
|
setOappConfig(connection: Connection, oappDelegate: PublicKey, oappID: PublicKey, msgLibProgram: PublicKey, eid: number, config: {
|
|
6519
6519
|
configType: SetConfigType;
|
|
6520
6520
|
value: ExecutorConfig$1 | UlnConfig$1;
|
|
@@ -6542,7 +6542,7 @@ declare class Endpoint {
|
|
|
6542
6542
|
/***
|
|
6543
6543
|
* setConfig is only supported by ULN
|
|
6544
6544
|
*/
|
|
6545
|
-
getSetConfigIXAccountMetaForCPI(
|
|
6545
|
+
getSetConfigIXAccountMetaForCPI(_connection: Connection, msgLibProgram: PublicKey, oappID: PublicKey, eid: number, commitmentOrConfig?: Commitment | GetAccountInfoConfig): AccountMeta[];
|
|
6546
6546
|
/***
|
|
6547
6547
|
* resetConfig is only supported by ULN
|
|
6548
6548
|
*/
|
|
@@ -6592,7 +6592,7 @@ declare class Endpoint {
|
|
|
6592
6592
|
isValid: boolean;
|
|
6593
6593
|
} | null;
|
|
6594
6594
|
} | null>;
|
|
6595
|
-
getInboundPayloadHash(connection: Connection, receiver: PublicKey, srcEid: number, sender: Uint8Array, nonce: number,
|
|
6595
|
+
getInboundPayloadHash(connection: Connection, receiver: PublicKey, srcEid: number, sender: Uint8Array, nonce: number, _payloadHash: Uint8Array, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<PayloadHash | null>;
|
|
6596
6596
|
getComposedMessageState(connection: Connection, from: PublicKey, params: SendComposeParams, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<ComposeMessageState | null>;
|
|
6597
6597
|
getNonce(connection: Connection, oappIDPDA: PublicKey, remoteEid: number, remoteOappAddr: Uint8Array, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<Nonce$1 | null>;
|
|
6598
6598
|
getPendingInboundNonce(connection: Connection, oappIDPDA: PublicKey, remoteEid: number, remoteOappAddr: Uint8Array, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<PendingInboundNonce | null>;
|
|
@@ -6616,7 +6616,7 @@ declare class SimpleMessageLib implements MessageLibInterface {
|
|
|
6616
6616
|
setWhitelistCaller(admin: PublicKey, newCaller: PublicKey): TransactionInstruction;
|
|
6617
6617
|
isWhiteListed(connection: Connection, caller: PublicKey, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<boolean>;
|
|
6618
6618
|
getWhiteListCaller(connection: Connection, commitmentOrConfig?: Commitment | GetAccountInfoConfig): Promise<PublicKey>;
|
|
6619
|
-
validatePacket(
|
|
6619
|
+
validatePacket(_connection: Connection, endpointProgram: PublicKey, payer: PublicKey, encodedPacket: Uint8Array): TransactionInstruction;
|
|
6620
6620
|
/***
|
|
6621
6621
|
* Get the account meta of the send instruction for CPI(Cross-Program Invocation )
|
|
6622
6622
|
*/
|
|
@@ -6626,7 +6626,7 @@ declare class SimpleMessageLib implements MessageLibInterface {
|
|
|
6626
6626
|
* Get the account meta of the send instruction for CPI(Cross-Program Invocation )
|
|
6627
6627
|
*/
|
|
6628
6628
|
getInitConfigIXAccountMetaForCPI(payer: PublicKey, oappID: PublicKey, eid: number): Promise<AccountMeta[]>;
|
|
6629
|
-
getSetConfigIXAccountMetaForCPI(
|
|
6629
|
+
getSetConfigIXAccountMetaForCPI(_endpointProgram: PublicKey, _oappID: PublicKey, _eid: number): Promise<AccountMeta[]>;
|
|
6630
6630
|
}
|
|
6631
6631
|
|
|
6632
6632
|
type simpleMessageLib_SimpleMessageLib = SimpleMessageLib;
|
|
@@ -11016,6 +11016,7 @@ declare class Executor {
|
|
|
11016
11016
|
setAllowList(owner: PublicKey, allowlist: PublicKey[]): TransactionInstruction;
|
|
11017
11017
|
setDenyList(owner: PublicKey, denylist: PublicKey[]): TransactionInstruction;
|
|
11018
11018
|
setPaused(owner: PublicKey, paused: boolean): TransactionInstruction;
|
|
11019
|
+
setExecutors(owner: PublicKey, executors: PublicKey[]): TransactionInstruction;
|
|
11019
11020
|
setMsglibs(owner: PublicKey, msglibPrograms: PublicKey[]): TransactionInstruction;
|
|
11020
11021
|
setDefaultMultiplierBps(admin: PublicKey, defaultMultiplierBps: number): TransactionInstruction;
|
|
11021
11022
|
setDstConfig(admin: PublicKey, dstConfigs: DstConfig$1[]): TransactionInstruction;
|
|
@@ -13810,7 +13811,7 @@ declare function quoteWithUln(connection: Connection, payer: PublicKey, tokenMin
|
|
|
13810
13811
|
nativeFee: bigint;
|
|
13811
13812
|
lzTokenFee: bigint;
|
|
13812
13813
|
}>;
|
|
13813
|
-
declare function createSetMintAuthorityIx(signer: PublicKey, oftInstance: PublicKey, newAuthority: PublicKey): Promise<TransactionInstruction>;
|
|
13814
|
+
declare function createSetMintAuthorityIx(signer: PublicKey, oftInstance: PublicKey, newAuthority: PublicKey | null): Promise<TransactionInstruction>;
|
|
13814
13815
|
declare function getEndpointConfig(connection: Connection, oftInstance: PublicKey, dstEid: number): Promise<{
|
|
13815
13816
|
sendLibraryConfig: SendLibraryConfig & {
|
|
13816
13817
|
ulnSendConfig?: SendConfig;
|
package/dist/index.mjs
CHANGED
|
@@ -14,8 +14,8 @@ import '@ethersproject/abi';
|
|
|
14
14
|
import { BigNumber } from '@ethersproject/bignumber';
|
|
15
15
|
import '@ethersproject/solidity';
|
|
16
16
|
import { keccak256 } from '@ethersproject/keccak256';
|
|
17
|
+
import { signWithECDSA } from '@layerzerolabs/lz-corekit-solana';
|
|
17
18
|
import { Environment, EndpointId } from '@layerzerolabs/lz-definitions';
|
|
18
|
-
import { signWithECDSA } from '@layerzerolabs/lz-utilities';
|
|
19
19
|
import crypto from 'crypto';
|
|
20
20
|
import base58 from 'bs58';
|
|
21
21
|
import { hexlify } from 'ethers/lib/utils';
|
|
@@ -2542,7 +2542,7 @@ var EndpointPDADeriver = class {
|
|
|
2542
2542
|
this.program
|
|
2543
2543
|
);
|
|
2544
2544
|
}
|
|
2545
|
-
receiveLibraryTimeout(
|
|
2545
|
+
receiveLibraryTimeout(_dstEndpointId) {
|
|
2546
2546
|
return [this.program, 0];
|
|
2547
2547
|
}
|
|
2548
2548
|
defaultMessageLib() {
|
|
@@ -8543,7 +8543,7 @@ var Endpoint = class {
|
|
|
8543
8543
|
this.program
|
|
8544
8544
|
);
|
|
8545
8545
|
}
|
|
8546
|
-
async setSendLibrary(
|
|
8546
|
+
async setSendLibrary(_connection, oappAdmin, oappIDPDA2, newSendLibProgram, dstEid) {
|
|
8547
8547
|
const [newSendLib] = new MessageLibPDADeriver(newSendLibProgram).messageLib();
|
|
8548
8548
|
const [sendLibraryConfig] = this.endpointDeriver.sendLibraryConfig(oappIDPDA2, dstEid);
|
|
8549
8549
|
const [sendLibraryInfo] = this.endpointDeriver.messageLibraryInfo(newSendLib);
|
|
@@ -8590,7 +8590,7 @@ var Endpoint = class {
|
|
|
8590
8590
|
this.program
|
|
8591
8591
|
);
|
|
8592
8592
|
}
|
|
8593
|
-
async setReceiveLibrary(
|
|
8593
|
+
async setReceiveLibrary(_connection, oappAdmin, oappIDPDA2, newReceiveLibProgram, srcEid, gracePeriod) {
|
|
8594
8594
|
const [newReceiveLib] = new MessageLibPDADeriver(newReceiveLibProgram).messageLib();
|
|
8595
8595
|
const [receiveLibraryConfig] = this.endpointDeriver.receiveLibraryConfig(oappIDPDA2, srcEid);
|
|
8596
8596
|
const [receiveLibraryInfo] = this.endpointDeriver.messageLibraryInfo(newReceiveLib);
|
|
@@ -8837,7 +8837,7 @@ var Endpoint = class {
|
|
|
8837
8837
|
/***
|
|
8838
8838
|
* setConfig is only supported by ULN
|
|
8839
8839
|
*/
|
|
8840
|
-
getSetConfigIXAccountMetaForCPI(
|
|
8840
|
+
getSetConfigIXAccountMetaForCPI(_connection, msgLibProgram, oappID, eid, commitmentOrConfig = "confirmed") {
|
|
8841
8841
|
const msgLib = msgLibProgram;
|
|
8842
8842
|
const [msgLibInfo] = this.endpointDeriver.messageLibraryInfo(msgLib);
|
|
8843
8843
|
const ix = createSetConfigInstruction(
|
|
@@ -9250,7 +9250,7 @@ var Endpoint = class {
|
|
|
9250
9250
|
return { programId: messageLibInfo.owner, msgLib: info.messageLib, isDefault: false, timeout: null };
|
|
9251
9251
|
}
|
|
9252
9252
|
// rename to a more generic name
|
|
9253
|
-
async getInboundPayloadHash(connection, receiver, srcEid, sender, nonce,
|
|
9253
|
+
async getInboundPayloadHash(connection, receiver, srcEid, sender, nonce, _payloadHash, commitmentOrConfig) {
|
|
9254
9254
|
const [payloadHashPDA] = this.endpointDeriver.payloadHash(receiver, srcEid, sender, nonce);
|
|
9255
9255
|
const accountInfo = await connection.getAccountInfo(payloadHashPDA, commitmentOrConfig);
|
|
9256
9256
|
if (!accountInfo) {
|
|
@@ -11301,7 +11301,7 @@ var SimpleMessageLib = class {
|
|
|
11301
11301
|
);
|
|
11302
11302
|
return messageLibInfo.wlCaller;
|
|
11303
11303
|
}
|
|
11304
|
-
validatePacket(
|
|
11304
|
+
validatePacket(_connection, endpointProgram, payer, encodedPacket) {
|
|
11305
11305
|
const packet = PacketV1Codec.fromBytes(encodedPacket);
|
|
11306
11306
|
const [receiveLibrary] = this.deriver.messageLib();
|
|
11307
11307
|
const endpoint = new endpoint_exports.Endpoint(endpointProgram);
|
|
@@ -11411,7 +11411,7 @@ var SimpleMessageLib = class {
|
|
|
11411
11411
|
});
|
|
11412
11412
|
return Promise.resolve(ix.keys.slice(1));
|
|
11413
11413
|
}
|
|
11414
|
-
async getSetConfigIXAccountMetaForCPI(
|
|
11414
|
+
async getSetConfigIXAccountMetaForCPI(_endpointProgram, _oappID, _eid) {
|
|
11415
11415
|
return Promise.reject(new Error("Method not implemented."));
|
|
11416
11416
|
}
|
|
11417
11417
|
};
|
|
@@ -15868,6 +15868,22 @@ var Executor = class {
|
|
|
15868
15868
|
this.program
|
|
15869
15869
|
);
|
|
15870
15870
|
}
|
|
15871
|
+
setExecutors(owner, executors) {
|
|
15872
|
+
const [configAccount] = this.deriver.config();
|
|
15873
|
+
return createOwnerSetConfigInstruction(
|
|
15874
|
+
{
|
|
15875
|
+
owner,
|
|
15876
|
+
config: configAccount
|
|
15877
|
+
},
|
|
15878
|
+
{
|
|
15879
|
+
params: {
|
|
15880
|
+
fields: [executors],
|
|
15881
|
+
__kind: "Executors"
|
|
15882
|
+
}
|
|
15883
|
+
},
|
|
15884
|
+
this.program
|
|
15885
|
+
);
|
|
15886
|
+
}
|
|
15871
15887
|
setMsglibs(owner, msglibPrograms) {
|
|
15872
15888
|
const [configAccount] = this.deriver.config();
|
|
15873
15889
|
const msglibPdas = msglibPrograms.map((program) => {
|