@rango-dev/queue-manager-rango-preset 0.1.10-next.96 → 0.1.10
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/dist/actions/checkStatus.d.ts.map +1 -1
- package/dist/actions/createTransaction.d.ts.map +1 -1
- package/dist/actions/scheduleNextStep.d.ts.map +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants.d.ts.map +1 -1
- package/dist/helpers.d.ts +46 -14
- package/dist/helpers.d.ts.map +1 -1
- package/dist/hooks.d.ts.map +1 -1
- package/dist/index.d.ts +4 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/queue-manager-rango-preset.cjs.development.js +397 -302
- package/dist/queue-manager-rango-preset.cjs.development.js.map +1 -1
- package/dist/queue-manager-rango-preset.cjs.production.min.js +1 -1
- package/dist/queue-manager-rango-preset.cjs.production.min.js.map +1 -1
- package/dist/queue-manager-rango-preset.esm.js +376 -288
- package/dist/queue-manager-rango-preset.esm.js.map +1 -1
- package/dist/shared-errors.d.ts +5 -37
- package/dist/shared-errors.d.ts.map +1 -1
- package/dist/shared.d.ts +20 -17
- package/dist/shared.d.ts.map +1 -1
- package/dist/types.d.ts +1 -0
- package/dist/types.d.ts.map +1 -1
- package/package.json +2 -2
- package/readme.md +1 -9
- package/src/actions/checkStatus.ts +54 -5
- package/src/actions/createTransaction.ts +2 -3
- package/src/actions/executeTransaction.ts +3 -3
- package/src/actions/scheduleNextStep.ts +1 -0
- package/src/constants.ts +1 -1
- package/src/helpers.ts +225 -174
- package/src/hooks.ts +2 -1
- package/src/index.ts +19 -44
- package/src/shared-errors.ts +53 -76
- package/src/shared.ts +34 -54
- package/src/types.ts +1 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"checkStatus.d.ts","sourceRoot":"","sources":["../src/actions/checkStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAahE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"checkStatus.d.ts","sourceRoot":"","sources":["../src/actions/checkStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAahE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAsO1E;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,eAAe,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC,GACvE,OAAO,CAAC,IAAI,CAAC,CAcf"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createTransaction.d.ts","sourceRoot":"","sources":["../src/actions/createTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"createTransaction.d.ts","sourceRoot":"","sources":["../src/actions/createTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAgB1E;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,eAAe,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC,GACvE,OAAO,CAAC,IAAI,CAAC,CA+Ff"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scheduleNextStep.d.ts","sourceRoot":"","sources":["../src/actions/scheduleNextStep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG1E;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,UAAU,EACV,UAAU,EACV,OAAO,GACR,EAAE,eAAe,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"scheduleNextStep.d.ts","sourceRoot":"","sources":["../src/actions/scheduleNextStep.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAG1E;;;;;;;;GAQG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,QAAQ,EACR,IAAI,EACJ,MAAM,EACN,UAAU,EACV,UAAU,EACV,OAAO,GACR,EAAE,eAAe,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC,GAAG,IAAI,CAwCxE"}
|
package/dist/constants.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export declare const RANGO_DAPP_API_KEY: string | undefined;
|
|
2
2
|
export declare const RANGO_DAPP_API_BASE_URL: string | undefined;
|
|
3
|
-
export declare const ERROR_MESSAGE_DEPENDS_ON_OTHER_QUEUES = "Waiting for other
|
|
3
|
+
export declare const ERROR_MESSAGE_DEPENDS_ON_OTHER_QUEUES = "Waiting for other swaps to complete";
|
|
4
4
|
export declare const ERROR_MESSAGE_WAIT_FOR_WALLET = "Waiting for connecting wallet";
|
|
5
5
|
export declare const ERROR_MESSAGE_WAIT_FOR_WALLET_DESCRIPTION_WRONG_WALLET: (type: string | null, address: string | null) => string;
|
|
6
6
|
export declare const ERROR_MESSAGE_WAIT_FOR_WALLET_DESCRIPTION: (type: string | null) => string;
|
package/dist/constants.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,oBAAgC,CAAC;AAChE,eAAO,MAAM,uBAAuB,oBAAqC,CAAC;AAE1E,eAAO,MAAM,qCAAqC,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["src/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB,oBAAgC,CAAC;AAChE,eAAO,MAAM,uBAAuB,oBAAqC,CAAC;AAE1E,eAAO,MAAM,qCAAqC,wCACX,CAAC;AACxC,eAAO,MAAM,6BAA6B,kCAAkC,CAAC;AAC7E,eAAO,MAAM,sDAAsD,SAC3D,MAAM,GAAG,IAAI,WACV,MAAM,GAAG,IAAI,KACrB,MAGC,CAAC;AACL,eAAO,MAAM,yCAAyC,SAC9C,MAAM,GAAG,IAAI,KAClB,MAGqD,CAAC;AACzD,eAAO,MAAM,qCAAqC,YACvC,MAAM,GAAG,IAAI,KACrB,MAAqD,CAAC"}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -1,13 +1,23 @@
|
|
|
1
|
-
import { ExecuterActions } from '@rango-dev/queue-manager-core';
|
|
1
|
+
import { ExecuterActions, QueueInfo } from '@rango-dev/queue-manager-core';
|
|
2
2
|
import { SwapActionTypes, SwapQueueContext, SwapQueueDef, SwapStorage } from './types';
|
|
3
3
|
import { Meta, Network, WalletState, WalletType } from '@rango-dev/wallets-shared';
|
|
4
4
|
import { Providers } from '@rango-dev/wallets-core';
|
|
5
5
|
import { TronTransaction, StarknetTransaction, CosmosTransaction, EvmTransaction, SolanaTransaction, Transfer as TransferTransaction, Transaction, EvmBlockchainMeta, CreateTransactionResponse } from 'rango-sdk';
|
|
6
6
|
import { Manager } from '@rango-dev/queue-manager-core';
|
|
7
|
-
import { EventType, PendingSwap, PendingSwapNetworkStatus, PendingSwapStep, StepStatus, SwapStatus, Wallet,
|
|
7
|
+
import { EventType, PendingSwap, PendingSwapNetworkStatus, PendingSwapStep, StepStatus, SwapStatus, Wallet, SwapProgressNotification } from './shared';
|
|
8
|
+
import { APIErrorCode, SignerErrorCode } from 'rango-types/lib';
|
|
8
9
|
declare type WhenTaskBlocked = Parameters<NonNullable<SwapQueueDef['whenTaskBlocked']>>;
|
|
9
10
|
declare type WhenTaskBlockedEvent = WhenTaskBlocked[0];
|
|
10
11
|
declare type WhenTaskBlockedMeta = WhenTaskBlocked[1];
|
|
12
|
+
/**
|
|
13
|
+
* Sample inputs are:
|
|
14
|
+
* - "metamask-ETH"
|
|
15
|
+
* - "metamask-BSC-BSC:0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
16
|
+
* - "token-pocket-BSC-BSC:0xaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa"
|
|
17
|
+
* Returns "wallet and network" separately, even if the wallet is dashed inside.
|
|
18
|
+
*
|
|
19
|
+
*/
|
|
20
|
+
export declare function splitWalletNetwork(input: string): string[];
|
|
11
21
|
/**
|
|
12
22
|
*
|
|
13
23
|
* Returns `steps`, if it's a `running` swap.
|
|
@@ -26,13 +36,13 @@ export declare function updateSwapStatus({ getStorage, setStorage, nextStatus, n
|
|
|
26
36
|
nextStepStatus?: StepStatus;
|
|
27
37
|
message?: string;
|
|
28
38
|
details?: string | null | undefined;
|
|
29
|
-
errorCode?:
|
|
39
|
+
errorCode?: APIErrorCode | SignerErrorCode | null;
|
|
30
40
|
hasAlreadyProceededToSign?: boolean;
|
|
31
41
|
}): {
|
|
32
42
|
swap: PendingSwap;
|
|
33
43
|
step: PendingSwapStep | null;
|
|
34
44
|
};
|
|
35
|
-
export declare function setStepTransactionIds({ getStorage, setStorage }: ExecuterActions<SwapStorage, SwapActionTypes>, txId: string | null,
|
|
45
|
+
export declare function setStepTransactionIds({ getStorage, setStorage }: ExecuterActions<SwapStorage, SwapActionTypes>, txId: string | null, notifier: SwapQueueContext['notifier'], eventType?: EventType, approveUrl?: string): void;
|
|
36
46
|
export declare function getSwapNotitfication(eventType: EventType, updateResult: {
|
|
37
47
|
swap: PendingSwap;
|
|
38
48
|
step: PendingSwapStep | null;
|
|
@@ -54,7 +64,9 @@ export declare function markRunningSwapAsSwitchingNetwork({ getStorage, setStora
|
|
|
54
64
|
* We are marking the queue as it depends on other queues to be run (on Parallel mode)
|
|
55
65
|
* By calling this function some related fields will be updated to show a correct message and state for notfiying the user.
|
|
56
66
|
*/
|
|
57
|
-
export declare function markRunningSwapAsDependsOnOtherQueues({ getStorage, setStorage, }: Pick<ExecuterActions, 'getStorage' | 'setStorage'>
|
|
67
|
+
export declare function markRunningSwapAsDependsOnOtherQueues({ getStorage, setStorage, notifier, }: Pick<ExecuterActions, 'getStorage' | 'setStorage'> & {
|
|
68
|
+
notifier: SwapQueueContext['notifier'];
|
|
69
|
+
}): {
|
|
58
70
|
swap: PendingSwap;
|
|
59
71
|
step: PendingSwapStep;
|
|
60
72
|
} | undefined;
|
|
@@ -100,11 +112,6 @@ export declare function getRequiredWallet(swap: PendingSwap): {
|
|
|
100
112
|
* which means the netowrk/chain of wallet should be exactly on what a transaction needs.
|
|
101
113
|
*/
|
|
102
114
|
export declare function isNetworkMatchedForTransaction(swap: PendingSwap, step: PendingSwapStep, wallet: Wallet | null, meta: Meta, providers: Providers): Promise<boolean>;
|
|
103
|
-
/**
|
|
104
|
-
* Returns the wallet address, based on the current step of `PendingSwap`.
|
|
105
|
-
*/
|
|
106
|
-
export declare const getCurrentAddressOf: (swap: PendingSwap, step: PendingSwapStep) => string;
|
|
107
|
-
export declare function getRelatedWallet(swap: PendingSwap, currentStep: PendingSwapStep): WalletTypeAndAddress;
|
|
108
115
|
export declare const isTxAlreadyCreated: (swap: PendingSwap, step: PendingSwapStep) => boolean;
|
|
109
116
|
export declare function resetNetworkStatus(actions: ExecuterActions<SwapStorage, SwapActionTypes, SwapQueueContext>): void;
|
|
110
117
|
export declare function updateNetworkStatus(actions: ExecuterActions<SwapStorage, SwapActionTypes, SwapQueueContext>, data?: {
|
|
@@ -114,7 +121,7 @@ export declare function updateNetworkStatus(actions: ExecuterActions<SwapStorage
|
|
|
114
121
|
}): void;
|
|
115
122
|
/**
|
|
116
123
|
* Event handler for blocked tasks.
|
|
117
|
-
* If a transcation execution is manually blocked (like for parallel or waiting for
|
|
124
|
+
* If a transcation execution is manually blocked (like for parallel or waiting for wallet),
|
|
118
125
|
* This function will be called by queue manager using `queue definition`.
|
|
119
126
|
*
|
|
120
127
|
* It checks if the required wallet is connected, unblock the queue to be run.
|
|
@@ -131,20 +138,41 @@ export declare function onBlockForConnectWallet(event: WhenTaskBlockedEvent, met
|
|
|
131
138
|
export declare function onBlockForChangeNetwork(_event: WhenTaskBlockedEvent, meta: WhenTaskBlockedMeta): void;
|
|
132
139
|
/**
|
|
133
140
|
* Event handler for blocked tasks. (Parallel mode)
|
|
134
|
-
* If a transcation execution is manually blocked (like for parallel or waiting for walle),
|
|
141
|
+
* If a transcation execution flow is manually blocked (like for parallel or waiting for walle),
|
|
135
142
|
* This function will be called by queue manager using `queue definition`.
|
|
136
143
|
*
|
|
137
144
|
* It checks the blocked tasks, if there is no active `claimed` queue, try to give it to the best candidate.
|
|
138
145
|
*/
|
|
139
146
|
export declare function onDependsOnOtherQueues(_event: WhenTaskBlockedEvent, meta: WhenTaskBlockedMeta): void;
|
|
140
|
-
export declare function isRequiredWalletConnected(swap: PendingSwap, getState: (type: WalletType) => WalletState):
|
|
147
|
+
export declare function isRequiredWalletConnected(swap: PendingSwap, getState: (type: WalletType) => WalletState): {
|
|
148
|
+
ok: boolean;
|
|
149
|
+
reason: 'not_connected' | 'account_miss_match';
|
|
150
|
+
};
|
|
141
151
|
export declare function singTransaction(actions: ExecuterActions<SwapStorage, SwapActionTypes, SwapQueueContext>): void;
|
|
142
152
|
export declare function checkWaitingForConnectWalletChange(params: {
|
|
143
153
|
wallet_network: string;
|
|
144
154
|
manager?: Manager;
|
|
145
155
|
evmChains: EvmBlockchainMeta[];
|
|
156
|
+
notifier: SwapQueueContext['notifier'];
|
|
146
157
|
}): void;
|
|
147
158
|
export declare function checkWaitingForNetworkChange(manager?: Manager): void;
|
|
159
|
+
/**
|
|
160
|
+
* Get list of all running swaps
|
|
161
|
+
*
|
|
162
|
+
* @param manager
|
|
163
|
+
* @returns list of pending swaps
|
|
164
|
+
*/
|
|
165
|
+
export declare function getRunningSwaps(manager: Manager): PendingSwap[];
|
|
166
|
+
/**
|
|
167
|
+
*
|
|
168
|
+
* Trying to reset notifications for pending swaps to correct message on page load.
|
|
169
|
+
* We could remove this after supporting auto connect for wallets.
|
|
170
|
+
*
|
|
171
|
+
* @param swaps
|
|
172
|
+
* @param notifier
|
|
173
|
+
* @returns
|
|
174
|
+
*/
|
|
175
|
+
export declare function resetRunningSwapNotifsOnPageLoad(runningSwaps: PendingSwap[], notifier: SwapQueueContext['notifier']): void;
|
|
148
176
|
/**
|
|
149
177
|
*
|
|
150
178
|
* Try to run blocked tasks by wallet and network name.
|
|
@@ -156,10 +184,14 @@ export declare function checkWaitingForNetworkChange(manager?: Manager): void;
|
|
|
156
184
|
* @param manager
|
|
157
185
|
* @returns
|
|
158
186
|
*/
|
|
159
|
-
export declare function retryOn(wallet_network: string, manager?: Manager, options?: {
|
|
187
|
+
export declare function retryOn(wallet_network: string, notifier: SwapQueueContext['notifier'], manager?: Manager, options?: {
|
|
160
188
|
fallbackToOnlyWallet: boolean;
|
|
161
189
|
}): void;
|
|
162
190
|
export declare function isNeedBlockQueueForParallel(step: PendingSwapStep): boolean;
|
|
163
191
|
export declare function throwOnOK(rawResponse: Promise<CreateTransactionResponse>): Promise<CreateTransactionResponse>;
|
|
192
|
+
export declare function cancelSwap(swap: QueueInfo): {
|
|
193
|
+
swap: PendingSwap;
|
|
194
|
+
step: PendingSwapStep | null;
|
|
195
|
+
};
|
|
164
196
|
export {};
|
|
165
197
|
//# sourceMappingURL=helpers.d.ts.map
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["src/helpers.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-1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["src/hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIhD;;;;;GAKG;AACH,iBAAS,YAAY,IAAI;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAmBA;AAED;;;;;GAKG;AACH,iBAAS,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,
|
|
1
|
+
{"version":3,"file":"hooks.d.ts","sourceRoot":"","sources":["src/hooks.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,qBAAqB,EAAE,MAAM,SAAS,CAAC;AAIhD;;;;;GAKG;AACH,iBAAS,YAAY,IAAI;IACvB,MAAM,EAAE,OAAO,CAAC;CACjB,CAmBA;AAED;;;;;GAKG;AACH,iBAAS,eAAe,CAAC,MAAM,EAAE,qBAAqB,GAAG,IAAI,CA0B5D;AAED,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,CAAC"}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,14 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
*
|
|
4
|
-
* The idea behind this queue is to be able dynamically add some steps.
|
|
5
|
-
* After running a swap, it can be blocked (like on waiting for switch netwrok)
|
|
6
|
-
* or waits for something happend (like checking status of a transaction from server)
|
|
7
|
-
*
|
|
8
|
-
*/
|
|
9
|
-
export declare const swapQueueDef: SwapQueueDef;
|
|
1
|
+
export { PrettyError, prettifyErrorMessage } from './shared-errors';
|
|
10
2
|
export { SwapQueueContext, SwapStorage } from './types';
|
|
11
|
-
export { PendingSwapWithQueueID } from './shared';
|
|
12
|
-
export { updateSwapStatus, checkWaitingForNetworkChange, getCurrentStep, getEvmProvider,
|
|
3
|
+
export { PendingSwapWithQueueID, getCurrentBlockchainOfOrNull, getRelatedWalletOrNull, getRelatedWallet, MessageSeverity, PendingSwapStep, PendingSwapNetworkStatus, PendingSwap, EventType, SwapProgressNotification, } from './shared';
|
|
4
|
+
export { updateSwapStatus, checkWaitingForNetworkChange, getCurrentStep, getEvmProvider, cancelSwap, getRequiredWallet, getRunningSwaps, splitWalletNetwork, resetRunningSwapNotifsOnPageLoad, } from './helpers';
|
|
5
|
+
export { swapQueueDef } from './queueDef';
|
|
13
6
|
export { useMigration, useQueueManager } from './hooks';
|
|
14
7
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,oBAAoB,EAAE,MAAM,iBAAiB,CAAC;AACpE,OAAO,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EACL,sBAAsB,EACtB,4BAA4B,EAC5B,sBAAsB,EACtB,gBAAgB,EAChB,eAAe,EACf,eAAe,EACf,wBAAwB,EACxB,WAAW,EACX,SAAS,EACT,wBAAwB,GACzB,MAAM,UAAU,CAAC;AAClB,OAAO,EACL,gBAAgB,EAChB,4BAA4B,EAC5B,cAAc,EACd,cAAc,EACd,UAAU,EACV,iBAAiB,EACjB,eAAe,EACf,kBAAkB,EAClB,gCAAgC,GACjC,MAAM,WAAW,CAAC;AACnB,OAAO,EAAE,YAAY,EAAE,MAAM,YAAY,CAAC;AAC1C,OAAO,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC"}
|