Skip to content

Commit f5942d7

Browse files
Keith-CYdevchenyan
andauthored
feat: handle hash_type:data2 (#3280)
* feat: update ckb client versions * feat: handle hash_type:data2 * fix --------- Co-authored-by: Keith-CY <7271329+Keith-CY@users.noreply.github.com> Co-authored-by: devchenyan <sgt39007@163.com>
1 parent 3d3546f commit f5942d7

File tree

5 files changed

+5
-2
lines changed

5 files changed

+5
-2
lines changed

packages/neuron-ui/src/components/SpecialAssetList/hooks.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export interface SpecialAssetCell {
3030
lock: {
3131
args: string
3232
codeHash: string
33-
hashType: 'type' | 'data'
33+
hashType: 'type' | 'data' | 'data1' | 'data2'
3434
}
3535
lockHash: string
3636
multiSignBlake160: string

packages/neuron-ui/src/types/Controller/index.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ declare namespace Controller {
215215
interface Response {
216216
cellDep: any
217217
codeHash: string
218-
hashType: 'data' | 'type'
218+
hashType: 'data' | 'type' | 'data1' | 'data2'
219219
}
220220
}
221221
interface SUDTAccount {

packages/neuron-wallet/src/models/asset-account-info.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -401,6 +401,7 @@ function toScriptInfo(sporeConfig: SporeScript): ScriptCellInfo {
401401
if (sporeScriptHashType === 'type') return ScriptHashType.Type
402402
if (sporeScriptHashType === 'data') return ScriptHashType.Data
403403
if (sporeScriptHashType === 'data1') return ScriptHashType.Data1
404+
if (sporeScriptHashType === 'data2') return ScriptHashType.Data2
404405

405406
throw new Error(`Invalid hash type: ${sporeScriptHashType}`)
406407
})()

packages/neuron-wallet/src/models/chain/live-cell.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const LUMOS_HASH_TYPE_MAP: Record<string, ScriptHashType> = {
66
type: ScriptHashType.Type,
77
data1: ScriptHashType.Data1,
88
data: ScriptHashType.Data,
9+
data2: ScriptHashType.Data2,
910
}
1011

1112
export type CellWithOutPoint = Cell & { outPoint: IOutPoint }

packages/neuron-wallet/src/models/chain/script.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ export enum ScriptHashType {
66
Data = 'data',
77
Type = 'type',
88
Data1 = 'data1',
9+
Data2 = 'data2',
910
}
1011

1112
export default class Script {

0 commit comments

Comments
 (0)