rango-sdk-basic 0.0.2 → 0.0.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.
- package/lib/services/client.d.ts +1 -1
- package/lib/services/client.d.ts.map +1 -1
- package/lib/services/client.js +18 -8
- package/lib/services/client.js.map +1 -1
- package/lib/types/api/common.d.ts +2 -2
- package/lib/types/api/common.d.ts.map +1 -1
- package/lib/types/api/common.js.map +1 -1
- package/lib/types/api/routing.d.ts +3 -1
- package/lib/types/api/routing.d.ts.map +1 -1
- package/lib/types/api/transactions.d.ts +46 -5
- package/lib/types/api/transactions.d.ts.map +1 -1
- package/lib/types/api/transactions.js.map +1 -1
- package/package.json +1 -1
package/lib/services/client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { MetaResponse, QuoteRequest, QuoteResponse, CheckApprovalResponse, StatusRequest, StatusResponse, SwapRequest, SwapResponse, ReportTransactionRequest, WalletDetailsResponse } from
|
|
1
|
+
import { MetaResponse, QuoteRequest, QuoteResponse, CheckApprovalResponse, StatusRequest, StatusResponse, SwapRequest, SwapResponse, ReportTransactionRequest, WalletDetailsResponse } from '../types';
|
|
2
2
|
declare type WalletAddress = {
|
|
3
3
|
blockchain: string;
|
|
4
4
|
address: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,wBAAwB,EACxB,qBAAqB,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,YAAY,EACZ,aAAa,EACb,qBAAqB,EACrB,aAAa,EACb,cAAc,EACd,WAAW,EACX,YAAY,EACZ,wBAAwB,EACxB,qBAAqB,EAEtB,MAAM,UAAU,CAAA;AAEjB,aAAK,aAAa,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAA;AAE5D,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IAEjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAEnB,MAAM,EAAE,MAAM;IAoBb,IAAI,IAAI,OAAO,CAAC,YAAY,CAAC;IAO7B,KAAK,CAAC,YAAY,EAAE,YAAY,GAAG,OAAO,CAAC,aAAa,CAAC;IAyBzD,UAAU,CACrB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,MAAM,GACX,OAAO,CAAC,qBAAqB,CAAC;IAWpB,MAAM,CAAC,aAAa,EAAE,aAAa,GAAG,OAAO,CAAC,cAAc,CAAC;IAW7D,IAAI,CAAC,WAAW,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC;IAyBrD,aAAa,CACxB,WAAW,EAAE,wBAAwB,GACpC,OAAO,CAAC,IAAI,CAAC;IAUH,OAAO,CAClB,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,qBAAqB,CAAC;CAUlC"}
|
package/lib/services/client.js
CHANGED
|
@@ -93,10 +93,15 @@ var RangoClient = /** @class */ (function () {
|
|
|
93
93
|
return __generator(this, function (_a) {
|
|
94
94
|
switch (_a.label) {
|
|
95
95
|
case 0:
|
|
96
|
-
body = __assign(__assign({}, quoteRequest), { from: (0, types_1.assetToString)(quoteRequest.from), to: (0, types_1.assetToString)(quoteRequest.to)
|
|
96
|
+
body = __assign(__assign({}, quoteRequest), { from: (0, types_1.assetToString)(quoteRequest.from), to: (0, types_1.assetToString)(quoteRequest.to), swappers: !!quoteRequest.swappers && quoteRequest.swappers.length > 0
|
|
97
|
+
? quoteRequest.swappers.join(',')
|
|
98
|
+
: undefined, messagingProtocols: !!quoteRequest.messagingProtocols &&
|
|
99
|
+
quoteRequest.messagingProtocols.length > 0
|
|
100
|
+
? quoteRequest.messagingProtocols.join(',')
|
|
101
|
+
: undefined });
|
|
97
102
|
return [4 /*yield*/, httpService_1.httpService.get("/basic/quote?apiKey=".concat(this.apiKey), {
|
|
98
103
|
params: body,
|
|
99
|
-
headers: { 'X-Rango-Id': this.deviceId }
|
|
104
|
+
headers: { 'X-Rango-Id': this.deviceId },
|
|
100
105
|
})];
|
|
101
106
|
case 1:
|
|
102
107
|
axiosResponse = _a.sent();
|
|
@@ -112,7 +117,7 @@ var RangoClient = /** @class */ (function () {
|
|
|
112
117
|
switch (_a.label) {
|
|
113
118
|
case 0: return [4 /*yield*/, httpService_1.httpService.get("/basic/is-approved?apiKey=".concat(this.apiKey), {
|
|
114
119
|
params: { requestId: requestId, txId: txId },
|
|
115
|
-
headers: { 'X-Rango-Id': this.deviceId }
|
|
120
|
+
headers: { 'X-Rango-Id': this.deviceId },
|
|
116
121
|
})];
|
|
117
122
|
case 1:
|
|
118
123
|
axiosResponse = _a.sent();
|
|
@@ -128,7 +133,7 @@ var RangoClient = /** @class */ (function () {
|
|
|
128
133
|
switch (_a.label) {
|
|
129
134
|
case 0: return [4 /*yield*/, httpService_1.httpService.get("/basic/status?apiKey=".concat(this.apiKey), {
|
|
130
135
|
params: statusRequest,
|
|
131
|
-
headers: { 'X-Rango-Id': this.deviceId }
|
|
136
|
+
headers: { 'X-Rango-Id': this.deviceId },
|
|
132
137
|
})];
|
|
133
138
|
case 1:
|
|
134
139
|
axiosResponse = _a.sent();
|
|
@@ -143,10 +148,15 @@ var RangoClient = /** @class */ (function () {
|
|
|
143
148
|
return __generator(this, function (_a) {
|
|
144
149
|
switch (_a.label) {
|
|
145
150
|
case 0:
|
|
146
|
-
body = __assign(__assign({}, swapRequest), { from: (0, types_1.assetToString)(swapRequest.from), to: (0, types_1.assetToString)(swapRequest.to)
|
|
151
|
+
body = __assign(__assign({}, swapRequest), { from: (0, types_1.assetToString)(swapRequest.from), to: (0, types_1.assetToString)(swapRequest.to), swappers: !!swapRequest.swappers && swapRequest.swappers.length > 0
|
|
152
|
+
? swapRequest.swappers.join(',')
|
|
153
|
+
: undefined, messagingProtocols: !!swapRequest.messagingProtocols &&
|
|
154
|
+
swapRequest.messagingProtocols.length > 0
|
|
155
|
+
? swapRequest.messagingProtocols.join(',')
|
|
156
|
+
: undefined });
|
|
147
157
|
return [4 /*yield*/, httpService_1.httpService.get("/basic/swap?apiKey=".concat(this.apiKey), {
|
|
148
158
|
params: body,
|
|
149
|
-
headers: { 'X-Rango-Id': this.deviceId }
|
|
159
|
+
headers: { 'X-Rango-Id': this.deviceId },
|
|
150
160
|
})];
|
|
151
161
|
case 1:
|
|
152
162
|
axiosResponse = _a.sent();
|
|
@@ -160,7 +170,7 @@ var RangoClient = /** @class */ (function () {
|
|
|
160
170
|
return __generator(this, function (_a) {
|
|
161
171
|
switch (_a.label) {
|
|
162
172
|
case 0: return [4 /*yield*/, httpService_1.httpService.post("/basic/report-tx?apiKey=".concat(this.apiKey), requestBody, {
|
|
163
|
-
headers: { 'X-Rango-Id': this.deviceId }
|
|
173
|
+
headers: { 'X-Rango-Id': this.deviceId },
|
|
164
174
|
})];
|
|
165
175
|
case 1:
|
|
166
176
|
_a.sent();
|
|
@@ -176,7 +186,7 @@ var RangoClient = /** @class */ (function () {
|
|
|
176
186
|
switch (_a.label) {
|
|
177
187
|
case 0: return [4 /*yield*/, httpService_1.httpService.get("/basic/balance?apiKey=".concat(this.apiKey), {
|
|
178
188
|
params: walletAddress,
|
|
179
|
-
headers: { 'X-Rango-Id': this.deviceId }
|
|
189
|
+
headers: { 'X-Rango-Id': this.deviceId },
|
|
180
190
|
})];
|
|
181
191
|
case 1:
|
|
182
192
|
axiosResponse = _a.sent();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA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;4BACE,MAAM,EAAE,aAAa;4BACrB,OAAO,EAAE,EAAE,YAAY,EAAE,IAAI,CAAC,QAAQ,EAAE;yBACzC,CACF,EAAA;;wBANK,aAAa,GAAG,SAMrB;wBACD,sBAAO,aAAa,CAAC,IAAI,EAAA;;;;KAC1B;IACH,kBAAC;AAAD,CAAC,AAnID,IAmIC;AAnIY,kCAAW"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SwapperMetaDto, Token } from
|
|
1
|
+
import { SwapperMetaDto, Token } from './meta';
|
|
2
2
|
/**
|
|
3
3
|
* An asset which is unique by (blockchain, symbol, address)
|
|
4
4
|
*
|
|
@@ -54,7 +54,7 @@ export declare type QuotePath = {
|
|
|
54
54
|
from: Token;
|
|
55
55
|
to: Token;
|
|
56
56
|
swapper: SwapperMetaDto;
|
|
57
|
-
swapperType:
|
|
57
|
+
swapperType: 'BRIDGE' | 'DEX' | 'COMPOSER';
|
|
58
58
|
expectedOutput: string;
|
|
59
59
|
};
|
|
60
60
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/api/common.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"common.d.ts","sourceRoot":"","sources":["../../../src/types/api/common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAE9C;;;;;;;GAOG;AACH,oBAAY,KAAK,GAAG;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,CAIlD;AAED;;;;;;;GAOG;AACH,oBAAY,MAAM,GAAG;IACnB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;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C,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO;QACjB,OAAO,UAAG,KAAK,CAAC,UAAU,cAAI,KAAK,CAAC,MAAM,eAAK,KAAK,CAAC,OAAO,CAAE,CAAA;;
|
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../../src/types/api/common.ts"],"names":[],"mappings":";;;AAgBA,SAAgB,aAAa,CAAC,KAAY;IACxC,IAAI,CAAC,CAAC,KAAK,CAAC,OAAO;QACjB,OAAO,UAAG,KAAK,CAAC,UAAU,cAAI,KAAK,CAAC,MAAM,eAAK,KAAK,CAAC,OAAO,CAAE,CAAA;;QAC3D,OAAO,UAAG,KAAK,CAAC,UAAU,cAAI,KAAK,CAAC,MAAM,CAAE,CAAA;AACnD,CAAC;AAJD,sCAIC"}
|
|
@@ -6,6 +6,7 @@ import type { Asset, QuoteSimulationResult } from './common';
|
|
|
6
6
|
* @property {Asset} to - The destination asset
|
|
7
7
|
* @property {string} amount - The human-readable amount of asset X that is going to be swapped, example: 0.28
|
|
8
8
|
* @property {string[]} [swappers] - List of all accepted swappers, an empty list means no filter is required
|
|
9
|
+
* @property {string[]} [messagingProtocols] - List of all messaging protocols, an empty list means no filter is required
|
|
9
10
|
*
|
|
10
11
|
*/
|
|
11
12
|
export declare type QuoteRequest = {
|
|
@@ -13,6 +14,7 @@ export declare type QuoteRequest = {
|
|
|
13
14
|
to: Asset;
|
|
14
15
|
amount: string;
|
|
15
16
|
swappers?: string[];
|
|
17
|
+
messagingProtocols?: string[];
|
|
16
18
|
};
|
|
17
19
|
/**
|
|
18
20
|
* The response of quote API, if the route field is null, it means that no route is found
|
|
@@ -25,7 +27,7 @@ export declare type QuoteRequest = {
|
|
|
25
27
|
*/
|
|
26
28
|
export declare type QuoteResponse = {
|
|
27
29
|
requestId: string;
|
|
28
|
-
resultType:
|
|
30
|
+
resultType: 'OK' | 'HIGH_IMPACT' | 'INPUT_LIMIT_ISSUE' | 'NO_ROUTE';
|
|
29
31
|
route: QuoteSimulationResult | null;
|
|
30
32
|
};
|
|
31
33
|
//# sourceMappingURL=routing.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../../src/types/api/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../../src/types/api/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AAE5D;;;;;;;;;GASG;AACH,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAA;CAC9B,CAAA;AAED;;;;;;;;GAQG;AACH,oBAAY,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,IAAI,GAAG,aAAa,GAAG,mBAAmB,GAAG,UAAU,CAAA;IACnE,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAA;CACpC,CAAA"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { Asset, QuoteSimulationResult } from
|
|
2
|
-
import { Token } from
|
|
3
|
-
import { CosmosTransaction, EvmTransaction, Transfer } from
|
|
1
|
+
import { Asset, QuoteSimulationResult } from './common';
|
|
2
|
+
import { Token } from './meta';
|
|
3
|
+
import { CosmosTransaction, EvmTransaction, Transfer } from './txs';
|
|
4
4
|
/**
|
|
5
5
|
* The type of transaction
|
|
6
6
|
*/
|
|
@@ -45,6 +45,10 @@ export declare type StatusRequest = {
|
|
|
45
45
|
* @property {string | number} referrerFee - Referrer fee in percent, (e.g. 0.3 means: 0.3% fee based on input amount)
|
|
46
46
|
* @property {boolean} disableEstimate - check pre-requests of a swap before creating tx (e.g. check having enough balance)
|
|
47
47
|
* @property {string} slippage - User slippage for this swap (e.g. 5.0 which means 5% slippage)
|
|
48
|
+
* @property {string[]} [messagingProtocols] - List of all messaging protocols, an empty list means no filter is required
|
|
49
|
+
* @property {string} [sourceContract] - Address of your contract on source chain (will be called in case of refund in the source chain)
|
|
50
|
+
* @property {string} [destinationContract] - Address of your contract on destination chain (will be called in case of success/refund in the destination chain)
|
|
51
|
+
* @property {string} [imMessage] - The message that you want to pass to your contract on the destination chain
|
|
48
52
|
*
|
|
49
53
|
*/
|
|
50
54
|
export declare type SwapRequest = {
|
|
@@ -58,6 +62,10 @@ export declare type SwapRequest = {
|
|
|
58
62
|
referrerFee: string | null;
|
|
59
63
|
disableEstimate: boolean;
|
|
60
64
|
slippage: string;
|
|
65
|
+
messagingProtocols?: string[];
|
|
66
|
+
sourceContract?: string;
|
|
67
|
+
destinationContract?: string;
|
|
68
|
+
imMessage?: string;
|
|
61
69
|
};
|
|
62
70
|
/**
|
|
63
71
|
* Data of the event including its type and an extra metadata
|
|
@@ -95,7 +103,38 @@ export declare enum TransactionStatus {
|
|
|
95
103
|
export declare type StatusOutput = {
|
|
96
104
|
amount: string;
|
|
97
105
|
receivedToken: Token;
|
|
98
|
-
type:
|
|
106
|
+
type: 'REVERTED_TO_INPUT' | 'MIDDLE_ASSET_IN_SRC' | 'MIDDLE_ASSET_IN_DEST' | 'DESIRED_OUTPUT';
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Tracking data for bridged token
|
|
110
|
+
*
|
|
111
|
+
* @property {number} srcChainId - source chain id
|
|
112
|
+
* @property {string | null} srcTxHash - source transaction hash
|
|
113
|
+
* @property {string | null} srcToken - source token address
|
|
114
|
+
* @property {string} srcTokenAmt - source token amount
|
|
115
|
+
* @property {number} srcTokenDecimals - source token decimals
|
|
116
|
+
* @property {number | null} srcTokenPrice - source token price
|
|
117
|
+
* @property {number} destChainId - destination chain id
|
|
118
|
+
* @property {string | null} destTxHash - destination transaction hash
|
|
119
|
+
* @property {string | null} destToken - destination token address
|
|
120
|
+
* @property {string | null} destTokenAmt - destination token amount
|
|
121
|
+
* @property {number} destTokenDecimals - destination token decimals
|
|
122
|
+
* @property {number | null} destTokenPrice - destination token price
|
|
123
|
+
*
|
|
124
|
+
*/
|
|
125
|
+
export declare type BridgeData = {
|
|
126
|
+
srcChainId: number;
|
|
127
|
+
srcTxHash: string | null;
|
|
128
|
+
srcToken: string | null;
|
|
129
|
+
srcTokenAmt: string;
|
|
130
|
+
srcTokenDecimals: number;
|
|
131
|
+
srcTokenPrice: string | null;
|
|
132
|
+
destChainId: number;
|
|
133
|
+
destTxHash: string | null;
|
|
134
|
+
destToken: string | null;
|
|
135
|
+
destTokenAmt: string | null;
|
|
136
|
+
destTokenDecimals: number;
|
|
137
|
+
destTokenPrice: string | null;
|
|
99
138
|
};
|
|
100
139
|
/**
|
|
101
140
|
* Response of check transaction status containing the latest status of transaction in blockchain
|
|
@@ -106,6 +145,7 @@ export declare type StatusOutput = {
|
|
|
106
145
|
* @property {StatusOutput | null} output - The output asset and amount, it could be different from destination asset in
|
|
107
146
|
* case of failures and refund
|
|
108
147
|
* @property {SwapExplorerUrl[] | null} explorerUrl - List of explorer URLs for the transactions of this swap.
|
|
148
|
+
* @property {BridgeData | null} bridgeData - Status of bridge
|
|
109
149
|
*
|
|
110
150
|
*/
|
|
111
151
|
export declare type StatusResponse = {
|
|
@@ -113,6 +153,7 @@ export declare type StatusResponse = {
|
|
|
113
153
|
error: string | null;
|
|
114
154
|
output: StatusOutput | null;
|
|
115
155
|
explorerUrl: SwapExplorerUrl[] | null;
|
|
156
|
+
bridgeData: BridgeData | null;
|
|
116
157
|
};
|
|
117
158
|
/**
|
|
118
159
|
* Response body of check-approval
|
|
@@ -137,7 +178,7 @@ export declare type CheckApprovalResponse = {
|
|
|
137
178
|
*/
|
|
138
179
|
export declare type SwapResponse = {
|
|
139
180
|
requestId: string;
|
|
140
|
-
resultType:
|
|
181
|
+
resultType: 'OK' | 'HIGH_IMPACT' | 'INPUT_LIMIT_ISSUE' | 'NO_ROUTE';
|
|
141
182
|
route: QuoteSimulationResult | null;
|
|
142
183
|
error: string | null;
|
|
143
184
|
tx: EvmTransaction | CosmosTransaction | Transfer | null;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,qBAAqB,EAAE,MAAM,UAAU,CAAA;AACvD,OAAO,EAAE,KAAK,EAAE,MAAM,QAAQ,CAAA;AAC9B,OAAO,EAAE,iBAAiB,EAAE,cAAc,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAEnE;;GAEG;AACH,oBAAY,eAAe;IACzB,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED;;;;;;;GAOG;AACH,oBAAY,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED;;;;;;GAMG;AACH,oBAAY,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;GAkBG;AACH,oBAAY,WAAW,GAAG;IACxB,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,eAAe,EAAE,MAAM,GAAG,IAAI,CAAA;IAC9B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,eAAe,EAAE,OAAO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H,oBAAY,cAAc,GAAG;IAC3B,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAChC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,MAAM,EAAE,YAAY,GAAG,IAAI,CAAA;IAC3B,WAAW,EAAE,eAAe,EAAE,GAAG,IAAI,CAAA;IACrC,UAAU,EAAE,UAAU,GAAG,IAAI,CAAA;CAC9B,CAAA;AAED;;;;;GAKG;AACH,oBAAY,qBAAqB,GAAG;IAClC,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,oBAAY,YAAY,GAAG;IACzB,SAAS,EAAE,MAAM,CAAA;IACjB,UAAU,EAAE,IAAI,GAAG,aAAa,GAAG,mBAAmB,GAAG,UAAU,CAAA;IACnE,KAAK,EAAE,qBAAqB,GAAG,IAAI,CAAA;IACnC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,EAAE,EAAE,cAAc,GAAG,iBAAiB,GAAG,QAAQ,GAAG,IAAI,CAAA;CACzD,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":";;;AAIA;;GAEG;AACH,IAAY,eAIX;AAJD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,wCAAqB,CAAA;IACrB,oCAAiB,CAAA;AACnB,CAAC,EAJW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAI1B;AA+ED;;GAEG;AACH,IAAY,iBAIX;AAJD,WAAY,iBAAiB;IAC3B,sCAAiB,CAAA;IACjB,wCAAmB,CAAA;IACnB,wCAAmB,CAAA;AACrB,CAAC,EAJW,iBAAiB,GAAjB,yBAAiB,KAAjB,yBAAiB,QAI5B"}
|