Skip to content

Commit 010d830

Browse files
authored
Merge pull request #52 from dotbitHQ/fix/update-dependencies
fix: update dependencies.
2 parents 211b5f3 + ed9202e commit 010d830

File tree

5 files changed

+15
-8271
lines changed

5 files changed

+15
-8271
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ package/
55
lib/
66
lib.esm/
77
example/browser/dist/
8-
*.tgz
8+
*.tgz
9+
pnpm-lock.yaml

packages/plugin-register/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dotbit/plugin-register",
3-
"version": "0.0.2",
3+
"version": "0.0.3",
44
"main": "lib/index.js",
55
"module": "lib.esm/index.js",
66
"types": "lib/index.d.ts",
@@ -18,8 +18,8 @@
1818
},
1919
"license": "MIT",
2020
"dependencies": {
21-
"@gnosis.pm/safe-core-sdk": "^2.1.0",
22-
"@gnosis.pm/safe-ethers-lib": "^1.1.0",
21+
"@safe-global/protocol-kit": "^0.1.1",
22+
"@safe-global/safe-ethers-lib": "^1.9.2",
2323
"ethers": "^5.7.2"
2424
}
2525
}

packages/plugin-register/src/index.ts

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ import {
1616
RenewRes,
1717
isSubAccount
1818
} from 'dotbit'
19-
import EthersAdapter from '@gnosis.pm/safe-ethers-lib'
20-
import GnosisSDK, { EthSignSignature } from '@gnosis.pm/safe-core-sdk'
19+
import EthersAdapter from '@safe-global/safe-ethers-lib'
20+
import Safe from '@safe-global/protocol-kit'
21+
import SafeSignature from '@safe-global/protocol-kit/dist/src/utils/signatures/SafeSignature'
2122
import EthNftGnosisAbi from './EthNftGnosisAbi.json'
2223
import EthNftAbi from './EthNftAbi.json'
2324
import { ethers } from 'ethers'
@@ -161,27 +162,27 @@ export class BitPluginRegister implements BitPluginBase {
161162
const gnosisContract = new ethers.Contract(CrossEthGnosisAddress, EthNftGnosisAbi, this.signer.signer)
162163
const nonce = (await gnosisContract.uuidNonces(accountIdHex(account))).toNumber()
163164

164-
const gnosisSdk = await GnosisSDK.create({
165+
const safeSdk = await Safe.create({
165166
ethAdapter,
166167
safeAddress: CrossEthGnosisAddress
167168
})
168169

169-
const transaction = {
170+
const safeTransactionData = {
170171
to: CrossEthContract,
171172
value: '0',
172173
nonce,
173174
data
174175
}
175176

176-
const tx = await gnosisSdk.createTransaction(transaction)
177+
const safeTransaction = await safeSdk.createTransaction({ safeTransactionData })
177178

178179
signatures.forEach((signature) => {
179-
tx.addSignature(new EthSignSignature(signature.signer, signature.data))
180+
safeTransaction.addSignature(new SafeSignature(signature.signer, signature.data))
180181
})
181182

182-
gnosisSdk.getOwnersWhoApprovedTx = () => Promise.resolve([]) // We ignore sdk's some internal logic for now.
183+
safeSdk.getOwnersWhoApprovedTx = () => Promise.resolve([]) // We ignore sdk's some internal logic for now.
183184

184-
const { hash: txHash } = await gnosisSdk.executeTransaction(tx)
185+
const { hash: txHash } = await safeSdk.executeTransaction(safeTransaction)
185186

186187
await this.bitBuilder.crossChainReturnTrxHashToService({
187188
account,
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
11
// Generated by genversion.
2-
export const version = '0.0.2'
2+
export const version = '0.0.3'

0 commit comments

Comments
 (0)