@ledgerhq/context-module 0.0.0-develop-20260702003423 → 0.0.0-develop-20260704002810
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/lib/cjs/package.json +1 -1
- package/lib/cjs/src/modules/solana/enum-variant/domain/EnumVariantContextLoader.js +1 -1
- package/lib/cjs/src/modules/solana/enum-variant/domain/EnumVariantContextLoader.js.map +3 -3
- package/lib/cjs/src/modules/solana/enum-variant/domain/EnumVariantContextLoader.test.js +1 -1
- package/lib/cjs/src/modules/solana/enum-variant/domain/EnumVariantContextLoader.test.js.map +3 -3
- package/lib/cjs/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.js +1 -1
- package/lib/cjs/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.js.map +3 -3
- package/lib/cjs/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.test.js +1 -1
- package/lib/cjs/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.test.js.map +3 -3
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoDataSource.js +1 -1
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoDataSource.js.map +1 -1
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoDto.js +1 -1
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoDto.js.map +2 -2
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoMapper.js +2 -0
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoMapper.js.map +7 -0
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.js +2 -0
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.js.map +7 -0
- package/lib/cjs/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.js +1 -1
- package/lib/cjs/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.js.map +3 -3
- package/lib/cjs/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.test.js +1 -1
- package/lib/cjs/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.test.js.map +3 -3
- package/lib/cjs/src/modules/solana/model/SolanaClearSignContext.js +1 -1
- package/lib/cjs/src/modules/solana/model/SolanaClearSignContext.js.map +2 -2
- package/lib/cjs/src/modules/solana/model/SolanaPayloads.js +1 -1
- package/lib/cjs/src/modules/solana/model/SolanaPayloads.js.map +2 -2
- package/lib/esm/package.json +1 -1
- package/lib/esm/src/modules/solana/enum-variant/domain/EnumVariantContextLoader.js +1 -1
- package/lib/esm/src/modules/solana/enum-variant/domain/EnumVariantContextLoader.js.map +3 -3
- package/lib/esm/src/modules/solana/enum-variant/domain/EnumVariantContextLoader.test.js +1 -1
- package/lib/esm/src/modules/solana/enum-variant/domain/EnumVariantContextLoader.test.js.map +3 -3
- package/lib/esm/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.js +1 -1
- package/lib/esm/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.js.map +3 -3
- package/lib/esm/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.test.js +1 -1
- package/lib/esm/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.test.js.map +3 -3
- package/lib/esm/src/modules/solana/instruction-info/data/InstructionInfoDto.js +1 -1
- package/lib/esm/src/modules/solana/instruction-info/data/InstructionInfoDto.js.map +2 -2
- package/lib/esm/src/modules/solana/instruction-info/data/InstructionInfoMapper.js +2 -0
- package/lib/esm/src/modules/solana/instruction-info/data/InstructionInfoMapper.js.map +7 -0
- package/lib/esm/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.js +2 -0
- package/lib/esm/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.js.map +7 -0
- package/lib/esm/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.js +1 -1
- package/lib/esm/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.js.map +3 -3
- package/lib/esm/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.test.js +1 -1
- package/lib/esm/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.test.js.map +3 -3
- package/lib/esm/src/modules/solana/model/SolanaClearSignContext.js +1 -1
- package/lib/esm/src/modules/solana/model/SolanaClearSignContext.js.map +2 -2
- package/lib/esm/src/modules/solana/model/SolanaPayloads.js +1 -1
- package/lib/esm/src/modules/solana/model/SolanaPayloads.js.map +2 -2
- package/lib/types/src/modules/solana/enum-variant/domain/EnumVariantContextLoader.d.ts +4 -4
- package/lib/types/src/modules/solana/enum-variant/domain/EnumVariantContextLoader.d.ts.map +1 -1
- package/lib/types/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.d.ts.map +1 -1
- package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoDataSource.d.ts +13 -4
- package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoDataSource.d.ts.map +1 -1
- package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoDto.d.ts +54 -5
- package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoDto.d.ts.map +1 -1
- package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoMapper.d.ts +23 -0
- package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoMapper.d.ts.map +1 -0
- package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.d.ts +2 -0
- package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.d.ts.map +1 -0
- package/lib/types/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.d.ts +1 -5
- package/lib/types/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.d.ts.map +1 -1
- package/lib/types/src/modules/solana/model/SolanaClearSignContext.d.ts +1 -1
- package/lib/types/src/modules/solana/model/SolanaClearSignContext.d.ts.map +1 -1
- package/lib/types/src/modules/solana/model/SolanaPayloads.d.ts +68 -4
- package/lib/types/src/modules/solana/model/SolanaPayloads.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +6 -6
package/lib/esm/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.test.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{DeviceModelId as
|
|
1
|
+
import{DeviceModelId as l}from"@ledgerhq/device-management-kit";import{Left as N,Right as d}from"purify-ts";import{beforeEach as A,describe as O,expect as e,it as u,vi as a}from"vitest";import{ClearSignContextType as i}from"../../../../shared/model/ClearSignContext";import{InstructionInfoContextLoader as v}from"./InstructionInfoContextLoader";const _=()=>({debug:a.fn(),info:a.fn(),warn:a.fn(),error:a.fn(),subscribers:[]}),R={keyUsageNumber:8,payload:new Uint8Array([66])},o="11111111111111111111111111111111",m="JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4";function g(){return{programId:o,discriminator:"00000000",instructionInfo:{data:"0001sys_data",signature:"prodsig_sys"},substructures:[{kind:0,data:"df1"},{kind:0,data:"df2"},{kind:1,data:"vfp1"}],enumVariants:[],idlDescriptor:{typePool:[],rootType:0},mintAssociations:[],valueFlowPorts:[],accountResets:[],displayFields:[]}}function f(){return{programId:o,descriptors:{"00000000":d(g())},enumVariants:[]}}function k(){return{programId:m,discriminator:"e517cb977ae3ad2a",instructionInfo:{data:"0001jup_data",signature:"prodsig_jup"},substructures:[],enumVariants:[],idlDescriptor:{typePool:[],rootType:0},mintAssociations:[],valueFlowPorts:[],accountResets:[],displayFields:[]}}function w(){return{programId:m,descriptors:{e517cb977ae3ad2a:d(k())},enumVariants:[]}}O("InstructionInfoContextLoader",()=>{let I,y;A(()=>{a.restoreAllMocks(),I={getInstructionInfo:a.fn()},y={loadCertificate:a.fn().mockResolvedValue(R)}});const c=()=>new v(I,y,_);O("canHandle",()=>{u("returns true when SOLANA_INSTRUCTION_INFO is requested and instructions are present",()=>{e(c().canHandle({deviceModelId:l.NANO_X,instructions:[{programId:o}]},[i.SOLANA_INSTRUCTION_INFO])).toBe(!0)}),u("returns false when SOLANA_INSTRUCTION_INFO is not requested",()=>{e(c().canHandle({deviceModelId:l.NANO_X,instructions:[{programId:o}]},[i.SOLANA_TOKEN])).toBe(!1)}),u("returns false on missing / empty / malformed instructions",()=>{const n=c(),t=[i.SOLANA_INSTRUCTION_INFO];e(n.canHandle({},t)).toBe(!1),e(n.canHandle({instructions:[]},t)).toBe(!1),e(n.canHandle({instructions:[{programId:""}]},t)).toBe(!1),e(n.canHandle(null,t)).toBe(!1),e(n.canHandle("string",t)).toBe(!1)})}),O("load",()=>{u("fans out one CAL call per distinct programId in parallel",async()=>{const n=c(),t=a.spyOn(I,"getInstructionInfo").mockImplementation(async({programId:s})=>s===o?d(f()):s===m?d(w()):N(new Error("unknown program"))),r=await n.load({deviceModelId:l.NANO_X,instructions:[{programId:o,discriminator:"00000000"},{programId:o,discriminator:"00000000"},{programId:m,discriminator:"e517cb977ae3ad2a"}],network:"solana-mainnet"});e(t).toHaveBeenCalledTimes(2),e(t).toHaveBeenCalledWith({programId:o,network:"solana-mainnet"}),e(t).toHaveBeenCalledWith({programId:m,network:"solana-mainnet"}),e(r.every(s=>s.type===i.SOLANA_INSTRUCTION_INFO||s.type===i.ERROR)).toBe(!0),e(r.filter(s=>s.type===i.SOLANA_INSTRUCTION_INFO)).toHaveLength(2)}),u("emits one SOLANA_INSTRUCTION_INFO per matching (programId, discriminator), passing the decoded payload through with the certificate",async()=>{const n=c();a.spyOn(I,"getInstructionInfo").mockResolvedValue(d(f()));const r=(await n.load({deviceModelId:l.NANO_X,instructions:[{programId:o,discriminator:"00000000"}]})).find(s=>s.type===i.SOLANA_INSTRUCTION_INFO);e(r).toBeDefined(),e(r).toMatchObject({type:i.SOLANA_INSTRUCTION_INFO,certificate:R}),e(r.payload).toEqual(g())}),u("filters descriptors by requested discriminator",async()=>{const n=c(),t={programId:o,descriptors:{"00000000":d(g()),"00000001":d({...g(),discriminator:"00000001",instructionInfo:{data:"0001other",signature:"p"}})},enumVariants:[]};a.spyOn(I,"getInstructionInfo").mockResolvedValue(d(t));const s=(await n.load({deviceModelId:l.NANO_X,instructions:[{programId:o,discriminator:"00000000"}]})).filter(p=>p.type===i.SOLANA_INSTRUCTION_INFO);e(s).toHaveLength(1),e(s[0].payload.discriminator).toBe("00000000")}),u("emits an ERROR context for a descriptor the data source could not decode",async()=>{const n=c(),t={programId:o,descriptors:{"00000000":N(new Error("missing 'test' signature"))},enumVariants:[]};a.spyOn(I,"getInstructionInfo").mockResolvedValue(d(t));const r=await n.load({deviceModelId:l.NANO_X,instructions:[{programId:o,discriminator:"00000000"}]});e(r).toHaveLength(1),e(r[0]?.type).toBe(i.ERROR),e(r[0].error.message).toMatch(/missing 'test' signature/)}),u("emits one ERROR context when CAL fails for a program but keeps processing the others",async()=>{const n=c();a.spyOn(I,"getInstructionInfo").mockImplementation(async({programId:p})=>p===o?d(f()):N(new Error("upstream-500")));const t=await n.load({deviceModelId:l.NANO_X,instructions:[{programId:o,discriminator:"00000000"},{programId:m,discriminator:"e517cb977ae3ad2a"}]}),r=t.filter(p=>p.type===i.ERROR),s=t.filter(p=>p.type===i.SOLANA_INSTRUCTION_INFO);e(r).toHaveLength(1),e(s).toHaveLength(1)}),u("degrades every program to ERROR when certificate loading fails",async()=>{a.spyOn(y,"loadCertificate").mockRejectedValue(new Error("pki-down")),a.spyOn(I,"getInstructionInfo").mockResolvedValue(d(f()));const t=await c().load({deviceModelId:l.NANO_X,instructions:[{programId:o},{programId:m}]});e(t).toHaveLength(2),e(t.every(r=>r.type===i.ERROR)).toBe(!0)}),u("degrades every program to ERROR when the certificate resolves undefined",async()=>{a.spyOn(y,"loadCertificate").mockResolvedValue(void 0),a.spyOn(I,"getInstructionInfo").mockResolvedValue(d(f()));const t=await c().load({deviceModelId:l.NANO_X,instructions:[{programId:o},{programId:m}]});e(t).toHaveLength(2),e(t.every(r=>r.type===i.ERROR)).toBe(!0),e(t[0].error.message).toMatch(/certificate is missing/)}),u("falls back to default network when input.network is omitted or empty string",async()=>{const n=c(),t=a.spyOn(I,"getInstructionInfo").mockResolvedValue(d(f()));await n.load({deviceModelId:l.NANO_X,instructions:[{programId:o}]}),e(t).toHaveBeenLastCalledWith({programId:o,network:"solana-mainnet"}),await n.load({deviceModelId:l.NANO_X,instructions:[{programId:o}],network:""}),e(t).toHaveBeenLastCalledWith({programId:o,network:"solana-mainnet"})})})});
|
|
2
2
|
//# sourceMappingURL=InstructionInfoContextLoader.test.js.map
|
package/lib/esm/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.test.js.map
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../../src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.test.ts"],
|
|
4
|
-
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { DeviceModelId } from \"@ledgerhq/device-management-kit\";\nimport { Left, Right } from \"purify-ts\";\nimport { beforeEach, describe, expect, it, vi } from \"vitest\";\n\nimport { type ContextModuleServiceConfig } from \"@/config/model/ContextModuleConfig\";\nimport { type PkiCertificateLoader } from \"@/modules/multichain/pki/domain/PkiCertificateLoader\";\nimport {\n type InstructionInfoDataSource,\n type InstructionInfoResult,\n} from \"@/modules/solana/instruction-info/data/InstructionInfoDataSource\";\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\n\nimport { InstructionInfoContextLoader } from \"./InstructionInfoContextLoader\";\n\nconst mockLoggerFactory = () => ({\n debug: vi.fn(),\n info: vi.fn(),\n warn: vi.fn(),\n error: vi.fn(),\n subscribers: [],\n});\n\nconst mockCertificate = {\n keyUsageNumber: 8,\n payload: new Uint8Array([0x42]),\n};\n\nconst mockConfig = {\n cal: {\n url: \"https://crypto-assets-service.api.ledger.com/v1\",\n mode: \"prod\",\n branch: \"main\",\n },\n} as ContextModuleServiceConfig;\n\nconst SYSTEM_PROGRAM = \"11111111111111111111111111111111\";\nconst JUPITER_PROGRAM = \"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4\";\n\nfunction makeSystemCreateAccountResult(): InstructionInfoResult {\n return {\n programId: SYSTEM_PROGRAM,\n descriptors: {\n \"00000000\": {\n type: \"instruction\",\n instruction_info: {\n version: 1,\n program_id: SYSTEM_PROGRAM,\n discriminator: \"00000000\",\n hash: \"feedface\",\n descriptor: {\n data: \"0001sys_data\",\n signatures: { prod: \"prodsig_sys\", test: \"testsig_sys\" },\n },\n },\n display_fields: [{ descriptor: \"df1\" }, { descriptor: \"df2\" }],\n value_flow_ports: [{ descriptor: \"vfp1\" }],\n hide_rules: [],\n account_resets: [],\n },\n },\n };\n}\n\nfunction makeJupiterRouteResult(): InstructionInfoResult {\n return {\n programId: JUPITER_PROGRAM,\n descriptors: {\n e517cb977ae3ad2a: {\n type: \"instruction\",\n instruction_info: {\n version: 1,\n program_id: JUPITER_PROGRAM,\n discriminator: \"e517cb977ae3ad2a\",\n hash: \"deadbeef\",\n descriptor: {\n data: \"0001jup_data\",\n signatures: { prod: \"prodsig_jup\", test: \"testsig_jup\" },\n },\n },\n display_fields: [],\n value_flow_ports: [{ descriptor: \"vfp_in\" }, { descriptor: \"vfp_out\" }],\n hide_rules: [],\n account_resets: [],\n },\n },\n };\n}\n\ndescribe(\"InstructionInfoContextLoader\", () => {\n let dataSource: InstructionInfoDataSource;\n let certificateLoader: PkiCertificateLoader;\n\n beforeEach(() => {\n vi.restoreAllMocks();\n dataSource = {\n getInstructionInfo: vi.fn(),\n };\n certificateLoader = {\n loadCertificate: vi.fn().mockResolvedValue(mockCertificate),\n };\n });\n\n const makeLoader = (config = mockConfig) =>\n new InstructionInfoContextLoader(\n dataSource,\n config,\n certificateLoader,\n mockLoggerFactory,\n );\n\n describe(\"canHandle\", () => {\n it(\"returns true when SOLANA_INSTRUCTION_INFO is requested and instructions are present\", () => {\n expect(\n makeLoader().canHandle(\n {\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [{ programId: SYSTEM_PROGRAM }],\n },\n [ClearSignContextType.SOLANA_INSTRUCTION_INFO],\n ),\n ).toBe(true);\n });\n\n it(\"returns false when SOLANA_INSTRUCTION_INFO is not requested\", () => {\n expect(\n makeLoader().canHandle(\n {\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [{ programId: SYSTEM_PROGRAM }],\n },\n [ClearSignContextType.SOLANA_TOKEN],\n ),\n ).toBe(false);\n });\n\n it(\"returns false on missing / empty / malformed instructions\", () => {\n const loader = makeLoader();\n const types = [ClearSignContextType.SOLANA_INSTRUCTION_INFO];\n expect(loader.canHandle({} as any, types)).toBe(false);\n expect(loader.canHandle({ instructions: [] } as any, types)).toBe(false);\n expect(\n loader.canHandle({ instructions: [{ programId: \"\" }] } as any, types),\n ).toBe(false);\n expect(loader.canHandle(null, types)).toBe(false);\n expect(loader.canHandle(\"string\", types)).toBe(false);\n });\n });\n\n describe(\"load\", () => {\n it(\"fans out one CAL call per distinct programId in parallel\", async () => {\n const loader = makeLoader();\n const spy = vi\n .spyOn(dataSource, \"getInstructionInfo\")\n .mockImplementation(async ({ programId }) => {\n if (programId === SYSTEM_PROGRAM)\n return Right(makeSystemCreateAccountResult());\n if (programId === JUPITER_PROGRAM)\n return Right(makeJupiterRouteResult());\n return Left(new Error(\"unknown program\"));\n });\n\n const result = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" },\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" }, // dup\n { programId: JUPITER_PROGRAM, discriminator: \"e517cb977ae3ad2a\" },\n ],\n network: \"solana-mainnet\",\n });\n\n expect(spy).toHaveBeenCalledTimes(2);\n expect(spy).toHaveBeenCalledWith({\n programId: SYSTEM_PROGRAM,\n network: \"solana-mainnet\",\n });\n expect(spy).toHaveBeenCalledWith({\n programId: JUPITER_PROGRAM,\n network: \"solana-mainnet\",\n });\n\n // Only INSTRUCTION_INFO contexts now \u2014 enum variants moved to\n // EnumVariantContextLoader.\n expect(\n result.every(\n (c) =>\n c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO ||\n c.type === ClearSignContextType.ERROR,\n ),\n ).toBe(true);\n expect(\n result.filter(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n ),\n ).toHaveLength(2);\n });\n\n it(\"emits one SOLANA_INSTRUCTION_INFO per matching (programId, discriminator) with substructures and certificate bundled\", async () => {\n const loader = makeLoader();\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeSystemCreateAccountResult()),\n );\n\n const result = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" },\n ],\n });\n\n const infoCtx = result.find(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n );\n expect(infoCtx).toBeDefined();\n expect(infoCtx).toMatchObject({\n type: ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n certificate: mockCertificate,\n });\n expect((infoCtx as any).payload).toMatchObject({\n programId: SYSTEM_PROGRAM,\n discriminator: \"00000000\",\n instructionInfo: { data: \"0001sys_data\", signature: \"prodsig_sys\" },\n substructures: [\n { kind: 0x00, data: \"df1\" },\n { kind: 0x00, data: \"df2\" },\n { kind: 0x01, data: \"vfp1\" },\n ],\n });\n });\n\n it(\"does NOT emit SOLANA_ENUM_VARIANT contexts (those come from EnumVariantContextLoader)\", async () => {\n const loader = makeLoader();\n const jupiter = makeJupiterRouteResult();\n // Stuff an enum_variants entry into the descriptor to confirm it's ignored.\n const descriptor = jupiter.descriptors[\"e517cb977ae3ad2a\"];\n if (!descriptor) throw new Error(\"fixture: descriptor must exist\");\n descriptor.enum_variants = {\n swap: {\n \"46\": {\n variant_name: \"raydiumCP\",\n data: \"01_raydium_tlv\",\n signatures: { prod: \"prodsig_v46\", test: \"testsig_v46\" },\n },\n },\n };\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(jupiter),\n );\n\n const result = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: JUPITER_PROGRAM, discriminator: \"e517cb977ae3ad2a\" },\n ],\n });\n\n expect(\n result.filter(\n (c) => c.type === ClearSignContextType.SOLANA_ENUM_VARIANT,\n ),\n ).toHaveLength(0);\n });\n\n it(\"bundles CAL enum_variants into the SOLANA_INSTRUCTION_INFO payload (host decode cache)\", async () => {\n const loader = makeLoader();\n const jupiter = makeJupiterRouteResult();\n const descriptor = jupiter.descriptors[\"e517cb977ae3ad2a\"];\n if (!descriptor) throw new Error(\"fixture: descriptor must exist\");\n descriptor.enum_variants = {\n swap: {\n \"46\": {\n variant_name: \"raydiumCP\",\n data: \"01_raydium_tlv\",\n signatures: { prod: \"prodsig_v46\", test: \"testsig_v46\" },\n },\n },\n };\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(jupiter),\n );\n\n const result = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: JUPITER_PROGRAM, discriminator: \"e517cb977ae3ad2a\" },\n ],\n });\n\n const infoCtx = result.find(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n );\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n expect((infoCtx as any).payload.enumVariants).toEqual([\n {\n enumId: \"swap\",\n variantIndex: 46,\n descriptor: { data: \"01_raydium_tlv\", signature: \"prodsig_v46\" },\n },\n ]);\n });\n\n it(\"skips enum_variants keyed by a non-u16 index instead of leaking NaN\", async () => {\n const loader = makeLoader();\n const jupiter = makeJupiterRouteResult();\n const descriptor = jupiter.descriptors[\"e517cb977ae3ad2a\"];\n if (!descriptor) throw new Error(\"fixture: descriptor must exist\");\n descriptor.enum_variants = {\n swap: {\n \"46\": {\n variant_name: \"raydiumCP\",\n data: \"01_raydium_tlv\",\n signatures: { prod: \"prodsig_v46\", test: \"testsig_v46\" },\n },\n // malformed keys CAL must never produce, but the codec guards anyway\n \"7abc\": {\n variant_name: \"junk\",\n data: \"junk_tlv\",\n signatures: { prod: \"x\", test: \"x\" },\n },\n \"70000\": {\n variant_name: \"overflow\",\n data: \"overflow_tlv\",\n signatures: { prod: \"x\", test: \"x\" },\n },\n },\n };\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(jupiter),\n );\n\n const result = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: JUPITER_PROGRAM, discriminator: \"e517cb977ae3ad2a\" },\n ],\n });\n\n const infoCtx = result.find(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n );\n // only the valid u16 key survives\n // eslint-disable-next-line @typescript-eslint/no-explicit-any\n expect((infoCtx as any).payload.enumVariants).toEqual([\n {\n enumId: \"swap\",\n variantIndex: 46,\n descriptor: { data: \"01_raydium_tlv\", signature: \"prodsig_v46\" },\n },\n ]);\n });\n\n it(\"filters descriptors by requested discriminator\", async () => {\n const loader = makeLoader();\n const result: InstructionInfoResult = {\n programId: SYSTEM_PROGRAM,\n descriptors: {\n ...makeSystemCreateAccountResult().descriptors,\n \"00000001\": {\n type: \"instruction\",\n instruction_info: {\n version: 1,\n program_id: SYSTEM_PROGRAM,\n discriminator: \"00000001\",\n hash: \"feedface2\",\n descriptor: {\n data: \"0001other\",\n signatures: { prod: \"p\", test: \"t\" },\n },\n },\n display_fields: [{ descriptor: \"shouldnotappear\" }],\n },\n },\n };\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(result),\n );\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" },\n ],\n });\n\n const infos = out.filter(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n );\n expect(infos).toHaveLength(1);\n expect((infos[0] as any).payload.discriminator).toBe(\"00000000\");\n });\n\n it(\"emits one ERROR context when CAL fails for a program but keeps processing the others\", async () => {\n const loader = makeLoader();\n vi.spyOn(dataSource, \"getInstructionInfo\").mockImplementation(\n async ({ programId }) => {\n if (programId === SYSTEM_PROGRAM)\n return Right(makeSystemCreateAccountResult());\n return Left(new Error(\"upstream-500\"));\n },\n );\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" },\n { programId: JUPITER_PROGRAM, discriminator: \"e517cb977ae3ad2a\" },\n ],\n });\n\n const errors = out.filter((c) => c.type === ClearSignContextType.ERROR);\n const infos = out.filter(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n );\n expect(errors).toHaveLength(1);\n expect(infos).toHaveLength(1);\n });\n\n it(\"emits ERROR (not empty signature) when configured CAL mode signature is missing\", async () => {\n const loader = new InstructionInfoContextLoader(\n dataSource,\n { ...mockConfig, cal: { ...mockConfig.cal, mode: \"test\" } } as any,\n certificateLoader,\n mockLoggerFactory,\n );\n // Only prod signature in CAL response; loader is configured for test.\n const result = makeJupiterRouteResult();\n const descriptor = result.descriptors[\"e517cb977ae3ad2a\"];\n if (!descriptor) throw new Error(\"fixture: descriptor must exist\");\n delete (descriptor.instruction_info.descriptor.signatures as any).test;\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(result),\n );\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: JUPITER_PROGRAM, discriminator: \"e517cb977ae3ad2a\" },\n ],\n });\n\n expect(out).toHaveLength(1);\n expect(out[0]?.type).toBe(ClearSignContextType.ERROR);\n expect((out[0] as any).error.message).toMatch(/missing 'test' signature/);\n });\n\n it(\"degrades every program to ERROR when certificate loading fails\", async () => {\n vi.spyOn(certificateLoader, \"loadCertificate\").mockRejectedValue(\n new Error(\"pki-down\"),\n );\n // Data fetches happen in parallel with the cert load, so they may run\n // before the cert rejection settles. Resolve them so allSettled-like\n // logic doesn't dangle.\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeSystemCreateAccountResult()),\n );\n const loader = makeLoader();\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM },\n { programId: JUPITER_PROGRAM },\n ],\n });\n\n expect(out).toHaveLength(2);\n expect(out.every((c) => c.type === ClearSignContextType.ERROR)).toBe(\n true,\n );\n });\n\n it(\"degrades every program to ERROR when the certificate resolves undefined\", async () => {\n vi.spyOn(certificateLoader, \"loadCertificate\").mockResolvedValue(\n undefined,\n );\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeSystemCreateAccountResult()),\n );\n const loader = makeLoader();\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM },\n { programId: JUPITER_PROGRAM },\n ],\n });\n\n expect(out).toHaveLength(2);\n expect(out.every((c) => c.type === ClearSignContextType.ERROR)).toBe(\n true,\n );\n expect((out[0] as any).error.message).toMatch(/certificate is missing/);\n });\n\n it(\"selects signatures based on config.cal.mode (test)\", async () => {\n const loader = new InstructionInfoContextLoader(\n dataSource,\n { ...mockConfig, cal: { ...mockConfig.cal, mode: \"test\" } } as any,\n certificateLoader,\n mockLoggerFactory,\n );\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeJupiterRouteResult()),\n );\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: JUPITER_PROGRAM, discriminator: \"e517cb977ae3ad2a\" },\n ],\n });\n\n const info = out.find(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n );\n expect((info as any).payload.instructionInfo.signature).toBe(\n \"testsig_jup\",\n );\n });\n\n it(\"falls back to default network when input.network is omitted or empty string\", async () => {\n const loader = makeLoader();\n const spy = vi\n .spyOn(dataSource, \"getInstructionInfo\")\n .mockResolvedValue(Right(makeSystemCreateAccountResult()));\n\n await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [{ programId: SYSTEM_PROGRAM }],\n });\n expect(spy).toHaveBeenLastCalledWith({\n programId: SYSTEM_PROGRAM,\n network: \"solana-mainnet\",\n });\n\n await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [{ programId: SYSTEM_PROGRAM }],\n network: \"\",\n });\n expect(spy).toHaveBeenLastCalledWith({\n programId: SYSTEM_PROGRAM,\n network: \"solana-mainnet\",\n });\n });\n });\n});\n"],
|
|
5
|
-
"mappings": "AAEA,OAAS,iBAAAA,MAAqB,kCAC9B,OAAS,QAAAC,EAAM,SAAAC,MAAa,YAC5B,OAAS,cAAAC,EAAY,YAAAC,EAAU,UAAAC,EAAQ,MAAAC,EAAI,MAAAC,MAAU,SAQrD,OAAS,wBAAAC,MAA4B,kCAErC,OAAS,gCAAAC,MAAoC,iCAE7C,MAAMC,EAAoB,KAAO,CAC/B,MAAOH,EAAG,GAAG,EACb,KAAMA,EAAG,GAAG,EACZ,KAAMA,EAAG,GAAG,EACZ,MAAOA,EAAG,GAAG,EACb,YAAa,CAAC,CAChB,GAEMI,EAAkB,CACtB,eAAgB,EAChB,QAAS,IAAI,WAAW,CAAC,EAAI,CAAC,CAChC,EAEMC,
|
|
6
|
-
"names": ["DeviceModelId", "Left", "Right", "beforeEach", "describe", "expect", "it", "vi", "ClearSignContextType", "InstructionInfoContextLoader", "mockLoggerFactory", "mockCertificate", "
|
|
4
|
+
"sourcesContent": ["/* eslint-disable @typescript-eslint/no-explicit-any */\n/* eslint-disable @typescript-eslint/no-unsafe-member-access */\nimport { DeviceModelId } from \"@ledgerhq/device-management-kit\";\nimport { Left, Right } from \"purify-ts\";\nimport { beforeEach, describe, expect, it, vi } from \"vitest\";\n\nimport { type PkiCertificateLoader } from \"@/modules/multichain/pki/domain/PkiCertificateLoader\";\nimport {\n type InstructionInfoDataSource,\n type InstructionInfoResult,\n} from \"@/modules/solana/instruction-info/data/InstructionInfoDataSource\";\nimport { type SolanaInstructionInfoPayload } from \"@/modules/solana/model/SolanaPayloads\";\nimport { ClearSignContextType } from \"@/shared/model/ClearSignContext\";\n\nimport { InstructionInfoContextLoader } from \"./InstructionInfoContextLoader\";\n\nconst mockLoggerFactory = () => ({\n debug: vi.fn(),\n info: vi.fn(),\n warn: vi.fn(),\n error: vi.fn(),\n subscribers: [],\n});\n\nconst mockCertificate = {\n keyUsageNumber: 8,\n payload: new Uint8Array([0x42]),\n};\n\nconst SYSTEM_PROGRAM = \"11111111111111111111111111111111\";\nconst JUPITER_PROGRAM = \"JUP6LkbZbjS1jKKwapdHNy74zcZ3tLUZoi5QNyVTaV4\";\n\n// The data source hands the loader fully-decoded core payloads.\nfunction makeSystemPayload(): SolanaInstructionInfoPayload {\n return {\n programId: SYSTEM_PROGRAM,\n discriminator: \"00000000\",\n instructionInfo: { data: \"0001sys_data\", signature: \"prodsig_sys\" },\n substructures: [\n { kind: 0x00, data: \"df1\" },\n { kind: 0x00, data: \"df2\" },\n { kind: 0x01, data: \"vfp1\" },\n ],\n enumVariants: [],\n idlDescriptor: { typePool: [], rootType: 0 },\n mintAssociations: [],\n valueFlowPorts: [],\n accountResets: [],\n displayFields: [],\n };\n}\n\nfunction makeSystemResult(): InstructionInfoResult {\n return {\n programId: SYSTEM_PROGRAM,\n descriptors: { \"00000000\": Right(makeSystemPayload()) },\n enumVariants: [],\n };\n}\n\nfunction makeJupiterPayload(): SolanaInstructionInfoPayload {\n return {\n programId: JUPITER_PROGRAM,\n discriminator: \"e517cb977ae3ad2a\",\n instructionInfo: { data: \"0001jup_data\", signature: \"prodsig_jup\" },\n substructures: [],\n enumVariants: [],\n idlDescriptor: { typePool: [], rootType: 0 },\n mintAssociations: [],\n valueFlowPorts: [],\n accountResets: [],\n displayFields: [],\n };\n}\n\nfunction makeJupiterResult(): InstructionInfoResult {\n return {\n programId: JUPITER_PROGRAM,\n descriptors: { e517cb977ae3ad2a: Right(makeJupiterPayload()) },\n enumVariants: [],\n };\n}\n\ndescribe(\"InstructionInfoContextLoader\", () => {\n let dataSource: InstructionInfoDataSource;\n let certificateLoader: PkiCertificateLoader;\n\n beforeEach(() => {\n vi.restoreAllMocks();\n dataSource = {\n getInstructionInfo: vi.fn(),\n };\n certificateLoader = {\n loadCertificate: vi.fn().mockResolvedValue(mockCertificate),\n };\n });\n\n const makeLoader = () =>\n new InstructionInfoContextLoader(\n dataSource,\n certificateLoader,\n mockLoggerFactory,\n );\n\n describe(\"canHandle\", () => {\n it(\"returns true when SOLANA_INSTRUCTION_INFO is requested and instructions are present\", () => {\n expect(\n makeLoader().canHandle(\n {\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [{ programId: SYSTEM_PROGRAM }],\n },\n [ClearSignContextType.SOLANA_INSTRUCTION_INFO],\n ),\n ).toBe(true);\n });\n\n it(\"returns false when SOLANA_INSTRUCTION_INFO is not requested\", () => {\n expect(\n makeLoader().canHandle(\n {\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [{ programId: SYSTEM_PROGRAM }],\n },\n [ClearSignContextType.SOLANA_TOKEN],\n ),\n ).toBe(false);\n });\n\n it(\"returns false on missing / empty / malformed instructions\", () => {\n const loader = makeLoader();\n const types = [ClearSignContextType.SOLANA_INSTRUCTION_INFO];\n expect(loader.canHandle({} as any, types)).toBe(false);\n expect(loader.canHandle({ instructions: [] } as any, types)).toBe(false);\n expect(\n loader.canHandle({ instructions: [{ programId: \"\" }] } as any, types),\n ).toBe(false);\n expect(loader.canHandle(null, types)).toBe(false);\n expect(loader.canHandle(\"string\", types)).toBe(false);\n });\n });\n\n describe(\"load\", () => {\n it(\"fans out one CAL call per distinct programId in parallel\", async () => {\n const loader = makeLoader();\n const spy = vi\n .spyOn(dataSource, \"getInstructionInfo\")\n .mockImplementation(async ({ programId }) => {\n if (programId === SYSTEM_PROGRAM) return Right(makeSystemResult());\n if (programId === JUPITER_PROGRAM) return Right(makeJupiterResult());\n return Left(new Error(\"unknown program\"));\n });\n\n const result = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" },\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" }, // dup\n { programId: JUPITER_PROGRAM, discriminator: \"e517cb977ae3ad2a\" },\n ],\n network: \"solana-mainnet\",\n });\n\n expect(spy).toHaveBeenCalledTimes(2);\n expect(spy).toHaveBeenCalledWith({\n programId: SYSTEM_PROGRAM,\n network: \"solana-mainnet\",\n });\n expect(spy).toHaveBeenCalledWith({\n programId: JUPITER_PROGRAM,\n network: \"solana-mainnet\",\n });\n\n expect(\n result.every(\n (c) =>\n c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO ||\n c.type === ClearSignContextType.ERROR,\n ),\n ).toBe(true);\n expect(\n result.filter(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n ),\n ).toHaveLength(2);\n });\n\n it(\"emits one SOLANA_INSTRUCTION_INFO per matching (programId, discriminator), passing the decoded payload through with the certificate\", async () => {\n const loader = makeLoader();\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeSystemResult()),\n );\n\n const result = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" },\n ],\n });\n\n const infoCtx = result.find(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n );\n expect(infoCtx).toBeDefined();\n expect(infoCtx).toMatchObject({\n type: ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n certificate: mockCertificate,\n });\n // The loader does not transform \u2014 it forwards the data source's payload.\n expect((infoCtx as any).payload).toEqual(makeSystemPayload());\n });\n\n it(\"filters descriptors by requested discriminator\", async () => {\n const loader = makeLoader();\n const result: InstructionInfoResult = {\n programId: SYSTEM_PROGRAM,\n descriptors: {\n \"00000000\": Right(makeSystemPayload()),\n \"00000001\": Right({\n ...makeSystemPayload(),\n discriminator: \"00000001\",\n instructionInfo: { data: \"0001other\", signature: \"p\" },\n }),\n },\n enumVariants: [],\n };\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(result),\n );\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" },\n ],\n });\n\n const infos = out.filter(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n );\n expect(infos).toHaveLength(1);\n expect((infos[0] as any).payload.discriminator).toBe(\"00000000\");\n });\n\n it(\"emits an ERROR context for a descriptor the data source could not decode\", async () => {\n const loader = makeLoader();\n const result: InstructionInfoResult = {\n programId: SYSTEM_PROGRAM,\n descriptors: {\n \"00000000\": Left(new Error(\"missing 'test' signature\")),\n },\n enumVariants: [],\n };\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(result),\n );\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" },\n ],\n });\n\n expect(out).toHaveLength(1);\n expect(out[0]?.type).toBe(ClearSignContextType.ERROR);\n expect((out[0] as any).error.message).toMatch(/missing 'test' signature/);\n });\n\n it(\"emits one ERROR context when CAL fails for a program but keeps processing the others\", async () => {\n const loader = makeLoader();\n vi.spyOn(dataSource, \"getInstructionInfo\").mockImplementation(\n async ({ programId }) => {\n if (programId === SYSTEM_PROGRAM) return Right(makeSystemResult());\n return Left(new Error(\"upstream-500\"));\n },\n );\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM, discriminator: \"00000000\" },\n { programId: JUPITER_PROGRAM, discriminator: \"e517cb977ae3ad2a\" },\n ],\n });\n\n const errors = out.filter((c) => c.type === ClearSignContextType.ERROR);\n const infos = out.filter(\n (c) => c.type === ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n );\n expect(errors).toHaveLength(1);\n expect(infos).toHaveLength(1);\n });\n\n it(\"degrades every program to ERROR when certificate loading fails\", async () => {\n vi.spyOn(certificateLoader, \"loadCertificate\").mockRejectedValue(\n new Error(\"pki-down\"),\n );\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeSystemResult()),\n );\n const loader = makeLoader();\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM },\n { programId: JUPITER_PROGRAM },\n ],\n });\n\n expect(out).toHaveLength(2);\n expect(out.every((c) => c.type === ClearSignContextType.ERROR)).toBe(\n true,\n );\n });\n\n it(\"degrades every program to ERROR when the certificate resolves undefined\", async () => {\n vi.spyOn(certificateLoader, \"loadCertificate\").mockResolvedValue(\n undefined,\n );\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeSystemResult()),\n );\n const loader = makeLoader();\n\n const out = await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [\n { programId: SYSTEM_PROGRAM },\n { programId: JUPITER_PROGRAM },\n ],\n });\n\n expect(out).toHaveLength(2);\n expect(out.every((c) => c.type === ClearSignContextType.ERROR)).toBe(\n true,\n );\n expect((out[0] as any).error.message).toMatch(/certificate is missing/);\n });\n\n it(\"falls back to default network when input.network is omitted or empty string\", async () => {\n const loader = makeLoader();\n const spy = vi\n .spyOn(dataSource, \"getInstructionInfo\")\n .mockResolvedValue(Right(makeSystemResult()));\n\n await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [{ programId: SYSTEM_PROGRAM }],\n });\n expect(spy).toHaveBeenLastCalledWith({\n programId: SYSTEM_PROGRAM,\n network: \"solana-mainnet\",\n });\n\n await loader.load({\n deviceModelId: DeviceModelId.NANO_X,\n instructions: [{ programId: SYSTEM_PROGRAM }],\n network: \"\",\n });\n expect(spy).toHaveBeenLastCalledWith({\n programId: SYSTEM_PROGRAM,\n network: \"solana-mainnet\",\n });\n });\n });\n});\n"],
|
|
5
|
+
"mappings": "AAEA,OAAS,iBAAAA,MAAqB,kCAC9B,OAAS,QAAAC,EAAM,SAAAC,MAAa,YAC5B,OAAS,cAAAC,EAAY,YAAAC,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C,EAAG,MAAMY,EAAmB,iBAAiB,EAAE,kBAC7C,MACF,EACAZ,EAAG,MAAMW,EAAY,oBAAoB,EAAE,kBACzChB,EAAMa,EAAiB,CAAC,CAC1B,EAGA,MAAMc,EAAM,MAFGT,EAAW,EAED,KAAK,CAC5B,cAAepB,EAAc,OAC7B,aAAc,CACZ,CAAE,UAAWY,CAAe,EAC5B,CAAE,UAAWC,CAAgB,CAC/B,CACF,CAAC,EAEDR,EAAOwB,CAAG,EAAE,aAAa,CAAC,EAC1BxB,EAAOwB,EAAI,MAAOH,GAAMA,EAAE,OAASlB,EAAqB,KAAK,CAAC,EAAE,KAC9D,EACF,EACAH,EAAQwB,EAAI,CAAC,EAAU,MAAM,OAAO,EAAE,QAAQ,wBAAwB,CACxE,CAAC,EAEDvB,EAAG,8EAA+E,SAAY,CAC5F,MAAMe,EAASD,EAAW,EACpBG,EAAMhB,EACT,MAAMW,EAAY,oBAAoB,EACtC,kBAAkBhB,EAAMa,EAAiB,CAAC,CAAC,EAE9C,MAAMM,EAAO,KAAK,CAChB,cAAerB,EAAc,OAC7B,aAAc,CAAC,CAAE,UAAWY,CAAe,CAAC,CAC9C,CAAC,EACDP,EAAOkB,CAAG,EAAE,yBAAyB,CACnC,UAAWX,EACX,QAAS,gBACX,CAAC,EAED,MAAMS,EAAO,KAAK,CAChB,cAAerB,EAAc,OAC7B,aAAc,CAAC,CAAE,UAAWY,CAAe,CAAC,EAC5C,QAAS,EACX,CAAC,EACDP,EAAOkB,CAAG,EAAE,yBAAyB,CACnC,UAAWX,EACX,QAAS,gBACX,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
|
+
"names": ["DeviceModelId", "Left", "Right", "beforeEach", "describe", "expect", "it", "vi", "ClearSignContextType", "InstructionInfoContextLoader", "mockLoggerFactory", "mockCertificate", "SYSTEM_PROGRAM", "JUPITER_PROGRAM", "makeSystemPayload", "makeSystemResult", "makeJupiterPayload", "makeJupiterResult", "dataSource", "certificateLoader", "makeLoader", "loader", "types", "spy", "programId", "result", "c", "infoCtx", "infos", "out", "errors"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ClearSignContextType as a}from"../../../shared/model/ClearSignContext";import{SolanaInstructionSubstructureKind as r}from"../../../modules/solana/model/SolanaPayloads";const
|
|
1
|
+
import{ClearSignContextType as a}from"../../../shared/model/ClearSignContext";import{SolanaInstructionSubstructureKind as r}from"../../../modules/solana/model/SolanaPayloads";const o={TOKEN:a.SOLANA_TOKEN,LIFI:a.SOLANA_LIFI,TRUSTED_NAME:a.SOLANA_TRUSTED_NAME,TRANSACTION_CHECK:a.SOLANA_TRANSACTION_CHECK,INSTRUCTION_INFO:a.SOLANA_INSTRUCTION_INFO,ENUM_VARIANT:a.SOLANA_ENUM_VARIANT,TOKEN_INFO:a.SOLANA_TOKEN_INFO,TOKEN_ACCOUNT_STATE:a.SOLANA_TOKEN_ACCOUNT_STATE,ALT_RESOLUTION:a.SOLANA_ALT_RESOLUTION},e=new Set(Object.values(o));function l(t){return e.has(t.type)}export{e as SOLANA_CLEAR_SIGN_CONTEXT_SUCCESS_TYPES,o as SolanaContextType,r as SolanaInstructionSubstructureKind,l as isSolanaContextSuccess};
|
|
2
2
|
//# sourceMappingURL=SolanaClearSignContext.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/solana/model/SolanaClearSignContext.ts"],
|
|
4
|
-
"sourcesContent": ["import { type PkiCertificate } from \"@/modules/multichain/pki/model/PkiCertificate\";\nimport {\n type SolanaAltResolutionPayload,\n type SolanaEnumVariantPayload,\n type SolanaInstructionInfoPayload,\n type SolanaLifiPayload,\n type SolanaTokenAccountStatePayload,\n type SolanaTokenData,\n type SolanaTokenInfoPayload,\n type SolanaTransactionCheckPayload,\n} from \"@/modules/solana/model/SolanaPayloads\";\nimport {\n type ClearSignContext,\n type ClearSignContextSuccess,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\n\n// Re-export Solana payload types so consumers can import from this file\nexport type {\n SolanaAltResolutionPayload,\n SolanaEnumVariantPayload,\n SolanaInstructionEnumVariant,\n SolanaInstructionInfoPayload,\n SolanaInstructionSubstructure,\n SolanaLifiInstructionMeta,\n SolanaLifiPayload,\n SolanaSignedDescriptor,\n SolanaTokenAccountStatePayload,\n SolanaTokenData,\n SolanaTokenInfoPayload,\n SolanaTransactionCheckPayload,\n SolanaTransactionDescriptor,\n} from \"@/modules/solana/model/SolanaPayloads\";\nexport { SolanaInstructionSubstructureKind } from \"@/modules/solana/model/SolanaPayloads\";\n\n/**\n * Solana-specific payload overrides \u2014 contributed to the shared\n * ClearSignContextSuccessPayloads map at the integration boundary.\n */\nexport type SolanaPayloadOverrides = {\n [ClearSignContextType.SOLANA_TOKEN]: {\n payload: SolanaTokenData;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_LIFI]: {\n payload: SolanaLifiPayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_TRUSTED_NAME]: {\n payload: Uint8Array;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_TRANSACTION_CHECK]: {\n payload: SolanaTransactionCheckPayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_INSTRUCTION_INFO]: {\n payload: SolanaInstructionInfoPayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_ENUM_VARIANT]: {\n payload: SolanaEnumVariantPayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_TOKEN_INFO]: {\n payload: SolanaTokenInfoPayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_TOKEN_ACCOUNT_STATE]: {\n payload: SolanaTokenAccountStatePayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_ALT_RESOLUTION]: {\n payload: SolanaAltResolutionPayload;\n certificate?: PkiCertificate;\n };\n};\n\nexport const SolanaContextType = {\n TOKEN: ClearSignContextType.SOLANA_TOKEN,\n LIFI: ClearSignContextType.SOLANA_LIFI,\n TRUSTED_NAME: ClearSignContextType.SOLANA_TRUSTED_NAME,\n TRANSACTION_CHECK: ClearSignContextType.SOLANA_TRANSACTION_CHECK,\n INSTRUCTION_INFO: ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n ENUM_VARIANT: ClearSignContextType.SOLANA_ENUM_VARIANT,\n TOKEN_INFO: ClearSignContextType.SOLANA_TOKEN_INFO,\n TOKEN_ACCOUNT_STATE: ClearSignContextType.SOLANA_TOKEN_ACCOUNT_STATE,\n ALT_RESOLUTION: ClearSignContextType.SOLANA_ALT_RESOLUTION,\n} as const;\n\n/**\n * Union of all Solana-relevant success context types.\n */\nexport type SolanaClearSignContextSuccessType =\n (typeof SolanaContextType)[keyof typeof SolanaContextType];\n\n/**\n * A ClearSignContextSuccess narrowed to only Solana-relevant types.\n */\nexport type SolanaClearSignContextSuccess =\n ClearSignContextSuccess<SolanaClearSignContextSuccessType>;\n\n/**\n * Set of all Solana-relevant success ClearSignContextType values.\n * Used by the type guard below to filter out non-Solana contexts at runtime.\n */\nexport const SOLANA_CLEAR_SIGN_CONTEXT_SUCCESS_TYPES =\n new Set<ClearSignContextType>(Object.values(SolanaContextType));\n\n/**\n * Type guard that narrows a ClearSignContextSuccess to a\n * SolanaClearSignContextSuccess, filtering out non-Solana types.\n */\nexport function isSolanaContextSuccess(\n ctx: ClearSignContext,\n): ctx is SolanaClearSignContextSuccess {\n return SOLANA_CLEAR_SIGN_CONTEXT_SUCCESS_TYPES.has(ctx.type);\n}\n"],
|
|
5
|
-
"mappings": "AAWA,OAGE,wBAAAA,MACK,
|
|
4
|
+
"sourcesContent": ["import { type PkiCertificate } from \"@/modules/multichain/pki/model/PkiCertificate\";\nimport {\n type SolanaAltResolutionPayload,\n type SolanaEnumVariantPayload,\n type SolanaInstructionInfoPayload,\n type SolanaLifiPayload,\n type SolanaTokenAccountStatePayload,\n type SolanaTokenData,\n type SolanaTokenInfoPayload,\n type SolanaTransactionCheckPayload,\n} from \"@/modules/solana/model/SolanaPayloads\";\nimport {\n type ClearSignContext,\n type ClearSignContextSuccess,\n ClearSignContextType,\n} from \"@/shared/model/ClearSignContext\";\n\n// Re-export Solana payload types so consumers can import from this file\nexport type {\n SolanaAltResolutionPayload,\n SolanaCalAccountReset,\n SolanaCalDisplayField,\n SolanaCalMintAssociation,\n SolanaCalTokenValue,\n SolanaCalTypePoolEntry,\n SolanaCalValue,\n SolanaCalValueFlowPort,\n SolanaEnumVariantPayload,\n SolanaInstructionEnumVariant,\n SolanaInstructionInfoPayload,\n SolanaInstructionSubstructure,\n SolanaLifiInstructionMeta,\n SolanaLifiPayload,\n SolanaSignedDescriptor,\n SolanaTokenAccountStatePayload,\n SolanaTokenData,\n SolanaTokenInfoPayload,\n SolanaTransactionCheckPayload,\n SolanaTransactionDescriptor,\n} from \"@/modules/solana/model/SolanaPayloads\";\nexport { SolanaInstructionSubstructureKind } from \"@/modules/solana/model/SolanaPayloads\";\n\n/**\n * Solana-specific payload overrides \u2014 contributed to the shared\n * ClearSignContextSuccessPayloads map at the integration boundary.\n */\nexport type SolanaPayloadOverrides = {\n [ClearSignContextType.SOLANA_TOKEN]: {\n payload: SolanaTokenData;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_LIFI]: {\n payload: SolanaLifiPayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_TRUSTED_NAME]: {\n payload: Uint8Array;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_TRANSACTION_CHECK]: {\n payload: SolanaTransactionCheckPayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_INSTRUCTION_INFO]: {\n payload: SolanaInstructionInfoPayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_ENUM_VARIANT]: {\n payload: SolanaEnumVariantPayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_TOKEN_INFO]: {\n payload: SolanaTokenInfoPayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_TOKEN_ACCOUNT_STATE]: {\n payload: SolanaTokenAccountStatePayload;\n certificate?: PkiCertificate;\n };\n [ClearSignContextType.SOLANA_ALT_RESOLUTION]: {\n payload: SolanaAltResolutionPayload;\n certificate?: PkiCertificate;\n };\n};\n\nexport const SolanaContextType = {\n TOKEN: ClearSignContextType.SOLANA_TOKEN,\n LIFI: ClearSignContextType.SOLANA_LIFI,\n TRUSTED_NAME: ClearSignContextType.SOLANA_TRUSTED_NAME,\n TRANSACTION_CHECK: ClearSignContextType.SOLANA_TRANSACTION_CHECK,\n INSTRUCTION_INFO: ClearSignContextType.SOLANA_INSTRUCTION_INFO,\n ENUM_VARIANT: ClearSignContextType.SOLANA_ENUM_VARIANT,\n TOKEN_INFO: ClearSignContextType.SOLANA_TOKEN_INFO,\n TOKEN_ACCOUNT_STATE: ClearSignContextType.SOLANA_TOKEN_ACCOUNT_STATE,\n ALT_RESOLUTION: ClearSignContextType.SOLANA_ALT_RESOLUTION,\n} as const;\n\n/**\n * Union of all Solana-relevant success context types.\n */\nexport type SolanaClearSignContextSuccessType =\n (typeof SolanaContextType)[keyof typeof SolanaContextType];\n\n/**\n * A ClearSignContextSuccess narrowed to only Solana-relevant types.\n */\nexport type SolanaClearSignContextSuccess =\n ClearSignContextSuccess<SolanaClearSignContextSuccessType>;\n\n/**\n * Set of all Solana-relevant success ClearSignContextType values.\n * Used by the type guard below to filter out non-Solana contexts at runtime.\n */\nexport const SOLANA_CLEAR_SIGN_CONTEXT_SUCCESS_TYPES =\n new Set<ClearSignContextType>(Object.values(SolanaContextType));\n\n/**\n * Type guard that narrows a ClearSignContextSuccess to a\n * SolanaClearSignContextSuccess, filtering out non-Solana types.\n */\nexport function isSolanaContextSuccess(\n ctx: ClearSignContext,\n): ctx is SolanaClearSignContextSuccess {\n return SOLANA_CLEAR_SIGN_CONTEXT_SUCCESS_TYPES.has(ctx.type);\n}\n"],
|
|
5
|
+
"mappings": "AAWA,OAGE,wBAAAA,MACK,kCAyBP,OAAS,qCAAAC,MAAyC,wCA6C3C,MAAMC,EAAoB,CAC/B,MAAOF,EAAqB,aAC5B,KAAMA,EAAqB,YAC3B,aAAcA,EAAqB,oBACnC,kBAAmBA,EAAqB,yBACxC,iBAAkBA,EAAqB,wBACvC,aAAcA,EAAqB,oBACnC,WAAYA,EAAqB,kBACjC,oBAAqBA,EAAqB,2BAC1C,eAAgBA,EAAqB,qBACvC,EAkBaG,EACX,IAAI,IAA0B,OAAO,OAAOD,CAAiB,CAAC,EAMzD,SAASE,EACdC,EACsC,CACtC,OAAOF,EAAwC,IAAIE,EAAI,IAAI,CAC7D",
|
|
6
6
|
"names": ["ClearSignContextType", "SolanaInstructionSubstructureKind", "SolanaContextType", "SOLANA_CLEAR_SIGN_CONTEXT_SUCCESS_TYPES", "isSolanaContextSuccess", "ctx"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
var
|
|
1
|
+
var n=(a=>(a[a.DISPLAY_FIELD=0]="DISPLAY_FIELD",a[a.VALUE_FLOW_PORT=1]="VALUE_FLOW_PORT",a[a.HIDE_RULE=2]="HIDE_RULE",a[a.ACCOUNT_RESET=3]="ACCOUNT_RESET",a))(n||{});export{n as SolanaInstructionSubstructureKind};
|
|
2
2
|
//# sourceMappingURL=SolanaPayloads.js.map
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../../src/modules/solana/model/SolanaPayloads.ts"],
|
|
4
|
-
"sourcesContent": ["// Solana payload types \u2014 used both by Solana loaders and (type-only)\n// referenced by the shared ClearSignContext union for typed-payload variants.\n\nexport type SolanaTokenData = {\n solanaTokenDescriptor: {\n data: string;\n signature: string;\n };\n};\n\nexport type SolanaTransactionDescriptor = {\n data: string;\n descriptorType: string;\n descriptorVersion: string;\n signature: string;\n};\n\nexport type SolanaLifiInstructionMeta = {\n program_id: string;\n discriminator_hex?: string;\n};\n\nexport type SolanaLifiPayload = {\n descriptors: Record<string, SolanaTransactionDescriptor>;\n instructions: SolanaLifiInstructionMeta[];\n};\n\nexport type SolanaTransactionCheckPayload = {\n descriptor: string;\n};\n\n// --- Generic clear-signing payloads ---\n\n// CAL static descriptor payloads. `data` is the signed TLV (hex string);\n// `signature` is the resolved signature for the configured CAL signature\n// kind (`prod` | `test`).\n\nexport type SolanaSignedDescriptor = {\n data: string;\n signature: string;\n};\n\n/**\n * One enum-variant descriptor bundled with an instruction descriptor by CAL.\n * The signed TLV (`descriptor.data`) feeds the host-side type-pool decode\n * cache, `enumId`/`variantIndex` identify which variant it describes (and let\n * the host stream the selected variant's signed descriptor to the device).\n */\nexport type SolanaInstructionEnumVariant = {\n enumId: string;\n variantIndex: number;\n descriptor: SolanaSignedDescriptor;\n};\n\n/**\n * Payload for ClearSignContextType.SOLANA_INSTRUCTION_INFO
|
|
5
|
-
"mappings": "
|
|
4
|
+
"sourcesContent": ["// Solana payload types \u2014 used both by Solana loaders and (type-only)\n// referenced by the shared ClearSignContext union for typed-payload variants.\n\nexport type SolanaTokenData = {\n solanaTokenDescriptor: {\n data: string;\n signature: string;\n };\n};\n\nexport type SolanaTransactionDescriptor = {\n data: string;\n descriptorType: string;\n descriptorVersion: string;\n signature: string;\n};\n\nexport type SolanaLifiInstructionMeta = {\n program_id: string;\n discriminator_hex?: string;\n};\n\nexport type SolanaLifiPayload = {\n descriptors: Record<string, SolanaTransactionDescriptor>;\n instructions: SolanaLifiInstructionMeta[];\n};\n\nexport type SolanaTransactionCheckPayload = {\n descriptor: string;\n};\n\n// --- Generic clear-signing payloads ---\n\n// CAL static descriptor payloads. `data` is the signed TLV (hex string);\n// `signature` is the resolved signature for the configured CAL signature\n// kind (`prod` | `test`).\n\nexport type SolanaSignedDescriptor = {\n data: string;\n signature: string;\n};\n\n/**\n * One enum-variant descriptor bundled with an instruction descriptor by CAL.\n * The signed TLV (`descriptor.data`) feeds the host-side type-pool decode\n * cache, `enumId`/`variantIndex` identify which variant it describes (and let\n * the host stream the selected variant's signed descriptor to the device).\n */\nexport type SolanaInstructionEnumVariant = {\n enumId: string;\n variantIndex: number;\n descriptor: SolanaSignedDescriptor;\n};\n\n/**\n * Payload for ClearSignContextType.SOLANA_INSTRUCTION_INFO.\n *\n * `instructionInfo` + `substructures` are the signed TLVs streamed to the\n * device, and `enumVariants` are the signed enum-variant descriptors CAL\n * bundles for the program's enums (used to build the host decode cache). The\n * remaining fields are CAL's decoded JSON consumed host-side by the\n * requirement builder.\n */\nexport type SolanaInstructionInfoPayload = {\n programId: string;\n discriminator: string;\n instructionInfo: SolanaSignedDescriptor;\n substructures: SolanaInstructionSubstructure[];\n enumVariants: SolanaInstructionEnumVariant[];\n idlDescriptor: {\n typePool: SolanaCalTypePoolEntry[];\n rootType: number;\n };\n mintAssociations: SolanaCalMintAssociation[];\n valueFlowPorts: SolanaCalValueFlowPort[];\n accountResets: SolanaCalAccountReset[];\n displayFields: SolanaCalDisplayField[];\n};\n\nexport enum SolanaInstructionSubstructureKind {\n DISPLAY_FIELD = 0x00,\n VALUE_FLOW_PORT = 0x01,\n HIDE_RULE = 0x02,\n ACCOUNT_RESET = 0x03,\n}\n\nexport type SolanaInstructionSubstructure = {\n kind: SolanaInstructionSubstructureKind;\n // TLV payload (hex string) for the substructure.\n data: string;\n};\n\n// --- Decoded CAL JSON (snake_case mirrors the CAL response) ---\n\nexport type SolanaCalValue = {\n source: string;\n /** ACCOUNT_PATH: index into the instruction's accounts. */\n account_index?: number;\n /** CONSTANT: hex-encoded bytes. */\n data?: string;\n /** ARGUMENT_PATH: decoded steps. */\n path?: { steps: number[] };\n};\n\nexport type SolanaCalTokenValue = {\n kind: string;\n value?: SolanaCalValue;\n account_index?: number;\n};\n\nexport type SolanaCalValueFlowPort = {\n /** Ordered candidate list (spec form). */\n account_indices?: number[];\n /** Single-account form currently emitted by CAL; treated as a 1-element list. */\n account_index?: number;\n optional_account_strategy?: string;\n token_value?: SolanaCalTokenValue;\n};\n\nexport type SolanaCalAccountReset = {\n account_index: number;\n require_pre_balance_zero?: boolean;\n};\n\nexport type SolanaCalDisplayField = {\n name?: string;\n param: { type: string; value?: SolanaCalValue; token?: SolanaCalValue };\n};\n\nexport type SolanaCalTypePoolEntry = {\n index: number;\n kind: string;\n refs?: number[];\n size?: number;\n encoding?: number;\n len_kind?: string;\n flag_kind?: string;\n sentinel?: string;\n disc_kind?: string;\n total_variants?: number;\n enum_id?: string;\n};\n\nexport type SolanaCalMintAssociation = {\n account_index: number;\n mint_index: number;\n};\n\n/**\n * Payload for ClearSignContextType.SOLANA_ENUM_VARIANT: one signed\n * ENUM_VARIANT descriptor for a `(programId, enumId, variantIndex)` triple.\n */\nexport type SolanaEnumVariantPayload = {\n programId: string;\n enumId: string;\n variantIndex: number;\n descriptor: SolanaSignedDescriptor;\n};\n\n/**\n * Payload for ClearSignContextType.SOLANA_TOKEN_INFO, keyed by mint pubkey.\n * Distinct from the legacy SOLANA_TOKEN context.\n */\nexport type SolanaTokenInfoPayload = {\n mint: string;\n descriptor: SolanaSignedDescriptor;\n};\n\n// --- Dynamic descriptor payloads (challenge-bound) ---\n//\n// Each payload carries the raw signed TLV bytes decoded from the backend's\n// hex `signedDescriptor`.\n\nexport type SolanaTokenAccountStatePayload = {\n descriptor: Uint8Array;\n};\n\nexport type SolanaAltResolutionPayload = {\n descriptor: Uint8Array;\n};\n\n// SOLANA_TRUSTED_NAME already exists with `payload: Uint8Array`, emitted by\n// both OwnerInfoContextLoader and SolanaTrustedNameContextLoader.\n"],
|
|
5
|
+
"mappings": "AA+EO,IAAKA,OACVA,IAAA,cAAgB,GAAhB,gBACAA,IAAA,gBAAkB,GAAlB,kBACAA,IAAA,UAAY,GAAZ,YACAA,IAAA,cAAgB,GAAhB,gBAJUA,OAAA",
|
|
6
6
|
"names": ["SolanaInstructionSubstructureKind"]
|
|
7
7
|
}
|
|
@@ -35,10 +35,10 @@ export declare class EnumVariantContextLoader implements ContextLoader<SolanaEnu
|
|
|
35
35
|
canHandle(input: unknown, expectedTypes: ClearSignContextType[]): input is SolanaEnumVariantContextInput;
|
|
36
36
|
load(input: SolanaEnumVariantContextInput): Promise<ClearSignContext[]>;
|
|
37
37
|
/**
|
|
38
|
-
* Find the
|
|
39
|
-
* `enum_variants`
|
|
40
|
-
*
|
|
41
|
-
*
|
|
38
|
+
* Find the decoded enum variant for a selection. The data source flattens
|
|
39
|
+
* `enum_variants` across all of the program's descriptors into a single list
|
|
40
|
+
* (malformed `u16` keys already dropped), and CAL guarantees `(enumId,
|
|
41
|
+
* variantIndex)` is unique across a program's instructions.
|
|
42
42
|
*/
|
|
43
43
|
private lookupVariant;
|
|
44
44
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EnumVariantContextLoader.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/enum-variant/domain/EnumVariantContextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAKzC,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAErF,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAGjG,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,kEAAkE,CAAC;
|
|
1
|
+
{"version":3,"file":"EnumVariantContextLoader.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/enum-variant/domain/EnumVariantContextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAKzC,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAErF,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAGjG,OAAO,EACL,KAAK,yBAAyB,EAE/B,MAAM,kEAAkE,CAAC;AAM1E,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EACL,KAAK,gBAAgB,EACrB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAWzC;;;GAGG;AACH,MAAM,MAAM,0BAA0B,GAAG;IACvC,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,aAAa,EAAE,aAAa,CAAC;IAC7B,UAAU,EAAE,0BAA0B,EAAE,CAAC;IACzC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAcF;;;;;;;GAOG;AACH,qBACa,wBACX,YAAW,aAAa,CAAC,6BAA6B,CAAC;IAMrD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAE3B,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IARpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;gBAI7B,UAAU,EAAE,yBAAyB,EAErC,MAAM,EAAE,0BAA0B,EAElC,iBAAiB,EAAE,oBAAoB,EAExD,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,sBAAsB;IAKjD,SAAS,CACd,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,oBAAoB,EAAE,GACpC,KAAK,IAAI,6BAA6B;IAU5B,IAAI,CACf,KAAK,EAAE,6BAA6B,GACnC,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAkI9B;;;;;OAKG;IACH,OAAO,CAAC,aAAa;CAUtB"}
|
package/lib/types/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpInstructionInfoDataSource.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAEL,MAAM,EAMP,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGrF,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"HttpInstructionInfoDataSource.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,iCAAiC,CAAC;AAEnE,OAAO,EAEL,MAAM,EAMP,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,KAAK,0BAA0B,EAAE,MAAM,oCAAoC,CAAC;AAGrF,OAAO,EACL,wBAAwB,EACxB,yBAAyB,EACzB,qBAAqB,EACtB,MAAM,6BAA6B,CAAC;AAiBrC,qBACa,6BACX,YAAW,yBAAyB;IAIlC,OAAO,CAAC,QAAQ,CAAC,MAAM;IAEvB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBAFJ,MAAM,EAAE,0BAA0B,EAElC,IAAI,EAAE,gBAAgB;IAG5B,kBAAkB,CAAC,EAC9B,SAAS,EACT,OAAO,GACR,EAAE,wBAAwB,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC;CA4F5E"}
|
|
@@ -1,16 +1,25 @@
|
|
|
1
1
|
import { type Either } from "purify-ts";
|
|
2
|
-
import { type
|
|
2
|
+
import { type SolanaInstructionEnumVariant, type SolanaInstructionInfoPayload } from "../../../../modules/solana/model/SolanaPayloads";
|
|
3
3
|
export type GetInstructionInfoParams = {
|
|
4
4
|
programId: string;
|
|
5
5
|
network: string;
|
|
6
6
|
};
|
|
7
7
|
/**
|
|
8
|
-
* Result of one CAL call for a single `programId
|
|
9
|
-
*
|
|
8
|
+
* Result of one CAL call for a single `programId`, fully transformed into core
|
|
9
|
+
* models so consumers never see the CAL DTO shapes.
|
|
10
|
+
*
|
|
11
|
+
* - `descriptors` is indexed by discriminator hex (multiple entries when a
|
|
12
|
+
* program defines several instructions). Each is the decoded
|
|
13
|
+
* {@link SolanaInstructionInfoPayload}, or a `Left` when that descriptor could
|
|
14
|
+
* not be decoded (e.g. no signature for the configured CAL mode) so the
|
|
15
|
+
* consumer can surface a per-descriptor error.
|
|
16
|
+
* - `enumVariants` is the program-wide flat list of decoded enum variants,
|
|
17
|
+
* resolved independently of per-descriptor signature validity.
|
|
10
18
|
*/
|
|
11
19
|
export type InstructionInfoResult = {
|
|
12
20
|
programId: string;
|
|
13
|
-
descriptors: Record<string,
|
|
21
|
+
descriptors: Record<string, Either<Error, SolanaInstructionInfoPayload>>;
|
|
22
|
+
enumVariants: SolanaInstructionEnumVariant[];
|
|
14
23
|
};
|
|
15
24
|
export interface InstructionInfoDataSource {
|
|
16
25
|
/**
|
package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoDataSource.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstructionInfoDataSource.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/data/InstructionInfoDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,
|
|
1
|
+
{"version":3,"file":"InstructionInfoDataSource.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/data/InstructionInfoDataSource.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,MAAM,EAAE,MAAM,WAAW,CAAC;AAExC,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EAClC,MAAM,uCAAuC,CAAC;AAE/C,MAAM,MAAM,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,EAAE,4BAA4B,CAAC,CAAC,CAAC;IACzE,YAAY,EAAE,4BAA4B,EAAE,CAAC;CAC9C,CAAC;AAEF,MAAM,WAAW,yBAAyB;IACxC;;;;OAIG;IACH,kBAAkB,CAChB,MAAM,EAAE,wBAAwB,GAC/B,OAAO,CAAC,MAAM,CAAC,KAAK,EAAE,qBAAqB,CAAC,CAAC,CAAC;CAClD"}
|
|
@@ -7,6 +7,36 @@ export type CalSignedDescriptorDto = {
|
|
|
7
7
|
data: string;
|
|
8
8
|
signatures: CalSignatures;
|
|
9
9
|
};
|
|
10
|
+
export type CalValueDto = {
|
|
11
|
+
source: string;
|
|
12
|
+
account_index?: number;
|
|
13
|
+
data?: string;
|
|
14
|
+
path?: {
|
|
15
|
+
steps: number[];
|
|
16
|
+
};
|
|
17
|
+
};
|
|
18
|
+
export type CalTokenValueDto = {
|
|
19
|
+
kind: string;
|
|
20
|
+
value?: CalValueDto;
|
|
21
|
+
account_index?: number;
|
|
22
|
+
};
|
|
23
|
+
export type CalMintAssociationDto = {
|
|
24
|
+
account_index: number;
|
|
25
|
+
mint_index: number;
|
|
26
|
+
};
|
|
27
|
+
export type CalTypePoolEntryDto = {
|
|
28
|
+
index: number;
|
|
29
|
+
kind: string;
|
|
30
|
+
refs?: number[];
|
|
31
|
+
size?: number;
|
|
32
|
+
encoding?: number;
|
|
33
|
+
len_kind?: string;
|
|
34
|
+
flag_kind?: string;
|
|
35
|
+
sentinel?: string;
|
|
36
|
+
disc_kind?: string;
|
|
37
|
+
total_variants?: number;
|
|
38
|
+
enum_id?: string;
|
|
39
|
+
};
|
|
10
40
|
export type CalInstructionInfoDto = {
|
|
11
41
|
version: number;
|
|
12
42
|
program_id: string;
|
|
@@ -16,10 +46,10 @@ export type CalInstructionInfoDto = {
|
|
|
16
46
|
program_name?: string;
|
|
17
47
|
descriptor: CalSignedDescriptorDto;
|
|
18
48
|
idl_descriptor?: {
|
|
19
|
-
type_pool?:
|
|
49
|
+
type_pool?: CalTypePoolEntryDto[];
|
|
20
50
|
root_type?: number;
|
|
21
51
|
};
|
|
22
|
-
mint_association?:
|
|
52
|
+
mint_association?: CalMintAssociationDto;
|
|
23
53
|
owner_association?: unknown;
|
|
24
54
|
};
|
|
25
55
|
export type CalEnumVariantDto = {
|
|
@@ -28,9 +58,28 @@ export type CalEnumVariantDto = {
|
|
|
28
58
|
data: string;
|
|
29
59
|
signatures: CalSignatures;
|
|
30
60
|
};
|
|
61
|
+
/** A substructure CAL serves only as opaque TLV (e.g. HIDE_RULE). */
|
|
31
62
|
export type CalSubstructureDto = {
|
|
32
63
|
descriptor: string;
|
|
33
64
|
};
|
|
65
|
+
export type CalValueFlowPortDto = CalSubstructureDto & {
|
|
66
|
+
account_indices?: number[];
|
|
67
|
+
account_index?: number;
|
|
68
|
+
optional_account_strategy?: string;
|
|
69
|
+
token_value?: CalTokenValueDto;
|
|
70
|
+
};
|
|
71
|
+
export type CalAccountResetDto = CalSubstructureDto & {
|
|
72
|
+
account_index?: number;
|
|
73
|
+
require_pre_balance_zero?: boolean;
|
|
74
|
+
};
|
|
75
|
+
export type CalDisplayFieldDto = CalSubstructureDto & {
|
|
76
|
+
name?: string;
|
|
77
|
+
param?: {
|
|
78
|
+
type: string;
|
|
79
|
+
value?: CalValueDto;
|
|
80
|
+
token?: CalValueDto;
|
|
81
|
+
};
|
|
82
|
+
};
|
|
34
83
|
export type CalInstructionDescriptorDto = {
|
|
35
84
|
type: string;
|
|
36
85
|
source?: string;
|
|
@@ -38,10 +87,10 @@ export type CalInstructionDescriptorDto = {
|
|
|
38
87
|
version?: string;
|
|
39
88
|
instruction_info: CalInstructionInfoDto;
|
|
40
89
|
enum_variants?: Record<string, Record<string, CalEnumVariantDto>>;
|
|
41
|
-
display_fields?:
|
|
42
|
-
value_flow_ports?:
|
|
90
|
+
display_fields?: CalDisplayFieldDto[];
|
|
91
|
+
value_flow_ports?: CalValueFlowPortDto[];
|
|
43
92
|
hide_rules?: CalSubstructureDto[];
|
|
44
|
-
account_resets?:
|
|
93
|
+
account_resets?: CalAccountResetDto[];
|
|
45
94
|
};
|
|
46
95
|
export type CalInstructionInfoResponseDto = Array<{
|
|
47
96
|
descriptors_instruction: Record<string, Record<string, CalInstructionDescriptorDto>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstructionInfoDto.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/data/InstructionInfoDto.ts"],"names":[],"mappings":"AAQA,OAAO,EAAS,KAAK,EAA4B,MAAM,WAAW,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,aAAa,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,CAAC;IAChB,UAAU,EAAE,MAAM,CAAC;IACnB,aAAa,EAAE,MAAM,CAAC;IACtB,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,UAAU,EAAE,sBAAsB,CAAC;IACnC,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,
|
|
1
|
+
{"version":3,"file":"InstructionInfoDto.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/data/InstructionInfoDto.ts"],"names":[],"mappings":"AAQA,OAAO,EAAS,KAAK,EAA4B,MAAM,WAAW,CAAC;AAEnE,MAAM,MAAM,aAAa,GAAG;I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AAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,qBAAqB,CAAC;IACxC,aAAa,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,iBAAiB,CAAC,CAAC,CAAC;IAClE,cAAc,CAAC,EAAE,kBAAkB,EAAE,CAAC;IACtC,gBAAgB,CAAC,EAAE,mBAAmB,EAAE,CAAC;IACzC,UAAU,CAAC,EAAE,kBAAkB,EAAE,CAAC;IAClC,cAAc,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACvC,CAAC;AAIF,MAAM,MAAM,6BAA6B,GAAG,KAAK,CAAC;IAChD,uBAAuB,EAAE,MAAM,CAC7B,MAAM,EACN,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,CAC5C,CAAC;CACH,CAAC,CAAC;AAsCH;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAG1C,CAAC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { type Either } from "purify-ts";
|
|
2
|
+
import { type SolanaCalAccountReset, type SolanaCalDisplayField, type SolanaCalValueFlowPort, type SolanaInstructionEnumVariant, type SolanaInstructionInfoPayload } from "../../../../modules/solana/model/SolanaPayloads";
|
|
3
|
+
import { type CalAccountResetDto, type CalDisplayFieldDto, type CalInstructionDescriptorDto, type CalValueFlowPortDto } from "./InstructionInfoDto";
|
|
4
|
+
export type CalMode = "prod" | "test";
|
|
5
|
+
export declare function toValueFlowPorts(dtos?: CalValueFlowPortDto[]): SolanaCalValueFlowPort[];
|
|
6
|
+
export declare function toAccountResets(dtos?: CalAccountResetDto[]): SolanaCalAccountReset[];
|
|
7
|
+
export declare function toDisplayFields(dtos?: CalDisplayFieldDto[]): SolanaCalDisplayField[];
|
|
8
|
+
/**
|
|
9
|
+
* Flatten the enum variants of every descriptor in a program into a single
|
|
10
|
+
* list. CAL nests `enum_variants` inside each instruction descriptor but
|
|
11
|
+
* guarantees `(enumId, variantIndex)` is unique across a program, so the enum
|
|
12
|
+
* loader resolves a selection against this program-level list — independently
|
|
13
|
+
* of whether any individual instruction descriptor carried a usable signature.
|
|
14
|
+
*/
|
|
15
|
+
export declare function toProgramEnumVariants(descriptors: Record<string, CalInstructionDescriptorDto>, mode: CalMode): SolanaInstructionEnumVariant[];
|
|
16
|
+
/**
|
|
17
|
+
* Transform one validated CAL descriptor DTO into the core
|
|
18
|
+
* {@link SolanaInstructionInfoPayload}. Returns a `Left` when the descriptor is
|
|
19
|
+
* unusable (no signature for the configured `mode`), so the caller can surface
|
|
20
|
+
* a per-descriptor ERROR rather than emitting an empty signature.
|
|
21
|
+
*/
|
|
22
|
+
export declare function toInstructionInfoPayload(discriminator: string, dto: CalInstructionDescriptorDto, mode: CalMode): Either<Error, SolanaInstructionInfoPayload>;
|
|
23
|
+
//# sourceMappingURL=InstructionInfoMapper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstructionInfoMapper.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/data/InstructionInfoMapper.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,KAAK,MAAM,EAAe,MAAM,WAAW,CAAC;AAErD,OAAO,EACL,KAAK,qBAAqB,EAC1B,KAAK,qBAAqB,EAC1B,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EAGlC,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAEhC,KAAK,mBAAmB,EACzB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,OAAO,GAAG,MAAM,GAAG,MAAM,CAAC;AAatC,wBAAgB,gBAAgB,CAC9B,IAAI,GAAE,mBAAmB,EAAO,GAC/B,sBAAsB,EAAE,CAO1B;AAED,wBAAgB,eAAe,CAC7B,IAAI,GAAE,kBAAkB,EAAO,GAC9B,qBAAqB,EAAE,CAazB;AAED,wBAAgB,eAAe,CAC7B,IAAI,GAAE,kBAAkB,EAAO,GAC9B,qBAAqB,EAAE,CAKzB;AAsDD;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,CAAC,EACxD,IAAI,EAAE,OAAO,GACZ,4BAA4B,EAAE,CAEhC;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,2BAA2B,EAChC,IAAI,EAAE,OAAO,GACZ,MAAM,CAAC,KAAK,EAAE,4BAA4B,CAAC,CA6B7C"}
|
package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"InstructionInfoMapper.test.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/data/InstructionInfoMapper.test.ts"],"names":[],"mappings":""}
|
package/lib/types/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.d.ts
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { type DeviceModelId, type LoggerPublisherService } from "@ledgerhq/device-management-kit";
|
|
2
|
-
import { type ContextModuleServiceConfig } from "../../../../config/model/ContextModuleConfig";
|
|
3
2
|
import { type PkiCertificateLoader } from "../../../../modules/multichain/pki/domain/PkiCertificateLoader";
|
|
4
3
|
import { type InstructionInfoDataSource } from "../../../../modules/solana/instruction-info/data/InstructionInfoDataSource";
|
|
5
4
|
import { type ContextLoader } from "../../../../shared/domain/ContextLoader";
|
|
@@ -25,10 +24,9 @@ export type SolanaInstructionInfoContextInput = {
|
|
|
25
24
|
*/
|
|
26
25
|
export declare class InstructionInfoContextLoader implements ContextLoader<SolanaInstructionInfoContextInput> {
|
|
27
26
|
private readonly dataSource;
|
|
28
|
-
private readonly config;
|
|
29
27
|
private readonly certificateLoader;
|
|
30
28
|
private readonly logger;
|
|
31
|
-
constructor(dataSource: InstructionInfoDataSource,
|
|
29
|
+
constructor(dataSource: InstructionInfoDataSource, certificateLoader: PkiCertificateLoader, loggerFactory: (tag: string) => LoggerPublisherService);
|
|
32
30
|
canHandle(input: unknown, expectedTypes: ClearSignContextType[]): input is SolanaInstructionInfoContextInput;
|
|
33
31
|
load(input: SolanaInstructionInfoContextInput): Promise<ClearSignContext[]>;
|
|
34
32
|
/**
|
|
@@ -37,7 +35,5 @@ export declare class InstructionInfoContextLoader implements ContextLoader<Solan
|
|
|
37
35
|
* descriptor CAL has for the program.
|
|
38
36
|
*/
|
|
39
37
|
private collectWantedDiscriminators;
|
|
40
|
-
private toInstructionInfoContext;
|
|
41
|
-
private pickSignature;
|
|
42
38
|
}
|
|
43
39
|
//# sourceMappingURL=InstructionInfoContextLoader.d.ts.map
|
package/lib/types/src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InstructionInfoContextLoader.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"InstructionInfoContextLoader.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/domain/InstructionInfoContextLoader.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAClB,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAMzC,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,sDAAsD,CAAC;AAGjG,OAAO,EAAE,KAAK,yBAAyB,EAAE,MAAM,kEAAkE,CAAC;AAElH,OAAO,EAAE,KAAK,aAAa,EAAE,MAAM,+BAA+B,CAAC;AACnE,OAAO,EACL,KAAK,gBAAgB,EACrB,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAUzC;;;;;GAKG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,iCAAiC,GAAG;IAC9C,aAAa,EAAE,aAAa,CAAC;IAC7B,YAAY,EAAE,oBAAoB,EAAE,CAAC;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAaF;;;GAGG;AACH,qBACa,4BACX,YAAW,aAAa,CAAC,iCAAiC,CAAC;IAMzD,OAAO,CAAC,QAAQ,CAAC,UAAU;IAE3B,OAAO,CAAC,QAAQ,CAAC,iBAAiB;IANpC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAyB;gBAI7B,UAAU,EAAE,yBAAyB,EAErC,iBAAiB,EAAE,oBAAoB,EAExD,aAAa,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,sBAAsB;IAKjD,SAAS,CACd,KAAK,EAAE,OAAO,EACd,aAAa,EAAE,oBAAoB,EAAE,GACpC,KAAK,IAAI,iCAAiC;IAYhC,IAAI,CACf,KAAK,EAAE,iCAAiC,GACvC,OAAO,CAAC,gBAAgB,EAAE,CAAC;IA6G9B;;;;OAIG;IACH,OAAO,CAAC,2BAA2B;CAgBpC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type PkiCertificate } from "../../../modules/multichain/pki/model/PkiCertificate";
|
|
2
2
|
import { type SolanaAltResolutionPayload, type SolanaEnumVariantPayload, type SolanaInstructionInfoPayload, type SolanaLifiPayload, type SolanaTokenAccountStatePayload, type SolanaTokenData, type SolanaTokenInfoPayload, type SolanaTransactionCheckPayload } from "../../../modules/solana/model/SolanaPayloads";
|
|
3
3
|
import { type ClearSignContext, type ClearSignContextSuccess, ClearSignContextType } from "../../../shared/model/ClearSignContext";
|
|
4
|
-
export type { SolanaAltResolutionPayload, SolanaEnumVariantPayload, SolanaInstructionEnumVariant, SolanaInstructionInfoPayload, SolanaInstructionSubstructure, SolanaLifiInstructionMeta, SolanaLifiPayload, SolanaSignedDescriptor, SolanaTokenAccountStatePayload, SolanaTokenData, SolanaTokenInfoPayload, SolanaTransactionCheckPayload, SolanaTransactionDescriptor, } from "../../../modules/solana/model/SolanaPayloads";
|
|
4
|
+
export type { SolanaAltResolutionPayload, SolanaCalAccountReset, SolanaCalDisplayField, SolanaCalMintAssociation, SolanaCalTokenValue, SolanaCalTypePoolEntry, SolanaCalValue, SolanaCalValueFlowPort, SolanaEnumVariantPayload, SolanaInstructionEnumVariant, SolanaInstructionInfoPayload, SolanaInstructionSubstructure, SolanaLifiInstructionMeta, SolanaLifiPayload, SolanaSignedDescriptor, SolanaTokenAccountStatePayload, SolanaTokenData, SolanaTokenInfoPayload, SolanaTransactionCheckPayload, SolanaTransactionDescriptor, } from "../../../modules/solana/model/SolanaPayloads";
|
|
5
5
|
export { SolanaInstructionSubstructureKind } from "../../../modules/solana/model/SolanaPayloads";
|
|
6
6
|
/**
|
|
7
7
|
* Solana-specific payload overrides — contributed to the shared
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaClearSignContext.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/solana/model/SolanaClearSignContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EACnC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAGz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AoB,CAAC,0BAA0B,CAAC,EAAE;QACjD,OAAO,EAAE,8BAA8B,CAAC;QACxC,WAAW,CAAC,EAAE,cAAc,CAAC;KAC9B,CAAC;IACF,CAAC,oBAAoB,CAAC,qBAAqB,CAAC,EAAE;QAC5C,OAAO,EAAE,0BAA0B,CAAC;QACpC,WAAW,CAAC,EAAE,cAAc,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;CAUpB,CAAC;AAEX;;GAEG;AACH,MAAM,MAAM,iCAAiC,GAC3C,CAAC,OAAO,iBAAiB,CAAC,CAAC,MAAM,OAAO,iBAAiB,CAAC,CAAC;AAE7D;;GAEG;AACH,MAAM,MAAM,6BAA6B,GACvC,uBAAuB,CAAC,iCAAiC,CAAC,CAAC;AAE7D;;;GAGG;AACH,eAAO,MAAM,uCAAuC,2BACa,CAAC;AAElE;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,GAAG,EAAE,gBAAgB,GACpB,GAAG,IAAI,6BAA6B,CAEtC"}
|
|
1
|
+
{"version":3,"file":"SolanaClearSignContext.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/solana/model/SolanaClearSignContext.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,+CAA+C,CAAC;AACpF,OAAO,EACL,KAAK,0BAA0B,EAC/B,KAAK,wBAAwB,EAC7B,KAAK,4BAA4B,EACjC,KAAK,iBAAiB,EACtB,KAAK,8BAA8B,EACnC,KAAK,eAAe,EACpB,KAAK,sBAAsB,EAC3B,KAAK,6BAA6B,EACnC,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EACL,KAAK,gBAAgB,EACrB,KAAK,uBAAuB,EAC5B,oBAAoB,EACrB,MAAM,iCAAiC,CAAC;AAGzC,YAAY,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,sBAAs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