@codama/renderers-js 1.2.14 → 1.3.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/dist/index.node.cjs +19 -19
- package/dist/index.node.cjs.map +1 -1
- package/dist/index.node.mjs +23 -23
- package/dist/index.node.mjs.map +1 -1
- package/dist/templates/fragments/instructionParseFunction.njk +5 -5
- package/dist/templates/fragments/instructionType.njk +5 -5
- package/dist/templates/pages/sharedPage.njk +2 -2
- package/dist/types/fragments/instructionParseFunction.d.ts.map +1 -1
- package/dist/types/fragments/instructionType.d.ts.map +1 -1
- package/package.json +4 -4
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
export type {{ instructionParsedType }}<
|
|
4
4
|
TProgram extends string = typeof {{ programAddressConstant }},
|
|
5
5
|
{% if hasAccounts %}
|
|
6
|
-
TAccountMetas extends readonly
|
|
6
|
+
TAccountMetas extends readonly AccountMeta[] = readonly AccountMeta[],
|
|
7
7
|
{% endif %}
|
|
8
8
|
> = {
|
|
9
9
|
programAddress: Address<TProgram>;
|
|
@@ -25,15 +25,15 @@ export type {{ instructionParsedType }}<
|
|
|
25
25
|
export function {{ instructionParseFunction }}<
|
|
26
26
|
TProgram extends string,
|
|
27
27
|
{% if hasAccounts %}
|
|
28
|
-
TAccountMetas extends readonly
|
|
28
|
+
TAccountMetas extends readonly AccountMeta[],
|
|
29
29
|
{% endif %}
|
|
30
30
|
>(
|
|
31
|
-
instruction:
|
|
31
|
+
instruction: Instruction<TProgram>
|
|
32
32
|
{% if hasAccounts %}
|
|
33
|
-
&
|
|
33
|
+
& InstructionWithAccounts<TAccountMetas>
|
|
34
34
|
{% endif %}
|
|
35
35
|
{% if hasData %}
|
|
36
|
-
&
|
|
36
|
+
& InstructionWithData<ReadonlyUint8Array>
|
|
37
37
|
{% endif %}
|
|
38
38
|
): {{ instructionParsedType }}<TProgram {{ ', TAccountMetas' if hasAccounts }}> {
|
|
39
39
|
{% if hasAccounts %}
|
|
@@ -5,14 +5,14 @@ export type {{ instructionType }}<
|
|
|
5
5
|
{% if hasAccounts %}
|
|
6
6
|
{{ accountTypeParams }},
|
|
7
7
|
{% endif %}
|
|
8
|
-
TRemainingAccounts extends readonly
|
|
9
|
-
> =
|
|
8
|
+
TRemainingAccounts extends readonly AccountMeta<string>[] = [],
|
|
9
|
+
> = Instruction<TProgram>
|
|
10
10
|
{% if hasData %}
|
|
11
|
-
&
|
|
11
|
+
& InstructionWithData<ReadonlyUint8Array>
|
|
12
12
|
{% endif %}
|
|
13
13
|
{% if hasAccounts %}
|
|
14
|
-
&
|
|
14
|
+
& InstructionWithAccounts<[{{ accountMetas }}, ...TRemainingAccounts]>
|
|
15
15
|
{% else %}
|
|
16
|
-
&
|
|
16
|
+
& InstructionWithAccounts<TRemainingAccounts>
|
|
17
17
|
{% endif %}
|
|
18
18
|
;
|
|
@@ -73,7 +73,7 @@ export type ResolvedAccount<T extends string = string, U extends Address<T> | Pr
|
|
|
73
73
|
* Defines an instruction that stores additional bytes on-chain.
|
|
74
74
|
* @internal
|
|
75
75
|
*/
|
|
76
|
-
export type
|
|
76
|
+
export type InstructionWithByteDelta = {
|
|
77
77
|
byteDelta: number;
|
|
78
78
|
};
|
|
79
79
|
|
|
@@ -85,7 +85,7 @@ export function getAccountMetaFactory(
|
|
|
85
85
|
programAddress: Address,
|
|
86
86
|
optionalAccountStrategy: 'omitted' | 'programId',
|
|
87
87
|
) {
|
|
88
|
-
return (account: ResolvedAccount):
|
|
88
|
+
return (account: ResolvedAccount): AccountMeta | AccountSignerMeta | undefined => {
|
|
89
89
|
if (!account.value) {
|
|
90
90
|
if (optionalAccountStrategy === 'omitted') return;
|
|
91
91
|
return Object.freeze({ address: programAddress, role: AccountRole.READONLY });
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructionParseFunction.d.ts","sourceRoot":"","sources":["../../../src/fragments/instructionParseFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAgD,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAkC,MAAM,UAAU,CAAC;AAEpE,wBAAgB,mCAAmC,CAC/C,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,uBAAuB,GAAG,SAAS,CAAC,GAAG;IACpE,gBAAgB,EAAE,YAAY,CAAC;IAC/B,eAAe,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;CAC9C,GACF,QAAQ,
|
|
1
|
+
{"version":3,"file":"instructionParseFunction.d.ts","sourceRoot":"","sources":["../../../src/fragments/instructionParseFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,EAAgD,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AAC/C,OAAO,EAAE,QAAQ,EAAkC,MAAM,UAAU,CAAC;AAEpE,wBAAgB,mCAAmC,CAC/C,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,uBAAuB,GAAG,SAAS,CAAC,GAAG;IACpE,gBAAgB,EAAE,YAAY,CAAC;IAC/B,eAAe,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;CAC9C,GACF,QAAQ,CA2CV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instructionType.d.ts","sourceRoot":"","sources":["../../../src/fragments/instructionType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAc,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAgD,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAwC,MAAM,UAAU,CAAC;AAI1E,wBAAgB,0BAA0B,CACtC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,uBAAuB,GAAG,WAAW,GAAG,SAAS,CAAC,GAAG;IAClF,eAAe,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;CAC9C,GACF,QAAQ,
|
|
1
|
+
{"version":3,"file":"instructionType.d.ts","sourceRoot":"","sources":["../../../src/fragments/instructionType.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAc,MAAM,eAAe,CAAC;AAC5D,OAAO,EAAgD,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAE/F,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAClE,OAAO,EAAE,QAAQ,EAAwC,MAAM,UAAU,CAAC;AAI1E,wBAAgB,0BAA0B,CACtC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,uBAAuB,GAAG,WAAW,GAAG,SAAS,CAAC,GAAG;IAClF,eAAe,EAAE,QAAQ,CAAC,eAAe,CAAC,CAAC;CAC9C,GACF,QAAQ,CAyDV"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codama/renderers-js",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "JavaScript renderer compatible with the Solana Kit library",
|
|
5
5
|
"exports": {
|
|
6
6
|
"types": "./dist/types/index.d.ts",
|
|
@@ -28,9 +28,9 @@
|
|
|
28
28
|
"client"
|
|
29
29
|
],
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@solana/codecs-strings": "^2.
|
|
31
|
+
"@solana/codecs-strings": "^2.3.0",
|
|
32
32
|
"nunjucks": "^3.2.4",
|
|
33
|
-
"prettier": "^3.
|
|
33
|
+
"prettier": "^3.6.2",
|
|
34
34
|
"@codama/errors": "1.3.0",
|
|
35
35
|
"@codama/nodes": "1.3.0",
|
|
36
36
|
"@codama/renderers-core": "1.0.16",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"devDependencies": {
|
|
40
40
|
"@types/nunjucks": "^3.2.6",
|
|
41
|
-
"@codama/nodes-from-anchor": "1.2.
|
|
41
|
+
"@codama/nodes-from-anchor": "1.2.2"
|
|
42
42
|
},
|
|
43
43
|
"license": "MIT",
|
|
44
44
|
"repository": {
|