@defisaver/automation-sdk 3.3.22-instant-twap-close-dev → 3.3.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.
- package/cjs/automation/private/StrategiesAutomation.d.ts +5 -1
- package/cjs/automation/private/StrategiesAutomation.js +12 -0
- package/cjs/automation/private/StrategiesAutomation.test.js +51 -0
- package/cjs/constants/index.js +0 -40
- package/cjs/services/apiSubscriptionsService.d.ts +7 -0
- package/cjs/services/apiSubscriptionsService.js +33 -0
- package/cjs/services/apiSubscriptionsService.test.d.ts +1 -0
- package/cjs/services/apiSubscriptionsService.test.js +67 -0
- package/cjs/services/strategiesService.js +0 -25
- package/cjs/services/strategiesService.test.js +0 -63
- package/cjs/services/strategySubService.d.ts +0 -1
- package/cjs/services/strategySubService.js +0 -7
- package/cjs/services/strategySubService.test.js +0 -111
- package/cjs/services/subDataService.d.ts +0 -14
- package/cjs/services/subDataService.js +2 -40
- package/cjs/services/subDataService.test.js +0 -70
- package/cjs/types/enums.d.ts +4 -14
- package/cjs/types/enums.js +0 -11
- package/cjs/types/index.d.ts +24 -2
- package/esm/automation/private/StrategiesAutomation.d.ts +5 -1
- package/esm/automation/private/StrategiesAutomation.js +12 -0
- package/esm/automation/private/StrategiesAutomation.test.js +51 -0
- package/esm/constants/index.js +0 -40
- package/esm/services/apiSubscriptionsService.d.ts +7 -0
- package/esm/services/apiSubscriptionsService.js +29 -0
- package/esm/services/apiSubscriptionsService.test.d.ts +1 -0
- package/esm/services/apiSubscriptionsService.test.js +65 -0
- package/esm/services/strategiesService.js +0 -25
- package/esm/services/strategiesService.test.js +1 -64
- package/esm/services/strategySubService.d.ts +0 -1
- package/esm/services/strategySubService.js +0 -7
- package/esm/services/strategySubService.test.js +0 -111
- package/esm/services/subDataService.d.ts +0 -14
- package/esm/services/subDataService.js +0 -38
- package/esm/services/subDataService.test.js +0 -70
- package/esm/types/enums.d.ts +4 -14
- package/esm/types/enums.js +0 -11
- package/esm/types/index.d.ts +24 -2
- package/package.json +1 -1
- package/src/automation/private/StrategiesAutomation.test.ts +65 -1
- package/src/automation/private/StrategiesAutomation.ts +17 -0
- package/src/constants/index.ts +0 -40
- package/src/services/apiSubscriptionsService.test.ts +73 -0
- package/src/services/apiSubscriptionsService.ts +33 -0
- package/src/services/strategiesService.test.ts +1 -79
- package/src/services/strategiesService.ts +0 -33
- package/src/services/strategySubService.test.ts +0 -130
- package/src/services/strategySubService.ts +0 -26
- package/src/services/subDataService.test.ts +0 -98
- package/src/services/subDataService.ts +0 -61
- package/src/types/enums.ts +0 -11
- package/src/types/index.ts +26 -2
package/src/types/index.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type Web3 from 'web3';
|
|
2
2
|
import type { AbiItem } from 'web3-utils';
|
|
3
3
|
import type { BaseContract, BlockType } from './contracts/generated/types';
|
|
4
|
-
import type {
|
|
4
|
+
import type { StrategyModel } from './contracts/generated/SubStorage';
|
|
5
5
|
import type {
|
|
6
6
|
ChainId, Strategies, Bundles, ProtocolIdentifiers,
|
|
7
7
|
RatioState,
|
|
@@ -72,6 +72,22 @@ interface _SubscriptionOptions {
|
|
|
72
72
|
|
|
73
73
|
export type SubscriptionOptions = Partial<_SubscriptionOptions>;
|
|
74
74
|
|
|
75
|
+
/** Subscription record as returned by the automation API (GET /v1/subscriptions) */
|
|
76
|
+
export interface ApiSubscriptionRecord {
|
|
77
|
+
id: number,
|
|
78
|
+
wallet: EthereumAddress,
|
|
79
|
+
wallet_type: string,
|
|
80
|
+
is_enabled: boolean,
|
|
81
|
+
is_bundle: boolean,
|
|
82
|
+
strategy_or_bundle_id: number,
|
|
83
|
+
strategy_ids: number[],
|
|
84
|
+
sub_data_hash: string,
|
|
85
|
+
trigger_data: string[],
|
|
86
|
+
sub_data: string[],
|
|
87
|
+
block_number: number,
|
|
88
|
+
additional_triggers: string[] | null,
|
|
89
|
+
}
|
|
90
|
+
|
|
75
91
|
export declare namespace Interfaces {
|
|
76
92
|
interface ProtocolBase {
|
|
77
93
|
id: ProtocolIdentifiers.StrategiesAutomation | ProtocolIdentifiers.LegacyAutomation,
|
|
@@ -369,10 +385,18 @@ export type StrategyOrBundleIds =
|
|
|
369
385
|
| typeof Bundles.ArbitrumIds[keyof typeof Bundles.ArbitrumIds]
|
|
370
386
|
| typeof Bundles.BaseIds[keyof typeof Bundles.BaseIds];
|
|
371
387
|
|
|
388
|
+
/** Fields of the Subscribe event that parsing relies on */
|
|
389
|
+
export interface SubscriptionEventData {
|
|
390
|
+
subId: string,
|
|
391
|
+
proxy: EthereumAddress,
|
|
392
|
+
subHash: string,
|
|
393
|
+
subStruct: StrategyModel.StrategySubStructOutputStruct,
|
|
394
|
+
}
|
|
395
|
+
|
|
372
396
|
export interface ParseData {
|
|
373
397
|
chainId: ChainId,
|
|
374
398
|
blockNumber: BlockNumber,
|
|
375
|
-
subscriptionEventData:
|
|
399
|
+
subscriptionEventData: SubscriptionEventData,
|
|
376
400
|
strategiesSubsData: StrategyModel.StoredSubDataStructOutputStruct,
|
|
377
401
|
}
|
|
378
402
|
|