@layerzerolabs/lz-solana-sdk-v2 3.0.123 → 3.0.124-placeholder.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/index-CvZUDmni.d.mts +9272 -0
- package/dist/index-CvZUDmni.d.ts +9272 -0
- package/dist/index.cjs +15760 -356
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +3 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.mjs +15651 -247
- package/dist/index.mjs.map +1 -1
- package/dist/umi.cjs +174 -43
- package/dist/umi.cjs.map +1 -1
- package/dist/umi.d.mts +7 -9068
- package/dist/umi.d.ts +7 -9068
- package/dist/umi.mjs +174 -43
- package/dist/umi.mjs.map +1 -1
- package/package.json +9 -9
- package/src/generated/kinobi/executor/instructions/execute.ts +159 -0
- package/src/generated/kinobi/executor/instructions/index.ts +2 -0
- package/src/generated/kinobi/executor/instructions/version.ts +80 -0
- package/src/generated/kinobi/executor/types/index.ts +3 -1
- package/src/generated/kinobi/executor/types/lzReceiveParams.ts +50 -0
- package/src/generated/kinobi/executor/types/version.ts +28 -0
- package/src/solita/index.ts +1 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@layerzerolabs/lz-solana-sdk-v2",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.124-placeholder.0",
|
|
4
4
|
"license": "BUSL-1.1",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -39,12 +39,12 @@
|
|
|
39
39
|
"test-uln": "TEST_SCOPES=uln anchor test --skip-build"
|
|
40
40
|
},
|
|
41
41
|
"dependencies": {
|
|
42
|
-
"@layerzerolabs/lz-corekit-solana": "^3.0.
|
|
43
|
-
"@layerzerolabs/lz-definitions": "^3.0.
|
|
44
|
-
"@layerzerolabs/lz-foundation": "^3.0.
|
|
45
|
-
"@layerzerolabs/lz-serdes": "^3.0.
|
|
46
|
-
"@layerzerolabs/lz-utilities": "^3.0.
|
|
47
|
-
"@layerzerolabs/lz-v2-utilities": "^3.0.
|
|
42
|
+
"@layerzerolabs/lz-corekit-solana": "^3.0.124-placeholder.0",
|
|
43
|
+
"@layerzerolabs/lz-definitions": "^3.0.124-placeholder.0",
|
|
44
|
+
"@layerzerolabs/lz-foundation": "^3.0.124-placeholder.0",
|
|
45
|
+
"@layerzerolabs/lz-serdes": "^3.0.124-placeholder.0",
|
|
46
|
+
"@layerzerolabs/lz-utilities": "^3.0.124-placeholder.0",
|
|
47
|
+
"@layerzerolabs/lz-v2-utilities": "^3.0.124-placeholder.0",
|
|
48
48
|
"@metaplex-foundation/beet": "^0.7.1",
|
|
49
49
|
"@metaplex-foundation/beet-solana": "^0.4.0",
|
|
50
50
|
"@metaplex-foundation/mpl-toolbox": "^0.9.2",
|
|
@@ -67,8 +67,8 @@
|
|
|
67
67
|
"@kinobi-so/renderers": "^0.21.3",
|
|
68
68
|
"@kinobi-so/renderers-js-umi": "^0.21.6",
|
|
69
69
|
"@layerzerolabs/layerzero-v2-solana": "^0.0.0",
|
|
70
|
-
"@layerzerolabs/tsup-config-next": "^3.0.
|
|
71
|
-
"@layerzerolabs/typescript-config-next": "^3.0.
|
|
70
|
+
"@layerzerolabs/tsup-config-next": "^3.0.124-placeholder.0",
|
|
71
|
+
"@layerzerolabs/typescript-config-next": "^3.0.124-placeholder.0",
|
|
72
72
|
"@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
|
|
73
73
|
"@types/bn.js": "^5.1.5",
|
|
74
74
|
"@types/chai": "^4.3.11",
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the kinobi library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun kinobi to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/kinobi-so/kinobi
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
Context,
|
|
11
|
+
Pda,
|
|
12
|
+
PublicKey,
|
|
13
|
+
Signer,
|
|
14
|
+
TransactionBuilder,
|
|
15
|
+
transactionBuilder,
|
|
16
|
+
} from '@metaplex-foundation/umi';
|
|
17
|
+
import {
|
|
18
|
+
Serializer,
|
|
19
|
+
bytes,
|
|
20
|
+
mapSerializer,
|
|
21
|
+
publicKey as publicKeySerializer,
|
|
22
|
+
struct,
|
|
23
|
+
u64,
|
|
24
|
+
} from '@metaplex-foundation/umi/serializers';
|
|
25
|
+
import {
|
|
26
|
+
ResolvedAccount,
|
|
27
|
+
ResolvedAccountsWithIndices,
|
|
28
|
+
getAccountMetasAndSigners,
|
|
29
|
+
} from '../shared';
|
|
30
|
+
import {
|
|
31
|
+
LzReceiveParams,
|
|
32
|
+
LzReceiveParamsArgs,
|
|
33
|
+
getLzReceiveParamsSerializer,
|
|
34
|
+
} from '../types';
|
|
35
|
+
|
|
36
|
+
// Accounts.
|
|
37
|
+
export type ExecuteInstructionAccounts = {
|
|
38
|
+
executor: Signer;
|
|
39
|
+
config: PublicKey | Pda;
|
|
40
|
+
endpointProgram: PublicKey | Pda;
|
|
41
|
+
/** The authority for the endpoint program to emit events */
|
|
42
|
+
endpointEventAuthority: PublicKey | Pda;
|
|
43
|
+
eventAuthority: PublicKey | Pda;
|
|
44
|
+
program: PublicKey | Pda;
|
|
45
|
+
};
|
|
46
|
+
|
|
47
|
+
// Data.
|
|
48
|
+
export type ExecuteInstructionData = {
|
|
49
|
+
discriminator: Uint8Array;
|
|
50
|
+
receiver: PublicKey;
|
|
51
|
+
lzReceive: LzReceiveParams;
|
|
52
|
+
value: bigint;
|
|
53
|
+
computeUnits: bigint;
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export type ExecuteInstructionDataArgs = {
|
|
57
|
+
receiver: PublicKey;
|
|
58
|
+
lzReceive: LzReceiveParamsArgs;
|
|
59
|
+
value: number | bigint;
|
|
60
|
+
computeUnits: number | bigint;
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
export function getExecuteInstructionDataSerializer(): Serializer<
|
|
64
|
+
ExecuteInstructionDataArgs,
|
|
65
|
+
ExecuteInstructionData
|
|
66
|
+
> {
|
|
67
|
+
return mapSerializer<ExecuteInstructionDataArgs, any, ExecuteInstructionData>(
|
|
68
|
+
struct<ExecuteInstructionData>(
|
|
69
|
+
[
|
|
70
|
+
['discriminator', bytes({ size: 8 })],
|
|
71
|
+
['receiver', publicKeySerializer()],
|
|
72
|
+
['lzReceive', getLzReceiveParamsSerializer()],
|
|
73
|
+
['value', u64()],
|
|
74
|
+
['computeUnits', u64()],
|
|
75
|
+
],
|
|
76
|
+
{ description: 'ExecuteInstructionData' }
|
|
77
|
+
),
|
|
78
|
+
(value) => ({
|
|
79
|
+
...value,
|
|
80
|
+
discriminator: new Uint8Array([130, 221, 242, 154, 13, 193, 189, 29]),
|
|
81
|
+
})
|
|
82
|
+
) as Serializer<ExecuteInstructionDataArgs, ExecuteInstructionData>;
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Args.
|
|
86
|
+
export type ExecuteInstructionArgs = ExecuteInstructionDataArgs;
|
|
87
|
+
|
|
88
|
+
// Instruction.
|
|
89
|
+
export function execute(
|
|
90
|
+
context: Pick<Context, 'programs'>,
|
|
91
|
+
input: ExecuteInstructionAccounts & ExecuteInstructionArgs
|
|
92
|
+
): TransactionBuilder {
|
|
93
|
+
// Program ID.
|
|
94
|
+
const programId = context.programs.getPublicKey(
|
|
95
|
+
'executor',
|
|
96
|
+
'6doghB248px58JSSwG4qejQ46kFMW4AMj7vzJnWZHNZn'
|
|
97
|
+
);
|
|
98
|
+
|
|
99
|
+
// Accounts.
|
|
100
|
+
const resolvedAccounts = {
|
|
101
|
+
executor: {
|
|
102
|
+
index: 0,
|
|
103
|
+
isWritable: true as boolean,
|
|
104
|
+
value: input.executor ?? null,
|
|
105
|
+
},
|
|
106
|
+
config: {
|
|
107
|
+
index: 1,
|
|
108
|
+
isWritable: false as boolean,
|
|
109
|
+
value: input.config ?? null,
|
|
110
|
+
},
|
|
111
|
+
endpointProgram: {
|
|
112
|
+
index: 2,
|
|
113
|
+
isWritable: false as boolean,
|
|
114
|
+
value: input.endpointProgram ?? null,
|
|
115
|
+
},
|
|
116
|
+
endpointEventAuthority: {
|
|
117
|
+
index: 3,
|
|
118
|
+
isWritable: false as boolean,
|
|
119
|
+
value: input.endpointEventAuthority ?? null,
|
|
120
|
+
},
|
|
121
|
+
eventAuthority: {
|
|
122
|
+
index: 4,
|
|
123
|
+
isWritable: false as boolean,
|
|
124
|
+
value: input.eventAuthority ?? null,
|
|
125
|
+
},
|
|
126
|
+
program: {
|
|
127
|
+
index: 5,
|
|
128
|
+
isWritable: false as boolean,
|
|
129
|
+
value: input.program ?? null,
|
|
130
|
+
},
|
|
131
|
+
} satisfies ResolvedAccountsWithIndices;
|
|
132
|
+
|
|
133
|
+
// Arguments.
|
|
134
|
+
const resolvedArgs: ExecuteInstructionArgs = { ...input };
|
|
135
|
+
|
|
136
|
+
// Accounts in order.
|
|
137
|
+
const orderedAccounts: ResolvedAccount[] = Object.values(
|
|
138
|
+
resolvedAccounts
|
|
139
|
+
).sort((a, b) => a.index - b.index);
|
|
140
|
+
|
|
141
|
+
// Keys and Signers.
|
|
142
|
+
const [keys, signers] = getAccountMetasAndSigners(
|
|
143
|
+
orderedAccounts,
|
|
144
|
+
'programId',
|
|
145
|
+
programId
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
// Data.
|
|
149
|
+
const data = getExecuteInstructionDataSerializer().serialize(
|
|
150
|
+
resolvedArgs as ExecuteInstructionDataArgs
|
|
151
|
+
);
|
|
152
|
+
|
|
153
|
+
// Bytes Created On Chain.
|
|
154
|
+
const bytesCreatedOnChain = 0;
|
|
155
|
+
|
|
156
|
+
return transactionBuilder([
|
|
157
|
+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain },
|
|
158
|
+
]);
|
|
159
|
+
}
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export * from './adminSetConfig';
|
|
10
10
|
export * from './compose';
|
|
11
11
|
export * from './executable';
|
|
12
|
+
export * from './execute';
|
|
12
13
|
export * from './extendExecutorConfig';
|
|
13
14
|
export * from './initExecutor';
|
|
14
15
|
export * from './nativeDrop';
|
|
@@ -16,3 +17,4 @@ export * from './ownerSetConfig';
|
|
|
16
17
|
export * from './postExecute';
|
|
17
18
|
export * from './preExecute';
|
|
18
19
|
export * from './quoteExecutor';
|
|
20
|
+
export * from './version';
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the kinobi library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun kinobi to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/kinobi-so/kinobi
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
Context,
|
|
11
|
+
TransactionBuilder,
|
|
12
|
+
transactionBuilder,
|
|
13
|
+
} from '@metaplex-foundation/umi';
|
|
14
|
+
import {
|
|
15
|
+
Serializer,
|
|
16
|
+
bytes,
|
|
17
|
+
mapSerializer,
|
|
18
|
+
struct,
|
|
19
|
+
} from '@metaplex-foundation/umi/serializers';
|
|
20
|
+
import {
|
|
21
|
+
ResolvedAccount,
|
|
22
|
+
ResolvedAccountsWithIndices,
|
|
23
|
+
getAccountMetasAndSigners,
|
|
24
|
+
} from '../shared';
|
|
25
|
+
|
|
26
|
+
// Data.
|
|
27
|
+
export type VersionInstructionData = { discriminator: Uint8Array };
|
|
28
|
+
|
|
29
|
+
export type VersionInstructionDataArgs = {};
|
|
30
|
+
|
|
31
|
+
export function getVersionInstructionDataSerializer(): Serializer<
|
|
32
|
+
VersionInstructionDataArgs,
|
|
33
|
+
VersionInstructionData
|
|
34
|
+
> {
|
|
35
|
+
return mapSerializer<VersionInstructionDataArgs, any, VersionInstructionData>(
|
|
36
|
+
struct<VersionInstructionData>([['discriminator', bytes({ size: 8 })]], {
|
|
37
|
+
description: 'VersionInstructionData',
|
|
38
|
+
}),
|
|
39
|
+
(value) => ({
|
|
40
|
+
...value,
|
|
41
|
+
discriminator: new Uint8Array([118, 65, 195, 198, 129, 216, 252, 192]),
|
|
42
|
+
})
|
|
43
|
+
) as Serializer<VersionInstructionDataArgs, VersionInstructionData>;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
// Instruction.
|
|
47
|
+
export function version(
|
|
48
|
+
context: Pick<Context, 'programs'>
|
|
49
|
+
): TransactionBuilder {
|
|
50
|
+
// Program ID.
|
|
51
|
+
const programId = context.programs.getPublicKey(
|
|
52
|
+
'executor',
|
|
53
|
+
'6doghB248px58JSSwG4qejQ46kFMW4AMj7vzJnWZHNZn'
|
|
54
|
+
);
|
|
55
|
+
|
|
56
|
+
// Accounts.
|
|
57
|
+
const resolvedAccounts = {} satisfies ResolvedAccountsWithIndices;
|
|
58
|
+
|
|
59
|
+
// Accounts in order.
|
|
60
|
+
const orderedAccounts: ResolvedAccount[] = Object.values(
|
|
61
|
+
resolvedAccounts as ResolvedAccountsWithIndices
|
|
62
|
+
);
|
|
63
|
+
|
|
64
|
+
// Keys and Signers.
|
|
65
|
+
const [keys, signers] = getAccountMetasAndSigners(
|
|
66
|
+
orderedAccounts,
|
|
67
|
+
'programId',
|
|
68
|
+
programId
|
|
69
|
+
);
|
|
70
|
+
|
|
71
|
+
// Data.
|
|
72
|
+
const data = getVersionInstructionDataSerializer().serialize({});
|
|
73
|
+
|
|
74
|
+
// Bytes Created On Chain.
|
|
75
|
+
const bytesCreatedOnChain = 0;
|
|
76
|
+
|
|
77
|
+
return transactionBuilder([
|
|
78
|
+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain },
|
|
79
|
+
]);
|
|
80
|
+
}
|
|
@@ -12,5 +12,7 @@ export * from './dstConfig';
|
|
|
12
12
|
export * from './executionState';
|
|
13
13
|
export * from './lzComposeParams';
|
|
14
14
|
export * from './lzOption';
|
|
15
|
+
export * from './lzReceiveParams';
|
|
15
16
|
export * from './nativeDropRequest';
|
|
16
|
-
export * from './ownerSetConfigParams';
|
|
17
|
+
export * from './ownerSetConfigParams';
|
|
18
|
+
export * from './version';
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the kinobi library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun kinobi to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/kinobi-so/kinobi
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
Serializer,
|
|
11
|
+
bytes,
|
|
12
|
+
struct,
|
|
13
|
+
u32,
|
|
14
|
+
u64,
|
|
15
|
+
} from '@metaplex-foundation/umi/serializers';
|
|
16
|
+
|
|
17
|
+
export type LzReceiveParams = {
|
|
18
|
+
srcEid: number;
|
|
19
|
+
sender: Uint8Array;
|
|
20
|
+
nonce: bigint;
|
|
21
|
+
guid: Uint8Array;
|
|
22
|
+
message: Uint8Array;
|
|
23
|
+
extraData: Uint8Array;
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export type LzReceiveParamsArgs = {
|
|
27
|
+
srcEid: number;
|
|
28
|
+
sender: Uint8Array;
|
|
29
|
+
nonce: number | bigint;
|
|
30
|
+
guid: Uint8Array;
|
|
31
|
+
message: Uint8Array;
|
|
32
|
+
extraData: Uint8Array;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export function getLzReceiveParamsSerializer(): Serializer<
|
|
36
|
+
LzReceiveParamsArgs,
|
|
37
|
+
LzReceiveParams
|
|
38
|
+
> {
|
|
39
|
+
return struct<LzReceiveParams>(
|
|
40
|
+
[
|
|
41
|
+
['srcEid', u32()],
|
|
42
|
+
['sender', bytes({ size: 32 })],
|
|
43
|
+
['nonce', u64()],
|
|
44
|
+
['guid', bytes({ size: 32 })],
|
|
45
|
+
['message', bytes({ size: u32() })],
|
|
46
|
+
['extraData', bytes({ size: u32() })],
|
|
47
|
+
],
|
|
48
|
+
{ description: 'LzReceiveParams' }
|
|
49
|
+
) as Serializer<LzReceiveParamsArgs, LzReceiveParams>;
|
|
50
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This code was AUTOGENERATED using the kinobi library.
|
|
3
|
+
* Please DO NOT EDIT THIS FILE, instead use visitors
|
|
4
|
+
* to add features, then rerun kinobi to update it.
|
|
5
|
+
*
|
|
6
|
+
* @see https://github.com/kinobi-so/kinobi
|
|
7
|
+
*/
|
|
8
|
+
|
|
9
|
+
import {
|
|
10
|
+
Serializer,
|
|
11
|
+
struct,
|
|
12
|
+
u64,
|
|
13
|
+
u8,
|
|
14
|
+
} from '@metaplex-foundation/umi/serializers';
|
|
15
|
+
|
|
16
|
+
export type Version = { major: bigint; minor: number };
|
|
17
|
+
|
|
18
|
+
export type VersionArgs = { major: number | bigint; minor: number };
|
|
19
|
+
|
|
20
|
+
export function getVersionSerializer(): Serializer<VersionArgs, Version> {
|
|
21
|
+
return struct<Version>(
|
|
22
|
+
[
|
|
23
|
+
['major', u64()],
|
|
24
|
+
['minor', u8()],
|
|
25
|
+
],
|
|
26
|
+
{ description: 'Version' }
|
|
27
|
+
) as Serializer<VersionArgs, Version>;
|
|
28
|
+
}
|
package/src/solita/index.ts
CHANGED
|
@@ -16,6 +16,7 @@ export * from './deployment'
|
|
|
16
16
|
export * as BlockedMessageLibProgram from '../generated/solita/blocked_messagelib'
|
|
17
17
|
export * as DvnProgram from '../generated/solita/dvn'
|
|
18
18
|
export * from './send-helper'
|
|
19
|
+
export * as UMI from '..'
|
|
19
20
|
|
|
20
21
|
import { AccountMeta, Commitment, Connection, PublicKey } from '@solana/web3.js'
|
|
21
22
|
|