@layerzerolabs/lz-solana-sdk-v2 3.0.66 → 3.0.67
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 +174 -1
- package/dist/umi.cjs.map +1 -1
- package/dist/umi.d.mts +85 -5
- package/dist/umi.d.ts +85 -5
- package/dist/umi.mjs +174 -1
- 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/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.67",
|
|
4
4
|
"license": "BUSL-1.1",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": {
|
|
@@ -35,15 +35,16 @@
|
|
|
35
35
|
"sync-target-idl": "mkdir -p target/idl && rsync -avc --delete ../solana/target/idl/ target/idl/",
|
|
36
36
|
"test": "anchor test --skip-build",
|
|
37
37
|
"test-endpoint": "TEST_SCOPES=endpoint anchor test --skip-build",
|
|
38
|
+
"test-extend": "yarn run ts-mocha -b -p ./tsconfig.json -t 10000000 tests/extend_account.test.ts",
|
|
38
39
|
"test-uln": "TEST_SCOPES=uln anchor test --skip-build"
|
|
39
40
|
},
|
|
40
41
|
"dependencies": {
|
|
41
|
-
"@layerzerolabs/lz-corekit-solana": "^3.0.
|
|
42
|
-
"@layerzerolabs/lz-definitions": "^3.0.
|
|
43
|
-
"@layerzerolabs/lz-foundation": "^3.0.
|
|
44
|
-
"@layerzerolabs/lz-serdes": "^3.0.
|
|
45
|
-
"@layerzerolabs/lz-utilities": "^3.0.
|
|
46
|
-
"@layerzerolabs/lz-v2-utilities": "^3.0.
|
|
42
|
+
"@layerzerolabs/lz-corekit-solana": "^3.0.67",
|
|
43
|
+
"@layerzerolabs/lz-definitions": "^3.0.67",
|
|
44
|
+
"@layerzerolabs/lz-foundation": "^3.0.67",
|
|
45
|
+
"@layerzerolabs/lz-serdes": "^3.0.67",
|
|
46
|
+
"@layerzerolabs/lz-utilities": "^3.0.67",
|
|
47
|
+
"@layerzerolabs/lz-v2-utilities": "^3.0.67",
|
|
47
48
|
"@metaplex-foundation/beet": "^0.7.1",
|
|
48
49
|
"@metaplex-foundation/beet-solana": "^0.4.0",
|
|
49
50
|
"@metaplex-foundation/umi": "^0.9.2",
|
|
@@ -65,14 +66,15 @@
|
|
|
65
66
|
"@kinobi-so/renderers": "^0.21.3",
|
|
66
67
|
"@kinobi-so/renderers-js-umi": "^0.21.6",
|
|
67
68
|
"@layerzerolabs/layerzero-v2-solana": "^0.0.0",
|
|
68
|
-
"@layerzerolabs/tsup-config-next": "^3.0.
|
|
69
|
-
"@layerzerolabs/typescript-config-next": "^3.0.
|
|
69
|
+
"@layerzerolabs/tsup-config-next": "^3.0.67",
|
|
70
|
+
"@layerzerolabs/typescript-config-next": "^3.0.67",
|
|
70
71
|
"@metaplex-foundation/umi-bundle-defaults": "^0.9.2",
|
|
71
72
|
"@types/bn.js": "^5.1.5",
|
|
72
73
|
"@types/chai": "^4.3.11",
|
|
73
74
|
"@types/chai-as-promised": "^7.1.0",
|
|
74
75
|
"@types/mocha": "^10.0.6",
|
|
75
76
|
"@types/node": "^20.10.5",
|
|
77
|
+
"axios": "^1.6.2",
|
|
76
78
|
"chai": "^4.3.10",
|
|
77
79
|
"chai-as-promised": "^7.1.1",
|
|
78
80
|
"kinobi": "^0.21.4",
|
|
@@ -81,7 +83,8 @@
|
|
|
81
83
|
"ts-mocha": "^10.0.0",
|
|
82
84
|
"ts-node": "^10.9.1",
|
|
83
85
|
"tsup": "^8.3.5",
|
|
84
|
-
"typescript": "~5.2.2"
|
|
86
|
+
"typescript": "~5.2.2",
|
|
87
|
+
"zx": "^8.1.3"
|
|
85
88
|
},
|
|
86
89
|
"publishConfig": {
|
|
87
90
|
"access": "public"
|
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
struct,
|
|
22
|
+
} from '@metaplex-foundation/umi/serializers';
|
|
23
|
+
import {
|
|
24
|
+
ResolvedAccount,
|
|
25
|
+
ResolvedAccountsWithIndices,
|
|
26
|
+
getAccountMetasAndSigners,
|
|
27
|
+
} from '../shared';
|
|
28
|
+
|
|
29
|
+
// Accounts.
|
|
30
|
+
export type ExtendDvnConfigInstructionAccounts = {
|
|
31
|
+
admin: Signer;
|
|
32
|
+
config: PublicKey | Pda;
|
|
33
|
+
systemProgram?: PublicKey | Pda;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Data.
|
|
37
|
+
export type ExtendDvnConfigInstructionData = { discriminator: Uint8Array };
|
|
38
|
+
|
|
39
|
+
export type ExtendDvnConfigInstructionDataArgs = {};
|
|
40
|
+
|
|
41
|
+
export function getExtendDvnConfigInstructionDataSerializer(): Serializer<
|
|
42
|
+
ExtendDvnConfigInstructionDataArgs,
|
|
43
|
+
ExtendDvnConfigInstructionData
|
|
44
|
+
> {
|
|
45
|
+
return mapSerializer<
|
|
46
|
+
ExtendDvnConfigInstructionDataArgs,
|
|
47
|
+
any,
|
|
48
|
+
ExtendDvnConfigInstructionData
|
|
49
|
+
>(
|
|
50
|
+
struct<ExtendDvnConfigInstructionData>(
|
|
51
|
+
[['discriminator', bytes({ size: 8 })]],
|
|
52
|
+
{ description: 'ExtendDvnConfigInstructionData' }
|
|
53
|
+
),
|
|
54
|
+
(value) => ({
|
|
55
|
+
...value,
|
|
56
|
+
discriminator: new Uint8Array([183, 248, 24, 49, 110, 229, 169, 66]),
|
|
57
|
+
})
|
|
58
|
+
) as Serializer<
|
|
59
|
+
ExtendDvnConfigInstructionDataArgs,
|
|
60
|
+
ExtendDvnConfigInstructionData
|
|
61
|
+
>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Instruction.
|
|
65
|
+
export function extendDvnConfig(
|
|
66
|
+
context: Pick<Context, 'programs'>,
|
|
67
|
+
input: ExtendDvnConfigInstructionAccounts
|
|
68
|
+
): TransactionBuilder {
|
|
69
|
+
// Program ID.
|
|
70
|
+
const programId = context.programs.getPublicKey(
|
|
71
|
+
'dvn',
|
|
72
|
+
'HtEYV4xB4wvsj5fgTkcfuChYpvGYzgzwvNhgDZQNh7wW'
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// Accounts.
|
|
76
|
+
const resolvedAccounts = {
|
|
77
|
+
admin: {
|
|
78
|
+
index: 0,
|
|
79
|
+
isWritable: true as boolean,
|
|
80
|
+
value: input.admin ?? null,
|
|
81
|
+
},
|
|
82
|
+
config: {
|
|
83
|
+
index: 1,
|
|
84
|
+
isWritable: true as boolean,
|
|
85
|
+
value: input.config ?? null,
|
|
86
|
+
},
|
|
87
|
+
systemProgram: {
|
|
88
|
+
index: 2,
|
|
89
|
+
isWritable: false as boolean,
|
|
90
|
+
value: input.systemProgram ?? null,
|
|
91
|
+
},
|
|
92
|
+
} satisfies ResolvedAccountsWithIndices;
|
|
93
|
+
|
|
94
|
+
// Default values.
|
|
95
|
+
if (!resolvedAccounts.systemProgram.value) {
|
|
96
|
+
resolvedAccounts.systemProgram.value = context.programs.getPublicKey(
|
|
97
|
+
'splSystem',
|
|
98
|
+
'11111111111111111111111111111111'
|
|
99
|
+
);
|
|
100
|
+
resolvedAccounts.systemProgram.isWritable = false;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Accounts in order.
|
|
104
|
+
const orderedAccounts: ResolvedAccount[] = Object.values(
|
|
105
|
+
resolvedAccounts
|
|
106
|
+
).sort((a, b) => a.index - b.index);
|
|
107
|
+
|
|
108
|
+
// Keys and Signers.
|
|
109
|
+
const [keys, signers] = getAccountMetasAndSigners(
|
|
110
|
+
orderedAccounts,
|
|
111
|
+
'programId',
|
|
112
|
+
programId
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
// Data.
|
|
116
|
+
const data = getExtendDvnConfigInstructionDataSerializer().serialize({});
|
|
117
|
+
|
|
118
|
+
// Bytes Created On Chain.
|
|
119
|
+
const bytesCreatedOnChain = 0;
|
|
120
|
+
|
|
121
|
+
return transactionBuilder([
|
|
122
|
+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain },
|
|
123
|
+
]);
|
|
124
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
struct,
|
|
22
|
+
} from '@metaplex-foundation/umi/serializers';
|
|
23
|
+
import {
|
|
24
|
+
ResolvedAccount,
|
|
25
|
+
ResolvedAccountsWithIndices,
|
|
26
|
+
getAccountMetasAndSigners,
|
|
27
|
+
} from '../shared';
|
|
28
|
+
|
|
29
|
+
// Accounts.
|
|
30
|
+
export type ExtendExecutorConfigInstructionAccounts = {
|
|
31
|
+
admin: Signer;
|
|
32
|
+
config: PublicKey | Pda;
|
|
33
|
+
systemProgram?: PublicKey | Pda;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Data.
|
|
37
|
+
export type ExtendExecutorConfigInstructionData = { discriminator: Uint8Array };
|
|
38
|
+
|
|
39
|
+
export type ExtendExecutorConfigInstructionDataArgs = {};
|
|
40
|
+
|
|
41
|
+
export function getExtendExecutorConfigInstructionDataSerializer(): Serializer<
|
|
42
|
+
ExtendExecutorConfigInstructionDataArgs,
|
|
43
|
+
ExtendExecutorConfigInstructionData
|
|
44
|
+
> {
|
|
45
|
+
return mapSerializer<
|
|
46
|
+
ExtendExecutorConfigInstructionDataArgs,
|
|
47
|
+
any,
|
|
48
|
+
ExtendExecutorConfigInstructionData
|
|
49
|
+
>(
|
|
50
|
+
struct<ExtendExecutorConfigInstructionData>(
|
|
51
|
+
[['discriminator', bytes({ size: 8 })]],
|
|
52
|
+
{ description: 'ExtendExecutorConfigInstructionData' }
|
|
53
|
+
),
|
|
54
|
+
(value) => ({
|
|
55
|
+
...value,
|
|
56
|
+
discriminator: new Uint8Array([238, 223, 196, 220, 61, 71, 72, 85]),
|
|
57
|
+
})
|
|
58
|
+
) as Serializer<
|
|
59
|
+
ExtendExecutorConfigInstructionDataArgs,
|
|
60
|
+
ExtendExecutorConfigInstructionData
|
|
61
|
+
>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Instruction.
|
|
65
|
+
export function extendExecutorConfig(
|
|
66
|
+
context: Pick<Context, 'programs'>,
|
|
67
|
+
input: ExtendExecutorConfigInstructionAccounts
|
|
68
|
+
): TransactionBuilder {
|
|
69
|
+
// Program ID.
|
|
70
|
+
const programId = context.programs.getPublicKey(
|
|
71
|
+
'executor',
|
|
72
|
+
'6doghB248px58JSSwG4qejQ46kFMW4AMj7vzJnWZHNZn'
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// Accounts.
|
|
76
|
+
const resolvedAccounts = {
|
|
77
|
+
admin: {
|
|
78
|
+
index: 0,
|
|
79
|
+
isWritable: true as boolean,
|
|
80
|
+
value: input.admin ?? null,
|
|
81
|
+
},
|
|
82
|
+
config: {
|
|
83
|
+
index: 1,
|
|
84
|
+
isWritable: true as boolean,
|
|
85
|
+
value: input.config ?? null,
|
|
86
|
+
},
|
|
87
|
+
systemProgram: {
|
|
88
|
+
index: 2,
|
|
89
|
+
isWritable: false as boolean,
|
|
90
|
+
value: input.systemProgram ?? null,
|
|
91
|
+
},
|
|
92
|
+
} satisfies ResolvedAccountsWithIndices;
|
|
93
|
+
|
|
94
|
+
// Default values.
|
|
95
|
+
if (!resolvedAccounts.systemProgram.value) {
|
|
96
|
+
resolvedAccounts.systemProgram.value = context.programs.getPublicKey(
|
|
97
|
+
'splSystem',
|
|
98
|
+
'11111111111111111111111111111111'
|
|
99
|
+
);
|
|
100
|
+
resolvedAccounts.systemProgram.isWritable = false;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Accounts in order.
|
|
104
|
+
const orderedAccounts: ResolvedAccount[] = Object.values(
|
|
105
|
+
resolvedAccounts
|
|
106
|
+
).sort((a, b) => a.index - b.index);
|
|
107
|
+
|
|
108
|
+
// Keys and Signers.
|
|
109
|
+
const [keys, signers] = getAccountMetasAndSigners(
|
|
110
|
+
orderedAccounts,
|
|
111
|
+
'programId',
|
|
112
|
+
programId
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
// Data.
|
|
116
|
+
const data = getExtendExecutorConfigInstructionDataSerializer().serialize({});
|
|
117
|
+
|
|
118
|
+
// Bytes Created On Chain.
|
|
119
|
+
const bytesCreatedOnChain = 0;
|
|
120
|
+
|
|
121
|
+
return transactionBuilder([
|
|
122
|
+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain },
|
|
123
|
+
]);
|
|
124
|
+
}
|
|
@@ -10,6 +10,7 @@ export * from './adminSetConfig';
|
|
|
10
10
|
export * from './compose';
|
|
11
11
|
export * from './executable';
|
|
12
12
|
export * from './execute';
|
|
13
|
+
export * from './extendExecutorConfig';
|
|
13
14
|
export * from './initExecutor';
|
|
14
15
|
export * from './nativeDrop';
|
|
15
16
|
export * from './ownerSetConfig';
|
|
@@ -0,0 +1,124 @@
|
|
|
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
|
+
struct,
|
|
22
|
+
} from '@metaplex-foundation/umi/serializers';
|
|
23
|
+
import {
|
|
24
|
+
ResolvedAccount,
|
|
25
|
+
ResolvedAccountsWithIndices,
|
|
26
|
+
getAccountMetasAndSigners,
|
|
27
|
+
} from '../shared';
|
|
28
|
+
|
|
29
|
+
// Accounts.
|
|
30
|
+
export type ExtendPriceFeedInstructionAccounts = {
|
|
31
|
+
admin: Signer;
|
|
32
|
+
priceFeed: PublicKey | Pda;
|
|
33
|
+
systemProgram?: PublicKey | Pda;
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
// Data.
|
|
37
|
+
export type ExtendPriceFeedInstructionData = { discriminator: Uint8Array };
|
|
38
|
+
|
|
39
|
+
export type ExtendPriceFeedInstructionDataArgs = {};
|
|
40
|
+
|
|
41
|
+
export function getExtendPriceFeedInstructionDataSerializer(): Serializer<
|
|
42
|
+
ExtendPriceFeedInstructionDataArgs,
|
|
43
|
+
ExtendPriceFeedInstructionData
|
|
44
|
+
> {
|
|
45
|
+
return mapSerializer<
|
|
46
|
+
ExtendPriceFeedInstructionDataArgs,
|
|
47
|
+
any,
|
|
48
|
+
ExtendPriceFeedInstructionData
|
|
49
|
+
>(
|
|
50
|
+
struct<ExtendPriceFeedInstructionData>(
|
|
51
|
+
[['discriminator', bytes({ size: 8 })]],
|
|
52
|
+
{ description: 'ExtendPriceFeedInstructionData' }
|
|
53
|
+
),
|
|
54
|
+
(value) => ({
|
|
55
|
+
...value,
|
|
56
|
+
discriminator: new Uint8Array([16, 95, 1, 5, 220, 54, 15, 80]),
|
|
57
|
+
})
|
|
58
|
+
) as Serializer<
|
|
59
|
+
ExtendPriceFeedInstructionDataArgs,
|
|
60
|
+
ExtendPriceFeedInstructionData
|
|
61
|
+
>;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
// Instruction.
|
|
65
|
+
export function extendPriceFeed(
|
|
66
|
+
context: Pick<Context, 'programs'>,
|
|
67
|
+
input: ExtendPriceFeedInstructionAccounts
|
|
68
|
+
): TransactionBuilder {
|
|
69
|
+
// Program ID.
|
|
70
|
+
const programId = context.programs.getPublicKey(
|
|
71
|
+
'pricefeed',
|
|
72
|
+
'8ahPGPjEbpgGaZx2NV1iG5Shj7TDwvsjkEDcGWjt94TP'
|
|
73
|
+
);
|
|
74
|
+
|
|
75
|
+
// Accounts.
|
|
76
|
+
const resolvedAccounts = {
|
|
77
|
+
admin: {
|
|
78
|
+
index: 0,
|
|
79
|
+
isWritable: true as boolean,
|
|
80
|
+
value: input.admin ?? null,
|
|
81
|
+
},
|
|
82
|
+
priceFeed: {
|
|
83
|
+
index: 1,
|
|
84
|
+
isWritable: true as boolean,
|
|
85
|
+
value: input.priceFeed ?? null,
|
|
86
|
+
},
|
|
87
|
+
systemProgram: {
|
|
88
|
+
index: 2,
|
|
89
|
+
isWritable: false as boolean,
|
|
90
|
+
value: input.systemProgram ?? null,
|
|
91
|
+
},
|
|
92
|
+
} satisfies ResolvedAccountsWithIndices;
|
|
93
|
+
|
|
94
|
+
// Default values.
|
|
95
|
+
if (!resolvedAccounts.systemProgram.value) {
|
|
96
|
+
resolvedAccounts.systemProgram.value = context.programs.getPublicKey(
|
|
97
|
+
'splSystem',
|
|
98
|
+
'11111111111111111111111111111111'
|
|
99
|
+
);
|
|
100
|
+
resolvedAccounts.systemProgram.isWritable = false;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
// Accounts in order.
|
|
104
|
+
const orderedAccounts: ResolvedAccount[] = Object.values(
|
|
105
|
+
resolvedAccounts
|
|
106
|
+
).sort((a, b) => a.index - b.index);
|
|
107
|
+
|
|
108
|
+
// Keys and Signers.
|
|
109
|
+
const [keys, signers] = getAccountMetasAndSigners(
|
|
110
|
+
orderedAccounts,
|
|
111
|
+
'programId',
|
|
112
|
+
programId
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
// Data.
|
|
116
|
+
const data = getExtendPriceFeedInstructionDataSerializer().serialize({});
|
|
117
|
+
|
|
118
|
+
// Bytes Created On Chain.
|
|
119
|
+
const bytesCreatedOnChain = 0;
|
|
120
|
+
|
|
121
|
+
return transactionBuilder([
|
|
122
|
+
{ instruction: { keys, programId, data }, signers, bytesCreatedOnChain },
|
|
123
|
+
]);
|
|
124
|
+
}
|