@valve-tech/gas-oracle 0.2.0 → 0.2.1
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 +1 -1
- package/package.json +11 -28
- package/src/index.ts +0 -84
package/README.md
CHANGED
|
@@ -27,7 +27,7 @@ const oracle = createGasOracle({
|
|
|
27
27
|
client,
|
|
28
28
|
chainId: 1,
|
|
29
29
|
priorityFeeDecayCap: parseEther('0.125'), // 12.5%/block, EIP-1559 parity
|
|
30
|
-
priorityModel: 'eip1559', // 'flat' for
|
|
30
|
+
priorityModel: 'eip1559', // 'flat' for chains whose validators charge tips instead of burning them
|
|
31
31
|
})
|
|
32
32
|
|
|
33
33
|
oracle.subscribe((state) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@valve-tech/gas-oracle",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"description": "Multi-tier gas-fee oracle for EVM chains. Computes slow/standard/fast/instant tier recommendations from block-included tips, mempool pending tips, and base-fee trend, with a configurable downside-decay cap and a chain-aware EIP-1559 priority cutoff. viem-native — pass it a PublicClient and it does the rest. Ships viem-actions and viem-transport subpaths for drop-in client extension and transport-wrapping.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"homepage": "https://github.com/valve-tech/gas-oracle#readme",
|
|
@@ -24,38 +24,20 @@
|
|
|
24
24
|
],
|
|
25
25
|
"type": "module",
|
|
26
26
|
"packageManager": "yarn@4.14.1",
|
|
27
|
-
"main": "
|
|
28
|
-
"types": "
|
|
27
|
+
"main": "dist/index.js",
|
|
28
|
+
"types": "dist/index.d.ts",
|
|
29
29
|
"exports": {
|
|
30
30
|
".": {
|
|
31
|
-
"types": "./
|
|
32
|
-
"import": "./
|
|
31
|
+
"types": "./dist/index.d.ts",
|
|
32
|
+
"import": "./dist/index.js"
|
|
33
33
|
},
|
|
34
34
|
"./viem-actions": {
|
|
35
|
-
"types": "./
|
|
36
|
-
"import": "./
|
|
35
|
+
"types": "./dist/viem-actions.d.ts",
|
|
36
|
+
"import": "./dist/viem-actions.js"
|
|
37
37
|
},
|
|
38
38
|
"./viem-transport": {
|
|
39
|
-
"types": "./
|
|
40
|
-
"import": "./
|
|
41
|
-
}
|
|
42
|
-
},
|
|
43
|
-
"publishConfig": {
|
|
44
|
-
"main": "dist/index.js",
|
|
45
|
-
"types": "dist/index.d.ts",
|
|
46
|
-
"exports": {
|
|
47
|
-
".": {
|
|
48
|
-
"types": "./dist/index.d.ts",
|
|
49
|
-
"import": "./dist/index.js"
|
|
50
|
-
},
|
|
51
|
-
"./viem-actions": {
|
|
52
|
-
"types": "./dist/viem-actions.d.ts",
|
|
53
|
-
"import": "./dist/viem-actions.js"
|
|
54
|
-
},
|
|
55
|
-
"./viem-transport": {
|
|
56
|
-
"types": "./dist/viem-transport.d.ts",
|
|
57
|
-
"import": "./dist/viem-transport.js"
|
|
58
|
-
}
|
|
39
|
+
"types": "./dist/viem-transport.d.ts",
|
|
40
|
+
"import": "./dist/viem-transport.js"
|
|
59
41
|
}
|
|
60
42
|
},
|
|
61
43
|
"files": [
|
|
@@ -67,7 +49,8 @@
|
|
|
67
49
|
"build": "tsc -p .",
|
|
68
50
|
"typecheck": "tsc -p . --noEmit",
|
|
69
51
|
"test": "vitest run",
|
|
70
|
-
"test:watch": "vitest"
|
|
52
|
+
"test:watch": "vitest",
|
|
53
|
+
"prepare": "yarn build"
|
|
71
54
|
},
|
|
72
55
|
"peerDependencies": {
|
|
73
56
|
"viem": "^2.0.0"
|
package/src/index.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @valve-tech/gas-oracle — public API.
|
|
3
|
-
*
|
|
4
|
-
* Multi-tier gas-fee oracle for EVM chains. Pass it a viem PublicClient
|
|
5
|
-
* and it polls block + mempool data, computes slow/standard/fast/instant
|
|
6
|
-
* tier recommendations, and exposes them via a sub-millisecond in-memory
|
|
7
|
-
* read. Includes EIP-1559-style 12.5%/block downside cap so quiet blocks
|
|
8
|
-
* don't drop the published number off a cliff, and EIP-4844 blob fee
|
|
9
|
-
* for chains that support it.
|
|
10
|
-
*
|
|
11
|
-
* Zero runtime dependencies. viem is the only peer dependency, used to
|
|
12
|
-
* issue the underlying RPC calls (`eth_feeHistory`,
|
|
13
|
-
* `eth_getBlockByNumber`, `txpool_content`).
|
|
14
|
-
*/
|
|
15
|
-
|
|
16
|
-
export {
|
|
17
|
-
createGasOracle,
|
|
18
|
-
reducePollInputs,
|
|
19
|
-
type CreateGasOracleOptions,
|
|
20
|
-
type GasOracle,
|
|
21
|
-
} from './oracle.js'
|
|
22
|
-
|
|
23
|
-
export {
|
|
24
|
-
effectiveTip,
|
|
25
|
-
computePercentiles,
|
|
26
|
-
detectTrend,
|
|
27
|
-
cappedTip,
|
|
28
|
-
computeTiers,
|
|
29
|
-
computeBlobBaseFee,
|
|
30
|
-
flattenTxPool,
|
|
31
|
-
gasWeightedPercentiles,
|
|
32
|
-
sortedTips,
|
|
33
|
-
DEFAULT_PRIORITY_FEE_DECAY_CAP,
|
|
34
|
-
DEFAULT_BASE_FEE_LIVENESS_BLOCKS,
|
|
35
|
-
} from './math.js'
|
|
36
|
-
|
|
37
|
-
export {
|
|
38
|
-
blockToSample,
|
|
39
|
-
mempoolToSamples,
|
|
40
|
-
} from './samples.js'
|
|
41
|
-
|
|
42
|
-
export {
|
|
43
|
-
fetchOracleInputs,
|
|
44
|
-
type FeeHistoryResult,
|
|
45
|
-
type BlockResult,
|
|
46
|
-
type TxPoolContent,
|
|
47
|
-
type OraclePollInputs,
|
|
48
|
-
} from './transport.js'
|
|
49
|
-
|
|
50
|
-
export type {
|
|
51
|
-
RawTx,
|
|
52
|
-
TipPercentiles,
|
|
53
|
-
TierRecommendation,
|
|
54
|
-
TierName,
|
|
55
|
-
Trend,
|
|
56
|
-
MempoolStats,
|
|
57
|
-
BlobStats,
|
|
58
|
-
BlockSample,
|
|
59
|
-
GasOracleState,
|
|
60
|
-
TipSample,
|
|
61
|
-
PriorityModel,
|
|
62
|
-
PollOptions,
|
|
63
|
-
} from './types.js'
|
|
64
|
-
|
|
65
|
-
// Mempool inspection
|
|
66
|
-
export {
|
|
67
|
-
normalizeMempool,
|
|
68
|
-
findByHash,
|
|
69
|
-
findByAddressNonce,
|
|
70
|
-
findInMempool,
|
|
71
|
-
} from './mempool.js'
|
|
72
|
-
export type {
|
|
73
|
-
NormalizedMempool,
|
|
74
|
-
TxIdentifier,
|
|
75
|
-
MempoolBucket,
|
|
76
|
-
MempoolHit,
|
|
77
|
-
} from './mempool.js'
|
|
78
|
-
|
|
79
|
-
// Block-position calculations
|
|
80
|
-
export { tipForBlockPosition } from './block-position.js'
|
|
81
|
-
export type {
|
|
82
|
-
BlockPositionQuery,
|
|
83
|
-
BlockPositionResult,
|
|
84
|
-
} from './block-position.js'
|