From b3746a1ae43053032cedd78cc704331a6e628bc7 Mon Sep 17 00:00:00 2001 From: ZhenQian Date: Thu, 7 Nov 2024 10:58:43 +0800 Subject: [PATCH 1/4] feat: add sign sui hash request and uts --- .../__tests__/SuiSignHashRequest.test.ts | 59 ++++++++ packages/ur-registry-sui/src/RegistryType.ts | 3 +- .../ur-registry-sui/src/SuiSignHashRequest.ts | 133 ++++++++++++++++++ packages/ur-registry-sui/src/index.ts | 1 + 4 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts create mode 100644 packages/ur-registry-sui/src/SuiSignHashRequest.ts diff --git a/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts b/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts new file mode 100644 index 00000000..cf81524f --- /dev/null +++ b/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts @@ -0,0 +1,59 @@ +import { SuiSignHashRequest, SuiSignRequest } from "../src"; + +describe("sui-sign-hash-request", () => { + it("should construct an signRequest object from string", () => { + const publicKeyHdPaths = ["m/44'/784'/0'/0'/0'"]; + const xfps = ["52744703"]; + const intentMessage = Buffer.from( + "00000000000301008e5c1c0a270bb73b227ad2d1701b27ccbdedf501524c8a628759710d7876876deaa2b90500000000205b7c8adf36fc382dbbbb813415ab3a9bb2191d74c1f13452da7b889a49c92a650008dc000000000000000020bdf133158235f97b97a650c33c56c70951251a3ec2cfbca1fa1468169d8dfda20202010000010101000101020000010200504886c9ec43bff70af37f55865094cc3a799cb54479f252d30cd3717f15ecdc0209fa408be1a8db94026b34f9e71e39fea21aa7478fcd4f5fabce7c01aa0be284eca2b905000000002031c3a369455d6bd80c7366aa720a45ecaa62f9d92c5416f27ed817bf57850e0814197ba88574f872c9e5da61f6474663eea313ba5b7dd604844ea6321647c31feda2b9050000000020fd09263e975f575ad595e9925272b9a1bc721d5b02def7155dc28ac17d53191f504886c9ec43bff70af37f55865094cc3a799cb54479f252d30cd3717f15ecdcee02000000000000002d31010000000000", + "hex" + ); + const requestID = "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"; + const addresses = [ + Buffer.from( + "504886c9ec43bff70af37f55865094cc3a799cb54479f252d30cd3717f15ecdc", + "hex" + ), + ]; + + const request = SuiSignRequest.constructSuiRequest( + intentMessage, + publicKeyHdPaths, + xfps, + requestID, + addresses, + "Suiet" + ); + const ur = request.toUREncoder(1000).nextPart(); + expect(ur).toBe( + "ur:sui-sign-request/onadtpdagdndcawmgtfrkigrpmndutdnbtkgfssbjnaohkadjpaeaeaeaeaeaxadaemnhhcebkdibdrlfrcpkntdttjocwdisfryweykadgmgsleidlthkjsbtkskoltjnwdoerhahaeaeaeaecxhpkeleurenztetdprkrklyeebzpyftndprcfcajysewneegmtnkglonygasodrihaeayuoaeaeaeaeaeaeaeaecxrywneobzlfecytkgmsolgdsrfnhfstasgydacyfmsatkrfoyzsbbiscmntlgzcoeaoaoadaeaeadadadaeadadaoaeaeadaoaegdfdlnsowpfxrsylbkwflbgolngdmwsfftkknsrefykkwzgmtebntejslbbzwpuoaoaszsfzluvypduymwaojeeeytvdckeszeoecyosflmysngwhepytokeadpkbdvolrwpoerhahaeaeaeaecxehsrotinfehljetpbnjkiypkjpbkfewppkidyttadwghcmwzkbtpchrshglpbaaybbcfkgpdlpjyyajpsovwtnhsynflfgiawyotbwrdhpkitbaalrgloleycmflsrctweoerhahaeaeaeaecxzcasdsfmmshehghttlmdwlmogmjprhoyrfjpcahpaoueylbzhlsalesekigucfctgdfdlnsowpfxrsylbkwflbgolngdmwsfftkknsrefykkwzgmtebntejslbbzwpuowyaoaeaeaeaeaeaeaedpehadaeaeaeaeaeaxlytaaddyoeadlecsdwykcfaxbeykaeykaeykaeykaocygmjyflaxaalyhdcxgdfdlnsowpfxrsylbkwflbgolngdmwsfftkknsrefykkwzgmtebntejslbbzwpuoahihgukpinihjyissejstb" + ); + }); + + it("should construct an signHashRequest object from messageHash", () => { + const publicKeyHdPaths = ["m/44'/784'/0'/0'/0'"]; + const xfps = ["52744703"]; + const messageHash = + "ce035bd8ab6499dcaa01d623aa7c977ec9be13798046ca1f86c9f3ebcd2f4d13"; + const requestID = "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"; + const addresses = [ + Buffer.from( + "504886c9ec43bff70af37f55865094cc3a799cb54479f252d30cd3717f15ecdc", + "hex" + ), + ]; + + const request = SuiSignHashRequest.constructSuiRequest( + messageHash, + publicKeyHdPaths, + xfps, + requestID, + addresses, + "Suiet" + ); + const ur = request.toUREncoder(1000).nextPart(); + expect(ur).toBe( + "ur:sui-sign-hash-request/onadtpdagdndcawmgtfrkigrpmndutdnbtkgfssbjnaoksfziaihdyeoecidieethsideneeesesieiahshsdyehieeneyeohshsemiaesememihiaesidiheheoemesetdyeeeniahsehiyeteniaesiyeoihidiaieeyiyeeieeheoaxlytaaddyoeadlecsdwykcfaxbeykaeykaeykaeykaocygmjyflaxaalyhdcxgdfdlnsowpfxrsylbkwflbgolngdmwsfftkknsrefykkwzgmtebntejslbbzwpuoahihgukpinihjydakpldns" + ); + }); +}); diff --git a/packages/ur-registry-sui/src/RegistryType.ts b/packages/ur-registry-sui/src/RegistryType.ts index a316db93..f6ce1427 100644 --- a/packages/ur-registry-sui/src/RegistryType.ts +++ b/packages/ur-registry-sui/src/RegistryType.ts @@ -2,5 +2,6 @@ import { RegistryType } from "@keystonehq/bc-ur-registry"; export const ExtendedRegistryTypes = { SUI_SIGN_REQUEST: new RegistryType("sui-sign-request", 7101), - SUI_SIGNATURE: new RegistryType("sui-signature", 7102) + SUI_SIGNATURE: new RegistryType("sui-signature", 7102), + SUI_SIGN_HASH_REQUEST: new RegistryType("sui-sign-hash-request", 7103), }; diff --git a/packages/ur-registry-sui/src/SuiSignHashRequest.ts b/packages/ur-registry-sui/src/SuiSignHashRequest.ts new file mode 100644 index 00000000..394e9ea6 --- /dev/null +++ b/packages/ur-registry-sui/src/SuiSignHashRequest.ts @@ -0,0 +1,133 @@ +import { + CryptoKeypath, + extend, + DataItem, + PathComponent, + RegistryItem, + DataItemMap, +} from "@keystonehq/bc-ur-registry"; +import { ExtendedRegistryTypes } from "./RegistryType"; +import * as uuid from "uuid"; + +const { decodeToDataItem, RegistryTypes } = extend; + +enum Keys { + requestId = 1, + messageHash, + derivationPaths, + addresses, + origin, +} + +type signHashRequestProps = { + requestId?: Buffer; + messageHash: string; + derivationPaths: CryptoKeypath[]; + addresses?: Buffer[]; + origin?: string; +}; + +export class SuiSignHashRequest extends RegistryItem { + private requestId?: Buffer; + private messageHash: string; + private derivationPaths: CryptoKeypath[]; + private addresses?: Buffer[]; + private origin?: string; + + getRegistryType = () => ExtendedRegistryTypes.SUI_SIGN_HASH_REQUEST; + + constructor(args: signHashRequestProps) { + super(); + this.requestId = args.requestId; + this.messageHash = args.messageHash; + this.derivationPaths = args.derivationPaths; + this.addresses = args.addresses; + this.origin = args.origin; + } + + public getRequestId = () => this.requestId; + public getMessageHash = () => this.messageHash; + public getDerivationPaths = () => + this.derivationPaths.map((key) => key.getPath()); + public getAddresses = () => this.addresses; + public getOrigin = () => this.origin; + + public toDataItem = () => { + const map: DataItemMap = {}; + if (this.requestId) { + map[Keys.requestId] = new DataItem( + this.requestId, + RegistryTypes.UUID.getTag() + ); + } + if (this.addresses) { + map[Keys.addresses] = this.addresses; + } + if (this.origin) { + map[Keys.origin] = this.origin; + } + + map[Keys.messageHash] = this.messageHash; + map[Keys.derivationPaths] = this.derivationPaths.map((item) => { + const dataItem = item.toDataItem(); + dataItem.setTag(item.getRegistryType().getTag()); + return dataItem; + }); + return new DataItem(map); + }; + + public static fromDataItem = (dataItem: DataItem) => { + const map = dataItem.getData(); + const messageHash = map[Keys.messageHash]; + const derivationPaths = map[Keys.derivationPaths].map((item: DataItem) => + CryptoKeypath.fromDataItem(item) + ); + const addresses = map[Keys.addresses] ? map[Keys.addresses] : undefined; + const requestId = map[Keys.requestId] + ? map[Keys.requestId].getData() + : undefined; + const origin = map[Keys.origin] ? map[Keys.origin] : undefined; + return new SuiSignHashRequest({ + requestId, + messageHash, + derivationPaths, + addresses, + origin, + }); + }; + + public static fromCBOR = (_cborPayload: Buffer) => { + const dataItem = decodeToDataItem(_cborPayload); + return SuiSignHashRequest.fromDataItem(dataItem); + }; + + public static constructSuiRequest( + messageHash: string, + publicKeyHdPath: string[], + xfps: string[], + uuidString: string, + addresses?: Buffer[], + origin?: string + ) { + const publicKeyHdPathObjects = publicKeyHdPath.map((path, index) => { + const paths = path.replace(/[m|M]\//, "").split("/"); + const pathComponent = paths.map((path) => { + const index = parseInt(path.replace("'", "")); + let isHardened = false; + if (path.endsWith("'")) { + isHardened = true; + } + return new PathComponent({ index, hardened: isHardened }); + }); + return new CryptoKeypath(pathComponent, Buffer.from(xfps[index], "hex")); + }); + + return new SuiSignHashRequest({ + requestId: Buffer.from(uuid.parse(uuidString)), + messageHash, + derivationPaths: publicKeyHdPathObjects, + addresses: addresses || undefined, + origin: origin || undefined, + }); + } +} diff --git a/packages/ur-registry-sui/src/index.ts b/packages/ur-registry-sui/src/index.ts index 7989eb26..fda71148 100644 --- a/packages/ur-registry-sui/src/index.ts +++ b/packages/ur-registry-sui/src/index.ts @@ -10,3 +10,4 @@ patchTags( export { SuiSignRequest } from "./SuiSignRequest"; export { SuiSignature } from "./SuiSignature"; +export { SuiSignHashRequest } from "./SuiSignHashRequest"; From f0fd477d53965f5eaabfda5a8bab2bbee661ac03 Mon Sep 17 00:00:00 2001 From: ZhenQian Date: Thu, 7 Nov 2024 10:59:06 +0800 Subject: [PATCH 2/4] chore: run prettier --- package.json | 126 ++++++++++--------- packages/ur-registry-sui/src/SuiSignature.ts | 10 +- 2 files changed, 67 insertions(+), 69 deletions(-) diff --git a/package.json b/package.json index ef0d1949..d8db5a27 100644 --- a/package.json +++ b/package.json @@ -1,64 +1,66 @@ { - "name": "keystone-airgaped-base", - "publishConfig": { - "access": "public" - }, - "packageManager": "pnpm@8.15.5", - "scripts": { - "clean": "./scripts/clean.sh", - "build": "pnpm -r build", - "bootstrap": "pnpm clean && pnpm install", - "lint": "eslint '*/**/*.ts' --quiet --fix", - "prettier:check": "pnpm run prettier --check", - "prettier:fix": "pnpm run prettier --write", - "prettier": "prettier '*/**/*.{js,jsx,ts,tsx}'", - "test": "pnpm -r test", - "prepack": "pnpm -r build" - }, - "jest": { - "modulePathIgnorePatterns": [ - "__data__" - ], - "testEnvironment": "node" - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" + "name": "keystone-airgaped-base", + "publishConfig": { + "access": "public" + }, + "packageManager": "pnpm@8.15.5", + "scripts": { + "clean": "./scripts/clean.sh", + "build": "pnpm -r build", + "bootstrap": "pnpm clean && pnpm install", + "lint": "eslint '*/**/*.ts' --quiet --fix", + "prettier:check": "pnpm run prettier --check", + "prettier:fix": "pnpm run prettier --write", + "prettier": "prettier '*/**/*.{js,jsx,ts,tsx}'", + "test": "pnpm -r test", + "prepack": "pnpm -r build" + }, + "jest": { + "modulePathIgnorePatterns": [ + "__data__" + ], + "testEnvironment": "node" + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + }, + "lint-staged": { + "*.{js,jsx,ts,tsx}": [ + "prettier --write", + "eslint " + ], + "*.json": [ + "prettier --write" + ] + }, + "pnpm": { + "neverBuiltDependencies": [ + "node-hid" + ] + }, + "devDependencies": { + "@babel/cli": "^7.21.5", + "@babel/core": "^7.22.1", + "@babel/plugin-proposal-optional-chaining": "^7.21.0", + "@babel/preset-env": "^7.16.11", + "@babel/preset-typescript": "^7.16.7", + "@types/jest": "^27.4.1", + "@typescript-eslint/eslint-plugin": "^5.14.0", + "@typescript-eslint/parser": "^5.14.0", + "eslint": "^8.10.0", + "eslint-config-prettier": "^8.5.0", + "eslint-plugin-prettier": "^4.0.0", + "git-commit-msg-linter": "^4.1.2", + "husky": "^7.0.4", + "jest": "^27.5.1", + "lint-staged": "^12.3.5", + "prettier": "^2.5.1", + "tsdx": "^0.14.1", + "typescript": "^4.6.2" + }, + "dependencies": { + "uuid": "^8.3.2" } - }, - "lint-staged": { - "*.{js,jsx,ts,tsx}": [ - "prettier --write", - "eslint " - ], - "*.json": [ - "prettier --write" - ] - }, - "pnpm": { - "neverBuiltDependencies": ["node-hid"] - }, - "devDependencies": { - "@babel/cli": "^7.21.5", - "@babel/core": "^7.22.1", - "@babel/plugin-proposal-optional-chaining": "^7.21.0", - "@babel/preset-env": "^7.16.11", - "@babel/preset-typescript": "^7.16.7", - "@types/jest": "^27.4.1", - "@typescript-eslint/eslint-plugin": "^5.14.0", - "@typescript-eslint/parser": "^5.14.0", - "eslint": "^8.10.0", - "eslint-config-prettier": "^8.5.0", - "eslint-plugin-prettier": "^4.0.0", - "git-commit-msg-linter": "^4.1.2", - "husky": "^7.0.4", - "jest": "^27.5.1", - "lint-staged": "^12.3.5", - "prettier": "^2.5.1", - "tsdx": "^0.14.1", - "typescript": "^4.6.2" - }, - "dependencies": { - "uuid": "^8.3.2" - } -} +} \ No newline at end of file diff --git a/packages/ur-registry-sui/src/SuiSignature.ts b/packages/ur-registry-sui/src/SuiSignature.ts index 042e88ae..3bc88193 100644 --- a/packages/ur-registry-sui/src/SuiSignature.ts +++ b/packages/ur-registry-sui/src/SuiSignature.ts @@ -2,7 +2,7 @@ import { extend, DataItem, RegistryItem, - DataItemMap + DataItemMap, } from "@keystonehq/bc-ur-registry"; import { ExtendedRegistryTypes } from "./RegistryType"; @@ -11,7 +11,7 @@ const { RegistryTypes, decodeToDataItem } = extend; enum Keys { requestId = 1, signature, - publicKey + publicKey, } export class SuiSignature extends RegistryItem { @@ -21,11 +21,7 @@ export class SuiSignature extends RegistryItem { getRegistryType = () => ExtendedRegistryTypes.SUI_SIGNATURE; - constructor( - signature: Buffer, - requestId?: Buffer, - publicKey?: Buffer - ) { + constructor(signature: Buffer, requestId?: Buffer, publicKey?: Buffer) { super(); this.signature = signature; this.requestId = requestId; From 6c0c027c06e65b8b95327319067cb95cb1d43ebd Mon Sep 17 00:00:00 2001 From: ZhenQian Date: Fri, 8 Nov 2024 11:53:38 +0800 Subject: [PATCH 3/4] fix: update sign hash request unit test case --- .../__tests__/SuiSignHashRequest.test.ts | 4 +- .../__tests__/SuiSignature.test.ts | 43 ++++++++++++++++--- 2 files changed, 38 insertions(+), 9 deletions(-) diff --git a/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts b/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts index cf81524f..61ca6868 100644 --- a/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts +++ b/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts @@ -35,7 +35,7 @@ describe("sui-sign-hash-request", () => { const xfps = ["52744703"]; const messageHash = "ce035bd8ab6499dcaa01d623aa7c977ec9be13798046ca1f86c9f3ebcd2f4d13"; - const requestID = "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"; + const requestID = "c267e8c4-f363-464e-9f24-c53aabf84fe0"; const addresses = [ Buffer.from( "504886c9ec43bff70af37f55865094cc3a799cb54479f252d30cd3717f15ecdc", @@ -53,7 +53,7 @@ describe("sui-sign-hash-request", () => { ); const ur = request.toUREncoder(1000).nextPart(); expect(ur).toBe( - "ur:sui-sign-hash-request/onadtpdagdndcawmgtfrkigrpmndutdnbtkgfssbjnaoksfziaihdyeoecidieethsideneeesesieiahshsdyehieeneyeohshsemiaesememihiaesidiheheoemesetdyeeeniahsehiyeteniaesiyeoihidiaieeyiyeeieeheoaxlytaaddyoeadlecsdwykcfaxbeykaeykaeykaeykaocygmjyflaxaalyhdcxgdfdlnsowpfxrsylbkwflbgolngdmwsfftkknsrefykkwzgmtebntejslbbzwpuoahihgukpinihjydakpldns" + "ur:sui-sign-hash-request/onadtpdagdsaiovssswfiafgglnedkskftpyyagwvtaoksfziaihdyeoecidieethsideneeesesieiahshsdyehieeneyeohshsemiaesememihiaesidiheheoemesetdyeeeniahsehiyeteniaesiyeoihidiaieeyiyeeieeheoaxlytaaddyoeadlecsdwykcfaxbeykaeykaeykaeykaocygmjyflaxaalyhdcxgdfdlnsowpfxrsylbkwflbgolngdmwsfftkknsrefykkwzgmtebntejslbbzwpuoahihgukpinihjylpbdrnmd" ); }); }); diff --git a/packages/ur-registry-sui/__tests__/SuiSignature.test.ts b/packages/ur-registry-sui/__tests__/SuiSignature.test.ts index e7e76689..475adc69 100644 --- a/packages/ur-registry-sui/__tests__/SuiSignature.test.ts +++ b/packages/ur-registry-sui/__tests__/SuiSignature.test.ts @@ -9,17 +9,15 @@ describe("sui-signature", () => { "47e7b510784406dfa14d9fd13c3834128b49c56ddfc28edb02c5047219779adeed12017e2f9f116e83762e86f805c7311ea88fb403ff21900e069142b1fb310e", "hex" ); - const requestId = Buffer.from(uuid.parse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d")); + const requestId = Buffer.from( + uuid.parse("9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d") + ); const pubKey = Buffer.from( "8e53e7b10656816de70824e3016fc1a277e77825e12825dc4f239f418ab2e04e", "hex" ); - const suiSignature = new SuiSignature( - signature, - requestId, - pubKey - ); + const suiSignature = new SuiSignature(signature, requestId, pubKey); const cborHex = suiSignature.toCBOR().toString("hex"); const ur = suiSignature.toUREncoder(1000).nextPart(); @@ -29,9 +27,40 @@ describe("sui-signature", () => { const suiSignatureDecoded = SuiSignature.fromCBOR( Buffer.from(cborHex, "hex") ); - expect(uuid.stringify(suiSignatureDecoded.getRequestId())).toBe(uuid.stringify(requestId)); + expect(uuid.stringify(suiSignatureDecoded.getRequestId())).toBe( + uuid.stringify(requestId) + ); expect(suiSignatureDecoded.getSignature().toString("hex")).toEqual( "47e7b510784406dfa14d9fd13c3834128b49c56ddfc28edb02c5047219779adeed12017e2f9f116e83762e86f805c7311ea88fb403ff21900e069142b1fb310e" ); }); + + it("should sign messageHash result is equal to the request", () => { + const signature = Buffer.from( + "2b2596eeb2bf21c0444ee4a85960447dbf5144eab6f855594fa836ed1e100bc6e32c04ad15e58d04ac669623f2125fe7154fe3caa7baaaf0243d64f88cd9e903", + "hex" + ); + const requestId = Buffer.from("c267e8c4f363464e9f24c53aabf84fe0", "hex"); + const requestIdHex = "c267e8c4f363464e9f24c53aabf84fe0"; + const formattedUUID = [ + requestIdHex.slice(0, 8), + requestIdHex.slice(8, 12), + requestIdHex.slice(12, 16), + requestIdHex.slice(16, 20), + requestIdHex.slice(20, 32), + ].join("-"); + const receiveRequestId = Buffer.from(uuid.parse(formattedUUID)); + expect(requestId.toString("hex")).toBe(receiveRequestId.toString("hex")); + const pubKey = Buffer.from( + "edbe1b9b3b040ff88fbfa4ccda6f5f8d404ae7ffe35f9b220dec08679d5c336f", + "hex" + ); + + const suiSignature = new SuiSignature(signature, requestId, pubKey); + + const ur = suiSignature.toUREncoder(1000).nextPart().toLocaleUpperCase(); + expect(ur).toBe( + "UR:SUI-SIGNATURE/OTADTPDAGDSAIOVSSSWFIAFGGLNEDKSKFTPYYAGWVTAOHDFZDNDAMTWYPRRSCLRTFYGLVEPDHKHNFYKIRSGYFYWDRPYAGOHKGWPDENWECKBEBDSWVLDWAAPMBZVWLGAAPSIYMTCNWZBGHEVDBZGWVLSGOSRDPKWTDKFSIEYALKTAWLAXAXHDCXWERNCWNDFRAABSYAMYRSOXSFTNJLHELGFZGEVDZMVLHENDCPBTWPAYIONTHHEOJLDSLULEFW" + ); + }); }); From b17045d4d64f3e609ab0fb2e9be4784cef87fdb5 Mon Sep 17 00:00:00 2001 From: ZhenQian Date: Wed, 13 Nov 2024 13:46:08 +0800 Subject: [PATCH 4/4] fix: add sui unit test case --- .../__tests__/SuiSignHashRequest.test.ts | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts b/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts index 61ca6868..fdc55217 100644 --- a/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts +++ b/packages/ur-registry-sui/__tests__/SuiSignHashRequest.test.ts @@ -30,6 +30,35 @@ describe("sui-sign-hash-request", () => { ); }); + it("should construct an signRequest object from string", () => { + const publicKeyHdPaths = ["m/44'/784'/0'/0'/0'"]; + const xfps = ["52744703"]; + const intentMessage = Buffer.from( + "00000000000e0101aeab97f96cf9877fee2883315d459552b2b921edc16d7ceac6eab944dd88919c40000000000000000000ba07b80701000000040d00310f0484060b353f6b1c93fed2616c527acf6f3d5cc62d1f302267cd61d065a859795afb84fde7f538628b4dfbe1d875a5bbefae4dfc739bd4207c3e70b4af2800029614746e310697af3e16f4e761ff8e6ec0f9442694a10af5dfa4dc82629326e1777ca282f550987b59e51c039264c9a582190aa19fb80140f2cb367e3e0c9ff401044b824ff64104f5604860007fa4767bdfb500078c1911295e749e8022a7a882d20bdee158567c8efee40debef13f4ddcc6f9234001f408d6a84ebddc0dc4789f6000665894b2ea9a474f81dce7518f5166356831474da6d2b22bee09c46701d141881760c8a5b99da238d237201e49972bec92e0ebb76e25021f2485373467a176d6901089944051cf16230d38cb72f4c5c645b4a3bc23b68f0c889850d9bd972c7aa6b5a24c1bfc489fc9965b8a0851506647abf9ffcceb35326db75c901810090ad254e010a52e4fb4c0f955c98f93a509ebce4563ac7b6411bf089df4c07e8de5df442917d0f459f201b9d5945357651b0e6d8bc13d5e45a9d1c69c1b9b908f1e8162afb31010bb30b59c26888f46acd9775e3e52d57cab63c5f65d738b3fe874eab0ab114b8034b3ceb9ee6cf985aa3f2907dd6a3160e36e7c321ef33b4fa2e5677f7c4229594000c2fe723e687b6cfc2c52498d0ecf5e78705f9a3b87f80e88dea36008529cd0955068787c7b3974cfdc4a7b94b673986ab63d4d63b7b9c12c2503b6ce3f927044b010d3bc4619068abcd541e7e4d1ba9805545dd70c4a61f3b10542487903b23d6d0753d06f77558f3e90bd304f72ae0a765e677cc84cb027854532c5477d297128eda000e661328809e4e67c2fcbcc7b86dc2d7c3c3c565108d93270b59b443918364527f422cc3d85b369a5029b3bdf65e1d70ca3da444aa3ca6b1129829555dd1102fcb000f8b5b699dc8fc54bc32a0e7012db1760f01a76a4b2be180c411c2fbf42e6b697f139ba2d8920c834d2d7060eca0b3d10d97c1bf10f05c450589aa7744e3cab7c801110d453bdaaafea926804c269f92795f24eeacdbaa6e544d93c17ad2aee4208a1552350cc7c06a2fdc9f58afd6a51dbb92e4752074281ad8ff3052a05c6b02d157001259cb575a4dc15188197cc35fba5dc9c66351e811fa51d9bf812f5d1df7123d6641d3242c0395ed716273e644072c4e7c9f321ed916cd72c34492185302b69134016705e13200000000001ae101faedac5851e32b9b23b5f9411a8c2bac4aae3ed4dd7b811dd1a72ea4aa71000000000517d998014155575600000000000a23b6b5000027106cad37e6dc98915b8d49a9ce7263862754ffbba60101000000000000000000000000000000000000000000000000000000000000000601000000000000000001011f9310238ee9298fb703c3419030b35b22bb1cc37113e3bb5007c99aec79e5b886640c01000000000000e509e309504e41550100000003b801000000040d00310f0484060b353f6b1c93fed2616c527acf6f3d5cc62d1f302267cd61d065a859795afb84fde7f538628b4dfbe1d875a5bbefae4dfc739bd4207c3e70b4af2800029614746e310697af3e16f4e761ff8e6ec0f9442694a10af5dfa4dc82629326e1777ca282f550987b59e51c039264c9a582190aa19fb80140f2cb367e3e0c9ff401044b824ff64104f5604860007fa4767bdfb500078c1911295e749e8022a7a882d20bdee158567c8efee40debef13f4ddcc6f9234001f408d6a84ebddc0dc4789f6000665894b2ea9a474f81dce7518f5166356831474da6d2b22bee09c46701d141881760c8a5b99da238d237201e49972bec92e0ebb76e25021f2485373467a176d6901089944051cf16230d38cb72f4c5c645b4a3bc23b68f0c889850d9bd972c7aa6b5a24c1bfc489fc9965b8a0851506647abf9ffcceb35326db75c901810090ad254e010a52e4fb4c0f955c98f93a509ebce4563ac7b6411bf089df4c07e8de5df442917d0f459f201b9d5945357651b0e6d8bc13d5e45a9d1c69c1b9b908f1e8162afb31010bb30b59c26888f46acd9775e3e52d57cab63c5f65d738b3fe874eab0ab114b8034b3ceb9ee6cf985aa3f2907dd6a3160e36e7c321ef33b4fa2e5677f7c4229594000c2fe723e687b6cfc2c52498d0ecf5e78705f9a3b87f80e88dea36008529cd0955068787c7b3974cfdc4a7b94b673986ab63d4d63b7b9c12c2503b6ce3f927044b010d3bc4619068abcd541e7e4d1ba9805545dd70c4a61f3b10542487903b23d6d0753d06f77558f3e90bd304f72ae0a765e677cc84cb027854532c5477d297128eda000e661328809e4e67c2fcbcc7b86dc2d7c3c3c565108d93270b59b443918364527f422cc3d85b369a5029b3bdf65e1d70ca3da444aa3ca6b1129829555dd1102fcb000f8b5b699dc8fc54bc32a0e7012db1760f01a76a4b2be180c411c2fbf42e6b697f139ba2d8920c834d2d7060eca0b3d10d97c1bf10f05c450589aa7744e3cab7c801110d453bdaaafea926804c269f92795f24eeacdbaa6e544d93c17ad2aee4208a1552350cc7c06a2fdc9f58afd6a51dbb92e4752074281ad8ff3052a05c6b02d157001259cb575a4dc15188197cc35fba5dc9c66351e811fa51d9bf812f5d1df7123d6641d3242c0395ed716273e644072c4e7c9f321ed916cd72c34492185302b69134016705e13200000000001ae101faedac5851e32b9b23b5f9411a8c2bac4aae3ed4dd7b811dd1a72ea4aa71000000000517d998014155575600000000000a23b6b5000027106cad37e6dc98915b8d49a9ce7263862754ffbba60100550023d7315113f5b1d3ba7a83604c44b94d79f4fd69af77f804fc7f920a6dc65744000000000bb33737000000000003c024fffffff8000000006705e132000000006705e132000000000bc8882c00000000000365ed0a6fb5256469f21f0383b20b297032cb81ef1082fcdc8b8d0bcde27c98028b77078a43d14384f643a4fe51acfe14b76633baddbeaf5dc963741562392112f80c55580a95e4bdb8af1c440cf7a89b641a6981584a89a2ce695fb0978fd562d770fe0798eee0447df877cb3a889c5ebdb711b0a77cbc82fb88f90b0cec4b15e7cda5b921e2b5a60536b3bece2fb87184a07e081ed1066fe86b52a72faff21d7a310b393bb35700e5e36fe3ab86a5ed3b493ec1fe7443ef66400d3a856cdbfb9525864c826285e0367a04000801000000000000000101801dbc2f0053d34734814b2d6df491ce7807a725fe9a01ad74a07e9c51396c37eeff32010000000001010184030d26d85eaa7035084a057f2f11f701b7e2e4eda87551becbc7c97505ece173818d04000000000100080000000000000000000800000000000000000100f0655ebf7359d09e9dace10961c22e0552c201abe52f7ad4380cd93dc01e988beb053a1600000000208cddd9780721ebdfe3c74723dd2f85cad1370b29f5facfa5ab66dfef5c1f479a00086352075002000000000800000000000000000020634e3b61aad1c3326404cbe6d617c0f031fa28c38f29bdf6b24c4c9899593c8d0a005306f64e312b581766351c07af79c72fcb1cd25147157fdc2f8ad76de9a3fb6a037661611070617273655f616e645f76657269667900030100000101000102000004e20ddf36af412a4096f9014f4a565af9e812db9a05cc40254846cf6ed0ad910470797468326372656174655f61757468656e746963617465645f70726963655f696e666f735f7573696e675f616363756d756c61746f72000401030001040003000000000102000200010105000004e20ddf36af412a4096f9014f4a565af9e812db9a05cc40254846cf6ed0ad910470797468187570646174655f73696e676c655f70726963655f666565640005010300030100000001060003020000000102000004e20ddf36af412a4096f9014f4a565af9e812db9a05cc40254846cf6ed0ad9111686f745f706f7461746f5f766563746f720764657374726f79010704e20ddf36af412a4096f9014f4a565af9e812db9a05cc40254846cf6ed0ad910a70726963655f696e666f095072696365496e666f0001030300000000a5239cfdb84856fa466b7cec4da42954fc9901b2a48dd5320d670a1b210282070e6c656e64696e675f6d61726b657415726566726573685f726573657276655f70726963650107f95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf077375696c656e64094d41494e5f504f4f4c000401070001080001020001060000a5239cfdb84856fa466b7cec4da42954fc9901b2a48dd5320d670a1b210282070e6c656e64696e675f6d61726b65741077697468647261775f63746f6b656e730207f95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf077375696c656e64094d41494e5f504f4f4c0007000000000000000000000000000000000000000000000000000000000000000203737569035355490005010700010900010a00010200010b00000000000000000000000000000000000000000000000000000000000000000001066f7074696f6e046e6f6e650107f95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf0e6c656e64696e675f6d61726b657414526174654c696d697465724578656d7074696f6e0207f95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf077375696c656e64094d41494e5f504f4f4c000700000000000000000000000000000000000000000000000000000000000000020373756903535549000000a5239cfdb84856fa466b7cec4da42954fc9901b2a48dd5320d670a1b210282070e6c656e64696e675f6d61726b65742572656465656d5f63746f6b656e735f616e645f77697468647261775f6c69717569646974790207f95b06141ed4a174f239417323bde3f209b972f5930d8521ea38a52aff3a6ddf077375696c656e64094d41494e5f504f4f4c0007000000000000000000000000000000000000000000000000000000000000000203737569035355490005010700010c000102000306000000030700000001010308000000010d00634e3b61aad1c3326404cbe6d617c0f031fa28c38f29bdf6b24c4c9899593c8d015e01df7bd39f49ebc7ae9d40ec136ea6aaa798a4cabf072f1d94734b49237beaeb053a160000000020fdbb82d8a5704adfd474e0975e86ac95f17cd61458b6079f2c34964b69a85e18634e3b61aad1c3326404cbe6d617c0f031fa28c38f29bdf6b24c4c9899593c8dee0200000000000014b9a9000000000000", + "hex" + ); + const requestID = "9b1deb4d-3b7d-4bad-9bdd-2b0d7b3dcb6d"; + const addresses = [ + Buffer.from( + "504886c9ec43bff70af37f55865094cc3a799cb54479f252d30cd3717f15ecdc", + "hex" + ), + ]; + + const request = SuiSignRequest.constructSuiRequest( + intentMessage, + publicKeyHdPaths, + xfps, + requestID, + addresses, + "Suiet" + ); + const ur = request.toUREncoder(10000).nextPart(); + expect(ur).toBe( + "ur:sui-sign-request/onadtpdagdndcawmgtfrkigrpmndutdnbtkgfssbjnaohkbscsaeaeaeaeaebaadadplpymsytjzytltlbwydelsehhlfemdgmprrhclwesejnkewdswwdrhfyutlomensfzaeaeaeaeaeaeaeaeaerdatroatadaeaeaeaabtaeehbsaalrambdecfhjecemuzetdhsjzgmkntkjlfshhswdpctdycpiosnhstiihpdhkkkhtzolrzcvdyketidlugtzovytpkponrkwsplgtztjkndtycxkefmjoqzpedeaeaomtbbjyjtehammspefmcmwkvdhszmmnjtrtytfydsmwoybkykuroxuolfidmudsvyktkeoelfykgdmkkghkvwceaxmoiesoonlfcfbkoyneroadfzwzsbenkbfmbnnewkadaagrlfgwynfpaaykhnfdhnaelboxkokgurreaeatlkcfbydthyjynnlacpospdlftdbduevyhdhfkemnzevebtwmwsbwwkutsfjlmoeeaectfzlgimlrwmutrtuoflldynaeamihldgrdmptoxjyyacatokpcsykcmiahflsbbjytnjndncprnvtnsfgjocabbcslykobnlehpnltncnlgcnjpadvenljprnsodmbarkkovogdclwzfdgujkfgknchjninadaynlfyahcewniddytelkrldlgshhiehpgefrsafriswtspldlpbtndtajpstpkjehtdksersssldztnlihronblpbzamieknrsnezttoqdgudsuykpsoadlyaemhpmdagladbkgmvezogsbsmdhhmkytftgdnnrfvehfftstrpfpcwwtldurgsatvsuehlwkfwmekibsfenecxcwnthkfeeckogypfvatprfbwtlvehtntceinserhrhaywnvscmdrzoehadbdqdbdhksaislowkimsnmskpvlvwdphgsgrpfnheihtsetqdzeltglpybkpabbroaxgrfnwmnnvatkmkhtotwzmhkitbotcmbaenvdsrclwseoqzzsdmhfktylsscpmdmwaebndlvdcnvaltrptksaskdkmktiwpykvdltahytotrolblavslgwdenaelpdtsnasgoamltltstqdmsgszcssosrhgrioeslnpyiatytbfrkgnsbgsagdfrjzvlytdiaagradbtfrsshsmhispysnghckkbgtcwptlagofeutjossolctfrbeghdkltmhfrcntbtikpfsamylkphdwfwlbdteaayldrvtosihvaktsflrsbaoksghgudwghkttdmsbgmntnaebaiybwdelanngliosaztrfstrojnsatssrsrskihbelgmudibdhkqzfxmelsiegmlbfwdwsrtphpennygddtqdryynhycajosgfsoxfypkfnolpabgmkdtgohlttbedlsbaebsluhpinntspztghrfeynbvdaddppakobsadosimgrdnvylassbysazowkdmjeinlbbwndoetpmobnlsgtdpjohnwpnbqdttbtmssersbewthhfeahldpkktfyvlsgrlspadbybtfefrtnpkzeptdslagsdsnemokkhedkwypsuypkjtghgtmusekntdplvecxlebzgmecbnstrtimdluonehdpetboncarkmovekpcxjydecytpzmdygmnbhhjeaotthgaebghksbhghtgtsegylocfkesrherdhlsoswiagyvsbyzsgytarslydlhlcaylbgfsiyfptedkdwaxmdwejsidjkvafyatdwglkeneeycktacmsnjpsrfymocsguaorpmeeeadioahvyeyaeaeaeaeaecyvyadzswepshdgyvldnndcnreytfpcylkdnpsgeplfmtyutkglycattosdmoxpkjsaeaeaeaeahchtamkadfpgohghfaeaeaeaeaebkcnrpreaeaedibejzpmemvauomkmehplggapttojpialndighzmrkoladadaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeamadaeaeaeaeaeaeaeaeadadctmubecnmnwldtmyrlaxsrfpmhdyqdhpcprkcesrjsbwvlrkgdatsonywpkkvwrolniebnadaeaeaeaeaeaevwasvlasgdglfpgoadaeaeaeaxroadaeaeaeaabtaeehbsaalrambdecfhjecemuzetdhsjzgmkntkjlfshhswdpctdycpiosnhstiihpdhkkkhtzolrzcvdyketidlugtzovytpkponrkwsplgtztjkndtycxkefmjoqzpedeaeaomtbbjyjtehammspefmcmwkvdhszmmnjtrtytfydsmwoybkykuroxuolfidmudsvyktkeoelfykgdmkkghkvwceaxmoiesoonlfcfbkoyneroadfzwzsbenkbfmbnnewkadaagrlfgwynfpaaykhnfdhnaelboxkokgurreaeatlkcfbydthyjynnlacpospdlftdbduevyhdhfkemnzevebtwmwsbwwkutsfjlmoeeaectfzlgimlrwmutrtuoflldynaeamihldgrdmptoxjyyacatokpcsykcmiahflsbbjytnjndncprnvtnsfgjocabbcslykobnlehpnltncnlgcnjpadvenljprnsodmbarkkovogdclwzfdgujkfgknchjninadaynlfyahcewniddytelkrldlgshhiehpgefrsafriswtspldlpbtndtajpstpkjehtdksersssldztnlihronblpbzamieknrsnezttoqdgudsuykpsoadlyaemhpmdagladbkgmvezogsbsmdhhmkytftgdnnrfvehfftstrpfpcwwtldurgsatvsuehlwkfwmekibsfenecxcwnthkfeeckogypfvatprfbwtlvehtntceinserhrhaywnvscmdrzoehadbdqdbdhksaislowkimsnmskpvlvwdphgsgrpfnheihtsetqdzeltglpybkpabbroaxgrfnwmnnvatkmkhtotwzmhkitbotcmbaenvdsrclwseoqzzsdmhfktylsscpmdmwaebndlvdcnvaltrptksaskdkmktiwpykvdltahytotrolblavslgwdenaelpdtsnasgoamltltstqdmsgszcssosrhgrioeslnpyiatytbfrkgnsbgsagdfrjzvlytdiaagradbtfrsshsmhispysnghckkbgtcwptlagofeutjossolctfrbeghdkltmhfrcntbtikpfsamylkphdwfwlbdteaayldrvtosihvaktsflrsbaoksghgudwghkttdmsbgmntnaebaiybwdelanngliosaztrfstrojnsatssrsrskihbelgmudibdhkqzfxmelsiegmlbfwdwsrtphpennygddtqdryynhycajosgfsoxfypkfnolpabgmkdtgohlttbedlsbaebsluhpinntspztghrfeynbvdaddppakobsadosimgrdnvylassbysazowkdmjeinlbbwndoetpmobnlsgtdpjohnwpnbqdttbtmssersbewthhfeahldpkktfyvlsgrlspadbybtfefrtnpkzeptdslagsdsnemokkhedkwypsuypkjtghgtmusekntdplvecxlebzgmecbnstrtimdluonehdpetboncarkmovekpcxjydecytpzmdygmnbhhjeaotthgaebghksbhghtgtsegylocfkesrherdhlsoswiagyvsbyzsgytarslydlhlcaylbgfsiyfptedkdwaxmdwejsidjkvafyatdwglkeneeycktacmsnjpsrfymocsguaorpmeeeadioahvyeyaeaeaeaeaecyvyadzswepshdgyvldnndcnreytfpcylkdnpsgeplfmtyutkglycattosdmoxpkjsaeaeaeaeahchtamkadfpgohghfaeaeaeaeaebkcnrpreaeaedibejzpmemvauomkmehplggapttojpialndighzmrkoladaegoaecntsehgybwykpaterdknlshngsfyrhgtkkwkzcinpektyaaaztlbmobkjnswhgfyaeaeaeaebdqdememaeaeaeaeaeaxrtdkzmzmzmyaaeaeaeaeioahvyeyaeaeaeaeioahvyeyaeaeaeaebdsplodwaeaeaeaeaeaxihwebkjlredaieinwzctaxlsprbddtjoeysblywsbelfztuolulgbdsnvokemkaoluktatlefxttfxlrynfxoxzegypszebbrliyeordutrnpehlsoiajybzidesclbgyabngohdbkmdveryropecefybnylpdndiecyinlyhdgeldoetoinhepfmsmytlidtsjozeatmkwyvtfykiyaktsbftlonshyryrlbypfoskerflfzoloytbdbnwpgrbzvdsnonrhclvoreolahenqdrntodlrojslrnbkbayckttamjlvsjegmosdlpewzcaknehbdesfrqdhgaevwvljlvlpylnonwefrgafmsezejyfxwsiyfzbtftlpjzuyzomddalngslfidlpvtenknaaaeayadaeaeaeaeaeaeaeadadlacarfdlaegutefleelygrdpjnwkmetoksatosdazenyadpmjynbkbnsgyesjzemwyzmeyadaeaeaeaeadadadlraxbtdstphypkjoecaygeahlbdlbyyladrlvovewepdkpgyrnsbstsokpahwpvyjklylgaaaeaeaeaeadaeayaeaeaeaeaeaeaeaeaeayaeaeaeaeaeaeaeaeadaewtihhyrsjkhktinnntpsvyashssadmahgmsaadpyvwdlkntyetbntafsrtckmkluwmahftcmaeaeaeaecxlkuttaksatclwmurvlstflcnutdllpsgttembddtykzstkonpyiyurwshhctflnyaeayiagmatgdaoaeaeaeaeayaeaeaeaeaeaeaeaeaecxiaglfrhspkttsreyieaasbvatbchrtwtehzsdesrmydtryynprgsgsmknlhkfnlgbkaeguamynglehdnhdchiyecceatpekkstdlsbcetdgyflbzlbuodlletsjnwlotzoimaxkohshsbejohsjpjkihhehsjtiehekoihjpiniykkaeaxadaeaeadadaeadaoaeaeaavobturenpefpdrfzmtytadgwgehfhtytvsbguynyahsffzdafdfgtkjttipmmeaajokkjyiseyiajpihhsjyihhehskpjyisihjtjyiniahsjyihiehejojpiniaihheinjtiyjljkhekpjkinjtiohehsiaiakpjnkpjzhsjyjljpaeaaadaxaeadaaaeaxaeaeaeaeadaoaeaoaeadadahaeaeaavobturenpefpdrfzmtytadgwgehfhtytvsbguynyahsffzdafdfgtkjttipmmeaajokkjyiscskpjoiehsjyihhejkinjtiojzihhejojpiniaihheiyihihieaeahadaxaeaxadaeaeaeadamaeaxaoaeaeaeadaoaeaeaavobturenpefpdrfzmtytadgwgehfhtytvsbguynyahsffzdafdfgtkjttipmmebyisjljyhejojljyhsjyjlhekoihiajyjljpatieihjkjyjpjlkkadataavobturenpefpdrfzmtytadgwgehfhtytvsbguynyahsffzdafdfgtkjttipmmebkjojpiniaihheinjtiyjlasgdjpiniaihgajtiyjlaeadaxaxaeaeaeaeoncnnszcrofdhfzsfgjekewpgtoxdtghztnladproxlgtleybtiobkcwclaolfatbajzihjtieinjtiohejnhsjpjeihjybzjpihiyjpihjkishejpihjkihjpkoihhejojpiniaihadatythpambbcktyoyjywzesfpjkcnryvlwzasrhjpykmubtlpclwdetondrzmftjnuratjkkpinjzihjtieasgtfpgaglhegdgwgwgsaeaaadataeadayaeadaoaeadamaeaeoncnnszcrofdhfzsfgjekewpgtoxdtghztnladproxlgtleybtiobkcwclaolfatbajzihjtieinjtiohejnhsjpjeihjybektinjyisiejphsktheiajyjljeihjtjkaoatythpambbcktyoyjywzesfpjkcnryvlwzasrhjpykmubtlpclwdetondrzmftjnuratjkkpinjzihjtieasgtfpgaglhegdgwgwgsaeataeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaoaxjkkpinaxgugogaaeahadataeadasaeadbkaeadaoaeadbdaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeadamjljojyinjljtaajtjljtihadatythpambbcktyoyjywzesfpjkcnryvlwzasrhjpykmubtlpclwdetondrzmftjnurbajzihjtieinjtiohejnhsjpjeihjybbgmhsjyihgsinjninjyihjpfeksihjnjojyinjljtaoatythpambbcktyoyjywzesfpjkcnryvlwzasrhjpykmubtlpclwdetondrzmftjnuratjkkpinjzihjtieasgtfpgaglhegdgwgwgsaeataeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaoaxjkkpinaxgugogaaeaeaeoncnnszcrofdhfzsfgjekewpgtoxdtghztnladproxlgtleybtiobkcwclaolfatbajzihjtieinjtiohejnhsjpjeihjydajpihieihihjnheiajyjljeihjtjkhehsjtiehektinjyisiejphskthejzinjskpinieinjykkaoatythpambbcktyoyjywzesfpjkcnryvlwzasrhjpykmubtlpclwdetondrzmftjnuratjkkpinjzihjtieasgtfpgaglhegdgwgwgsaeataeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaeaoaxjkkpinaxgugogaaeahadataeadbnaeadaoaeaxamaeaeaeaxataeaeaeadadaxayaeaeaeadbtaeiaglfrhspkttsreyieaasbvatbchrtwtehzsdesrmydtryynprgsgsmknlhkfnlgadhyadurkgtenegawmstplntfzwpbwjtolpkosmkoxsgrsatdlcamwjkgrgacnkgwdwmahftcmaeaeaeaecxzcrklftponjogeurtyjyvtmshylnpsmdwnketbbbhdrpatnedweemtgrinpdhycsiaglfrhspkttsreyieaasbvatbchrtwtehzsdesrmydtryynprgsgsmknlhkfnlgwyaoaeaeaeaeaeaebbrhptaeaeaeaeaeaeaxlytaaddyoeadlecsdwykcfaxbeykaeykaeykaeykaocygmjyflaxaalyhdcxgdfdlnsowpfxrsylbkwflbgolngdmwsfftkknsrefykkwzgmtebntejslbbzwpuoahihgukpinihjyfwjsjkmd" + ); + }); + it("should construct an signHashRequest object from messageHash", () => { const publicKeyHdPaths = ["m/44'/784'/0'/0'/0'"]; const xfps = ["52744703"];