@ledgerhq/device-contacts-kit 0.3.1 → 0.4.1
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/README.md +22 -13
- package/lib/cjs/api/app-binder/RenameContactDeviceActionTypes.js.map +1 -1
- package/lib/cjs/api/index.js +1 -1
- package/lib/cjs/api/index.js.map +3 -3
- package/lib/cjs/api/model/ContactsVersionRequirements.js +1 -1
- package/lib/cjs/api/model/ContactsVersionRequirements.js.map +3 -3
- package/lib/cjs/api/model/ContactsVersionRequirements.test.js +1 -1
- package/lib/cjs/api/model/ContactsVersionRequirements.test.js.map +3 -3
- package/lib/cjs/api/model/ProvideContact.js +2 -0
- package/lib/cjs/api/model/ProvideContact.js.map +7 -0
- package/lib/cjs/api/model/RenameContact.js.map +1 -1
- package/lib/cjs/internal/app-binder/command/EditExternalAddressIdentifierCommand.js +1 -1
- package/lib/cjs/internal/app-binder/command/EditExternalAddressIdentifierCommand.js.map +3 -3
- package/lib/cjs/internal/app-binder/command/EditExternalAddressScopeCommand.js +1 -1
- package/lib/cjs/internal/app-binder/command/EditExternalAddressScopeCommand.js.map +3 -3
- package/lib/cjs/internal/app-binder/command/ProvideContactCommand.js +2 -0
- package/lib/cjs/internal/app-binder/command/ProvideContactCommand.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/ProvideContactCommand.test.js +2 -0
- package/lib/cjs/internal/app-binder/command/ProvideContactCommand.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/command/RegisterIdentityCommand.js +1 -1
- package/lib/cjs/internal/app-binder/command/RegisterIdentityCommand.js.map +3 -3
- package/lib/cjs/internal/app-binder/command/RenameContactCommand.js +1 -1
- package/lib/cjs/internal/app-binder/command/RenameContactCommand.js.map +3 -3
- package/lib/cjs/internal/app-binder/command/RenameContactCommand.test.js +1 -1
- package/lib/cjs/internal/app-binder/command/RenameContactCommand.test.js.map +2 -2
- package/lib/cjs/internal/app-binder/contactsVersionGuards.js +1 -1
- package/lib/cjs/internal/app-binder/contactsVersionGuards.js.map +3 -3
- package/lib/cjs/internal/app-binder/contactsVersionGuards.test.js +1 -1
- package/lib/cjs/internal/app-binder/contactsVersionGuards.test.js.map +2 -2
- package/lib/cjs/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.js +1 -1
- package/lib/cjs/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.js.map +3 -3
- package/lib/cjs/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js +1 -1
- package/lib/cjs/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js.map +3 -3
- package/lib/cjs/internal/app-binder/model/contactsConstants.js +1 -1
- package/lib/cjs/internal/app-binder/model/contactsConstants.js.map +3 -3
- package/lib/cjs/internal/app-binder/model/contactsErrors.js +1 -1
- package/lib/cjs/internal/app-binder/model/contactsErrors.js.map +3 -3
- package/lib/cjs/internal/app-binder/services/provideContact.js +2 -0
- package/lib/cjs/internal/app-binder/services/provideContact.js.map +7 -0
- package/lib/cjs/internal/app-binder/services/provideContact.test.js +2 -0
- package/lib/cjs/internal/app-binder/services/provideContact.test.js.map +7 -0
- package/lib/cjs/internal/app-binder/task/SendRegisterIdentityTask.js.map +2 -2
- package/lib/cjs/internal/app-binder/task/SendRegisterIdentityTask.test.js.map +1 -1
- package/lib/cjs/internal/app-binder/task/SendRenameContactTask.js +1 -1
- package/lib/cjs/internal/app-binder/task/SendRenameContactTask.js.map +2 -2
- package/lib/cjs/internal/app-binder/task/SendRenameContactTask.test.js +1 -1
- package/lib/cjs/internal/app-binder/task/SendRenameContactTask.test.js.map +3 -3
- package/lib/cjs/package.json +2 -2
- package/lib/esm/api/index.js +1 -1
- package/lib/esm/api/index.js.map +3 -3
- package/lib/esm/api/model/ContactsVersionRequirements.js +1 -1
- package/lib/esm/api/model/ContactsVersionRequirements.js.map +3 -3
- package/lib/esm/api/model/ContactsVersionRequirements.test.js +1 -1
- package/lib/esm/api/model/ContactsVersionRequirements.test.js.map +3 -3
- package/lib/esm/api/model/ProvideContact.js +1 -0
- package/lib/esm/api/model/ProvideContact.js.map +7 -0
- package/lib/esm/internal/app-binder/command/EditExternalAddressIdentifierCommand.js +1 -1
- package/lib/esm/internal/app-binder/command/EditExternalAddressIdentifierCommand.js.map +3 -3
- package/lib/esm/internal/app-binder/command/EditExternalAddressScopeCommand.js +1 -1
- package/lib/esm/internal/app-binder/command/EditExternalAddressScopeCommand.js.map +3 -3
- package/lib/esm/internal/app-binder/command/ProvideContactCommand.js +2 -0
- package/lib/esm/internal/app-binder/command/ProvideContactCommand.js.map +7 -0
- package/lib/esm/internal/app-binder/command/ProvideContactCommand.test.js +2 -0
- package/lib/esm/internal/app-binder/command/ProvideContactCommand.test.js.map +7 -0
- package/lib/esm/internal/app-binder/command/RegisterIdentityCommand.js +1 -1
- package/lib/esm/internal/app-binder/command/RegisterIdentityCommand.js.map +3 -3
- package/lib/esm/internal/app-binder/command/RenameContactCommand.js +1 -1
- package/lib/esm/internal/app-binder/command/RenameContactCommand.js.map +3 -3
- package/lib/esm/internal/app-binder/command/RenameContactCommand.test.js +1 -1
- package/lib/esm/internal/app-binder/command/RenameContactCommand.test.js.map +3 -3
- package/lib/esm/internal/app-binder/contactsVersionGuards.js +1 -1
- package/lib/esm/internal/app-binder/contactsVersionGuards.js.map +3 -3
- package/lib/esm/internal/app-binder/contactsVersionGuards.test.js +1 -1
- package/lib/esm/internal/app-binder/contactsVersionGuards.test.js.map +3 -3
- package/lib/esm/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.js +1 -1
- package/lib/esm/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.js.map +3 -3
- package/lib/esm/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js +1 -1
- package/lib/esm/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.test.js.map +3 -3
- package/lib/esm/internal/app-binder/model/contactsConstants.js +1 -1
- package/lib/esm/internal/app-binder/model/contactsConstants.js.map +3 -3
- package/lib/esm/internal/app-binder/model/contactsErrors.js +1 -1
- package/lib/esm/internal/app-binder/model/contactsErrors.js.map +3 -3
- package/lib/esm/internal/app-binder/services/provideContact.js +2 -0
- package/lib/esm/internal/app-binder/services/provideContact.js.map +7 -0
- package/lib/esm/internal/app-binder/services/provideContact.test.js +2 -0
- package/lib/esm/internal/app-binder/services/provideContact.test.js.map +7 -0
- package/lib/esm/internal/app-binder/task/SendRegisterIdentityTask.js.map +2 -2
- package/lib/esm/internal/app-binder/task/SendRegisterIdentityTask.test.js.map +1 -1
- package/lib/esm/internal/app-binder/task/SendRenameContactTask.js +1 -1
- package/lib/esm/internal/app-binder/task/SendRenameContactTask.js.map +2 -2
- package/lib/esm/internal/app-binder/task/SendRenameContactTask.test.js +1 -1
- package/lib/esm/internal/app-binder/task/SendRenameContactTask.test.js.map +3 -3
- package/lib/esm/package.json +2 -2
- package/lib/types/api/app-binder/RenameContactDeviceActionTypes.d.ts +2 -1
- package/lib/types/api/app-binder/RenameContactDeviceActionTypes.d.ts.map +1 -1
- package/lib/types/api/index.d.ts +4 -1
- package/lib/types/api/index.d.ts.map +1 -1
- package/lib/types/api/model/ContactsVersionRequirements.d.ts +38 -23
- package/lib/types/api/model/ContactsVersionRequirements.d.ts.map +1 -1
- package/lib/types/api/model/ProvideContact.d.ts +20 -0
- package/lib/types/api/model/ProvideContact.d.ts.map +1 -0
- package/lib/types/api/model/RenameContact.d.ts +5 -3
- package/lib/types/api/model/RenameContact.d.ts.map +1 -1
- package/lib/types/internal/app-binder/command/EditExternalAddressIdentifierCommand.d.ts.map +1 -1
- package/lib/types/internal/app-binder/command/EditExternalAddressScopeCommand.d.ts.map +1 -1
- package/lib/types/internal/app-binder/command/ProvideContactCommand.d.ts +18 -0
- package/lib/types/internal/app-binder/command/ProvideContactCommand.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/ProvideContactCommand.test.d.ts +2 -0
- package/lib/types/internal/app-binder/command/ProvideContactCommand.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/command/RegisterIdentityCommand.d.ts.map +1 -1
- package/lib/types/internal/app-binder/command/RenameContactCommand.d.ts.map +1 -1
- package/lib/types/internal/app-binder/contactsVersionGuards.d.ts +9 -1
- package/lib/types/internal/app-binder/contactsVersionGuards.d.ts.map +1 -1
- package/lib/types/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.d.ts +4 -3
- package/lib/types/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.d.ts.map +1 -1
- package/lib/types/internal/app-binder/model/contactsConstants.d.ts +2 -0
- package/lib/types/internal/app-binder/model/contactsConstants.d.ts.map +1 -1
- package/lib/types/internal/app-binder/model/contactsErrors.d.ts +21 -2
- package/lib/types/internal/app-binder/model/contactsErrors.d.ts.map +1 -1
- package/lib/types/internal/app-binder/services/provideContact.d.ts +15 -0
- package/lib/types/internal/app-binder/services/provideContact.d.ts.map +1 -0
- package/lib/types/internal/app-binder/services/provideContact.test.d.ts +2 -0
- package/lib/types/internal/app-binder/services/provideContact.test.d.ts.map +1 -0
- package/lib/types/internal/app-binder/task/SendRegisterIdentityTask.d.ts.map +1 -1
- package/lib/types/internal/app-binder/task/SendRenameContactTask.d.ts +8 -0
- package/lib/types/internal/app-binder/task/SendRenameContactTask.d.ts.map +1 -1
- package/lib/types/tsconfig.prod.tsbuildinfo +1 -1
- package/package.json +6 -6
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../../../src/internal/app-binder/task/SendRenameContactTask.test.ts"],
|
|
4
|
-
"sourcesContent": ["// Validates that the TLV serializer + tag ordering + chunk framing produce the\n// expected wire bytes for the Rename Contact (EDIT CONTACT NAME) op. The framed\n// chunk = 2-byte BE total length + TLV. Tag order: STRUCT_TYPE, STRUCT_VERSION,\n// CONTACT_NAME (new), PREVIOUS_CONTACT_NAME (old), GROUP_HANDLE,
|
|
5
|
-
"mappings": "
|
|
6
|
-
"names": ["CommandResultFactory", "InvalidStatusWordError", "RenameContactCommand", "SendRenameContactTask", "hexToBytes", "hex", "out", "i", "GROUP_HANDLE", "HMAC_PROOF_IN", "HMAC_PROOF_OUT", "
|
|
4
|
+
"sourcesContent": ["// Validates that the TLV serializer + tag ordering + chunk framing produce the\n// expected wire bytes for the Rename Contact (EDIT CONTACT NAME) op. The framed\n// chunk = 2-byte BE total length + TLV. Tag order: STRUCT_TYPE, STRUCT_VERSION,\n// CONTACT_NAME (new), PREVIOUS_CONTACT_NAME (old), GROUP_HANDLE, HMAC_PROOF \u2014\n// with tags >= 0x80 (0xf0/0xf3/0xf6) encoded as the 2-byte DER form [0x81, tag].\n// DERIVATION_PATH (tag 0x69) is CONDITIONAL (DSDK-1481): omitted by default (the\n// GA payload), and inserted between GROUP_HANDLE and HMAC_PROOF only when the\n// caller passes includeDerivationPath \u2014 the shape older OS builds still require.\nimport {\n CommandResultFactory,\n type InternalApi,\n InvalidStatusWordError,\n} from \"@ledgerhq/device-management-kit\";\n\nimport { RenameContactCommand } from \"@internal/app-binder/command/RenameContactCommand\";\n\nimport { SendRenameContactTask } from \"./SendRenameContactTask\";\n\nfunction hexToBytes(hex: string): Uint8Array {\n const out = new Uint8Array(hex.length / 2);\n for (let i = 0; i < hex.length; i += 2) {\n out[i / 2] = parseInt(hex.slice(i, i + 2), 16);\n }\n return out;\n}\n\nconst GROUP_HANDLE = hexToBytes(\"cc\".repeat(64));\nconst HMAC_PROOF_IN = hexToBytes(\"dd\".repeat(32));\nconst HMAC_PROOF_OUT = hexToBytes(\"ee\".repeat(32));\n\n// Framed chunk = \"00 79\" (2-byte BE total TLV length = 121) + TLV:\n// 01 01 2e STRUCT_TYPE = EDIT_CONTACT_NAME (0x2e)\n// 02 01 01 STRUCT_VERSION = 1\n// 81 f0 03 \"Bob\" CONTACT_NAME (new), tag 0xf0 -> [81 f0]\n// 81 f3 05 \"Alice\" PREVIOUS_CONTACT_NAME (old), tag 0xf3 -> [81 f3]\n// 81 f6 40 <64x cc> GROUP_HANDLE, tag 0xf6 -> [81 f6]\n// 29 20 <32x dd> HMAC_PROOF\nconst FRAMED_CHUNK = hexToBytes(\n \"0079\" +\n \"01012e\" +\n \"020101\" +\n \"81f003426f62\" +\n \"81f305416c696365\" +\n \"81f640\" +\n \"cc\".repeat(64) +\n \"2920\" +\n \"dd\".repeat(32),\n);\n\nfunction makeApiMock(): InternalApi & {\n sendCommand: ReturnType<typeof vi.fn>;\n} {\n return { sendCommand: vi.fn() } as unknown as InternalApi & {\n sendCommand: ReturnType<typeof vi.fn>;\n };\n}\n\ndescribe(\"SendRenameContactTask\", () => {\n it(\"assembles the rename framed chunk and dispatches RenameContactCommand\", async () => {\n const api = makeApiMock();\n api.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ data: { hmacProof: HMAC_PROOF_OUT } }),\n );\n\n const result = await new SendRenameContactTask(api, {\n previousContactName: \"Alice\",\n newContactName: \"Bob\",\n groupHandle: GROUP_HANDLE,\n hmacProof: HMAC_PROOF_IN,\n }).run();\n\n expect(api.sendCommand.mock.calls).toHaveLength(1);\n expect(api.sendCommand.mock.calls[0]![0]).toStrictEqual(\n new RenameContactCommand({ data: FRAMED_CHUNK, p2: 0x00 }),\n );\n expect(result).toStrictEqual(\n CommandResultFactory({ data: { hmacProof: HMAC_PROOF_OUT } }),\n );\n });\n\n it(\"does not emit a DERIVATION_PATH tag by default\", async () => {\n const api = makeApiMock();\n api.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ data: { hmacProof: HMAC_PROOF_OUT } }),\n );\n\n await new SendRenameContactTask(api, {\n previousContactName: \"Alice\",\n newContactName: \"Bob\",\n groupHandle: GROUP_HANDLE,\n hmacProof: HMAC_PROOF_IN,\n }).run();\n\n // GA payload (includeDerivationPath omitted): newer OS builds reject tag\n // 0x69, so HMAC_PROOF (0x29) follows GROUP_HANDLE directly.\n const command = api.sendCommand.mock.calls[0]![0] as RenameContactCommand;\n const framedHex = Buffer.from(command.args.data).toString(\"hex\");\n expect(framedHex).not.toContain(\"6915\");\n expect(\n framedHex.endsWith(\"81f640\" + \"cc\".repeat(64) + \"2920\" + \"dd\".repeat(32)),\n ).toBe(true);\n });\n\n it(\"emits the DERIVATION_PATH tag when includeDerivationPath is set\", async () => {\n const api = makeApiMock();\n api.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({ data: { hmacProof: HMAC_PROOF_OUT } }),\n );\n\n await new SendRenameContactTask(api, {\n previousContactName: \"Alice\",\n newContactName: \"Bob\",\n groupHandle: GROUP_HANDLE,\n hmacProof: HMAC_PROOF_IN,\n includeDerivationPath: true,\n }).run();\n\n // Older OS builds (below the model cutoff) mandate tag 0x69. The path TLV\n // (fixed m/44'/60'/0'/0/0) sits between GROUP_HANDLE and HMAC_PROOF, and the\n // framed total length grows by its 23 bytes: 0x0079 -> 0x0090.\n // 69 15 05 8000002c 8000003c 80000000 00000000 00000000\n const pathTlv =\n \"6915\" +\n \"05\" +\n \"8000002c\" +\n \"8000003c\" +\n \"80000000\" +\n \"00000000\" +\n \"00000000\";\n const expectedFramed = hexToBytes(\n \"0090\" +\n \"01012e\" +\n \"020101\" +\n \"81f003426f62\" +\n \"81f305416c696365\" +\n \"81f640\" +\n \"cc\".repeat(64) +\n pathTlv +\n \"2920\" +\n \"dd\".repeat(32),\n );\n const command = api.sendCommand.mock.calls[0]![0] as RenameContactCommand;\n expect(command).toStrictEqual(\n new RenameContactCommand({ data: expectedFramed, p2: 0x00 }),\n );\n });\n\n it(\"propagates command-level errors\", async () => {\n const api = makeApiMock();\n api.sendCommand.mockResolvedValueOnce(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"user cancelled\"),\n }),\n );\n\n const result = await new SendRenameContactTask(api, {\n previousContactName: \"Alice\",\n newContactName: \"Bob\",\n groupHandle: GROUP_HANDLE,\n hmacProof: HMAC_PROOF_IN,\n }).run();\n\n expect(result).toStrictEqual(\n CommandResultFactory({\n error: new InvalidStatusWordError(\"user cancelled\"),\n }),\n );\n });\n\n it(\"returns InvalidStatusWordError when the final response carries no hmac_name\", async () => {\n const api = makeApiMock();\n api.sendCommand.mockResolvedValueOnce(CommandResultFactory({ data: {} }));\n\n const result = await new SendRenameContactTask(api, {\n previousContactName: \"Alice\",\n newContactName: \"Bob\",\n groupHandle: GROUP_HANDLE,\n hmacProof: HMAC_PROOF_IN,\n }).run();\n\n expect(result.status).not.toBe(undefined);\n if (\"error\" in result) {\n expect(result.error).toBeInstanceOf(InvalidStatusWordError);\n }\n });\n});\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["CommandResultFactory", "InvalidStatusWordError", "RenameContactCommand", "SendRenameContactTask", "hexToBytes", "hex", "out", "i", "GROUP_HANDLE", "HMAC_PROOF_IN", "HMAC_PROOF_OUT", "FRAMED_CHUNK", "makeApiMock", "api", "result", "command", "framedHex", "expectedFramed"]
|
|
7
7
|
}
|
package/lib/esm/package.json
CHANGED
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"license": "Apache-2.0",
|
|
37
37
|
"name": "@ledgerhq/device-contacts-kit",
|
|
38
38
|
"peerDependencies": {
|
|
39
|
-
"@ledgerhq/device-management-kit": "^1.
|
|
39
|
+
"@ledgerhq/device-management-kit": "^1.9.0"
|
|
40
40
|
},
|
|
41
41
|
"private": false,
|
|
42
42
|
"repository": {
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"watch:builds": "pnpm ldmk-tool watch --entryPoints src/index.ts,src/**/*.ts --tsconfig tsconfig.prod.json",
|
|
59
59
|
"watch:types": "concurrently \"tsc --watch -p tsconfig.prod.json\" \"tsc-alias --watch -p tsconfig.prod.json\""
|
|
60
60
|
},
|
|
61
|
-
"version": "0.
|
|
61
|
+
"version": "0.4.1"
|
|
62
62
|
}
|
|
@@ -9,7 +9,7 @@ import { type ContactsValidationError } from "../../internal/app-binder/model/co
|
|
|
9
9
|
*/
|
|
10
10
|
export type RenameContactDAInput = RenameContactInput;
|
|
11
11
|
export type RenameContactDAOutput = RenameContactOutput;
|
|
12
|
-
export type RenameContactDAError = GoToDashboardDAError | ContactsValidationError | ContactsVersionRequirementError | CommandErrorResult<ContactsErrorCodes>["error"];
|
|
12
|
+
export type RenameContactDAError = GoToDashboardDAError | ContactsValidationError | ContactsVersionRequirementError | CommandErrorResult["error"] | CommandErrorResult<ContactsErrorCodes>["error"];
|
|
13
13
|
export type RenameContactDARequiredInteraction = GoToDashboardDARequiredInteraction | UserInteractionRequired.RegisterWallet;
|
|
14
14
|
export type RenameContactDAIntermediateValue = {
|
|
15
15
|
readonly requiredUserInteraction: RenameContactDARequiredInteraction;
|
|
@@ -17,6 +17,7 @@ export type RenameContactDAIntermediateValue = {
|
|
|
17
17
|
export type RenameContactDAState = DeviceActionState<RenameContactDAOutput, RenameContactDAError, RenameContactDAIntermediateValue>;
|
|
18
18
|
export type RenameContactDAInternalState = {
|
|
19
19
|
readonly error: RenameContactDAError | null;
|
|
20
|
+
readonly osVersion: string | null;
|
|
20
21
|
readonly proof: {
|
|
21
22
|
readonly hmacProof: Uint8Array;
|
|
22
23
|
} | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenameContactDeviceActionTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/RenameContactDeviceActionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,kCAAkC,EACvC,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,+BAA+B,EACrC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAE7F;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAC5B,oBAAoB,GACpB,uBAAuB,GACvB,+BAA+B,
|
|
1
|
+
{"version":3,"file":"RenameContactDeviceActionTypes.d.ts","sourceRoot":"","sources":["../../../../src/api/app-binder/RenameContactDeviceActionTypes.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,6BAA6B,EAClC,KAAK,oBAAoB,EACzB,KAAK,kCAAkC,EACvC,KAAK,uBAAuB,EAC7B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,EACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,+BAA+B,EACrC,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,KAAK,uBAAuB,EAAE,MAAM,+CAA+C,CAAC;AAE7F;;;;GAIG;AACH,MAAM,MAAM,oBAAoB,GAAG,kBAAkB,CAAC;AAEtD,MAAM,MAAM,qBAAqB,GAAG,mBAAmB,CAAC;AAExD,MAAM,MAAM,oBAAoB,GAC5B,oBAAoB,GACpB,uBAAuB,GACvB,+BAA+B,GAI/B,kBAAkB,CAAC,OAAO,CAAC,GAC3B,kBAAkB,CAAC,kBAAkB,CAAC,CAAC,OAAO,CAAC,CAAC;AAEpD,MAAM,MAAM,kCAAkC,GAC1C,kCAAkC,GAClC,uBAAuB,CAAC,cAAc,CAAC;AAE3C,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,CAAC,uBAAuB,EAAE,kCAAkC,CAAC;CACtE,CAAC;AAEF,MAAM,MAAM,oBAAoB,GAAG,iBAAiB,CAClD,qBAAqB,EACrB,oBAAoB,EACpB,gCAAgC,CACjC,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,KAAK,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAI5C,QAAQ,CAAC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IAClC,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;KAChC,GAAG,IAAI,CAAC;CACV,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG,6BAA6B,CACnE,qBAAqB,EACrB,oBAAoB,EACpB,gCAAgC,CACjC,CAAC"}
|
package/lib/types/api/index.d.ts
CHANGED
|
@@ -4,9 +4,12 @@ export { type RegisterExternalAddressDAError, type RegisterExternalAddressDAInpu
|
|
|
4
4
|
export { type RenameContactDAError, type RenameContactDAInput, type RenameContactDAIntermediateValue, type RenameContactDAOutput, type RenameContactDARequiredInteraction, type RenameContactDAReturnType, type RenameContactDAState, } from "./app-binder/RenameContactDeviceActionTypes";
|
|
5
5
|
export { type ContactsManager } from "./ContactsManager";
|
|
6
6
|
export { ContactsManagerBuilder } from "./ContactsManagerBuilder";
|
|
7
|
-
export { CONTACTS_VERSION_REQUIREMENTS, type ContactsModelRequirement, type ContactsModelSupport, type ContactsModelUnsupported, type
|
|
7
|
+
export { CONTACTS_VERSION_REQUIREMENTS, type ContactsModelRequirement, type ContactsModelSupport, type ContactsModelUnsupported, type ContactsVersionRequirements, ETHEREUM_APP_NAME, isVersionAtLeast, resolveContactsVersionRequirements, } from "./model/ContactsVersionRequirements";
|
|
8
8
|
export { type EditExternalAddressIdentifierInput, type EditExternalAddressIdentifierOutput, } from "./model/EditExternalAddressIdentifier";
|
|
9
9
|
export { type EditExternalAddressScopeInput, type EditExternalAddressScopeOutput, } from "./model/EditExternalAddressScope";
|
|
10
|
+
export { type ProvideContactInput } from "./model/ProvideContact";
|
|
10
11
|
export { type ExistingContactGroup, type RegisterExternalAddressInput, type RegisterExternalAddressMode, type RegisterExternalAddressOutput, } from "./model/RegisterExternalAddress";
|
|
11
12
|
export { type RenameContactInput, type RenameContactOutput, } from "./model/RenameContact";
|
|
13
|
+
export { type ContactsErrorCodes } from "../internal/app-binder/model/contactsErrors";
|
|
14
|
+
export { buildProvideContactPayload, sendProvideContactPayload, type SendProvideContactPayloadArgs, } from "../internal/app-binder/services/provideContact";
|
|
12
15
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oCAAoC,EACzC,KAAK,oCAAoC,EACzC,KAAK,gDAAgD,EACrD,KAAK,qCAAqC,EAC1C,KAAK,kDAAkD,EACvD,KAAK,yCAAyC,EAC9C,KAAK,oCAAoC,GAC1C,MAAM,gEAAgE,CAAC;AACxE,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACpC,KAAK,2CAA2C,EAChD,KAAK,gCAAgC,EACrC,KAAK,6CAA6C,EAClD,KAAK,oCAAoC,EACzC,KAAK,+BAA+B,GACrC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,0CAA0C,EAC/C,KAAK,+BAA+B,EACpC,KAAK,4CAA4C,EACjD,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,GACpC,MAAM,0DAA0D,CAAC;AAClE,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,kCAAkC,EACvC,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,GAC1B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACL,6BAA6B,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/api/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,oCAAoC,EACzC,KAAK,oCAAoC,EACzC,KAAK,gDAAgD,EACrD,KAAK,qCAAqC,EAC1C,KAAK,kDAAkD,EACvD,KAAK,yCAAyC,EAC9C,KAAK,oCAAoC,GAC1C,MAAM,gEAAgE,CAAC;AACxE,OAAO,EACL,KAAK,+BAA+B,EACpC,KAAK,+BAA+B,EACpC,KAAK,2CAA2C,EAChD,KAAK,gCAAgC,EACrC,KAAK,6CAA6C,EAClD,KAAK,oCAAoC,EACzC,KAAK,+BAA+B,GACrC,MAAM,2DAA2D,CAAC;AACnE,OAAO,EACL,KAAK,8BAA8B,EACnC,KAAK,8BAA8B,EACnC,KAAK,0CAA0C,EAC/C,KAAK,+BAA+B,EACpC,KAAK,4CAA4C,EACjD,KAAK,mCAAmC,EACxC,KAAK,8BAA8B,GACpC,MAAM,0DAA0D,CAAC;AAClE,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gCAAgC,EACrC,KAAK,qBAAqB,EAC1B,KAAK,kCAAkC,EACvC,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,GAC1B,MAAM,gDAAgD,CAAC;AACxD,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAAE,sBAAsB,EAAE,MAAM,6BAA6B,CAAC;AACrE,OAAO,EACL,6BAA6B,EAC7B,KAAK,wBAAwB,EAC7B,KAAK,oBAAoB,EACzB,KAAK,wBAAwB,EAC7B,KAAK,2BAA2B,EAChC,iBAAiB,EACjB,gBAAgB,EAChB,kCAAkC,GACnC,MAAM,wCAAwC,CAAC;AAChD,OAAO,EACL,KAAK,kCAAkC,EACvC,KAAK,mCAAmC,GACzC,MAAM,0CAA0C,CAAC;AAClD,OAAO,EACL,KAAK,6BAA6B,EAClC,KAAK,8BAA8B,GACpC,MAAM,qCAAqC,CAAC;AAC7C,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AACrE,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,4BAA4B,EACjC,KAAK,2BAA2B,EAChC,KAAK,6BAA6B,GACnC,MAAM,oCAAoC,CAAC;AAC5C,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,mBAAmB,GACzB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AACpF,OAAO,EACL,0BAA0B,EAC1B,yBAAyB,EACzB,KAAK,6BAA6B,GACnC,MAAM,8CAA8C,CAAC"}
|
|
@@ -15,6 +15,18 @@ export type ContactsModelSupport = {
|
|
|
15
15
|
readonly supported: true;
|
|
16
16
|
readonly minOsVersion: string;
|
|
17
17
|
readonly minAppVersion: Readonly<Record<string, string>>;
|
|
18
|
+
/**
|
|
19
|
+
* TEMPORARY (DSDK-1481) — the first OS build for this model that no longer
|
|
20
|
+
* wants the `DERIVATION_PATH` (tag 0x69) on EDIT CONTACT NAME. Rename is
|
|
21
|
+
* served by the OS, and OS builds *below* this version still require the path
|
|
22
|
+
* (omitting it yields 0x686A), while this build and later reject it
|
|
23
|
+
* (0x6A80). So the path is sent only when the device OS is below this
|
|
24
|
+
* cutoff. Absent means the model never wanted the path (send nothing — the
|
|
25
|
+
* GA end-state). Delete this field, its constants, and
|
|
26
|
+
* {@link renameRequiresDerivationPath} once no in-the-field OS predates the
|
|
27
|
+
* cutoff.
|
|
28
|
+
*/
|
|
29
|
+
readonly renameDerivationPathRequiredBelowOsVersion?: string;
|
|
18
30
|
};
|
|
19
31
|
/** Marks a device model on which Contacts is not supported at all. */
|
|
20
32
|
export type ContactsModelUnsupported = {
|
|
@@ -31,8 +43,8 @@ export type ContactsVersionRequirements = Readonly<Record<DeviceModelId, Contact
|
|
|
31
43
|
/** The name of the Ethereum embedded app (the only app supported in v1). */
|
|
32
44
|
export declare const ETHEREUM_APP_NAME = "Ethereum";
|
|
33
45
|
/**
|
|
34
|
-
* Contacts APDUs are supported
|
|
35
|
-
*
|
|
46
|
+
* Contacts APDUs are supported on the touchscreen device models (Stax, Flex,
|
|
47
|
+
* Apex) and on Nano X / Nano SP. Nano S does not support Contacts at all.
|
|
36
48
|
*/
|
|
37
49
|
export declare const CONTACTS_VERSION_REQUIREMENTS: ContactsVersionRequirements;
|
|
38
50
|
/**
|
|
@@ -42,29 +54,32 @@ export declare const CONTACTS_VERSION_REQUIREMENTS: ContactsVersionRequirements;
|
|
|
42
54
|
export declare function resolveContactsVersionRequirements(deviceModelId: DeviceModelId): ContactsModelRequirement;
|
|
43
55
|
/**
|
|
44
56
|
* Whether `actual` is greater than or equal to `minimum`, comparing as semver.
|
|
45
|
-
* Tolerant of non-strict version strings
|
|
46
|
-
*
|
|
47
|
-
*
|
|
57
|
+
* Tolerant of non-strict version strings and prerelease/build tags (coerces
|
|
58
|
+
* both sides, which drops them) so a release candidate such as `1.7.0-rc2`
|
|
59
|
+
* counts as meeting a `1.7.0` minimum. Returns `false` (i.e. requirement not
|
|
60
|
+
* met) when either version cannot be parsed, so an unknown version never
|
|
61
|
+
* passes a check.
|
|
48
62
|
*/
|
|
49
63
|
export declare function isVersionAtLeast(actual: string, minimum: string): boolean;
|
|
50
|
-
/** Inputs for {@link isContactsSupported}. */
|
|
51
|
-
export type ContactsSupportQuery = {
|
|
52
|
-
readonly deviceModelId: DeviceModelId;
|
|
53
|
-
/** The device OS (firmware) version. */
|
|
54
|
-
readonly osVersion: string;
|
|
55
|
-
/** The name of the currently running embedded app. */
|
|
56
|
-
readonly appName: string;
|
|
57
|
-
/** The version of the currently running embedded app. */
|
|
58
|
-
readonly appVersion: string;
|
|
59
|
-
};
|
|
60
64
|
/**
|
|
61
|
-
* Whether
|
|
62
|
-
*
|
|
63
|
-
*
|
|
64
|
-
*
|
|
65
|
-
*
|
|
66
|
-
*
|
|
67
|
-
*
|
|
65
|
+
* Whether `actual` is strictly less than `boundary`, comparing as semver with
|
|
66
|
+
* prerelease precedence preserved — unlike {@link isVersionAtLeast}, neither
|
|
67
|
+
* side is coerced, so `1.7.0-rc2` sorts *below* `1.7.0-rc3` (and both below the
|
|
68
|
+
* `1.7.0` release). Used to tell release candidates apart for the DSDK-1481
|
|
69
|
+
* derivation-path cutoff, which `isVersionAtLeast` cannot do (it drops the
|
|
70
|
+
* `-rcN` tag). Requires strict semver on both sides; returns `false` when
|
|
71
|
+
* either cannot be parsed, so an unknown version is treated as *not* below the
|
|
72
|
+
* boundary (i.e. the newer/GA payload shape).
|
|
73
|
+
*/
|
|
74
|
+
export declare function isVersionBelow(actual: string, boundary: string): boolean;
|
|
75
|
+
/**
|
|
76
|
+
* TEMPORARY (DSDK-1481) — whether the EDIT CONTACT NAME (rename) payload must
|
|
77
|
+
* carry the `DERIVATION_PATH` (tag 0x69) for a device on `osVersion`. True only
|
|
78
|
+
* when the model is supported, declares a
|
|
79
|
+
* {@link ContactsModelSupport.renameDerivationPathRequiredBelowOsVersion}
|
|
80
|
+
* cutoff, and the fresh device OS version is strictly below that cutoff
|
|
81
|
+
* (prerelease-aware). Callers pass the OS version read freshly from the device
|
|
82
|
+
* (not the session state, which may be stale/absent on the dashboard path).
|
|
68
83
|
*/
|
|
69
|
-
export declare function
|
|
84
|
+
export declare function renameRequiresDerivationPath(deviceModelId: DeviceModelId, osVersion: string): boolean;
|
|
70
85
|
//# sourceMappingURL=ContactsVersionRequirements.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContactsVersionRequirements.d.ts","sourceRoot":"","sources":["../../../../src/api/model/ContactsVersionRequirements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGhE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ContactsVersionRequirements.d.ts","sourceRoot":"","sources":["../../../../src/api/model/ContactsVersionRequirements.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAGhE;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,SAAS,EAAE,IAAI,CAAC;IACzB,QAAQ,CAAC,YAAY,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,aAAa,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;IACzD;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,0CAA0C,CAAC,EAAE,MAAM,CAAC;CAC9D,CAAC;AAEF,sEAAsE;AACtE,MAAM,MAAM,wBAAwB,GAAG;IACrC,QAAQ,CAAC,SAAS,EAAE,KAAK,CAAC;CAC3B,CAAC;AAEF,MAAM,MAAM,wBAAwB,GAChC,oBAAoB,GACpB,wBAAwB,CAAC;AAE7B;;;;;GAKG;AACH,MAAM,MAAM,2BAA2B,GAAG,QAAQ,CAChD,MAAM,CAAC,aAAa,EAAE,wBAAwB,CAAC,CAChD,CAAC;AAEF,4EAA4E;AAC5E,eAAO,MAAM,iBAAiB,aAAa,CAAC;AAwB5C;;;GAGG;AACH,eAAO,MAAM,6BAA6B,EAAE,2BAgC3C,CAAC;AAEF;;;GAGG;AACH,wBAAgB,kCAAkC,CAChD,aAAa,EAAE,aAAa,GAC3B,wBAAwB,CAE1B;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAKzE;AAED;;;;;;;;;GASG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAKxE;AAED;;;;;;;;GAQG;AACH,wBAAgB,4BAA4B,CAC1C,aAAa,EAAE,aAAa,EAC5B,SAAS,EAAE,MAAM,GAChB,OAAO,CAMT"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Everything the device needs to accept a registered external contact as a
|
|
3
|
+
* decoration for an upcoming signing flow: the name-level material shared by
|
|
4
|
+
* the whole contact group, plus the address-level material of the one matched
|
|
5
|
+
* address.
|
|
6
|
+
*/
|
|
7
|
+
export type ProvideContactInput = {
|
|
8
|
+
readonly contactName: string;
|
|
9
|
+
readonly scope: string;
|
|
10
|
+
/** Raw bytes, chain-dependent: a 20-byte address for Ethereum. */
|
|
11
|
+
readonly identifier: Uint8Array;
|
|
12
|
+
readonly groupHandle: Uint8Array;
|
|
13
|
+
readonly hmacProof: Uint8Array;
|
|
14
|
+
readonly hmacRest: Uint8Array;
|
|
15
|
+
/** Lowercase family name, e.g. `"ethereum"`. */
|
|
16
|
+
readonly blockchainFamily: string;
|
|
17
|
+
/** Mandatory for Ethereum, omitted for every other family. */
|
|
18
|
+
readonly chainId?: bigint;
|
|
19
|
+
};
|
|
20
|
+
//# sourceMappingURL=ProvideContact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProvideContact.d.ts","sourceRoot":"","sources":["../../../../src/api/model/ProvideContact.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,MAAM,mBAAmB,GAAG;IAChC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,kEAAkE;IAClE,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;IAC9B,gDAAgD;IAChD,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,8DAA8D;IAC9D,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;CAC3B,CAAC"}
|
|
@@ -8,9 +8,11 @@
|
|
|
8
8
|
* name proof needs re-persisting.
|
|
9
9
|
*
|
|
10
10
|
* Proof material (`groupHandle`, `hmacProof`) is passed and returned as raw
|
|
11
|
-
* bytes; the host owns persistence and address-book state.
|
|
12
|
-
*
|
|
13
|
-
* (a
|
|
11
|
+
* bytes; the host owns persistence and address-book state. The rename itself is
|
|
12
|
+
* name-only, so no derivation path is exposed. As a temporary compatibility
|
|
13
|
+
* shim (DSDK-1481), the kit sends a fixed `m/44'/60'/0'/0/0` on the wire only
|
|
14
|
+
* for OS builds below the model's cutoff, which still mandate it; newer builds
|
|
15
|
+
* send nothing. Either way the host never chooses this.
|
|
14
16
|
*/
|
|
15
17
|
export type RenameContactInput = {
|
|
16
18
|
/** The contact's current name, proven to the device via `hmacProof`. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenameContact.d.ts","sourceRoot":"","sources":["../../../../src/api/model/RenameContact.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"RenameContact.d.ts","sourceRoot":"","sources":["../../../../src/api/model/RenameContact.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,MAAM,MAAM,kBAAkB,GAAG;IAC/B,wEAAwE;IACxE,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,mDAAmD;IACnD,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,sEAAsE;IACtE,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,mBAAmB,GAAG;IAChC,8EAA8E;IAC9E,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,mDAAmD;IACnD,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,oDAAoD;IACpD,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC,+EAA+E;IAC/E,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;CAChC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditExternalAddressIdentifierCommand.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/EditExternalAddressIdentifierCommand.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,IAAI,EAGT,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAGnB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"EditExternalAddressIdentifierCommand.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/EditExternalAddressIdentifierCommand.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,IAAI,EAGT,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAGnB,MAAM,iCAAiC,CAAC;AASzC,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,2CAA2C,CAAC;AAGnD,MAAM,MAAM,wCAAwC,GAAG;IACrD,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,4CAA4C,GAAG;IACzD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC,CAAC;AAkBF,qBAAa,oCACX,YACE,OAAO,CACL,4CAA4C,EAC5C,wCAAwC,EACxC,kBAAkB,CACnB;IAEH,QAAQ,CAAC,IAAI,mCAAmC;IAChD,QAAQ,CAAC,IAAI,EAAE,wCAAwC,CAAC;IACxD,OAAO,CAAC,QAAQ,CAAC,WAAW,CACqD;gBAErE,IAAI,EAAE,wCAAwC;IAI1D,OAAO,IAAI,IAAI;IAWf,aAAa,CACX,QAAQ,EAAE,YAAY,GACrB,aAAa,CACd,4CAA4C,EAC5C,kBAAkB,CACnB;CAoCF"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"EditExternalAddressScopeCommand.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/EditExternalAddressScopeCommand.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,IAAI,EAGT,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAGnB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"EditExternalAddressScopeCommand.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/EditExternalAddressScopeCommand.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,KAAK,IAAI,EAGT,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAGnB,MAAM,iCAAiC,CAAC;AASzC,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,2CAA2C,CAAC;AAGnD,MAAM,MAAM,mCAAmC,GAAG;IAChD,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,uCAAuC,GAAG;IACpD;;;;OAIG;IACH,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC,CAAC;AAkBF,qBAAa,+BACX,YACE,OAAO,CACL,uCAAuC,EACvC,mCAAmC,EACnC,kBAAkB,CACnB;IAEH,QAAQ,CAAC,IAAI,8BAA8B;IAC3C,QAAQ,CAAC,IAAI,EAAE,mCAAmC,CAAC;IACnD,OAAO,CAAC,QAAQ,CAAC,WAAW,CACgD;gBAEhE,IAAI,EAAE,mCAAmC;IAIrD,OAAO,IAAI,IAAI;IAWf,aAAa,CACX,QAAQ,EAAE,YAAY,GACrB,aAAa,CACd,uCAAuC,EACvC,kBAAkB,CACnB;CAoCF"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { type Apdu, type ApduResponse, type Command, type CommandResult } from "@ledgerhq/device-management-kit";
|
|
2
|
+
import { type ContactsErrorCodes } from "../../app-binder/model/contactsErrors";
|
|
3
|
+
export type ProvideContactCommandArgs = {
|
|
4
|
+
/** One framed chunk built by sendProvideContactPayload. */
|
|
5
|
+
readonly data: Uint8Array;
|
|
6
|
+
/** 0x00 for the first/only chunk, 0x80 for continuation chunks. */
|
|
7
|
+
readonly p2: number;
|
|
8
|
+
};
|
|
9
|
+
export type ProvideContactCommandResponse = void;
|
|
10
|
+
export declare class ProvideContactCommand implements Command<ProvideContactCommandResponse, ProvideContactCommandArgs, ContactsErrorCodes> {
|
|
11
|
+
readonly name = "provideContact";
|
|
12
|
+
readonly args: ProvideContactCommandArgs;
|
|
13
|
+
private readonly errorHelper;
|
|
14
|
+
constructor(args: ProvideContactCommandArgs);
|
|
15
|
+
getApdu(): Apdu;
|
|
16
|
+
parseResponse(response: ApduResponse): CommandResult<ProvideContactCommandResponse, ContactsErrorCodes>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=ProvideContactCommand.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProvideContactCommand.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/ProvideContactCommand.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,IAAI,EAET,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAEnB,MAAM,iCAAiC,CAAC;AAQzC,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,MAAM,yBAAyB,GAAG;IACtC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAAC;AAEjD,qBAAa,qBACX,YACE,OAAO,CACL,6BAA6B,EAC7B,yBAAyB,EACzB,kBAAkB,CACnB;IAEH,QAAQ,CAAC,IAAI,oBAAoB;IACjC,QAAQ,CAAC,IAAI,EAAE,yBAAyB,CAAC;IACzC,OAAO,CAAC,QAAQ,CAAC,WAAW,CACsC;gBAEtD,IAAI,EAAE,yBAAyB;IAI3C,OAAO,IAAI,IAAI;IAWf,aAAa,CACX,QAAQ,EAAE,YAAY,GACrB,aAAa,CAAC,6BAA6B,EAAE,kBAAkB,CAAC;CASpE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ProvideContactCommand.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/ProvideContactCommand.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RegisterIdentityCommand.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/RegisterIdentityCommand.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,IAAI,EAGT,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAGnB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"RegisterIdentityCommand.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/RegisterIdentityCommand.ts"],"names":[],"mappings":"AAQA,OAAO,EACL,KAAK,IAAI,EAGT,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAGnB,MAAM,iCAAiC,CAAC;AAWzC,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,2CAA2C,CAAC;AAEnD,MAAM,MAAM,2BAA2B,GAAG;IACxC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,+BAA+B,GAAG;IAC5C;;;;;;;OAOG;IACH,QAAQ,CAAC,WAAW,CAAC,EAAE,UAAU,CAAC;IAClC,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,QAAQ,CAAC,EAAE,UAAU,CAAC;CAChC,CAAC;AAkBF,qBAAa,uBACX,YACE,OAAO,CACL,+BAA+B,EAC/B,2BAA2B,EAC3B,kBAAkB,CACnB;IAEH,QAAQ,CAAC,IAAI,sBAAsB;IACnC,QAAQ,CAAC,IAAI,EAAE,2BAA2B,CAAC;IAC3C,OAAO,CAAC,QAAQ,CAAC,WAAW,CACwC;gBAExD,IAAI,EAAE,2BAA2B;IAI7C,OAAO,IAAI,IAAI;IAWf,aAAa,CACX,QAAQ,EAAE,YAAY,GACrB,aAAa,CAAC,+BAA+B,EAAE,kBAAkB,CAAC;CAoDtE"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenameContactCommand.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/RenameContactCommand.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,KAAK,IAAI,EAGT,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAGnB,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"RenameContactCommand.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/command/RenameContactCommand.ts"],"names":[],"mappings":"AAcA,OAAO,EACL,KAAK,IAAI,EAGT,KAAK,YAAY,EACjB,KAAK,OAAO,EACZ,KAAK,aAAa,EAGnB,MAAM,iCAAiC,CAAC;AASzC,OAAO,EAEL,KAAK,kBAAkB,EACxB,MAAM,2CAA2C,CAAC;AAGnD,MAAM,MAAM,wBAAwB,GAAG;IACrC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,EAAE,UAAU,CAAC;IAC1B,mEAAmE;IACnE,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC;;;;OAIG;IACH,QAAQ,CAAC,SAAS,CAAC,EAAE,UAAU,CAAC;CACjC,CAAC;AAkBF,qBAAa,oBACX,YACE,OAAO,CACL,4BAA4B,EAC5B,wBAAwB,EACxB,kBAAkB,CACnB;IAEH,QAAQ,CAAC,IAAI,mBAAmB;IAChC,QAAQ,CAAC,IAAI,EAAE,wBAAwB,CAAC;IACxC,OAAO,CAAC,QAAQ,CAAC,WAAW,CACqC;gBAErD,IAAI,EAAE,wBAAwB;IAI1C,OAAO,IAAI,IAAI;IAWf,aAAa,CACX,QAAQ,EAAE,YAAY,GACrB,aAAa,CAAC,4BAA4B,EAAE,kBAAkB,CAAC;CAoCnE"}
|
|
@@ -15,9 +15,17 @@ export type RunningApp = {
|
|
|
15
15
|
* The running-app dimension is intentionally skipped: on the dashboard there is
|
|
16
16
|
* no embedded app to gate on (the running "app" is BOLOS).
|
|
17
17
|
*
|
|
18
|
+
* The OS `version` is supplied by the caller so it can come from a fresh
|
|
19
|
+
* `GetOsVersion` result rather than the device session state, whose
|
|
20
|
+
* `firmwareVersion` is often absent on the dashboard path (the session
|
|
21
|
+
* refresher and `GoToDashboard` re-read only the running app, never the OS
|
|
22
|
+
* version). The model comes from the session state, which does not change
|
|
23
|
+
* under the caller's feet the way a stale/missing OS version would.
|
|
24
|
+
*
|
|
18
25
|
* @param internalApi - the DeviceAction's internal API for the current session.
|
|
26
|
+
* @param osVersion - the device OS version, read freshly from the device.
|
|
19
27
|
*/
|
|
20
|
-
export declare function
|
|
28
|
+
export declare function isContactsOsVersionSupportedForSession(internalApi: InternalApi, osVersion: string): boolean;
|
|
21
29
|
/**
|
|
22
30
|
* Session-aware Contacts support check, for internal consumption by app-owned
|
|
23
31
|
* Contacts `DeviceAction`s (registering / editing external addresses). These
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contactsVersionGuards.d.ts","sourceRoot":"","sources":["../../../../src/internal/app-binder/contactsVersionGuards.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AAWzC,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AASF
|
|
1
|
+
{"version":3,"file":"contactsVersionGuards.d.ts","sourceRoot":"","sources":["../../../../src/internal/app-binder/contactsVersionGuards.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,WAAW,EACjB,MAAM,iCAAiC,CAAC;AAWzC,gEAAgE;AAChE,MAAM,MAAM,UAAU,GAAG;IACvB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B,CAAC;AASF;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,sCAAsC,CACpD,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,MAAM,GAChB,OAAO,CAQT;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,uCAAuC,CACrD,WAAW,EAAE,WAAW,EACxB,GAAG,EAAE,UAAU,GACd,OAAO,CAiBT"}
|
package/lib/types/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { type DeviceActionStateMachine, type InternalApi, XStateDeviceAction } from "@ledgerhq/device-management-kit";
|
|
1
|
+
import { type DeviceActionStateMachine, type GetOsVersionCommandResult, type InternalApi, XStateDeviceAction } from "@ledgerhq/device-management-kit";
|
|
2
2
|
import { type RenameContactDAError, type RenameContactDAInput, type RenameContactDAIntermediateValue, type RenameContactDAInternalState, type RenameContactDAOutput } from "../../../../api/app-binder/RenameContactDeviceActionTypes";
|
|
3
3
|
import { type RenameContactProof, SendRenameContactTask } from "../../../app-binder/task/SendRenameContactTask";
|
|
4
4
|
export type RenameContactMachineDependencies = {
|
|
5
|
-
readonly
|
|
6
|
-
readonly
|
|
5
|
+
readonly getOsVersion: () => Promise<GetOsVersionCommandResult>;
|
|
6
|
+
readonly isOsVersionSupported: (osVersion: string) => boolean;
|
|
7
|
+
readonly renameContact: (input: RenameContactDAInput, includeDerivationPath: boolean) => Promise<Awaited<ReturnType<SendRenameContactTask["run"]>>>;
|
|
7
8
|
};
|
|
8
9
|
export declare class RenameContactDeviceAction extends XStateDeviceAction<RenameContactDAOutput, RenameContactDAInput, RenameContactDAError, RenameContactDAIntermediateValue, RenameContactDAInternalState> {
|
|
9
10
|
makeStateMachine(internalApi: InternalApi): DeviceActionStateMachine<RenameContactDAOutput, RenameContactDAInput, RenameContactDAError, RenameContactDAIntermediateValue, RenameContactDAInternalState>;
|
package/lib/types/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"RenameContactDeviceAction.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAE7B,KAAK,WAAW,EAKhB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC3B,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"RenameContactDeviceAction.d.ts","sourceRoot":"","sources":["../../../../../../src/internal/app-binder/device-action/RenameContact/RenameContactDeviceAction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,wBAAwB,EAE7B,KAAK,yBAAyB,EAE9B,KAAK,WAAW,EAKhB,kBAAkB,EACnB,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EACL,KAAK,oBAAoB,EACzB,KAAK,oBAAoB,EACzB,KAAK,gCAAgC,EACrC,KAAK,4BAA4B,EACjC,KAAK,qBAAqB,EAC3B,MAAM,gDAAgD,CAAC;AAIxD,OAAO,EACL,KAAK,kBAAkB,EACvB,qBAAqB,EACtB,MAAM,iDAAiD,CAAC;AAIzD,MAAM,MAAM,gCAAgC,GAAG;IAC7C,QAAQ,CAAC,YAAY,EAAE,MAAM,OAAO,CAAC,yBAAyB,CAAC,CAAC;IAChE,QAAQ,CAAC,oBAAoB,EAAE,CAAC,SAAS,EAAE,MAAM,KAAK,OAAO,CAAC;IAC9D,QAAQ,CAAC,aAAa,EAAE,CACtB,KAAK,EAAE,oBAAoB,EAC3B,qBAAqB,EAAE,OAAO,KAC3B,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;CACjE,CAAC;AAEF,qBAAa,yBAA0B,SAAQ,kBAAkB,CAC/D,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gCAAgC,EAChC,4BAA4B,CAC7B;IACC,gBAAgB,CACd,WAAW,EAAE,WAAW,GACvB,wBAAwB,CACzB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,gCAAgC,EAChC,4BAA4B,CAC7B;IAwQD,mBAAmB,CACjB,WAAW,EAAE,WAAW,GACvB,gCAAgC;CAqBpC;AAED,YAAY,EAAE,kBAAkB,EAAE,CAAC"}
|
|
@@ -11,6 +11,8 @@ export declare const CONTACTS_APDU_CLA = 176;
|
|
|
11
11
|
export declare const CONTACTS_APDU_INS = 16;
|
|
12
12
|
/** P1 sub-command selector for REGISTER IDENTITY (register external address). */
|
|
13
13
|
export declare const SUB_CMD_REGISTER_IDENTITY = 1;
|
|
14
|
+
/** P1 sub-command selector for PROVIDE CONTACT (pre-signing decoration). */
|
|
15
|
+
export declare const SUB_CMD_PROVIDE_CONTACT = 32;
|
|
14
16
|
/**
|
|
15
17
|
* P1 sub-command selector for EDIT IDENTIFIER — an address-book app sub-command
|
|
16
18
|
* (CLA 0xB0 / INS 0x10) served by the coin app, never OS-dispatched.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contactsConstants.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/model/contactsConstants.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,MAAO,CAAC;AACtC,eAAO,MAAM,iBAAiB,KAAO,CAAC;AAEtC,iFAAiF;AACjF,eAAO,MAAM,yBAAyB,IAAO,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,IAAO,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,IAAO,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,MAAO,CAAC;AAC5C,eAAO,MAAM,uBAAuB,KAAO,CAAC;AAC5C,eAAO,MAAM,iBAAiB,IAAO,CAAC;AAEtC,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOtE,CAAC"}
|
|
1
|
+
{"version":3,"file":"contactsConstants.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/model/contactsConstants.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,uEAAuE;AACvE,eAAO,MAAM,iBAAiB,MAAO,CAAC;AACtC,eAAO,MAAM,iBAAiB,KAAO,CAAC;AAEtC,iFAAiF;AACjF,eAAO,MAAM,yBAAyB,IAAO,CAAC;AAE9C,4EAA4E;AAC5E,eAAO,MAAM,uBAAuB,KAAO,CAAC;AAE5C;;;GAGG;AACH,eAAO,MAAM,uBAAuB,IAAO,CAAC;AAE5C;;;;GAIG;AACH,eAAO,MAAM,kBAAkB,IAAO,CAAC;AAEvC;;;;;;GAMG;AACH,eAAO,MAAM,uBAAuB,MAAO,CAAC;AAC5C,eAAO,MAAM,uBAAuB,KAAO,CAAC;AAC5C,eAAO,MAAM,iBAAiB,IAAO,CAAC;AAEtC,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,KAAK,CAAC;AACrC,eAAO,MAAM,gBAAgB,KAAK,CAAC;AACnC,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC;;;GAGG;AACH,eAAO,MAAM,eAAe,KAAK,CAAC;AAElC;;;;GAIG;AACH,eAAO,MAAM,yBAAyB,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAOtE,CAAC"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { type CommandErrorArgs, type CommandErrors, DeviceExchangeError, type DmkError } from "@ledgerhq/device-management-kit";
|
|
1
|
+
import { type ApduResponse, type CommandErrorArgs, type CommandErrors, type CommandResult, DeviceExchangeError, type DmkError } from "@ledgerhq/device-management-kit";
|
|
2
|
+
import { CommandErrorHelper } from "@ledgerhq/signer-utils";
|
|
2
3
|
/**
|
|
3
4
|
* Status word returned by the app's Address Book *edit* operations when the
|
|
4
5
|
* seed-bound HMAC / group-handle verification fails — i.e. the entry was
|
|
@@ -10,12 +11,30 @@ import { type CommandErrorArgs, type CommandErrors, DeviceExchangeError, type Dm
|
|
|
10
11
|
* signal that consumers (e.g. Ledger Wallet) can catch to guide the user.
|
|
11
12
|
*/
|
|
12
13
|
export declare const CONTACT_SEED_MISMATCH_ERROR_CODE: "6982";
|
|
13
|
-
export type ContactsErrorCodes = "6982" | "6800" | "6983" | "6984" | "6985" | "6a80" | "6a84" | "6a88" | "6af0" | "6b00" | "6f00";
|
|
14
|
+
export type ContactsErrorCodes = "6982" | "6800" | "6983" | "6984" | "6985" | "686a" | "6a80" | "6a84" | "6a88" | "6af0" | "6b00" | "6f00";
|
|
14
15
|
export declare const CONTACTS_APP_ERRORS: CommandErrors<ContactsErrorCodes>;
|
|
15
16
|
export declare class ContactsCommandError extends DeviceExchangeError<ContactsErrorCodes> {
|
|
16
17
|
constructor(args: CommandErrorArgs<ContactsErrorCodes>);
|
|
17
18
|
}
|
|
18
19
|
export declare const contactsCommandErrorFactory: (args: CommandErrorArgs<ContactsErrorCodes>) => ContactsCommandError;
|
|
20
|
+
/**
|
|
21
|
+
* A {@link CommandErrorHelper} preconfigured with the Contacts error map, that
|
|
22
|
+
* additionally guarantees no address-book command ever surfaces a bare
|
|
23
|
+
* `UnknownDeviceExchangeError`.
|
|
24
|
+
*
|
|
25
|
+
* The base helper maps known status words to a {@link ContactsCommandError} and
|
|
26
|
+
* falls back to the global handler for the rest — which, for a status word in
|
|
27
|
+
* neither the Contacts nor the global dictionary (e.g. 0x686A before it was
|
|
28
|
+
* mapped), yields an `UnknownDeviceExchangeError` whose message is a generic
|
|
29
|
+
* "Unexpected device exchange error happened." with no status word and no
|
|
30
|
+
* guidance. This subclass replaces that specific case with an
|
|
31
|
+
* `InvalidStatusWordError` naming the actual status word and pointing at a
|
|
32
|
+
* firmware/app update, so the host always has something actionable to show.
|
|
33
|
+
*/
|
|
34
|
+
export declare class ContactsCommandErrorHelper<Response> extends CommandErrorHelper<Response, ContactsErrorCodes> {
|
|
35
|
+
constructor();
|
|
36
|
+
getError(apduResponse: ApduResponse): CommandResult<Response, ContactsErrorCodes> | undefined;
|
|
37
|
+
}
|
|
19
38
|
/**
|
|
20
39
|
* Raised by a Contacts `DeviceAction` when the connected device model, app
|
|
21
40
|
* version, or OS version does not meet the Contacts requirements — i.e. the
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"contactsErrors.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/model/contactsErrors.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"contactsErrors.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/model/contactsErrors.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EAErB,KAAK,aAAa,EAClB,KAAK,aAAa,EAClB,mBAAmB,EACnB,KAAK,QAAQ,EAId,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAC;AAE5D;;;;;;;;;GASG;AACH,eAAO,MAAM,gCAAgC,EAAG,MAAe,CAAC;AAEhE,MAAM,MAAM,kBAAkB,GAC1B,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,GACN,MAAM,CAAC;AAEX,eAAO,MAAM,mBAAmB,EAAE,aAAa,CAAC,kBAAkB,CA2BjE,CAAC;AAEF,qBAAa,oBAAqB,SAAQ,mBAAmB,CAAC,kBAAkB,CAAC;gBACnE,IAAI,EAAE,gBAAgB,CAAC,kBAAkB,CAAC;CAGvD;AAED,eAAO,MAAM,2BAA2B,GACtC,MAAM,gBAAgB,CAAC,kBAAkB,CAAC,yBACT,CAAC;AAEpC;;;;;;;;;;;;;GAaG;AACH,qBAAa,0BAA0B,CAAC,QAAQ,CAAE,SAAQ,kBAAkB,CAC1E,QAAQ,EACR,kBAAkB,CACnB;;IAKU,QAAQ,CACf,YAAY,EAAE,YAAY,GACzB,aAAa,CAAC,QAAQ,EAAE,kBAAkB,CAAC,GAAG,SAAS;CAqB3D;AAED;;;;GAIG;AACH,qBAAa,+BAAgC,YAAW,QAAQ;IAI5D,QAAQ,CAAC,OAAO;IAHlB,QAAQ,CAAC,IAAI,qCAAqC;IAClD,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAC;gBAEtB,OAAO,SAAiF;CAEpG"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { type CommandResult, type InternalApi, type LoggerPublisherService } from "@ledgerhq/device-management-kit";
|
|
2
|
+
import { type ProvideContactInput } from "../../../api/model/ProvideContact";
|
|
3
|
+
import { type ContactsErrorCodes } from "../../app-binder/model/contactsErrors";
|
|
4
|
+
/**
|
|
5
|
+
* Encode a matched contact as the PROVIDE CONTACT TLV payload, without the
|
|
6
|
+
* chunk framing. Pure, so callers can build it while matching a recipient
|
|
7
|
+
* against the address book, with no device involved.
|
|
8
|
+
*/
|
|
9
|
+
export declare function buildProvideContactPayload(input: ProvideContactInput): Uint8Array;
|
|
10
|
+
export type SendProvideContactPayloadArgs = {
|
|
11
|
+
readonly payload: Uint8Array;
|
|
12
|
+
readonly logger?: LoggerPublisherService;
|
|
13
|
+
};
|
|
14
|
+
export declare function sendProvideContactPayload(api: InternalApi, { payload, logger }: SendProvideContactPayloadArgs): Promise<CommandResult<void, ContactsErrorCodes>>;
|
|
15
|
+
//# sourceMappingURL=provideContact.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provideContact.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/services/provideContact.ts"],"names":[],"mappings":"AASA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAMrE,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAYpF;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,mBAAmB,GACzB,UAAU,CAkCZ;AAED,MAAM,MAAM,6BAA6B,GAAG;IAC1C,QAAQ,CAAC,OAAO,EAAE,UAAU,CAAC;IAC7B,QAAQ,CAAC,MAAM,CAAC,EAAE,sBAAsB,CAAC;CAC1C,CAAC;AAEF,wBAAgB,yBAAyB,CACvC,GAAG,EAAE,WAAW,EAChB,EAAE,OAAO,EAAE,MAAM,EAAE,EAAE,6BAA6B,GACjD,OAAO,CAAC,aAAa,CAAC,IAAI,EAAE,kBAAkB,CAAC,CAAC,CAQlD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"provideContact.test.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/services/provideContact.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SendRegisterIdentityTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SendRegisterIdentityTask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SendRegisterIdentityTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SendRegisterIdentityTask.ts"],"names":[],"mappings":"AAuBA,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,WAAW,EAGhB,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAEzC,OAAO,EAAE,KAAK,oBAAoB,EAAE,MAAM,oCAAoC,CAAC;AAM/E,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAYpF,MAAM,MAAM,sBAAsB,GAAG;IACnC,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B,QAAQ,CAAC,QAAQ,EAAE,UAAU,CAAC;CAC/B,CAAC;AAEF,MAAM,MAAM,4BAA4B,GAAG;IACzC,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,UAAU,EAAE,UAAU,CAAC;IAChC,QAAQ,CAAC,gBAAgB,EAAE,MAAM,CAAC;IAClC,QAAQ,CAAC,OAAO,CAAC,EAAE,MAAM,CAAC;IAC1B,QAAQ,CAAC,oBAAoB,CAAC,EAAE,oBAAoB,CAAC;IACrD,QAAQ,CAAC,MAAM,CAAC,EAAE,sBAAsB,CAAC;CAC1C,CAAC;AAEF,qBAAa,wBAAwB;IAEjC,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBADJ,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,4BAA4B;IAG/C,GAAG,IAAI,OAAO,CAClB,aAAa,CAAC,sBAAsB,EAAE,kBAAkB,CAAC,CAC1D;IAkCD,OAAO,CAAC,YAAY;CA+CrB"}
|
|
@@ -8,6 +8,14 @@ export type SendRenameContactTaskArgs = {
|
|
|
8
8
|
readonly newContactName: string;
|
|
9
9
|
readonly groupHandle: Uint8Array;
|
|
10
10
|
readonly hmacProof: Uint8Array;
|
|
11
|
+
/**
|
|
12
|
+
* TEMPORARY (DSDK-1481) — emit the `DERIVATION_PATH` (tag 0x69) TLV. Defaults
|
|
13
|
+
* to `false` (the GA payload, path-free). The caller sets it `true` only for
|
|
14
|
+
* OS builds below the model's cutoff, which still mandate the path; see
|
|
15
|
+
* {@link renameRequiresDerivationPath}. Not exposed on the public
|
|
16
|
+
* `RenameContactInput` — the host never chooses this.
|
|
17
|
+
*/
|
|
18
|
+
readonly includeDerivationPath?: boolean;
|
|
11
19
|
readonly logger?: LoggerPublisherService;
|
|
12
20
|
};
|
|
13
21
|
export declare class SendRenameContactTask {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SendRenameContactTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SendRenameContactTask.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SendRenameContactTask.d.ts","sourceRoot":"","sources":["../../../../../src/internal/app-binder/task/SendRenameContactTask.ts"],"names":[],"mappings":"AA4BA,OAAO,EAEL,KAAK,aAAa,EAElB,KAAK,WAAW,EAGhB,KAAK,sBAAsB,EAC5B,MAAM,iCAAiC,CAAC;AAIzC,OAAO,EAAE,KAAK,kBAAkB,EAAE,MAAM,2CAA2C,CAAC;AAYpF,MAAM,MAAM,kBAAkB,GAAG;IAC/B,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;CAChC,CAAC;AAEF,MAAM,MAAM,yBAAyB,GAAG;IACtC,QAAQ,CAAC,mBAAmB,EAAE,MAAM,CAAC;IACrC,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,WAAW,EAAE,UAAU,CAAC;IACjC,QAAQ,CAAC,SAAS,EAAE,UAAU,CAAC;IAC/B;;;;;;OAMG;IACH,QAAQ,CAAC,qBAAqB,CAAC,EAAE,OAAO,CAAC;IACzC,QAAQ,CAAC,MAAM,CAAC,EAAE,sBAAsB,CAAC;CAC1C,CAAC;AAEF,qBAAa,qBAAqB;IAE9B,OAAO,CAAC,QAAQ,CAAC,GAAG;IACpB,OAAO,CAAC,QAAQ,CAAC,IAAI;gBADJ,GAAG,EAAE,WAAW,EAChB,IAAI,EAAE,yBAAyB;IAG5C,GAAG,IAAI,OAAO,CAAC,aAAa,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IA6B3E,OAAO,CAAC,YAAY;CAmCrB"}
|