Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/neuron-ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,8 @@
"last 2 chrome versions"
],
"dependencies": {
"@ckb-lumos/base": "0.21.0-next.2",
"@ckb-lumos/codec": "0.21.0-next.2",
"@ckb-lumos/base": "0.21.1",
"@ckb-lumos/codec": "0.21.1",
"@nervosnetwork/ckb-sdk-core": "0.109.0",
"@nervosnetwork/ckb-sdk-utils": "0.109.0",
"canvg": "2.0.0",
Expand Down
18 changes: 9 additions & 9 deletions packages/neuron-wallet/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,15 +42,15 @@
]
},
"dependencies": {
"@ckb-lumos/base": "0.21.0-next.2",
"@ckb-lumos/bi": "0.21.0-next.2",
"@ckb-lumos/ckb-indexer": "0.21.0-next.2",
"@ckb-lumos/codec": "0.21.0-next.2",
"@ckb-lumos/common-scripts": "0.21.0-next.2",
"@ckb-lumos/config-manager": "0.21.0-next.2",
"@ckb-lumos/hd": "0.21.0-next.2",
"@ckb-lumos/helpers": "0.21.0-next.2",
"@ckb-lumos/rpc": "0.21.0-next.2",
"@ckb-lumos/base": "0.21.1",
"@ckb-lumos/bi": "0.21.1",
"@ckb-lumos/ckb-indexer": "0.21.1",
"@ckb-lumos/codec": "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",
"@iarna/toml": "2.2.5",
"@ledgerhq/hw-transport-node-hid": "6.27.22",
"@spore-sdk/core": "0.1.0-beta.9",
Expand Down
27 changes: 1 addition & 26 deletions packages/neuron-wallet/src/services/sdk-core.ts
Original file line number Diff line number Diff line change
@@ -1,32 +1,7 @@
import { CKBRPC } from '@ckb-lumos/rpc'
import https from 'https'
import http from 'http'

let httpsAgent: https.Agent
let httpAgent: http.Agent

const getHttpsAgent = () => {
if (!httpsAgent) {
httpsAgent = new https.Agent({ keepAlive: true })
}
return httpsAgent
}

const getHttpAgent = () => {
if (!httpAgent) {
httpAgent = new http.Agent({ keepAlive: true })
}
return httpAgent
}

export const generateCKB = (url: string): CKBRPC => {
const rpc = new CKBRPC(url)
if (url.startsWith('https')) {
rpc.setNode({ url, httpsAgent: getHttpsAgent() })
} else {
rpc.setNode({ url, httpAgent: getHttpAgent() })
}
return rpc
return new CKBRPC(url, { fetch: (request, init) => globalThis.fetch(request, { ...init, keepalive: true }) })
}

export default {
Expand Down
4 changes: 3 additions & 1 deletion packages/neuron-wallet/src/services/transaction-sender.ts
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,9 @@ export default class TransactionSender {
const rpc = generateRPC(currentNetwork.remote, currentNetwork.type)

let tx = await rpc.getTransaction(depositOutPoint.txHash)
if (tx.txStatus.status !== 'committed') throw new Error('Transaction is not committed yet')
if (tx.txStatus.status !== 'committed' || !tx.txStatus.blockHash) {
Comment thread
Keith-CY marked this conversation as resolved.
throw new Error('Transaction is not committed yet')
}
const depositBlockHash = tx.txStatus.blockHash

const cellOutput = tx.transaction.outputs[+depositOutPoint.index]
Expand Down
Loading