@ledgerhq/context-module 0.0.0-develop-20260831155922 → 0.0.0-develop-20260902001426
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/instruction-info/data/HttpInstructionInfoDataSource.test.js +1 -1
- package/lib/cjs/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.test.js.map +2 -2
- 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 +1 -1
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoMapper.js.map +3 -3
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.js +1 -1
- package/lib/cjs/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.js.map +2 -2
- 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 +2 -2
- 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/instruction-info/data/HttpInstructionInfoDataSource.test.js +1 -1
- package/lib/esm/src/modules/solana/instruction-info/data/HttpInstructionInfoDataSource.test.js.map +2 -2
- 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 +1 -1
- package/lib/esm/src/modules/solana/instruction-info/data/InstructionInfoMapper.js.map +3 -3
- package/lib/esm/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.js +1 -1
- package/lib/esm/src/modules/solana/instruction-info/data/InstructionInfoMapper.test.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 +2 -2
- 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.map +2 -2
- package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoDto.d.ts +19 -2
- 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 +18 -2
- package/lib/types/src/modules/solana/instruction-info/data/InstructionInfoMapper.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 +39 -0
- package/lib/types/src/modules/solana/model/SolanaPayloads.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +4 -4
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 PkiCertificateLoader } from \"@/modules/multichain/pki/domain/PkiCertificateLoader\";\nimport {\n type InstructionInfoDataSource,\n type InstructionInfoResult,\n} from \"@/modules/solana/instruction-info/data/InstructionInfoDataSource\";\nimport {\n type SolanaInstructionEnumVariant,\n type SolanaInstructionInfoPayload,\n} 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\nfunction makeJupiterRouteResult(\n enumVariants: SolanaInstructionEnumVariant[] = [],\n): InstructionInfoResult {\n return {\n programId: JUPITER_PROGRAM,\n descriptors: {\n e517cb977ae3ad2a: Right({ ...makeJupiterPayload(), enumVariants }),\n },\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(\"does NOT emit SOLANA_ENUM_VARIANT contexts (those come from EnumVariantContextLoader)\", async () => {\n const loader = makeLoader();\n // Pass a pre-decoded variant to confirm the loader never emits SOLANA_ENUM_VARIANT.\n const jupiter = makeJupiterRouteResult([\n {\n enumId: \"swap\",\n variantIndex: 46,\n descriptor: { data: \"01_raydium_tlv\", signature: \"prodsig_v46\" },\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 expectedVariants: SolanaInstructionEnumVariant[] = [\n {\n enumId: \"swap\",\n variantIndex: 46,\n descriptor: { data: \"01_raydium_tlv\", signature: \"prodsig_v46\" },\n },\n ];\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeJupiterRouteResult(expectedVariants)),\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\n expect((infoCtx as any).payload.enumVariants).toEqual(expectedVariants);\n });\n\n it(\"forwards exactly the enumVariants the data source decoded \u2014 no NaN indices\", async () => {\n const loader = makeLoader();\n // The data source is responsible for filtering malformed variant keys;\n // the loader forwards whatever pre-decoded variants it receives as-is.\n const validVariant: SolanaInstructionEnumVariant = {\n enumId: \"swap\",\n variantIndex: 46,\n descriptor: { data: \"01_raydium_tlv\", signature: \"prodsig_v46\" },\n };\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeJupiterRouteResult([validVariant])),\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\n expect((infoCtx as any).payload.enumVariants).toEqual([validVariant]);\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,EAAU,UAAAC,EAAQ,MAAAC,EAAI,MAAAC,MAAU,SAWrD,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,EAAiB,mCACjBC,EAAkB,8CAGxB,SAASC,GAAkD,CACzD,MAAO,CACL,UAAWF,EACX,cAAe,WACf,gBAAiB,CAAE,KAAM,eAAgB,UAAW,aAAc,EAClE,cAAe,CACb,CAAE,KAAM,EAAM,KAAM,KAAM,EAC1B,CAAE,KAAM,EAAM,KAAM,KAAM,EAC1B,CAAE,KAAM,EAAM,KAAM,MAAO,CAC7B,EACA,aAAc,CAAC,EACf,cAAe,CAAE,SAAU,CAAC,EAAG,SAAU,CAAE,EAC3C,iBAAkB,CAAC,EACnB,eAAgB,CAAC,EACjB,cAAe,CAAC,EAChB,cAAe,CAAC,
|
|
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 {\n type SolanaInstructionEnumVariant,\n type SolanaInstructionInfoPayload,\n} 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 ownerAssociations: [],\n valueFlowPorts: [],\n accountResets: [],\n displayFields: [],\n hideRules: [],\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 ownerAssociations: [],\n valueFlowPorts: [],\n accountResets: [],\n displayFields: [],\n hideRules: [],\n };\n}\n\nfunction makeJupiterResult(): InstructionInfoResult {\n return {\n programId: JUPITER_PROGRAM,\n descriptors: { e517cb977ae3ad2a: Right(makeJupiterPayload()) },\n enumVariants: [],\n };\n}\n\nfunction makeJupiterRouteResult(\n enumVariants: SolanaInstructionEnumVariant[] = [],\n): InstructionInfoResult {\n return {\n programId: JUPITER_PROGRAM,\n descriptors: {\n e517cb977ae3ad2a: Right({ ...makeJupiterPayload(), enumVariants }),\n },\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(\"does NOT emit SOLANA_ENUM_VARIANT contexts (those come from EnumVariantContextLoader)\", async () => {\n const loader = makeLoader();\n // Pass a pre-decoded variant to confirm the loader never emits SOLANA_ENUM_VARIANT.\n const jupiter = makeJupiterRouteResult([\n {\n enumId: \"swap\",\n variantIndex: 46,\n descriptor: { data: \"01_raydium_tlv\", signature: \"prodsig_v46\" },\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 expectedVariants: SolanaInstructionEnumVariant[] = [\n {\n enumId: \"swap\",\n variantIndex: 46,\n descriptor: { data: \"01_raydium_tlv\", signature: \"prodsig_v46\" },\n },\n ];\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeJupiterRouteResult(expectedVariants)),\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\n expect((infoCtx as any).payload.enumVariants).toEqual(expectedVariants);\n });\n\n it(\"forwards exactly the enumVariants the data source decoded \u2014 no NaN indices\", async () => {\n const loader = makeLoader();\n // The data source is responsible for filtering malformed variant keys;\n // the loader forwards whatever pre-decoded variants it receives as-is.\n const validVariant: SolanaInstructionEnumVariant = {\n enumId: \"swap\",\n variantIndex: 46,\n descriptor: { data: \"01_raydium_tlv\", signature: \"prodsig_v46\" },\n };\n vi.spyOn(dataSource, \"getInstructionInfo\").mockResolvedValue(\n Right(makeJupiterRouteResult([validVariant])),\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\n expect((infoCtx as any).payload.enumVariants).toEqual([validVariant]);\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,EAAU,UAAAC,EAAQ,MAAAC,EAAI,MAAAC,MA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W,EAAO,KAAK,CAChB,cAAevB,EAAc,OAC7B,aAAc,CAAC,CAAE,UAAWY,CAAe,CAAC,EAC5C,QAAS,EACX,CAAC,EACDP,EAAOoB,CAAG,EAAE,yBAAyB,CACnC,UAAWb,EACX,QAAS,gBACX,CAAC,CACH,CAAC,CACH,CAAC,CACH,CAAC",
|
|
6
6
|
"names": ["DeviceModelId", "Left", "Right", "beforeEach", "describe", "expect", "it", "vi", "ClearSignContextType", "InstructionInfoContextLoader", "mockLoggerFactory", "mockCertificate", "SYSTEM_PROGRAM", "JUPITER_PROGRAM", "makeSystemPayload", "makeSystemResult", "makeJupiterPayload", "makeJupiterResult", "makeJupiterRouteResult", "enumVariants", "dataSource", "certificateLoader", "makeLoader", "loader", "types", "spy", "programId", "result", "c", "infoCtx", "jupiter", "expectedVariants", "validVariant", "infos", "out", "errors"]
|
|
7
7
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{ClearSignContextType as a}from"../../../shared/model/ClearSignContext";import{SolanaInstructionSubstructureKind as
|
|
1
|
+
import{ClearSignContextType as a}from"../../../shared/model/ClearSignContext";import{SolanaInstructionSubstructureKind as C}from"../../../modules/solana/model/SolanaPayloads";const t={TOKEN:a.SOLANA_TOKEN,LIFI:a.SOLANA_LIFI,TRUSTED_NAME:a.SOLANA_TRUSTED_NAME,BASIC_TRUSTED_NAME:a.SOLANA_BASIC_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},o=new Set(Object.values(t));function l(e){return o.has(e.type)}export{o as SOLANA_CLEAR_SIGN_CONTEXT_SUCCESS_TYPES,t as SolanaContextType,C 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 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_BASIC_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 BASIC_TRUSTED_NAME: ClearSignContextType.SOLANA_BASIC_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 SolanaCalActiveWhenPredicate,\n SolanaCalDisplayField,\n SolanaCalHideRule,\n SolanaCalMintAssociation,\n SolanaCalOwnerAssociation,\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_BASIC_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 BASIC_TRUSTED_NAME: ClearSignContextType.SOLANA_BASIC_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,kCA4BP,OAAS,qCAAAC,MAAyC,wCAiD3C,MAAMC,EAAoB,CAC/B,MAAOF,EAAqB,aAC5B,KAAMA,EAAqB,YAC3B,aAAcA,EAAqB,oBACnC,mBAAoBA,EAAqB,0BACzC,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,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 has_basis_point?: boolean;\n};\n\nexport type SolanaLifiInstructionMeta = {\n program_id: string;\n discriminator_hex?: string;\n has_basis_point?: boolean;\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 instructionName?: 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 of account indices (length 1 for a single-account port). */\n account_indices: 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 mint?: string;\n};\n\nexport type SolanaAltResolutionPayload = {\n descriptor: Uint8Array;\n resolvedAddress?: string;\n};\n\n// SOLANA_TRUSTED_NAME (generic flow, with 2-byte length prefix) is emitted by\n// SolanaTrustedNameContextLoader. SOLANA_BASIC_TRUSTED_NAME (basic flow, raw\n// bytes) is emitted by OwnerInfoContextLoader. Both carry `payload: Uint8Array`.\n"],
|
|
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 has_basis_point?: boolean;\n};\n\nexport type SolanaLifiInstructionMeta = {\n program_id: string;\n discriminator_hex?: string;\n has_basis_point?: boolean;\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 instructionName?: string;\n instructionInfo: SolanaSignedDescriptor;\n substructures: SolanaInstructionSubstructure[];\n enumVariants: SolanaInstructionEnumVariant[];\n idlDescriptor: {\n typePool: SolanaCalTypePoolEntry[];\n rootType: number;\n };\n mintAssociations: SolanaCalMintAssociation[];\n ownerAssociations: SolanaCalOwnerAssociation[];\n valueFlowPorts: SolanaCalValueFlowPort[];\n accountResets: SolanaCalAccountReset[];\n displayFields: SolanaCalDisplayField[];\n hideRules: SolanaCalHideRule[];\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 * `RESOLVE` only: account index whose *address* the device uses as the mint\n * when the binding lookup fails through both the mint-association map and\n * `TOKEN_ACCOUNT_STATE` (`accountMintTokenNode.fallbackAccount`).\n */\n fallback_account?: number;\n};\n\n/**\n * One `VALUE_FLOW_PORT.ACTIVE_WHEN` predicate: a bare `ActiveWhenPredicate`\n * name, or `MINT_PREDICATE` with its trailing mint.\n */\nexport type SolanaCalActiveWhenPredicate =\n | string\n | { kind: string; mint?: string };\n\nexport type SolanaCalValueFlowPort = {\n /** Ordered candidate list of account indices (length 1 for a single-account port). */\n account_indices: number[];\n optional_account_strategy?: string;\n token_value: SolanaCalTokenValue;\n /** Port activation predicates; all must pass for the port to be active. */\n active_when?: SolanaCalActiveWhenPredicate[];\n};\n\n/**\n * One `HIDE_RULE` substructure: a `(rule_set_index, target, condition)` triple.\n * `condition` is non-optional in the TLV, but it stays optional here: the signed\n * substructure reaches the device either way, so a rule whose condition CAL\n * failed to name must still be surfaced \u2014 dropping it would lose the `target`\n * the device resolves for every rule.\n */\nexport type SolanaCalHideRule = {\n rule_set_index?: number;\n target?: SolanaCalValue;\n condition?: string;\n};\n\n/**\n * An `OWNER_ASSOC_ACCOUNT` / `OWNER_ASSOC_OWNER` pair: binds a token account to\n * its owner, seeding the transaction-scoped owner map the `IS_SIGNER` /\n * `IS_ANOTHER_SIGNER` predicates read.\n */\nexport type SolanaCalOwnerAssociation = {\n account_index: number;\n owner: SolanaCalValue;\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 mint?: string;\n};\n\nexport type SolanaAltResolutionPayload = {\n descriptor: Uint8Array;\n resolvedAddress?: string;\n};\n\n// SOLANA_TRUSTED_NAME (generic flow, with 2-byte length prefix) is emitted by\n// SolanaTrustedNameContextLoader. SOLANA_BASIC_TRUSTED_NAME (basic flow, raw\n// bytes) is emitted by OwnerInfoContextLoader. Both carry `payload: Uint8Array`.\n"],
|
|
5
|
+
"mappings": "AAoFO,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
|
}
|
|
@@ -19,11 +19,22 @@ export type CalTokenValueDto = {
|
|
|
19
19
|
kind: string;
|
|
20
20
|
value?: CalValueDto;
|
|
21
21
|
account_index?: number;
|
|
22
|
+
/** `RESOLVE` only: account index whose address is the mint of last resort. */
|
|
23
|
+
fallback_account?: number;
|
|
22
24
|
};
|
|
23
25
|
export type CalMintAssociationDto = {
|
|
24
26
|
account_index: number;
|
|
25
27
|
mint_index: number;
|
|
26
28
|
};
|
|
29
|
+
export type CalOwnerAssociationDto = {
|
|
30
|
+
account_index?: number;
|
|
31
|
+
owner?: CalValueDto;
|
|
32
|
+
};
|
|
33
|
+
/** One `ACTIVE_WHEN` predicate: a bare name, or `MINT_PREDICATE` + its mint. */
|
|
34
|
+
export type CalActiveWhenPredicateDto = string | {
|
|
35
|
+
kind: string;
|
|
36
|
+
mint?: string;
|
|
37
|
+
};
|
|
27
38
|
export type CalTypePoolEntryDto = {
|
|
28
39
|
index: number;
|
|
29
40
|
kind: string;
|
|
@@ -50,6 +61,12 @@ export type CalValueFlowPortDto = CalSubstructureDto & {
|
|
|
50
61
|
account_indices: number[];
|
|
51
62
|
optional_account_strategy?: string;
|
|
52
63
|
token_value: CalTokenValueDto;
|
|
64
|
+
active_when?: CalActiveWhenPredicateDto[];
|
|
65
|
+
};
|
|
66
|
+
export type CalHideRuleDto = CalSubstructureDto & {
|
|
67
|
+
rule_set_index?: number;
|
|
68
|
+
target?: CalValueDto;
|
|
69
|
+
condition?: string;
|
|
53
70
|
};
|
|
54
71
|
export type CalAccountResetDto = CalSubstructureDto & {
|
|
55
72
|
account_index?: number;
|
|
@@ -72,11 +89,11 @@ export type CalInstructionDescriptorDto = {
|
|
|
72
89
|
root_type?: number;
|
|
73
90
|
};
|
|
74
91
|
mint_association?: CalMintAssociationDto;
|
|
75
|
-
owner_association?:
|
|
92
|
+
owner_association?: CalOwnerAssociationDto;
|
|
76
93
|
enum_variants?: Record<string, Record<string, CalEnumVariantDto>>;
|
|
77
94
|
display_fields?: CalDisplayFieldDto[];
|
|
78
95
|
value_flow_ports?: CalValueFlowPortDto[];
|
|
79
|
-
hide_rules?:
|
|
96
|
+
hide_rules?: CalHideRuleDto[];
|
|
80
97
|
account_resets?: CalAccountResetDto[];
|
|
81
98
|
};
|
|
82
99
|
export type CalInstructionProgramDto = {
|
|
@@ -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,EAAoC,MAAM,WAAW,CAAC;AAE3E,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;AAKF,MAAM,MAAM,WAAW,GAAG;IACxB,MAAM,EAAE,MAAM,CAAC;IACf,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;CAC5B,CAAC;AAEF,MAAM,MAAM,gBAAgB,GAAG;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB,aAAa,CAAC,EAAE,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"InstructionInfoDto.d.ts","sourceRoot":"","sources":["../../../../../../../src/modules/solana/instruction-info/data/InstructionInfoDto.ts"],"names":[],"mappings":"AAQA,OAAO,EAAS,KAAK,EAAoC,MAAM,WAAW,CAAC;AAE3E,MAAM,MAAM,aAAa,GAAG;IAC1B,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,M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nC,cAAc,CAAC,EAAE;QACf,SAAS,CAAC,EAAE,mBAAmB,EAAE,CAAC;QAClC,SAAS,CAAC,EAAE,MAAM,CAAC;KACpB,CAAC;IACF,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;IACzC,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;IAC3C,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,cAAc,EAAE,CAAC;IAC9B,cAAc,CAAC,EAAE,kBAAkB,EAAE,CAAC;CACvC,CAAC;AAKF,MAAM,MAAM,wBAAwB,GAAG;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,2BAA2B,EAAE,CAAC;CAC7C,CAAC;AAGF,MAAM,MAAM,6BAA6B,GAAG,wBAAwB,EAAE,CAAC;AAiCvE;;;;;GAKG;AACH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIrC,CAAC"}
|
|
@@ -1,9 +1,25 @@
|
|
|
1
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";
|
|
2
|
+
import { type SolanaCalAccountReset, type SolanaCalDisplayField, type SolanaCalHideRule, type SolanaCalOwnerAssociation, type SolanaCalValueFlowPort, type SolanaInstructionEnumVariant, type SolanaInstructionInfoPayload } from "../../../../modules/solana/model/SolanaPayloads";
|
|
3
|
+
import { type CalAccountResetDto, type CalDisplayFieldDto, type CalHideRuleDto, type CalInstructionDescriptorDto, type CalOwnerAssociationDto, type CalValueFlowPortDto } from "./InstructionInfoDto";
|
|
4
4
|
export type CalMode = "prod" | "test";
|
|
5
5
|
export declare function toValueFlowPorts(dtos?: CalValueFlowPortDto[]): SolanaCalValueFlowPort[];
|
|
6
6
|
export declare function toAccountResets(dtos?: CalAccountResetDto[]): SolanaCalAccountReset[];
|
|
7
|
+
/**
|
|
8
|
+
* Every rule is carried, including one CAL served without a `condition`. The
|
|
9
|
+
* rule's signed TLV goes to the device through {@link toSubstructures}
|
|
10
|
+
* regardless, and the device resolves the `target` of every rule it receives —
|
|
11
|
+
* so dropping the entry here would cost the host the `ALT_RESOLUTION` for that
|
|
12
|
+
* target and make the device refuse to sign. A missing condition only means no
|
|
13
|
+
* requirement keys off this rule's predicate.
|
|
14
|
+
*/
|
|
15
|
+
export declare function toHideRules(dtos?: CalHideRuleDto[]): SolanaCalHideRule[];
|
|
16
|
+
/**
|
|
17
|
+
* CAL carries at most one `owner_association` per descriptor; the payload holds
|
|
18
|
+
* a list so the transaction-wide owner map is built the same way as the mint
|
|
19
|
+
* map. Both halves of the pair are required (spec: "must both be present or
|
|
20
|
+
* both absent"), so a half-declared association is dropped.
|
|
21
|
+
*/
|
|
22
|
+
export declare function toOwnerAssociations(dto: CalOwnerAssociationDto | undefined): SolanaCalOwnerAssociation[];
|
|
7
23
|
export declare function toDisplayFields(dtos?: CalDisplayFieldDto[]): SolanaCalDisplayField[];
|
|
8
24
|
/**
|
|
9
25
|
* Flatten the enum variants of every descriptor in a program into a single
|
|
@@ -1 +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,
|
|
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,iBAAiB,EACtB,KAAK,yBAAyB,EAC9B,KAAK,sBAAsB,EAC3B,KAAK,4BAA4B,EACjC,KAAK,4BAA4B,EAGlC,MAAM,uCAAuC,CAAC;AAG/C,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,2BAA2B,EAChC,KAAK,sBAAsB,EAE3B,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;;;;;;;GAOG;AACH,wBAAgB,WAAW,CAAC,IAAI,GAAE,cAAc,EAAO,GAAG,iBAAiB,EAAE,CAM5E;AAED;;;;;GAKG;AACH,wBAAgB,mBAAmB,CACjC,GAAG,EAAE,sBAAsB,GAAG,SAAS,GACtC,yBAAyB,EAAE,CAI7B;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;;;;;;;;GAQG;AACH,wBAAgB,wBAAwB,CACtC,SAAS,EAAE,MAAM,EACjB,aAAa,EAAE,MAAM,EACrB,GAAG,EAAE,2BAA2B,EAChC,IAAI,EAAE,OAAO,GACZ,MAAM,CAAC,KAAK,EAAE,4BAA4B,CAAC,CA+B7C"}
|
|
@@ -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, SolanaCalAccountReset, SolanaCalDisplayField, SolanaCalMintAssociation, SolanaCalTokenValue, SolanaCalTypePoolEntry, SolanaCalValue, SolanaCalValueFlowPort, SolanaEnumVariantPayload, SolanaInstructionEnumVariant, SolanaInstructionInfoPayload, SolanaInstructionSubstructure, SolanaLifiInstructionMeta, SolanaLifiPayload, SolanaSignedDescriptor, SolanaTokenAccountStatePayload, SolanaTokenData, SolanaTokenInfoPayload, SolanaTransactionCheckPayload, SolanaTransactionDescriptor, } from "../../../modules/solana/model/SolanaPayloads";
|
|
4
|
+
export type { SolanaAltResolutionPayload, SolanaCalAccountReset, SolanaCalActiveWhenPredicate, SolanaCalDisplayField, SolanaCalHideRule, SolanaCalMintAssociation, SolanaCalOwnerAssociation, 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;AAGzC,YAAY,EACV,0BAA0B,EAC1B,qBAAqB,EACrB,qBAAqB,EACrB,wBAAwB,EACxB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,EAC7B,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACtB,8BAA8B,EAC9B,eAAe,EACf,sBAAsB,EACtB,6BAA6B,EAC7B,2BAA2B,GAC5B,MAAM,uCAAuC,CAAC;AAC/C,OAAO,EAAE,iCAAiC,EAAE,MAAM,uCAAuC,CAAC;AAE1F;;;GAGG;AACH,MAAM,MAAM,sBAAsB,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C,WAAW,CAAC,EAAE,cAAc,CAAC;KAC9B,CAAC;CACH,CAAC;AAEF,eAAO,MAAM,iBAAiB;;;;;;;;;;;CAWpB,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,4BAA4B,EAC5B,qBAAqB,EACrB,iBAAiB,EACjB,wBAAwB,EACxB,yBAAyB,EACzB,mBAAmB,EACnB,sBAAsB,EACtB,cAAc,EACd,sBAAsB,EACtB,wBAAwB,EACxB,4BAA4B,EAC5B,4BAA4B,EAC5B,6BAA6B,EAC7B,yBAAyB,EACzB,iBAAiB,EACjB,sBAAsB,EACtB,8BAA8B,EAC9B,eAAe,EACf,sBAAsB,EAC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AE,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;;;;;;;;;;;CAWpB,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"}
|
|
@@ -59,9 +59,11 @@ export type SolanaInstructionInfoPayload = {
|
|
|
59
59
|
rootType: number;
|
|
60
60
|
};
|
|
61
61
|
mintAssociations: SolanaCalMintAssociation[];
|
|
62
|
+
ownerAssociations: SolanaCalOwnerAssociation[];
|
|
62
63
|
valueFlowPorts: SolanaCalValueFlowPort[];
|
|
63
64
|
accountResets: SolanaCalAccountReset[];
|
|
64
65
|
displayFields: SolanaCalDisplayField[];
|
|
66
|
+
hideRules: SolanaCalHideRule[];
|
|
65
67
|
};
|
|
66
68
|
export declare enum SolanaInstructionSubstructureKind {
|
|
67
69
|
DISPLAY_FIELD = 0,
|
|
@@ -88,12 +90,49 @@ export type SolanaCalTokenValue = {
|
|
|
88
90
|
kind: string;
|
|
89
91
|
value?: SolanaCalValue;
|
|
90
92
|
account_index?: number;
|
|
93
|
+
/**
|
|
94
|
+
* `RESOLVE` only: account index whose *address* the device uses as the mint
|
|
95
|
+
* when the binding lookup fails through both the mint-association map and
|
|
96
|
+
* `TOKEN_ACCOUNT_STATE` (`accountMintTokenNode.fallbackAccount`).
|
|
97
|
+
*/
|
|
98
|
+
fallback_account?: number;
|
|
99
|
+
};
|
|
100
|
+
/**
|
|
101
|
+
* One `VALUE_FLOW_PORT.ACTIVE_WHEN` predicate: a bare `ActiveWhenPredicate`
|
|
102
|
+
* name, or `MINT_PREDICATE` with its trailing mint.
|
|
103
|
+
*/
|
|
104
|
+
export type SolanaCalActiveWhenPredicate = string | {
|
|
105
|
+
kind: string;
|
|
106
|
+
mint?: string;
|
|
91
107
|
};
|
|
92
108
|
export type SolanaCalValueFlowPort = {
|
|
93
109
|
/** Ordered candidate list of account indices (length 1 for a single-account port). */
|
|
94
110
|
account_indices: number[];
|
|
95
111
|
optional_account_strategy?: string;
|
|
96
112
|
token_value: SolanaCalTokenValue;
|
|
113
|
+
/** Port activation predicates; all must pass for the port to be active. */
|
|
114
|
+
active_when?: SolanaCalActiveWhenPredicate[];
|
|
115
|
+
};
|
|
116
|
+
/**
|
|
117
|
+
* One `HIDE_RULE` substructure: a `(rule_set_index, target, condition)` triple.
|
|
118
|
+
* `condition` is non-optional in the TLV, but it stays optional here: the signed
|
|
119
|
+
* substructure reaches the device either way, so a rule whose condition CAL
|
|
120
|
+
* failed to name must still be surfaced — dropping it would lose the `target`
|
|
121
|
+
* the device resolves for every rule.
|
|
122
|
+
*/
|
|
123
|
+
export type SolanaCalHideRule = {
|
|
124
|
+
rule_set_index?: number;
|
|
125
|
+
target?: SolanaCalValue;
|
|
126
|
+
condition?: string;
|
|
127
|
+
};
|
|
128
|
+
/**
|
|
129
|
+
* An `OWNER_ASSOC_ACCOUNT` / `OWNER_ASSOC_OWNER` pair: binds a token account to
|
|
130
|
+
* its owner, seeding the transaction-scoped owner map the `IS_SIGNER` /
|
|
131
|
+
* `IS_ANOTHER_SIGNER` predicates read.
|
|
132
|
+
*/
|
|
133
|
+
export type SolanaCalOwnerAssociation = {
|
|
134
|
+
account_index: number;
|
|
135
|
+
owner: SolanaCalValue;
|
|
97
136
|
};
|
|
98
137
|
export type SolanaCalAccountReset = {
|
|
99
138
|
account_index: number;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SolanaPayloads.d.ts","sourceRoot":"","sources":["../../../../../../src/modules/solana/model/SolanaPayloads.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,eAAe,GAAG;IAC5B,qBAAqB,EAAE;QACrB,IAAI,EAAE,MAAM,CAAC;QACb,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;CACH,CAAC;AAEF,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,cAAc,EAAE,MAAM,CAAC;IACvB,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAC;IACnB,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAC3B,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,WAAW,EAAE,MAAM,CAAC,MAAM,EAAE,2BAA2B,EAAE,CAAC,CAAC;IAC3D,YAAY,EAAE,yBAAyB,EAAE,CAAC;CAC3C,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG;IAC1C,UAAU,EAAE,MAAM,CAAC;CACpB,CAAC;AAQF,MAAM,MAAM,sBAAsB,GAAG;IACnC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF;;;;;GAKG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,MAAM,EAAE,MAAM,CAAC;IACf,YAAY,EAAE,MAAM,CAAC;IACrB,UAAU,EAAE,sBAAsB,CAAC;CACpC,CAAC;AAEF;;;;;;;;GAQG;AACH,MAAM,MAAM,4BAA4B,GAAG;IACzC,SAAS,EAAE,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