diff --git a/apps/node/package.json b/apps/node/package.json index 0b00e46bc..a60f0bb72 100644 --- a/apps/node/package.json +++ b/apps/node/package.json @@ -43,6 +43,6 @@ "tronweb": "^5.3.2", "winston": "^3.11.0", "xrpl": "^4.0.0", - "starknet": "^5.24.3" + "starknet": "^6.11.0" } } diff --git a/apps/node/src/index.ts b/apps/node/src/index.ts index c29d0b4f7..687a989e2 100644 --- a/apps/node/src/index.ts +++ b/apps/node/src/index.ts @@ -17,9 +17,9 @@ import { ISignTxnUnsignedTxn, setStarknetApiJs, StarknetApp } from '@cypherock/s // import { ethers } from 'ethers'; import { createServiceLogger } from './logger'; import { hexToUint8Array } from '@cypherock/sdk-utils'; -// import dotEnv from 'dotenv-flow'; +import dotEnv from 'dotenv-flow'; -// dotEnv.config(); +dotEnv.config(); const getEnvVariable = (key: string, defaultValue?: string): string => { let value: string | undefined; @@ -176,15 +176,15 @@ async function fetchAccount(connection: IDeviceConnection) { // ================ Starknet App -- Fund Transfer ========== // async function transfer(connection: IDeviceConnection, wallet: IWalletItem) { const starkApp = await StarknetApp.create(connection); - const starkKeyPubAX = (await starkApp.getPublicKeys({ + const starkKeyPubAX = (await starkApp.getUserVerifiedPublicKey({ walletId: wallet.id, - derivationPaths: [{ path: [0x80000000 + 0xA55, + derivationPath: [0x80000000 + 0xA55, 0x80000000 + 0x4741E9C9, 0x80000000 + 0x447A6028, 0x80000000, 0x80000000, - 0xC] }] - })).publicKeys[0]; + 0xC] + })); console.log("Public key: ", starkKeyPubAX) const constructorAXCallData = starknetApiJs.CallData.compile([0,starkKeyPubAX,1]); const accountAXAddress = "0x7b419b63869cd1e23f0354aed454b8fe2908afbe6386f2a29a508f9d34da4d9";//starknetApiJs.hash.calculateContractAddressFromHash(starkKeyPubAX, contractAXclassHash, constructorAXCallData, 0); @@ -273,7 +273,7 @@ const run = async () => { // setEthersLib(ethers); // setNearApiJs(nearApiJs); // setSolanaWeb3(solanaWeb3); - // setStarknetApiJs(starknetApiJs); + setStarknetApiJs(starknetApiJs); let connection: IDeviceConnection; diff --git a/packages/app-starknet/src/operations/getUserVerifiedPublicKey/index.ts b/packages/app-starknet/src/operations/getUserVerifiedPublicKey/index.ts index 6b3530802..23ec5c1dc 100644 --- a/packages/app-starknet/src/operations/getUserVerifiedPublicKey/index.ts +++ b/packages/app-starknet/src/operations/getUserVerifiedPublicKey/index.ts @@ -63,12 +63,8 @@ export const getUserVerifiedPublicKey = async ( }, forceStatusUpdate, ); - // const starkAPI = getStarknetApiJs(); - // const starkPubKey = starkAPI.ec.starkCurve.getStarkKey( - // result.publicKeys[0].slice(0, 64), - // ); return { - publicKey: result.publicKeys[0], + publicKey: '0x' + result.publicKeys[0], }; }; diff --git a/packages/app-starknet/src/operations/runGetPublicKeys/index.ts b/packages/app-starknet/src/operations/runGetPublicKeys/index.ts index f8e504088..4bacaf2f2 100644 --- a/packages/app-starknet/src/operations/runGetPublicKeys/index.ts +++ b/packages/app-starknet/src/operations/runGetPublicKeys/index.ts @@ -35,6 +35,6 @@ export const runGetPublicKeysOnDevice = async ( forceStatusUpdate(GetPublicKeysEvent.VERIFY); return { - publicKeys: publicKeys.map(e => uint8ArrayToHex(e)), + publicKeys: publicKeys.map(e => '0x' + uint8ArrayToHex(e)), }; }; diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 02c5b7379..bd24c76ed 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -148,8 +148,8 @@ importers: specifier: ^2.1.4 version: 2.1.4 starknet: - specifier: ^5.24.3 - version: 5.24.3 + specifier: ^6.11.0 + version: 6.11.0 tronweb: specifier: ^5.3.2 version: 5.3.2 @@ -2942,17 +2942,10 @@ packages: dev: false optional: true - /@noble/curves@1.2.0: - resolution: {integrity: sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==} - dependencies: - '@noble/hashes': 1.3.2 - dev: false - /@noble/curves@1.3.0: resolution: {integrity: sha512-t01iSXPuN+Eqzb4eBX0S5oubSqXbK/xXa1Ne18Hj8f9pStxztHCE2gfboSp/dZRLSqfuLpRK2nDXDK+W9puocA==} dependencies: '@noble/hashes': 1.3.3 - dev: true /@noble/curves@1.4.2: resolution: {integrity: sha512-TavHr8qycMChk8UwMld0ZDRvatedkzWfH8IiaeGCfymOP5i0hSCozz9vHOL0nkwk7HRMlFnAiKpS2jrUmSybcw==} @@ -2968,11 +2961,6 @@ packages: /@noble/hashes@1.1.2: resolution: {integrity: sha512-KYRCASVTv6aeUi1tsF8/vpyR7zpfs3FUzy2Jqm+MU+LmUKhQ0y2FpfwqkCcxSg2ua4GALJd8k2R76WxwZGbQpA==} - /@noble/hashes@1.3.2: - resolution: {integrity: sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==} - engines: {node: '>= 16'} - dev: false - /@noble/hashes@1.3.3: resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} engines: {node: '>= 16'} @@ -3089,19 +3077,11 @@ packages: '@scure/base': 1.2.1 dev: false - /@scure/starknet@0.3.0: - resolution: {integrity: sha512-Ma66yZlwa5z00qI5alSxdWtIpky5LBhy22acVFdoC5kwwbd9uDyMWEYzWHdNyKmQg9t5Y2UOXzINMeb3yez+Gw==} - dependencies: - '@noble/curves': 1.2.0 - '@noble/hashes': 1.3.3 - dev: false - /@scure/starknet@1.0.0: resolution: {integrity: sha512-o5J57zY0f+2IL/mq8+AYJJ4Xpc1fOtDhr+mFQKbHnYFmm3WQrC+8zj2HEgxak1a+x86mhmBC1Kq305KUpVf0wg==} dependencies: '@noble/curves': 1.3.0 '@noble/hashes': 1.3.3 - dev: true /@serialport/binding-abstract@10.0.0: resolution: {integrity: sha512-1IwOMDOWqKO0csrTOv95Ah0Av012DZB8C0OF11SmE3eyh8ab1+y4/Yah/8byMAMG7TXw+2LqkNs1oZtOJGlY1Q==} @@ -3237,7 +3217,6 @@ packages: /@starknet-io/types-js@0.7.10: resolution: {integrity: sha512-1VtCqX4AHWJlRRSYGSn+4X1mqolI1Tdq62IwzoU2vUuEE72S1OlEeGhpvd6XsdqXcfHmVzYfj8k1XtKBQqwo9w==} - dev: true /@stryker-mutator/api@6.4.1: resolution: {integrity: sha512-xHK5mqTXqMKegfOAhURDqaPNA2vOj79f0/fC3J9Udnol0OkTresSfOG06t2Y80Qr0iH50RQm+Dzgg0Sgt8ODzg==} @@ -3742,7 +3721,6 @@ packages: cardinal: 2.1.1 fs-extra: 10.1.0 yargs: 17.7.2 - dev: true /acorn-jsx@5.3.2(acorn@7.4.1): resolution: {integrity: sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ==} @@ -3890,7 +3868,6 @@ packages: /ansicolors@0.3.2: resolution: {integrity: sha512-QXu7BPrP29VllRxH8GwB7x5iX5qWKAAMLqKQGWTeLWVlNHNOpVMJ91dsxQAIWXpjuW5wqvxu3Jd/nRjrJ+0pqg==} - dev: true /anymatch@3.1.3: resolution: {integrity: sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==} @@ -4536,7 +4513,6 @@ packages: dependencies: ansicolors: 0.3.2 redeyed: 2.1.1 - dev: true /case-anything@2.1.13: resolution: {integrity: sha512-zlOQ80VrQ2Ue+ymH5OuM/DlDq64mEm+B9UTdHULv5osUMD6HalNTblf2b1u/m6QecjsnOkBpqVZ+XPwIVsy7Ng==} @@ -5988,7 +5964,6 @@ packages: dependencies: set-cookie-parser: 2.7.1 tough-cookie: 4.1.4 - dev: true /figures@5.0.0: resolution: {integrity: sha512-ej8ksPF4x6e5wvK9yevct0UCXh8TTFlWGVLlgjZuoBH1HwjIfKE/IdL5mq89sFA7zELi1VhKpmtDnrs7zWyeyg==} @@ -6089,7 +6064,6 @@ packages: graceful-fs: 4.2.11 jsonfile: 6.1.0 universalify: 2.0.1 - dev: true /fs-extra@11.2.0: resolution: {integrity: sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==} @@ -6184,7 +6158,6 @@ packages: resolution: {integrity: sha512-6pLmidQZkC3wZsrHY99grQHoGpuuXqkbSP65F8ov1/JsEI8DDLkhsAuLCKFzNOK56cJp+f1bWWfTJ57e9r5eqQ==} dependencies: '@starknet-io/types-js': 0.7.10 - dev: true /get-stream@6.0.1: resolution: {integrity: sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg==} @@ -7394,7 +7367,6 @@ packages: universalify: 2.0.1 optionalDependencies: graceful-fs: 4.2.11 - dev: true /jsonparse@1.3.1: resolution: {integrity: sha512-POQXvpdL69+CluYsillJ7SUhKvytYjW9vG/GKpnf+xP8UWgYEM/RaMzHHofbALDiKbbP1W8UEYmgGl39WkPZsg==} @@ -7667,13 +7639,8 @@ packages: js-tokens: 4.0.0 dev: false - /lossless-json@2.0.11: - resolution: {integrity: sha512-BP0vn+NGYvzDielvBZaFain/wgeJ1hTvURCqtKvhr1SCPePdaaTanmmcplrHfEJSJOUql7hk4FHwToNJjWRY3g==} - dev: false - /lossless-json@4.0.2: resolution: {integrity: sha512-+z0EaLi2UcWi8MZRxA5iTb6m4Ys4E80uftGY+yG5KNFJb5EceQXOhdW/pWJZ8m97s26u7yZZAYMcKWNztSZssA==} - dev: true /lru-cache@4.1.5: resolution: {integrity: sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==} @@ -8551,7 +8518,6 @@ packages: resolution: {integrity: sha512-JZd3gMVBAVQkSs6HdNZo9Sdo0LNcQeMNP3CozBJb3JYC/QUYZTnKxP+f8oWRX4rHP5EurWxqAHTSwUCjlNKa1w==} dependencies: punycode: 2.3.1 - dev: true /public-encrypt@4.0.3: resolution: {integrity: sha512-zVpa8oKZSz5bTMTFClc1fQOnyyEzpl5ozpi1B5YcvBrdohMjH2rfsBtyXcuNuwjsDIXmBYlF2N5FlJYhR29t8Q==} @@ -8605,7 +8571,6 @@ packages: /querystringify@2.2.0: resolution: {integrity: sha512-FIqgj2EUvTa7R50u0rGsyTftzjYmv/a3hO345bZNrqabNqjtgiDMgmo4mkUjd+nzU5oF3dClKqFIPUKybUyqoQ==} - dev: true /queue-microtask@1.2.3: resolution: {integrity: sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==} @@ -8730,7 +8695,6 @@ packages: resolution: {integrity: sha512-FNpGGo1DycYAdnrKFxCMmKYgo/mILAqtRYbkdQD8Ep/Hk2PQ5+aEAEx+IU713RTDmuBaH0c8P5ZozurNu5ObRQ==} dependencies: esprima: 4.0.1 - dev: true /reflect.getprototypeof@1.0.7: resolution: {integrity: sha512-bMvFGIUKlc/eSfXNX+aZ+EL95/EgZzuwA0OBPTbZZDEJw/0AkentjMuM1oiRfwHrshqk4RzdgiTg5CcDalXN5g==} @@ -8774,7 +8738,6 @@ packages: /requires-port@1.0.0: resolution: {integrity: sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ==} - dev: true /resolve-cwd@3.0.0: resolution: {integrity: sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==} @@ -9030,7 +8993,6 @@ packages: /set-cookie-parser@2.7.1: resolution: {integrity: sha512-IOc8uWeOZgnb3ptbCURJWNjWUPcO3ZnTTdzsurqERrP6nPyv+paC55vJM0LpOlT2ne+Ix+9+CRG1MNLlyZ4GjQ==} - dev: true /set-function-length@1.2.2: resolution: {integrity: sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==} @@ -9251,20 +9213,6 @@ packages: escape-string-regexp: 2.0.0 dev: true - /starknet@5.24.3: - resolution: {integrity: sha512-v0TuaNc9iNtHdbIRzX372jfQH1vgx2rwBHQDMqK4DqjJbwFEE5dog8Go6rGiZVW750NqRSWrZ7ahqyRNc3bscg==} - dependencies: - '@noble/curves': 1.2.0 - '@scure/base': 1.2.1 - '@scure/starknet': 0.3.0 - isomorphic-fetch: 3.0.0 - lossless-json: 2.0.11 - pako: 2.1.0 - url-join: 4.0.1 - transitivePeerDependencies: - - encoding - dev: false - /starknet@6.11.0: resolution: {integrity: sha512-u50KrGDi9fbu1Ogu7ynwF/tSeFlp3mzOg1/Y5x50tYFICImo3OfY4lOz9OtYDk404HK4eUujKkhov9tG7GAKlg==} dependencies: @@ -9283,7 +9231,6 @@ packages: url-join: 4.0.1 transitivePeerDependencies: - encoding - dev: true /statuses@1.5.0: resolution: {integrity: sha512-OpZ3zP+jT1PI7I8nemJX4AKmAX070ZkYPVWV/AaKTJl+tXCTGyVdC1a4SL8RUQYEwk/f34ZX8UTykN68FwrqAA==} @@ -9664,7 +9611,6 @@ packages: punycode: 2.3.1 universalify: 0.2.0 url-parse: 1.5.10 - dev: true /tr46@0.0.3: resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==} @@ -9741,7 +9687,6 @@ packages: /ts-mixer@6.0.4: resolution: {integrity: sha512-ufKpbmrugz5Aou4wcr5Wc1UUFWOLhq+Fm6qa6P0w0K5Qw2yhaUoiWszhCVuNQyNwrlGiscHOmqYoAox1PtvgjA==} - dev: true /ts-node@10.9.2(@types/node@20.5.1)(typescript@4.9.5): resolution: {integrity: sha512-f0FFpIdcHgn8zcPSbf1dRevwt047YMnaiJM3u2w2RewrB+fob/zePZcrOyQoLMMO7aBIddLcQIEK5dYjkLnGrQ==} @@ -10073,12 +10018,10 @@ packages: /universalify@0.2.0: resolution: {integrity: sha512-CJ1QgKmNg3CwvAv/kOFmtnEN05f0D/cn9QntgNOQlQF9dgvVTHj3t+8JPdjqawCHk7V/KA+fbUqzZ9XWhcqPUg==} engines: {node: '>= 4.0.0'} - dev: true /universalify@2.0.1: resolution: {integrity: sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==} engines: {node: '>= 10.0.0'} - dev: true /update-browserslist-db@1.1.1(browserslist@4.24.2): resolution: {integrity: sha512-R8UzCaa9Az+38REPiJ1tXlImTJXlVfgHZsglwBD/k6nj76ctsH1E3q4doGrukiLQd3sGQYu56r5+lo5r94l29A==} @@ -10104,7 +10047,6 @@ packages: dependencies: querystringify: 2.2.0 requires-port: 1.0.0 - dev: true /url@0.11.4: resolution: {integrity: sha512-oCwdVC7mTuWiPyjLUz/COz5TLk6wgp0RCsN+wHZ2Ekneac9w8uuV0njcbbie2ME+Vs+d6duwmYuR3HgQXs1fOg==}