@codama/renderers-js 1.3.2 → 1.3.4

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.
@@ -43,7 +43,7 @@ export function {{ instructionParseFunction }}<
43
43
  }
44
44
  let accountIndex = 0;
45
45
  const getNextAccount = () => {
46
- const accountMeta = instruction.accounts![accountIndex]!;
46
+ const accountMeta = (instruction.accounts as TAccountMetas)[accountIndex]!;
47
47
  accountIndex += 1;
48
48
  return accountMeta;
49
49
  }
@@ -11,6 +11,7 @@ export type {{ pdaSeedsType }} = {
11
11
  }
12
12
  {% endif %}
13
13
 
14
+ {{ macros.docblock(pdaDocs) }}
14
15
  export async function {{ findPdaFunction }}(
15
16
  {% if hasVariableSeeds %}
16
17
  seeds: {{ pdaSeedsType }},
@@ -2,7 +2,7 @@
2
2
 
3
3
  {% for error in errors | sort(false, false, 'code') %}
4
4
  {{ macros.docblock(error.docs) }}
5
- export const {{ getProgramErrorConstant(error.name) }} = 0x{{ error.code.toString(16) }}, // {{ error.code }}
5
+ export const {{ getProgramErrorConstant(error.name) }} = 0x{{ error.code.toString(16) }}; // {{ error.code }}
6
6
  {% endfor %}
7
7
 
8
8
  export type {{ programErrorUnion }} =
@@ -9,7 +9,7 @@
9
9
  * @internal
10
10
  */
11
11
  export function expectSome<T>(value: T | null | undefined): T {
12
- if (value == null) {
12
+ if (value === null || value === undefined) {
13
13
  throw new Error('Expected a value but received null or undefined.');
14
14
  }
15
15
  return value;
@@ -29,7 +29,7 @@ export function expectAddress<T extends string = string>(
29
29
  return value.address;
30
30
  }
31
31
  if (Array.isArray(value)) {
32
- return value[0];
32
+ return value[0] as Address<T>;
33
33
  }
34
34
  return value as Address<T>;
35
35
  }
@@ -1 +1 @@
1
- {"version":3,"file":"pdaFunction.d.ts","sourceRoot":"","sources":["../../../src/fragments/pdaFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,OAAO,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAgD,QAAQ,EAAS,MAAM,uBAAuB,CAAC;AAEtG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAwB,MAAM,UAAU,CAAC;AAE1D,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,qBAAqB,CAAC,GAAG;IAClE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CAC9B,GACF,QAAQ,CAkCV"}
1
+ {"version":3,"file":"pdaFunction.d.ts","sourceRoot":"","sources":["../../../src/fragments/pdaFunction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAwB,OAAO,EAAE,MAAM,eAAe,CAAC;AAC9D,OAAO,EAAgD,QAAQ,EAAS,MAAM,uBAAuB,CAAC;AAEtG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,wBAAwB,CAAC;AAElE,OAAO,EAAE,QAAQ,EAAwB,MAAM,UAAU,CAAC;AAE1D,wBAAgB,sBAAsB,CAClC,KAAK,EAAE,IAAI,CAAC,mBAAmB,EAAE,SAAS,GAAG,qBAAqB,CAAC,GAAG;IAClE,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC;CAC9B,GACF,QAAQ,CAmCV"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codama/renderers-js",
3
- "version": "1.3.2",
3
+ "version": "1.3.4",
4
4
  "description": "JavaScript renderer compatible with the Solana Kit library",
5
5
  "exports": {
6
6
  "types": "./dist/types/index.d.ts",
@@ -31,14 +31,14 @@
31
31
  "@solana/codecs-strings": "^2.3.0",
32
32
  "nunjucks": "^3.2.4",
33
33
  "prettier": "^3.6.2",
34
- "@codama/errors": "1.3.1",
35
- "@codama/nodes": "1.3.1",
36
- "@codama/renderers-core": "1.0.17",
37
- "@codama/visitors-core": "1.3.1"
34
+ "@codama/errors": "1.3.3",
35
+ "@codama/nodes": "1.3.3",
36
+ "@codama/visitors-core": "1.3.3",
37
+ "@codama/renderers-core": "1.0.19"
38
38
  },
39
39
  "devDependencies": {
40
40
  "@types/nunjucks": "^3.2.6",
41
- "@codama/nodes-from-anchor": "1.2.3"
41
+ "@codama/nodes-from-anchor": "1.2.5"
42
42
  },
43
43
  "license": "MIT",
44
44
  "repository": {