@codama/renderers-js 1.1.2 → 1.2.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
CHANGED
|
@@ -455,7 +455,7 @@ function getAccountPdaHelpersFragment(scope) {
|
|
|
455
455
|
const { accountPath, nameApi, linkables, customAccountData, typeManifest: typeManifest2 } = scope;
|
|
456
456
|
const accountNode = visitorsCore.getLastNodeFromPath(accountPath);
|
|
457
457
|
const programNode = visitorsCore.findProgramNodeFromPath(accountPath);
|
|
458
|
-
const pdaNode = accountNode.pda ? linkables.get([...accountPath, accountNode.pda]) :
|
|
458
|
+
const pdaNode = accountNode.pda ? linkables.get([...accountPath, accountNode.pda]) : undefined;
|
|
459
459
|
if (!pdaNode) {
|
|
460
460
|
return fragment("");
|
|
461
461
|
}
|
|
@@ -807,7 +807,7 @@ function getInstructionInputDefaultFragment(scope) {
|
|
|
807
807
|
if (input.kind === "instructionAccountNode" && nodes.isNode(defaultValue, "resolverValueNode")) {
|
|
808
808
|
return fragment(`accounts.${inputName} = { ...accounts.${inputName}, ...${renderedValue} };`);
|
|
809
809
|
}
|
|
810
|
-
if (input.kind === "instructionAccountNode" && isWritable ===
|
|
810
|
+
if (input.kind === "instructionAccountNode" && isWritable === undefined) {
|
|
811
811
|
return fragment(`accounts.${inputName}.value = ${renderedValue};`);
|
|
812
812
|
}
|
|
813
813
|
if (input.kind === "instructionAccountNode") {
|
|
@@ -993,7 +993,7 @@ ${ifTrueRenderer ? ifTrueRenderer.render : ifFalseRenderer?.render}
|
|
|
993
993
|
}
|
|
994
994
|
function renderNestedInstructionDefault(scope) {
|
|
995
995
|
const { input, defaultValue } = scope;
|
|
996
|
-
if (!defaultValue) return
|
|
996
|
+
if (!defaultValue) return undefined;
|
|
997
997
|
return getInstructionInputDefaultFragment({
|
|
998
998
|
...scope,
|
|
999
999
|
input: { ...input, defaultValue }
|
|
@@ -2154,11 +2154,8 @@ function getTypeManifestVisitor(input) {
|
|
|
2154
2154
|
},
|
|
2155
2155
|
visitSolAmountType({ number }, { self }) {
|
|
2156
2156
|
const numberManifest = visitorsCore.visit(number, self);
|
|
2157
|
-
const lamportsType = "
|
|
2158
|
-
const lamportsImport = new ImportMap().add(
|
|
2159
|
-
"solanaRpcTypes",
|
|
2160
|
-
"type LamportsUnsafeBeyond2Pow53Minus1"
|
|
2161
|
-
);
|
|
2157
|
+
const lamportsType = "Lamports";
|
|
2158
|
+
const lamportsImport = new ImportMap().add("solanaRpcTypes", "type Lamports");
|
|
2162
2159
|
return {
|
|
2163
2160
|
...numberManifest,
|
|
2164
2161
|
decoder: numberManifest.decoder.mapRender((r) => `getLamportsDecoder(${r})`).addImports("solanaRpcTypes", "getLamportsDecoder"),
|