@rango-dev/queue-manager-rango-preset 0.47.1-next.4 → 0.47.1-next.5

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
- {"inputs":{"src/configs.ts":{"bytes":816,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":7452,"imports":[],"format":"esm"},"src/constants.ts":{"bytes":742,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/services/httpService.ts":{"bytes":284,"imports":[{"path":"rango-sdk","kind":"import-statement","external":true},{"path":"src/configs.ts","kind":"import-statement","original":"../configs"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/services/index.ts":{"bytes":45,"imports":[{"path":"src/services/httpService.ts","kind":"import-statement","original":"./httpService"}],"format":"esm"},"src/numbers.ts":{"bytes":1637,"imports":[{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/shared-errors.ts":{"bytes":4547,"imports":[{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/shared.ts":{"bytes":12267,"imports":[{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"src/numbers.ts","kind":"import-statement","original":"./numbers"},{"path":"src/shared-errors.ts","kind":"import-statement","original":"./shared-errors"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/services/eventEmitter.ts":{"bytes":8191,"imports":[{"path":"src/configs.ts","kind":"import-statement","original":"../configs"},{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/shared.ts","kind":"import-statement","original":"../shared"},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/helpers.ts":{"bytes":46250,"imports":[{"path":"@rango-dev/logging-core","kind":"import-statement","external":true},{"path":"@rango-dev/queue-manager-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/services/index.ts","kind":"import-statement","original":"./services"},{"path":"src/services/eventEmitter.ts","kind":"import-statement","original":"./services/eventEmitter"},{"path":"src/shared.ts","kind":"import-statement","original":"./shared"},{"path":"src/shared-errors.ts","kind":"import-statement","original":"./shared-errors"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/actions/checkStatus.ts":{"bytes":15772,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/services/index.ts","kind":"import-statement","original":"../services"},{"path":"src/services/eventEmitter.ts","kind":"import-statement","original":"../services/eventEmitter"},{"path":"src/shared.ts","kind":"import-statement","original":"../shared"},{"path":"src/shared-errors.ts","kind":"import-statement","original":"../shared-errors"},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/actions/createTransaction.ts":{"bytes":3041,"imports":[{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/services/index.ts","kind":"import-statement","original":"../services"},{"path":"src/services/eventEmitter.ts","kind":"import-statement","original":"../services/eventEmitter"},{"path":"src/shared-errors.ts","kind":"import-statement","original":"../shared-errors"},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/actions/executeTransaction.ts":{"bytes":4424,"imports":[{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/shared.ts","kind":"import-statement","original":"../shared"},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/actions/scheduleNextStep.ts":{"bytes":2758,"imports":[{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/services/eventEmitter.ts","kind":"import-statement","original":"../services/eventEmitter"},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/actions/start.ts":{"bytes":484,"imports":[{"path":"@rango-dev/queue-manager-core","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"src/services/eventEmitter.ts","kind":"import-statement","original":"../services/eventEmitter"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/queueDef.ts":{"bytes":1523,"imports":[{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/actions/checkStatus.ts","kind":"import-statement","original":"./actions/checkStatus"},{"path":"src/actions/createTransaction.ts","kind":"import-statement","original":"./actions/createTransaction"},{"path":"src/actions/executeTransaction.ts","kind":"import-statement","original":"./actions/executeTransaction"},{"path":"src/actions/scheduleNextStep.ts","kind":"import-statement","original":"./actions/scheduleNextStep"},{"path":"src/actions/start.ts","kind":"import-statement","original":"./actions/start"},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"}],"format":"esm"},"src/migration.ts":{"bytes":3321,"imports":[{"path":"@rango-dev/queue-manager-core","kind":"import-statement","external":true},{"path":"uuid","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hooks.ts":{"bytes":2290,"imports":[{"path":"@rango-dev/queue-manager-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/migration.ts","kind":"import-statement","original":"./migration"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1522,"imports":[{"path":"src/configs.ts","kind":"import-statement","original":"./configs"},{"path":"src/queueDef.ts","kind":"import-statement","original":"./queueDef"},{"path":"src/shared-errors.ts","kind":"import-statement","original":"./shared-errors"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/shared.ts","kind":"import-statement","original":"./shared"},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/hooks.ts","kind":"import-statement","original":"./hooks"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":175845},"dist/index.js":{"imports":[{"path":"@rango-dev/logging-core","kind":"import-statement","external":true},{"path":"@rango-dev/queue-manager-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"rango-sdk","kind":"import-statement","external":true},{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"@rango-dev/queue-manager-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/queue-manager-core","kind":"import-statement","external":true},{"path":"uuid","kind":"import-statement","external":true}],"exports":["EventSeverity","MessageSeverity","PrettyError","RouteEventType","StepEventType","StepExecutionBlockedEventStatus","StepExecutionEventStatus","WidgetEvents","calculatePendingSwap","cancelSwap","checkWaitingForNetworkChange","getCurrentNamespaceOfOrNull","getCurrentStep","getLastSuccessfulStep","getRelatedWallet","getRelatedWalletOrNull","getRequiredWallet","getRunningSwaps","getUsdPrice","isApprovalTX","makeQueueDefinition","prettifyErrorMessage","resetRunningSwapNotifsOnPageLoad","updateSwapStatus","useMigration","useQueueManager"],"entryPoint":"src/index.ts","inputs":{"src/configs.ts":{"bytesInOutput":167},"src/types.ts":{"bytesInOutput":846},"src/constants.ts":{"bytesInOutput":431},"src/helpers.ts":{"bytesInOutput":16311},"src/services/httpService.ts":{"bytesInOutput":118},"src/services/index.ts":{"bytesInOutput":0},"src/shared.ts":{"bytesInOutput":5141},"src/numbers.ts":{"bytesInOutput":689},"src/shared-errors.ts":{"bytesInOutput":2212},"src/services/eventEmitter.ts":{"bytesInOutput":3548},"src/actions/checkStatus.ts":{"bytesInOutput":5534},"src/actions/createTransaction.ts":{"bytesInOutput":895},"src/actions/executeTransaction.ts":{"bytesInOutput":957},"src/actions/scheduleNextStep.ts":{"bytesInOutput":804},"src/actions/start.ts":{"bytesInOutput":155},"src/queueDef.ts":{"bytesInOutput":340},"src/index.ts":{"bytesInOutput":59},"src/hooks.ts":{"bytesInOutput":652},"src/migration.ts":{"bytesInOutput":1138}},"bytes":40753}}}
1
+ {"inputs":{"src/configs.ts":{"bytes":816,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/types.ts":{"bytes":7452,"imports":[],"format":"esm"},"src/constants.ts":{"bytes":742,"imports":[{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/services/httpService.ts":{"bytes":284,"imports":[{"path":"rango-sdk","kind":"import-statement","external":true},{"path":"src/configs.ts","kind":"import-statement","original":"../configs"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/services/index.ts":{"bytes":45,"imports":[{"path":"src/services/httpService.ts","kind":"import-statement","original":"./httpService"}],"format":"esm"},"src/numbers.ts":{"bytes":1637,"imports":[{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/shared-errors.ts":{"bytes":4547,"imports":[{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/shared.ts":{"bytes":12267,"imports":[{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"src/numbers.ts","kind":"import-statement","original":"./numbers"},{"path":"src/shared-errors.ts","kind":"import-statement","original":"./shared-errors"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/services/eventEmitter.ts":{"bytes":8198,"imports":[{"path":"src/configs.ts","kind":"import-statement","original":"../configs"},{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/shared.ts","kind":"import-statement","original":"../shared"},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/helpers.ts":{"bytes":46708,"imports":[{"path":"@rango-dev/logging-core","kind":"import-statement","external":true},{"path":"@rango-dev/queue-manager-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"./constants"},{"path":"src/services/index.ts","kind":"import-statement","original":"./services"},{"path":"src/services/eventEmitter.ts","kind":"import-statement","original":"./services/eventEmitter"},{"path":"src/shared.ts","kind":"import-statement","original":"./shared"},{"path":"src/shared-errors.ts","kind":"import-statement","original":"./shared-errors"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/actions/checkStatus.ts":{"bytes":17008,"imports":[{"path":"@rango-dev/logging-core","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/services/index.ts","kind":"import-statement","original":"../services"},{"path":"src/services/eventEmitter.ts","kind":"import-statement","original":"../services/eventEmitter"},{"path":"src/shared.ts","kind":"import-statement","original":"../shared"},{"path":"src/shared-errors.ts","kind":"import-statement","original":"../shared-errors"},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/actions/createTransaction.ts":{"bytes":3220,"imports":[{"path":"@rango-dev/logging-core","kind":"import-statement","external":true},{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/services/index.ts","kind":"import-statement","original":"../services"},{"path":"src/services/eventEmitter.ts","kind":"import-statement","original":"../services/eventEmitter"},{"path":"src/shared-errors.ts","kind":"import-statement","original":"../shared-errors"},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/actions/executeTransaction.ts":{"bytes":4424,"imports":[{"path":"rango-types","kind":"import-statement","external":true},{"path":"src/constants.ts","kind":"import-statement","original":"../constants"},{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/shared.ts","kind":"import-statement","original":"../shared"},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/actions/scheduleNextStep.ts":{"bytes":2758,"imports":[{"path":"src/helpers.ts","kind":"import-statement","original":"../helpers"},{"path":"src/services/eventEmitter.ts","kind":"import-statement","original":"../services/eventEmitter"},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/actions/start.ts":{"bytes":484,"imports":[{"path":"@rango-dev/queue-manager-core","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"../types"},{"path":"src/services/eventEmitter.ts","kind":"import-statement","original":"../services/eventEmitter"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/queueDef.ts":{"bytes":1523,"imports":[{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/actions/checkStatus.ts","kind":"import-statement","original":"./actions/checkStatus"},{"path":"src/actions/createTransaction.ts","kind":"import-statement","original":"./actions/createTransaction"},{"path":"src/actions/executeTransaction.ts","kind":"import-statement","original":"./actions/executeTransaction"},{"path":"src/actions/scheduleNextStep.ts","kind":"import-statement","original":"./actions/scheduleNextStep"},{"path":"src/actions/start.ts","kind":"import-statement","original":"./actions/start"},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"}],"format":"esm"},"src/migration.ts":{"bytes":3321,"imports":[{"path":"@rango-dev/queue-manager-core","kind":"import-statement","external":true},{"path":"uuid","kind":"import-statement","external":true},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/hooks.ts":{"bytes":2290,"imports":[{"path":"@rango-dev/queue-manager-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/migration.ts","kind":"import-statement","original":"./migration"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"},"src/index.ts":{"bytes":1522,"imports":[{"path":"src/configs.ts","kind":"import-statement","original":"./configs"},{"path":"src/queueDef.ts","kind":"import-statement","original":"./queueDef"},{"path":"src/shared-errors.ts","kind":"import-statement","original":"./shared-errors"},{"path":"src/types.ts","kind":"import-statement","original":"./types"},{"path":"src/shared.ts","kind":"import-statement","original":"./shared"},{"path":"src/helpers.ts","kind":"import-statement","original":"./helpers"},{"path":"src/hooks.ts","kind":"import-statement","original":"./hooks"},{"path":"<runtime>","kind":"import-statement","external":true}],"format":"esm"}},"outputs":{"dist/index.js.map":{"imports":[],"exports":[],"inputs":{},"bytes":178974},"dist/index.js":{"imports":[{"path":"@rango-dev/logging-core","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"@rango-dev/logging-core","kind":"import-statement","external":true},{"path":"@rango-dev/queue-manager-core","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-core/legacy","kind":"import-statement","external":true},{"path":"@rango-dev/wallets-shared","kind":"import-statement","external":true},{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"rango-sdk","kind":"import-statement","external":true},{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"bignumber.js","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"@rango-dev/logging-core","kind":"import-statement","external":true},{"path":"rango-types","kind":"import-statement","external":true},{"path":"@rango-dev/queue-manager-react","kind":"import-statement","external":true},{"path":"react","kind":"import-statement","external":true},{"path":"@rango-dev/queue-manager-core","kind":"import-statement","external":true},{"path":"uuid","kind":"import-statement","external":true}],"exports":["EventSeverity","MessageSeverity","PrettyError","RouteEventType","StepEventType","StepExecutionBlockedEventStatus","StepExecutionEventStatus","WidgetEvents","calculatePendingSwap","cancelSwap","checkWaitingForNetworkChange","getCurrentNamespaceOfOrNull","getCurrentStep","getLastSuccessfulStep","getRelatedWallet","getRelatedWalletOrNull","getRequiredWallet","getRunningSwaps","getUsdPrice","isApprovalTX","makeQueueDefinition","prettifyErrorMessage","resetRunningSwapNotifsOnPageLoad","updateSwapStatus","useMigration","useQueueManager"],"entryPoint":"src/index.ts","inputs":{"src/configs.ts":{"bytesInOutput":167},"src/types.ts":{"bytesInOutput":848},"src/actions/checkStatus.ts":{"bytesInOutput":6222},"src/helpers.ts":{"bytesInOutput":16439},"src/constants.ts":{"bytesInOutput":431},"src/services/httpService.ts":{"bytesInOutput":118},"src/services/index.ts":{"bytesInOutput":0},"src/shared.ts":{"bytesInOutput":5142},"src/numbers.ts":{"bytesInOutput":689},"src/shared-errors.ts":{"bytesInOutput":2212},"src/services/eventEmitter.ts":{"bytesInOutput":3548},"src/actions/createTransaction.ts":{"bytesInOutput":1035},"src/actions/executeTransaction.ts":{"bytesInOutput":957},"src/actions/scheduleNextStep.ts":{"bytesInOutput":804},"src/actions/start.ts":{"bytesInOutput":155},"src/queueDef.ts":{"bytesInOutput":340},"src/index.ts":{"bytesInOutput":59},"src/hooks.ts":{"bytesInOutput":652},"src/migration.ts":{"bytesInOutput":1138}},"bytes":41713}}}
@@ -1,11 +1,10 @@
1
1
  import type { RemoveNameField, StepEvent } from '../types';
2
2
  import type { PendingSwap, PendingSwapStep } from 'rango-types';
3
- type NotifierParams = {
3
+ export type NotifierParams = {
4
4
  swap: PendingSwap;
5
5
  step: PendingSwapStep | null;
6
6
  } & {
7
7
  event: RemoveNameField<StepEvent, 'message' | 'messageSeverity'>;
8
8
  };
9
9
  export declare function notifier(params: NotifierParams): void;
10
- export {};
11
10
  //# sourceMappingURL=eventEmitter.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eventEmitter.d.ts","sourceRoot":"","sources":["../../src/services/eventEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAIf,SAAS,EACV,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAqBhE,KAAK,cAAc,GAAG;IACpB,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;CAC9B,GAAG;IACF,KAAK,EAAE,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,iBAAiB,CAAC,CAAC;CAClE,CAAC;AAwJF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,QAsG9C"}
1
+ {"version":3,"file":"eventEmitter.d.ts","sourceRoot":"","sources":["../../src/services/eventEmitter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EAIf,SAAS,EACV,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,WAAW,EAAE,eAAe,EAAE,MAAM,aAAa,CAAC;AAqBhE,MAAM,MAAM,cAAc,GAAG;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,IAAI,EAAE,eAAe,GAAG,IAAI,CAAC;CAC9B,GAAG;IACF,KAAK,EAAE,eAAe,CAAC,SAAS,EAAE,SAAS,GAAG,iBAAiB,CAAC,CAAC;CAClE,CAAC;AAwJF,wBAAgB,QAAQ,CAAC,MAAM,EAAE,cAAc,QAsG9C"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rango-dev/queue-manager-rango-preset",
3
- "version": "0.47.1-next.4",
3
+ "version": "0.47.1-next.5",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "source": "./src/index.ts",
@@ -1,10 +1,16 @@
1
1
  import type { SwapQueueContext, SwapStorage } from '../types';
2
2
  import type { ExecuterActions } from '@rango-dev/queue-manager-core';
3
- import type { Transaction, TransactionStatusResponse } from 'rango-sdk';
4
- import type { GenericSigner } from 'rango-types';
3
+ import type {
4
+ CheckTxStatusRequest,
5
+ Transaction,
6
+ TransactionStatusResponse,
7
+ } from 'rango-sdk';
8
+
9
+ import { warn } from '@rango-dev/logging-core';
10
+ import { type GenericSigner, SignerError } from 'rango-types';
5
11
 
6
- import { DEFAULT_ERROR_CODE } from '../constants';
7
12
  import {
13
+ createStepFailedEvent,
8
14
  delay,
9
15
  getCurrentStep,
10
16
  getCurrentStepTx,
@@ -51,6 +57,7 @@ async function checkTransactionStatus({
51
57
  >): Promise<void> {
52
58
  const swap = getStorage().swapDetails;
53
59
  const { meta } = context;
60
+ const checkStatusError = new Error('check status Error');
54
61
 
55
62
  const currentStep = getCurrentStep(swap)!;
56
63
 
@@ -137,15 +144,22 @@ async function checkTransactionStatus({
137
144
  errorCode: extraMessageErrorCode,
138
145
  });
139
146
 
140
- notifier({
141
- event: {
142
- type: StepEventType.FAILED,
143
- reason: extraMessage,
144
- reasonCode: updateResult.failureType ?? DEFAULT_ERROR_CODE,
145
- inputAmount: getLastFinishedStepInput(swap),
146
- inputAmountUsd: getLastFinishedStepInputUsd(swap),
147
+ const event = createStepFailedEvent(
148
+ swap,
149
+ extraMessage,
150
+ updateResult.failureType
151
+ );
152
+
153
+ warn(checkStatusError, {
154
+ tags: {
155
+ type: 'singer-error',
156
+ reason: event.reason,
157
+ reasonCode: event.reasonCode,
158
+ message: extraMessage,
159
+ messageDetail: extraMessageDetail,
160
+ pendingSwap: swap,
147
161
  },
148
- ...updateResult,
162
+ context: SignerError.isSignerError(error) ? error.getErrorContext() : {},
149
163
  });
150
164
 
151
165
  getTxReceiptFailed = true;
@@ -155,16 +169,21 @@ async function checkTransactionStatus({
155
169
  */
156
170
  }
157
171
 
172
+ const requestBody: CheckTxStatusRequest = {
173
+ requestId: swap.requestId,
174
+ txId,
175
+ step: currentStep.id,
176
+ };
177
+
158
178
  try {
159
- status = await httpService().checkStatus({
160
- requestId: swap.requestId,
161
- txId,
162
- step: currentStep.id,
163
- });
179
+ status = await httpService().checkStatus(requestBody);
164
180
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
165
181
  } catch (e) {
166
182
  await delay(INTERVAL_FOR_CHECK_STATUS);
167
183
  retry();
184
+ warn(checkStatusError, {
185
+ tags: { type: 'request-error', requestBody, pendingSwap: swap },
186
+ });
168
187
  return;
169
188
  }
170
189
 
@@ -242,6 +261,14 @@ async function checkTransactionStatus({
242
261
  swap.extraMessageDetail = status?.extraMessage || '';
243
262
  swap.status = 'failed';
244
263
  swap.finishTime = new Date().getTime().toString();
264
+ warn(checkStatusError, {
265
+ tags: {
266
+ type: 'transaction-failed',
267
+ message: swap.extraMessage,
268
+ messageDetails: swap.extraMessageDetail,
269
+ pendingSwap: swap,
270
+ },
271
+ });
245
272
  }
246
273
 
247
274
  // Sync data with storage
@@ -282,6 +309,7 @@ async function checkApprovalStatus({
282
309
  const { meta } = context;
283
310
  const { getTransactionDataByHash, setTransactionDataByHash } =
284
311
  inMemoryTransactionsData();
312
+ const checkApprovalStatusError = new Error('check approval status error');
285
313
 
286
314
  const currentStep = getCurrentStep(swap);
287
315
  if (!currentStep) {
@@ -366,24 +394,41 @@ async function checkApprovalStatus({
366
394
  details: extraMessageDetail,
367
395
  errorCode: extraMessageErrorCode,
368
396
  });
397
+
398
+ const event = createStepFailedEvent(
399
+ swap,
400
+ extraMessage,
401
+ updateResult.failureType
402
+ );
403
+
369
404
  notifier({
370
- event: {
371
- type: StepEventType.FAILED,
372
- reason: extraMessage,
373
- reasonCode: updateResult.failureType ?? DEFAULT_ERROR_CODE,
374
- inputAmount: getLastFinishedStepInput(swap),
375
- inputAmountUsd: getLastFinishedStepInputUsd(swap),
376
- },
405
+ event,
377
406
  ...updateResult,
378
407
  });
408
+ warn(checkApprovalStatusError, {
409
+ tags: {
410
+ type: 'singer-error',
411
+ reason: event.reason,
412
+ reasonCode: event.reasonCode,
413
+ message: extraMessage,
414
+ messageDetail: extraMessageDetail,
415
+ pendingSwap: swap,
416
+ },
417
+ context: SignerError.isSignerError(error) ? error.getErrorContext() : {},
418
+ });
379
419
  return failed();
380
420
  }
381
421
 
382
422
  let isApproved = false;
423
+ const request: { requestId: string; txId?: string } = {
424
+ requestId: swap.requestId,
425
+ txId: currentStep.executedTransactionId,
426
+ };
427
+
383
428
  try {
384
429
  const response = await httpService().checkApproval(
385
- swap.requestId,
386
- currentStep.executedTransactionId
430
+ request.requestId,
431
+ request.txId
387
432
  );
388
433
  // If user cancel swap during check status api call, we should ignore check approval response
389
434
  if (currentStep?.status === 'failed') {
@@ -421,17 +466,26 @@ async function checkApprovalStatus({
421
466
  details: details,
422
467
  });
423
468
 
469
+ const event = createStepFailedEvent(
470
+ swap,
471
+ message,
472
+ updateResult.failureType
473
+ );
474
+
424
475
  notifier({
425
- event: {
426
- type: StepEventType.FAILED,
427
- reason: message,
428
- reasonCode: updateResult.failureType ?? DEFAULT_ERROR_CODE,
429
- inputAmount: getLastFinishedStepInput(swap),
430
- inputAmountUsd: getLastFinishedStepInputUsd(swap),
431
- },
476
+ event,
432
477
  ...updateResult,
433
478
  });
434
479
 
480
+ warn(checkApprovalStatusError, {
481
+ tags: {
482
+ type: 'approval-failed',
483
+ message: swap.extraMessage,
484
+ messageDetails: swap.extraMessageDetail,
485
+ pendingSwap: swap,
486
+ },
487
+ });
488
+
435
489
  failed();
436
490
  } else if (!isApproved) {
437
491
  // it is needed to set notification after reloading the page
@@ -444,6 +498,9 @@ async function checkApprovalStatus({
444
498
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
445
499
  } catch (e) {
446
500
  isApproved = false;
501
+ warn(checkApprovalStatusError, {
502
+ tags: { type: 'request-error', requestBody: request, pendingSwap: swap },
503
+ });
447
504
  }
448
505
  if (isApproved) {
449
506
  currentStep.status = 'approved';
@@ -2,11 +2,12 @@ import type { SwapQueueContext, SwapStorage } from '../types';
2
2
  import type { ExecuterActions } from '@rango-dev/queue-manager-core';
3
3
  import type { CreateTransactionRequest } from 'rango-sdk';
4
4
 
5
- import { DEFAULT_ERROR_CODE } from '../constants';
5
+ import { warn } from '@rango-dev/logging-core';
6
+
6
7
  import {
8
+ createStepFailedEvent,
7
9
  getCurrentStep,
8
10
  getCurrentStepTx,
9
- getLastFinishedStepInput,
10
11
  setCurrentStepTx,
11
12
  throwOnOK,
12
13
  updateSwapStatus,
@@ -72,7 +73,7 @@ export async function createTransaction(
72
73
  setStorage({ ...getStorage(), swapDetails: swap });
73
74
  schedule(SwapActionTypes.EXECUTE_TRANSACTION);
74
75
  next();
75
- } catch (error) {
76
+ } catch (error: unknown) {
76
77
  swap.status = 'failed';
77
78
  swap.finishTime = new Date().getTime().toString();
78
79
  const { extraMessage, extraMessageDetail } = prettifyErrorMessage(error);
@@ -87,17 +88,29 @@ export async function createTransaction(
87
88
  errorCode: 'FETCH_TX_FAILED',
88
89
  });
89
90
 
91
+ const event = createStepFailedEvent(
92
+ swap,
93
+ extraMessage,
94
+ updateResult.failureType
95
+ );
96
+
90
97
  notifier({
91
- event: {
92
- type: StepEventType.FAILED,
93
- reason: extraMessage,
94
- reasonCode: updateResult.failureType ?? DEFAULT_ERROR_CODE,
95
- inputAmount: getLastFinishedStepInput(swap),
96
- inputAmountUsd: getLastFinishedStepInput(swap),
97
- },
98
+ event,
98
99
  ...updateResult,
99
100
  });
100
101
 
102
+ if (error instanceof Error) {
103
+ warn(new Error('create transaction error'), {
104
+ tags: {
105
+ message: error.message,
106
+ requestBody: request,
107
+ reason: event.reason,
108
+ reasonCode: event.reasonCode,
109
+ pendingSwap: swap,
110
+ },
111
+ });
112
+ }
113
+
101
114
  actions.failed();
102
115
  }
103
116
  }
package/src/helpers.ts CHANGED
@@ -1,6 +1,7 @@
1
1
  /* eslint-disable destructuring/in-params */
2
2
 
3
3
  /* eslint-disable @typescript-eslint/no-floating-promises */
4
+ import type { NotifierParams } from './services/eventEmitter';
4
5
  import type { SwapStatus, TargetNamespace, Wallet } from './shared';
5
6
  import type {
6
7
  ArrayElement,
@@ -1634,3 +1635,17 @@ export function getLastSuccessfulStepOutputUsd(swap: PendingSwap): string {
1634
1635
  lastSuccessfulStep?.toUsdPrice ?? ''
1635
1636
  );
1636
1637
  }
1638
+
1639
+ export function createStepFailedEvent(
1640
+ swap: PendingSwap,
1641
+ message: string,
1642
+ reasonCode?: APIErrorCode
1643
+ ): NotifierParams['event'] & { type: StepEventType.FAILED } {
1644
+ return {
1645
+ type: StepEventType.FAILED,
1646
+ reason: message,
1647
+ reasonCode: reasonCode ?? DEFAULT_ERROR_CODE,
1648
+ inputAmount: getLastFinishedStepInput(swap),
1649
+ inputAmountUsd: getLastFinishedStepInputUsd(swap),
1650
+ };
1651
+ }
@@ -26,7 +26,7 @@ import {
26
26
  WidgetEvents,
27
27
  } from '../types';
28
28
 
29
- type NotifierParams = {
29
+ export type NotifierParams = {
30
30
  swap: PendingSwap;
31
31
  step: PendingSwapStep | null;
32
32
  } & {