1
1
import {
2
2
Cell ,
3
3
CellDep ,
4
- CellDepLike ,
5
4
OutPoint ,
6
5
OutPointLike ,
7
- Script ,
8
6
ScriptLike ,
9
7
Transaction ,
10
8
TransactionLike ,
11
9
} from "../ckb/index.js" ;
12
10
import { Zero } from "../fixedPoint/index.js" ;
13
11
import { Hex , HexLike , hexFrom } from "../hex/index.js" ;
14
12
import { Num , NumLike , numFrom , numMax } from "../num/index.js" ;
15
- import { apply , reduceAsync , sleep } from "../utils/index.js" ;
13
+ import { reduceAsync , sleep } from "../utils/index.js" ;
16
14
import { ClientCache } from "./cache/index.js" ;
17
15
import { ClientCacheMemory } from "./cache/memory.js" ;
18
16
import { ClientCollectableSearchKeyLike } from "./clientTypes.advanced.js" ;
19
17
import {
18
+ CellDepInfo ,
19
+ CellDepInfoLike ,
20
20
ClientBlock ,
21
21
ClientBlockHeader ,
22
22
ClientFindCellsResponse ,
@@ -27,62 +27,11 @@ import {
27
27
ClientIndexerSearchKeyTransactionLike ,
28
28
ClientTransactionResponse ,
29
29
ErrorClientWaitTransactionTimeout ,
30
+ KnownScript ,
30
31
OutputsValidator ,
32
+ ScriptInfo ,
31
33
} from "./clientTypes.js" ;
32
34
33
- /**
34
- * @public
35
- */
36
- export enum KnownScript {
37
- NervosDao = "NervosDao" ,
38
- Secp256k1Blake160 = "Secp256k1Blake160" ,
39
- Secp256k1Multisig = "Secp256k1Multisig" ,
40
- AnyoneCanPay = "AnyoneCanPay" ,
41
- TypeId = "TypeId" ,
42
- XUdt = "XUdt" ,
43
- JoyId = "JoyId" ,
44
- COTA = "COTA" ,
45
- PWLock = "PWLock" ,
46
- OmniLock = "OmniLock" ,
47
- NostrLock = "NostrLock" ,
48
- UniqueType = "UniqueType" ,
49
-
50
- // ckb-proxy-locks https://github.com/ckb-ecofund/ckb-proxy-locks
51
- AlwaysSuccess = "AlwaysSuccess" ,
52
- InputTypeProxyLock = "InputTypeProxyLock" ,
53
- OutputTypeProxyLock = "OutputTypeProxyLock" ,
54
- LockProxyLock = "LockProxyLock" ,
55
- SingleUseLock = "SingleUseLock" ,
56
- TypeBurnLock = "TypeBurnLock" ,
57
- EasyToDiscoverType = "EasyToDiscoverType" ,
58
- TimeLock = "TimeLock" ,
59
- }
60
-
61
- /**
62
- * @public
63
- */
64
- export type CellDepInfoLike = {
65
- cellDep : CellDepLike ;
66
- type ?: ScriptLike | null ;
67
- } ;
68
-
69
- /**
70
- * @public
71
- */
72
- export class CellDepInfo {
73
- constructor (
74
- public cellDep : CellDep ,
75
- public type ?: Script ,
76
- ) { }
77
-
78
- static from ( cellDepInfoLike : CellDepInfoLike ) : CellDepInfo {
79
- return new CellDepInfo (
80
- CellDep . from ( cellDepInfoLike . cellDep ) ,
81
- apply ( Script . from , cellDepInfoLike . type ) ,
82
- ) ;
83
- }
84
- }
85
-
86
35
/**
87
36
* @public
88
37
*/
@@ -96,11 +45,7 @@ export abstract class Client {
96
45
abstract get url ( ) : string ;
97
46
abstract get addressPrefix ( ) : string ;
98
47
99
- abstract getKnownScript (
100
- script : KnownScript ,
101
- ) : Promise <
102
- Pick < Script , "codeHash" | "hashType" > & { cellDeps : CellDepInfo [ ] }
103
- > ;
48
+ abstract getKnownScript ( script : KnownScript ) : Promise < ScriptInfo > ;
104
49
105
50
abstract getFeeRateStatistics (
106
51
blockRange ?: NumLike ,
0 commit comments