@nadohq/engine-client 0.9.0 → 0.10.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 +63 -0
- package/package.json +10 -10
package/README.md
CHANGED
|
@@ -1,2 +1,65 @@
|
|
|
1
1
|
# `@nadohq/engine-client`
|
|
2
2
|
|
|
3
|
+
HTTP client for the Nado off-chain matching engine. Provides typed queries and EIP-712 signed executes for order management, subaccount state, market data, and NLP operations.
|
|
4
|
+
|
|
5
|
+
[Full SDK Documentation](https://nadohq.github.io/nado-typescript-sdk/index.html)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @nadohq/engine-client @nadohq/shared viem bignumber.js
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Most apps should use `@nadohq/client` instead, which includes this package. Install `@nadohq/engine-client` directly when you only need engine interactions without the full client.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { EngineClient, ENGINE_CLIENT_ENDPOINTS } from '@nadohq/engine-client';
|
|
19
|
+
import { createWalletClient, http } from 'viem';
|
|
20
|
+
import { privateKeyToAccount } from 'viem/accounts';
|
|
21
|
+
import { ink } from 'viem/chains';
|
|
22
|
+
|
|
23
|
+
const walletClient = createWalletClient({
|
|
24
|
+
account: privateKeyToAccount('0x...'),
|
|
25
|
+
chain: ink,
|
|
26
|
+
transport: http(),
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
const engine = new EngineClient({
|
|
30
|
+
url: ENGINE_CLIENT_ENDPOINTS.inkMainnet,
|
|
31
|
+
walletClient,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Query market data
|
|
35
|
+
const markets = await engine.getAllMarkets();
|
|
36
|
+
const price = await engine.getMarketPrice({ productId: 1 });
|
|
37
|
+
|
|
38
|
+
// Place an order (EIP-712 signed)
|
|
39
|
+
await engine.placeOrder({ ... });
|
|
40
|
+
|
|
41
|
+
// Cancel orders
|
|
42
|
+
await engine.cancelOrders({ ... });
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## API Surface
|
|
46
|
+
|
|
47
|
+
### Queries
|
|
48
|
+
|
|
49
|
+
`getStatus`, `getContracts`, `getSubaccountSummary`, `getEstimatedSubaccountSummary`, `getIsolatedPositions`, `getSymbols`, `getAllMarkets`, `getHealthGroups`, `getOrder`, `getSubaccountOrders`, `getSubaccountFeeRates`, `getMarketLiquidity`, `getMarketPrice`, `getMarketPrices`, `getMaxOrderSize`, `getMaxWithdrawable`, `getMaxMintNlpAmount`, `getMaxBurnNlpAmount`, `getLinkedSigner`, `getInsurance`, `getNlpPoolInfo`, and more.
|
|
50
|
+
|
|
51
|
+
### Executes
|
|
52
|
+
|
|
53
|
+
`placeOrder`, `placeOrders`, `cancelOrders`, `cancelAndPlace`, `cancelProductOrders`, `liquidateSubaccount`, `withdrawCollateral`, `linkSigner`, `transferQuote`, `mintNlp`, `burnNlp`.
|
|
54
|
+
|
|
55
|
+
### Linked Signers
|
|
56
|
+
|
|
57
|
+
The engine client supports linked signers for delegated transaction signing:
|
|
58
|
+
|
|
59
|
+
```ts
|
|
60
|
+
engine.setLinkedSigner(linkedSignerWalletClient);
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## License
|
|
64
|
+
|
|
65
|
+
ISC
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadohq/engine-client",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
|
-
"description": "
|
|
6
|
+
"description": "HTTP client for the Nado off-chain matching engine",
|
|
7
7
|
"author": "Frank Jia <frank@inkfnd.com>",
|
|
8
8
|
"homepage": "",
|
|
9
9
|
"license": "ISC",
|
|
@@ -41,17 +41,17 @@
|
|
|
41
41
|
"module": "./dist/index.js",
|
|
42
42
|
"types": "./dist/index.d.ts",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@nadohq/shared": "^0.
|
|
45
|
-
"axios": "
|
|
46
|
-
"ts-mixer": "
|
|
44
|
+
"@nadohq/shared": "^0.10.0",
|
|
45
|
+
"axios": "1.14.0",
|
|
46
|
+
"ts-mixer": "6.0.4"
|
|
47
47
|
},
|
|
48
48
|
"peerDependencies": {
|
|
49
|
-
"bignumber.js": "
|
|
50
|
-
"viem": "
|
|
49
|
+
"bignumber.js": "10.0.0",
|
|
50
|
+
"viem": "2.41.0"
|
|
51
51
|
},
|
|
52
52
|
"devDependencies": {
|
|
53
|
-
"bignumber.js": "
|
|
54
|
-
"viem": "
|
|
53
|
+
"bignumber.js": "10.0.2",
|
|
54
|
+
"viem": "2.41.2"
|
|
55
55
|
},
|
|
56
|
-
"gitHead": "
|
|
56
|
+
"gitHead": "e516a80d16ed2bc1ee29fa51d1ee23fd00006075"
|
|
57
57
|
}
|