rango-sdk 0.0.1 → 0.0.2
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/README.md +2 -2
- package/lib/index.js +5 -1
- package/lib/index.js.map +1 -1
- package/lib/services/client.d.ts +1 -4
- package/lib/services/client.d.ts.map +1 -1
- package/lib/services/client.js +13 -8
- package/lib/services/client.js.map +1 -1
- package/lib/types/api/routing.d.ts +15 -14
- package/lib/types/api/routing.d.ts.map +1 -1
- package/lib/types/api/transactions.d.ts +14 -13
- package/lib/types/api/transactions.d.ts.map +1 -1
- package/lib/types/api/transactions.js.map +1 -1
- package/lib/types/api/txs/index.js +5 -1
- package/lib/types/api/txs/index.js.map +1 -1
- package/lib/types/index.js +5 -1
- package/lib/types/index.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -21,5 +21,5 @@ This is the first phase of Rango SDK which only wraps Rest API calls. In the nex
|
|
|
21
21
|
|
|
22
22
|
Please checkout the examples' folder for sample usage of the SDK. We will add more examples there soon.
|
|
23
23
|
|
|
24
|
-
- [
|
|
25
|
-
- [Examples](https://github.com/rango-exchange/rango-sdk/tree/master/
|
|
24
|
+
- [Documents](https://docs.rango.exchange/integration/overview)
|
|
25
|
+
- [Examples](https://github.com/rango-exchange/rango-sdk/tree/master/examples/)
|
package/lib/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAwC;AAA/B,uGAAA,WAAW,OAAA;AACpB,0CAAuB"}
|
package/lib/services/client.d.ts
CHANGED
|
@@ -1,7 +1,4 @@
|
|
|
1
|
-
import
|
|
2
|
-
import type { BestRouteRequest, BestRouteResponse } from '../types/api/routing';
|
|
3
|
-
import type { CheckApprovalResponse, CheckTxStatusRequest, CreateTransactionRequest, CreateTransactionResponse, ReportTransactionRequest, TransactionStatusResponse } from '../types/api/transactions';
|
|
4
|
-
import type { WalletDetailsResponse } from '../types/api/balance';
|
|
1
|
+
import { MetaResponse, BestRouteRequest, BestRouteResponse, CheckApprovalResponse, CheckTxStatusRequest, TransactionStatusResponse, CreateTransactionRequest, CreateTransactionResponse, ReportTransactionRequest, WalletDetailsResponse } from "../types";
|
|
5
2
|
declare type WalletAddresses = {
|
|
6
3
|
blockchain: string;
|
|
7
4
|
address: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EACZ,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,yBAAyB,EACzB,wBAAwB,EACxB,yBAAyB,EACzB,wBAAwB,EACxB,qBAAqB,EACtB,MAAM,UAAU,CAAA;AAGjB,aAAK,eAAe,GAAG;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,EAAE,CAAA;AAEhE,qBAAa,WAAW;IACtB,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAQ;IAEjC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAQ;gBAEnB,MAAM,EAAE,MAAM;IAoBb,cAAc,IAAI,OAAO,CAAC,YAAY,CAAC;IAOvC,YAAY,CACvB,WAAW,EAAE,gBAAgB,GAC5B,OAAO,CAAC,iBAAiB,CAAC;IAShB,aAAa,CACxB,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,qBAAqB,CAAC;IAOpB,WAAW,CACtB,WAAW,EAAE,oBAAoB,GAChC,OAAO,CAAC,yBAAyB,CAAC;IAQxB,iBAAiB,CAC5B,WAAW,EAAE,wBAAwB,GACpC,OAAO,CAAC,yBAAyB,CAAC;IAQxB,aAAa,CACxB,WAAW,EAAE,wBAAwB,GACpC,OAAO,CAAC,IAAI,CAAC;IAIH,iBAAiB,CAC5B,eAAe,EAAE,eAAe,GAC/B,OAAO,CAAC,qBAAqB,CAAC;CAWlC"}
|
package/lib/services/client.js
CHANGED
|
@@ -42,18 +42,23 @@ var httpService_1 = require("./httpService");
|
|
|
42
42
|
var RangoClient = /** @class */ (function () {
|
|
43
43
|
function RangoClient(apiKey) {
|
|
44
44
|
this.apiKey = apiKey;
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
try {
|
|
46
|
+
if (typeof window !== 'undefined') {
|
|
47
|
+
var deviceId = localStorage.getItem('deviceId');
|
|
48
|
+
if (deviceId) {
|
|
49
|
+
this.deviceId = deviceId;
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
var generatedId = (0, uuid_1.v4)();
|
|
53
|
+
localStorage.setItem('deviceId', generatedId);
|
|
54
|
+
this.deviceId = generatedId;
|
|
55
|
+
}
|
|
49
56
|
}
|
|
50
57
|
else {
|
|
51
|
-
|
|
52
|
-
localStorage.setItem('deviceId', generatedId);
|
|
53
|
-
this.deviceId = generatedId;
|
|
58
|
+
this.deviceId = (0, uuid_1.v4)();
|
|
54
59
|
}
|
|
55
60
|
}
|
|
56
|
-
|
|
61
|
+
catch (e) {
|
|
57
62
|
this.deviceId = (0, uuid_1.v4)();
|
|
58
63
|
}
|
|
59
64
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAyB;AAEzB,6CAA2C;
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/services/client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6BAAyB;AAEzB,6CAA2C;AAiB3C;IAKE,qBAAY,MAAc;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAA;QACpB,IAAI;YACF,IAAI,OAAO,MAAM,KAAK,WAAW,EAAE;gBACjC,IAAM,QAAQ,GAAG,YAAY,CAAC,OAAO,CAAC,UAAU,CAAC,CAAA;gBACjD,IAAI,QAAQ,EAAE;oBACZ,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;iBACzB;qBAAM;oBACL,IAAM,WAAW,GAAG,IAAA,SAAE,GAAE,CAAA;oBACxB,YAAY,CAAC,OAAO,CAAC,UAAU,EAAE,WAAW,CAAC,CAAA;oBAC7C,IAAI,CAAC,QAAQ,GAAG,WAAW,CAAA;iBAC5B;aACF;iBAAM;gBACL,IAAI,CAAC,QAAQ,GAAG,IAAA,SAAE,GAAE,CAAA;aACrB;SACF;QAAC,OAAO,CAAC,EAAE;YACV,IAAI,CAAC,QAAQ,GAAG,IAAA,SAAE,GAAE,CAAA;SACrB;IACH,CAAC;IAEY,oCAAc,GAA3B;;;;;4BACwB,qBAAM,yBAAW,CAAC,GAAG,CACzC,uBAAgB,IAAI,CAAC,MAAM,CAAE,CAC9B,EAAA;;wBAFK,aAAa,G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C,GAAG,CAAC,EAAE,CAAC,GAAG,eAAe,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;4BACzC,aAAa,GAAG,eAAe,CAAC,CAAC,CAAC,CAAA;4BACxC,0BAA0B,IAAI,mBAAY,aAAa,CAAC,UAAU,cAAI,aAAa,CAAC,OAAO,CAAE,CAAA;yBAC9F;wBACqB,qBAAM,yBAAW,CAAC,GAAG,CACzC,kCAA2B,IAAI,CAAC,MAAM,SAAG,0BAA0B,CAAE,CACtE,EAAA;;wBAFK,aAAa,GAAG,SAErB;wBACD,sBAAO,aAAa,CAAC,IAAI,EAAA;;;;KAC1B;IACH,kBAAC;AAAD,CAAC,AA3FD,IA2FC;AA3FY,kCAAW"}
|
|
@@ -77,13 +77,14 @@ export declare type BlockchainValidationStatus = {
|
|
|
77
77
|
* and true when user really accepted to swap. If true, server will be much slower to respond, but will check some
|
|
78
78
|
* pre-requisites including balance of X and required fees in user's wallets
|
|
79
79
|
* @property {{ [key: string]: string }} selectedWallets - Map of blockchain to selected address
|
|
80
|
+
* @property {UserWalletBlockchain[]} connectedWallets - List of all user connected wallet addresses per each blockchain
|
|
80
81
|
* @property {string | null} [affiliateRef] - The affiliate ref that client likes to send to Rango, so in cases of
|
|
81
82
|
* 1inch, Thorchain, etc. that support affiliation, the referrer will earn some money if user accept the route and
|
|
82
83
|
* signs the transactions. example: K3ldk3
|
|
83
|
-
* @property {boolean} [disableMultiStepTx] - It should be true when client doesn't want multi
|
|
84
|
-
* @property {string[]} [blockchains] -
|
|
85
|
-
* @property {string[]} [swappers] -
|
|
86
|
-
* @property {string[]} [transactionTypes] -
|
|
84
|
+
* @property {boolean} [disableMultiStepTx] - It should be true when the client doesn't want multi-step transactions
|
|
85
|
+
* @property {string[]} [blockchains] - List of all accepted blockchains, an empty list means no filter is required
|
|
86
|
+
* @property {string[]} [swappers] - List of all accepted swappers, an empty list means no filter is required
|
|
87
|
+
* @property {string[]} [transactionTypes] - List of all accepted transaction types including [EVM, TRANSFER, COSMOS]
|
|
87
88
|
*
|
|
88
89
|
*/
|
|
89
90
|
export declare type BestRouteRequest = {
|
|
@@ -104,21 +105,21 @@ export declare type BestRouteRequest = {
|
|
|
104
105
|
/**
|
|
105
106
|
* The response of best route, if the result fields is null, it means that no route is found
|
|
106
107
|
*
|
|
107
|
-
* @property {string} requestId - The unique requestId generated for this request by server. It should be
|
|
108
|
-
* to all other endpoints if this swap continues on
|
|
109
|
-
* @property {string} requestAmount - The human readable amount from the request
|
|
108
|
+
* @property {string} requestId - The unique requestId which is generated for this request by the server. It should be
|
|
109
|
+
* passed down to all other endpoints if this swap continues on. e.g. d10657ce-b13a-405c-825b-b47f8a5016ad
|
|
110
|
+
* @property {string} requestAmount - The human readable input amount from the request
|
|
110
111
|
* @property {Asset} from
|
|
111
112
|
* @property {Asset} to
|
|
112
113
|
* @property {SimulationResult | null} result
|
|
113
|
-
* @property {BlockchainValidationStatus[] | null} validationStatus - Pre-
|
|
114
|
-
* request
|
|
114
|
+
* @property {BlockchainValidationStatus[] | null} validationStatus - Pre-requisites check result. It will be null if
|
|
115
|
+
* the request checkPrerequisites was false
|
|
115
116
|
* @property {string[]} diagnosisMessages - list of string messages that might be cause of not finding the route.
|
|
116
|
-
* It's just for display
|
|
117
|
+
* It's just for display purposes
|
|
117
118
|
* @property {string[]} missingBlockchains - List of all blockchains which are necessary to be present for the best
|
|
118
|
-
* route and user has not provided any connected wallets for it.
|
|
119
|
-
* @property {boolean} processingLimitReached - A warning
|
|
120
|
-
* route and server could not find any routes from X to Y
|
|
121
|
-
* @property {boolean} walletNotSupportingFromBlockchain - A warning
|
|
119
|
+
* route and user has not provided any connected wallets for it. A null or empty list indicates that there is no problem.
|
|
120
|
+
* @property {boolean} processingLimitReached - A warning indicates that it took too much time to find the best
|
|
121
|
+
* route and the server could not find any routes from X to Y
|
|
122
|
+
* @property {boolean} walletNotSupportingFromBlockchain - A warning indicates that none of your wallets have the same
|
|
122
123
|
* blockchain as X asset
|
|
123
124
|
*
|
|
124
125
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../../src/types/api/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAA;AAErD;;;;;;GAMG;AACH,oBAAY,oBAAoB,GAAG;IACjC,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB,CAAA;AAED;;;;;;GAMG;AACH,oBAAY,gBAAgB,GAAG;IAC7B,YAAY,EAAE,MAAM,CAAA;IACpB,KAAK,EAAE,UAAU,EAAE,CAAA;CACpB,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,oBAAoB,GAAG;IACjC,KAAK,EAAE,KAAK,CAAA;IACZ,cAAc,EAAE,MAAM,CAAA;IACtB,aAAa,EAAE,MAAM,CAAA;IACrB,EAAE,EAAE,OAAO,CAAA;IACX,MAAM,EAAE,KAAK,GAAG,qBAAqB,GAAG,aAAa,CAAA;CACtD,CAAA;AAED;;;;;;;;;;GAUG;AACH,oBAAY,sBAAsB,GAAG;IACnC,OAAO,EAAE,MAAM,CAAA;IACf,cAAc,EAAE,OAAO,CAAA;IACvB,cAAc,EAAE,oBAAoB,EAAE,CAAA;IACtC,WAAW,EAAE,OAAO,CAAA;CACrB,CAAA;AAED;;;;;;GAMG;AACH,oBAAY,0BAA0B,GAAG;IACvC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,sBAAsB,EAAE,CAAA;CAClC,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"routing.d.ts","sourceRoot":"","sources":["../../../src/types/api/routing.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,UAAU,EAAE,MAAM,UAAU,CAAA;AACzD,OAAO,KAAK,EAAE,eAA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E,MAAM,EAAE,CAAA;IACtB,QAAQ,CAAC,EAAE,MAAM,EAAE,CAAA;IACnB,gBAAgB,CAAC,EAAE,eAAe,EAAE,CAAA;CACrC,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,oBAAY,iBAAiB,GAAG;IAC9B,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,KAAK,CAAA;IACX,EAAE,EAAE,KAAK,CAAA;IACT,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAA;IAC/B,gBAAgB,EAAE,0BAA0B,EAAE,GAAG,IAAI,CAAA;IACrD,iBAAiB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IAClC,kBAAkB,EAAE,MAAM,EAAE,GAAG,IAAI,CAAA;IACnC,sBAAsB,EAAE,OAAO,CAAA;IAC/B,iCAAiC,EAAE,OAAO,CAAA;CAC3C,CAAA"}
|
|
@@ -66,7 +66,7 @@ export declare type SwapExplorerUrl = {
|
|
|
66
66
|
/**
|
|
67
67
|
* Request body of check tx status
|
|
68
68
|
*
|
|
69
|
-
* @property {string} requestId - The unique ID which is generated in best route endpoint
|
|
69
|
+
* @property {string} requestId - The unique ID which is generated in the best route endpoint
|
|
70
70
|
* @property {number} step - 1-based step number of a complex multi-step swap, example: 1, 2, ...
|
|
71
71
|
* @property {number} txId - Tx hash that wallet returned, example: 0xa1a37ce2063c4764da27d990a22a0c89ed8ac585286a77a...
|
|
72
72
|
*
|
|
@@ -79,10 +79,11 @@ export declare type CheckTxStatusRequest = {
|
|
|
79
79
|
/**
|
|
80
80
|
* Request body of createTransaction endpoint
|
|
81
81
|
*
|
|
82
|
-
* @property {string} requestId - The unique ID which is generated in best route endpoint
|
|
82
|
+
* @property {string} requestId - The unique ID which is generated in the best route endpoint
|
|
83
83
|
* @property {number} step - 1-based step number of a complex multi-step swap, example: 1, 2, ...
|
|
84
|
-
* @property {UserSettings} userSettings - user settings for swap
|
|
85
|
-
* @property {CreateTransactionValidation} validations - validation checks we are interested to check by Rango
|
|
84
|
+
* @property {UserSettings} userSettings - user settings for the swap
|
|
85
|
+
* @property {CreateTransactionValidation} validations - the validation checks we are interested to check by Rango
|
|
86
|
+
* before starting the swap
|
|
86
87
|
*
|
|
87
88
|
*/
|
|
88
89
|
export declare type CreateTransactionRequest = {
|
|
@@ -119,17 +120,17 @@ export declare enum TransactionStatus {
|
|
|
119
120
|
/**
|
|
120
121
|
* Response of check transaction status containing the latest status of transaction
|
|
121
122
|
*
|
|
122
|
-
* @property {TransactionStatus | null} status - Status of the transaction, while the status is running or null,
|
|
123
|
-
* should retry until it turns into success or
|
|
123
|
+
* @property {TransactionStatus | null} status - Status of the transaction, while the status is running or null, the
|
|
124
|
+
* client should retry until it turns into success or failed
|
|
124
125
|
* @property {number} timestamp - The timestamp of the executed transaction. Beware that timestamp can be null even if
|
|
125
126
|
* the status is successful or failed, example: 1635271424813
|
|
126
|
-
* @property {string | null} extraMessage - A message in case of failure, that
|
|
127
|
+
* @property {string | null} extraMessage - A message in case of failure, that could be shown to the user
|
|
127
128
|
* @property {string | null} outputAmount - The output amount of the transaction if it was successful, exmaple: 0.28
|
|
128
|
-
* @property {GenericTransaction | null} newTx - if a transaction needs more than one-step transaction to
|
|
129
|
-
* user, next step transaction will be returned in this field.
|
|
130
|
-
* @property {string | null} diagnosisUrl - In some special cases [
|
|
131
|
-
* Rango to get its assets. You can show this link to user to help him
|
|
132
|
-
* @property {SwapExplorerUrl[] | null} explorerUrl - List of explorer
|
|
129
|
+
* @property {GenericTransaction | null} newTx - if a transaction needs more than one-step transaction to be signed by
|
|
130
|
+
* the user, the next step transaction will be returned in this field.
|
|
131
|
+
* @property {string | null} diagnosisUrl - In some special cases [e.g. AnySwap], the user should follow some steps
|
|
132
|
+
* outside Rango to get its assets back (refund). You can show this link to the user to help him
|
|
133
|
+
* @property {SwapExplorerUrl[] | null} explorerUrl - List of explorer URLs for the transactions that happened in this step.
|
|
133
134
|
* @property {TransactionStatusReferral[] | null} referrals - List of referral reward for the dApp and Rango
|
|
134
135
|
*
|
|
135
136
|
*/
|
|
@@ -157,7 +158,7 @@ export declare type CheckApprovalResponse = {
|
|
|
157
158
|
* @see https://rango.exchange/apis/docs/tx-example
|
|
158
159
|
*
|
|
159
160
|
* @property {string | null} error - Error message about the incident if ok == false
|
|
160
|
-
* @property {boolean} ok - If true, Rango has created a non-null transaction and error message is null
|
|
161
|
+
* @property {boolean} ok - If true, Rango has created a non-null transaction and the error message is null
|
|
161
162
|
* @property {GenericTransaction | null} transaction - Transaction's raw data
|
|
162
163
|
*
|
|
163
164
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,eAAe;IACzB,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,eAAe,CAAA;CACtB,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;GAKG;AACH,oBAAY,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;GAMG;AACH,oBAAY,2BAA2B,GAAG;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,OAAO,CAAA;CACb,CAAA;AAED;;;;;;;GAOG;AACH,oBAAY,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED;;;;;;;GAOG;AACH,oBAAY,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED
|
|
1
|
+
{"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,oBAAY,eAAe;IACzB,GAAG,QAAQ;IACX,QAAQ,aAAa;IACrB,MAAM,WAAW;CAClB;AAED;;;;GAIG;AACH,oBAAY,kBAAkB,GAAG;IAC/B,IAAI,EAAE,eAAe,CAAA;CACtB,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,yBAAyB,GAAG;IACtC,UAAU,EAAE,MAAM,CAAA;IAClB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,MAAM,EAAE,MAAM,CAAA;CACf,CAAA;AAED;;;;;GAKG;AACH,oBAAY,YAAY,GAAG;IACzB,QAAQ,EAAE,MAAM,CAAA;CACjB,CAAA;AAED;;;;;;GAMG;AACH,oBAAY,2BAA2B,GAAG;IACxC,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,EAAE,OAAO,CAAA;CACb,CAAA;AAED;;;;;;;GAOG;AACH,oBAAY,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED;;;;;;;GAOG;AACH,oBAAY,oBAAoB,GAAG;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;IACZ,YAAY,EAAE,YAAY,CAAA;IAC1B,WAAW,EAAE,2BAA2B,CAAA;CACzC,CAAA;AAED;;;;;;;;;GASG;AACH,oBAAY,wBAAwB,GAAG;IACrC,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,SAAS,CAAA;IACpB,IAAI,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAA;CAChC,CAAA;AAED;;GAEG;AACH,oBAAY,iBAAiB;IAC3B,MAAM,WAAW;IACjB,OAAO,YAAY;IACnB,OAAO,YAAY;CACpB;AAED;;;;;;;;;;;;;;;;GAgBG;AACH,oBAAY,yBAAyB,GAAG;IACtC,MAAM,EAAE,iBAAiB,GAAG,IAAI,CAAA;IAChC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,KAAK,EAAE,kBAAkB,GAAG,IAAI,CAAA;IAChC,YAAY,EAAE,MAAM,GAAG,IAAI,CAAA;IAC3B,WAAW,EAAE,eAAe,EAAE,GAAG,IAAI,CAAA;IACrC,SAAS,EAAE,yBAAyB,EAAE,GAAG,IAAI,CAAA;CAC9C,CAAA;AAED;;;;;GAKG;AACH,oBAAY,qBAAqB,GAAG;IAClC,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;;GAQG;AACH,oBAAY,yBAAyB,GAAG;IACtC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,EAAE,EAAE,OAAO,CAAA;IACX,WAAW,EAAE,kBAAkB,GAAG,IAAI,CAAA;CACvC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":";;;AAAA;;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;
|
|
1
|
+
{"version":3,"file":"transactions.js","sourceRoot":"","sources":["../../../src/types/api/transactions.ts"],"names":[],"mappings":";;;AAAA;;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+GD;;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"}
|
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/api/txs/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/types/api/txs/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,wCAAqB;AACrB,2CAAwB;AACxB,6CAA0B"}
|
package/lib/types/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
package/lib/types/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA6B;AAC7B,+CAA4B;AAC5B,6CAA0B;AAC1B,gDAA6B;AAC7B,qDAAkC;AAClC,4CAAyB"}
|