diff --git a/electron/main/index.ts b/electron/main/index.ts index e5cda818..6f75cd41 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -317,7 +317,9 @@ async function createWindow() { case 'ada': case 'tada': case 'dot': - case 'tdot': { + case 'tdot': + case 'sui': + case 'tsui': { const mpcCoin = sdk.coin(coin) as Ada | Tada | Dot | Tdot; return await mpcCoin.recoverConsolidations(params); } diff --git a/electron/preload/index.ts b/electron/preload/index.ts index 62ef9d5d..b6d0c688 100644 --- a/electron/preload/index.ts +++ b/electron/preload/index.ts @@ -33,6 +33,8 @@ import { DotRecoveryConsolidationRecoveryOptions, SolRecoverConsolidationRecoveryBatch, SolRecoveryConsolidationRecoveryOptions, + SuiRecoverConsolidationRecoveryBatch, + SuiRecoveryConsolidationRecoveryOptions, } from '../types'; import type * as EthLikeCommon from '@ethereumjs/common'; @@ -62,12 +64,14 @@ type Commands = { | AdaRecoveryConsolidationRecoveryOptions | DotRecoveryConsolidationRecoveryOptions | SolRecoveryConsolidationRecoveryOptions + | SuiRecoveryConsolidationRecoveryOptions ): Promise< | Error | TrxConsolidationRecoveryBatch | AdaRecoveryConsolidationRecoveryBatch | DotRecoverConsolidationRecoveryBatch | SolRecoverConsolidationRecoveryBatch + | SuiRecoverConsolidationRecoveryBatch >; writeFile( file: string, diff --git a/electron/types.ts b/electron/types.ts index af9e0415..b3e895cf 100644 --- a/electron/types.ts +++ b/electron/types.ts @@ -57,6 +57,9 @@ export type DotRecoveryConsolidationRecoveryOptions = export type SolRecoveryConsolidationRecoveryOptions = | Parameters[0] | Parameters[0]; +export type SuiRecoveryConsolidationRecoveryOptions = + | Parameters[0] + | Parameters[0]; export type TrxConsolidationRecoveryOptions = ConsolidationRecoveryOptions; export type AdaRecoveryConsolidationRecoveryBatch = Awaited< @@ -68,4 +71,7 @@ export type DotRecoverConsolidationRecoveryBatch = Awaited< export type SolRecoverConsolidationRecoveryBatch = Awaited< ReturnType >; +export type SuiRecoverConsolidationRecoveryBatch = Awaited< + ReturnType +>; export type TrxConsolidationRecoveryBatch = ConsolidationRecoveryBatch; diff --git a/package-lock.json b/package-lock.json index 4db7c97d..34a13aaa 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,6 +9,7 @@ "version": "0.0.0-placeholder-version", "license": "Apache-2.0", "dependencies": { +<<<<<<< HEAD "@bitgo-beta/sdk-coin-sui": "^1.4.1-alpha.180", "@bitgo/abstract-cosmos": "10.1.1", "@bitgo/abstract-utxo": "8.12.1", @@ -50,6 +51,48 @@ "@bitgo/sdk-coin-zec": "2.0.30", "@bitgo/sdk-coin-zeta": "2.0.30", "@bitgo/utxo-lib": "10.1.0", +======= + "@bitgo-beta/sdk-coin-sui": "^1.4.1-alpha.161", + "@bitgo/abstract-cosmos": "10.0.24", + "@bitgo/abstract-utxo": "8.9.0", + "@bitgo/sdk-api": "1.50.0", + "@bitgo/sdk-coin-ada": "4.2.2", + "@bitgo/sdk-coin-algo": "2.1.22", + "@bitgo/sdk-coin-arbeth": "21.0.16", + "@bitgo/sdk-coin-atom": "12.0.24", + "@bitgo/sdk-coin-avaxc": "5.0.16", + "@bitgo/sdk-coin-bch": "2.0.24", + "@bitgo/sdk-coin-bcha": "2.1.8", + "@bitgo/sdk-coin-bld": "2.0.24", + "@bitgo/sdk-coin-bsc": "22.1.8", + "@bitgo/sdk-coin-bsv": "2.0.24", + "@bitgo/sdk-coin-btc": "2.0.24", + "@bitgo/sdk-coin-btg": "2.0.24", + "@bitgo/sdk-coin-coreum": "20.0.24", + "@bitgo/sdk-coin-dash": "2.0.24", + "@bitgo/sdk-coin-doge": "2.0.24", + "@bitgo/sdk-coin-dot": "4.1.2", + "@bitgo/sdk-coin-eos": "2.1.17", + "@bitgo/sdk-coin-eth": "24.2.13", + "@bitgo/sdk-coin-ethw": "20.0.24", + "@bitgo/sdk-coin-hash": "2.0.24", + "@bitgo/sdk-coin-hbar": "2.0.24", + "@bitgo/sdk-coin-injective": "2.0.24", + "@bitgo/sdk-coin-ltc": "3.0.24", + "@bitgo/sdk-coin-near": "2.0.24", + "@bitgo/sdk-coin-opeth": "18.1.9", + "@bitgo/sdk-coin-osmo": "2.0.24", + "@bitgo/sdk-coin-polygon": "20.5.8", + "@bitgo/sdk-coin-sei": "2.0.24", + "@bitgo/sdk-coin-sol": "4.3.2", + "@bitgo/sdk-coin-tia": "2.1.10", + "@bitgo/sdk-coin-trx": "2.0.24", + "@bitgo/sdk-coin-xlm": "3.1.2", + "@bitgo/sdk-coin-xrp": "2.1.5", + "@bitgo/sdk-coin-zec": "2.0.24", + "@bitgo/sdk-coin-zeta": "2.0.24", + "@bitgo/utxo-lib": "9.39.0", +>>>>>>> a1cc27d (feat(sui): build unsigned consolidations) "@ethereumjs/common": "2.6.5", "@lottiefiles/react-lottie-player": "3.4.9", "clsx": "1.2.1", @@ -2048,16 +2091,30 @@ "license": "MIT" }, "node_modules/@bitgo-beta/blake2b": { +<<<<<<< HEAD "version": "3.2.1-alpha.181", "license": "ISC", "dependencies": { "@bitgo-beta/blake2b-wasm": "3.2.1-alpha.182", +======= + "version": "3.2.1-alpha.162", + "resolved": "https://registry.npmjs.org/@bitgo-beta/blake2b/-/blake2b-3.2.1-alpha.162.tgz", + "integrity": "sha512-zcrIjaAlmtOwMcnhFxQGO7rQzozbzz2na0O4/qDnzgs1yh0Cqy3v0ea0kyIUrO8iaw6twsrg9p6d/jhw90XSmg==", + "dependencies": { + "@bitgo-beta/blake2b-wasm": "3.2.1-alpha.163", +>>>>>>> a1cc27d (feat(sui): build unsigned consolidations) "nanoassert": "^2.0.0" } }, "node_modules/@bitgo-beta/blake2b-wasm": { +<<<<<<< HEAD "version": "3.2.1-alpha.182", "license": "MIT", +======= + "version": "3.2.1-alpha.163", + "resolved": "https://registry.npmjs.org/@bitgo-beta/blake2b-wasm/-/blake2b-wasm-3.2.1-alpha.163.tgz", + "integrity": "sha512-fepz0qvvp6m8pdUHo1207F9tUY4KPsstYPhCgA2a1Hqe8dvOTeV/LF1P+VDWHTHO+Swii9+zqwgnLNL7e1uSyw==", +>>>>>>> a1cc27d (feat(sui): build unsigned consolidations) "dependencies": { "nanoassert": "^1.0.0" } @@ -2067,13 +2124,20 @@ "license": "ISC" }, "node_modules/@bitgo-beta/bls-dkg": { +<<<<<<< HEAD "version": "1.3.1-alpha.182", "license": "ISC", +======= + "version": "1.3.1-alpha.163", + "resolved": "https://registry.npmjs.org/@bitgo-beta/bls-dkg/-/bls-dkg-1.3.1-alpha.163.tgz", + "integrity": "sha512-olm4ftrsJ/oK6l/Ynu+UfloKhTWob7J3WjK4T6DSJRsxa9ELisx+G8JDa7ViB2c7/YgRpQ3ZBPAmI93dP9s64Q==", +>>>>>>> a1cc27d (feat(sui): build unsigned consolidations) "dependencies": { "noble-bls12-381": "^0.7.2" } }, "node_modules/@bitgo-beta/sdk-coin-sui": { +<<<<<<< HEAD "version": "1.4.1-alpha.180", "license": "MIT", "dependencies": { @@ -2081,6 +2145,16 @@ "@bitgo-beta/sdk-core": "2.4.1-alpha.181", "@bitgo-beta/sdk-lib-mpc": "8.2.1-alpha.136", "@bitgo-beta/statics": "10.0.1-alpha.181", +======= + "version": "1.4.1-alpha.161", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-coin-sui/-/sdk-coin-sui-1.4.1-alpha.161.tgz", + "integrity": "sha512-/S+g2KOnPjETZjsUSrEWXH7NFSD4jmyQEyfgwP1fZOabkLuXqSnAQA2y4iIYYIoB2WEdO9q1DVIbocLF2nkZ2g==", + "dependencies": { + "@bitgo-beta/blake2b": "3.2.1-alpha.162", + "@bitgo-beta/sdk-core": "2.4.1-alpha.162", + "@bitgo-beta/sdk-lib-mpc": "8.2.1-alpha.117", + "@bitgo-beta/statics": "10.0.1-alpha.162", +>>>>>>> a1cc27d (feat(sui): build unsigned consolidations) "@mysten/bcs": "^0.7.0", "bignumber.js": "^9.0.0", "bs58": "^4.0.1", @@ -2184,6 +2258,7 @@ } }, "node_modules/@bitgo-beta/sdk-core": { +<<<<<<< HEAD "version": "2.4.1-alpha.181", "license": "MIT", "dependencies": { @@ -2193,6 +2268,18 @@ "@bitgo-beta/statics": "10.0.1-alpha.181", "@bitgo-beta/utxo-lib": "4.0.1-alpha.181", "@bitgo/public-types": "2.33.4", +======= + "version": "2.4.1-alpha.162", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-core/-/sdk-core-2.4.1-alpha.162.tgz", + "integrity": "sha512-gBJjwEky+VYcLiKNXjZre/9gqDVmFdQvm59hyQAmx/KeQx1oa8TR9tvqWXu2ctgbSB5nssiiFghrOujo7Blq6g==", + "dependencies": { + "@bitgo-beta/bls-dkg": "1.3.1-alpha.163", + "@bitgo-beta/sdk-lib-mpc": "8.2.1-alpha.117", + "@bitgo-beta/sjcl": "1.0.1-alpha.111", + "@bitgo-beta/statics": "10.0.1-alpha.162", + "@bitgo-beta/utxo-lib": "4.0.1-alpha.162", + "@bitgo/public-types": "2.33.3", +>>>>>>> a1cc27d (feat(sui): build unsigned consolidations) "@noble/secp256k1": "1.6.3", "@stablelib/hex": "^1.0.0", "@types/elliptic": "^6.4.12", @@ -2224,6 +2311,19 @@ "uuid": "^8.3.2" } }, + "node_modules/@bitgo-beta/sdk-core/node_modules/@bitgo/public-types": { + "version": "2.33.3", + "resolved": "https://registry.npmjs.org/@bitgo/public-types/-/public-types-2.33.3.tgz", + "integrity": "sha512-yPsrMRx+bgLYvFGu6mlIXuZ5cdOoqv3pVcShlHUsRnngLdd0BSq9U11MN6zjKVCFHYIFKsnxoGKUpopuRn06jQ==", + "dependencies": { + "@api-ts/io-ts-http": "1.0.0", + "fp-ts": "2.16.2", + "io-ts": "2.1.3", + "io-ts-types": "0.5.16", + "monocle-ts": "2.3.13", + "newtype-ts": "0.3.5" + } + }, "node_modules/@bitgo-beta/sdk-core/node_modules/debug": { "version": "3.2.7", "license": "MIT", @@ -2231,6 +2331,11 @@ "ms": "^2.1.1" } }, + "node_modules/@bitgo-beta/sdk-core/node_modules/fp-ts": { + "version": "2.16.2", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.16.2.tgz", + "integrity": "sha512-CkqAjnIKFqvo3sCyoBTqgJvF+bHrSik584S9nhTjtBESLx26cbtVMR/T9a6ApChOcSDAaM3JydDmWDUn4EEXng==" + }, "node_modules/@bitgo-beta/sdk-core/node_modules/keccak": { "version": "3.0.3", "hasInstallScript": true, @@ -2266,8 +2371,14 @@ "license": "MIT" }, "node_modules/@bitgo-beta/sdk-lib-mpc": { +<<<<<<< HEAD "version": "8.2.1-alpha.136", "license": "MIT", +======= + "version": "8.2.1-alpha.117", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-lib-mpc/-/sdk-lib-mpc-8.2.1-alpha.117.tgz", + "integrity": "sha512-zBSNyo+CloVYMBvpY3DEnLjtNImHBTHP3PFAz8y1L4uM/Xe6wIb0dJ8M1lGjDJLmRZ3aKpgnskwtYlPCz3V4Iw==", +>>>>>>> a1cc27d (feat(sui): build unsigned consolidations) "dependencies": { "@noble/curves": "1.4.0", "@silencelaboratories/dkls-wasm-ll-node": "1.1.2", @@ -2335,6 +2446,7 @@ } }, "node_modules/@bitgo-beta/sjcl": { +<<<<<<< HEAD "version": "1.0.1-alpha.130", "license": "(BSD-2-Clause OR GPL-2.0-only)" }, @@ -2347,6 +2459,23 @@ "license": "MIT", "dependencies": { "@bitgo-beta/blake2b": "3.2.1-alpha.181", +======= + "version": "1.0.1-alpha.111", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sjcl/-/sjcl-1.0.1-alpha.111.tgz", + "integrity": "sha512-zoj8+aXSi/CnveLGM5uJfM4/x7OaxQqVodjq13uM46Fxxi0PrNwZvzWM6qoXGDE4BdPpfEJPBj8ehfyhmCoCRg==" + }, + "node_modules/@bitgo-beta/statics": { + "version": "10.0.1-alpha.162", + "resolved": "https://registry.npmjs.org/@bitgo-beta/statics/-/statics-10.0.1-alpha.162.tgz", + "integrity": "sha512-KAgoTmp4/93qY4ro/S/Dvy0fSCO4Qtqwp3KONS+uAdIQSkoVRw9SwpobOFMDgxwvmvfiGv3iBMj+er7s+V4zLQ==" + }, + "node_modules/@bitgo-beta/utxo-lib": { + "version": "4.0.1-alpha.162", + "resolved": "https://registry.npmjs.org/@bitgo-beta/utxo-lib/-/utxo-lib-4.0.1-alpha.162.tgz", + "integrity": "sha512-vMGMmzT2o/6Syjpm5uD+B23pVZmGTdyr1+lTzMU0xEvwQ9zM38dXaP3fBox5DLcWmCJCh/0v2w0WE5ueJb9cQw==", + "dependencies": { + "@bitgo-beta/blake2b": "3.2.1-alpha.162", +>>>>>>> a1cc27d (feat(sui): build unsigned consolidations) "@brandonblack/musig": "^0.0.1-alpha.0", "@noble/secp256k1": "1.6.3", "bech32": "^2.0.0", diff --git a/src/containers/BuildUnsignedConsolidation/BuildUnsignedConsolidationCoin.tsx b/src/containers/BuildUnsignedConsolidation/BuildUnsignedConsolidationCoin.tsx index d0b665ce..dce3dda9 100644 --- a/src/containers/BuildUnsignedConsolidation/BuildUnsignedConsolidationCoin.tsx +++ b/src/containers/BuildUnsignedConsolidation/BuildUnsignedConsolidationCoin.tsx @@ -154,6 +154,8 @@ function ConsolidationForm({ coin, environment }: ConsolidationFormProps) { case 'tada': case 'dot': case 'tdot': + case 'sui': + case 'tsui': return ( { diff --git a/src/helpers/config.ts b/src/helpers/config.ts index 6afb8baa..70f84f13 100644 --- a/src/helpers/config.ts +++ b/src/helpers/config.ts @@ -605,6 +605,7 @@ export const buildUnsignedConsolidationCoins: Record< allCoinMetas.dot, allCoinMetas.sol, allCoinMetas.solToken, + allCoinMetas.sui, ], test: [ allCoinMetas.ttrx, @@ -613,6 +614,7 @@ export const buildUnsignedConsolidationCoins: Record< allCoinMetas.tdot, allCoinMetas.tsol, allCoinMetas.tsolToken, + allCoinMetas.tsui, ], }; diff --git a/src/preload.d.ts b/src/preload.d.ts index 834bcd39..7e074c23 100644 --- a/src/preload.d.ts +++ b/src/preload.d.ts @@ -28,6 +28,8 @@ import { DotRecoveryConsolidationRecoveryOptions, SolRecoverConsolidationRecoveryBatch, SolRecoveryConsolidationRecoveryOptions, + SuiRecoverConsolidationRecoveryBatch, + SuiRecoveryConsolidationRecoveryOptions, TrxConsolidationRecoveryBatch, TrxConsolidationRecoveryOptions, } from '~/utils/types'; @@ -58,12 +60,14 @@ type Commands = { | AdaRecoveryConsolidationRecoveryOptions | DotRecoveryConsolidationRecoveryOptions | SolRecoveryConsolidationRecoveryOptions + | SuiRecoveryConsolidationRecoveryOptions ): Promise< | Error | TrxConsolidationRecoveryBatch | AdaRecoveryConsolidationRecoveryBatch | DotRecoverConsolidationRecoveryBatch | SolRecoverConsolidationRecoveryBatch + | SuiRecoverConsolidationRecoveryBatch >; writeFile( file: string, @@ -164,12 +168,14 @@ const commands: Commands = { | AdaRecoveryConsolidationRecoveryOptions | DotRecoveryConsolidationRecoveryOptions | SolRecoveryConsolidationRecoveryOptions + | SuiRecoveryConsolidationRecoveryOptions ): Promise< | Error | TrxConsolidationRecoveryBatch | AdaRecoveryConsolidationRecoveryBatch | DotRecoverConsolidationRecoveryBatch | SolRecoverConsolidationRecoveryBatch + | SuiRecoverConsolidationRecoveryBatch > { return ipcRenderer.invoke('recoverConsolidations', coin, params); }, diff --git a/src/utils/types.ts b/src/utils/types.ts index 9cfeddc0..400ebb52 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -67,6 +67,9 @@ export type DotRecoveryConsolidationRecoveryOptions = export type SolRecoveryConsolidationRecoveryOptions = | Parameters[0] | Parameters[0]; +export type SuiRecoveryConsolidationRecoveryOptions = + | Parameters[0] + | Parameters[0]; export type TrxConsolidationRecoveryOptions = ConsolidationRecoveryOptions; export type AdaRecoveryConsolidationRecoveryBatch = Awaited< @@ -78,4 +81,7 @@ export type DotRecoverConsolidationRecoveryBatch = Awaited< export type SolRecoverConsolidationRecoveryBatch = Awaited< ReturnType >; +export type SuiRecoverConsolidationRecoveryBatch = Awaited< + ReturnType +>; export type TrxConsolidationRecoveryBatch = ConsolidationRecoveryBatch;