From 7f432ec06df9d150de238166694037aa93712a55 Mon Sep 17 00:00:00 2001 From: nacho <25931366+ignaciosantise@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:02:10 -0300 Subject: [PATCH 1/8] feat: added TON support --- wallets/rn_cli_wallet/.env.example | 1 + ...project-pbkdf2-npm-5.8.0-b720e81bcc.patch} | Bin 11352 -> 10515 bytes ...ypto-primitives-npm-2.1.0-3d1ea62176.patch | 33 + wallets/rn_cli_wallet/declarations.d.ts | 1 + wallets/rn_cli_wallet/ios/Podfile.lock | 4 +- wallets/rn_cli_wallet/package.json | 15 +- .../patches/@ethersproject+pbkdf2+5.7.0.patch | 105 -- .../rn_cli_wallet/src/assets/chains/ton.png | Bin 0 -> 4204 bytes .../rn_cli_wallet/src/components/Modal.tsx | 6 + .../src/components/Modal/Chains.tsx | 2 +- wallets/rn_cli_wallet/src/constants/Eip155.ts | 201 ++++ .../rn_cli_wallet/src/constants/Storage.ts | 1 - wallets/rn_cli_wallet/src/constants/Sui.ts | 69 ++ wallets/rn_cli_wallet/src/constants/Ton.ts | 42 + .../src/hooks/useInitializeWalletKit.ts | 3 + .../src/hooks/useWalletKitEventsManager.ts | 16 +- wallets/rn_cli_wallet/src/lib/TonLib.ts | 187 +++ .../src/modals/SessionAuthenticateModal.tsx | 5 +- .../src/modals/SessionProposalModal.tsx | 24 +- .../modals/SessionSendTransactionModal.tsx | 3 +- .../src/modals/SessionSignModal.tsx | 4 +- .../src/modals/SessionSignTypedDataModal.tsx | 3 +- ...ssionSuiSignAndExecuteTransactionModal.tsx | 3 +- .../SessionSuiSignPersonalMessageModal.tsx | 3 +- .../modals/SessionSuiSignTransactionModal.tsx | 3 +- .../src/modals/SessionTonSendMessageModal.tsx | 181 +++ .../src/modals/SessionTonSignDataModal.tsx | 177 +++ .../src/screens/Settings/index.tsx | 16 +- wallets/rn_cli_wallet/src/store/ModalStore.ts | 4 +- .../rn_cli_wallet/src/store/SettingsStore.ts | 6 + .../src/utils/EIP155RequestHandlerUtil.ts | 5 +- .../rn_cli_wallet/src/utils/LinkingUtils.ts | 16 +- .../rn_cli_wallet/src/utils/PresetsUtil.ts | 364 +----- .../rn_cli_wallet/src/utils/SuiWalletUtil.ts | 1 - .../src/utils/TonRequestHandlerUtil.ts | 46 + .../rn_cli_wallet/src/utils/TonWalletUtil.ts | 48 + wallets/rn_cli_wallet/src/utils/TypesUtil.ts | 7 +- wallets/rn_cli_wallet/yarn.lock | 1052 +++++++---------- 38 files changed, 1517 insertions(+), 1140 deletions(-) rename wallets/rn_cli_wallet/.yarn/patches/{@ethersproject-pbkdf2-npm-5.7.0-5b8e51d4b9.patch => @ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch} (88%) create mode 100644 wallets/rn_cli_wallet/.yarn/patches/@ton-crypto-primitives-npm-2.1.0-3d1ea62176.patch delete mode 100644 wallets/rn_cli_wallet/patches/@ethersproject+pbkdf2+5.7.0.patch create mode 100644 wallets/rn_cli_wallet/src/assets/chains/ton.png create mode 100644 wallets/rn_cli_wallet/src/constants/Eip155.ts delete mode 100644 wallets/rn_cli_wallet/src/constants/Storage.ts create mode 100644 wallets/rn_cli_wallet/src/constants/Sui.ts create mode 100644 wallets/rn_cli_wallet/src/constants/Ton.ts create mode 100644 wallets/rn_cli_wallet/src/lib/TonLib.ts create mode 100644 wallets/rn_cli_wallet/src/modals/SessionTonSendMessageModal.tsx create mode 100644 wallets/rn_cli_wallet/src/modals/SessionTonSignDataModal.tsx create mode 100644 wallets/rn_cli_wallet/src/utils/TonRequestHandlerUtil.ts create mode 100644 wallets/rn_cli_wallet/src/utils/TonWalletUtil.ts diff --git a/wallets/rn_cli_wallet/.env.example b/wallets/rn_cli_wallet/.env.example index 32b7e518..95d6ec3a 100644 --- a/wallets/rn_cli_wallet/.env.example +++ b/wallets/rn_cli_wallet/.env.example @@ -3,6 +3,7 @@ ENV_PROJECT_ID='39bc93c...' ENV_RELAY_URL='wss://relay.walletconnect.org' ENV_SENTRY_DSN='' +ENV_TON_CENTER_API_KEY='' # for android builds. for iOS check xcode.env file SENTRY_DISABLE_AUTO_UPLOAD=true diff --git a/wallets/rn_cli_wallet/.yarn/patches/@ethersproject-pbkdf2-npm-5.7.0-5b8e51d4b9.patch b/wallets/rn_cli_wallet/.yarn/patches/@ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch similarity index 88% rename from wallets/rn_cli_wallet/.yarn/patches/@ethersproject-pbkdf2-npm-5.7.0-5b8e51d4b9.patch rename to wallets/rn_cli_wallet/.yarn/patches/@ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch index ea15c15f57007276f607534e89d00cfcb042d7a0..a5d5c5e874dc68985cedbc5ab91f5578bac95f49 100644 GIT binary patch delta 150 zcmcZ+F*#^LhDNfHQL3S-kx@#rd74F1qJ_DUkpWP|%*Zm?)W9Io)FRm^&CtNiV&a58 zM#jnVjP{I-o8uXOi)$Dr8k(C}q*xjmnWh0XrOb1SQ;lRVXeg%1ka%vgT5lY^P+;s4%%sNp7>FlqLJ-{VFrr0mAny A5dZ)H delta 500 zcmaKoJ#W-N5QcMAq@zJd5Mm)QIZ@c$M|O7CyFQ{QRthAfRM5~xUhl3j9QLuc4~~z9 zAAo|kO2ePH3Mo}u{s27{74$S%oJ1laG2Of~^FFV}Km7Xm8}Tf;g2@8^TH4xuK;< zRN~)nA6@5=rhOQ+wSl^EMcxed`eXlX`@o;WwG|KUZ$8+at7qEM$bWFvQV+vqg)l z&_KGhi_Agpmh+}MM%V{uUbKZX;b5%|B7ZMn+_q)j6jceTwbr=8F2hAOYfS`i`eW$I znWl9m9R3+ktgD`f{%3IG%6cp6IPd&vaO6M1t^JUU{t_qa?>t(Tc@$ol&$GIISvehz eE)nZ&)wnz5x_Z5Hy7?P3dY!lc diff --git a/wallets/rn_cli_wallet/.yarn/patches/@ton-crypto-primitives-npm-2.1.0-3d1ea62176.patch b/wallets/rn_cli_wallet/.yarn/patches/@ton-crypto-primitives-npm-2.1.0-3d1ea62176.patch new file mode 100644 index 00000000..23057f33 --- /dev/null +++ b/wallets/rn_cli_wallet/.yarn/patches/@ton-crypto-primitives-npm-2.1.0-3d1ea62176.patch @@ -0,0 +1,33 @@ +diff --git a/dist/native/getSecureRandom.js b/dist/native/getSecureRandom.js +index b769fd9ad676132979c406b5c77bea98838a2104..b3a153661498e349dd502295cf61075d29892fb6 100644 +--- a/dist/native/getSecureRandom.js ++++ b/dist/native/getSecureRandom.js +@@ -8,9 +8,10 @@ + */ + Object.defineProperty(exports, "__esModule", { value: true }); + exports.getSecureRandomWords = exports.getSecureRandomBytes = void 0; +-const getRandomBytes = require('expo-crypto').getRandomBytes; + function getSecureRandomBytes(size) { +- return Buffer.from(getRandomBytes(size)); ++ const bytes = new Uint8Array(size); ++ crypto.getRandomValues(bytes); ++ return Buffer.from(bytes); + } + exports.getSecureRandomBytes = getSecureRandomBytes; + function getSecureRandomWords(size) { +diff --git a/dist/native/pbkdf2_sha512.js b/dist/native/pbkdf2_sha512.js +index fe733396a95b9374665953bb102cdaa0f4d69e9c..4eecb6bb5f46c796316ae3cd5a461aaa5b4862fe 100644 +--- a/dist/native/pbkdf2_sha512.js ++++ b/dist/native/pbkdf2_sha512.js +@@ -11,7 +11,8 @@ exports.pbkdf2_sha512 = void 0; + async function pbkdf2_sha512(key, salt, iterations, keyLen) { + const keyBuffer = typeof key === 'string' ? Buffer.from(key, 'utf-8') : key; + const saltBuffer = typeof salt === 'string' ? Buffer.from(salt, 'utf-8') : salt; +- let pbkdf2 = require('react-native-fast-pbkdf2').default; ++ var crypto = require("crypto"); ++ let pbkdf2 = crypto.pbkdf2Sync; +- let res = await pbkdf2.derive(keyBuffer.toString('base64'), saltBuffer.toString('base64'), iterations, keyLen, 'sha-512'); ++ let res = crypto.pbkdf2Sync(keyBuffer, saltBuffer, iterations, keyLen, 'sha512'); +- return Buffer.from(res, 'base64'); ++ return res; + } diff --git a/wallets/rn_cli_wallet/declarations.d.ts b/wallets/rn_cli_wallet/declarations.d.ts index 7b4ba439..4b7d4297 100644 --- a/wallets/rn_cli_wallet/declarations.d.ts +++ b/wallets/rn_cli_wallet/declarations.d.ts @@ -7,6 +7,7 @@ declare module 'react-native-config' { ENV_RELAY_URL: string; ENV_SENTRY_DSN: string; ENV_SENTRY_TAG: string; + ENV_TON_CENTER_API_KEY: string; } export const Config: NativeConfig; diff --git a/wallets/rn_cli_wallet/ios/Podfile.lock b/wallets/rn_cli_wallet/ios/Podfile.lock index a8684df8..21db27c6 100644 --- a/wallets/rn_cli_wallet/ios/Podfile.lock +++ b/wallets/rn_cli_wallet/ios/Podfile.lock @@ -1783,7 +1783,7 @@ PODS: - React-RCTFBReactNativeSpec - ReactCommon/turbomodule/core - SocketRocket - - react-native-compat (2.22.2): + - react-native-compat (2.22.4): - boost - DoubleConversion - fast_float @@ -3131,7 +3131,7 @@ SPEC CHECKSUMS: React-logger: 30adf849117e87cf86e88dca1824bb0f18f87e10 React-Mapbuffer: 499069c3dcd4b438a70fcc2a65e8a4185ea9170b React-microtasksnativemodule: f0238469cb9894fd18c419137d312665b8fc05b3 - react-native-compat: 3573295702a92c9b13cc0ee3dd47499c5aee0c32 + react-native-compat: 67bb1df21b252406f83fe8c0302c8479b53c03b0 react-native-config: 644074ab88db883fcfaa584f03520ec29589d7df react-native-get-random-values: d16467cf726c618e9c7a8c3c39c31faa2244bbba react-native-mmkv: ac7507625cd74bac0eb5333604a7cd7b08fe9e3e diff --git a/wallets/rn_cli_wallet/package.json b/wallets/rn_cli_wallet/package.json index b8fc0545..ca85d943 100644 --- a/wallets/rn_cli_wallet/package.json +++ b/wallets/rn_cli_wallet/package.json @@ -32,13 +32,16 @@ "@react-navigation/native-stack": "7.3.27", "@react-navigation/stack": "7.4.9", "@reown/appkit-ui-react-native": "1.0.1", - "@reown/walletkit": "1.2.11", + "@reown/walletkit": "1.3.0", "@sentry/react-native": "7.3.0", - "@walletconnect/react-native-compat": "2.22.2", + "@ton/core": "0.62.0", + "@ton/crypto": "3.3.0", + "@ton/ton": "15.4.0", + "@walletconnect/react-native-compat": "2.22.4", "bip39": "3.1.0", "dayjs": "1.11.11", "ed25519-hd-key": "^1.3.0", - "ethers": "5.7.2", + "ethers": "5.8.0", "fast-xml-parser": "4.4.1", "react": "19.1.1", "react-native": "0.82.0", @@ -101,9 +104,9 @@ "tmp": "0.2.4", "on-headers": "1.1.0", "brace-expansion": "1.1.12", - "@ethersproject/pbkdf2@5.7.0": "patch:@ethersproject/pbkdf2@npm%3A5.7.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.7.0-5b8e51d4b9.patch", - "@ethersproject/pbkdf2@^5.7.0": "patch:@ethersproject/pbkdf2@npm%3A5.7.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.7.0-5b8e51d4b9.patch", - "@ethersproject/pbkdf2@^5.8.0": "patch:@ethersproject/pbkdf2@npm%3A5.7.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.7.0-5b8e51d4b9.patch" + "@ton/crypto-primitives@2.1.0": "patch:@ton/crypto-primitives@npm%3A2.1.0#./.yarn/patches/@ton-crypto-primitives-npm-2.1.0-3d1ea62176.patch", + "@ethersproject/pbkdf2@5.8.0": "patch:@ethersproject/pbkdf2@npm%3A5.8.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch", + "@ethersproject/pbkdf2@^5.8.0": "patch:@ethersproject/pbkdf2@npm%3A5.8.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch" }, "packageManager": "yarn@3.8.7" } diff --git a/wallets/rn_cli_wallet/patches/@ethersproject+pbkdf2+5.7.0.patch b/wallets/rn_cli_wallet/patches/@ethersproject+pbkdf2+5.7.0.patch deleted file mode 100644 index 2c38001f..00000000 --- a/wallets/rn_cli_wallet/patches/@ethersproject+pbkdf2+5.7.0.patch +++ /dev/null @@ -1,105 +0,0 @@ -diff --git a/node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js b/node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js -index e211793..06a80af 100644 ---- a/node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js -+++ b/node_modules/@ethersproject/pbkdf2/lib.esm/pbkdf2.js -@@ -1,44 +1,4 @@ - "use strict"; --import { arrayify, hexlify } from "@ethersproject/bytes"; --import { computeHmac } from "@ethersproject/sha2"; --export function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) { -- password = arrayify(password); -- salt = arrayify(salt); -- let hLen; -- let l = 1; -- const DK = new Uint8Array(keylen); -- const block1 = new Uint8Array(salt.length + 4); -- block1.set(salt); -- //salt.copy(block1, 0, 0, salt.length) -- let r; -- let T; -- for (let i = 1; i <= l; i++) { -- //block1.writeUInt32BE(i, salt.length) -- block1[salt.length] = (i >> 24) & 0xff; -- block1[salt.length + 1] = (i >> 16) & 0xff; -- block1[salt.length + 2] = (i >> 8) & 0xff; -- block1[salt.length + 3] = i & 0xff; -- //let U = createHmac(password).update(block1).digest(); -- let U = arrayify(computeHmac(hashAlgorithm, password, block1)); -- if (!hLen) { -- hLen = U.length; -- T = new Uint8Array(hLen); -- l = Math.ceil(keylen / hLen); -- r = keylen - (l - 1) * hLen; -- } -- //U.copy(T, 0, 0, hLen) -- T.set(U); -- for (let j = 1; j < iterations; j++) { -- //U = createHmac(password).update(U).digest(); -- U = arrayify(computeHmac(hashAlgorithm, password, U)); -- for (let k = 0; k < hLen; k++) -- T[k] ^= U[k]; -- } -- const destPos = (i - 1) * hLen; -- const len = (i === l ? r : hLen); -- //T.copy(DK, destPos, 0, len) -- DK.set(arrayify(T).slice(0, len), destPos); -- } -- return hexlify(DK); --} -+var crypto = require("crypto"); -+exports.pbkdf2 = crypto.pbkdf2Sync; - //# sourceMappingURL=pbkdf2.js.map -diff --git a/node_modules/@ethersproject/pbkdf2/lib/browser-pbkdf2.js b/node_modules/@ethersproject/pbkdf2/lib/browser-pbkdf2.js -index 45c6f03..f2c584d 100644 ---- a/node_modules/@ethersproject/pbkdf2/lib/browser-pbkdf2.js -+++ b/node_modules/@ethersproject/pbkdf2/lib/browser-pbkdf2.js -@@ -1,47 +1,6 @@ - "use strict"; - Object.defineProperty(exports, "__esModule", { value: true }); - exports.pbkdf2 = void 0; --var bytes_1 = require("@ethersproject/bytes"); --var sha2_1 = require("@ethersproject/sha2"); --function pbkdf2(password, salt, iterations, keylen, hashAlgorithm) { -- password = (0, bytes_1.arrayify)(password); -- salt = (0, bytes_1.arrayify)(salt); -- var hLen; -- var l = 1; -- var DK = new Uint8Array(keylen); -- var block1 = new Uint8Array(salt.length + 4); -- block1.set(salt); -- //salt.copy(block1, 0, 0, salt.length) -- var r; -- var T; -- for (var i = 1; i <= l; i++) { -- //block1.writeUInt32BE(i, salt.length) -- block1[salt.length] = (i >> 24) & 0xff; -- block1[salt.length + 1] = (i >> 16) & 0xff; -- block1[salt.length + 2] = (i >> 8) & 0xff; -- block1[salt.length + 3] = i & 0xff; -- //let U = createHmac(password).update(block1).digest(); -- var U = (0, bytes_1.arrayify)((0, sha2_1.computeHmac)(hashAlgorithm, password, block1)); -- if (!hLen) { -- hLen = U.length; -- T = new Uint8Array(hLen); -- l = Math.ceil(keylen / hLen); -- r = keylen - (l - 1) * hLen; -- } -- //U.copy(T, 0, 0, hLen) -- T.set(U); -- for (var j = 1; j < iterations; j++) { -- //U = createHmac(password).update(U).digest(); -- U = (0, bytes_1.arrayify)((0, sha2_1.computeHmac)(hashAlgorithm, password, U)); -- for (var k = 0; k < hLen; k++) -- T[k] ^= U[k]; -- } -- var destPos = (i - 1) * hLen; -- var len = (i === l ? r : hLen); -- //T.copy(DK, destPos, 0, len) -- DK.set((0, bytes_1.arrayify)(T).slice(0, len), destPos); -- } -- return (0, bytes_1.hexlify)(DK); --} --exports.pbkdf2 = pbkdf2; -+var crypto = require("crypto"); -+exports.pbkdf2 = crypto.pbkdf2Sync; - //# sourceMappingURL=browser-pbkdf2.js.map \ No newline at end of file diff --git a/wallets/rn_cli_wallet/src/assets/chains/ton.png b/wallets/rn_cli_wallet/src/assets/chains/ton.png new file mode 100644 index 0000000000000000000000000000000000000000..6bb06e936dcdc56bf40f9a81bbf14a90e3c53bf7 GIT binary patch literal 4204 zcmYjUXH*kP(+*OE(0eiT5_$p%!Ud!W2!w!CDFOk4D5wZtdN)9j8l;3KRTQNoQer3} zlu$)66cwa;19&MShW^F({`t8E0I*wJzh(yjT!8)| z26`Ij?jp>cw$O#xnHvKdCO{M#U;`R|pP!R9j#DOn*>>#GAbhx-k*3M`$PR7~06FJ=#FdMD1OPb67T1g%!soZsV5C-~DYrmttuC>$WGsKLd@X?= zTs*Cz;$Q{RSU!KS|7iw=QUx7~YC>XjXmlf@xD zw?=}QNK$@Awf1dkL|-$eiM$2jnR!=F6X-{qFPBngL{rC6vC?$W@l-sfV=R6Zd3OKM zQw!T85n(>85z(Bf+bDH=&%1Qx<)EdQkg~QIb|DKUSG7*nOKSV_gYVfzrhv}R3c(&s zO_>+XFh6^}L^;!?z9;nkB_?D#LI3z~_elO{RuJ-Dulxz(Tz#tkkfSOnx})E+d*8cn zx7SOyKv#K3t9&@Zt0{A|ln~O{PcHcc9CFFXOZQL?a#9MuO7v3Mrg8qU=I$wW8K(|R zjZz&e3wG103U*&#gRJ~cs4vLkr1m9bagIEu7Z*P}`qsP1*pn~RpgzLW@5mI!<6L;p zW);Ba?%k9>Lzm2Y|dH$C*cIkP#$vgQ@&@VsJtziIv=nCNS8&4x*XpY{m@ps z`zu06mnGm(Nt`va6t#9zhN|y8@D@EEQ`DRBsQcD5=-Pk>4k0quK;)YwM8@CIRd(TK zY)(NpeN-NhZ+?q0T#69y1)8yu)xDc~(Kr6c_W9I)UlDJ}Io{cI^1c(5iY1i4`>Fo5|AF7<>j&f2evS8}=dRd4yNkyK!0=B+`D@9z zLG0E`>o*HA_tNoJt;M6|r6gki)O>G^RK9X@cN| zx!1i!7eXd}r14x>0ivtVb>fC%5W#wAk=JbH*Ag6E_0TXbISIzxATDO`n1P8649+Dt zMm%A$a#xh=K^Uv(efOAf8HHw1fMGRj zAhSJ{+AOEg?SPBr=#U&a7JJm(4k$4@Vfne@hgyv<#PaK=LMgURKodzhA725qA}lmr zTT%m@tNFz6g`(g;A}d0Y_NF{cbV)`P=ZgLthVYyu%KhOtXj!%kFt#ZxXR1n7Jnv5x z<8Rf@36VtKh?ke1(eH(OykbU*CMuVMrwWp9;p#ZKpgur`3UCrzMIDK^AF}17yqQe^ zRXvuJwpjrnX6ZrdfGOayYkM6lgOniZhJ2v03olACqL#&lj5)8r>V~DS)>aEfKxn64 z$Kv4vp>C$7XFl4i%qYDP$7Q6-Qx<}J$u9Gdt{-*e@45G*MFwiY!w#-PI57f{Hz&bq z_;Pcp3@n`>oMlU1O*QJ{9h8*k7&81q=$_VDVCTx#?_j&IN?0$@3@%7;pFL^GPf9S{ zXiTKJ+0?=IRcXtV4@{~k4;qxt)$FsJCN#)^G4;ea#HjIa%mH!Oqs#J0Ut;ATzJdSX zc{rMLwAsYp%no03W?d}PmR#^^LPsIQ@CDEfURU?chOMW`6g&k^_MEjAt*A4tXOT2P z3w7uH&-$XJkj2lkP?w))^4?`wn0?Fj!BIav&jxmzeO}6SQODxA_4PgYe9XvS6V^5`NE+j!jfy zJ9m_5!~+TPkrYLDA^^1`%coUQXR)Lt7-|g(_}^Xi)Ezn*zuf-XP~9STGu3t$)glK^ zr)6$MG|tmA67y#4Z9qr}lJNA8+)3CJz(5mzn)e0FWMc9wM& zR4rJ>!5v&bw8Ui519YWigGz-#^C-NGIV|&^X-mQ?j@8~`LWV)Q&*}|&$%gGnGKs>A zsz9;z)FBa2`iiD20?EtOmwM?m6?}Ozu};=Pf^aN%?>*UA#3-^<3C=cPWnCIbET;qQ z2$KXtrN5H-v2+~%6^0L99Iv-sjs#88H>-awea=DM*%WOkqW8CDB~&}ivXd-c zHu3olDs26d)cBsOc^{w+&{XoZ%fLE0V$aBuAIZTkO0H!Nv;3OgWE+X^Q>vxfP*I5a8v7DA-Scs&w_rWmDcI0=oF z6TEQQwKw6ee*ZrGJcYmmfmHvyOTl%%k&=N>f^QN zOdkHojPq#znj|O0%%!N>S{G!7>n$O^f?`(b+_oC%gvNUm!7s1vWQyZS8k@Ty>M(fQ zygnSftEdBR`;DrtAol%B*cT>5Gfi3rf=Tx>!0l4pz$jgWdxNWGP#3}LjmHHS)r-kc z_BTN|puJ(*#u?`ks||L*3_b#U`BoE@KdlTQ{T_e2tWzt?EZu&8020sxElZWu5Ns$S zq7Sd+Ys=R(f&|#x>(=ZN9|wC@-4s{1woVmNbF6tTU{Jc%>ry)~Fw$6=D4@DXigUfJ zM3}w?sUI@J<$mMBY;CdrT&w=)H{aqTMVVB$X^<97TUf{wkxBh z&?CxblWeEoLBpPP?GT0J^iJ^?RmmwX%Cp=Y^N6@}xAuhS5p~MkP?{ep<3<)FV4b2N zyQS02Wv<0gL#61AIE+6c%P^cP`$N0l^MW=QUC_thUrB=}3X6;N<buz6&{{u9-rGckGf*lSOIGe24Y8gjek(TL-CY zktq~A94%AO22xZ1hyos`|0l=En5To(PY7oT0yMqDYpMY{-o7;?z5^YIH&rrZhc+SVg2x2=LarLyx0bVX&l+ z;DPX+AJ(U?zn&~rGZZX_?Q4WrdK~2rXDFVo6|^4IY|Ea}f5`F?LrxsR_cWF=#x_x< z40_d5=k_sVCIVHqx*}^iLf~$W)QsK+n;VqX9&g6%UgLuyI z#P9Tmzj?&xEFM92F%XXR=hhI86J4<~?oi3%qNnnUkll!^uR&|lFM2a!fvJ*u&4(xK zR)KlDdKUxpFa<(xNR+H!SWQ-VDjgur(`MiGB(id5**VkWKQQ9fIM4`=REeDdfwrg; z;LNl_yS^w6(3_PiK*7BE#GkR`H>DKGqFJkMPBM)m{0|JwO7VSiPl5c5~}*a;(G4Az1fgNaEO7BWb4 z3l(9a{nVvN`&${SOSO1RS9m-%n;xL-=hPwJMD#Yhe>bg=zk7%$P1vUQ<{0xOHsLF6 z>}Gz8i8KB0X+%tPmMg}pb_3pK%)ChF&l&6H&q;~-IMCnC-i z{eSqZP*v>U-r_GPwn(+EUF&=z`)qB)B!L4{oA)sd^t(B@Yfbk{zZBJ3mE*lpi*%YG z=j51~7!z+RCY1KxrUwN28)vbWZMmQxk#>cG5;iHO360n?KKE-&bCfyDGBf;mInL6aw*L98; case 'SessionSuiSignAndExecuteTransactionModal': return ; + case 'SessionTonSendMessageModal': + return + case 'SessionTonSignDataModal': + return default: return ; } diff --git a/wallets/rn_cli_wallet/src/components/Modal/Chains.tsx b/wallets/rn_cli_wallet/src/components/Modal/Chains.tsx index 37a3e9b6..d663f95a 100644 --- a/wallets/rn_cli_wallet/src/components/Modal/Chains.tsx +++ b/wallets/rn_cli_wallet/src/components/Modal/Chains.tsx @@ -21,7 +21,7 @@ export function Chains({chains}: Props) { {chains?.map(chain => { - const logo = PresetsUtil.getChainLogo(chain.caip2); + const logo = PresetsUtil.getChainLogo(`${chain.namespace}:${chain.chainId}`); return ( = { + 'eip155:1': { + chainId: '1', + namespace: 'eip155', + name: 'Ethereum', + rpcUrl: 'https://eth.llamarpc.com', + }, + 'eip155:5': { + chainId: '5', + namespace: 'eip155', + name: 'Ethereum Goerli', + rpcUrl: 'https://rpc.ankr.com/eth_goerli', + }, + 'eip155:42161': { + chainId: '42161', + namespace: 'eip155', + name: 'Arbitrum One', + rpcUrl: 'https://arb1.arbitrum.io/rpc', + }, + 'eip155:43114': { + chainId: '43114', + namespace: 'eip155', + name: 'Avalanche', + rpcUrl: 'https://api.avax.network/ext/bc/C/rpc', + }, + 'eip155:43113': { + chainId: '43113', + namespace: 'eip155', + name: 'Avalanche Fuji', + rpcUrl: 'https://api.avax-test.network/ext/bc/C/rpc', + }, + 'eip155:56': { + chainId: '56', + namespace: 'eip155', + name: 'Binance Smart Chain', + rpcUrl: 'https://rpc.ankr.com/bsc', + }, + 'eip155:250': { + chainId: '250', + namespace: 'eip155', + name: 'Fantom', + rpcUrl: 'https://rpc.ankr.com/fantom', + }, + 'eip155:10': { + chainId: '10', + namespace: 'eip155', + name: 'Optimism', + rpcUrl: 'https://mainnet.optimism.io', + }, + 'eip155:11155420': { + chainId: '11155420', + namespace: 'eip155', + name: 'Optimism Sepholia', + rpcUrl: 'https://sepolia.optimism.io', + }, + 'eip155:137': { + chainId: '137', + namespace: 'eip155', + name: 'Polygon', + rpcUrl: 'https://polygon-rpc.com', + }, + 'eip155:80001': { + chainId: '80001', + namespace: 'eip155', + name: 'Polygon Mumbai', + rpcUrl: 'https://rpc.ankr.com/polygon_mumbai', + }, + 'eip155:100': { + chainId: '100', + namespace: 'eip155', + name: 'Gnosis', + rpcUrl: 'https://rpc.gnosischain.com', + }, + 'eip155:9001': { + chainId: '9001', + namespace: 'eip155', + name: 'Evmos', + rpcUrl: 'https://eth.bd.evmos.org:8545', + }, + 'eip155:324': { + chainId: '324', + namespace: 'eip155', + name: 'zkSync Era', + rpcUrl: 'https://mainnet.era.zksync.io', + }, + 'eip155:314': { + chainId: '314', + namespace: 'eip155', + name: 'Filecoin Mainnet', + rpcUrl: 'https://api.node.glif.io/rpc/v1', + }, + 'eip155:4689': { + chainId: '4689', + namespace: 'eip155', + name: 'IoTeX', + rpcUrl: 'https://babel-api.mainnet.iotex.io', + }, + 'eip155:1088': { + chainId: '1088', + namespace: 'eip155', + name: 'Metis', + rpcUrl: 'https://andromeda.metis.io/?owner=1088', + }, + 'eip155:1284': { + chainId: '1284', + namespace: 'eip155', + name: 'Moonbeam', + rpcUrl: 'https://moonbeam.public.blastapi.io', + }, + 'eip155:1285': { + chainId: '1285', + namespace: 'eip155', + name: 'Moonriver', + rpcUrl: 'https://moonriver.public.blastapi.io', + }, + 'eip155:7777777': { + chainId: '7777777', + namespace: 'eip155', + name: 'Zora', + rpcUrl: 'https://rpc.zora.energy', + }, + 'eip155:42220': { + chainId: '42220', + namespace: 'eip155', + name: 'Celo', + rpcUrl: 'https://forno.celo.org', + }, + 'eip155:8453': { + chainId: '8453', + namespace: 'eip155', + name: 'Base', + rpcUrl: 'https://mainnet.base.org', + }, + 'eip155:1313161554': { + chainId: '1313161554', + namespace: 'eip155', + name: 'Aurora', + rpcUrl: 'https://mainnet.aurora.dev', + }, +}; + +export const EIP155_NETWORK_IMAGES: Record = { + 'eip155:1': Ethereum, + 'eip155:5': Ethereum, + 'eip155:42161': Arbitrum, + 'eip155:43114': Avalanche, + 'eip155:43113': Avalanche, + 'eip155:56': Binance, + 'eip155:250': Fantom, + 'eip155:10': Optimism, + 'eip155:11155420': Optimism, + 'eip155:137': Polygon, + 'eip155:80001': Polygon, + 'eip155:100': Gnosis, + 'eip155:9001': Evmos, + 'eip155:324': ZkSync, + 'eip155:314': Filecoin, + 'eip155:4689': Iotx, + 'eip155:1088': Metis, + 'eip155:1284': Moonbeam, + 'eip155:1285': Moonriver, + 'eip155:7777777': Zora, + 'eip155:42220': Celo, + 'eip155:8453': Base, + 'eip155:1313161554': Aurora, +}; + +export const EIP155_SIGNING_METHODS = { + PERSONAL_SIGN: 'personal_sign', + ETH_SIGN: 'eth_sign', + ETH_SIGN_TRANSACTION: 'eth_signTransaction', + ETH_SIGN_TYPED_DATA: 'eth_signTypedData', + ETH_SIGN_TYPED_DATA_V3: 'eth_signTypedData_v3', + ETH_SIGN_TYPED_DATA_V4: 'eth_signTypedData_v4', + ETH_SEND_RAW_TRANSACTION: 'eth_sendRawTransaction', + ETH_SEND_TRANSACTION: 'eth_sendTransaction', +}; \ No newline at end of file diff --git a/wallets/rn_cli_wallet/src/constants/Storage.ts b/wallets/rn_cli_wallet/src/constants/Storage.ts deleted file mode 100644 index 28dd5d93..00000000 --- a/wallets/rn_cli_wallet/src/constants/Storage.ts +++ /dev/null @@ -1 +0,0 @@ -export const SYM_KEY_PREFIX = 'symkey:'; diff --git a/wallets/rn_cli_wallet/src/constants/Sui.ts b/wallets/rn_cli_wallet/src/constants/Sui.ts new file mode 100644 index 00000000..6533c32b --- /dev/null +++ b/wallets/rn_cli_wallet/src/constants/Sui.ts @@ -0,0 +1,69 @@ +// SUI +import Sui from '@/assets/chains/sui.webp'; +import { Chain } from '@/utils/TypesUtil'; +/** + * Methods + */ +export const SUI_SIGNING_METHODS = { + SUI_SIGN_TRANSACTION: 'sui_signTransaction', + SUI_SIGN_AND_EXECUTE_TRANSACTION: 'sui_signAndExecuteTransaction', + SUI_SIGN_PERSONAL_MESSAGE: 'sui_signPersonalMessage', +}; + +/** + * Events + */ + +export const SUI_EVENTS = { + SUI_ACCOUNTS_CHANGED: 'sui_accountsChanged', + SUI_CHAIN_CHANGED: 'sui_chainChanged', +}; + +export type ISuiChainId = typeof SUI_MAINNET_CAIP2 | typeof SUI_TESTNET_CAIP2; + +export const SUI_NAMESPACE = 'sui'; + +export const SUI_MAINNET_ID = 'mainnet'; +export const SUI_TESTNET_ID = 'testnet'; +export const SUI_DEVNET_ID = 'devnet'; +export const SUI_MAINNET_CAIP2 = `${SUI_NAMESPACE}:${SUI_MAINNET_ID}`; +export const SUI_TESTNET_CAIP2 = `${SUI_NAMESPACE}:${SUI_TESTNET_ID}`; +export const SUI_DEVNET_CAIP2 = `${SUI_NAMESPACE}:${SUI_DEVNET_ID}`; + +export const SUI_MAINNET = { + [SUI_MAINNET_CAIP2]: { + chainId: SUI_MAINNET_ID, + namespace: SUI_NAMESPACE, + name: 'SUI Mainnet', + rpcUrl: 'https://fullnode.mainnet.sui.io', + }, +}; +export const SUI_TESTNET = { + [SUI_TESTNET_CAIP2]: { + chainId: SUI_TESTNET_ID, + namespace: SUI_NAMESPACE, + name: 'SUI Testnet', + rpcUrl: 'https://fullnode.testnet.sui.io', + }, +}; + +export const SUI_DEVNET = { + [SUI_DEVNET_CAIP2]: { + chainId: SUI_DEVNET_ID, + namespace: SUI_NAMESPACE, + name: 'SUI Devnet', + rpcUrl: 'https://fullnode.devnet.sui.io', + }, +}; + +export const SUI_NETWORKS_IMAGES = { + 'sui:mainnet': Sui, + 'sui:testnet': Sui, + 'sui:devnet': Sui, +}; + +export const SUI_CHAINS: Record = { + ...SUI_MAINNET, + ...SUI_TESTNET, + ...SUI_DEVNET, +}; \ No newline at end of file diff --git a/wallets/rn_cli_wallet/src/constants/Ton.ts b/wallets/rn_cli_wallet/src/constants/Ton.ts new file mode 100644 index 00000000..041a3057 --- /dev/null +++ b/wallets/rn_cli_wallet/src/constants/Ton.ts @@ -0,0 +1,42 @@ +import Ton from '@/assets/chains/ton.png'; + +/** + * Types + */ +export type TTonChain = keyof typeof TON_MAINNET_CHAINS | keyof typeof TON_TEST_CHAINS + +/** + * Chains + */ +export const TON_MAINNET_CHAINS = { + 'ton:-239': { + chainId: '-239', + namespace: 'ton', + name: 'TON Mainnet', + rpcUrl: 'https://toncenter.com/api/v2/jsonRPC', + } +} + +export const TON_TEST_CHAINS = { + 'ton:-3': { + chainId: '-3', + namespace: 'ton', + name: 'TON Testnet', + rpcUrl: 'https://testnet.toncenter.com/api/v2/jsonRPC', + } +} + +export const TON_CHAINS = { ...TON_MAINNET_CHAINS, ...TON_TEST_CHAINS } + +export const TON_NETWORKS_IMAGES = { + 'ton:-239': Ton, + 'ton:-3': Ton, +}; + +/** + * Methods + */ +export const TON_SIGNING_METHODS = { + SEND_MESSAGE: 'ton_sendMessage', + SIGN_DATA: 'ton_signData' +} \ No newline at end of file diff --git a/wallets/rn_cli_wallet/src/hooks/useInitializeWalletKit.ts b/wallets/rn_cli_wallet/src/hooks/useInitializeWalletKit.ts index 0c64ec8c..da77b296 100644 --- a/wallets/rn_cli_wallet/src/hooks/useInitializeWalletKit.ts +++ b/wallets/rn_cli_wallet/src/hooks/useInitializeWalletKit.ts @@ -5,6 +5,7 @@ import SettingsStore from '@/store/SettingsStore'; import {createOrRestoreEIP155Wallet} from '@/utils/EIP155WalletUtil'; import {createOrRestoreSuiWallet} from '@/utils/SuiWalletUtil'; import {createWalletKit, walletKit} from '@/utils/WalletKitUtil'; +import { createOrRestoreTonWallet } from '@/utils/TonWalletUtil'; export default function useInitializeWalletKit() { const [initialized, setInitialized] = useState(false); @@ -17,11 +18,13 @@ export default function useInitializeWalletKit() { const {eip155Addresses, eip155Wallets} = await createOrRestoreEIP155Wallet(); const {suiAddresses, suiWallet} = await createOrRestoreSuiWallet(); + const { tonAddresses } = await createOrRestoreTonWallet() SettingsStore.setEIP155Address(eip155Addresses[0]); SettingsStore.setWallet(eip155Wallets[eip155Addresses[0]]); SettingsStore.setSuiAddress(suiAddresses[0]); SettingsStore.setSuiWallet(suiWallet); + SettingsStore.setTonAddress(tonAddresses[0]) await createWalletKit(relayerRegionURL); setInitialized(true); SettingsStore.state.initPromiseResolver?.resolve(undefined); diff --git a/wallets/rn_cli_wallet/src/hooks/useWalletKitEventsManager.ts b/wallets/rn_cli_wallet/src/hooks/useWalletKitEventsManager.ts index ffa43dd7..4b543942 100644 --- a/wallets/rn_cli_wallet/src/hooks/useWalletKitEventsManager.ts +++ b/wallets/rn_cli_wallet/src/hooks/useWalletKitEventsManager.ts @@ -2,15 +2,14 @@ import {useCallback, useEffect} from 'react'; import {SignClientTypes} from '@walletconnect/types'; import Toast from 'react-native-toast-message'; -import { - EIP155_CHAINS, - EIP155_SIGNING_METHODS, - SUI_SIGNING_METHODS, -} from '@/utils/PresetsUtil'; + import ModalStore from '@/store/ModalStore'; import SettingsStore from '@/store/SettingsStore'; import {walletKit} from '@/utils/WalletKitUtil'; import {getSupportedChains} from '@/utils/HelperUtil'; +import { EIP155_CHAINS, EIP155_SIGNING_METHODS } from '@/constants/Eip155'; +import { SUI_SIGNING_METHODS } from '@/constants/Sui'; +import { TON_SIGNING_METHODS } from '@/constants/Ton'; export default function useWalletKitEventsManager(initialized: boolean) { /****************************************************************************** @@ -87,6 +86,13 @@ export default function useWalletKitEventsManager(initialized: boolean) { requestEvent, requestSession, }); + case TON_SIGNING_METHODS.SIGN_DATA: + return ModalStore.open('SessionTonSignDataModal', { + requestEvent, + requestSession + }) + case TON_SIGNING_METHODS.SEND_MESSAGE: + return ModalStore.open('SessionTonSendMessageModal', { requestEvent, requestSession }) default: return ModalStore.open('SessionUnsuportedMethodModal', { requestEvent, diff --git a/wallets/rn_cli_wallet/src/lib/TonLib.ts b/wallets/rn_cli_wallet/src/lib/TonLib.ts new file mode 100644 index 00000000..7bfbf7ac --- /dev/null +++ b/wallets/rn_cli_wallet/src/lib/TonLib.ts @@ -0,0 +1,187 @@ +import { KeyPair, keyPairFromSeed, keyPairFromSecretKey, sign, signVerify } from '@ton/crypto' +import { WalletContractV4, TonClient, internal, Address } from '@ton/ton' +import { TON_MAINNET_CHAINS, TON_TEST_CHAINS } from '@/constants/Ton' +import Config from 'react-native-config' + +/** + * Types + */ +interface IInitArguments { + secretKey?: string + seed?: string +} + +/** + * Library + */ +export default class TonLib { + keypair: KeyPair + wallet: WalletContractV4 + + constructor(keypair: KeyPair) { + this.keypair = keypair + this.wallet = WalletContractV4.create({ workchain: 0, publicKey: keypair.publicKey }) + } + + static async init({ secretKey, seed }: IInitArguments) { + let keypair: KeyPair + + if (secretKey) { + keypair = keyPairFromSecretKey(Buffer.from(secretKey, 'hex')) + } else if (seed) { + keypair = keyPairFromSeed(Buffer.from(seed, 'hex')) + } else { + // Generate random keypair using crypto.getRandomValues + const _seed = crypto.getRandomValues(new Uint8Array(32)) + keypair = keyPairFromSeed(Buffer.from(_seed)) + } + + return new TonLib(keypair) + } + + public async getAddress() { + return this.wallet.address.toString({ bounceable: false }) + } + + public getSecretKey() { + return this.keypair.secretKey.toString('hex') + } + + public async signMessage( + params: TonLib.SignMessage['params'] + ): Promise { + const signature = sign(Buffer.from(params.message), this.keypair.secretKey) + return { + signature: signature.toString('base64'), + publicKey: this.keypair.publicKey.toString('base64') + } + } + + public async sendMessage( + params: TonLib.SendMessage['params'], + chainId: string + ): Promise { + const client = this.getTonClient(chainId) + const walletContract = client.open(this.wallet) + const seqno = await walletContract.getSeqno() + const messages = (params.messages || []).map(m => { + const amountBigInt = typeof m.amount === 'string' ? BigInt(m.amount) : BigInt(m.amount) + + return internal({ + to: Address.parse(m.address), + value: amountBigInt, + body: m.payload ?? 'Test transfer from ton WalletConnect' + }) + }); + + // Create the transfer + const transfer = walletContract.createTransfer({ + seqno, + secretKey: this.keypair.secretKey, + messages + }) + + // Send the transfer + await walletContract.sendTransfer({ + seqno, + secretKey: this.keypair.secretKey, + messages + }) + + return transfer.toBoc().toString('base64') + } + + public async signData(params: TonLib.SignData['params']): Promise { + const payload: TonLib.SignData['params'] = params + const dataToSign = this.getToSign(params) + const signature = sign(dataToSign, this.keypair.secretKey as unknown as Buffer) + const addressStr = await this.getAddress() + + const result = { + signature: signature.toString('base64'), + address: addressStr, + publicKey: this.keypair.publicKey.toString('base64'), + timestamp: Math.floor(Date.now() / 1000), + domain: 'unknown', + payload + } + + try { + const verified = signVerify( + dataToSign, + Buffer.from(result.signature, 'base64'), + this.keypair.publicKey + ) + console.log('TON signData verified:', verified) + } catch (e) { + console.warn('TON signData verification failed to run', e) + } + return result + } + + private getTonClient(chainId: string): TonClient { + const rpc = { ...TON_TEST_CHAINS, ...TON_MAINNET_CHAINS }[chainId]?.rpcUrl + + if (!rpc) { + throw new Error('There is no RPC URL for the provided chain') + } + + return new TonClient({ + endpoint: rpc, + apiKey: Config.ENV_TON_CENTER_API_KEY + }) + } + + private getToSign(params: TonLib.SignData['params']): Buffer { + if (params.type === 'text') { + return Buffer.from(params.text) + } else if (params.type === 'binary') { + return Buffer.from(params.bytes) + } else if (params.type === 'cell') { + return Buffer.from(params.cell) + } else { + throw new Error('Unsupported sign data type') + } + } +} + +export namespace TonLib { + type RPCRequest = { + params: Params + result: Result + } + + export type SignMessage = RPCRequest< + { message: string }, + { signature: string; publicKey: string } + > + + export type SendMessage = RPCRequest< + { + valid_until?: number + from?: string + messages: Array<{ + address: string + amount: number | string + payload?: string + stateInit?: string + extra_currency?: Record + }> + }, + string + > + + export type SignData = RPCRequest< + | { type: 'text'; text: string; from?: string } + | { type: 'binary'; bytes: string; from?: string } + | { type: 'cell'; schema: string; cell: string; from?: string }, + { + signature: string + address: string + publicKey: string + timestamp: number + domain: string + payload: unknown + } + > +} diff --git a/wallets/rn_cli_wallet/src/modals/SessionAuthenticateModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionAuthenticateModal.tsx index 6654e613..c02b441c 100644 --- a/wallets/rn_cli_wallet/src/modals/SessionAuthenticateModal.tsx +++ b/wallets/rn_cli_wallet/src/modals/SessionAuthenticateModal.tsx @@ -11,9 +11,9 @@ import SettingsStore from '@/store/SettingsStore'; import {handleRedirect} from '@/utils/LinkingUtils'; import {useTheme} from '@/hooks/useTheme'; -import {EIP155_CHAINS, EIP155_SIGNING_METHODS} from '@/utils/PresetsUtil'; import {RequestModal} from './RequestModal'; import {Message} from '@/components/Modal/Message'; +import { EIP155_CHAINS, EIP155_SIGNING_METHODS } from '@/constants/Eip155'; export default function SessionAuthenticateModal() { const Theme = useTheme(); @@ -79,7 +79,7 @@ export default function SessionAuthenticateModal() { handleRedirect({ peerRedirect: authRequest.params.requester?.metadata?.redirect, - isLinkMode: isLinkModeRequest, + isLinkMode: isLinkModeRequest }); } catch (e) { console.log((e as Error).message, 'error'); @@ -106,6 +106,7 @@ export default function SessionAuthenticateModal() { handleRedirect({ peerRedirect: authRequest.params.requester?.metadata?.redirect, isLinkMode: SettingsStore.state.isLinkModeRequest, + error: 'User rejected auth request', }); } catch (e) { console.log((e as Error).message, 'error'); diff --git a/wallets/rn_cli_wallet/src/modals/SessionProposalModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionProposalModal.tsx index b6b17c74..fb9698b9 100644 --- a/wallets/rn_cli_wallet/src/modals/SessionProposalModal.tsx +++ b/wallets/rn_cli_wallet/src/modals/SessionProposalModal.tsx @@ -14,16 +14,13 @@ import SettingsStore from '@/store/SettingsStore'; import {handleRedirect} from '@/utils/LinkingUtils'; import {useTheme} from '@/hooks/useTheme'; import {Chains} from '@/components/Modal/Chains'; -import { - EIP155_CHAINS, - EIP155_SIGNING_METHODS, - SUI_CHAINS, - SUI_EVENTS, - SUI_SIGNING_METHODS, -} from '@/utils/PresetsUtil'; import {RequestModal} from './RequestModal'; import {getSupportedChains} from '@/utils/HelperUtil'; import {suiAddresses} from '@/utils/SuiWalletUtil'; +import { EIP155_CHAINS, EIP155_SIGNING_METHODS } from '@/constants/Eip155'; +import { SUI_CHAINS, SUI_EVENTS, SUI_SIGNING_METHODS } from '@/constants/Sui'; +import { TON_CHAINS, TON_SIGNING_METHODS } from '@/constants/Ton'; +import { tonAddresses } from '@/utils/TonWalletUtil' export default function SessionProposalModal() { const Theme = useTheme(); @@ -51,6 +48,11 @@ export default function SessionProposalModal() { const suiMethods = Object.values(SUI_SIGNING_METHODS); const suiEvents = Object.values(SUI_EVENTS); + // ton + const tonChains = Object.keys(TON_CHAINS) + const tonMethods = Object.values(TON_SIGNING_METHODS) + const tonEvents = [] as string[] + return { eip155: { chains: eip155Chains, @@ -66,6 +68,12 @@ export default function SessionProposalModal() { events: suiEvents, accounts: suiChains.map(chain => `${chain}:${suiAddresses[0]}`).flat(), }, + ton: { + chains: tonChains, + methods: tonMethods, + events: tonEvents, + accounts: tonChains.map(chain => `${chain}:${tonAddresses[0]}`).flat(), + }, }; }, []); @@ -88,7 +96,6 @@ export default function SessionProposalModal() { proposal: proposal.params, supportedNamespaces, }); - try { const session = await walletKit.approveSession({ id: proposal.id, @@ -125,6 +132,7 @@ export default function SessionProposalModal() { handleRedirect({ peerRedirect: proposal.params.proposer.metadata.redirect, isLinkMode: false, + error: 'User rejected connect request', }); } catch (e) { console.log((e as Error).message, 'error'); diff --git a/wallets/rn_cli_wallet/src/modals/SessionSendTransactionModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionSendTransactionModal.tsx index 072a21a9..2909626b 100644 --- a/wallets/rn_cli_wallet/src/modals/SessionSendTransactionModal.tsx +++ b/wallets/rn_cli_wallet/src/modals/SessionSendTransactionModal.tsx @@ -49,6 +49,7 @@ export default function SessionSendTransactionModal() { handleRedirect({ peerRedirect: peerMetadata?.redirect, isLinkMode: isLinkMode, + error: 'error' in response ? response.error.message : undefined, }); } catch (e) { console.log((e as Error).message, 'error'); @@ -88,7 +89,7 @@ export default function SessionSendTransactionModal() { approveLoader={isLoadingApprove} rejectLoader={isLoadingReject}> - + {chain ? : null} diff --git a/wallets/rn_cli_wallet/src/modals/SessionSignModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionSignModal.tsx index 7f730964..be80d4ea 100644 --- a/wallets/rn_cli_wallet/src/modals/SessionSignModal.tsx +++ b/wallets/rn_cli_wallet/src/modals/SessionSignModal.tsx @@ -51,6 +51,7 @@ export default function SessionSignModal() { handleRedirect({ peerRedirect: peerMetadata?.redirect, isLinkMode: isLinkMode, + error: 'error' in response ? response.error.message : undefined, }); } catch (e) { console.log((e as Error).message, 'error'); @@ -74,6 +75,7 @@ export default function SessionSignModal() { handleRedirect({ peerRedirect: peerMetadata?.redirect, isLinkMode: isLinkMode, + error: 'User rejected signature request', }); } catch (e) { setIsLoadingReject(false); @@ -100,7 +102,7 @@ export default function SessionSignModal() { approveLoader={isLoadingApprove} rejectLoader={isLoadingReject}> - + {chain ? : null} diff --git a/wallets/rn_cli_wallet/src/modals/SessionSignTypedDataModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionSignTypedDataModal.tsx index 2c3a563e..1797915a 100644 --- a/wallets/rn_cli_wallet/src/modals/SessionSignTypedDataModal.tsx +++ b/wallets/rn_cli_wallet/src/modals/SessionSignTypedDataModal.tsx @@ -49,6 +49,7 @@ export default function SessionSignTypedDataModal() { handleRedirect({ peerRedirect: peerMetadata?.redirect, isLinkMode: isLinkMode, + error: 'error' in response ? response.error.message : undefined, }); } catch (e) { console.log((e as Error).message, 'error'); @@ -93,7 +94,7 @@ export default function SessionSignTypedDataModal() { approveLoader={isLoadingApprove} rejectLoader={isLoadingReject}> - + {chain ? : null} diff --git a/wallets/rn_cli_wallet/src/modals/SessionSuiSignAndExecuteTransactionModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionSuiSignAndExecuteTransactionModal.tsx index 7b32b3eb..c48a3e73 100644 --- a/wallets/rn_cli_wallet/src/modals/SessionSuiSignAndExecuteTransactionModal.tsx +++ b/wallets/rn_cli_wallet/src/modals/SessionSuiSignAndExecuteTransactionModal.tsx @@ -85,6 +85,7 @@ export default function SessionSuiSignAndExecuteTransactionModal() { handleRedirect({ peerRedirect: peerMetadata?.redirect, isLinkMode: isLinkMode, + error: 'User rejected transaction request', }); } catch (e) { setIsLoadingReject(false); @@ -111,7 +112,7 @@ export default function SessionSuiSignAndExecuteTransactionModal() { approveLoader={isLoadingApprove} rejectLoader={isLoadingReject}> - + {chain ? : null} diff --git a/wallets/rn_cli_wallet/src/modals/SessionSuiSignPersonalMessageModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionSuiSignPersonalMessageModal.tsx index ab77385d..2e9e26e2 100644 --- a/wallets/rn_cli_wallet/src/modals/SessionSuiSignPersonalMessageModal.tsx +++ b/wallets/rn_cli_wallet/src/modals/SessionSuiSignPersonalMessageModal.tsx @@ -74,6 +74,7 @@ export default function SessionSignSuiPersonalMessageModal() { handleRedirect({ peerRedirect: peerMetadata?.redirect, isLinkMode: isLinkMode, + error: 'User rejected personal message request', }); } catch (e) { setIsLoadingReject(false); @@ -100,7 +101,7 @@ export default function SessionSignSuiPersonalMessageModal() { approveLoader={isLoadingApprove} rejectLoader={isLoadingReject}> - + {chain ? : null} diff --git a/wallets/rn_cli_wallet/src/modals/SessionSuiSignTransactionModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionSuiSignTransactionModal.tsx index d5ccfb63..32878e03 100644 --- a/wallets/rn_cli_wallet/src/modals/SessionSuiSignTransactionModal.tsx +++ b/wallets/rn_cli_wallet/src/modals/SessionSuiSignTransactionModal.tsx @@ -84,6 +84,7 @@ export default function SessionSignSuiPersonalMessageModal() { handleRedirect({ peerRedirect: peerMetadata?.redirect, isLinkMode: isLinkMode, + error: 'User rejected transaction request', }); } catch (e) { setIsLoadingReject(false); @@ -110,7 +111,7 @@ export default function SessionSignSuiPersonalMessageModal() { approveLoader={isLoadingApprove} rejectLoader={isLoadingReject}> - + {chain ? : null} diff --git a/wallets/rn_cli_wallet/src/modals/SessionTonSendMessageModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionTonSendMessageModal.tsx new file mode 100644 index 00000000..dd10269e --- /dev/null +++ b/wallets/rn_cli_wallet/src/modals/SessionTonSendMessageModal.tsx @@ -0,0 +1,181 @@ +import {useSnapshot} from 'valtio'; +import {useCallback, useState} from 'react'; +import {View, StyleSheet, Text} from 'react-native'; +import {SignClientTypes} from '@walletconnect/types'; + +import {Methods} from '@/components/Modal/Methods'; +import { + approveTonRequest, + rejectTonRequest, +} from '@/utils/TonRequestHandlerUtil'; +import {walletKit} from '@/utils/WalletKitUtil'; +import {handleRedirect} from '@/utils/LinkingUtils'; +import ModalStore from '@/store/ModalStore'; +import {RequestModal} from './RequestModal'; +import {Chains} from '@/components/Modal/Chains'; +import {PresetsUtil} from '@/utils/PresetsUtil'; +import {tonAddresses} from '@/utils/TonWalletUtil'; +import {useTheme} from '@/hooks/useTheme'; + +export default function SessionTonSendMessageModal() { + // Get request and wallet data from store + const {data} = useSnapshot(ModalStore.state); + const requestEvent = data?.requestEvent; + const session = data?.requestSession; + const isLinkMode = session?.transportType === 'link_mode'; + + const [isLoadingApprove, setIsLoadingApprove] = useState(false); + const [isLoadingReject, setIsLoadingReject] = useState(false); + + const Theme = useTheme(); + + // Get required request data + const {topic, params} = requestEvent!; + const {request, chainId} = params; + const chain = PresetsUtil.getChainData(chainId); + const peerMetadata = session?.peer?.metadata as SignClientTypes.Metadata; + const method = requestEvent?.params?.request?.method!; + + // Extract message details for display (SendMessage spec) + const tx = Array.isArray(request.params) + ? request.params[0] + : request.params || {}; + const messages = Array.isArray(tx.messages) ? tx.messages : []; + + // Format transaction details + const formatTransactionDetails = () => { + if (messages.length === 0) { + return 'No messages'; + } + + return messages + .map((m: any, idx: number) => { + let details = `Message ${idx + 1}:\nTo: ${m.address}\nAmount: ${m.amount} nanotons`; + if (m.payload) { + details += `\nPayload: ${m.payload}`; + } + if (m.stateInit) { + details += `\nStateInit: ${m.stateInit}`; + } + return details; + }) + .join('\n\n'); + }; + + // Handle approve action + const onApprove = useCallback(async () => { + try { + if (requestEvent) { + setIsLoadingApprove(true); + const response = await approveTonRequest(requestEvent); + console.log('response', response); + + await walletKit.respondSessionRequest({ + topic, + response, + }); + + handleRedirect({ + peerRedirect: peerMetadata?.redirect, + isLinkMode: isLinkMode, + error: 'error' in response ? response.error.message : undefined, + }); + } + } catch (e) { + console.log((e as Error).message, 'error'); + } finally { + setIsLoadingApprove(false); + ModalStore.close(); + } + }, [requestEvent, peerMetadata, topic, isLinkMode]); + + // Handle reject action + const onReject = useCallback(async () => { + if (requestEvent) { + setIsLoadingReject(true); + const response = rejectTonRequest(requestEvent); + try { + await walletKit.respondSessionRequest({ + topic, + response, + }); + handleRedirect({ + peerRedirect: peerMetadata?.redirect, + isLinkMode: isLinkMode, + error: 'User rejected request', + }); + } catch (e) { + setIsLoadingReject(false); + console.log((e as Error).message, 'error'); + return; + } + setIsLoadingReject(false); + ModalStore.close(); + } + }, [requestEvent, topic, peerMetadata, isLinkMode]); + + // Ensure request and wallet are defined + if (!requestEvent || !session) { + return Missing request data; + } + + return ( + + + {chain ? : null} + + + {/* Sign with Address */} + + + Sign with Address + + + {tonAddresses[0]} + + + + {/* Transaction Details */} + + + Transaction Details + + + {formatTransactionDetails()} + + + + + ); +} + +const styles = StyleSheet.create({ + container: { + width: '100%', + marginVertical: 8, + paddingHorizontal: 16, + rowGap: 8, + }, + section: { + borderRadius: 20, + paddingVertical: 8, + paddingHorizontal: 16, + }, + sectionTitle: { + fontSize: 12, + lineHeight: 18, + fontWeight: '600', + marginBottom: 4, + }, + sectionContent: { + fontSize: 12, + lineHeight: 18, + }, +}); \ No newline at end of file diff --git a/wallets/rn_cli_wallet/src/modals/SessionTonSignDataModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionTonSignDataModal.tsx new file mode 100644 index 00000000..d0813d00 --- /dev/null +++ b/wallets/rn_cli_wallet/src/modals/SessionTonSignDataModal.tsx @@ -0,0 +1,177 @@ +import {useSnapshot} from 'valtio'; +import {useCallback, useState} from 'react'; +import {View, StyleSheet, Text} from 'react-native'; +import {SignClientTypes} from '@walletconnect/types'; + +import {Methods} from '@/components/Modal/Methods'; +import {Message} from '@/components/Modal/Message'; +import { + approveTonRequest, + rejectTonRequest, +} from '@/utils/TonRequestHandlerUtil'; +import {walletKit} from '@/utils/WalletKitUtil'; +import {handleRedirect} from '@/utils/LinkingUtils'; +import ModalStore from '@/store/ModalStore'; +import {RequestModal} from './RequestModal'; +import {Chains} from '@/components/Modal/Chains'; +import {PresetsUtil} from '@/utils/PresetsUtil'; +import {tonAddresses} from '@/utils/TonWalletUtil'; +import {useTheme} from '@/hooks/useTheme'; + +export default function SessionTonSignDataModal() { + // Get request and wallet data from store + const {data} = useSnapshot(ModalStore.state); + const requestEvent = data?.requestEvent; + const session = data?.requestSession; + const isLinkMode = session?.transportType === 'link_mode'; + + const [isLoadingApprove, setIsLoadingApprove] = useState(false); + const [isLoadingReject, setIsLoadingReject] = useState(false); + + const Theme = useTheme(); + + // Get required request data + const {topic, params} = requestEvent!; + const {request, chainId} = params; + const chain = PresetsUtil.getChainData(chainId); + const peerMetadata = session?.peer?.metadata as SignClientTypes.Metadata; + const method = requestEvent?.params?.request?.method!; + + // Extract payload + const payload = Array.isArray(request.params) + ? request.params[0] + : request.params || {}; + + // Format payload message based on type + const getPayloadMessage = () => { + if (payload?.type === 'text') { + return payload.text; + } else if (payload?.type === 'binary') { + const bytes = payload.bytes?.slice(0, 64) || ''; + const suffix = payload.bytes?.length > 64 ? '...' : ''; + return `Binary (base64): ${bytes}${suffix}`; + } else if (payload?.type === 'cell') { + const cell = payload.cell?.slice(0, 64) || ''; + const suffix = payload.cell?.length > 64 ? '...' : ''; + return `Cell (base64): ${cell}${suffix}`; + } + return JSON.stringify(payload); + }; + + // Handle approve action + const onApprove = useCallback(async () => { + try { + if (requestEvent) { + setIsLoadingApprove(true); + const response = await approveTonRequest(requestEvent); + await walletKit.respondSessionRequest({ + topic, + response, + }); + + handleRedirect({ + peerRedirect: peerMetadata?.redirect, + isLinkMode: isLinkMode, + error: 'error' in response ? response.error.message : undefined, + }); + } + } catch (e) { + console.log((e as Error).message, 'error'); + } finally { + setIsLoadingApprove(false); + ModalStore.close(); + } + }, [requestEvent, peerMetadata, topic, isLinkMode]); + + // Handle reject action + const onReject = useCallback(async () => { + if (requestEvent) { + setIsLoadingReject(true); + const response = rejectTonRequest(requestEvent); + try { + await walletKit.respondSessionRequest({ + topic, + response, + }); + handleRedirect({ + peerRedirect: peerMetadata?.redirect, + isLinkMode: isLinkMode, + error: 'User rejected request', + }); + } catch (e) { + setIsLoadingReject(false); + console.log((e as Error).message, 'error'); + return; + } + setIsLoadingReject(false); + ModalStore.close(); + } + }, [requestEvent, topic, peerMetadata, isLinkMode]); + + + // Ensure request and wallet are defined + if (!requestEvent || !session) { + return Missing request data; + } + + return ( + + + {chain ? : null} + + + {/* Sign with Address */} + + + Sign with Address + + + {tonAddresses[0]} + + + + {/* Payload */} + + + + Payload + + + {getPayloadMessage()} + + + + + ); +} + +const styles = StyleSheet.create({ + container: { + width: '100%', + marginVertical: 8, + paddingHorizontal: 16, + rowGap: 8, + }, + section: { + borderRadius: 20, + paddingVertical: 8, + paddingHorizontal: 16, + }, + sectionTitle: { + fontSize: 12, + lineHeight: 18, + fontWeight: '600', + marginBottom: 4, + }, + sectionContent: { + fontSize: 12, + lineHeight: 18, + }, +}); \ No newline at end of file diff --git a/wallets/rn_cli_wallet/src/screens/Settings/index.tsx b/wallets/rn_cli_wallet/src/screens/Settings/index.tsx index 9060d3ab..700562b8 100644 --- a/wallets/rn_cli_wallet/src/screens/Settings/index.tsx +++ b/wallets/rn_cli_wallet/src/screens/Settings/index.tsx @@ -16,7 +16,7 @@ type Props = SettingsStackScreenProps<'Settings'>; export default function Settings({navigation}: Props) { const Theme = useTheme(); - const {eip155Address, socketStatus} = useSnapshot(SettingsStore.state); + const {eip155Address, suiAddress, tonAddress, socketStatus} = useSnapshot(SettingsStore.state); const [clientId, setClientId] = useState(''); useEffect(() => { @@ -42,12 +42,22 @@ export default function Settings({navigation}: Props) { Account copyToClipboard(eip155Address)} /> copyToClipboard(suiAddress)} + /> + copyToClipboard(tonAddress)} + /> + copyToClipboard(eip155Wallets[eip155Address].getMnemonic()) } diff --git a/wallets/rn_cli_wallet/src/store/ModalStore.ts b/wallets/rn_cli_wallet/src/store/ModalStore.ts index 16df3d58..46640010 100644 --- a/wallets/rn_cli_wallet/src/store/ModalStore.ts +++ b/wallets/rn_cli_wallet/src/store/ModalStore.ts @@ -26,7 +26,9 @@ interface State { | 'LoadingModal' | 'SessionSuiSignTransactionModal' | 'SessionSuiSignPersonalMessageModal' - | 'SessionSuiSignAndExecuteTransactionModal'; + | 'SessionSuiSignAndExecuteTransactionModal' + | 'SessionTonSendMessageModal' + | 'SessionTonSignDataModal'; data?: ModalData; } diff --git a/wallets/rn_cli_wallet/src/store/SettingsStore.ts b/wallets/rn_cli_wallet/src/store/SettingsStore.ts index 2677f7d0..896f9ccf 100644 --- a/wallets/rn_cli_wallet/src/store/SettingsStore.ts +++ b/wallets/rn_cli_wallet/src/store/SettingsStore.ts @@ -14,6 +14,7 @@ interface State { eip155Address: string; suiAddress: string; suiWallet: SuiLib | null; + tonAddress: string relayerRegionURL: string; activeChainId: string; currentRequestVerifyContext?: Verify.Context; @@ -39,6 +40,7 @@ const state = proxy({ eip155Address: '', suiAddress: '', suiWallet: null, + tonAddress: '', relayerRegionURL: '', sessions: [], wallet: null, @@ -111,6 +113,10 @@ const SettingsStore = { setSuiWallet(suiWallet: SuiLib) { state.suiWallet = suiWallet; }, + + setTonAddress(tonAddress: string) { + state.tonAddress = tonAddress + }, }; export default SettingsStore; diff --git a/wallets/rn_cli_wallet/src/utils/EIP155RequestHandlerUtil.ts b/wallets/rn_cli_wallet/src/utils/EIP155RequestHandlerUtil.ts index 5d963966..69fc94d5 100644 --- a/wallets/rn_cli_wallet/src/utils/EIP155RequestHandlerUtil.ts +++ b/wallets/rn_cli_wallet/src/utils/EIP155RequestHandlerUtil.ts @@ -9,7 +9,8 @@ import { getSignTypedDataParamsData, getWalletAddressFromParams, } from '@/utils/HelperUtil'; -import {EIP155_SIGNING_METHODS, PresetsUtil} from './PresetsUtil'; +import {PresetsUtil} from './PresetsUtil'; +import { EIP155_SIGNING_METHODS } from '@/constants/Eip155'; type RequestEventArgs = Omit< SignClientTypes.EventArguments['session_request'], 'verifyContext' @@ -59,7 +60,7 @@ export async function approveEIP155Request(requestEvent: RequestEventArgs) { case EIP155_SIGNING_METHODS.ETH_SEND_TRANSACTION: try { const chainData = PresetsUtil.getChainData(chainId); - const provider = new providers.JsonRpcProvider(chainData.rpcUrl); + const provider = new providers.JsonRpcProvider(chainData?.rpcUrl); const sendTransaction = request.params[0]; const connectedWallet = wallet.connect(provider); const {hash} = await connectedWallet.sendTransaction(sendTransaction); diff --git a/wallets/rn_cli_wallet/src/utils/LinkingUtils.ts b/wallets/rn_cli_wallet/src/utils/LinkingUtils.ts index ff4c78db..487283aa 100644 --- a/wallets/rn_cli_wallet/src/utils/LinkingUtils.ts +++ b/wallets/rn_cli_wallet/src/utils/LinkingUtils.ts @@ -10,22 +10,32 @@ interface redirect { interface Props { peerRedirect?: redirect; isLinkMode?: boolean; + error?: string; } const showSuccessToast = () => { Toast.show({ type: 'success', - text1: 'Success!', + text1: 'Success', text2: 'Please go back to the dapp', }); }; -export const handleRedirect = ({peerRedirect, isLinkMode}: Props) => { +export const handleRedirect = ({peerRedirect, isLinkMode, error}: Props) => { try { + if (error) { + Toast.show({ + type: 'error', + text1: 'Error', + text2: error, + }); + return; + } + if (isLinkMode) { Toast.show({ type: 'success', - text1: 'Success!', + text1: 'Success', text2: 'Redirecting to the dapp', }); return; diff --git a/wallets/rn_cli_wallet/src/utils/PresetsUtil.ts b/wallets/rn_cli_wallet/src/utils/PresetsUtil.ts index ab0b5bd4..627449f4 100644 --- a/wallets/rn_cli_wallet/src/utils/PresetsUtil.ts +++ b/wallets/rn_cli_wallet/src/utils/PresetsUtil.ts @@ -1,371 +1,35 @@ -import {Chain} from './TypesUtil'; -import Ethereum from '@/assets/chains/ethereum.webp'; -import Arbitrum from '@/assets/chains/arbitrum.webp'; -import Avalanche from '@/assets/chains/avalanche.webp'; -import Binance from '@/assets/chains/binance.webp'; -import Fantom from '@/assets/chains/fantom.webp'; -import Optimism from '@/assets/chains/optimism.webp'; -import Polygon from '@/assets/chains/polygon.webp'; -import Gnosis from '@/assets/chains/gnosis.webp'; -import Evmos from '@/assets/chains/evmos.webp'; -import ZkSync from '@/assets/chains/zksync.webp'; -import Filecoin from '@/assets/chains/filecoin.webp'; -import Iotx from '@/assets/chains/iotx.webp'; -import Metis from '@/assets/chains/metis.webp'; -import Moonbeam from '@/assets/chains/moonbeam.webp'; -import Moonriver from '@/assets/chains/moonriver.webp'; -import Zora from '@/assets/chains/zora.webp'; -import Celo from '@/assets/chains/celo.webp'; -import Base from '@/assets/chains/base.webp'; -import Aurora from '@/assets/chains/aurora.webp'; -import Sui from '@/assets/chains/sui.webp'; import {ImageSourcePropType} from 'react-native'; +import { TON_CHAINS, TON_NETWORKS_IMAGES } from '@/constants/Ton'; +import { SUI_CHAINS, SUI_NETWORKS_IMAGES } from '@/constants/Sui'; +import { EIP155_CHAINS, EIP155_NETWORK_IMAGES } from '@/constants/Eip155'; -// Helpers -export const EIP155_CHAINS: Record = { - 'eip155:1': { - id: 1, - caip2: 'eip155:1', - network: 'homestead', - name: 'Ethereum', - nativeCurrency: {name: 'Ether', symbol: 'ETH', decimals: 18}, - rpcUrl: 'https://eth.llamarpc.com', - blockExplorer: 'https://etherscan.io', - }, - 'eip155:5': { - id: 5, - caip2: 'eip155:5', - network: 'goerli', - name: 'Ethereum Goerli', - nativeCurrency: {name: 'Goerli Ether', symbol: 'ETH', decimals: 18}, - rpcUrl: 'https://rpc.ankr.com/eth_goerli', - blockExplorer: 'https://goerli.etherscan.io', - }, - 'eip155:42161': { - id: 42161, - caip2: 'eip155:42161', - network: 'arbitrum', - name: 'Arbitrum One', - nativeCurrency: {name: 'Ether', symbol: 'ETH', decimals: 18}, - rpcUrl: 'https://arb1.arbitrum.io/rpc', - blockExplorer: 'https://arbiscan.io', - }, - 'eip155:43114': { - id: 43114, - caip2: 'eip155:43114', - network: 'avalanche', - name: 'Avalanche', - nativeCurrency: {name: 'Avalanche', symbol: 'AVAX', decimals: 18}, - rpcUrl: 'https://api.avax.network/ext/bc/C/rpc', - blockExplorer: 'https://snowtrace.io', - }, - 'eip155:43113': { - id: 43113, - caip2: 'eip155:43113', - network: 'avalanche-fuji', - name: 'Avalanche Fuji', - nativeCurrency: {name: 'Avalanche', symbol: 'AVAX', decimals: 18}, - rpcUrl: 'https://api.avax-test.network/ext/bc/C/rpc', - blockExplorer: 'https://testnet.snowtrace.io', - }, - 'eip155:56': { - id: 56, - caip2: 'eip155:56', - network: 'bsc', - name: 'Binance Smart Chain', - nativeCurrency: {name: 'BNB', symbol: 'BNB', decimals: 18}, - rpcUrl: 'https://rpc.ankr.com/bsc', - blockExplorer: 'https://bscscan.com', - }, - 'eip155:250': { - id: 250, - caip2: 'eip155:250', - network: 'fantom', - name: 'Fantom', - nativeCurrency: {name: 'Fantom', symbol: 'FTM', decimals: 18}, - rpcUrl: 'https://rpc.ankr.com/fantom', - blockExplorer: 'https://ftmscan.com', - }, - 'eip155:10': { - id: 10, - caip2: 'eip155:10', - network: 'optimism', - name: 'Optimism', - nativeCurrency: {name: 'Ether', symbol: 'ETH', decimals: 18}, - rpcUrl: 'https://mainnet.optimism.io', - blockExplorer: 'https://optimistic.etherscan.io', - }, - 'eip155:11155420': { - id: 11155420, - caip2: 'eip155:11155420', - network: 'optimism-sepholia', - name: 'Optimism Sepholia', - nativeCurrency: {name: 'Sepolia Ether', symbol: 'ETH', decimals: 18}, - rpcUrl: 'https://sepolia.optimism.io', - blockExplorer: 'https://optimism-sepolia.blockscout.com', - }, - 'eip155:137': { - id: 137, - caip2: 'eip155:137', - network: 'polygon', - name: 'Polygon', - nativeCurrency: {name: 'Matic', symbol: 'MATIC', decimals: 18}, - rpcUrl: 'https://polygon-rpc.com', - blockExplorer: 'https://polygonscan.com', - }, - 'eip155:80001': { - id: 80001, - caip2: 'eip155:80001', - network: 'mumbai', - name: 'Polygon Mumbai', - nativeCurrency: {name: 'Matic', symbol: 'MATIC', decimals: 18}, - rpcUrl: 'https://rpc.ankr.com/polygon_mumbai', - blockExplorer: 'https://mumbai.polygonscan.com', - }, - 'eip155:100': { - id: 100, - caip2: 'eip155:100', - network: 'gnosis', - name: 'Gnosis', - nativeCurrency: {name: 'Gnosis', symbol: 'xDai', decimals: 18}, - rpcUrl: 'https://rpc.gnosischain.com', - blockExplorer: 'https://gnosis.blockscout.com', - }, - 'eip155:9001': { - id: 9001, - caip2: 'eip155:9001', - network: 'evmos', - name: 'Evmos', - nativeCurrency: {name: 'Evmos', symbol: 'EVMOS', decimals: 18}, - rpcUrl: 'https://eth.bd.evmos.org:8545', - blockExplorer: 'https://escan.live', - }, - 'eip155:324': { - id: 324, - caip2: 'eip155:324', - network: 'zksync-era', - name: 'zkSync Era', - nativeCurrency: {name: 'Ether', symbol: 'ETH', decimals: 18}, - rpcUrl: 'https://mainnet.era.zksync.io', - blockExplorer: 'https://explorer.zksync.io', - }, - 'eip155:314': { - id: 314, - caip2: 'eip155:314', - network: 'filecoin-mainnet', - name: 'Filecoin Mainnet', - nativeCurrency: {name: 'Filecoin', symbol: 'FIL', decimals: 18}, - rpcUrl: 'https://api.node.glif.io/rpc/v1', - blockExplorer: 'https://filscan.io', - }, - 'eip155:4689': { - id: 4689, - caip2: 'eip155:4689', - network: 'iotex', - name: 'IoTeX', - nativeCurrency: {name: 'IoTeX', symbol: 'IOTX', decimals: 18}, - rpcUrl: 'https://babel-api.mainnet.iotex.io', - blockExplorer: 'https://iotexscan.io', - }, - 'eip155:1088': { - id: 1088, - caip2: 'eip155:1088', - network: 'andromeda', - name: 'Metis', - nativeCurrency: {name: 'Metis', symbol: 'METIS', decimals: 18}, - rpcUrl: 'https://andromeda.metis.io/?owner=1088', - blockExplorer: 'https://andromeda-explorer.metis.io', - }, - 'eip155:1284': { - id: 1284, - caip2: 'eip155:1284', - network: 'moonbeam', - name: 'Moonbeam', - nativeCurrency: {name: 'GLMR', symbol: 'GLMR', decimals: 18}, - rpcUrl: 'https://moonbeam.public.blastapi.io', - blockExplorer: 'https://moonscan.io', - }, - 'eip155:1285': { - id: 1285, - caip2: 'eip155:1285', - network: 'moonriver', - name: 'Moonriver', - nativeCurrency: {name: 'MOVR', symbol: 'MOVR', decimals: 18}, - rpcUrl: 'https://moonriver.public.blastapi.io', - blockExplorer: 'https://moonriver.moonscan.io', - }, - 'eip155:7777777': { - id: 7777777, - caip2: 'eip155:7777777', - network: 'zora', - name: 'Zora', - nativeCurrency: {name: 'Ether', symbol: 'ETH', decimals: 18}, - rpcUrl: 'https://rpc.zora.energy', - blockExplorer: 'https://explorer.zora.energy', - }, - 'eip155:42220': { - id: 42220, - caip2: 'eip155:42220', - network: 'celo', - name: 'Celo', - nativeCurrency: {name: 'Celo', symbol: 'CELO', decimals: 18}, - rpcUrl: 'https://forno.celo.org', - blockExplorer: 'https://explorer.celo.org/mainnet', - }, - 'eip155:8453': { - id: 8453, - caip2: 'eip155:8453', - network: 'base', - name: 'Base', - nativeCurrency: {name: 'Ether', symbol: 'ETH', decimals: 18}, - rpcUrl: 'https://mainnet.base.org', - blockExplorer: 'https://basescan.org', - }, - 'eip155:1313161554': { - id: 1313161554, - caip2: 'eip155:1313161554', - network: 'aurora', - name: 'Aurora', - nativeCurrency: {name: 'Ether', symbol: 'ETH', decimals: 18}, - rpcUrl: 'https://mainnet.aurora.dev', - blockExplorer: 'https://aurorascan.dev', - }, -}; - -export const EIPNetworkImages: Record = { - 'eip155:1': Ethereum, - 'eip155:5': Ethereum, - 'eip155:42161': Arbitrum, - 'eip155:43114': Avalanche, - 'eip155:43113': Avalanche, - 'eip155:56': Binance, - 'eip155:250': Fantom, - 'eip155:10': Optimism, - 'eip155:11155420': Optimism, - 'eip155:137': Polygon, - 'eip155:80001': Polygon, - 'eip155:100': Gnosis, - 'eip155:9001': Evmos, - 'eip155:324': ZkSync, - 'eip155:314': Filecoin, - 'eip155:4689': Iotx, - 'eip155:1088': Metis, - 'eip155:1284': Moonbeam, - 'eip155:1285': Moonriver, - 'eip155:7777777': Zora, - 'eip155:42220': Celo, - 'eip155:8453': Base, - 'eip155:1313161554': Aurora, -}; - -export const EIP155_SIGNING_METHODS = { - PERSONAL_SIGN: 'personal_sign', - ETH_SIGN: 'eth_sign', - ETH_SIGN_TRANSACTION: 'eth_signTransaction', - ETH_SIGN_TYPED_DATA: 'eth_signTypedData', - ETH_SIGN_TYPED_DATA_V3: 'eth_signTypedData_v3', - ETH_SIGN_TYPED_DATA_V4: 'eth_signTypedData_v4', - ETH_SEND_RAW_TRANSACTION: 'eth_sendRawTransaction', - ETH_SEND_TRANSACTION: 'eth_sendTransaction', -}; - -// SUI - -/** - * Methods - */ -export const SUI_SIGNING_METHODS = { - SUI_SIGN_TRANSACTION: 'sui_signTransaction', - SUI_SIGN_AND_EXECUTE_TRANSACTION: 'sui_signAndExecuteTransaction', - SUI_SIGN_PERSONAL_MESSAGE: 'sui_signPersonalMessage', -}; - -/** - * Events - */ - -export const SUI_EVENTS = { - SUI_ACCOUNTS_CHANGED: 'sui_accountsChanged', - SUI_CHAIN_CHANGED: 'sui_chainChanged', -}; - -export type ISuiChainId = typeof SUI_MAINNET_CAIP2 | typeof SUI_TESTNET_CAIP2; - -export const SUI_NAMESPACE = 'sui'; - -export const SUI_MAINNET_ID = 'mainnet'; -export const SUI_TESTNET_ID = 'testnet'; -export const SUI_DEVNET_ID = 'devnet'; -export const SUI_MAINNET_CAIP2 = `${SUI_NAMESPACE}:${SUI_MAINNET_ID}`; -export const SUI_TESTNET_CAIP2 = `${SUI_NAMESPACE}:${SUI_TESTNET_ID}`; -export const SUI_DEVNET_CAIP2 = `${SUI_NAMESPACE}:${SUI_DEVNET_ID}`; - -export const SUI_MAINNET = { - [SUI_MAINNET_CAIP2]: { - id: SUI_MAINNET_ID, - caip2: SUI_MAINNET_CAIP2, - network: 'sui', - name: 'SUI Mainnet', - nativeCurrency: {name: 'SUI', symbol: 'SUI', decimals: 9}, - rpcUrl: 'https://fullnode.mainnet.sui.io', - blockExplorer: 'https://suiscan.xyz', - }, -}; -export const SUI_TESTNET = { - [SUI_TESTNET_CAIP2]: { - id: SUI_TESTNET_ID, - caip2: SUI_TESTNET_CAIP2, - network: 'sui', - name: 'SUI Testnet', - nativeCurrency: {name: 'SUI', symbol: 'SUI', decimals: 9}, - rpcUrl: 'https://fullnode.testnet.sui.io', - blockExplorer: 'https://suiscan.xyz', - }, -}; - -export const SUI_DEVNET = { - [SUI_DEVNET_CAIP2]: { - id: SUI_DEVNET_ID, - caip2: SUI_DEVNET_CAIP2, - network: 'sui', - name: 'SUI Devnet', - nativeCurrency: {name: 'SUI', symbol: 'SUI', decimals: 9}, - rpcUrl: 'https://fullnode.devnet.sui.io', - blockExplorer: 'https://suiscan.xyz', - }, -}; - -export const SUI_NETWORKS_IMAGES = { - 'sui:mainnet': Sui, - 'sui:testnet': Sui, - 'sui:devnet': Sui, -}; const NetworkImages: Record = { - ...EIPNetworkImages, + ...EIP155_NETWORK_IMAGES, ...SUI_NETWORKS_IMAGES, + ...TON_NETWORKS_IMAGES, }; -export const SUI_CHAINS: Record = { - ...SUI_MAINNET, - ...SUI_TESTNET, - ...SUI_DEVNET, -}; export const ALL_CHAINS = { ...EIP155_CHAINS, ...SUI_CHAINS, + ...TON_CHAINS, }; export const PresetsUtil = { getChainLogo: (chainId: string | number) => { - const logo = NetworkImages[String(chainId)]; + const logo = NetworkImages[chainId]; if (!logo) { return undefined; } return logo; }, - getChainData: (chainId: string | number) => { - return ALL_CHAINS[String(chainId)]; - }, + getChainData: (chainId?: string) => { + if (!chainId) return + const [namespace, reference] = chainId.toString().split(':') + return Object.values(ALL_CHAINS).find( + chain => chain.chainId === reference && chain.namespace === namespace + ) + } }; diff --git a/wallets/rn_cli_wallet/src/utils/SuiWalletUtil.ts b/wallets/rn_cli_wallet/src/utils/SuiWalletUtil.ts index 7710f276..67c6ae1d 100644 --- a/wallets/rn_cli_wallet/src/utils/SuiWalletUtil.ts +++ b/wallets/rn_cli_wallet/src/utils/SuiWalletUtil.ts @@ -16,7 +16,6 @@ export async function createOrRestoreSuiWallet() { wallet1 = await SuiLib.init({}); // Don't store private keys in local storage in a production project! await storage.setItem('SUI_MNEMONIC_1', wallet1.getMnemonic()); - console.log('SUI_MNEMONIC_1', wallet1.getMnemonic()); } suiAddresses = [wallet1.getAddress()]; diff --git a/wallets/rn_cli_wallet/src/utils/TonRequestHandlerUtil.ts b/wallets/rn_cli_wallet/src/utils/TonRequestHandlerUtil.ts new file mode 100644 index 00000000..7f8123ab --- /dev/null +++ b/wallets/rn_cli_wallet/src/utils/TonRequestHandlerUtil.ts @@ -0,0 +1,46 @@ +import { getWallet } from '@/utils/TonWalletUtil' +import { formatJsonRpcError, formatJsonRpcResult } from '@json-rpc-tools/utils' +import { SignClientTypes } from '@walletconnect/types' +import { getSdkError } from '@walletconnect/utils' +import SettingsStore from '@/store/SettingsStore' +import { TON_SIGNING_METHODS } from '@/constants/Ton' + +type RequestEventArgs = Omit + +export async function approveTonRequest(requestEvent: RequestEventArgs) { + const { params, id } = requestEvent + const { chainId, request } = params + + SettingsStore.setActiveChainId(chainId) + + const wallet = await getWallet() + + switch (request.method) { + case TON_SIGNING_METHODS.SIGN_DATA: + try { + const payload = Array.isArray(request.params) ? request.params[0] : request.params + const result = await wallet.signData(payload) + return formatJsonRpcResult(id, result) + } catch (error: any) { + console.error(error) + return formatJsonRpcError(id, error.message) + } + case TON_SIGNING_METHODS.SEND_MESSAGE: + try { + const txParams = Array.isArray(request.params) ? request.params[0] : request.params + const result = await wallet.sendMessage(txParams, chainId) + return formatJsonRpcResult(id, result) + } catch (error: any) { + console.error(error) + return formatJsonRpcError(id, error.message) + } + default: + throw new Error(getSdkError('INVALID_METHOD').message) + } +} + +export function rejectTonRequest(request: RequestEventArgs) { + const { id } = request + + return formatJsonRpcError(id, getSdkError('USER_REJECTED').message) +} \ No newline at end of file diff --git a/wallets/rn_cli_wallet/src/utils/TonWalletUtil.ts b/wallets/rn_cli_wallet/src/utils/TonWalletUtil.ts new file mode 100644 index 00000000..09f16cbb --- /dev/null +++ b/wallets/rn_cli_wallet/src/utils/TonWalletUtil.ts @@ -0,0 +1,48 @@ +import TonLib from '../lib/TonLib' +import { storage } from './storage' + +export let wallet1: TonLib +export let wallet2: TonLib +export let tonWallets: Record +export let tonAddresses: string[] + +let address1: string +let address2: string + +/** + * Utilities + */ +export async function createOrRestoreTonWallet() { + const secretKey1 = await storage.getItem('TON_SECRET_KEY_1') + const secretKey2 = await storage.getItem('TON_SECRET_KEY_2') + + if (secretKey1 && secretKey2) { + wallet1 = await TonLib.init({ secretKey: secretKey1 }) + wallet2 = await TonLib.init({ secretKey: secretKey2 }) + } else { + wallet1 = await TonLib.init({}) + wallet2 = await TonLib.init({}) + + // Don't store secretKey in local storage in a production project! + await storage.setItem('TON_SECRET_KEY_1', wallet1.getSecretKey()) + await storage.setItem('TON_SECRET_KEY_2', wallet2.getSecretKey()) + } + + address1 = await wallet1.getAddress() + address2 = await wallet2.getAddress() + + tonWallets = { + [address1]: wallet1, + [address2]: wallet2 + } + tonAddresses = Object.keys(tonWallets) + + return { + tonWallets, + tonAddresses + } +} + +export const getWallet = async () => { + return wallet1 +} \ No newline at end of file diff --git a/wallets/rn_cli_wallet/src/utils/TypesUtil.ts b/wallets/rn_cli_wallet/src/utils/TypesUtil.ts index 1f26f84a..27605cde 100644 --- a/wallets/rn_cli_wallet/src/utils/TypesUtil.ts +++ b/wallets/rn_cli_wallet/src/utils/TypesUtil.ts @@ -104,11 +104,8 @@ export type SettingsStackScreenProps = >; export type Chain = { - id: number | string; - caip2: string; - network: string; + chainId: string; name: string; - nativeCurrency: {name: string; symbol: string; decimals: number}; + namespace: string; rpcUrl: string; - blockExplorer: string; }; diff --git a/wallets/rn_cli_wallet/yarn.lock b/wallets/rn_cli_wallet/yarn.lock index 9df1ab60..01565490 100644 --- a/wallets/rn_cli_wallet/yarn.lock +++ b/wallets/rn_cli_wallet/yarn.lock @@ -1563,24 +1563,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/abi@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/abi@npm:5.7.0" - dependencies: - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: bc6962bb6cb854e4d2a4d65b2c49c716477675b131b1363312234bdbb7e19badb7d9ce66f4ca2a70ae2ea84f7123dbc4e300a1bfe5d58864a7eafabc1466627e - languageName: node - linkType: hard - -"@ethersproject/abi@npm:^5.7.0": +"@ethersproject/abi@npm:5.8.0, @ethersproject/abi@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/abi@npm:5.8.0" dependencies: @@ -1597,22 +1580,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/abstract-provider@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/abstract-provider@npm:5.7.0" - dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/networks": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/web": ^5.7.0 - checksum: 74cf4696245cf03bb7cc5b6cbf7b4b89dd9a79a1c4688126d214153a938126d4972d42c93182198653ce1de35f2a2cad68be40337d4774b3698a39b28f0228a8 - languageName: node - linkType: hard - -"@ethersproject/abstract-provider@npm:^5.7.0, @ethersproject/abstract-provider@npm:^5.8.0": +"@ethersproject/abstract-provider@npm:5.8.0, @ethersproject/abstract-provider@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/abstract-provider@npm:5.8.0" dependencies: @@ -1627,20 +1595,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/abstract-signer@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/abstract-signer@npm:5.7.0" - dependencies: - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - checksum: a823dac9cfb761e009851050ebebd5b229d1b1cc4a75b125c2da130ff37e8218208f7f9d1386f77407705b889b23d4a230ad67185f8872f083143e0073cbfbe3 - languageName: node - linkType: hard - -"@ethersproject/abstract-signer@npm:^5.7.0, @ethersproject/abstract-signer@npm:^5.8.0": +"@ethersproject/abstract-signer@npm:5.8.0, @ethersproject/abstract-signer@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/abstract-signer@npm:5.8.0" dependencies: @@ -1653,20 +1608,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/address@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/address@npm:5.7.0" - dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/rlp": ^5.7.0 - checksum: 64ea5ebea9cc0e845c413e6cb1e54e157dd9fc0dffb98e239d3a3efc8177f2ff798cd4e3206cf3660ee8faeb7bef1a47dc0ebef0d7b132c32e61e550c7d4c843 - languageName: node - linkType: hard - -"@ethersproject/address@npm:^5.7.0, @ethersproject/address@npm:^5.8.0": +"@ethersproject/address@npm:5.8.0, @ethersproject/address@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/address@npm:5.8.0" dependencies: @@ -1679,16 +1621,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/base64@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/base64@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - checksum: 7dd5d734d623582f08f665434f53685041a3d3b334a0e96c0c8afa8bbcaab934d50e5b6b980e826a8fde8d353e0b18f11e61faf17468177274b8e7c69cd9742b - languageName: node - linkType: hard - -"@ethersproject/base64@npm:^5.7.0, @ethersproject/base64@npm:^5.8.0": +"@ethersproject/base64@npm:5.8.0, @ethersproject/base64@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/base64@npm:5.8.0" dependencies: @@ -1697,17 +1630,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/basex@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/basex@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - checksum: 326087b7e1f3787b5fe6cd1cf2b4b5abfafbc355a45e88e22e5e9d6c845b613ffc5301d629b28d5c4d5e2bfe9ec424e6782c804956dff79be05f0098cb5817de - languageName: node - linkType: hard - -"@ethersproject/basex@npm:^5.7.0, @ethersproject/basex@npm:^5.8.0": +"@ethersproject/basex@npm:5.8.0, @ethersproject/basex@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/basex@npm:5.8.0" dependencies: @@ -1717,18 +1640,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/bignumber@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/bignumber@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - bn.js: ^5.2.1 - checksum: 8c9a134b76f3feb4ec26a5a27379efb4e156b8fb2de0678a67788a91c7f4e30abe9d948638458e4b20f2e42380da0adacc7c9389d05fce070692edc6ae9b4904 - languageName: node - linkType: hard - -"@ethersproject/bignumber@npm:^5.7.0, @ethersproject/bignumber@npm:^5.8.0": +"@ethersproject/bignumber@npm:5.8.0, @ethersproject/bignumber@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/bignumber@npm:5.8.0" dependencies: @@ -1739,16 +1651,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/bytes@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/bytes@npm:5.7.0" - dependencies: - "@ethersproject/logger": ^5.7.0 - checksum: 66ad365ceaab5da1b23b72225c71dce472cf37737af5118181fa8ab7447d696bea15ca22e3a0e8836fdd8cfac161afe321a7c67d0dde96f9f645ddd759676621 - languageName: node - linkType: hard - -"@ethersproject/bytes@npm:^5.7.0, @ethersproject/bytes@npm:^5.8.0": +"@ethersproject/bytes@npm:5.8.0, @ethersproject/bytes@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/bytes@npm:5.8.0" dependencies: @@ -1757,16 +1660,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/constants@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/constants@npm:5.7.0" - dependencies: - "@ethersproject/bignumber": ^5.7.0 - checksum: 6d4b1355747cce837b3e76ec3bde70e4732736f23b04f196f706ebfa5d4d9c2be50904a390d4d40ce77803b98d03d16a9b6898418e04ba63491933ce08c4ba8a - languageName: node - linkType: hard - -"@ethersproject/constants@npm:^5.7.0, @ethersproject/constants@npm:^5.8.0": +"@ethersproject/constants@npm:5.8.0, @ethersproject/constants@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/constants@npm:5.8.0" dependencies: @@ -1775,42 +1669,25 @@ __metadata: languageName: node linkType: hard -"@ethersproject/contracts@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/contracts@npm:5.7.0" - dependencies: - "@ethersproject/abi": ^5.7.0 - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - checksum: 6ccf1121cba01b31e02f8c507cb971ab6bfed85706484a9ec09878ef1594a62215f43c4fdef8f4a4875b99c4a800bc95e3be69b1803f8ce479e07634b5a740c0 - languageName: node - linkType: hard - -"@ethersproject/hash@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/hash@npm:5.7.0" +"@ethersproject/contracts@npm:5.8.0": + version: 5.8.0 + resolution: "@ethersproject/contracts@npm:5.8.0" dependencies: - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/base64": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 6e9fa8d14eb08171cd32f17f98cc108ec2aeca74a427655f0d689c550fee0b22a83b3b400fad7fb3f41cf14d4111f87f170aa7905bcbcd1173a55f21b06262ef + "@ethersproject/abi": ^5.8.0 + "@ethersproject/abstract-provider": ^5.8.0 + "@ethersproject/abstract-signer": ^5.8.0 + "@ethersproject/address": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/constants": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/transactions": ^5.8.0 + checksum: cb181012bd55cc19c08f136e56e28e922f1ca66af66747a1b3f58a2aea5b3332bc7ecfe2d23fa14245e7fd45a4fdc4f3427a345c2e9873a9792838cdfe4c62d5 languageName: node linkType: hard -"@ethersproject/hash@npm:^5.7.0, @ethersproject/hash@npm:^5.8.0": +"@ethersproject/hash@npm:5.8.0, @ethersproject/hash@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/hash@npm:5.8.0" dependencies: @@ -1827,27 +1704,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/hdnode@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/hdnode@npm:5.7.0" - dependencies: - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/basex": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/pbkdf2": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - "@ethersproject/signing-key": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/wordlists": ^5.7.0 - checksum: bfe5ca2d89a42de73655f853170ef4766b933c5f481cddad709b3aca18823275b096e572f92d1602a052f80b426edde44ad6b9d028799775a7dad4a5bbed2133 - languageName: node - linkType: hard - -"@ethersproject/hdnode@npm:^5.7.0, @ethersproject/hdnode@npm:^5.8.0": +"@ethersproject/hdnode@npm:5.8.0, @ethersproject/hdnode@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/hdnode@npm:5.8.0" dependencies: @@ -1867,28 +1724,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/json-wallets@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/json-wallets@npm:5.7.0" - dependencies: - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/hdnode": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/pbkdf2": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/random": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - aes-js: 3.0.0 - scrypt-js: 3.0.1 - checksum: f583458d22db62efaaf94d38dd243482776a45bf90f9f3882fbad5aa0b8fd288b41eb7c1ff8ec0b99c9b751088e43d6173530db64dd33c59f9d8daa8d7ad5aa2 - languageName: node - linkType: hard - -"@ethersproject/json-wallets@npm:^5.7.0": +"@ethersproject/json-wallets@npm:5.8.0, @ethersproject/json-wallets@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/json-wallets@npm:5.8.0" dependencies: @@ -1909,17 +1745,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/keccak256@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/keccak256@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - js-sha3: 0.8.0 - checksum: ff70950d82203aab29ccda2553422cbac2e7a0c15c986bd20a69b13606ed8bb6e4fdd7b67b8d3b27d4f841e8222cbaccd33ed34be29f866fec7308f96ed244c6 - languageName: node - linkType: hard - -"@ethersproject/keccak256@npm:^5.7.0, @ethersproject/keccak256@npm:^5.8.0": +"@ethersproject/keccak256@npm:5.8.0, @ethersproject/keccak256@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/keccak256@npm:5.8.0" dependencies: @@ -1929,30 +1755,14 @@ __metadata: languageName: node linkType: hard -"@ethersproject/logger@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/logger@npm:5.7.0" - checksum: 075ab2f605f1fd0813f2e39c3308f77b44a67732b36e712d9bc085f22a84aac4da4f71b39bee50fe78da3e1c812673fadc41180c9970fe5e486e91ea17befe0d - languageName: node - linkType: hard - -"@ethersproject/logger@npm:^5.7.0, @ethersproject/logger@npm:^5.8.0": +"@ethersproject/logger@npm:5.8.0, @ethersproject/logger@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/logger@npm:5.8.0" checksum: 6249885a7fd4a5806e4c8700b76ffcc8f1ff00d71f31aa717716a89fa6b391de19fbb0cb5ae2560b9f57ec0c2e8e0a11ebc2099124c73d3b42bc58e3eedc41d1 languageName: node linkType: hard -"@ethersproject/networks@npm:5.7.1": - version: 5.7.1 - resolution: "@ethersproject/networks@npm:5.7.1" - dependencies: - "@ethersproject/logger": ^5.7.0 - checksum: 0339f312304c17d9a0adce550edb825d4d2c8c9468c1634c44172c67a9ed256f594da62c4cda5c3837a0f28b7fabc03aca9b492f68ff1fdad337ee861b27bd5d - languageName: node - linkType: hard - -"@ethersproject/networks@npm:^5.7.0, @ethersproject/networks@npm:^5.8.0": +"@ethersproject/networks@npm:5.8.0, @ethersproject/networks@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/networks@npm:5.8.0" dependencies: @@ -1961,36 +1771,27 @@ __metadata: languageName: node linkType: hard -"@ethersproject/pbkdf2@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/pbkdf2@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - checksum: b895adb9e35a8a127e794f7aadc31a2424ef355a70e51cde10d457e3e888bb8102373199a540cf61f2d6b9a32e47358f9c65b47d559f42bf8e596b5fd67901e9 - languageName: node - linkType: hard - -"@ethersproject/pbkdf2@patch:@ethersproject/pbkdf2@npm%3A5.7.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.7.0-5b8e51d4b9.patch::locator=RNWeb3Wallet%40workspace%3A.": - version: 5.7.0 - resolution: "@ethersproject/pbkdf2@patch:@ethersproject/pbkdf2@npm%3A5.7.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.7.0-5b8e51d4b9.patch::version=5.7.0&hash=27f621&locator=RNWeb3Wallet%40workspace%3A." +"@ethersproject/pbkdf2@npm:5.8.0": + version: 5.8.0 + resolution: "@ethersproject/pbkdf2@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - checksum: cf5fa57b9c2bb051d7fc2bb3e37533177cd369aa3d6f0309072b9459a22a60a808f24c937df1f2d17d7a19a435603921df0dca2a8f9af3216a5be43000e63c09 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/sha2": ^5.8.0 + checksum: 79e06ec6063e745a714c7c3f8ecfb7a8d2db2d19d45ad0e84e59526f685a2704f06e8c8fbfaf3aca85d15037bead7376d704529aac783985e1ff7b90c2d6e714 languageName: node linkType: hard -"@ethersproject/properties@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/properties@npm:5.7.0" +"@ethersproject/pbkdf2@patch:@ethersproject/pbkdf2@npm%3A5.8.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch::locator=RNWeb3Wallet%40workspace%3A.": + version: 5.8.0 + resolution: "@ethersproject/pbkdf2@patch:@ethersproject/pbkdf2@npm%3A5.8.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch::version=5.8.0&hash=3a7e9c&locator=RNWeb3Wallet%40workspace%3A." dependencies: - "@ethersproject/logger": ^5.7.0 - checksum: 6ab0ccf0c3aadc9221e0cdc5306ce6cd0df7f89f77d77bccdd1277182c9ead0202cd7521329ba3acde130820bf8af299e17cf567d0d497c736ee918207bbf59f + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/sha2": ^5.8.0 + checksum: a44c5d0c23b3d72a20a54697dcc1e43a56f95cc458b2bb34b2e20d69ad4a831a466462268e6478641ab20619bbe7f82847813e94c60b18d05aea5c2a9335ce7e languageName: node linkType: hard -"@ethersproject/properties@npm:^5.7.0, @ethersproject/properties@npm:^5.8.0": +"@ethersproject/properties@npm:5.8.0, @ethersproject/properties@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/properties@npm:5.8.0" dependencies: @@ -1999,45 +1800,35 @@ __metadata: languageName: node linkType: hard -"@ethersproject/providers@npm:5.7.2": - version: 5.7.2 - resolution: "@ethersproject/providers@npm:5.7.2" - dependencies: - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/base64": ^5.7.0 - "@ethersproject/basex": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/networks": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/random": ^5.7.0 - "@ethersproject/rlp": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/web": ^5.7.0 - bech32: 1.1.4 - ws: 7.4.6 - checksum: 1754c731a5ca6782ae9677f4a9cd8b6246c4ef21a966c9a01b133750f3c578431ec43ec254e699969c4a0f87e84463ded50f96b415600aabd37d2056aee58c19 - languageName: node - linkType: hard - -"@ethersproject/random@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/random@npm:5.7.0" +"@ethersproject/providers@npm:5.8.0": + version: 5.8.0 + resolution: "@ethersproject/providers@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: 017829c91cff6c76470852855108115b0b52c611b6be817ed1948d56ba42d6677803ec2012aa5ae298a7660024156a64c11fcf544e235e239ab3f89f0fff7345 + "@ethersproject/abstract-provider": ^5.8.0 + "@ethersproject/abstract-signer": ^5.8.0 + "@ethersproject/address": ^5.8.0 + "@ethersproject/base64": ^5.8.0 + "@ethersproject/basex": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/constants": ^5.8.0 + "@ethersproject/hash": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/networks": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/random": ^5.8.0 + "@ethersproject/rlp": ^5.8.0 + "@ethersproject/sha2": ^5.8.0 + "@ethersproject/strings": ^5.8.0 + "@ethersproject/transactions": ^5.8.0 + "@ethersproject/web": ^5.8.0 + bech32: 1.1.4 + ws: 8.18.0 + checksum: 2970ee03fe61bc941555b57075d4a12fbb6342ee56181ad75250a75e9418403e85821bbea1b6e17b25ef35e9eaa1c2b2c564dad7d20af2c1f28ba6db9d0c7ce3 languageName: node linkType: hard -"@ethersproject/random@npm:^5.7.0, @ethersproject/random@npm:^5.8.0": +"@ethersproject/random@npm:5.8.0, @ethersproject/random@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/random@npm:5.8.0" dependencies: @@ -2047,17 +1838,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/rlp@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/rlp@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: bce165b0f7e68e4d091c9d3cf47b247cac33252df77a095ca4281d32d5eeaaa3695d9bc06b2b057c5015353a68df89f13a4a54a72e888e4beeabbe56b15dda6e - languageName: node - linkType: hard - -"@ethersproject/rlp@npm:^5.7.0, @ethersproject/rlp@npm:^5.8.0": +"@ethersproject/rlp@npm:5.8.0, @ethersproject/rlp@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/rlp@npm:5.8.0" dependencies: @@ -2067,18 +1848,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/sha2@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/sha2@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - hash.js: 1.1.7 - checksum: 09321057c022effbff4cc2d9b9558228690b5dd916329d75c4b1ffe32ba3d24b480a367a7cc92d0f0c0b1c896814d03351ae4630e2f1f7160be2bcfbde435dbc - languageName: node - linkType: hard - -"@ethersproject/sha2@npm:^5.7.0, @ethersproject/sha2@npm:^5.8.0": +"@ethersproject/sha2@npm:5.8.0, @ethersproject/sha2@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/sha2@npm:5.8.0" dependencies: @@ -2089,21 +1859,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/signing-key@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/signing-key@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - bn.js: ^5.2.1 - elliptic: 6.5.4 - hash.js: 1.1.7 - checksum: 8f8de09b0aac709683bbb49339bc0a4cd2f95598f3546436c65d6f3c3a847ffa98e06d35e9ed2b17d8030bd2f02db9b7bd2e11c5cf8a71aad4537487ab4cf03a - languageName: node - linkType: hard - -"@ethersproject/signing-key@npm:^5.7.0, @ethersproject/signing-key@npm:^5.8.0": +"@ethersproject/signing-key@npm:5.8.0, @ethersproject/signing-key@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/signing-key@npm:5.8.0" dependencies: @@ -2117,32 +1873,21 @@ __metadata: languageName: node linkType: hard -"@ethersproject/solidity@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/solidity@npm:5.7.0" - dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/sha2": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 9a02f37f801c96068c3e7721f83719d060175bc4e80439fe060e92bd7acfcb6ac1330c7e71c49f4c2535ca1308f2acdcb01e00133129aac00581724c2d6293f3 - languageName: node - linkType: hard - -"@ethersproject/strings@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/strings@npm:5.7.0" +"@ethersproject/solidity@npm:5.8.0": + version: 5.8.0 + resolution: "@ethersproject/solidity@npm:5.8.0" dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: 5ff78693ae3fdf3cf23e1f6dc047a61e44c8197d2408c42719fef8cb7b7b3613a4eec88ac0ed1f9f5558c74fe0de7ae3195a29ca91a239c74b9f444d8e8b50df + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/keccak256": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/sha2": ^5.8.0 + "@ethersproject/strings": ^5.8.0 + checksum: 305166f3f8e8c2f5ad7b0b03ab96d52082fc79b5136601175e1c76d7abd8fd8e3e4b56569dea745dfa2b7fcbfd180c5d824b03fea7e08dd53d515738a35e51dd languageName: node linkType: hard -"@ethersproject/strings@npm:^5.7.0, @ethersproject/strings@npm:^5.8.0": +"@ethersproject/strings@npm:5.8.0, @ethersproject/strings@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/strings@npm:5.8.0" dependencies: @@ -2153,24 +1898,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/transactions@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/transactions@npm:5.7.0" - dependencies: - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/rlp": ^5.7.0 - "@ethersproject/signing-key": ^5.7.0 - checksum: a31b71996d2b283f68486241bff0d3ea3f1ba0e8f1322a8fffc239ccc4f4a7eb2ea9994b8fd2f093283fd75f87bae68171e01b6265261f821369aca319884a79 - languageName: node - linkType: hard - -"@ethersproject/transactions@npm:^5.7.0, @ethersproject/transactions@npm:^5.8.0": +"@ethersproject/transactions@npm:5.8.0, @ethersproject/transactions@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/transactions@npm:5.8.0" dependencies: @@ -2187,54 +1915,41 @@ __metadata: languageName: node linkType: hard -"@ethersproject/units@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/units@npm:5.7.0" - dependencies: - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/constants": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - checksum: 304714f848cd32e57df31bf545f7ad35c2a72adae957198b28cbc62166daa929322a07bff6e9c9ac4577ab6aa0de0546b065ed1b2d20b19e25748b7d475cb0fc - languageName: node - linkType: hard - -"@ethersproject/wallet@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/wallet@npm:5.7.0" +"@ethersproject/units@npm:5.8.0": + version: 5.8.0 + resolution: "@ethersproject/units@npm:5.8.0" dependencies: - "@ethersproject/abstract-provider": ^5.7.0 - "@ethersproject/abstract-signer": ^5.7.0 - "@ethersproject/address": ^5.7.0 - "@ethersproject/bignumber": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/hdnode": ^5.7.0 - "@ethersproject/json-wallets": ^5.7.0 - "@ethersproject/keccak256": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/random": ^5.7.0 - "@ethersproject/signing-key": ^5.7.0 - "@ethersproject/transactions": ^5.7.0 - "@ethersproject/wordlists": ^5.7.0 - checksum: a4009bf7331eddab38e3015b5e9101ef92de7f705b00a6196b997db0e5635b6d83561674d46c90c6f77b87c0500fe4a6b0183ba13749efc22db59c99deb82fbd + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/constants": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + checksum: cc7180c85f695449c20572602971145346fc5c169ee32f23d79ac31cc8c9c66a2049e3ac852b940ddccbe39ab1db3b81e3e093b604d9ab7ab27639ecb933b270 languageName: node linkType: hard -"@ethersproject/web@npm:5.7.1": - version: 5.7.1 - resolution: "@ethersproject/web@npm:5.7.1" +"@ethersproject/wallet@npm:5.8.0": + version: 5.8.0 + resolution: "@ethersproject/wallet@npm:5.8.0" dependencies: - "@ethersproject/base64": ^5.7.0 - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 7028c47103f82fd2e2c197ce0eecfacaa9180ffeec7de7845b1f4f9b19d84081b7a48227aaddde05a4aaa526af574a9a0ce01cc0fc75e3e371f84b38b5b16b2b + "@ethersproject/abstract-provider": ^5.8.0 + "@ethersproject/abstract-signer": ^5.8.0 + "@ethersproject/address": ^5.8.0 + "@ethersproject/bignumber": ^5.8.0 + "@ethersproject/bytes": ^5.8.0 + "@ethersproject/hash": ^5.8.0 + "@ethersproject/hdnode": ^5.8.0 + "@ethersproject/json-wallets": ^5.8.0 + "@ethersproject/keccak256": ^5.8.0 + "@ethersproject/logger": ^5.8.0 + "@ethersproject/properties": ^5.8.0 + "@ethersproject/random": ^5.8.0 + "@ethersproject/signing-key": ^5.8.0 + "@ethersproject/transactions": ^5.8.0 + "@ethersproject/wordlists": ^5.8.0 + checksum: d2921c3212c30a49048e0cba7a8287e0d53a5346ad5a15d46d9932991dc54e541a3da063c47addc1347a4b65142d7239f7056c8716d6f85c8ec4a1bf6b5d2f69 languageName: node linkType: hard -"@ethersproject/web@npm:^5.7.0, @ethersproject/web@npm:^5.8.0": +"@ethersproject/web@npm:5.8.0, @ethersproject/web@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/web@npm:5.8.0" dependencies: @@ -2247,20 +1962,7 @@ __metadata: languageName: node linkType: hard -"@ethersproject/wordlists@npm:5.7.0": - version: 5.7.0 - resolution: "@ethersproject/wordlists@npm:5.7.0" - dependencies: - "@ethersproject/bytes": ^5.7.0 - "@ethersproject/hash": ^5.7.0 - "@ethersproject/logger": ^5.7.0 - "@ethersproject/properties": ^5.7.0 - "@ethersproject/strings": ^5.7.0 - checksum: 30eb6eb0731f9ef5faa44bf9c0c6e950bcaaef61e4d2d9ce0ae6d341f4e2d6d1f4ab4f8880bfce03b7aac4b862fb740e1421170cfbf8e2aafc359277d49e6e97 - languageName: node - linkType: hard - -"@ethersproject/wordlists@npm:^5.7.0, @ethersproject/wordlists@npm:^5.8.0": +"@ethersproject/wordlists@npm:5.8.0, @ethersproject/wordlists@npm:^5.8.0": version: 5.8.0 resolution: "@ethersproject/wordlists@npm:5.8.0" dependencies: @@ -2877,16 +2579,16 @@ __metadata: languageName: node linkType: hard -"@noble/curves@npm:1.9.6": - version: 1.9.6 - resolution: "@noble/curves@npm:1.9.6" +"@noble/curves@npm:1.9.1": + version: 1.9.1 + resolution: "@noble/curves@npm:1.9.1" dependencies: "@noble/hashes": 1.8.0 - checksum: 0944cb0fd0f521ee2004df22013e997c85d3a10b529e98cb2d5b552343fd62cd3edb65a3373dcb255bda18cb7651b0399e58a3f50b5307db2b3ef0c2bdb35248 + checksum: 4f3483a1001538d2f55516cdcb19319d1eaef79550633f670e7d570b989cdbc0129952868b72bb67643329746b8ffefe8e4cd791c8cc35574e05a37f873eef42 languageName: node linkType: hard -"@noble/curves@npm:1.9.7, @noble/curves@npm:^1.9.1, @noble/curves@npm:^1.9.4, @noble/curves@npm:~1.9.0": +"@noble/curves@npm:1.9.7, @noble/curves@npm:^1.9.4, @noble/curves@npm:~1.9.0": version: 1.9.7 resolution: "@noble/curves@npm:1.9.7" dependencies: @@ -3568,18 +3270,18 @@ __metadata: languageName: node linkType: hard -"@reown/walletkit@npm:1.2.11": - version: 1.2.11 - resolution: "@reown/walletkit@npm:1.2.11" +"@reown/walletkit@npm:1.3.0": + version: 1.3.0 + resolution: "@reown/walletkit@npm:1.3.0" dependencies: - "@walletconnect/core": 2.21.9 + "@walletconnect/core": 2.22.3 "@walletconnect/jsonrpc-provider": 1.0.14 "@walletconnect/jsonrpc-utils": 1.0.8 - "@walletconnect/logger": 2.1.2 - "@walletconnect/sign-client": 2.21.9 - "@walletconnect/types": 2.21.9 - "@walletconnect/utils": 2.21.9 - checksum: ad8a88c32e553991b8f71e5e61b1e23fb542fde6a126277034b889d200fe9395c6c3504d3455e4e417e7fe45d42057aa9febd865e45781b514320f0bed84404a + "@walletconnect/logger": 3.0.0 + "@walletconnect/sign-client": 2.22.3 + "@walletconnect/types": 2.22.3 + "@walletconnect/utils": 2.22.3 + checksum: 799159648f391ad45956ea324785b8fdd2c188dfa49ed867729b40238071ad11b8a95aef7ba56e8f0155808859521f5ee05f6b0f5eceef9a5c3bc44a6fe13550 languageName: node linkType: hard @@ -3590,7 +3292,7 @@ __metadata: languageName: node linkType: hard -"@scure/bip32@npm:1.7.0, @scure/bip32@npm:^1.7.0": +"@scure/bip32@npm:^1.7.0": version: 1.7.0 resolution: "@scure/bip32@npm:1.7.0" dependencies: @@ -3601,7 +3303,7 @@ __metadata: languageName: node linkType: hard -"@scure/bip39@npm:1.6.0, @scure/bip39@npm:^1.6.0": +"@scure/bip39@npm:^1.6.0": version: 1.6.0 resolution: "@scure/bip39@npm:1.6.0" dependencies: @@ -3865,6 +3567,62 @@ __metadata: languageName: node linkType: hard +"@ton/core@npm:0.62.0": + version: 0.62.0 + resolution: "@ton/core@npm:0.62.0" + dependencies: + symbol.inspect: 1.0.1 + peerDependencies: + "@ton/crypto": ">=3.2.0" + checksum: d1e4810a7b312e828e017411ca57d832aadc3a085f570ddb131522ff651370a2ef531bd3e57a0e19255eb5cc252d033ca8db308dfa7d8ab136861762dbaf277b + languageName: node + linkType: hard + +"@ton/crypto-primitives@npm:2.1.0": + version: 2.1.0 + resolution: "@ton/crypto-primitives@npm:2.1.0" + dependencies: + jssha: 3.2.0 + checksum: 71119f74461ae17bf2cfe7e0a6fcea8d4e359665ea6878b0c935cfd83ca0d84f9c299df3467adb1b1b7ba50f7d446732f2c13b5ea5e26dc1703a6dc24063be3a + languageName: node + linkType: hard + +"@ton/crypto-primitives@patch:@ton/crypto-primitives@npm%3A2.1.0#./.yarn/patches/@ton-crypto-primitives-npm-2.1.0-3d1ea62176.patch::locator=RNWeb3Wallet%40workspace%3A.": + version: 2.1.0 + resolution: "@ton/crypto-primitives@patch:@ton/crypto-primitives@npm%3A2.1.0#./.yarn/patches/@ton-crypto-primitives-npm-2.1.0-3d1ea62176.patch::version=2.1.0&hash=b32558&locator=RNWeb3Wallet%40workspace%3A." + dependencies: + jssha: 3.2.0 + checksum: 69029726d66e99c8979a52832887ca07c3f6412b6f7071b235ab2787a00ca5473f48c5696c81e1dab94db2a4471479c7a42bcbad012e367157063da9353711d9 + languageName: node + linkType: hard + +"@ton/crypto@npm:3.3.0": + version: 3.3.0 + resolution: "@ton/crypto@npm:3.3.0" + dependencies: + "@ton/crypto-primitives": 2.1.0 + jssha: 3.2.0 + tweetnacl: 1.0.3 + checksum: e25036de9850b284dac53ef51dbf00ce63f9d451b2a3a2720d91e9f5b3d6b335e045510cd38d99cce8095b468ad312da76f607ca99a5b66d1b5059c9844b4098 + languageName: node + linkType: hard + +"@ton/ton@npm:15.4.0": + version: 15.4.0 + resolution: "@ton/ton@npm:15.4.0" + dependencies: + axios: ^1.6.7 + dataloader: ^2.0.0 + symbol.inspect: 1.0.1 + teslabot: ^1.3.0 + zod: ^3.21.4 + peerDependencies: + "@ton/core": ">=0.62.0 <1.0.0" + "@ton/crypto": ">=3.2.0" + checksum: 36e59fbe3e3cf5c05cd22b2a1b72c7526f7dbca7c9f40a1335ca0b243469c70f78fa9ae8553a23cbbddeefcc5e589eda9c10548e11d76bb09f966f738aec4524 + languageName: node + linkType: hard + "@types/babel__core@npm:^7.1.14": version: 7.20.5 resolution: "@types/babel__core@npm:7.20.5" @@ -4174,9 +3932,9 @@ __metadata: languageName: node linkType: hard -"@walletconnect/core@npm:2.21.9": - version: 2.21.9 - resolution: "@walletconnect/core@npm:2.21.9" +"@walletconnect/core@npm:2.22.3": + version: 2.22.3 + resolution: "@walletconnect/core@npm:2.22.3" dependencies: "@walletconnect/heartbeat": 1.2.2 "@walletconnect/jsonrpc-provider": 1.0.14 @@ -4184,18 +3942,18 @@ __metadata: "@walletconnect/jsonrpc-utils": 1.0.8 "@walletconnect/jsonrpc-ws-connection": 1.0.16 "@walletconnect/keyvaluestorage": 1.1.1 - "@walletconnect/logger": 2.1.2 + "@walletconnect/logger": 3.0.0 "@walletconnect/relay-api": 1.0.11 "@walletconnect/relay-auth": 1.1.0 "@walletconnect/safe-json": 1.0.2 "@walletconnect/time": 1.0.2 - "@walletconnect/types": 2.21.9 - "@walletconnect/utils": 2.21.9 + "@walletconnect/types": 2.22.3 + "@walletconnect/utils": 2.22.3 "@walletconnect/window-getters": 1.0.1 es-toolkit: 1.39.3 events: 3.3.0 uint8arrays: 3.1.1 - checksum: 32b9f3e5eebc04379ba1786a808742f9217946c1618de1256ded8f47b1a319aa20a81c5371156714ffeabfc6563ab527d37a253915b9c22a61103c63c3875b33 + checksum: d7043414a6075a02df98e652f79194f9676fed6cec30dfa88a1c06fd9d7b0dc9c117863e9d842cd1252431590852c26253ceb5d25190bc76d732b42096968914 languageName: node linkType: hard @@ -4289,19 +4047,19 @@ __metadata: languageName: node linkType: hard -"@walletconnect/logger@npm:2.1.2": - version: 2.1.2 - resolution: "@walletconnect/logger@npm:2.1.2" +"@walletconnect/logger@npm:3.0.0": + version: 3.0.0 + resolution: "@walletconnect/logger@npm:3.0.0" dependencies: "@walletconnect/safe-json": ^1.0.2 - pino: 7.11.0 - checksum: a2bb88b76d95ec5a95279dcc919f1d044d17be8fdda98a01665a607561b445bb56f2245a280933fb19aa7d41d41b688d0ffdb434ac56c46163ad2eb5338f389a + pino: 10.0.0 + checksum: cfc6e8f9633124e366b8e8d66be4cf5367482f8a937eed1fcaf3b99b624e580e32577dcc510f3da25fcd660c1405f3de286353ea8e97a063c3f8d28679572e8e languageName: node linkType: hard -"@walletconnect/react-native-compat@npm:2.22.2": - version: 2.22.2 - resolution: "@walletconnect/react-native-compat@npm:2.22.2" +"@walletconnect/react-native-compat@npm:2.22.4": + version: 2.22.4 + resolution: "@walletconnect/react-native-compat@npm:2.22.4" dependencies: events: 3.3.0 fast-text-encoding: 1.0.6 @@ -4315,7 +4073,7 @@ __metadata: peerDependenciesMeta: expo-application: optional: true - checksum: 8c416485761a86f82b90c08e09fd574f167fea88682c88caf0a1979c309306ab928fb5fe0f6b66f2ebc315229442991e3c24774fe428a50b7b780d7cc0c91952 + checksum: f87cd97e698b34ffbb477d24af52050a7cfbecdd550200caa18c154c66cbae0198729b7616b3cd059e7531d6da70483ff14216548ccceb5c88654facd9807a9b languageName: node linkType: hard @@ -4350,20 +4108,20 @@ __metadata: languageName: node linkType: hard -"@walletconnect/sign-client@npm:2.21.9": - version: 2.21.9 - resolution: "@walletconnect/sign-client@npm:2.21.9" +"@walletconnect/sign-client@npm:2.22.3": + version: 2.22.3 + resolution: "@walletconnect/sign-client@npm:2.22.3" dependencies: - "@walletconnect/core": 2.21.9 + "@walletconnect/core": 2.22.3 "@walletconnect/events": 1.0.1 "@walletconnect/heartbeat": 1.2.2 "@walletconnect/jsonrpc-utils": 1.0.8 - "@walletconnect/logger": 2.1.2 + "@walletconnect/logger": 3.0.0 "@walletconnect/time": 1.0.2 - "@walletconnect/types": 2.21.9 - "@walletconnect/utils": 2.21.9 + "@walletconnect/types": 2.22.3 + "@walletconnect/utils": 2.22.3 events: 3.3.0 - checksum: 01ff1ba0f42c0a1d1a6e21786910b234f08f1a1f339b95137c1fbaec853c0cad5a486a77e058e3ac5b39fae46d43e96d6346453f73b6fb90c1adbf62d31d1cdc + checksum: 79d94dc96a0181803a815ce6d66b1101d254c3f79af44944b9efb1a51f7fe10d30f96355b5475e2cb155c075e7deee6ea149d65b9a6bedae2a7fa97bfb6429b0 languageName: node linkType: hard @@ -4376,23 +4134,23 @@ __metadata: languageName: node linkType: hard -"@walletconnect/types@npm:2.21.9": - version: 2.21.9 - resolution: "@walletconnect/types@npm:2.21.9" +"@walletconnect/types@npm:2.22.3": + version: 2.22.3 + resolution: "@walletconnect/types@npm:2.22.3" dependencies: "@walletconnect/events": 1.0.1 "@walletconnect/heartbeat": 1.2.2 "@walletconnect/jsonrpc-types": 1.0.4 "@walletconnect/keyvaluestorage": 1.1.1 - "@walletconnect/logger": 2.1.2 + "@walletconnect/logger": 3.0.0 events: 3.3.0 - checksum: 43f8c257aa46ba0f537dcf0a5a4f155b6d77c5a36a9f3c717ffb57ad39bc2e0cb177504a69fcd3c02bad5b286c7d0bd417d2fa635ab1b6956c597a131e1b4e21 + checksum: d35af97922dd673a1bada19e1105035e2f47cdb8fd50d2bf6aff6671827175b84124ff2be53b7946953401984700f5de10d466ac3bf7aad0e94f4ae4584ea4a2 languageName: node linkType: hard -"@walletconnect/utils@npm:2.21.9": - version: 2.21.9 - resolution: "@walletconnect/utils@npm:2.21.9" +"@walletconnect/utils@npm:2.22.3": + version: 2.22.3 + resolution: "@walletconnect/utils@npm:2.22.3" dependencies: "@msgpack/msgpack": 3.1.2 "@noble/ciphers": 1.3.0 @@ -4401,19 +4159,20 @@ __metadata: "@scure/base": 1.2.6 "@walletconnect/jsonrpc-utils": 1.0.8 "@walletconnect/keyvaluestorage": 1.1.1 + "@walletconnect/logger": 3.0.0 "@walletconnect/relay-api": 1.0.11 "@walletconnect/relay-auth": 1.1.0 "@walletconnect/safe-json": 1.0.2 "@walletconnect/time": 1.0.2 - "@walletconnect/types": 2.21.9 + "@walletconnect/types": 2.22.3 "@walletconnect/window-getters": 1.0.1 "@walletconnect/window-metadata": 1.0.1 blakejs: 1.2.1 bs58: 6.0.0 detect-browser: 5.3.0 + ox: 0.9.3 uint8arrays: 3.1.1 - viem: 2.36.0 - checksum: 5d561861a6b4621a978c2e35cbf17e31e26bd1c08c7a093d3d9bc18090a9d062ed0e34e3f6fcec7304d97151948546f0c41d12b0c03f428d22d258391cc7c41d + checksum: 1a3a3ecc4e7d91f6cc1a49b17d4253f7d72f88d5655064ba3947ece2921e9c9b9762d94ac72c2d06259d1dedaf3f0fb38f05105c453c724495812adcb9934a9b languageName: node linkType: hard @@ -4476,19 +4235,22 @@ __metadata: "@react-navigation/native-stack": 7.3.27 "@react-navigation/stack": 7.4.9 "@reown/appkit-ui-react-native": 1.0.1 - "@reown/walletkit": 1.2.11 + "@reown/walletkit": 1.3.0 "@sentry/react-native": 7.3.0 + "@ton/core": 0.62.0 + "@ton/crypto": 3.3.0 + "@ton/ton": 15.4.0 "@types/jest": ^29.5.13 "@types/lodash.clonedeep": ^4.5.9 "@types/react": ^19.1.1 "@types/react-test-renderer": ^19.1.0 - "@walletconnect/react-native-compat": 2.22.2 + "@walletconnect/react-native-compat": 2.22.4 babel-plugin-module-resolver: ^5.0.0 bip39: 3.1.0 dayjs: 1.11.11 ed25519-hd-key: ^1.3.0 eslint: ^8.19.0 - ethers: 5.7.2 + ethers: 5.8.0 fast-xml-parser: 4.4.1 jest: ^29.2.1 prettier: 2.8.8 @@ -4524,22 +4286,7 @@ __metadata: languageName: node linkType: hard -"abitype@npm:1.0.8": - version: 1.0.8 - resolution: "abitype@npm:1.0.8" - peerDependencies: - typescript: ">=5.0.4" - zod: ^3 >=3.22.0 - peerDependenciesMeta: - typescript: - optional: true - zod: - optional: true - checksum: 104bc2f6820ced8d2cb61521916f7f22c0981a846216f5b6144f69461265f7da137a4ae108bf4b84cd8743f2dd1e9fdadffc0f95371528e15a59e0a369e08438 - languageName: node - linkType: hard - -"abitype@npm:^1.0.8": +"abitype@npm:^1.0.9": version: 1.1.1 resolution: "abitype@npm:1.1.1" peerDependencies: @@ -4866,6 +4613,13 @@ __metadata: languageName: node linkType: hard +"asynckit@npm:^0.4.0": + version: 0.4.0 + resolution: "asynckit@npm:0.4.0" + checksum: 7b78c451df768adba04e2d02e63e2d0bf3b07adcd6e42b4cf665cb7ce899bedd344c69a1dcbce355b5f972d597b25aaa1c1742b52cffd9caccb22f348114f6be + languageName: node + linkType: hard + "atomic-sleep@npm:^1.0.0": version: 1.0.0 resolution: "atomic-sleep@npm:1.0.0" @@ -4882,6 +4636,17 @@ __metadata: languageName: node linkType: hard +"axios@npm:^1.6.7": + version: 1.12.2 + resolution: "axios@npm:1.12.2" + dependencies: + follow-redirects: ^1.15.6 + form-data: ^4.0.4 + proxy-from-env: ^1.1.0 + checksum: f0331594fe053a4bbff04104edb073973a3aabfad2e56b0aa18de82428aa63f6f0839ca3d837258ec739cb4528014121793b1649a21e5115ffb2bf8237eadca3 + languageName: node + linkType: hard + "babel-jest@npm:^29.7.0": version: 29.7.0 resolution: "babel-jest@npm:29.7.0" @@ -5560,6 +5325,15 @@ __metadata: languageName: node linkType: hard +"combined-stream@npm:^1.0.8": + version: 1.0.8 + resolution: "combined-stream@npm:1.0.8" + dependencies: + delayed-stream: ~1.0.0 + checksum: 49fa4aeb4916567e33ea81d088f6584749fc90c7abec76fd516bf1c5aa5c79f3584b5ba3de6b86d26ddd64bae5329c4c7479343250cfe71c75bb366eae53bb7c + languageName: node + linkType: hard + "command-exists@npm:^1.2.8": version: 1.2.9 resolution: "command-exists@npm:1.2.9" @@ -5819,6 +5593,13 @@ __metadata: languageName: node linkType: hard +"dataloader@npm:^2.0.0": + version: 2.2.3 + resolution: "dataloader@npm:2.2.3" + checksum: cc272181f6cad0ea20511c0a0d270cbc1df960a3526ab24941bbeb2cb7120499a598fe2cd41b4818527367acf7bc1be0723b6e5034637db4759a396c904b78a6 + languageName: node + linkType: hard + "dayjs@npm:1.11.11": version: 1.11.11 resolution: "dayjs@npm:1.11.11" @@ -5948,6 +5729,13 @@ __metadata: languageName: node linkType: hard +"delayed-stream@npm:~1.0.0": + version: 1.0.0 + resolution: "delayed-stream@npm:1.0.0" + checksum: 46fe6e83e2cb1d85ba50bd52803c68be9bd953282fa7096f51fc29edd5d67ff84ff753c51966061e5ba7cb5e47ef6d36a91924eddb7f3f3483b1c560f77a0020 + languageName: node + linkType: hard + "depd@npm:2.0.0": version: 2.0.0 resolution: "depd@npm:2.0.0" @@ -6078,18 +5866,6 @@ __metadata: languageName: node linkType: hard -"duplexify@npm:^4.1.2": - version: 4.1.3 - resolution: "duplexify@npm:4.1.3" - dependencies: - end-of-stream: ^1.4.1 - inherits: ^2.0.3 - readable-stream: ^3.1.1 - stream-shift: ^1.0.2 - checksum: 9636a027345de3dd3c801594d01a7c73d9ce260019538beb1ee650bba7544e72f40a4d4902b52e1ab283dc32a06f210d42748773af02ff15e3064a9659deab7f - languageName: node - linkType: hard - "eastasianwidth@npm:^0.2.0": version: 0.2.0 resolution: "eastasianwidth@npm:0.2.0" @@ -6707,41 +6483,41 @@ __metadata: languageName: node linkType: hard -"ethers@npm:5.7.2": - version: 5.7.2 - resolution: "ethers@npm:5.7.2" - dependencies: - "@ethersproject/abi": 5.7.0 - "@ethersproject/abstract-provider": 5.7.0 - "@ethersproject/abstract-signer": 5.7.0 - "@ethersproject/address": 5.7.0 - "@ethersproject/base64": 5.7.0 - "@ethersproject/basex": 5.7.0 - "@ethersproject/bignumber": 5.7.0 - "@ethersproject/bytes": 5.7.0 - "@ethersproject/constants": 5.7.0 - "@ethersproject/contracts": 5.7.0 - "@ethersproject/hash": 5.7.0 - "@ethersproject/hdnode": 5.7.0 - "@ethersproject/json-wallets": 5.7.0 - "@ethersproject/keccak256": 5.7.0 - "@ethersproject/logger": 5.7.0 - "@ethersproject/networks": 5.7.1 - "@ethersproject/pbkdf2": 5.7.0 - "@ethersproject/properties": 5.7.0 - "@ethersproject/providers": 5.7.2 - "@ethersproject/random": 5.7.0 - "@ethersproject/rlp": 5.7.0 - "@ethersproject/sha2": 5.7.0 - "@ethersproject/signing-key": 5.7.0 - "@ethersproject/solidity": 5.7.0 - "@ethersproject/strings": 5.7.0 - "@ethersproject/transactions": 5.7.0 - "@ethersproject/units": 5.7.0 - "@ethersproject/wallet": 5.7.0 - "@ethersproject/web": 5.7.1 - "@ethersproject/wordlists": 5.7.0 - checksum: b7c08cf3e257185a7946117dbbf764433b7ba0e77c27298dec6088b3bc871aff711462b0621930c56880ff0a7ceb8b1d3a361ffa259f93377b48e34107f62553 +"ethers@npm:5.8.0": + version: 5.8.0 + resolution: "ethers@npm:5.8.0" + dependencies: + "@ethersproject/abi": 5.8.0 + "@ethersproject/abstract-provider": 5.8.0 + "@ethersproject/abstract-signer": 5.8.0 + "@ethersproject/address": 5.8.0 + "@ethersproject/base64": 5.8.0 + "@ethersproject/basex": 5.8.0 + "@ethersproject/bignumber": 5.8.0 + "@ethersproject/bytes": 5.8.0 + "@ethersproject/constants": 5.8.0 + "@ethersproject/contracts": 5.8.0 + "@ethersproject/hash": 5.8.0 + "@ethersproject/hdnode": 5.8.0 + "@ethersproject/json-wallets": 5.8.0 + "@ethersproject/keccak256": 5.8.0 + "@ethersproject/logger": 5.8.0 + "@ethersproject/networks": 5.8.0 + "@ethersproject/pbkdf2": 5.8.0 + "@ethersproject/properties": 5.8.0 + "@ethersproject/providers": 5.8.0 + "@ethersproject/random": 5.8.0 + "@ethersproject/rlp": 5.8.0 + "@ethersproject/sha2": 5.8.0 + "@ethersproject/signing-key": 5.8.0 + "@ethersproject/solidity": 5.8.0 + "@ethersproject/strings": 5.8.0 + "@ethersproject/transactions": 5.8.0 + "@ethersproject/units": 5.8.0 + "@ethersproject/wallet": 5.8.0 + "@ethersproject/web": 5.8.0 + "@ethersproject/wordlists": 5.8.0 + checksum: fb107bf28dc3aedde4729f9553be066c699e0636346c095b4deeb5349a0c0c8538f48a58b5c8cbefced008706919739c5f7b8f4dd506bb471a31edee18cda228 languageName: node linkType: hard @@ -6858,13 +6634,6 @@ __metadata: languageName: node linkType: hard -"fast-redact@npm:^3.0.0": - version: 3.5.0 - resolution: "fast-redact@npm:3.5.0" - checksum: ef03f0d1849da074a520a531ad299bf346417b790a643931ab4e01cb72275c8d55b60dc8512fb1f1818647b696790edefaa96704228db9f012da935faa1940af - languageName: node - linkType: hard - "fast-text-encoding@npm:1.0.6": version: 1.0.6 resolution: "fast-text-encoding@npm:1.0.6" @@ -7025,6 +6794,16 @@ __metadata: languageName: node linkType: hard +"follow-redirects@npm:^1.15.6": + version: 1.15.11 + resolution: "follow-redirects@npm:1.15.11" + peerDependenciesMeta: + debug: + optional: true + checksum: 20bf55e9504f59e6cc3743ba27edb2ebf41edea1baab34799408f2c050f73f0c612728db21c691276296d2795ea8a812dc532a98e8793619fcab91abe06d017f + languageName: node + linkType: hard + "for-each@npm:^0.3.3, for-each@npm:^0.3.5": version: 0.3.5 resolution: "for-each@npm:0.3.5" @@ -7044,6 +6823,19 @@ __metadata: languageName: node linkType: hard +"form-data@npm:^4.0.4": + version: 4.0.4 + resolution: "form-data@npm:4.0.4" + dependencies: + asynckit: ^0.4.0 + combined-stream: ^1.0.8 + es-set-tostringtag: ^2.1.0 + hasown: ^2.0.2 + mime-types: ^2.1.12 + checksum: 9b7788836df9fa5a6999e0c02515b001946b2a868cfe53f026c69e2c537a2ff9fbfb8e9d2b678744628f3dc7a2d6e14e4e45dfaf68aa6239727f0bdb8ce0abf2 + languageName: node + linkType: hard + "fresh@npm:0.5.2": version: 0.5.2 resolution: "fresh@npm:0.5.2" @@ -8090,15 +7882,6 @@ __metadata: languageName: node linkType: hard -"isows@npm:1.0.7": - version: 1.0.7 - resolution: "isows@npm:1.0.7" - peerDependencies: - ws: "*" - checksum: 044b949b369872882af07b60b613b5801ae01b01a23b5b72b78af80c8103bbeed38352c3e8ceff13a7834bc91fd2eb41cf91ec01d59a041d8705680e6b0ec546 - languageName: node - linkType: hard - "istanbul-lib-coverage@npm:^3.0.0, istanbul-lib-coverage@npm:^3.2.0": version: 3.2.2 resolution: "istanbul-lib-coverage@npm:3.2.2" @@ -8745,6 +8528,13 @@ __metadata: languageName: node linkType: hard +"jssha@npm:3.2.0": + version: 3.2.0 + resolution: "jssha@npm:3.2.0" + checksum: 2adb8a9a57a79360379e843c0548e240d072c2ef12aef39ef6a784315686bd6f65501e9353fdd2f3a604f64af07e7eab04a0ed92b221cdfea97d671d7b8e14f4 + languageName: node + linkType: hard + "jsx-ast-utils@npm:^2.4.1 || ^3.0.0": version: 3.3.5 resolution: "jsx-ast-utils@npm:3.3.5" @@ -9285,7 +9075,7 @@ __metadata: languageName: node linkType: hard -"mime-types@npm:^2.1.27, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": +"mime-types@npm:^2.1.12, mime-types@npm:^2.1.27, mime-types@npm:~2.1.24, mime-types@npm:~2.1.34": version: 2.1.35 resolution: "mime-types@npm:2.1.35" dependencies: @@ -9776,10 +9566,10 @@ __metadata: languageName: node linkType: hard -"on-exit-leak-free@npm:^0.2.0": - version: 0.2.0 - resolution: "on-exit-leak-free@npm:0.2.0" - checksum: d22b0f0538069110626b578db6e68b6ee0e85b1ee9cc5ef9b4de1bba431431d6a8da91a61e09d2ad46f22a96f968e5237833cb9d0b69bc4d294f7ec82f609b05 +"on-exit-leak-free@npm:^2.1.0": + version: 2.1.2 + resolution: "on-exit-leak-free@npm:2.1.2" + checksum: 6ce7acdc7b9ceb51cf029b5239cbf41937ee4c8dcd9d4e475e1777b41702564d46caa1150a744e00da0ac6d923ab83471646a39a4470f97481cf6e2d8d253c3f languageName: node linkType: hard @@ -9887,24 +9677,24 @@ __metadata: languageName: node linkType: hard -"ox@npm:0.9.1": - version: 0.9.1 - resolution: "ox@npm:0.9.1" +"ox@npm:0.9.3": + version: 0.9.3 + resolution: "ox@npm:0.9.3" dependencies: "@adraffy/ens-normalize": ^1.11.0 "@noble/ciphers": ^1.3.0 - "@noble/curves": ^1.9.1 + "@noble/curves": 1.9.1 "@noble/hashes": ^1.8.0 "@scure/bip32": ^1.7.0 "@scure/bip39": ^1.6.0 - abitype: ^1.0.8 + abitype: ^1.0.9 eventemitter3: 5.0.1 peerDependencies: typescript: ">=5.4.0" peerDependenciesMeta: typescript: optional: true - checksum: 577946f69fb8fa2b80fad359ae6e315e459209392109e43313b6bb59a127bdef8eb1844bdd924b87751cc0613d4fe4b64ac08c6e9514d9b7c53367e3f7394a44 + checksum: 742a15a3942fa66beac1d0e80ee9ed806c9c4898f950d7e879373eb7068b2b61e983b0f3ea95ec09f7e19637a7978d2cf44ab73ca51007827f5d690f2974910f languageName: node linkType: hard @@ -10068,41 +9858,40 @@ __metadata: languageName: node linkType: hard -"pino-abstract-transport@npm:v0.5.0": - version: 0.5.0 - resolution: "pino-abstract-transport@npm:0.5.0" +"pino-abstract-transport@npm:^2.0.0": + version: 2.0.0 + resolution: "pino-abstract-transport@npm:2.0.0" dependencies: - duplexify: ^4.1.2 split2: ^4.0.0 - checksum: c503f867de3189f8217ab9cf794e8a631dddd0029a829f0f985f5511308152ebd53e363764fbc5570b3d1c715b341e3923456ce16ad84cd41be2b9a074ada234 + checksum: 4db0cd8a1a7b6d13e76dbb58e6adc057c39e4591c70f601f4a427c030d57dff748ab53954e1ecd3aa6e21c1a22dd38de96432606c6d906a7b9f610543bf1d6e2 languageName: node linkType: hard -"pino-std-serializers@npm:^4.0.0": - version: 4.0.0 - resolution: "pino-std-serializers@npm:4.0.0" - checksum: 89d487729b58c9d3273a0ee851ead068d6d2e2ccc1af8e1c1d28f1b3442423679bec7ec04d9a2aba36f94f335e82be9f4de19dc4fbc161e71c136aaa15b85ad3 +"pino-std-serializers@npm:^7.0.0": + version: 7.0.0 + resolution: "pino-std-serializers@npm:7.0.0" + checksum: 08cd1d7b7adc4cfca39e42c2d5fd21bcf4513153734e7b8fa278b0e9e9f62df78c4c202886343fe882a462539c931cb8110b661775ad7f7217c96856795b5a86 languageName: node linkType: hard -"pino@npm:7.11.0": - version: 7.11.0 - resolution: "pino@npm:7.11.0" +"pino@npm:10.0.0": + version: 10.0.0 + resolution: "pino@npm:10.0.0" dependencies: atomic-sleep: ^1.0.0 - fast-redact: ^3.0.0 - on-exit-leak-free: ^0.2.0 - pino-abstract-transport: v0.5.0 - pino-std-serializers: ^4.0.0 - process-warning: ^1.0.0 + on-exit-leak-free: ^2.1.0 + pino-abstract-transport: ^2.0.0 + pino-std-serializers: ^7.0.0 + process-warning: ^5.0.0 quick-format-unescaped: ^4.0.3 - real-require: ^0.1.0 - safe-stable-stringify: ^2.1.0 - sonic-boom: ^2.2.1 - thread-stream: ^0.15.1 + real-require: ^0.2.0 + safe-stable-stringify: ^2.3.1 + slow-redact: ^0.3.0 + sonic-boom: ^4.0.1 + thread-stream: ^3.0.0 bin: pino: bin.js - checksum: b919e7dbe41de978bb050dcef94fd687c012eb78d344a18f75f04ce180d5810fc162be1f136722d70cd005ed05832c4023a38b9acbc1076ae63c9f5ec5ca515c + checksum: 76dd61c2928e9d26a9049bae5ee23d2ee913eecb5798034e31f44be3f143ad3f356a66259e722c978527587492153e2dc2d04829055d43a2e313df8132ee4d0f languageName: node linkType: hard @@ -10235,10 +10024,10 @@ __metadata: languageName: node linkType: hard -"process-warning@npm:^1.0.0": - version: 1.0.0 - resolution: "process-warning@npm:1.0.0" - checksum: c708a03241deec3cabaeee39c4f9ee8c4d71f1c5ef9b746c8252cdb952a6059068cfcdaf348399775244cbc441b6ae5e26a9c87ed371f88335d84f26d19180f9 +"process-warning@npm:^5.0.0": + version: 5.0.0 + resolution: "process-warning@npm:5.0.0" + checksum: 99bce32133a67d45f3efff1202d0895548da3464501ad2acf6ad6d5f6a879b246868f2f382ff8a5872e2bb17b0d800dc1961885947ea9b3344db9cb91405cd88 languageName: node linkType: hard @@ -10827,10 +10616,10 @@ __metadata: languageName: node linkType: hard -"real-require@npm:^0.1.0": - version: 0.1.0 - resolution: "real-require@npm:0.1.0" - checksum: 96745583ed4f82cd5c6a6af012fd1d3c6fc2f13ae1bcff1a3c4f8094696013a1a07c82c5aa66a403d7d4f84949fc2203bc927c7ad120caad125941ca2d7e5e8e +"real-require@npm:^0.2.0": + version: 0.2.0 + resolution: "real-require@npm:0.2.0" + checksum: fa060f19f2f447adf678d1376928c76379dce5f72bd334da301685ca6cdcb7b11356813332cc243c88470796bc2e2b1e2917fc10df9143dd93c2ea608694971d languageName: node linkType: hard @@ -11124,7 +10913,7 @@ __metadata: languageName: node linkType: hard -"safe-stable-stringify@npm:^2.1.0": +"safe-stable-stringify@npm:^2.3.1": version: 2.5.0 resolution: "safe-stable-stringify@npm:2.5.0" checksum: d3ce103ed43c6c2f523e39607208bfb1c73aa48179fc5be53c3aa97c118390bffd4d55e012f5393b982b65eb3e0ee954dd57b547930d3f242b0053dcdb923d17 @@ -11446,6 +11235,13 @@ __metadata: languageName: node linkType: hard +"slow-redact@npm:^0.3.0": + version: 0.3.2 + resolution: "slow-redact@npm:0.3.2" + checksum: 7c5264f93a309684a3a2622d0017af024174f31b4b82921b19791d8a707e8bc5dca56918df685dada23ccc84fbe2cc0cc954a739989c9167d5f60c05fa639f22 + languageName: node + linkType: hard + "slugify@npm:^1.6.6": version: 1.6.6 resolution: "slugify@npm:1.6.6" @@ -11481,12 +11277,12 @@ __metadata: languageName: node linkType: hard -"sonic-boom@npm:^2.2.1": - version: 2.8.0 - resolution: "sonic-boom@npm:2.8.0" +"sonic-boom@npm:^4.0.1": + version: 4.2.0 + resolution: "sonic-boom@npm:4.2.0" dependencies: atomic-sleep: ^1.0.0 - checksum: c7f9c89f931d7f60f8e0741551a729f0d81e6dc407a99420fc847a9a4c25af048a615b1188ab3c4f1fb3708fe4904973ddab6ebcc8ed5b78b50ab81a99045910 + checksum: e5e1ffdd3bcb0dee3bf6f7b2ff50dd3ffa2df864dc9d53463f33e225021a28601e91d0ec7e932739824bafd6f4ff3b7090939ac3e34ab1022e01692b41f7e8a3 languageName: node linkType: hard @@ -11620,13 +11416,6 @@ __metadata: languageName: node linkType: hard -"stream-shift@npm:^1.0.2": - version: 1.0.3 - resolution: "stream-shift@npm:1.0.3" - checksum: a24c0a3f66a8f9024bd1d579a533a53be283b4475d4e6b4b3211b964031447bdf6532dd1f3c2b0ad66752554391b7c62bd7ca4559193381f766534e723d50242 - languageName: node - linkType: hard - "strict-uri-encode@npm:^2.0.0": version: 2.0.0 resolution: "strict-uri-encode@npm:2.0.0" @@ -11856,6 +11645,13 @@ __metadata: languageName: node linkType: hard +"symbol.inspect@npm:1.0.1": + version: 1.0.1 + resolution: "symbol.inspect@npm:1.0.1" + checksum: 47fa8d38d0bc5d04c06df2f71bba1a723ee0e015ca042c47b29c11f107877dd1a2e2d2154c9ef5eec11e92e4165d126c844f06d05da80e477581c8f284f05fdf + languageName: node + linkType: hard + "tar-fs@npm:2.1.4": version: 2.1.4 resolution: "tar-fs@npm:2.1.4" @@ -11908,6 +11704,13 @@ __metadata: languageName: node linkType: hard +"teslabot@npm:^1.3.0": + version: 1.5.0 + resolution: "teslabot@npm:1.5.0" + checksum: 1494f83b9070f3d0882c7ce089a69ea46f0f30ee24c14036880ed5f49882cd80ff47f1c5543c9c973d250596896640130c16b221e84be296474a02f65e7187d0 + languageName: node + linkType: hard + "test-exclude@npm:^6.0.0": version: 6.0.0 resolution: "test-exclude@npm:6.0.0" @@ -11926,12 +11729,12 @@ __metadata: languageName: node linkType: hard -"thread-stream@npm:^0.15.1": - version: 0.15.2 - resolution: "thread-stream@npm:0.15.2" +"thread-stream@npm:^3.0.0": + version: 3.1.0 + resolution: "thread-stream@npm:3.1.0" dependencies: - real-require: ^0.1.0 - checksum: 0547795a8f357ba1ac0dba29c71f965182e29e21752951a04a7167515ee37524bfba6c410f31e65a01a8d3e5b93400b812889aa09523e38ce4d744c894ffa6c0 + real-require: ^0.2.0 + checksum: 3c5b494ce776f832dfd696792cc865f78c1e850db93e07979349bbc1a5845857cd447aea95808892906cc0178a2fd3233907329f3376e7fc9951e2833f5b7896 languageName: node linkType: hard @@ -12451,27 +12254,6 @@ __metadata: languageName: node linkType: hard -"viem@npm:2.36.0": - version: 2.36.0 - resolution: "viem@npm:2.36.0" - dependencies: - "@noble/curves": 1.9.6 - "@noble/hashes": 1.8.0 - "@scure/bip32": 1.7.0 - "@scure/bip39": 1.6.0 - abitype: 1.0.8 - isows: 1.0.7 - ox: 0.9.1 - ws: 8.18.3 - peerDependencies: - typescript: ">=5.0.4" - peerDependenciesMeta: - typescript: - optional: true - checksum: 9dc94f729b1035a91469976dd7ed3d4b4d54844e73eaacb5e518d1c4ab7dac84942358c676f19718f4637692a66d9fd0b5571ddcfa128566c1d369b891a1ddcc - languageName: node - linkType: hard - "vlq@npm:^1.0.0": version: 1.0.1 resolution: "vlq@npm:1.0.1" @@ -12704,24 +12486,9 @@ __metadata: languageName: node linkType: hard -"ws@npm:7.4.6": - version: 7.4.6 - resolution: "ws@npm:7.4.6" - peerDependencies: - bufferutil: ^4.0.1 - utf-8-validate: ^5.0.2 - peerDependenciesMeta: - bufferutil: - optional: true - utf-8-validate: - optional: true - checksum: 3a990b32ed08c72070d5e8913e14dfcd831919205be52a3ff0b4cdd998c8d554f167c9df3841605cde8b11d607768cacab3e823c58c96a5c08c987e093eb767a - languageName: node - linkType: hard - -"ws@npm:8.18.3": - version: 8.18.3 - resolution: "ws@npm:8.18.3" +"ws@npm:8.18.0": + version: 8.18.0 + resolution: "ws@npm:8.18.0" peerDependencies: bufferutil: ^4.0.1 utf-8-validate: ">=5.0.2" @@ -12730,7 +12497,7 @@ __metadata: optional: true utf-8-validate: optional: true - checksum: d64ef1631227bd0c5fe21b3eb3646c9c91229402fb963d12d87b49af0a1ef757277083af23a5f85742bae1e520feddfb434cb882ea59249b15673c16dc3f36e0 + checksum: 91d4d35bc99ff6df483bdf029b9ea4bfd7af1f16fc91231a96777a63d263e1eabf486e13a2353970efc534f9faa43bdbf9ee76525af22f4752cbc5ebda333975 languageName: node linkType: hard @@ -12916,3 +12683,10 @@ __metadata: checksum: f77b3d8d00310def622123df93d4ee654fc6a0096182af8bd60679ddcdfb3474c56c6c7190817c84a2785648cdee9d721c0154eb45698c62176c322fb46fc700 languageName: node linkType: hard + +"zod@npm:^3.21.4": + version: 3.25.76 + resolution: "zod@npm:3.25.76" + checksum: c9a403a62b329188a5f6bd24d5d935d2bba345f7ab8151d1baa1505b5da9f227fb139354b043711490c798e91f3df75991395e40142e6510a4b16409f302b849 + languageName: node + linkType: hard From 97628fae4198a358c2f9b72b3a43b35f4f917861 Mon Sep 17 00:00:00 2001 From: nacho <25931366+ignaciosantise@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:10:09 -0300 Subject: [PATCH 2/8] chore: removed extra message in sign modal --- .../src/modals/SessionTonSignDataModal.tsx | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/wallets/rn_cli_wallet/src/modals/SessionTonSignDataModal.tsx b/wallets/rn_cli_wallet/src/modals/SessionTonSignDataModal.tsx index d0813d00..f0aeaf9c 100644 --- a/wallets/rn_cli_wallet/src/modals/SessionTonSignDataModal.tsx +++ b/wallets/rn_cli_wallet/src/modals/SessionTonSignDataModal.tsx @@ -138,15 +138,7 @@ export default function SessionTonSignDataModal() { {/* Payload */} - - - - Payload - - - {getPayloadMessage()} - - + ); From 2ff9351733073aa98cf51d29a785cf7256101775 Mon Sep 17 00:00:00 2001 From: nacho <25931366+ignaciosantise@users.noreply.github.com> Date: Tue, 14 Oct 2025 14:54:29 -0300 Subject: [PATCH 3/8] chore: small ui details --- wallets/rn_cli_wallet/src/components/Modal/Chains.tsx | 2 +- wallets/rn_cli_wallet/src/navigators/RootStackNavigator.tsx | 5 +++-- wallets/rn_cli_wallet/src/screens/LogList/index.tsx | 3 ++- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/wallets/rn_cli_wallet/src/components/Modal/Chains.tsx b/wallets/rn_cli_wallet/src/components/Modal/Chains.tsx index d663f95a..cd674440 100644 --- a/wallets/rn_cli_wallet/src/components/Modal/Chains.tsx +++ b/wallets/rn_cli_wallet/src/components/Modal/Chains.tsx @@ -30,7 +30,7 @@ export function Chains({chains}: Props) { source={logo} style={[styles.chainLogo, {backgroundColor: Theme['bg-300']}]} /> - {chain.name} + {chain.name} ); })} diff --git a/wallets/rn_cli_wallet/src/navigators/RootStackNavigator.tsx b/wallets/rn_cli_wallet/src/navigators/RootStackNavigator.tsx index 4116dc63..c47f79f7 100644 --- a/wallets/rn_cli_wallet/src/navigators/RootStackNavigator.tsx +++ b/wallets/rn_cli_wallet/src/navigators/RootStackNavigator.tsx @@ -40,7 +40,7 @@ export function RootStackNavigator() { options={{ headerShown: true, headerTitle: 'Session Details', - headerBackTitleVisible: false, + headerBackTitle: '', headerTintColor: Theme['fg-100'], }} /> @@ -54,8 +54,9 @@ export function RootStackNavigator() { component={LogList} options={{ headerShown: true, - headerBackTitleVisible: false, title: 'Logs', + headerBackTitle: '', + headerTintColor: Theme['fg-100'], }} /> diff --git a/wallets/rn_cli_wallet/src/screens/LogList/index.tsx b/wallets/rn_cli_wallet/src/screens/LogList/index.tsx index 32c8b0ec..bbb972e5 100644 --- a/wallets/rn_cli_wallet/src/screens/LogList/index.tsx +++ b/wallets/rn_cli_wallet/src/screens/LogList/index.tsx @@ -1,5 +1,6 @@ import React from 'react'; -import {FlatList, SafeAreaView, StyleSheet} from 'react-native'; +import {FlatList, StyleSheet} from 'react-native'; +import {SafeAreaView} from 'react-native-safe-area-context'; import {Log} from './components/Log'; import {useTheme} from '@/hooks/useTheme'; From 6473817a09edaded35e1c19318e42fb86babd8e7 Mon Sep 17 00:00:00 2001 From: nacho <25931366+ignaciosantise@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:10:39 -0300 Subject: [PATCH 4/8] chore: removed extra wallet creation + added patch to use native crypto in bip39 --- .../patches/bip39-npm-3.1.0-03958ed434.patch | 82 +++++++++++++++++++ wallets/rn_cli_wallet/index.js | 7 +- wallets/rn_cli_wallet/package.json | 3 +- .../rn_cli_wallet/src/screens/Scan/index.tsx | 2 +- .../src/utils/EIP155WalletUtil.ts | 10 +-- .../rn_cli_wallet/src/utils/TonWalletUtil.ts | 10 +-- wallets/rn_cli_wallet/yarn.lock | 9 ++ 7 files changed, 100 insertions(+), 23 deletions(-) create mode 100644 wallets/rn_cli_wallet/.yarn/patches/bip39-npm-3.1.0-03958ed434.patch diff --git a/wallets/rn_cli_wallet/.yarn/patches/bip39-npm-3.1.0-03958ed434.patch b/wallets/rn_cli_wallet/.yarn/patches/bip39-npm-3.1.0-03958ed434.patch new file mode 100644 index 00000000..e8c11aff --- /dev/null +++ b/wallets/rn_cli_wallet/.yarn/patches/bip39-npm-3.1.0-03958ed434.patch @@ -0,0 +1,82 @@ +diff --git a/src/index.js b/src/index.js +index b83863f4b3d09df1159eb2c05d43e20a05d55767..926895a1f697905d48bf32f32fc538de3ce1b252 100644 +--- a/src/index.js ++++ b/src/index.js +@@ -38,20 +38,68 @@ function salt(password) { + function mnemonicToSeedSync(mnemonic, password) { + const mnemonicBuffer = Uint8Array.from(Buffer.from(normalize(mnemonic), 'utf8')); + const saltBuffer = Uint8Array.from(Buffer.from(salt(normalize(password)), 'utf8')); +- const res = pbkdf2_1.pbkdf2(sha512_1.sha512, mnemonicBuffer, saltBuffer, { +- c: 2048, +- dkLen: 64, +- }); +- return Buffer.from(res); ++ ++ // Use react-native-quick-crypto's native PBKDF2 ++ try { ++ var crypto = require("crypto"); ++ const res = crypto.pbkdf2Sync( ++ mnemonicBuffer, ++ saltBuffer, ++ 2048, // iterations ++ 64, // key length ++ 'sha512' ++ ); ++ return Buffer.from(res); ++ } catch (e) { ++ console.warn('Native pbkdf2Sync failed, falling back to JS implementation', e); ++ // Fallback to original implementation ++ const res = pbkdf2_1.pbkdf2(sha512_1.sha512, mnemonicBuffer, saltBuffer, { ++ c: 2048, ++ dkLen: 64, ++ }); ++ return Buffer.from(res); ++ } + } + exports.mnemonicToSeedSync = mnemonicToSeedSync; ++ + function mnemonicToSeed(mnemonic, password) { + const mnemonicBuffer = Uint8Array.from(Buffer.from(normalize(mnemonic), 'utf8')); + const saltBuffer = Uint8Array.from(Buffer.from(salt(normalize(password)), 'utf8')); +- return pbkdf2_1.pbkdf2Async(sha512_1.sha512, mnemonicBuffer, saltBuffer, { +- c: 2048, +- dkLen: 64, +- }).then((res) => Buffer.from(res)); ++ ++ // Use react-native-quick-crypto's native PBKDF2 ++ try { ++ var crypto = require("crypto"); ++ return new Promise((resolve, reject) => { ++ crypto.pbkdf2( ++ mnemonicBuffer, ++ saltBuffer, ++ 2048, // iterations ++ 64, // key length ++ 'sha512', ++ (err, res) => { ++ if (err) { ++ reject(err); ++ } else { ++ resolve(Buffer.from(res)); ++ } ++ } ++ ); ++ }).catch((err) => { ++ console.warn('Native pbkdf2 failed, falling back to JS implementation', err); ++ // Fallback to original implementation ++ return pbkdf2_1.pbkdf2Async(sha512_1.sha512, mnemonicBuffer, saltBuffer, { ++ c: 2048, ++ dkLen: 64, ++ }).then((res) => Buffer.from(res)); ++ }); ++ } catch (e) { ++ console.warn('Native pbkdf2 not available, using JS implementation', e); ++ // Fallback to original implementation ++ return pbkdf2_1.pbkdf2Async(sha512_1.sha512, mnemonicBuffer, saltBuffer, { ++ c: 2048, ++ dkLen: 64, ++ }).then((res) => Buffer.from(res)); ++ } + } + exports.mnemonicToSeed = mnemonicToSeed; + function mnemonicToEntropy(mnemonic, wordlist) { diff --git a/wallets/rn_cli_wallet/index.js b/wallets/rn_cli_wallet/index.js index 9490b44c..b0fdedcf 100644 --- a/wallets/rn_cli_wallet/index.js +++ b/wallets/rn_cli_wallet/index.js @@ -2,9 +2,9 @@ import 'react-native-gesture-handler'; import '@walletconnect/react-native-compat'; import {AppRegistry} from 'react-native'; import {name as appName} from './app.json'; -import crypto from 'react-native-quick-crypto'; +import crypto, { install } from 'react-native-quick-crypto'; -import App from './src/screens/App'; +install(); const polyfillDigest = async (algorithm, data) => { const algo = algorithm.replace('-', '').toLowerCase(); @@ -13,11 +13,10 @@ const polyfillDigest = async (algorithm, data) => { return hash.digest(); }; -// eslint-disable-next-line no-undef -globalThis.crypto = crypto; // eslint-disable-next-line no-undef globalThis.crypto.subtle = { digest: polyfillDigest, }; +import App from './src/screens/App'; AppRegistry.registerComponent(appName, () => App); diff --git a/wallets/rn_cli_wallet/package.json b/wallets/rn_cli_wallet/package.json index ca85d943..7e2b10f1 100644 --- a/wallets/rn_cli_wallet/package.json +++ b/wallets/rn_cli_wallet/package.json @@ -106,7 +106,8 @@ "brace-expansion": "1.1.12", "@ton/crypto-primitives@2.1.0": "patch:@ton/crypto-primitives@npm%3A2.1.0#./.yarn/patches/@ton-crypto-primitives-npm-2.1.0-3d1ea62176.patch", "@ethersproject/pbkdf2@5.8.0": "patch:@ethersproject/pbkdf2@npm%3A5.8.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch", - "@ethersproject/pbkdf2@^5.8.0": "patch:@ethersproject/pbkdf2@npm%3A5.8.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch" + "@ethersproject/pbkdf2@^5.8.0": "patch:@ethersproject/pbkdf2@npm%3A5.8.0#./.yarn/patches/@ethersproject-pbkdf2-npm-5.8.0-b720e81bcc.patch", + "bip39@3.1.0": "patch:bip39@npm%3A3.1.0#./.yarn/patches/bip39-npm-3.1.0-03958ed434.patch" }, "packageManager": "yarn@3.8.7" } diff --git a/wallets/rn_cli_wallet/src/screens/Scan/index.tsx b/wallets/rn_cli_wallet/src/screens/Scan/index.tsx index 8ffbaec0..d3aab6a9 100644 --- a/wallets/rn_cli_wallet/src/screens/Scan/index.tsx +++ b/wallets/rn_cli_wallet/src/screens/Scan/index.tsx @@ -18,7 +18,7 @@ import styles from './styles'; type Props = RootStackScreenProps<'Scan'>; export default function Scan({navigation}: Props) { - const device = useCameraDevice('back'); + const device = useCameraDevice('back', {physicalDevices: ['wide-angle-camera']}); const [showCamera, setShowCamera] = useState(false); // 2. Only activate Camera when the app is focused and this screen is currently opened diff --git a/wallets/rn_cli_wallet/src/utils/EIP155WalletUtil.ts b/wallets/rn_cli_wallet/src/utils/EIP155WalletUtil.ts index 35b8ea16..0454751a 100644 --- a/wallets/rn_cli_wallet/src/utils/EIP155WalletUtil.ts +++ b/wallets/rn_cli_wallet/src/utils/EIP155WalletUtil.ts @@ -7,33 +7,27 @@ export let eip155Wallets: Record; export let eip155Addresses: string[]; let address1: string; -let address2: string; +// let address2: string; /** * Utilities */ export async function createOrRestoreEIP155Wallet() { const mnemonic1 = await storage.getItem('EIP155_MNEMONIC_1'); - const mnemonic2 = await storage.getItem('EIP155_MNEMONIC_2'); - if (mnemonic1 && mnemonic2) { + if (mnemonic1) { wallet1 = EIP155Lib.init({mnemonic: mnemonic1}); - wallet2 = EIP155Lib.init({mnemonic: mnemonic2}); } else { wallet1 = EIP155Lib.init({}); - wallet2 = EIP155Lib.init({}); // Don't store mnemonic in local storage in a production project! storage.setItem('EIP155_MNEMONIC_1', wallet1.getMnemonic()); - storage.setItem('EIP155_MNEMONIC_2', wallet2.getMnemonic()); } address1 = wallet1.getAddress(); - address2 = wallet2.getAddress(); eip155Wallets = { [address1]: wallet1, - [address2]: wallet2, }; eip155Addresses = Object.keys(eip155Wallets); diff --git a/wallets/rn_cli_wallet/src/utils/TonWalletUtil.ts b/wallets/rn_cli_wallet/src/utils/TonWalletUtil.ts index 09f16cbb..16e2a29f 100644 --- a/wallets/rn_cli_wallet/src/utils/TonWalletUtil.ts +++ b/wallets/rn_cli_wallet/src/utils/TonWalletUtil.ts @@ -7,33 +7,25 @@ export let tonWallets: Record export let tonAddresses: string[] let address1: string -let address2: string /** * Utilities */ export async function createOrRestoreTonWallet() { const secretKey1 = await storage.getItem('TON_SECRET_KEY_1') - const secretKey2 = await storage.getItem('TON_SECRET_KEY_2') - if (secretKey1 && secretKey2) { + if (secretKey1) { wallet1 = await TonLib.init({ secretKey: secretKey1 }) - wallet2 = await TonLib.init({ secretKey: secretKey2 }) } else { wallet1 = await TonLib.init({}) - wallet2 = await TonLib.init({}) - // Don't store secretKey in local storage in a production project! await storage.setItem('TON_SECRET_KEY_1', wallet1.getSecretKey()) - await storage.setItem('TON_SECRET_KEY_2', wallet2.getSecretKey()) } address1 = await wallet1.getAddress() - address2 = await wallet2.getAddress() tonWallets = { [address1]: wallet1, - [address2]: wallet2 } tonAddresses = Object.keys(tonWallets) diff --git a/wallets/rn_cli_wallet/yarn.lock b/wallets/rn_cli_wallet/yarn.lock index 01565490..72820ef9 100644 --- a/wallets/rn_cli_wallet/yarn.lock +++ b/wallets/rn_cli_wallet/yarn.lock @@ -4846,6 +4846,15 @@ __metadata: languageName: node linkType: hard +"bip39@patch:bip39@npm%3A3.1.0#./.yarn/patches/bip39-npm-3.1.0-03958ed434.patch::locator=RNWeb3Wallet%40workspace%3A.": + version: 3.1.0 + resolution: "bip39@patch:bip39@npm%3A3.1.0#./.yarn/patches/bip39-npm-3.1.0-03958ed434.patch::version=3.1.0&hash=6ad58d&locator=RNWeb3Wallet%40workspace%3A." + dependencies: + "@noble/hashes": ^1.2.0 + checksum: 482916c2a55755aff5e354042932c71b1f37cbe7c8ff870306ea2dc185b932db3b2e775e61175f68e3263f532fcbf8588ee7fe4422b60f55b6b208b6527b51a5 + languageName: node + linkType: hard + "bl@npm:^4.0.3, bl@npm:^4.1.0": version: 4.1.0 resolution: "bl@npm:4.1.0" From 96a5fd578c12abb1d6886d4e3506a0fbbb47be52 Mon Sep 17 00:00:00 2001 From: nacho <25931366+ignaciosantise@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:22:45 -0300 Subject: [PATCH 5/8] chore: removed react-native-permissions and replaced with built-in camera permission handlers --- wallets/rn_cli_wallet/ios/Podfile | 6 ---- wallets/rn_cli_wallet/ios/Podfile.lock | 34 +------------------ .../ios/RNWeb3Wallet/Debug-Info.plist | 2 -- .../rn_cli_wallet/ios/RNWeb3Wallet/Info.plist | 2 -- .../ios/RNWeb3Wallet/Internal-Info.plist | 2 -- wallets/rn_cli_wallet/package.json | 1 - .../rn_cli_wallet/src/screens/Scan/index.tsx | 26 ++++++-------- wallets/rn_cli_wallet/yarn.lock | 15 -------- 8 files changed, 11 insertions(+), 77 deletions(-) diff --git a/wallets/rn_cli_wallet/ios/Podfile b/wallets/rn_cli_wallet/ios/Podfile index a85c9e15..19743d56 100644 --- a/wallets/rn_cli_wallet/ios/Podfile +++ b/wallets/rn_cli_wallet/ios/Podfile @@ -9,16 +9,10 @@ end # Use it to require both react-native's and this package's scripts: node_require('react-native/scripts/react_native_pods.rb') -node_require('react-native-permissions/scripts/setup.rb') platform :ios, min_ios_version_supported prepare_react_native_project! -setup_permissions([ - 'Camera', - 'Notifications' -]) - linkage = ENV['USE_FRAMEWORKS'] if linkage != nil diff --git a/wallets/rn_cli_wallet/ios/Podfile.lock b/wallets/rn_cli_wallet/ios/Podfile.lock index 21db27c6..554e1fd6 100644 --- a/wallets/rn_cli_wallet/ios/Podfile.lock +++ b/wallets/rn_cli_wallet/ios/Podfile.lock @@ -2619,34 +2619,6 @@ PODS: - ReactCommon/turbomodule/core - SocketRocket - Yoga - - RNPermissions (5.4.2): - - boost - - DoubleConversion - - fast_float - - fmt - - glog - - hermes-engine - - RCT-Folly - - RCT-Folly/Fabric - - RCTRequired - - RCTTypeSafety - - React-Core - - React-debug - - React-Fabric - - React-featureflags - - React-graphics - - React-ImageManager - - React-jsi - - React-NativeModulesApple - - React-RCTFabric - - React-renderercss - - React-rendererdebug - - React-utils - - ReactCodegen - - ReactCommon/turbomodule/bridging - - ReactCommon/turbomodule/core - - SocketRocket - - Yoga - RNScreens (4.16.0): - boost - DoubleConversion @@ -2890,7 +2862,6 @@ DEPENDENCIES: - "RNCClipboard (from `../node_modules/@react-native-clipboard/clipboard`)" - RNDeviceInfo (from `../node_modules/react-native-device-info`) - RNGestureHandler (from `../node_modules/react-native-gesture-handler`) - - RNPermissions (from `../node_modules/react-native-permissions`) - RNScreens (from `../node_modules/react-native-screens`) - "RNSentry (from `../node_modules/@sentry/react-native`)" - RNSVG (from `../node_modules/react-native-svg`) @@ -3076,8 +3047,6 @@ EXTERNAL SOURCES: :path: "../node_modules/react-native-device-info" RNGestureHandler: :path: "../node_modules/react-native-gesture-handler" - RNPermissions: - :path: "../node_modules/react-native-permissions" RNScreens: :path: "../node_modules/react-native-screens" RNSentry: @@ -3176,7 +3145,6 @@ SPEC CHECKSUMS: RNCClipboard: 4b58c780f63676367640f23c8e114e9bd0cf86ac RNDeviceInfo: bcce8752b5043a623fe3c26789679b473f705d3c RNGestureHandler: f1dd7f92a0faa2868a919ab53bb9d66eb4ebfcf5 - RNPermissions: 304745e60937128f77f79a64e342295549d829da RNScreens: 0bbf16c074ae6bb1058a7bf2d1ae017f4306797c RNSentry: bbaa7ef3a4b131bc947de327ed9e47a054ce0978 RNSVG: 8c0bbfa480a24b24468f1c76bd852a4aac3178e6 @@ -3185,6 +3153,6 @@ SPEC CHECKSUMS: VisionCamera: 30b358b807324c692064f78385e9a732ce1bebfe Yoga: edeb9900b9e5bb5b27b9a6a2d5914e4fe4033c1b -PODFILE CHECKSUM: 198cfec3fad83c0e3af1672f94f8de0ffc5f2180 +PODFILE CHECKSUM: 37b3abb743131d0d701e76db155ef06d7f5954ad COCOAPODS: 1.14.3 diff --git a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Debug-Info.plist b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Debug-Info.plist index dbf462dc..371f9d74 100644 --- a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Debug-Info.plist +++ b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Debug-Info.plist @@ -58,8 +58,6 @@ NSCameraUsageDescription Allow access to the camera to scan codes - NSLocationWhenInUseUsageDescription - Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes the react-native-permissions library. UIBackgroundModes fetch diff --git a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Info.plist b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Info.plist index 11d795e0..be95d9f4 100644 --- a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Info.plist +++ b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Info.plist @@ -58,8 +58,6 @@ NSCameraUsageDescription Allow access to the camera to scan codes - NSLocationWhenInUseUsageDescription - Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes the react-native-permissions library. RCTNewArchEnabled UIBackgroundModes diff --git a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Internal-Info.plist b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Internal-Info.plist index e51646fc..b92e3acd 100644 --- a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Internal-Info.plist +++ b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Internal-Info.plist @@ -58,8 +58,6 @@ NSCameraUsageDescription Allow access to the camera to scan codes - NSLocationWhenInUseUsageDescription - Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes the react-native-permissions library. UIBackgroundModes fetch diff --git a/wallets/rn_cli_wallet/package.json b/wallets/rn_cli_wallet/package.json index 7e2b10f1..b99a4384 100644 --- a/wallets/rn_cli_wallet/package.json +++ b/wallets/rn_cli_wallet/package.json @@ -53,7 +53,6 @@ "react-native-get-random-values": "1.11.0", "react-native-mmkv": "3.3.3", "react-native-modal": "14.0.0-rc.1", - "react-native-permissions": "5.4.2", "react-native-quick-base64": "2.2.2", "react-native-quick-crypto": "0.7.17", "react-native-safe-area-context": "5.6.1", diff --git a/wallets/rn_cli_wallet/src/screens/Scan/index.tsx b/wallets/rn_cli_wallet/src/screens/Scan/index.tsx index d3aab6a9..88e05855 100644 --- a/wallets/rn_cli_wallet/src/screens/Scan/index.tsx +++ b/wallets/rn_cli_wallet/src/screens/Scan/index.tsx @@ -1,13 +1,13 @@ -import {useEffect, useState} from 'react'; -import {Platform, StyleSheet, TouchableOpacity, View, Text} from 'react-native'; +import {useEffect,} from 'react'; +import { StyleSheet, TouchableOpacity, View, Text} from 'react-native'; import { Camera, Code, useCameraDevice, useCodeScanner, + useCameraPermission, // Add this } from 'react-native-vision-camera'; -import {request, PERMISSIONS, RESULTS} from 'react-native-permissions'; import {useIsFocused} from '@react-navigation/native'; import {SafeAreaView} from 'react-native-safe-area-context'; @@ -19,7 +19,7 @@ type Props = RootStackScreenProps<'Scan'>; export default function Scan({navigation}: Props) { const device = useCameraDevice('back', {physicalDevices: ['wide-angle-camera']}); - const [showCamera, setShowCamera] = useState(false); + const {hasPermission, requestPermission} = useCameraPermission(); // Add this // 2. Only activate Camera when the app is focused and this screen is currently opened const isActive = useIsFocused(); @@ -42,16 +42,10 @@ export default function Scan({navigation}: Props) { }; useEffect(() => { - request( - Platform.OS === 'ios' - ? PERMISSIONS.IOS.CAMERA - : PERMISSIONS.ANDROID.CAMERA, - ).then(result => { - if (result === RESULTS.GRANTED) { - setShowCamera(true); - } - }); - }, []); + if (!hasPermission) { + requestPermission(); + } + }, [hasPermission, requestPermission]); return ( @@ -64,7 +58,7 @@ export default function Scan({navigation}: Props) { /> - {showCamera && device ? ( + {hasPermission && device ? ( ); -} +} \ No newline at end of file diff --git a/wallets/rn_cli_wallet/yarn.lock b/wallets/rn_cli_wallet/yarn.lock index 72820ef9..007fd70f 100644 --- a/wallets/rn_cli_wallet/yarn.lock +++ b/wallets/rn_cli_wallet/yarn.lock @@ -4264,7 +4264,6 @@ __metadata: react-native-get-random-values: 1.11.0 react-native-mmkv: 3.3.3 react-native-modal: 14.0.0-rc.1 - react-native-permissions: 5.4.2 react-native-quick-base64: 2.2.2 react-native-quick-crypto: 0.7.17 react-native-safe-area-context: 5.6.1 @@ -10386,20 +10385,6 @@ __metadata: languageName: node linkType: hard -"react-native-permissions@npm:5.4.2": - version: 5.4.2 - resolution: "react-native-permissions@npm:5.4.2" - peerDependencies: - react: ">=18.1.0" - react-native: ">=0.70.0" - react-native-windows: ">=0.70.0" - peerDependenciesMeta: - react-native-windows: - optional: true - checksum: fac680b7d85fb979806156d6c9f90dee9c8299b83eb9d2d82bee50aec4baa71b0f5d3cf79e8bf02345e67f77d6cb0fbfbe7e54d02b6822de0ae2e0d9323a6614 - languageName: node - linkType: hard - "react-native-quick-base64@npm:2.2.2, react-native-quick-base64@npm:^2.2.2": version: 2.2.2 resolution: "react-native-quick-base64@npm:2.2.2" From b9b773912d97d313e8d77e1450972af0c98b8e13 Mon Sep 17 00:00:00 2001 From: nacho <25931366+ignaciosantise@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:38:41 -0300 Subject: [PATCH 6/8] chore: re-added NSLocationWhenInUseUsageDescription --- wallets/rn_cli_wallet/ios/RNWeb3Wallet/Debug-Info.plist | 2 ++ wallets/rn_cli_wallet/ios/RNWeb3Wallet/Info.plist | 2 ++ wallets/rn_cli_wallet/ios/RNWeb3Wallet/Internal-Info.plist | 2 ++ 3 files changed, 6 insertions(+) diff --git a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Debug-Info.plist b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Debug-Info.plist index 371f9d74..dbf462dc 100644 --- a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Debug-Info.plist +++ b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Debug-Info.plist @@ -58,6 +58,8 @@ NSCameraUsageDescription Allow access to the camera to scan codes + NSLocationWhenInUseUsageDescription + Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes the react-native-permissions library. UIBackgroundModes fetch diff --git a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Info.plist b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Info.plist index be95d9f4..11d795e0 100644 --- a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Info.plist +++ b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Info.plist @@ -58,6 +58,8 @@ NSCameraUsageDescription Allow access to the camera to scan codes + NSLocationWhenInUseUsageDescription + Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes the react-native-permissions library. RCTNewArchEnabled UIBackgroundModes diff --git a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Internal-Info.plist b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Internal-Info.plist index b92e3acd..e51646fc 100644 --- a/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Internal-Info.plist +++ b/wallets/rn_cli_wallet/ios/RNWeb3Wallet/Internal-Info.plist @@ -58,6 +58,8 @@ NSCameraUsageDescription Allow access to the camera to scan codes + NSLocationWhenInUseUsageDescription + Our app does not request this permission or utilize this functionality but it is included in our info.plist since our app utilizes the react-native-permissions library. UIBackgroundModes fetch From dbf37ced01ab840bd2f431bebb0c7fdbd3b37296 Mon Sep 17 00:00:00 2001 From: nacho <25931366+ignaciosantise@users.noreply.github.com> Date: Tue, 14 Oct 2025 16:57:47 -0300 Subject: [PATCH 7/8] chore: added PreactNativeArchitectures flag on build command + added cache in android action --- .github/workflows/release-android-base.yaml | 18 +++++++++++++++++- wallets/rn_cli_wallet/package.json | 4 ++-- 2 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/release-android-base.yaml b/.github/workflows/release-android-base.yaml index 3722f6f7..0a2a2cef 100644 --- a/.github/workflows/release-android-base.yaml +++ b/.github/workflows/release-android-base.yaml @@ -82,7 +82,23 @@ jobs: google-services-file: ${{ secrets.google-services-file }} if: ${{ env.google-services-file != '' }} run: echo ${{ env.google-services-file }} | base64 --decode >> ${{ inputs.root-path }}/android/app/google-services.json - + + - name: Optimize Gradle for CI + run: | + echo "org.gradle.jvmargs=-Xmx4096m -XX:MaxMetaspaceSize=1024m" >> ${{ inputs.root-path }}/android/gradle.properties + echo "org.gradle.parallel=true" >> ${{ inputs.root-path }}/android/gradle.properties + echo "org.gradle.caching=true" >> ${{ inputs.root-path }}/android/gradle.properties + + - name: Cache Gradle + uses: actions/cache@v3 + with: + path: | + ~/.gradle/caches + ~/.gradle/wrapper + key: ${{ runner.os }}-gradle-${{ hashFiles('**/*.gradle*', '**/gradle-wrapper.properties') }} + restore-keys: | + ${{ runner.os }}-gradle- + - name: Build APK run: | if [ ${{ inputs.release-type }} = 'internal' ]; then diff --git a/wallets/rn_cli_wallet/package.json b/wallets/rn_cli_wallet/package.json index b99a4384..807dd94b 100644 --- a/wallets/rn_cli_wallet/package.json +++ b/wallets/rn_cli_wallet/package.json @@ -4,8 +4,8 @@ "private": true, "scripts": { "android": "yarn run copy:debug && react-native run-android --mode=debug --appId com.walletconnect.web3wallet.rnsample.debug", - "android:build": "yarn run copy:production && cd android && ./gradlew clean && ./gradlew assembleRelease", - "android:build:internal": "yarn run copy:internal && cd android && ./gradlew clean && ./gradlew assembleInternal", + "android:build": "yarn run copy:production && cd android && ./gradlew clean && ./gradlew assembleRelease -PreactNativeArchitectures=arm64-v8a", + "android:build:internal": "yarn run copy:internal && cd android && ./gradlew clean && ./gradlew assembleInternal -PreactNativeArchitectures=arm64-v8a", "ios": "react-native run-ios --scheme 'RNWallet-Debug'", "ios:internal": "react-native run-ios --scheme 'RNWallet-Internal'", "bundle:ios": "react-native bundle --entry-file='index.js' --bundle-output='./ios/main.jsbundle' --dev=false --platform='ios'", From 8883ec4d991b3da267e25c80ce04deaa2d5d2d92 Mon Sep 17 00:00:00 2001 From: nacho <25931366+ignaciosantise@users.noreply.github.com> Date: Tue, 14 Oct 2025 17:15:12 -0300 Subject: [PATCH 8/8] chore: added architecture flag on dapp samples --- dapps/W3MEthers/package.json | 2 +- dapps/W3MEthers5/package.json | 2 +- dapps/W3MWagmi/package.json | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/dapps/W3MEthers/package.json b/dapps/W3MEthers/package.json index a4347616..1a92c262 100644 --- a/dapps/W3MEthers/package.json +++ b/dapps/W3MEthers/package.json @@ -3,7 +3,7 @@ "private": true, "scripts": { "android": "react-native run-android", - "android:build": "cd android && ./gradlew clean && ./gradlew assembleRelease", + "android:build": "cd android && ./gradlew clean && ./gradlew assembleRelease -PreactNativeArchitectures=arm64-v8a", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", diff --git a/dapps/W3MEthers5/package.json b/dapps/W3MEthers5/package.json index cfdf7658..aa03f774 100644 --- a/dapps/W3MEthers5/package.json +++ b/dapps/W3MEthers5/package.json @@ -3,7 +3,7 @@ "private": true, "scripts": { "android": "react-native run-android", - "android:build": "cd android && ./gradlew clean && ./gradlew assembleRelease", + "android:build": "cd android && ./gradlew clean && ./gradlew assembleRelease -PreactNativeArchitectures=arm64-v8a", "ios": "react-native run-ios", "lint": "eslint .", "start": "react-native start", diff --git a/dapps/W3MWagmi/package.json b/dapps/W3MWagmi/package.json index e96997ad..d11d35db 100644 --- a/dapps/W3MWagmi/package.json +++ b/dapps/W3MWagmi/package.json @@ -3,8 +3,8 @@ "private": true, "scripts": { "android": "yarn run copy:debug && react-native run-android --appId com.walletconnect.web3modal.rnsample.debug", - "android:build": "yarn run copy:production && cd android && ./gradlew clean && ./gradlew assembleRelease", - "android:build:internal": "yarn run copy:internal && cd android && ./gradlew clean && ./gradlew assembleInternal", + "android:build": "yarn run copy:production && cd android && ./gradlew clean && ./gradlew assembleRelease -PreactNativeArchitectures=arm64-v8a", + "android:build:internal": "yarn run copy:internal && cd android && ./gradlew clean && ./gradlew assembleInternal -PreactNativeArchitectures=arm64-v8a", "ios": "react-native run-ios", "ios:internal": "react-native run-ios --scheme 'W3MWagmi Internal' ", "lint": "eslint .",