@nadohq/trigger-client 0.1.0-alpha.20 → 0.1.0-alpha.22
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/clientTypes.ts"],"sourcesContent":["import {\n EngineOrderParams,\n EngineServerExecuteResult,\n} from '@nadohq/engine-client';\nimport {\n BigDecimal,\n EIP712CancelOrdersParams,\n EIP712CancelProductOrdersParams,\n OrderAppendix,\n Subaccount,\n} from '@nadohq/shared';\nimport { TriggerCriteria, TriggerOrderStatus } from './clientModelTypes';\nimport {\n TriggerServerOrder,\n TriggerServerStatusTypeFilter,\n TriggerServerTriggerTypeFilter,\n} from './serverQueryTypes';\n\ntype WithOptionalNonce<T> = Omit<T, 'nonce'> & { nonce?: string };\n\ninterface SignatureParams {\n /**\n * Address derived from productId for placement (see getOrderVerifyingAddr)\n * endpoint address for cancellation & listing\n */\n verifyingAddr: string;\n chainId: number;\n}\n\n/**\n * Executes\n */\n\nexport interface TriggerPlaceOrderParams extends SignatureParams {\n id?: number;\n productId: number;\n order: EngineOrderParams;\n triggerCriteria: TriggerCriteria;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spotLeverage?: boolean;\n // For isolated orders, this specifies whether margin can be borrowed (i.e. whether the cross account can have a negative
|
|
1
|
+
{"version":3,"sources":["../../src/types/clientTypes.ts"],"sourcesContent":["import {\n EngineOrderParams,\n EngineServerExecuteResult,\n} from '@nadohq/engine-client';\nimport {\n BigDecimal,\n EIP712CancelOrdersParams,\n EIP712CancelProductOrdersParams,\n OrderAppendix,\n Subaccount,\n} from '@nadohq/shared';\nimport { TriggerCriteria, TriggerOrderStatus } from './clientModelTypes';\nimport {\n TriggerServerOrder,\n TriggerServerStatusTypeFilter,\n TriggerServerTriggerTypeFilter,\n} from './serverQueryTypes';\n\ntype WithOptionalNonce<T> = Omit<T, 'nonce'> & { nonce?: string };\n\ninterface SignatureParams {\n /**\n * Address derived from productId for placement (see getOrderVerifyingAddr)\n * endpoint address for cancellation & listing\n */\n verifyingAddr: string;\n chainId: number;\n}\n\n/**\n * Executes\n */\n\nexport interface TriggerPlaceOrderParams extends SignatureParams {\n id?: number;\n productId: number;\n order: EngineOrderParams;\n triggerCriteria: TriggerCriteria;\n // If not given, engine defaults to true (leverage/borrow enabled)\n spotLeverage?: boolean;\n // For isolated orders, this specifies whether margin can be borrowed (i.e. whether the cross account can have a negative USDT balance)\n borrowMargin?: boolean;\n digest?: string;\n nonce?: string;\n}\n\nexport type TriggerCancelOrdersParams = SignatureParams &\n WithOptionalNonce<EIP712CancelOrdersParams>;\n\nexport type TriggerCancelProductOrdersParams = SignatureParams &\n WithOptionalNonce<EIP712CancelProductOrdersParams>;\n\n/**\n * Queries\n */\n\nexport interface TriggerListOrdersParams extends Subaccount, SignatureParams {\n // In millis, defaults to 90s in the future\n recvTime?: BigDecimal;\n // If not given, defaults to all products\n productIds?: number[];\n // In seconds\n maxUpdateTimeInclusive?: number;\n // When provided, the associated trigger orders are returned regardless of other filters\n digests?: string[];\n limit?: number;\n // Filter by status types\n statusTypes?: TriggerServerStatusTypeFilter[];\n // Filter by trigger types\n triggerTypes?: TriggerServerTriggerTypeFilter[];\n // Filter by reduce-only orders\n reduceOnly?: boolean;\n}\n\nexport interface TriggerOrder {\n productId: number;\n triggerCriteria: TriggerCriteria;\n price: BigDecimal;\n amount: BigDecimal;\n expiration: number;\n nonce: string;\n digest: string;\n appendix: OrderAppendix;\n}\n\nexport interface TriggerOrderInfo {\n order: TriggerOrder;\n serverOrder: TriggerServerOrder;\n status: TriggerOrderStatus;\n updatedAt: number;\n placementTime: number;\n}\n\nexport interface TriggerListOrdersResponse {\n orders: TriggerOrderInfo[];\n}\n\nexport interface TriggerListTwapExecutionsParams {\n digest: string;\n}\n\nexport type TwapExecutionStatus =\n | {\n type: 'pending';\n }\n | {\n type: 'executed';\n executedTime: number;\n executeResponse: EngineServerExecuteResult;\n }\n | {\n type: 'failed';\n error: string;\n }\n | {\n type: 'cancelled';\n reason: string;\n };\n\nexport interface TwapExecutionInfo {\n executionId: number;\n scheduledTime: number;\n status: TwapExecutionStatus;\n updatedAt: number;\n}\n\nexport interface TriggerListTwapExecutionsResponse {\n executions: TwapExecutionInfo[];\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAAA;AAAA;","names":[]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nadohq/trigger-client",
|
|
3
|
-
"version": "0.1.0-alpha.
|
|
3
|
+
"version": "0.1.0-alpha.22",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"description": "> TODO: description",
|
|
@@ -37,8 +37,8 @@
|
|
|
37
37
|
}
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@nadohq/engine-client": "^0.1.0-alpha.
|
|
41
|
-
"@nadohq/shared": "^0.1.0-alpha.
|
|
40
|
+
"@nadohq/engine-client": "^0.1.0-alpha.22",
|
|
41
|
+
"@nadohq/shared": "^0.1.0-alpha.22",
|
|
42
42
|
"axios": "*",
|
|
43
43
|
"ts-mixer": "*"
|
|
44
44
|
},
|
|
@@ -48,5 +48,5 @@
|
|
|
48
48
|
"devDependencies": {
|
|
49
49
|
"viem": "*"
|
|
50
50
|
},
|
|
51
|
-
"gitHead": "
|
|
51
|
+
"gitHead": "12e3d11b8f2a2e5cfe8c5166ec4d3d6666489bdd"
|
|
52
52
|
}
|
package/src/types/clientTypes.ts
CHANGED
|
@@ -38,7 +38,7 @@ export interface TriggerPlaceOrderParams extends SignatureParams {
|
|
|
38
38
|
triggerCriteria: TriggerCriteria;
|
|
39
39
|
// If not given, engine defaults to true (leverage/borrow enabled)
|
|
40
40
|
spotLeverage?: boolean;
|
|
41
|
-
// For isolated orders, this specifies whether margin can be borrowed (i.e. whether the cross account can have a negative
|
|
41
|
+
// For isolated orders, this specifies whether margin can be borrowed (i.e. whether the cross account can have a negative USDT balance)
|
|
42
42
|
borrowMargin?: boolean;
|
|
43
43
|
digest?: string;
|
|
44
44
|
nonce?: string;
|