@layerzerolabs/lz-solana-sdk-v2 3.0.66 → 3.0.68-ton.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/CHANGELOG.md +13 -0
- package/dist/umi.cjs +188 -14
- package/dist/umi.cjs.map +1 -1
- package/dist/umi.d.mts +88 -7
- package/dist/umi.d.ts +88 -7
- package/dist/umi.mjs +188 -15
- package/dist/umi.mjs.map +1 -1
- package/package.json +13 -10
- package/src/generated/kinobi/dvn/instructions/extendDvnConfig.ts +124 -0
- package/src/generated/kinobi/dvn/instructions/index.ts +1 -0
- package/src/generated/kinobi/executor/instructions/extendExecutorConfig.ts +124 -0
- package/src/generated/kinobi/executor/instructions/index.ts +1 -0
- package/src/generated/kinobi/pricefeed/instructions/extendPriceFeed.ts +124 -0
- package/src/generated/kinobi/pricefeed/instructions/index.ts +1 -0
- package/src/next_nonce.ts +2 -9
- package/src/utility.ts +14 -13
package/dist/umi.mjs
CHANGED
|
@@ -7395,7 +7395,9 @@ function getMultisigConfigSetEventSerializer() {
|
|
|
7395
7395
|
var instructions_exports3 = {};
|
|
7396
7396
|
__export(instructions_exports3, {
|
|
7397
7397
|
closeExecute: () => closeExecute,
|
|
7398
|
+
extendDvnConfig: () => extendDvnConfig,
|
|
7398
7399
|
getCloseExecuteInstructionDataSerializer: () => getCloseExecuteInstructionDataSerializer,
|
|
7400
|
+
getExtendDvnConfigInstructionDataSerializer: () => getExtendDvnConfigInstructionDataSerializer,
|
|
7399
7401
|
getInitDvnInstructionDataSerializer: () => getInitDvnInstructionDataSerializer,
|
|
7400
7402
|
getInvokeInstructionDataSerializer: () => getInvokeInstructionDataSerializer,
|
|
7401
7403
|
getQuoteDvnInstructionDataSerializer: () => getQuoteDvnInstructionDataSerializer,
|
|
@@ -7503,6 +7505,61 @@ function closeExecute(context, input) {
|
|
|
7503
7505
|
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }
|
|
7504
7506
|
]);
|
|
7505
7507
|
}
|
|
7508
|
+
function getExtendDvnConfigInstructionDataSerializer() {
|
|
7509
|
+
return mapSerializer(
|
|
7510
|
+
struct(
|
|
7511
|
+
[["discriminator", bytes({ size: 8 })]],
|
|
7512
|
+
{ description: "ExtendDvnConfigInstructionData" }
|
|
7513
|
+
),
|
|
7514
|
+
(value) => ({
|
|
7515
|
+
...value,
|
|
7516
|
+
discriminator: new Uint8Array([183, 248, 24, 49, 110, 229, 169, 66])
|
|
7517
|
+
})
|
|
7518
|
+
);
|
|
7519
|
+
}
|
|
7520
|
+
function extendDvnConfig(context, input) {
|
|
7521
|
+
const programId = context.programs.getPublicKey(
|
|
7522
|
+
"dvn",
|
|
7523
|
+
"HtEYV4xB4wvsj5fgTkcfuChYpvGYzgzwvNhgDZQNh7wW"
|
|
7524
|
+
);
|
|
7525
|
+
const resolvedAccounts = {
|
|
7526
|
+
admin: {
|
|
7527
|
+
index: 0,
|
|
7528
|
+
isWritable: true,
|
|
7529
|
+
value: input.admin ?? null
|
|
7530
|
+
},
|
|
7531
|
+
config: {
|
|
7532
|
+
index: 1,
|
|
7533
|
+
isWritable: true,
|
|
7534
|
+
value: input.config ?? null
|
|
7535
|
+
},
|
|
7536
|
+
systemProgram: {
|
|
7537
|
+
index: 2,
|
|
7538
|
+
isWritable: false,
|
|
7539
|
+
value: input.systemProgram ?? null
|
|
7540
|
+
}
|
|
7541
|
+
};
|
|
7542
|
+
if (!resolvedAccounts.systemProgram.value) {
|
|
7543
|
+
resolvedAccounts.systemProgram.value = context.programs.getPublicKey(
|
|
7544
|
+
"splSystem",
|
|
7545
|
+
"11111111111111111111111111111111"
|
|
7546
|
+
);
|
|
7547
|
+
resolvedAccounts.systemProgram.isWritable = false;
|
|
7548
|
+
}
|
|
7549
|
+
const orderedAccounts = Object.values(
|
|
7550
|
+
resolvedAccounts
|
|
7551
|
+
).sort((a, b) => a.index - b.index);
|
|
7552
|
+
const [keys, signers] = getAccountMetasAndSigners3(
|
|
7553
|
+
orderedAccounts,
|
|
7554
|
+
"programId",
|
|
7555
|
+
programId
|
|
7556
|
+
);
|
|
7557
|
+
const data = getExtendDvnConfigInstructionDataSerializer().serialize({});
|
|
7558
|
+
const bytesCreatedOnChain = 0;
|
|
7559
|
+
return transactionBuilder([
|
|
7560
|
+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }
|
|
7561
|
+
]);
|
|
7562
|
+
}
|
|
7506
7563
|
function getInitDvnInstructionDataSerializer() {
|
|
7507
7564
|
return mapSerializer(
|
|
7508
7565
|
struct(
|
|
@@ -7924,6 +7981,7 @@ __export(dvn_exports, {
|
|
|
7924
7981
|
expectPda: () => expectPda,
|
|
7925
7982
|
expectPublicKey: () => expectPublicKey,
|
|
7926
7983
|
expectSome: () => expectSome,
|
|
7984
|
+
extendDvnConfig: () => extendDvnConfig,
|
|
7927
7985
|
fetchAllDvnConfig: () => fetchAllDvnConfig,
|
|
7928
7986
|
fetchAllExecuteHash: () => fetchAllExecuteHash,
|
|
7929
7987
|
fetchAllReceiveConfig: () => fetchAllReceiveConfig,
|
|
@@ -7945,6 +8003,7 @@ __export(dvn_exports, {
|
|
|
7945
8003
|
getExecuteHashGpaBuilder: () => getExecuteHashGpaBuilder,
|
|
7946
8004
|
getExecuteHashSize: () => getExecuteHashSize,
|
|
7947
8005
|
getExecuteTransactionDigestSerializer: () => getExecuteTransactionDigestSerializer,
|
|
8006
|
+
getExtendDvnConfigInstructionDataSerializer: () => getExtendDvnConfigInstructionDataSerializer,
|
|
7948
8007
|
getInitDvnInstructionDataSerializer: () => getInitDvnInstructionDataSerializer,
|
|
7949
8008
|
getInvokeInstructionDataSerializer: () => getInvokeInstructionDataSerializer,
|
|
7950
8009
|
getLzOptionSerializer: () => getLzOptionSerializer,
|
|
@@ -8909,10 +8968,12 @@ __export(instructions_exports4, {
|
|
|
8909
8968
|
compose: () => compose,
|
|
8910
8969
|
executable: () => executable,
|
|
8911
8970
|
execute: () => execute,
|
|
8971
|
+
extendExecutorConfig: () => extendExecutorConfig,
|
|
8912
8972
|
getAdminSetConfigInstructionDataSerializer: () => getAdminSetConfigInstructionDataSerializer,
|
|
8913
8973
|
getComposeInstructionDataSerializer: () => getComposeInstructionDataSerializer,
|
|
8914
8974
|
getExecutableInstructionDataSerializer: () => getExecutableInstructionDataSerializer,
|
|
8915
8975
|
getExecuteInstructionDataSerializer: () => getExecuteInstructionDataSerializer,
|
|
8976
|
+
getExtendExecutorConfigInstructionDataSerializer: () => getExtendExecutorConfigInstructionDataSerializer,
|
|
8916
8977
|
getInitExecutorInstructionDataSerializer: () => getInitExecutorInstructionDataSerializer,
|
|
8917
8978
|
getNativeDropInstructionDataSerializer: () => getNativeDropInstructionDataSerializer,
|
|
8918
8979
|
getOwnerSetConfigInstructionDataSerializer: () => getOwnerSetConfigInstructionDataSerializer,
|
|
@@ -9187,6 +9248,61 @@ function execute(context, input) {
|
|
|
9187
9248
|
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }
|
|
9188
9249
|
]);
|
|
9189
9250
|
}
|
|
9251
|
+
function getExtendExecutorConfigInstructionDataSerializer() {
|
|
9252
|
+
return mapSerializer(
|
|
9253
|
+
struct(
|
|
9254
|
+
[["discriminator", bytes({ size: 8 })]],
|
|
9255
|
+
{ description: "ExtendExecutorConfigInstructionData" }
|
|
9256
|
+
),
|
|
9257
|
+
(value) => ({
|
|
9258
|
+
...value,
|
|
9259
|
+
discriminator: new Uint8Array([238, 223, 196, 220, 61, 71, 72, 85])
|
|
9260
|
+
})
|
|
9261
|
+
);
|
|
9262
|
+
}
|
|
9263
|
+
function extendExecutorConfig(context, input) {
|
|
9264
|
+
const programId = context.programs.getPublicKey(
|
|
9265
|
+
"executor",
|
|
9266
|
+
"6doghB248px58JSSwG4qejQ46kFMW4AMj7vzJnWZHNZn"
|
|
9267
|
+
);
|
|
9268
|
+
const resolvedAccounts = {
|
|
9269
|
+
admin: {
|
|
9270
|
+
index: 0,
|
|
9271
|
+
isWritable: true,
|
|
9272
|
+
value: input.admin ?? null
|
|
9273
|
+
},
|
|
9274
|
+
config: {
|
|
9275
|
+
index: 1,
|
|
9276
|
+
isWritable: true,
|
|
9277
|
+
value: input.config ?? null
|
|
9278
|
+
},
|
|
9279
|
+
systemProgram: {
|
|
9280
|
+
index: 2,
|
|
9281
|
+
isWritable: false,
|
|
9282
|
+
value: input.systemProgram ?? null
|
|
9283
|
+
}
|
|
9284
|
+
};
|
|
9285
|
+
if (!resolvedAccounts.systemProgram.value) {
|
|
9286
|
+
resolvedAccounts.systemProgram.value = context.programs.getPublicKey(
|
|
9287
|
+
"splSystem",
|
|
9288
|
+
"11111111111111111111111111111111"
|
|
9289
|
+
);
|
|
9290
|
+
resolvedAccounts.systemProgram.isWritable = false;
|
|
9291
|
+
}
|
|
9292
|
+
const orderedAccounts = Object.values(
|
|
9293
|
+
resolvedAccounts
|
|
9294
|
+
).sort((a, b) => a.index - b.index);
|
|
9295
|
+
const [keys, signers] = getAccountMetasAndSigners4(
|
|
9296
|
+
orderedAccounts,
|
|
9297
|
+
"programId",
|
|
9298
|
+
programId
|
|
9299
|
+
);
|
|
9300
|
+
const data = getExtendExecutorConfigInstructionDataSerializer().serialize({});
|
|
9301
|
+
const bytesCreatedOnChain = 0;
|
|
9302
|
+
return transactionBuilder([
|
|
9303
|
+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }
|
|
9304
|
+
]);
|
|
9305
|
+
}
|
|
9190
9306
|
function getInitExecutorInstructionDataSerializer() {
|
|
9191
9307
|
return mapSerializer(
|
|
9192
9308
|
struct(
|
|
@@ -9787,7 +9903,7 @@ async function extractWorkerFeePaidEventByTxHash(connection, program, signature,
|
|
|
9787
9903
|
if (!events) return null;
|
|
9788
9904
|
return events;
|
|
9789
9905
|
}
|
|
9790
|
-
async function extractEventFromTransactionSignature(
|
|
9906
|
+
async function extractEventFromTransactionSignature(rpc, _program, signature, serializer, commitment, unsafeParseErr = false) {
|
|
9791
9907
|
let program;
|
|
9792
9908
|
if (typeof _program === "string" && isPublicKey(_program)) {
|
|
9793
9909
|
program = toWeb3JsPublicKey(_program);
|
|
@@ -9796,13 +9912,8 @@ async function extractEventFromTransactionSignature(connection, _program, signat
|
|
|
9796
9912
|
}
|
|
9797
9913
|
let tx;
|
|
9798
9914
|
if (typeof signature === "string") {
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
} else if ("connection" in connection && connection.connection instanceof web3.Connection) {
|
|
9802
|
-
tx = await connection.connection.getParsedTransaction(signature, commitment);
|
|
9803
|
-
} else {
|
|
9804
|
-
throw new Error("Invalid connection");
|
|
9805
|
-
}
|
|
9915
|
+
const connection = toWeb3Connection(rpc);
|
|
9916
|
+
tx = await connection.getParsedTransaction(signature, commitment);
|
|
9806
9917
|
} else {
|
|
9807
9918
|
tx = signature;
|
|
9808
9919
|
}
|
|
@@ -9953,12 +10064,8 @@ async function simulateWeb3JsTransaction(_connection, _instructions, _programId,
|
|
|
9953
10064
|
let connection;
|
|
9954
10065
|
if (typeof _connection === "string") {
|
|
9955
10066
|
connection = new web3.Connection(_connection, commitment);
|
|
9956
|
-
} else if (_connection instanceof web3.Connection) {
|
|
9957
|
-
connection = _connection;
|
|
9958
|
-
} else if ("connection" in _connection && _connection.connection instanceof web3.Connection) {
|
|
9959
|
-
({ connection } = _connection);
|
|
9960
10067
|
} else {
|
|
9961
|
-
|
|
10068
|
+
connection = toWeb3Connection(_connection);
|
|
9962
10069
|
}
|
|
9963
10070
|
let instructions;
|
|
9964
10071
|
if (_instructions.length === 0) {
|
|
@@ -10009,6 +10116,15 @@ async function simulateWeb3JsTransaction(_connection, _instructions, _programId,
|
|
|
10009
10116
|
return serializer.deserialize(resp, 0)[0];
|
|
10010
10117
|
}
|
|
10011
10118
|
}
|
|
10119
|
+
function toWeb3Connection(rpc) {
|
|
10120
|
+
if (rpc instanceof web3.Connection) {
|
|
10121
|
+
return rpc;
|
|
10122
|
+
} else if ("connection" in rpc && rpc.connection instanceof web3.Connection) {
|
|
10123
|
+
return rpc.connection;
|
|
10124
|
+
} else {
|
|
10125
|
+
throw new Error("Invalid connection");
|
|
10126
|
+
}
|
|
10127
|
+
}
|
|
10012
10128
|
|
|
10013
10129
|
// src/receive.ts
|
|
10014
10130
|
async function lzReceive(rpc, payer, packet, callerParams = Uint8Array.from([0, 0]), commitment = "confirmed") {
|
|
@@ -13313,6 +13429,8 @@ function getPricefeedErrorFromName(name, program, cause) {
|
|
|
13313
13429
|
// src/generated/kinobi/pricefeed/instructions/index.ts
|
|
13314
13430
|
var instructions_exports6 = {};
|
|
13315
13431
|
__export(instructions_exports6, {
|
|
13432
|
+
extendPriceFeed: () => extendPriceFeed,
|
|
13433
|
+
getExtendPriceFeedInstructionDataSerializer: () => getExtendPriceFeedInstructionDataSerializer,
|
|
13316
13434
|
getFee: () => getFee,
|
|
13317
13435
|
getGetFeeInstructionDataSerializer: () => getGetFeeInstructionDataSerializer,
|
|
13318
13436
|
getInitPriceFeedInstructionDataSerializer: () => getInitPriceFeedInstructionDataSerializer,
|
|
@@ -13346,7 +13464,62 @@ function getAccountMetasAndSigners6(accounts, optionalAccountStrategy, programId
|
|
|
13346
13464
|
return [keys, signers];
|
|
13347
13465
|
}
|
|
13348
13466
|
|
|
13349
|
-
// src/generated/kinobi/pricefeed/instructions/
|
|
13467
|
+
// src/generated/kinobi/pricefeed/instructions/extendPriceFeed.ts
|
|
13468
|
+
function getExtendPriceFeedInstructionDataSerializer() {
|
|
13469
|
+
return mapSerializer(
|
|
13470
|
+
struct(
|
|
13471
|
+
[["discriminator", bytes({ size: 8 })]],
|
|
13472
|
+
{ description: "ExtendPriceFeedInstructionData" }
|
|
13473
|
+
),
|
|
13474
|
+
(value) => ({
|
|
13475
|
+
...value,
|
|
13476
|
+
discriminator: new Uint8Array([16, 95, 1, 5, 220, 54, 15, 80])
|
|
13477
|
+
})
|
|
13478
|
+
);
|
|
13479
|
+
}
|
|
13480
|
+
function extendPriceFeed(context, input) {
|
|
13481
|
+
const programId = context.programs.getPublicKey(
|
|
13482
|
+
"pricefeed",
|
|
13483
|
+
"8ahPGPjEbpgGaZx2NV1iG5Shj7TDwvsjkEDcGWjt94TP"
|
|
13484
|
+
);
|
|
13485
|
+
const resolvedAccounts = {
|
|
13486
|
+
admin: {
|
|
13487
|
+
index: 0,
|
|
13488
|
+
isWritable: true,
|
|
13489
|
+
value: input.admin ?? null
|
|
13490
|
+
},
|
|
13491
|
+
priceFeed: {
|
|
13492
|
+
index: 1,
|
|
13493
|
+
isWritable: true,
|
|
13494
|
+
value: input.priceFeed ?? null
|
|
13495
|
+
},
|
|
13496
|
+
systemProgram: {
|
|
13497
|
+
index: 2,
|
|
13498
|
+
isWritable: false,
|
|
13499
|
+
value: input.systemProgram ?? null
|
|
13500
|
+
}
|
|
13501
|
+
};
|
|
13502
|
+
if (!resolvedAccounts.systemProgram.value) {
|
|
13503
|
+
resolvedAccounts.systemProgram.value = context.programs.getPublicKey(
|
|
13504
|
+
"splSystem",
|
|
13505
|
+
"11111111111111111111111111111111"
|
|
13506
|
+
);
|
|
13507
|
+
resolvedAccounts.systemProgram.isWritable = false;
|
|
13508
|
+
}
|
|
13509
|
+
const orderedAccounts = Object.values(
|
|
13510
|
+
resolvedAccounts
|
|
13511
|
+
).sort((a, b) => a.index - b.index);
|
|
13512
|
+
const [keys, signers] = getAccountMetasAndSigners6(
|
|
13513
|
+
orderedAccounts,
|
|
13514
|
+
"programId",
|
|
13515
|
+
programId
|
|
13516
|
+
);
|
|
13517
|
+
const data = getExtendPriceFeedInstructionDataSerializer().serialize({});
|
|
13518
|
+
const bytesCreatedOnChain = 0;
|
|
13519
|
+
return transactionBuilder([
|
|
13520
|
+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain }
|
|
13521
|
+
]);
|
|
13522
|
+
}
|
|
13350
13523
|
function getGetFeeInstructionDataSerializer() {
|
|
13351
13524
|
return mapSerializer(
|
|
13352
13525
|
struct(
|
|
@@ -14396,6 +14569,6 @@ var SetConfigType2 = /* @__PURE__ */ ((SetConfigType3) => {
|
|
|
14396
14569
|
return SetConfigType3;
|
|
14397
14570
|
})(SetConfigType2 || {});
|
|
14398
14571
|
|
|
14399
|
-
export { blocked_messagelib_exports as BlockedMessageLibProgram, dvn_exports2 as DVNProgram, DvnPDA, dvn_exports as DvnProgram, EDDSA, ENFORCED_OPTIONS_SEED, EndpointPDA, endpoint_exports as EndpointProgram, EventPDA, ExecutorOptionType, ExecutorPDA, executor_exports as ExecutorProgram, FAUCET_URL, MINT_SEED, MSG_TYPE_OFFSET, MaxExecutorOptionTypeLength, MessageLibPDA, MessageType, OmniAppPDA, PEER_SEED, PriceFeedPDA, pricefeed_exports as PriceFeedProgram, SendHelper, SetConfigType2 as SetConfigType, simple_message_lib_exports as SimpleMessageLibProgram, UlnPDA, uln_exports as UlnProgram, buildMessageV0, buildVersionedTransaction, closeLookupTable, createNonceAccountTX, deactivateLookupTable, extractComposeDeliveredEventByTxHash, extractComposeSentEventByTxHash, extractEventFromTransactionSignature, extractPacketSentEventByTxHash, extractReceivedPacketEventByTxHash, extractVerifiedPacketEventByTxHash, extractWorkerFeePaidEventByTxHash, generateAddressLookupTable, getBlockedMessageLibProgramId, getDVNProgramId, getEndpointProgramId, getExecutorProgramId, getLzComposeAccountMeta, getLzComposeParamsSerializer2 as getLzComposeParamsSerializer, getLzReceiveAccountSerializer, getLzReceiveAccounts, getLzReceiveParamsSerializer2 as getLzReceiveParamsSerializer, getPricefeedProgramId, getProgramKeypair, getSimpleMessageLibProgramId, getULNProgramId, idlTypes, instructionDiscriminator, isAccountInitialized, lzCompose, lzReceive, messageLibs, simulateWeb3JsTransaction, txWithAddressLookupTable, txWithNonce };
|
|
14572
|
+
export { blocked_messagelib_exports as BlockedMessageLibProgram, dvn_exports2 as DVNProgram, DvnPDA, dvn_exports as DvnProgram, EDDSA, ENFORCED_OPTIONS_SEED, EndpointPDA, endpoint_exports as EndpointProgram, EventPDA, ExecutorOptionType, ExecutorPDA, executor_exports as ExecutorProgram, FAUCET_URL, MINT_SEED, MSG_TYPE_OFFSET, MaxExecutorOptionTypeLength, MessageLibPDA, MessageType, OmniAppPDA, PEER_SEED, PriceFeedPDA, pricefeed_exports as PriceFeedProgram, SendHelper, SetConfigType2 as SetConfigType, simple_message_lib_exports as SimpleMessageLibProgram, UlnPDA, uln_exports as UlnProgram, buildMessageV0, buildVersionedTransaction, closeLookupTable, createNonceAccountTX, deactivateLookupTable, extractComposeDeliveredEventByTxHash, extractComposeSentEventByTxHash, extractEventFromTransactionSignature, extractPacketSentEventByTxHash, extractReceivedPacketEventByTxHash, extractVerifiedPacketEventByTxHash, extractWorkerFeePaidEventByTxHash, generateAddressLookupTable, getBlockedMessageLibProgramId, getDVNProgramId, getEndpointProgramId, getExecutorProgramId, getLzComposeAccountMeta, getLzComposeParamsSerializer2 as getLzComposeParamsSerializer, getLzReceiveAccountSerializer, getLzReceiveAccounts, getLzReceiveParamsSerializer2 as getLzReceiveParamsSerializer, getPricefeedProgramId, getProgramKeypair, getSimpleMessageLibProgramId, getULNProgramId, idlTypes, instructionDiscriminator, isAccountInitialized, lzCompose, lzReceive, messageLibs, simulateWeb3JsTransaction, toWeb3Connection, txWithAddressLookupTable, txWithNonce };
|
|
14400
14573
|
//# sourceMappingURL=umi.mjs.map
|
|
14401
14574
|
//# sourceMappingURL=umi.mjs.map
|