@wowok/wowok 2.3.7 → 2.3.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/Transaction-B_HAG_T7.mjs +1 -0
- package/dist/esm/arb-B7NNAqML.mjs +1 -0
- package/dist/esm/base-5DoRlfD_.mjs +1 -0
- package/dist/esm/call-DZtG6l2x.mjs +1 -0
- package/dist/esm/client/index.d.mts +1 -1
- package/dist/esm/client/index.mjs +1 -1
- package/dist/esm/{client-VxiBQfen.mjs → client-YYCgsO99.mjs} +1 -1
- package/dist/esm/common-CQggZ8z4.mjs +1 -0
- package/dist/esm/cryptography/index.d.mts +1 -1
- package/dist/esm/cryptography/index.mjs +1 -1
- package/dist/esm/ed25519-BrJWQ45w.mjs +1 -1
- package/dist/esm/evm-account-Dppw7HJc.d.mts +233 -0
- package/dist/esm/exception--UEPnygY.mjs +1 -0
- package/dist/esm/{falcon512-J8Pe5emy.mjs → falcon512-B4y-EH2f.mjs} +1 -1
- package/dist/esm/graphql/index.d.mts +1 -1
- package/dist/esm/graphql/index.mjs +1 -1
- package/dist/esm/{graphql-BXSiG4J0.mjs → graphql-D2Rx6H0h.mjs} +1 -1
- package/dist/esm/grpc/index.d.mts +1 -1
- package/dist/esm/grpc/index.mjs +1 -1
- package/dist/esm/{grpc-clMX5Wo0.mjs → grpc-BYkFJ8ot.mjs} +1 -1
- package/dist/esm/{index-Q3W63gcw.d.mts → index-BB7rqcJ9.d.mts} +688 -288
- package/dist/esm/index.d.mts +5 -5
- package/dist/esm/index.mjs +1 -1
- package/dist/esm/jsonRpc/index.d.mts +1 -1
- package/dist/esm/jsonRpc/index.mjs +1 -1
- package/dist/esm/keypairs/ed25519/index.d.mts +1 -1
- package/dist/esm/keypairs/falcon512/index.d.mts +1 -1
- package/dist/esm/keypairs/falcon512/index.mjs +1 -1
- package/dist/esm/keypairs/passkey/index.d.mts +1 -1
- package/dist/esm/keypairs/passkey/index.mjs +1 -1
- package/dist/esm/keypairs/secp256k1/index.d.mts +1 -1
- package/dist/esm/keypairs/secp256k1/index.mjs +1 -1
- package/dist/esm/keypairs/secp256r1/index.d.mts +1 -1
- package/dist/esm/keypairs/secp256r1/index.mjs +1 -1
- package/dist/esm/messenger-api-DsV5ffz-.mjs +1 -0
- package/dist/esm/{messenger-Bokr4-T2.mjs → messenger-b7VI27mY.mjs} +1 -1
- package/dist/esm/multisig/index.d.mts +1 -1
- package/dist/esm/multisig/index.mjs +1 -1
- package/dist/esm/{network-DOe6BgcD.mjs → network-CeDd07Hg.mjs} +1 -1
- package/dist/esm/{networks-DhrBVvu6.d.mts → networks-CEYOA-1U.d.mts} +95 -16
- package/dist/esm/object-ZwHVe_Xm.mjs +1 -0
- package/dist/esm/passkey-D0XCtEYg.mjs +1 -0
- package/dist/esm/proof-DU8afdtW.mjs +1 -0
- package/dist/esm/publickey-BPT9QiGv.mjs +1 -1
- package/dist/esm/{publickey-S1fGFYJX.mjs → publickey-Bkjn-YAu.mjs} +1 -1
- package/dist/esm/publickey-qLbcTInT.mjs +1 -1
- package/dist/esm/publickey-zB4h0HOi.mjs +1 -1
- package/dist/esm/received-g0FdzsRW.mjs +1 -0
- package/dist/esm/{rlp-BcIAoIV4.d.mts → rlp-Do3rPWRV.d.mts} +9 -1
- package/dist/esm/rolldown-runtime-D7D4PA-g.mjs +1 -0
- package/dist/esm/secp256k1-B-8mI0dI.mjs +1 -0
- package/dist/esm/secp256r1-B3O6jSlP.mjs +1 -0
- package/dist/esm/service-BP_-4e1d.mjs +1 -0
- package/dist/esm/storage-0TLziZMp.d.mts +62 -0
- package/dist/esm/transactions/index.d.mts +1 -1
- package/dist/esm/transactions/index.mjs +1 -1
- package/dist/esm/{transactions-CDWnTSTU.mjs → transactions-rYyItYOR.mjs} +1 -1
- package/dist/esm/util-BUonvpyz.mjs +1 -0
- package/dist/esm/utils/index.mjs +1 -1
- package/dist/esm/utils-IlS3fpdQ.mjs +1 -1
- package/dist/esm/verify/index.d.mts +1 -1
- package/dist/esm/verify/index.mjs +1 -1
- package/dist/esm/w/call/allocation.d.mts +1 -1
- package/dist/esm/w/call/allocation.mjs +1 -1
- package/dist/esm/w/call/arbitration.d.mts +1 -1
- package/dist/esm/w/call/arbitration.mjs +1 -1
- package/dist/esm/w/call/base.d.mts +1 -1
- package/dist/esm/w/call/base.mjs +1 -1
- package/dist/esm/w/call/demand.d.mts +1 -1
- package/dist/esm/w/call/demand.mjs +1 -1
- package/dist/esm/w/call/guard.d.mts +1 -1
- package/dist/esm/w/call/guard.mjs +1 -1
- package/dist/esm/w/call/index.d.mts +2 -2
- package/dist/esm/w/call/index.mjs +1 -1
- package/dist/esm/w/call/machine.d.mts +1 -1
- package/dist/esm/w/call/machine.mjs +1 -1
- package/dist/esm/w/call/passport.d.mts +1 -1
- package/dist/esm/w/call/passport.mjs +1 -1
- package/dist/esm/w/call/payment.d.mts +1 -1
- package/dist/esm/w/call/payment.mjs +1 -1
- package/dist/esm/w/call/permission.d.mts +1 -1
- package/dist/esm/w/call/permission.mjs +1 -1
- package/dist/esm/w/call/progress.d.mts +1 -1
- package/dist/esm/w/call/progress.mjs +1 -1
- package/dist/esm/w/call/repository.d.mts +1 -1
- package/dist/esm/w/call/repository.mjs +1 -1
- package/dist/esm/w/call/reward.d.mts +1 -1
- package/dist/esm/w/call/reward.mjs +1 -1
- package/dist/esm/w/call/service.d.mts +1 -1
- package/dist/esm/w/call/service.mjs +1 -1
- package/dist/esm/w/call/treasury.d.mts +1 -1
- package/dist/esm/w/call/treasury.mjs +1 -1
- package/dist/esm/w/common.d.mts +1 -1
- package/dist/esm/w/common.mjs +1 -1
- package/dist/esm/w/index.d.mts +5 -5
- package/dist/esm/w/index.mjs +1 -1
- package/dist/esm/w/local/account.d.mts +1 -1
- package/dist/esm/w/local/account.mjs +1 -1
- package/dist/esm/w/local/config.mjs +1 -1
- package/dist/esm/w/local/evm/networks.d.mts +1 -1
- package/dist/esm/w/local/evm/networks.mjs +1 -1
- package/dist/esm/w/local/evm/rlp.d.mts +2 -2
- package/dist/esm/w/local/evm/rlp.mjs +1 -1
- package/dist/esm/w/local/evm-account.d.mts +3 -3
- package/dist/esm/w/local/evm-account.mjs +1 -1
- package/dist/esm/w/local/index.d.mts +5 -5
- package/dist/esm/w/local/index.mjs +1 -1
- package/dist/esm/w/local/local.mjs +1 -1
- package/dist/esm/w/local/storage.d.mts +1 -52
- package/dist/esm/w/local/storage.mjs +1 -1
- package/dist/esm/w/local/token.d.mts +1 -1
- package/dist/esm/w/local/token.mjs +1 -1
- package/dist/esm/w/local/util.mjs +1 -1
- package/dist/esm/w/local/wip.mjs +1 -1
- package/dist/esm/w/messenger/index.d.mts +1 -1
- package/dist/esm/w/messenger/index.mjs +1 -1
- package/dist/esm/w/messenger/messenger-api.d.mts +1 -1
- package/dist/esm/w/messenger/messenger-api.mjs +1 -1
- package/dist/esm/w/messenger/messenger.d.mts +1 -1
- package/dist/esm/w/messenger/messenger.mjs +1 -1
- package/dist/esm/w/messenger/pq/crypto.mjs +1 -1
- package/dist/esm/w/messenger/pq/erasure.mjs +1 -1
- package/dist/esm/w/messenger/storage.d.mts +1 -1
- package/dist/esm/w/messenger/storage.mjs +1 -1
- package/dist/esm/w/messenger/types.d.mts +1 -1
- package/dist/esm/w/messenger/types.mjs +1 -1
- package/dist/esm/w/query/index.d.mts +1 -1
- package/dist/esm/w/query/index.mjs +1 -1
- package/dist/esm/w/query/object.d.mts +1 -1
- package/dist/esm/w/query/object.mjs +1 -1
- package/dist/esm/w-DCO00HIj.mjs +1 -0
- package/package.json +1 -4
- package/dist/esm/Transaction-YosVjNZA.mjs +0 -1
- package/dist/esm/arb-NYOQp2oH.mjs +0 -1
- package/dist/esm/base-fdHKX-jS.mjs +0 -1
- package/dist/esm/bridge-AHnWGzN1.mjs +0 -1
- package/dist/esm/call-7FZbEsRl.mjs +0 -1
- package/dist/esm/common-fDv-Cuzq.mjs +0 -1
- package/dist/esm/evm-account-XzrSThfS.d.mts +0 -185
- package/dist/esm/local-c-Tbdkfa.mjs +0 -1
- package/dist/esm/messenger-api-1m7Lp85p.mjs +0 -1
- package/dist/esm/object-DzsQI-0e.mjs +0 -1
- package/dist/esm/passkey-Dh6btBAD.mjs +0 -1
- package/dist/esm/proof-DER5SXw4.mjs +0 -1
- package/dist/esm/received-D7jEPxlE.mjs +0 -1
- package/dist/esm/rolldown-runtime-DkIiUugF.mjs +0 -1
- package/dist/esm/secp256k1-BZUdTK1D.mjs +0 -1
- package/dist/esm/secp256r1-COXOSFIF.mjs +0 -1
- package/dist/esm/service-W7-dgV57.mjs +0 -1
- package/dist/esm/util-B3X9acB0.mjs +0 -1
- package/dist/esm/w/call/bridge.d.mts +0 -2
- package/dist/esm/w/call/bridge.mjs +0 -1
- package/dist/esm/w-5GiAI3sP.mjs +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{t as a34a}from'./rolldown-runtime-D7D4PA-g.mjs';var network_exports=a34a({'ENTRYPOINT':()=>ENTRYPOINT,'getFullnodeUrl':()=>getFullnodeUrl});let ENTRYPOINT=function(a){return a['Testnet']='testnet',a['Localnet']='localnet',a['Mainnet']='mainnet',a;}({});function getFullnodeUrl(a){if(a==='testnet'&&process['env']['WOWOK_RPC_URL'])return process['env']['WOWOK_RPC_URL'];switch(a){case'testnet':return'https://fullnode.testnet.wowok.net:443';case'localnet':return'http://127.0.0.1:9000';case'mainnet':return'https://fullnode.mainnet.wowok.net:443';default:throw new Error('Unknown\x20network:\x20'+a);}}export{getFullnodeUrl as n,network_exports as r,ENTRYPOINT as t};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
1
|
//#region src/w/local/evm/networks.d.ts
|
|
2
|
-
/**
|
|
3
|
-
* EVM 多链网络配置与注册表
|
|
4
|
-
*
|
|
5
|
-
* 设计目标:
|
|
6
|
-
* - 一份配置覆盖一条链的所有参数(chainId、rpcUrls、explorer、确认数、gas 策略、超时等)
|
|
7
|
-
* - 通过 EvmNetworkRegistry 单例集中管理,支持按 chainId / name 查找
|
|
8
|
-
* - 智能维护:备用 RPC 故障转移、chainId 缓存、健康检查
|
|
9
|
-
* - 与 BridgeConfig 协同:bridge 初始化时把 EvmChainConfig 注册进来,
|
|
10
|
-
* EvmAccount 调用时即可自动找到对应网络的 RPC,无需重复传参
|
|
11
|
-
* - 预留 L2 扩展:每条 L2 都是独立的 EvmNetworkConfig
|
|
12
|
-
*/
|
|
13
2
|
/**
|
|
14
3
|
* 单条 EVM 链的完整网络配置
|
|
15
4
|
*
|
|
@@ -44,8 +33,12 @@ interface EvmNetworkConfig {
|
|
|
44
33
|
/**
|
|
45
34
|
* ETH 主网默认配置
|
|
46
35
|
*
|
|
47
|
-
*
|
|
48
|
-
* `EvmNetworkRegistry.Instance().
|
|
36
|
+
* 默认配置 10 个免费公共 RPC,按顺序尝试,主 RPC 失败自动故障转移到备用。
|
|
37
|
+
* 公共 RPC 易触发 429 限流,建议通过 `EvmNetworkRegistry.Instance().addRpc(...)`
|
|
38
|
+
* 或 `setRpcs(...)` 追加 / 替换为付费 RPC(Alchemy/Infura/自建节点)以提升稳定性。
|
|
39
|
+
*
|
|
40
|
+
* 健康状态过期:被标记为不可用的 RPC 在 5 分钟后自动重新加入轮询池
|
|
41
|
+
* (见 `EvmNetworkRegistry.DEFAULT_UNHEALTHY_RETRY_MS`)。
|
|
49
42
|
*/
|
|
50
43
|
declare const ETH_MAINNET: EvmNetworkConfig;
|
|
51
44
|
/**
|
|
@@ -72,6 +65,13 @@ declare const ETH_MAINNET: EvmNetworkConfig;
|
|
|
72
65
|
*/
|
|
73
66
|
declare class EvmNetworkRegistry {
|
|
74
67
|
private static _instance;
|
|
68
|
+
/**
|
|
69
|
+
* 默认 RPC 不可用重试窗口:5 分钟。
|
|
70
|
+
*
|
|
71
|
+
* 公共 RPC 429 限流通常在分钟级别恢复,5 分钟保证既不会被永久剔除,
|
|
72
|
+
* 也不会反复重试坏节点。可通过 `markUnhealthy(url, customMs)` 覆盖。
|
|
73
|
+
*/
|
|
74
|
+
static readonly DEFAULT_UNHEALTHY_RETRY_MS: number;
|
|
75
75
|
/** 按 chainId 索引 */
|
|
76
76
|
private byChainId;
|
|
77
77
|
/** 按小写 name 索引 */
|
|
@@ -81,7 +81,22 @@ declare class EvmNetworkRegistry {
|
|
|
81
81
|
/** chainId 缓存(RPC 返回的真实 chainId,避免重复查询) */
|
|
82
82
|
private chainIdCache;
|
|
83
83
|
/** RPC 故障转移状态:url → 下次重试时间 */
|
|
84
|
-
|
|
84
|
+
unhealthyRpc: Map<string, number>;
|
|
85
|
+
/**
|
|
86
|
+
* RPC 失败计数器:url → 累计失败次数。
|
|
87
|
+
*
|
|
88
|
+
* 用于"垃圾 RPC 反复复位"问题:失败次数越多,恢复时间越长,排序越靠后。
|
|
89
|
+
* 成功调用一次清零(见 markHealthy)。
|
|
90
|
+
*
|
|
91
|
+
* 恢复时间策略(指数退避):
|
|
92
|
+
* 1 次 = 5 分钟
|
|
93
|
+
* 2 次 = 15 分钟
|
|
94
|
+
* 3 次 = 30 分钟
|
|
95
|
+
* 4+ 次 = 60 分钟(上限)
|
|
96
|
+
*/
|
|
97
|
+
unhealthyCounter: Map<string, number>;
|
|
98
|
+
/** Persistence: evm_network_rpcs table in account.db (shared with evm-account) */
|
|
99
|
+
private _persistStore;
|
|
85
100
|
private constructor();
|
|
86
101
|
static Instance(): EvmNetworkRegistry;
|
|
87
102
|
/** 注册或覆盖一条网络配置 */
|
|
@@ -106,18 +121,82 @@ declare class EvmNetworkRegistry {
|
|
|
106
121
|
resolve(network?: number | string): Promise<EvmNetworkConfig>;
|
|
107
122
|
/**
|
|
108
123
|
* 选出当前可用的 RPC URL(跳过被标记为不可用的)
|
|
124
|
+
*
|
|
125
|
+
* 改进:按"健康度"排序,失败次数少的优先。
|
|
126
|
+
* 即使所有 RPC 都"过期可重试",也会优先选择历史记录好的。
|
|
109
127
|
*/
|
|
110
128
|
pickHealthyRpc(cfg: EvmNetworkConfig): string;
|
|
111
|
-
/**
|
|
129
|
+
/**
|
|
130
|
+
* 标记 RPC 不可用。
|
|
131
|
+
*
|
|
132
|
+
* 改进:使用指数退避,失败次数越多,恢复时间越长。
|
|
133
|
+
* 这样"垃圾 RPC"反复失败后会被自动降级,不会反复复位影响体验。
|
|
134
|
+
*
|
|
135
|
+
* 恢复时间策略:
|
|
136
|
+
* 1 次 = 5 分钟
|
|
137
|
+
* 2 次 = 15 分钟
|
|
138
|
+
* 3 次 = 30 分钟
|
|
139
|
+
* 4+ 次 = 60 分钟(上限)
|
|
140
|
+
*/
|
|
112
141
|
markUnhealthy(url: string, retryAfterMs?: number): void;
|
|
113
|
-
/** 标记 RPC
|
|
142
|
+
/** 标记 RPC 恢复健康(成功调用一次后清零计数) */
|
|
114
143
|
markHealthy(url: string): void;
|
|
144
|
+
/** 查询某个 RPC 当前是否被标记为不可用 */
|
|
145
|
+
isUnhealthy(url: string): boolean;
|
|
146
|
+
/** 查询某条链上所有 RPC 的健康状态(用于 AI / 用户管理 RPC) */
|
|
147
|
+
listRpcStatus(chainIdOrName?: number | string): Array<{
|
|
148
|
+
url: string;
|
|
149
|
+
healthy: boolean;
|
|
150
|
+
retryInMs?: number;
|
|
151
|
+
failCount: number;
|
|
152
|
+
}>;
|
|
153
|
+
/**
|
|
154
|
+
* 给指定链追加一个 RPC(去重,已存在则忽略)
|
|
155
|
+
*
|
|
156
|
+
* 用于 AI / 用户动态管理 RPC 端点:
|
|
157
|
+
* registry.addRpc("mainnet", "https://my-private-rpc.example.com")
|
|
158
|
+
*/
|
|
159
|
+
addRpc(chainIdOrName: number | string, rpcUrl: string): boolean;
|
|
160
|
+
/**
|
|
161
|
+
* 从指定链移除一个 RPC
|
|
162
|
+
*
|
|
163
|
+
* 注意:不应移除链上最后一个 RPC,否则将无法发起任何请求。
|
|
164
|
+
*/
|
|
165
|
+
removeRpc(chainIdOrName: number | string, rpcUrl: string): boolean;
|
|
166
|
+
/**
|
|
167
|
+
* 完全替换指定链的 RPC 列表
|
|
168
|
+
*
|
|
169
|
+
* 用于 AI / 用户批量替换 RPC(如全部切换到付费节点)。
|
|
170
|
+
* 必须至少传入一个 RPC。
|
|
171
|
+
*/
|
|
172
|
+
setRpcs(chainIdOrName: number | string, rpcUrls: string[]): boolean;
|
|
115
173
|
/** 健康检查(ping RPC 节点) */
|
|
116
174
|
ping(url: string, timeoutMs?: number): Promise<boolean>;
|
|
117
175
|
/** 通过 RPC 查询 chainId(带缓存) */
|
|
118
176
|
queryChainIdFromRpc(rpcUrl: string): Promise<number>;
|
|
119
177
|
/** 清空 chainId 缓存(切换节点后调用) */
|
|
120
178
|
clearChainIdCache(): void;
|
|
179
|
+
/**
|
|
180
|
+
* Lazy init: use SQLiteAccountStorage with table "evm_network_rpcs" in account.db.
|
|
181
|
+
* Same database file as evm-account.ts, but isolated table.
|
|
182
|
+
* Data format: single JSON row — { "<chainId>": ["url1", "url2", ...], ... }
|
|
183
|
+
*/
|
|
184
|
+
private _getPersistStore;
|
|
185
|
+
/** Save all chains' RPC URLs as a single JSON blob */
|
|
186
|
+
private _saveAllRpcs;
|
|
187
|
+
/** Load all chains' RPC overrides from account.db, applied on top of defaults */
|
|
188
|
+
private _loadAllRpcs;
|
|
189
|
+
/**
|
|
190
|
+
* Batch add RPC URLs to a chain. Duplicates are silently ignored.
|
|
191
|
+
* Returns the number of URLs actually added.
|
|
192
|
+
*/
|
|
193
|
+
addRpcs(chainIdOrName: number | string, rpcUrls: string[]): number;
|
|
194
|
+
/**
|
|
195
|
+
* Batch remove RPC URLs from a chain.
|
|
196
|
+
* At least one RPC must remain. Silently skips URLs not found.
|
|
197
|
+
* Returns the number of URLs actually removed.
|
|
198
|
+
*/
|
|
199
|
+
removeRpcs(chainIdOrName: number | string, rpcUrls: string[]): number;
|
|
121
200
|
private buildTempConfig;
|
|
122
201
|
}
|
|
123
202
|
/**
|