diff --git a/electron/main/index.ts b/electron/main/index.ts index 77f32aeb..edc63585 100644 --- a/electron/main/index.ts +++ b/electron/main/index.ts @@ -413,14 +413,18 @@ async function createWindow() { case 'dot': case 'tdot': case 'sol': - case 'tsol': { + case 'tsol': + case 'sui': + case 'tsui': { const coinInstance = sdk.coin(coin) as | Ada | Tada | Dot | Tdot | Sol - | Tsol; + | Tsol + | Sui + | Tsui; return coinInstance.createBroadcastableSweepTransaction(parameters); } default: diff --git a/electron/preload/index.ts b/electron/preload/index.ts index 9c7c05ab..46aa6ae0 100644 --- a/electron/preload/index.ts +++ b/electron/preload/index.ts @@ -28,6 +28,7 @@ import { createAdaBroadcastableSweepTransactionParameters, createDotBroadcastableSweepTransactionParameters, createSolBroadcastableSweepTransactionParameters, + createSuiBroadcastableSweepTransactionParameters, DotRecoverConsolidationRecoveryBatch, DotRecoveryConsolidationRecoveryOptions, SolRecoverConsolidationRecoveryBatch, @@ -47,6 +48,7 @@ type Commands = { | createAdaBroadcastableSweepTransactionParameters | createDotBroadcastableSweepTransactionParameters | createSolBroadcastableSweepTransactionParameters + | createSuiBroadcastableSweepTransactionParameters ): Promise; unlock(otp: string); sweepV1(coin: string, parameters: V1SweepParams): ReturnType; diff --git a/electron/types.ts b/electron/types.ts index 542b317f..af9e0415 100644 --- a/electron/types.ts +++ b/electron/types.ts @@ -18,6 +18,9 @@ export type createDotBroadcastableSweepTransactionParameters = export type createSolBroadcastableSweepTransactionParameters = | Parameters[0] | Parameters[0]; +export type createSuiBroadcastableSweepTransactionParameters = + | Parameters[0] + | Parameters[0]; export type BroadcastableSweepTransaction = Awaited< ReturnType< @@ -27,6 +30,8 @@ export type BroadcastableSweepTransaction = Awaited< | Tdot['createBroadcastableSweepTransaction'] | Sol['createBroadcastableSweepTransaction'] | Tsol['createBroadcastableSweepTransaction'] + | Sui['createBroadcastableSweepTransaction'] + | Tsui['createBroadcastableSweepTransaction'] > >; diff --git a/package-lock.json b/package-lock.json index 390f8bdc..d8ba8a8a 100644 --- a/package-lock.json +++ b/package-lock.json @@ -9,7 +9,7 @@ "version": "0.0.0-placeholder-version", "license": "Apache-2.0", "dependencies": { - "@bitgo-beta/sdk-coin-sui": "^1.4.1-alpha.158", + "@bitgo-beta/sdk-coin-sui": "^1.4.1-alpha.163", "@bitgo/abstract-cosmos": "10.0.24", "@bitgo/abstract-utxo": "8.9.0", "@bitgo/sdk-api": "1.50.0", @@ -2198,18 +2198,18 @@ "dev": true }, "node_modules/@bitgo-beta/blake2b": { - "version": "3.2.1-alpha.159", - "resolved": "https://registry.npmjs.org/@bitgo-beta/blake2b/-/blake2b-3.2.1-alpha.159.tgz", - "integrity": "sha512-Na2sNJnS2uxRbcRYZmbBqjF/YByylTfkkQb7YwCcNyRb5HUmv82XbP9wMglYgNpau5bDqZqDHbMUHtNiTUt/4g==", + "version": "3.2.1-alpha.164", + "resolved": "https://registry.npmjs.org/@bitgo-beta/blake2b/-/blake2b-3.2.1-alpha.164.tgz", + "integrity": "sha512-RgcEP7n+eIBaQkZeRxGkLOEJHHzWiMoeu2ztB6aQULvJfpsFEzVzHAgEisF+j5OJ/FcPDCLFXxc7E3fwvfPH9w==", "dependencies": { - "@bitgo-beta/blake2b-wasm": "3.2.1-alpha.160", + "@bitgo-beta/blake2b-wasm": "3.2.1-alpha.165", "nanoassert": "^2.0.0" } }, "node_modules/@bitgo-beta/blake2b-wasm": { - "version": "3.2.1-alpha.160", - "resolved": "https://registry.npmjs.org/@bitgo-beta/blake2b-wasm/-/blake2b-wasm-3.2.1-alpha.160.tgz", - "integrity": "sha512-6XiYErmM7s6yzRj4eAE87rTKGSMnuryRySiuBbvdUG0zMsQ9DJN54/cb3I7bINS9cUf6siMnav0rOkuzq6MrFQ==", + "version": "3.2.1-alpha.165", + "resolved": "https://registry.npmjs.org/@bitgo-beta/blake2b-wasm/-/blake2b-wasm-3.2.1-alpha.165.tgz", + "integrity": "sha512-8/FVFB9fnQ0k7juQdpU2tHWnltlV0/ooOx2xB08rJRJEAUXDs9KiSHuBkTy1qL6awoyJQ9WF2NIw4pd7cpy9HA==", "dependencies": { "nanoassert": "^1.0.0" } @@ -2220,22 +2220,22 @@ "integrity": "sha512-C40jQ3NzfkP53NsO8kEOFd79p4b9kDXQMwgiY1z8ZwrDZgUyom0AHwGegF4Dm99L+YoYhuaB0ceerUcXmqr1rQ==" }, "node_modules/@bitgo-beta/bls-dkg": { - "version": "1.3.1-alpha.160", - "resolved": "https://registry.npmjs.org/@bitgo-beta/bls-dkg/-/bls-dkg-1.3.1-alpha.160.tgz", - "integrity": "sha512-R8ZMw0gcZioK7CxnVh4OrCJXgKPG+C5oMQQCYl8yZYN8on31u2/JFu9QBfsjKCpdiOC7HW5cFWZaGBo8Nv1mYg==", + "version": "1.3.1-alpha.165", + "resolved": "https://registry.npmjs.org/@bitgo-beta/bls-dkg/-/bls-dkg-1.3.1-alpha.165.tgz", + "integrity": "sha512-qOB6wpElm7XX+tAyudQ0I8rNtyGDtj1ZJTOil2HuKWIowUNWTeLqj+PV5xDAW8jPpMgcl/KVpOoNP46hEGZmUA==", "dependencies": { "noble-bls12-381": "^0.7.2" } }, "node_modules/@bitgo-beta/sdk-coin-sui": { - "version": "1.4.1-alpha.158", - "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-coin-sui/-/sdk-coin-sui-1.4.1-alpha.158.tgz", - "integrity": "sha512-Y58bds2RM5PawcV0tVkf41LRt/OZX/eZCvxkJ84oGbaPuevwUYKxao/wz3vj3NHDNTnowZSAzhi9JMlW4DGtnQ==", - "dependencies": { - "@bitgo-beta/blake2b": "3.2.1-alpha.159", - "@bitgo-beta/sdk-core": "2.4.1-alpha.159", - "@bitgo-beta/sdk-lib-mpc": "8.2.1-alpha.114", - "@bitgo-beta/statics": "10.0.1-alpha.159", + "version": "1.4.1-alpha.163", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-coin-sui/-/sdk-coin-sui-1.4.1-alpha.163.tgz", + "integrity": "sha512-CyoX0uI+u4Sbk8+HKy4ng6jhRM2XOr0eTwmW5p7iTz8TH+6LRQ07/N6yxE9BYhooiJh4vc6zk8A8y7LYcJzlzw==", + "dependencies": { + "@bitgo-beta/blake2b": "3.2.1-alpha.164", + "@bitgo-beta/sdk-core": "2.4.1-alpha.164", + "@bitgo-beta/sdk-lib-mpc": "8.2.1-alpha.119", + "@bitgo-beta/statics": "10.0.1-alpha.164", "@mysten/bcs": "^0.7.0", "bignumber.js": "^9.0.0", "bs58": "^4.0.1", @@ -2351,16 +2351,16 @@ } }, "node_modules/@bitgo-beta/sdk-core": { - "version": "2.4.1-alpha.159", - "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-core/-/sdk-core-2.4.1-alpha.159.tgz", - "integrity": "sha512-2VUiojHWJGWXcHM2xv5voCOhGPIDHNAy2Z81u2t1eXFrh1mV/Fd6qewtUElr56s3zLmpWwCgmUoCXs7EDo4FxQ==", - "dependencies": { - "@bitgo-beta/bls-dkg": "1.3.1-alpha.160", - "@bitgo-beta/sdk-lib-mpc": "8.2.1-alpha.114", - "@bitgo-beta/sjcl": "1.0.1-alpha.108", - "@bitgo-beta/statics": "10.0.1-alpha.159", - "@bitgo-beta/utxo-lib": "4.0.1-alpha.159", - "@bitgo/public-types": "2.25.1", + "version": "2.4.1-alpha.164", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-core/-/sdk-core-2.4.1-alpha.164.tgz", + "integrity": "sha512-109OYskmNpkEllDhTG6CBLLcFVNuId7cSnY8NCdIniDfzvn3OwUyGVLRnuG8Uj3IADRcZ1Ov45QKpp9gNH/0fA==", + "dependencies": { + "@bitgo-beta/bls-dkg": "1.3.1-alpha.165", + "@bitgo-beta/sdk-lib-mpc": "8.2.1-alpha.119", + "@bitgo-beta/sjcl": "1.0.1-alpha.113", + "@bitgo-beta/statics": "10.0.1-alpha.164", + "@bitgo-beta/utxo-lib": "4.0.1-alpha.164", + "@bitgo/public-types": "2.33.3", "@noble/secp256k1": "1.6.3", "@stablelib/hex": "^1.0.0", "@types/elliptic": "^6.4.12", @@ -2392,6 +2392,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", "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", @@ -2400,6 +2413,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", "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.3.tgz", @@ -2439,9 +2457,9 @@ "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" }, "node_modules/@bitgo-beta/sdk-lib-mpc": { - "version": "8.2.1-alpha.114", - "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-lib-mpc/-/sdk-lib-mpc-8.2.1-alpha.114.tgz", - "integrity": "sha512-2X9i+UAyd/Aug5BMzKhZTquRXEyTzFlEC1eoysQ1p/VL6qZmjMLmlzzwg5Aavy/LbBA4tjwW/AcYTgiWFC41IQ==", + "version": "8.2.1-alpha.119", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-lib-mpc/-/sdk-lib-mpc-8.2.1-alpha.119.tgz", + "integrity": "sha512-TcDfa0BV2V/Nujyme49u8O733s9LfFxKzTaxIS0AVGQyYAMC7r3vTTpGoqlh4MPLPQCEZRZMu3hrKkw3N3LQOw==", "dependencies": { "@noble/curves": "1.4.0", "@silencelaboratories/dkls-wasm-ll-node": "1.1.2", @@ -2514,21 +2532,21 @@ } }, "node_modules/@bitgo-beta/sjcl": { - "version": "1.0.1-alpha.108", - "resolved": "https://registry.npmjs.org/@bitgo-beta/sjcl/-/sjcl-1.0.1-alpha.108.tgz", - "integrity": "sha512-n3Q0qVurbvmm3BUJR685rkLU6hsSZgbmGW8WWR/qVaXmraMtsjU2fWOseCIz7nXEyWSGM3YSVGEYIVOwflwXrg==" + "version": "1.0.1-alpha.113", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sjcl/-/sjcl-1.0.1-alpha.113.tgz", + "integrity": "sha512-E0YwInb2HTbTOMcaiY68INSN0jwdXEA5c/j51S/IcH2HemGKjD6wneX94MIw2NQV1/P/ceWBtAW0QJJhRMg+lA==" }, "node_modules/@bitgo-beta/statics": { - "version": "10.0.1-alpha.159", - "resolved": "https://registry.npmjs.org/@bitgo-beta/statics/-/statics-10.0.1-alpha.159.tgz", - "integrity": "sha512-ga/1o6JKzAPHktBjJg75SvhP8xsZR6l2r9+YckmeS+NYC05Ntt0XrEjtE/vOO/xTh4L7f4qw9paSS5dnLMmgWw==" + "version": "10.0.1-alpha.164", + "resolved": "https://registry.npmjs.org/@bitgo-beta/statics/-/statics-10.0.1-alpha.164.tgz", + "integrity": "sha512-VtMtYhy6soiq3bUrepi6iIcFVkbJ7ZW5V/07HsuR53FLxsBuEmCnY6PY/HVpXXRdajLGszxgx7FIQXUkyN65lg==" }, "node_modules/@bitgo-beta/utxo-lib": { - "version": "4.0.1-alpha.159", - "resolved": "https://registry.npmjs.org/@bitgo-beta/utxo-lib/-/utxo-lib-4.0.1-alpha.159.tgz", - "integrity": "sha512-z4rR6cEb0CmCT5caFKpvk3B/bzXXBE7fOkILTW9Z6ayre7XBh9f1pBP6tU/ZnPyU4aaVn6kDTyKWG3wkFRLkUw==", + "version": "4.0.1-alpha.164", + "resolved": "https://registry.npmjs.org/@bitgo-beta/utxo-lib/-/utxo-lib-4.0.1-alpha.164.tgz", + "integrity": "sha512-RsWfMCv3T+/PxmRRJNL+xuc2SO73poUAKo8QpBr/KSwXVp7dPfWv5gRF+GroItWlLf0BoxzDjGI4rgSOqprknA==", "dependencies": { - "@bitgo-beta/blake2b": "3.2.1-alpha.159", + "@bitgo-beta/blake2b": "3.2.1-alpha.164", "@brandonblack/musig": "^0.0.1-alpha.0", "@noble/secp256k1": "1.6.3", "bech32": "^2.0.0", diff --git a/package.json b/package.json index b359b02a..cad5450a 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ } }, "dependencies": { - "@bitgo-beta/sdk-coin-sui": "^1.4.1-alpha.158", + "@bitgo-beta/sdk-coin-sui": "^1.4.1-alpha.163", "@bitgo/abstract-cosmos": "10.0.24", "@bitgo/abstract-utxo": "8.9.0", "@bitgo/sdk-api": "1.50.0", diff --git a/src/containers/CreateBroadcastableTransaction/CreateBroadcastableTransactionIndex.tsx b/src/containers/CreateBroadcastableTransaction/CreateBroadcastableTransactionIndex.tsx index 989373fa..49ef8060 100644 --- a/src/containers/CreateBroadcastableTransaction/CreateBroadcastableTransactionIndex.tsx +++ b/src/containers/CreateBroadcastableTransaction/CreateBroadcastableTransactionIndex.tsx @@ -8,6 +8,7 @@ import type { createAdaBroadcastableSweepTransactionParameters, createDotBroadcastableSweepTransactionParameters, createSolBroadcastableSweepTransactionParameters, + createSuiBroadcastableSweepTransactionParameters, } from '~/utils/types'; import { assert, safeEnv } from '~/helpers'; import { useAlertBanner } from '~/contexts'; @@ -31,11 +32,13 @@ function isSignedTransaction( ): json is | createAdaBroadcastableSweepTransactionParameters | createDotBroadcastableSweepTransactionParameters - | createSolBroadcastableSweepTransactionParameters { + | createSolBroadcastableSweepTransactionParameters + | createSuiBroadcastableSweepTransactionParameters { const signedTransaction = json as | createAdaBroadcastableSweepTransactionParameters | createDotBroadcastableSweepTransactionParameters - | createSolBroadcastableSweepTransactionParameters; + | createSolBroadcastableSweepTransactionParameters + | createSuiBroadcastableSweepTransactionParameters; return ( signedTransaction && signedTransaction.signatureShares !== undefined && @@ -64,7 +67,8 @@ export function CreateBroadcastableTransactionIndex() { const tx = JSON.parse(event.target?.result as string) as | createAdaBroadcastableSweepTransactionParameters | createDotBroadcastableSweepTransactionParameters - | createSolBroadcastableSweepTransactionParameters; + | createSolBroadcastableSweepTransactionParameters + | createSuiBroadcastableSweepTransactionParameters; assert(isSignedTransaction(tx), 'Signed transaction not found'); diff --git a/src/preload.d.ts b/src/preload.d.ts index c4e9b2bf..050eeb31 100644 --- a/src/preload.d.ts +++ b/src/preload.d.ts @@ -23,6 +23,7 @@ import { createAdaBroadcastableSweepTransactionParameters, createDotBroadcastableSweepTransactionParameters, createSolBroadcastableSweepTransactionParameters, + createSuiBroadcastableSweepTransactionParameters, DotRecoverConsolidationRecoveryBatch, DotRecoveryConsolidationRecoveryOptions, SolRecoverConsolidationRecoveryBatch, @@ -44,6 +45,7 @@ type Commands = { | createAdaBroadcastableSweepTransactionParameters | createDotBroadcastableSweepTransactionParameters | createSolBroadcastableSweepTransactionParameters + | createSuiBroadcastableSweepTransactionParameters ): Promise; unlock(otp: string); sweepV1(coin: string, parameters); diff --git a/src/utils/types.ts b/src/utils/types.ts index 910a5953..0116eb4f 100644 --- a/src/utils/types.ts +++ b/src/utils/types.ts @@ -18,6 +18,9 @@ export type createDotBroadcastableSweepTransactionParameters = export type createSolBroadcastableSweepTransactionParameters = | Parameters[0] | Parameters[0]; +export type createSuiBroadcastableSweepTransactionParameters = + | Parameters[0] + | Parameters[0]; export type BroadcastableSweepTransaction = Awaited< ReturnType< @@ -27,6 +30,8 @@ export type BroadcastableSweepTransaction = Awaited< | Tdot['createBroadcastableSweepTransaction'] | Sol['createBroadcastableSweepTransaction'] | Tsol['createBroadcastableSweepTransaction'] + | Sui['createBroadcastableSweepTransaction'] + | Tsui['createBroadcastableSweepTransaction'] > >;