@grimoirelabs/venues 0.7.0 → 0.9.0
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 +38 -0
- package/dist/cli/polymarket.d.ts +3 -0
- package/dist/cli/polymarket.d.ts.map +1 -0
- package/dist/cli/polymarket.js +1025 -0
- package/dist/cli/polymarket.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4 -1
- package/dist/index.js.map +1 -1
- package/dist/polymarket.d.ts +45 -0
- package/dist/polymarket.d.ts.map +1 -0
- package/dist/polymarket.js +557 -0
- package/dist/polymarket.js.map +1 -0
- package/dist/query-provider.d.ts +34 -0
- package/dist/query-provider.d.ts.map +1 -0
- package/dist/query-provider.js +94 -0
- package/dist/query-provider.js.map +1 -0
- package/package.json +6 -4
package/README.md
CHANGED
|
@@ -9,6 +9,8 @@ Official Grimoire venue adapters bundle.
|
|
|
9
9
|
- `uniswap_v3` (Uniswap V3 SDK)
|
|
10
10
|
- `hyperliquid` (Hyperliquid SDK, offchain)
|
|
11
11
|
- `across` (Across Protocol bridge SDK)
|
|
12
|
+
- `pendle` (Pendle Hosted SDK convert adapter)
|
|
13
|
+
- `polymarket` (Polymarket CLOB offchain adapter)
|
|
12
14
|
|
|
13
15
|
## Usage
|
|
14
16
|
|
|
@@ -29,6 +31,29 @@ await execute({
|
|
|
29
31
|
|
|
30
32
|
Adapters may require configuration via factory functions for production use.
|
|
31
33
|
|
|
34
|
+
## QueryProvider
|
|
35
|
+
|
|
36
|
+
The package exports an Alchemy-backed `QueryProvider` for on-chain balance reads and token price lookups.
|
|
37
|
+
|
|
38
|
+
```ts
|
|
39
|
+
import { createAlchemyQueryProvider } from "@grimoirelabs/venues";
|
|
40
|
+
|
|
41
|
+
const queryProvider = createAlchemyQueryProvider({
|
|
42
|
+
provider,
|
|
43
|
+
chainId: 1,
|
|
44
|
+
vault: "0x...",
|
|
45
|
+
rpcUrl: "https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY",
|
|
46
|
+
});
|
|
47
|
+
|
|
48
|
+
// queryProvider.queryBalance("ETH") → on-chain balance
|
|
49
|
+
// queryProvider.queryPrice("ETH", "USDC") → price via Alchemy API
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
- `queryBalance` reads on-chain ERC20 balances (or native ETH) via the RPC provider.
|
|
53
|
+
- `queryPrice` fetches token prices from the Alchemy Token Prices API. The API key is auto-extracted from the RPC URL, or can be set explicitly via `alchemyApiKey`.
|
|
54
|
+
|
|
55
|
+
Also exported: `extractAlchemyKey(rpcUrl)` and the `AlchemyQueryProviderConfig` type.
|
|
56
|
+
|
|
32
57
|
## CLI tools
|
|
33
58
|
|
|
34
59
|
Each venue exposes a small read-only CLI for fetching public data:
|
|
@@ -42,4 +67,17 @@ grimoire-morpho-blue addresses --chain 1
|
|
|
42
67
|
|
|
43
68
|
grimoire-hyperliquid mids
|
|
44
69
|
grimoire-hyperliquid l2-book --coin BTC
|
|
70
|
+
|
|
71
|
+
grimoire-polymarket status
|
|
72
|
+
grimoire-polymarket markets list --limit 10 --format json
|
|
73
|
+
grimoire-polymarket markets search "bitcoin" --limit 10 --format json
|
|
74
|
+
grimoire-polymarket search-markets --category sports --league "la liga" --open-only true --format json
|
|
75
|
+
grimoire-polymarket clob book <token_id> --format json
|
|
76
|
+
grimoire-polymarket clob price <token_id> --side buy --format json
|
|
45
77
|
```
|
|
78
|
+
|
|
79
|
+
Polymarket note:
|
|
80
|
+
|
|
81
|
+
- `grimoire-polymarket` delegates to the official `polymarket` CLI binary.
|
|
82
|
+
- Install with `brew tap Polymarket/polymarket-cli && brew install polymarket`.
|
|
83
|
+
- Set `POLYMARKET_OFFICIAL_CLI` to override binary path.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"polymarket.d.ts","sourceRoot":"","sources":["../../src/cli/polymarket.ts"],"names":[],"mappings":""}
|