@nadohq/trigger-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 +62 -0
- package/package.json +11 -11
package/README.md
CHANGED
|
@@ -1,2 +1,64 @@
|
|
|
1
1
|
# `@nadohq/trigger-client`
|
|
2
2
|
|
|
3
|
+
HTTP client for the Nado trigger service. Manages stop-loss, take-profit, and other conditional orders, as well as TWAP (time-weighted average price) order execution.
|
|
4
|
+
|
|
5
|
+
[Full SDK Documentation](https://nadohq.github.io/nado-typescript-sdk/index.html)
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install @nadohq/trigger-client @nadohq/engine-client @nadohq/shared viem bignumber.js
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Most apps should use `@nadohq/client` instead, which includes this package. Install `@nadohq/trigger-client` directly when integrating only the trigger service.
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```ts
|
|
18
|
+
import { TriggerClient, TRIGGER_CLIENT_ENDPOINTS } from '@nadohq/trigger-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 trigger = new TriggerClient({
|
|
30
|
+
url: TRIGGER_CLIENT_ENDPOINTS.inkMainnet,
|
|
31
|
+
walletClient,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
// Place a stop-loss trigger order
|
|
35
|
+
await trigger.placeTriggerOrder({ ... });
|
|
36
|
+
|
|
37
|
+
// List active trigger orders
|
|
38
|
+
const orders = await trigger.listOrders({ ... });
|
|
39
|
+
|
|
40
|
+
// Cancel trigger orders
|
|
41
|
+
await trigger.cancelTriggerOrders({ ... });
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## API Surface
|
|
45
|
+
|
|
46
|
+
### Executes
|
|
47
|
+
|
|
48
|
+
`placeTriggerOrder`, `placeTriggerOrders`, `cancelTriggerOrders`, `cancelProductOrders`.
|
|
49
|
+
|
|
50
|
+
### Queries
|
|
51
|
+
|
|
52
|
+
`listOrders`, `listTwapExecutions`.
|
|
53
|
+
|
|
54
|
+
### Linked Signers
|
|
55
|
+
|
|
56
|
+
The trigger client supports linked signers for delegated transaction signing:
|
|
57
|
+
|
|
58
|
+
```ts
|
|
59
|
+
trigger.setLinkedSigner(linkedSignerWalletClient);
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
ISC
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadohq/trigger-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 trigger service — stop-loss, take-profit, and TWAP orders",
|
|
7
7
|
"author": "Frank Jia <frank@inkfnd.com>",
|
|
8
8
|
"homepage": "",
|
|
9
9
|
"license": "ISC",
|
|
@@ -41,18 +41,18 @@
|
|
|
41
41
|
"module": "./dist/index.js",
|
|
42
42
|
"types": "./dist/index.d.ts",
|
|
43
43
|
"dependencies": {
|
|
44
|
-
"@nadohq/engine-client": "^0.
|
|
45
|
-
"@nadohq/shared": "^0.
|
|
46
|
-
"axios": "
|
|
47
|
-
"ts-mixer": "
|
|
44
|
+
"@nadohq/engine-client": "^0.10.0",
|
|
45
|
+
"@nadohq/shared": "^0.10.0",
|
|
46
|
+
"axios": "1.14.0",
|
|
47
|
+
"ts-mixer": "6.0.4"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
|
-
"bignumber.js": "
|
|
51
|
-
"viem": "
|
|
50
|
+
"bignumber.js": "10.0.0",
|
|
51
|
+
"viem": "2.41.0"
|
|
52
52
|
},
|
|
53
53
|
"devDependencies": {
|
|
54
|
-
"bignumber.js": "
|
|
55
|
-
"viem": "
|
|
54
|
+
"bignumber.js": "10.0.2",
|
|
55
|
+
"viem": "2.41.2"
|
|
56
56
|
},
|
|
57
|
-
"gitHead": "
|
|
57
|
+
"gitHead": "e516a80d16ed2bc1ee29fa51d1ee23fd00006075"
|
|
58
58
|
}
|