@forgezero/providers 0.1.23 → 0.1.24
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/README.md +67 -81
- package/dist/billing.d.ts +305 -0
- package/dist/{chain.js → billing.js} +258 -143
- package/dist/database.js +1 -1
- package/dist/email.js +1 -1
- package/dist/git.d.ts +108 -40
- package/dist/git.js +41 -19
- package/dist/http.js +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/pool.js +1 -1
- package/dist/storage.js +1 -1
- package/dist/translation.js +1 -1
- package/package.json +6 -10
- package/dist/binance.d.ts +0 -27
- package/dist/binance.js +0 -704
- package/dist/chain.d.ts +0 -99
package/dist/chain.d.ts
DELETED
|
@@ -1,99 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* A blockchain node, behind the same failover every other service gets.
|
|
3
|
-
*
|
|
4
|
-
* Reading a chain is a PROVIDER problem, not a runtime one, and the distinction
|
|
5
|
-
* is not bookkeeping. A node needs a credential, it rate-limits, it goes down,
|
|
6
|
-
* and the answer when it does is to ask a different one — which is precisely
|
|
7
|
-
* what the registry already does for email and storage. Deriving an address
|
|
8
|
-
* needs none of that and lives in `runtime/finance/custody`.
|
|
9
|
-
*
|
|
10
|
-
* ## Why several nodes is the normal case, not a luxury
|
|
11
|
-
*
|
|
12
|
-
* Public RPC endpoints are rate-limited and unreliable, and paid ones have
|
|
13
|
-
* outages like anything else. A deposit scanner that stops when one endpoint is
|
|
14
|
-
* down stops CREDITING DEPOSITS, and the user's money is on the chain the whole
|
|
15
|
-
* time. Priority and health belong here so a scanner never has to know which
|
|
16
|
-
* node answered.
|
|
17
|
-
*
|
|
18
|
-
* ## The classification is the load-bearing part
|
|
19
|
-
*
|
|
20
|
-
* terminal our request is malformed, or the chain rejected the transaction
|
|
21
|
-
* on its merits. Every node will say the same thing, and asking
|
|
22
|
-
* three of them buries the real reason under two duplicates.
|
|
23
|
-
* backoff rate limited. The node is healthy and we are asking too fast;
|
|
24
|
-
* striking it would punish the one that is working.
|
|
25
|
-
* retryable this node is behind, broken, or its key is bad. The next may
|
|
26
|
-
* be fine.
|
|
27
|
-
*
|
|
28
|
-
* "Already known" and "nonce too low" are the interesting cases. Both mean the
|
|
29
|
-
* transaction is ALREADY IN FLIGHT, so they are terminal rather than retryable:
|
|
30
|
-
* rebroadcasting through another node cannot help, and treating them as failure
|
|
31
|
-
* is how a sweep gets sent twice.
|
|
32
|
-
*/
|
|
33
|
-
export type ChainCall = {
|
|
34
|
-
op: 'head';
|
|
35
|
-
} | {
|
|
36
|
-
op: 'balance';
|
|
37
|
-
address: string;
|
|
38
|
-
block?: string;
|
|
39
|
-
} | {
|
|
40
|
-
op: 'call';
|
|
41
|
-
to: string;
|
|
42
|
-
data: string;
|
|
43
|
-
block?: string;
|
|
44
|
-
} | {
|
|
45
|
-
op: 'logs';
|
|
46
|
-
fromBlock: number;
|
|
47
|
-
toBlock: number;
|
|
48
|
-
address?: string;
|
|
49
|
-
topics?: (string | string[] | null)[];
|
|
50
|
-
} | {
|
|
51
|
-
op: 'nonce';
|
|
52
|
-
address: string;
|
|
53
|
-
block?: 'pending' | 'latest';
|
|
54
|
-
} | {
|
|
55
|
-
op: 'send';
|
|
56
|
-
raw: string;
|
|
57
|
-
} | {
|
|
58
|
-
op: 'receipt';
|
|
59
|
-
hash: string;
|
|
60
|
-
};
|
|
61
|
-
export interface ChainLog {
|
|
62
|
-
transactionHash: string;
|
|
63
|
-
logIndex: number;
|
|
64
|
-
blockNumber: number;
|
|
65
|
-
address: string;
|
|
66
|
-
topics: string[];
|
|
67
|
-
data: string;
|
|
68
|
-
}
|
|
69
|
-
export interface ChainReceipt {
|
|
70
|
-
hash: string;
|
|
71
|
-
blockNumber: number;
|
|
72
|
-
/** True only when the chain executed it successfully. */
|
|
73
|
-
success: boolean;
|
|
74
|
-
}
|
|
75
|
-
export type ChainResult = {
|
|
76
|
-
op: 'head';
|
|
77
|
-
block: number;
|
|
78
|
-
} | {
|
|
79
|
-
op: 'balance';
|
|
80
|
-
wei: bigint;
|
|
81
|
-
} | {
|
|
82
|
-
op: 'call';
|
|
83
|
-
data: string;
|
|
84
|
-
} | {
|
|
85
|
-
op: 'logs';
|
|
86
|
-
logs: ChainLog[];
|
|
87
|
-
} | {
|
|
88
|
-
op: 'nonce';
|
|
89
|
-
nonce: bigint;
|
|
90
|
-
} | {
|
|
91
|
-
op: 'send';
|
|
92
|
-
hash: string;
|
|
93
|
-
}
|
|
94
|
-
/** `null` when the transaction has not mined yet — not an error. */
|
|
95
|
-
| {
|
|
96
|
-
op: 'receipt';
|
|
97
|
-
receipt: ChainReceipt | null;
|
|
98
|
-
};
|
|
99
|
-
export declare const evmRpc: import("./index").ProviderDefinition<Record<"request", import("./index").ProviderMethodSpec<ChainCall, ChainResult>>>;
|