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..02ff9590 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.160", "@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.161", + "resolved": "https://registry.npmjs.org/@bitgo-beta/blake2b/-/blake2b-3.2.1-alpha.161.tgz", + "integrity": "sha512-fM8/1e0ewOTH7CwEAvlZbeiAR9Sq1ObD1yySQ7iB7Zrp5j3YICfIQwG4PP5Fo83w3mguntnLas/l/uz5GL68kA==", "dependencies": { - "@bitgo-beta/blake2b-wasm": "3.2.1-alpha.160", + "@bitgo-beta/blake2b-wasm": "3.2.1-alpha.162", "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.162", + "resolved": "https://registry.npmjs.org/@bitgo-beta/blake2b-wasm/-/blake2b-wasm-3.2.1-alpha.162.tgz", + "integrity": "sha512-PepaM798DARnuDYuUzpmz2KpnIW0QwJNvIiNyxIr8CU99b1S4jXQM/Vqc9dzCwp0j4vh/UmS6gqj3fcBL89xpA==", "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.162", + "resolved": "https://registry.npmjs.org/@bitgo-beta/bls-dkg/-/bls-dkg-1.3.1-alpha.162.tgz", + "integrity": "sha512-9X9L0Btry3sjPSrdMtzv4YC2VijvkK8C8ER7HTkragIF0iZf/xDyywAjwPmkDlKov66kYPEctIsYqFCiBh2Bmw==", "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.160", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-coin-sui/-/sdk-coin-sui-1.4.1-alpha.160.tgz", + "integrity": "sha512-lmFDZ0J9iG7XN0qnfB/gxb3tzEBh5uiPjE201q7udILDiQS47zDH0TjOVmgNKefIhX5qHgA5WbPNdyYirBFhMw==", + "dependencies": { + "@bitgo-beta/blake2b": "3.2.1-alpha.161", + "@bitgo-beta/sdk-core": "2.4.1-alpha.161", + "@bitgo-beta/sdk-lib-mpc": "8.2.1-alpha.116", + "@bitgo-beta/statics": "10.0.1-alpha.161", "@mysten/bcs": "^0.7.0", "bignumber.js": "^9.0.0", "bs58": "^4.0.1", @@ -2351,15 +2351,15 @@ } }, "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", + "version": "2.4.1-alpha.161", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-core/-/sdk-core-2.4.1-alpha.161.tgz", + "integrity": "sha512-53xPhQno6Xn7d44UEeru+yFhaGR+HHeXxg0gInYISJjaku3k/vyXCCIoV1njxZBwhDWR2FJ/nFrC+Hd/Xk/X/A==", + "dependencies": { + "@bitgo-beta/bls-dkg": "1.3.1-alpha.162", + "@bitgo-beta/sdk-lib-mpc": "8.2.1-alpha.116", + "@bitgo-beta/sjcl": "1.0.1-alpha.110", + "@bitgo-beta/statics": "10.0.1-alpha.161", + "@bitgo-beta/utxo-lib": "4.0.1-alpha.161", "@bitgo/public-types": "2.25.1", "@noble/secp256k1": "1.6.3", "@stablelib/hex": "^1.0.0", @@ -2439,9 +2439,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.116", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sdk-lib-mpc/-/sdk-lib-mpc-8.2.1-alpha.116.tgz", + "integrity": "sha512-dvwPthiIoQPk/tMT/TZ8ow6o8RGE9HBLSUOipaWfma8EGPKlEiOIHqnmsqGGCdvzj2I/E4nltyVNtFOuhcPEAg==", "dependencies": { "@noble/curves": "1.4.0", "@silencelaboratories/dkls-wasm-ll-node": "1.1.2", @@ -2514,21 +2514,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.110", + "resolved": "https://registry.npmjs.org/@bitgo-beta/sjcl/-/sjcl-1.0.1-alpha.110.tgz", + "integrity": "sha512-10MZkWK6nGRSggVYwyVgpgVw104zAwSQ5HolbP3uWKyj+yUmZ2nEXGBhAbF1Gp0OpmSC4T4n4qqzDtltIkT9Fw==" }, "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.161", + "resolved": "https://registry.npmjs.org/@bitgo-beta/statics/-/statics-10.0.1-alpha.161.tgz", + "integrity": "sha512-aL3Bwt4YLVcr6YGEazEdkGl+s/iiXA+FyJrUNtqxJ7kYHmLwyNr+C/sFLxbTUdvt+bAAUZm2QiXxSwQMIY9CoA==" }, "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.161", + "resolved": "https://registry.npmjs.org/@bitgo-beta/utxo-lib/-/utxo-lib-4.0.1-alpha.161.tgz", + "integrity": "sha512-m4Ef9HekFA4jJ3V1LTAmLskBWATUDPXIXsuO1/7CRcSXOudqLwstsbfT7/jFk/yr7n+XZlK8BtWRDg3W7ALcBA==", "dependencies": { - "@bitgo-beta/blake2b": "3.2.1-alpha.159", + "@bitgo-beta/blake2b": "3.2.1-alpha.161", "@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..34d231a3 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.160", "@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'] > >;