Skip to content

Commit

Permalink
refactor: upgrade spore sdk (#3007)
Browse files Browse the repository at this point in the history
  • Loading branch information
homura authored Jan 12, 2024
1 parent d4488a1 commit b823770
Show file tree
Hide file tree
Showing 4 changed files with 39 additions and 151 deletions.
2 changes: 1 addition & 1 deletion packages/neuron-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
"@ckb-lumos/rpc": "0.21.1",
"@iarna/toml": "2.2.5",
"@ledgerhq/hw-transport-node-hid": "6.27.22",
"@spore-sdk/core": "0.1.0-beta.9",
"@spore-sdk/core": "0.1.0-beta.14",
"archiver": "6.0.1",
"async": "3.2.5",
"bn.js": "4.12.0",
Expand Down
7 changes: 2 additions & 5 deletions packages/neuron-wallet/src/services/cells.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import MultisigConfigModel from '../models/multisig-config'
import MultisigOutput from '../database/chain/entities/multisig-output'
import { bytes } from '@ckb-lumos/codec'
import { generateRPC } from '../utils/ckb-rpc'
import { getClusterCellById, SporeData, unpackToRawClusterData } from '@spore-sdk/core'
import { getClusterById, SporeData, unpackToRawClusterData } from '@spore-sdk/core'
import NetworksService from './networks'
import { LOCKTIME_ARGS_LENGTH, MIN_CELL_CAPACITY } from '../utils/const'
import HdPublicKeyInfo from '../database/chain/entities/hd-public-key-info'
Expand Down Expand Up @@ -383,10 +383,7 @@ export default class CellsService {
return
}

const clusterCell = await getClusterCellById(
clusterId,
assetAccountInfo.getSporeConfig(currentNetwork.remote)
)
const clusterCell = await getClusterById(clusterId, assetAccountInfo.getSporeConfig(currentNetwork.remote))
const { name, description } = unpackToRawClusterData(clusterCell.data)
clusterInfos[clusterId] = { name, description }
} catch {
Expand Down
4 changes: 2 additions & 2 deletions packages/neuron-wallet/src/services/transaction-sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ import NetworksService from './networks'
import { generateRPC } from '../utils/ckb-rpc'
import CellsService from './cells'
import hd from '@ckb-lumos/hd'
import { getClusterCellByOutPoint } from '@spore-sdk/core'
import { getClusterByOutPoint } from '@spore-sdk/core'
import CellDep, { DepType } from '../models/chain/cell-dep'
import { dao } from '@ckb-lumos/common-scripts'

Expand Down Expand Up @@ -606,7 +606,7 @@ export default class TransactionSender {

// https://github.com/sporeprotocol/spore-sdk/blob/05f2cbe1c03d03e334ebd3b440b5b3b20ec67da7/packages/core/src/api/joints/spore.ts#L154-L158
const clusterDep = await (async () => {
const clusterCell = await getClusterCellByOutPoint(outPoint, assetAccountInfo.getSporeConfig(rpcUrl)).then(
const clusterCell = await getClusterByOutPoint(outPoint, assetAccountInfo.getSporeConfig(rpcUrl)).then(
_ => _,
() => undefined
)
Expand Down
177 changes: 34 additions & 143 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2110,21 +2110,7 @@
resolved "https://registry.yarnpkg.com/@bcoe/v8-coverage/-/v8-coverage-0.2.3.tgz#75a2e8b51cb758a7553d6804a5932d7aace75c39"
integrity sha512-0hYQ8SB4Db5zvZB4axdMHGwEaQjkZzFjQiN9LVYvIFB2nSUHW9tYpxWriPrWDASIxiaXax83REcLxuSdnGPZtw==

"@ckb-lumos/[email protected]", "@ckb-lumos/base@^0.20.0":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/base/-/base-0.20.0.tgz#d18164ec60eae3f3a97a4bc48e1399e6e0c190d9"
integrity sha512-Zz4+iO7d7dJBMtn/7icD9uuld2fBUGI+RqoBumXW8mem3xDw41Vb4vL0knxVdOFF1EkuSX5yZ796f83h8Q/6zw==
dependencies:
"@ckb-lumos/bi" "0.20.0"
"@ckb-lumos/codec" "0.20.0"
"@ckb-lumos/toolkit" "0.20.0"
"@types/blake2b" "^2.1.0"
"@types/lodash.isequal" "^4.5.5"
blake2b "^2.1.3"
js-xxhash "^1.0.4"
lodash.isequal "^4.5.0"

"@ckb-lumos/[email protected]":
"@ckb-lumos/[email protected]", "@ckb-lumos/base@^0.21.0-next.0":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/base/-/base-0.21.1.tgz#1faf7909b5a68a124256d937cfb0fa03bb6b5457"
integrity sha512-7O+jBl7pqMsRbYTMNnbpamgaQzvaLZq+ftMtnKZ3A+Zbs6hZcGbz/6nfbRZnyJitPXQHRPT5KAQz6g+TiYqJGg==
Expand All @@ -2138,32 +2124,13 @@
js-xxhash "^1.0.4"
lodash.isequal "^4.5.0"

"@ckb-lumos/[email protected]", "@ckb-lumos/bi@^0.20.0":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/bi/-/bi-0.20.0.tgz#4fa3beca641737b7b83a64d56668067e38cc288d"
integrity sha512-cJtv1NnvC11oQbDC8f3jIGTYdyEs2m8GvSrZgGL5KjBoaHTWghH8v6Z2XkwFgHmmCwfX5KrdXekrsOWrcIXyqw==
dependencies:
jsbi "^4.1.0"

"@ckb-lumos/[email protected]":
"@ckb-lumos/[email protected]", "@ckb-lumos/bi@^0.21.0-next.0":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/bi/-/bi-0.21.1.tgz#dfaa0968a9ffd990c1c4fcfc0711f20f09eb0485"
integrity sha512-6q8uesvu3DAM7GReei9H5seino4tnakTeg8uXtZBPDC6rboMohLCPQvEwhl1iHmsybXvBYVQt4Te1BPPZtuaRw==
dependencies:
jsbi "^4.1.0"

"@ckb-lumos/[email protected]":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/ckb-indexer/-/ckb-indexer-0.20.0.tgz#c6792821e3b903f998a891b14892ff67229d3957"
integrity sha512-bw5HiuAleTa9D4l3xW+0+kYh49CH3bjRNPHxv/ySVy1TxTAYEJA6qjcIOE81T8U6qSnUxY1KKiAjk2bO+mo05w==
dependencies:
"@ckb-lumos/base" "0.20.0"
"@ckb-lumos/bi" "0.20.0"
"@ckb-lumos/rpc" "0.20.0"
"@ckb-lumos/toolkit" "0.20.0"
cross-fetch "^3.1.5"
events "^3.3.0"

"@ckb-lumos/[email protected]":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/ckb-indexer/-/ckb-indexer-0.21.1.tgz#a0e0ac3261c98181dc8c72e9e726030bb210779d"
Expand All @@ -2177,35 +2144,14 @@
cross-fetch "^3.1.5"
events "^3.3.0"

"@ckb-lumos/[email protected]", "@ckb-lumos/codec@^0.20.0":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/codec/-/codec-0.20.0.tgz#bb07707c5976b3b706b78f253e680cdc431ca898"
integrity sha512-NHBPIaiNYz5yX0RGSM0Qz1effLnVTt0wJHPfLVAkuzNRBg5/xRZySjYOemOsogbX1t4s3Yk7N0Q17tr02AUh3A==
dependencies:
"@ckb-lumos/bi" "0.20.0"

"@ckb-lumos/[email protected]":
"@ckb-lumos/[email protected]", "@ckb-lumos/codec@^0.21.0-next.0":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/codec/-/codec-0.21.1.tgz#160f21efa0cded6ea461eb6476f9af6010b682e0"
integrity sha512-z6IUUxVZrx663iC7VM9CmaQZL8jsdM3ybgz0UCS24JgBXTNec+Uz0/Zrl7yeH6fBpVls44C2wObcHKigKaNVAA==
dependencies:
"@ckb-lumos/bi" "0.21.1"

"@ckb-lumos/[email protected]":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/common-scripts/-/common-scripts-0.20.0.tgz#7f95fb91d3c275ff557197269225a15a634811b6"
integrity sha512-GSCayhyt+G0k9fNGK3bjVif2PDWbo47ovUEM0CiRuG0YrhvBYbuq69mpQ3nKezI1IKI3UZyYOax7SqhYBCJ5VQ==
dependencies:
"@ckb-lumos/base" "0.20.0"
"@ckb-lumos/bi" "0.20.0"
"@ckb-lumos/codec" "0.20.0"
"@ckb-lumos/config-manager" "0.20.0"
"@ckb-lumos/helpers" "0.20.0"
"@ckb-lumos/rpc" "0.20.0"
"@ckb-lumos/toolkit" "0.20.0"
immutable "^4.0.0-rc.12"

"@ckb-lumos/[email protected]":
"@ckb-lumos/[email protected]", "@ckb-lumos/common-scripts@^0.21.0-next.0":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/common-scripts/-/common-scripts-0.21.1.tgz#64776b5ce55d8c66898a3ab592c7f77fe13d865e"
integrity sha512-EfZQ9wdxPmEsxVVwtBjhpZVKbYCm1FJkMt59ABsIO1Ub7yi0qap7AQl0MMbuLwWIGKwS2w0U3wx/oJPm7z1RXg==
Expand All @@ -2219,18 +2165,7 @@
"@ckb-lumos/toolkit" "0.21.1"
immutable "^4.3.0"

"@ckb-lumos/[email protected]", "@ckb-lumos/config-manager@^0.20.0":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/config-manager/-/config-manager-0.20.0.tgz#f24946971005f62df62e22c3306947b5e820c181"
integrity sha512-YNhowInBGuOVMRBuhDWznhcB+83vLzYSL6HAlGCBbm2yT7lDmIrrVWh731hISmuaXeMt4IFupLfGXxpelB6zCA==
dependencies:
"@ckb-lumos/base" "0.20.0"
"@ckb-lumos/bi" "0.20.0"
"@ckb-lumos/codec" "0.20.0"
"@types/deep-freeze-strict" "^1.1.0"
deep-freeze-strict "^1.1.1"

"@ckb-lumos/[email protected]":
"@ckb-lumos/[email protected]", "@ckb-lumos/config-manager@^0.21.0-next.0":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/config-manager/-/config-manager-0.21.1.tgz#857050ebf2ca38096d8fae26b6a8927164798ca3"
integrity sha512-BmrNqYyaksdCKHWagyC8+R8GUxhIO+sOM5S925jlkpjju2sUbH0Id2/zmdb7I9KxdKnbx3WsR+hqy7/bYqw1lA==
Expand All @@ -2241,19 +2176,6 @@
"@types/deep-freeze-strict" "^1.1.0"
deep-freeze-strict "^1.1.1"

"@ckb-lumos/[email protected]":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/hd/-/hd-0.20.0.tgz#4b51fb881313ca193a876ae93257f2d5a13df46c"
integrity sha512-vPzMFZwYpuOVEiQ8WeY6+TVGy0Hcdau7okbMX6mks87Kt1f8qEyW5uAP8xFWA0UmsOGucdJKirjRfSvsAPzbIw==
dependencies:
"@ckb-lumos/base" "0.20.0"
"@ckb-lumos/bi" "0.20.0"
bn.js "^5.1.3"
elliptic "^6.5.4"
scrypt-js "^3.0.1"
sha3 "^2.1.3"
uuid "^8.3.0"

"@ckb-lumos/[email protected]":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/hd/-/hd-0.21.1.tgz#406026ac2b570f72b4407149cb941d09bb8a0ab6"
Expand All @@ -2267,18 +2189,6 @@
sha3 "^2.1.3"
uuid "^8.3.0"

"@ckb-lumos/[email protected]":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/helpers/-/helpers-0.20.0.tgz#bc0555aeaba146ce90726ac87acad7e2200112c7"
integrity sha512-UWxiJSljZcN1zH6Blv5HyjNGgA9VSXyXFh8VSYD7W1xEeHYK05LP00rRWtEr8Z+KSfuuZ0ASg2sJofBDv/UZ9w==
dependencies:
"@ckb-lumos/base" "0.20.0"
"@ckb-lumos/bi" "0.20.0"
"@ckb-lumos/config-manager" "0.20.0"
"@ckb-lumos/toolkit" "0.20.0"
bech32 "^2.0.0"
immutable "^4.0.0-rc.12"

"@ckb-lumos/[email protected]":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/helpers/-/helpers-0.21.1.tgz#fffd455071f51556b2cd2539a255b3759893da08"
Expand All @@ -2292,33 +2202,22 @@
bech32 "^2.0.0"
immutable "^4.3.0"

"@ckb-lumos/lumos@^0.20.0":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/lumos/-/lumos-0.20.0.tgz#47cd173affa81051f8a8fa60c91c366001d82d6c"
integrity sha512-LIKf1tDNk0HkK3DQ+BV4dmj/B7nfkbVXlPbzqxwLRaqHTbAArXs8g3JXGfmjZIgpoU6sfXdArO1jVpGRN1xnYg==
dependencies:
"@ckb-lumos/base" "0.20.0"
"@ckb-lumos/bi" "0.20.0"
"@ckb-lumos/ckb-indexer" "0.20.0"
"@ckb-lumos/common-scripts" "0.20.0"
"@ckb-lumos/config-manager" "0.20.0"
"@ckb-lumos/hd" "0.20.0"
"@ckb-lumos/helpers" "0.20.0"
"@ckb-lumos/rpc" "0.20.0"
"@ckb-lumos/toolkit" "0.20.0"

"@ckb-lumos/[email protected]":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/rpc/-/rpc-0.20.0.tgz#7da342c6db0403ecf654c0281e004653c1220dc0"
integrity sha512-vAH/rXMnKYcyKVW8/vg5EvY9roW46FlDod/efLGN5FQyROn0O5Y9PTO/7bs4U1KyPeceHQpRW0ZAQ/KEHBWEzA==
dependencies:
"@ckb-lumos/base" "0.20.0"
"@ckb-lumos/bi" "0.20.0"
"@vespaiach/axios-fetch-adapter" "^0.3.1"
axios "0.27.2"
tslib "2.3.1"
"@ckb-lumos/lumos@^0.21.0-next.0":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/lumos/-/lumos-0.21.1.tgz#ff5a9a10859b305530026668bd14cdc12e5e7532"
integrity sha512-a5n8xaIUvmaPsw2fBki8Jamy6/6uQnLWDZM9SQX29cZ1YVoAk/slnBmEbCIGXmxDhcuAlLkTeJaiLDKEGrZ6pg==
dependencies:
"@ckb-lumos/base" "0.21.1"
"@ckb-lumos/bi" "0.21.1"
"@ckb-lumos/ckb-indexer" "0.21.1"
"@ckb-lumos/common-scripts" "0.21.1"
"@ckb-lumos/config-manager" "0.21.1"
"@ckb-lumos/hd" "0.21.1"
"@ckb-lumos/helpers" "0.21.1"
"@ckb-lumos/rpc" "0.21.1"
"@ckb-lumos/toolkit" "0.21.1"

"@ckb-lumos/[email protected]":
"@ckb-lumos/[email protected]", "@ckb-lumos/rpc@^0.21.0-next.0":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/rpc/-/rpc-0.21.1.tgz#f6a6b3ed6d76adfb84c148e4b4acadb7fbaa7d7a"
integrity sha512-gZWXYCyQ98s84Pb+buOiYL3HOIxQPLHQdCyo96GFerNw9lB1XsbaGWzfHPYpZvOQqYtnJ1GUfTkQkADrQ7hmew==
Expand All @@ -2328,11 +2227,6 @@
abort-controller "^3.0.0"
cross-fetch "^3.1.5"

"@ckb-lumos/[email protected]":
version "0.20.0"
resolved "https://registry.yarnpkg.com/@ckb-lumos/toolkit/-/toolkit-0.20.0.tgz#8f71043324e50c8a3e94c65414325482d874cfca"
integrity sha512-nLNXRPG20NqUdXwHAnKwr0T7nZyDrf4fGwIrsxo+7ffqWeg9wNEhZoqTBJLgxEpoe0I+WHRLwYLiwUbkkqR1SQ==

"@ckb-lumos/[email protected]":
version "0.21.1"
resolved "https://registry.yarnpkg.com/@ckb-lumos/toolkit/-/toolkit-0.21.1.tgz#bcf4bf05615375087e3dd02fb087b797a8c67f37"
Expand Down Expand Up @@ -4302,16 +4196,18 @@
dependencies:
"@sinonjs/commons" "^1.7.0"

"@spore-sdk/[email protected]":
version "0.1.0-beta.9"
resolved "https://registry.yarnpkg.com/@spore-sdk/core/-/core-0.1.0-beta.9.tgz#0ec68155367f72c5dcd40de7dcdbc12029a69e5d"
integrity sha512-Bku2Wrya1bFBAvBhWnzCnHMrZF1y4qWKES27dKYVOIZghBPK5WAYU2fDGWRCuU8YhueUOdqeUnkbVxc0mgyfuA==
dependencies:
"@ckb-lumos/base" "^0.20.0"
"@ckb-lumos/bi" "^0.20.0"
"@ckb-lumos/codec" "^0.20.0"
"@ckb-lumos/config-manager" "^0.20.0"
"@ckb-lumos/lumos" "^0.20.0"
"@spore-sdk/[email protected]":
version "0.1.0-beta.14"
resolved "https://registry.yarnpkg.com/@spore-sdk/core/-/core-0.1.0-beta.14.tgz#1b7823e27180f7031fd12f641bbabcf52f78b3e3"
integrity sha512-pwD20Ft134aTUzJ3xZDEGtSNqJfuO5CoUGKqIbd/o+oQp1a7UpwdNKiqYxUKUBWEBF/JyBPPD2qvoBID/PycRw==
dependencies:
"@ckb-lumos/base" "^0.21.0-next.0"
"@ckb-lumos/bi" "^0.21.0-next.0"
"@ckb-lumos/codec" "^0.21.0-next.0"
"@ckb-lumos/common-scripts" "^0.21.0-next.0"
"@ckb-lumos/config-manager" "^0.21.0-next.0"
"@ckb-lumos/lumos" "^0.21.0-next.0"
"@ckb-lumos/rpc" "^0.21.0-next.0"
lodash "^4.17.21"
whatwg-mimetype "^3.0.0"

Expand Down Expand Up @@ -6318,11 +6214,6 @@
resolved "https://registry.yarnpkg.com/@ungap/structured-clone/-/structured-clone-1.2.0.tgz#756641adb587851b5ccb3e095daf27ae581c8406"
integrity sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==

"@vespaiach/axios-fetch-adapter@^0.3.1":
version "0.3.1"
resolved "https://registry.yarnpkg.com/@vespaiach/axios-fetch-adapter/-/axios-fetch-adapter-0.3.1.tgz#b0c08167bec9cc558f578a1b9ccff52ead1cf1cb"
integrity sha512-+1F52VWXmQHSRFSv4/H0wtnxfvjRMPK5531e880MIjypPdUSX6QZuoDgEVeCE1vjhzDdxCVX7rOqkub7StEUwQ==

"@webassemblyjs/[email protected]", "@webassemblyjs/ast@^1.11.5":
version "1.11.6"
resolved "https://registry.yarnpkg.com/@webassemblyjs/ast/-/ast-1.11.6.tgz#db046555d3c413f8966ca50a95176a0e2c642e24"
Expand Down Expand Up @@ -7268,7 +7159,7 @@ [email protected]:
dependencies:
follow-redirects "^1.14.0"

axios@0.27.2, axios@^0.27.2:
axios@^0.27.2:
version "0.27.2"
resolved "https://registry.yarnpkg.com/axios/-/axios-0.27.2.tgz#207658cc8621606e586c85db4b41a750e756d972"
integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ==
Expand Down Expand Up @@ -12243,7 +12134,7 @@ immutable@^4.0.0:
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.0.tgz#eb1738f14ffb39fd068b1dbe1296117484dd34be"
integrity sha512-0AOCmOip+xgJwEVTQj1EfiDDOkPmuyllDuTuEX+DDXUgapLAsBIfkg3sxCYyCEA8mQqZrrxPUGjcOQ2JS3WLkg==

immutable@^4.0.0-rc.12, immutable@^4.3.0:
immutable@^4.3.0:
version "4.3.4"
resolved "https://registry.yarnpkg.com/immutable/-/immutable-4.3.4.tgz#2e07b33837b4bb7662f288c244d1ced1ef65a78f"
integrity sha512-fsXeu4J4i6WNWSikpI88v/PcVflZz+6kMhUfIwc5SY+poQRPnaf5V7qds6SUyUN3cVxEzuCab7QIoLOQ+DQ1wA==
Expand Down

1 comment on commit b823770

@github-actions
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Packaging for test is done in 7497040179

Please sign in to comment.