Skip to content

Commit

Permalink
fix: update dependencies.
Browse files Browse the repository at this point in the history
  • Loading branch information
web3max committed Apr 17, 2023
1 parent 211b5f3 commit ed9202e
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 8,271 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,5 @@ package/
lib/
lib.esm/
example/browser/dist/
*.tgz
*.tgz
pnpm-lock.yaml
6 changes: 3 additions & 3 deletions packages/plugin-register/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@dotbit/plugin-register",
"version": "0.0.2",
"version": "0.0.3",
"main": "lib/index.js",
"module": "lib.esm/index.js",
"types": "lib/index.d.ts",
Expand All @@ -18,8 +18,8 @@
},
"license": "MIT",
"dependencies": {
"@gnosis.pm/safe-core-sdk": "^2.1.0",
"@gnosis.pm/safe-ethers-lib": "^1.1.0",
"@safe-global/protocol-kit": "^0.1.1",
"@safe-global/safe-ethers-lib": "^1.9.2",
"ethers": "^5.7.2"
}
}
17 changes: 9 additions & 8 deletions packages/plugin-register/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ import {
RenewRes,
isSubAccount
} from 'dotbit'
import EthersAdapter from '@gnosis.pm/safe-ethers-lib'
import GnosisSDK, { EthSignSignature } from '@gnosis.pm/safe-core-sdk'
import EthersAdapter from '@safe-global/safe-ethers-lib'
import Safe from '@safe-global/protocol-kit'
import SafeSignature from '@safe-global/protocol-kit/dist/src/utils/signatures/SafeSignature'
import EthNftGnosisAbi from './EthNftGnosisAbi.json'
import EthNftAbi from './EthNftAbi.json'
import { ethers } from 'ethers'
Expand Down Expand Up @@ -161,27 +162,27 @@ export class BitPluginRegister implements BitPluginBase {
const gnosisContract = new ethers.Contract(CrossEthGnosisAddress, EthNftGnosisAbi, this.signer.signer)
const nonce = (await gnosisContract.uuidNonces(accountIdHex(account))).toNumber()

const gnosisSdk = await GnosisSDK.create({
const safeSdk = await Safe.create({
ethAdapter,
safeAddress: CrossEthGnosisAddress
})

const transaction = {
const safeTransactionData = {
to: CrossEthContract,
value: '0',
nonce,
data
}

const tx = await gnosisSdk.createTransaction(transaction)
const safeTransaction = await safeSdk.createTransaction({ safeTransactionData })

signatures.forEach((signature) => {
tx.addSignature(new EthSignSignature(signature.signer, signature.data))
safeTransaction.addSignature(new SafeSignature(signature.signer, signature.data))
})

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

const { hash: txHash } = await gnosisSdk.executeTransaction(tx)
const { hash: txHash } = await safeSdk.executeTransaction(safeTransaction)

await this.bitBuilder.crossChainReturnTrxHashToService({
account,
Expand Down
2 changes: 1 addition & 1 deletion packages/plugin-register/src/version.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
// Generated by genversion.
export const version = '0.0.2'
export const version = '0.0.3'
Loading

0 comments on commit ed9202e

Please sign in to comment.