@rango-dev/queue-manager-rango-preset 0.1.15-next.2 → 0.1.15-next.4
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/helpers.d.ts +39 -13
- package/dist/helpers.d.ts.map +1 -1
- package/dist/queue-manager-rango-preset.cjs.development.js +396 -580
- 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 +398 -582
- package/dist/queue-manager-rango-preset.esm.js.map +1 -1
- package/dist/shared.d.ts +5 -5
- package/dist/shared.d.ts.map +1 -1
- package/package.json +2 -2
- package/src/actions/checkStatus.ts +171 -73
- package/src/actions/createTransaction.ts +5 -50
- package/src/helpers.ts +256 -672
- package/src/shared.ts +31 -33
|
@@ -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;
|
|
1
|
+
{"version":3,"file":"checkStatus.d.ts","sourceRoot":"","sources":["../src/actions/checkStatus.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAUhE,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAuV1E;;;;;;;GAOG;AACH,wBAAsB,WAAW,CAC/B,OAAO,EAAE,eAAe,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC,GACvE,OAAO,CAAC,IAAI,CAAC,CAiBf"}
|
|
@@ -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;AAY1E;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACrC,OAAO,EAAE,eAAe,CAAC,WAAW,EAAE,eAAe,EAAE,gBAAgB,CAAC,GACvE,OAAO,CAAC,IAAI,CAAC,CAsDf"}
|
package/dist/helpers.d.ts
CHANGED
|
@@ -2,9 +2,9 @@ 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
|
-
import {
|
|
5
|
+
import { Transaction, TransactionType, 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 } from './shared';
|
|
8
8
|
import { APIErrorCode, SignerErrorCode } from 'rango-types/lib';
|
|
9
9
|
declare type WhenTaskBlocked = Parameters<NonNullable<SwapQueueDef['whenTaskBlocked']>>;
|
|
10
10
|
declare type WhenTaskBlockedEvent = WhenTaskBlocked[0];
|
|
@@ -19,6 +19,10 @@ export declare function claimQueue(): {
|
|
|
19
19
|
setClaimer: (queue_id: string) => void;
|
|
20
20
|
reset: () => void;
|
|
21
21
|
};
|
|
22
|
+
export declare function useTransactionsResponse(): {
|
|
23
|
+
getTransactionResponseByHash: (hash: string) => any;
|
|
24
|
+
setTransactionResponseByHash: (hash: string, response: any) => void;
|
|
25
|
+
};
|
|
22
26
|
/**
|
|
23
27
|
* Sample inputs are:
|
|
24
28
|
* - "metamask-ETH"
|
|
@@ -35,6 +39,30 @@ export declare function splitWalletNetwork(input: string): string[];
|
|
|
35
39
|
*
|
|
36
40
|
*/
|
|
37
41
|
export declare const getCurrentStep: (swap: PendingSwap) => PendingSwapStep | null;
|
|
42
|
+
/**
|
|
43
|
+
*
|
|
44
|
+
* Returns current step transaction
|
|
45
|
+
*
|
|
46
|
+
*/
|
|
47
|
+
export declare const getCurrentStepTx: (currentStep: PendingSwapStep) => Transaction | null;
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* Set current step transaction
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
export declare const setCurrentStepTx: (currentStep: PendingSwapStep, transaction: Transaction) => PendingSwapStep;
|
|
54
|
+
/**
|
|
55
|
+
*
|
|
56
|
+
* Returns current step transaction type
|
|
57
|
+
*
|
|
58
|
+
*/
|
|
59
|
+
export declare const getCurrentStepTxType: (currentStep: PendingSwapStep) => TransactionType | undefined;
|
|
60
|
+
/**
|
|
61
|
+
*
|
|
62
|
+
* Returns a boolean indicating that current step is an approval tx or not.
|
|
63
|
+
*
|
|
64
|
+
*/
|
|
65
|
+
export declare const isApprovalCurrentStepTx: (currentStep: PendingSwapStep) => boolean;
|
|
38
66
|
/**
|
|
39
67
|
* When we are doing a swap, there are some common fields that will be updated together.
|
|
40
68
|
* This function helps us to update a swap status and also it will update some more fields like `extraMessageSeverity` based on the input.
|
|
@@ -52,11 +80,15 @@ export declare function updateSwapStatus({ getStorage, setStorage, nextStatus, n
|
|
|
52
80
|
swap: PendingSwap;
|
|
53
81
|
step: PendingSwapStep | null;
|
|
54
82
|
};
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
83
|
+
/**
|
|
84
|
+
*
|
|
85
|
+
* Set current step transaction hash, update pending swap status, and notify user if needed
|
|
86
|
+
*
|
|
87
|
+
*/
|
|
88
|
+
export declare function setStepTransactionIds({ getStorage, setStorage }: ExecuterActions<SwapStorage, SwapActionTypes>, txId: string | null, notifier: SwapQueueContext['notifier'], eventType?: EventType, explorerUrl?: {
|
|
89
|
+
url?: string;
|
|
90
|
+
description?: string;
|
|
91
|
+
}): void;
|
|
60
92
|
/**
|
|
61
93
|
* If a swap needs a wallet to be connected,
|
|
62
94
|
* By calling this function some related fields will be updated to show a correct message and state for notfiying the user.
|
|
@@ -81,12 +113,6 @@ export declare function markRunningSwapAsDependsOnOtherQueues({ getStorage, setS
|
|
|
81
113
|
step: PendingSwapStep;
|
|
82
114
|
} | undefined;
|
|
83
115
|
export declare function delay(ms: number): Promise<unknown>;
|
|
84
|
-
export declare const isEvmTransaction: (tx: Transaction) => tx is EvmTransaction;
|
|
85
|
-
export declare const isCosmosTransaction: (tx: Transaction) => tx is CosmosTransaction;
|
|
86
|
-
export declare const isSolanaTransaction: (tx: Transaction) => tx is SolanaTransaction;
|
|
87
|
-
export declare const isTrasnferTransaction: (tx: Transaction) => tx is TransferTransaction;
|
|
88
|
-
export declare const isStarknetTransaction: (tx: Transaction) => tx is StarknetTransaction;
|
|
89
|
-
export declare const isTronTransaction: (tx: Transaction) => tx is TronTransaction;
|
|
90
116
|
/**
|
|
91
117
|
*
|
|
92
118
|
* To execute a swap, we are keeping the user prefrences on what wallet they are going to use for a sepecific blockchain
|
package/dist/helpers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.d.ts","sourceRoot":"","sources":["src/helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,SAAS,EAGV,M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