rango-sdk-basic 0.0.14 → 0.0.15

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.
Files changed (79) hide show
  1. package/lib/index.d.ts +2 -2
  2. package/lib/index.d.ts.map +1 -1
  3. package/lib/index.js +8 -21
  4. package/lib/rango-sdk-basic.cjs.development.js +1002 -0
  5. package/lib/rango-sdk-basic.cjs.development.js.map +1 -0
  6. package/lib/rango-sdk-basic.cjs.production.min.js +2 -0
  7. package/lib/rango-sdk-basic.cjs.production.min.js.map +1 -0
  8. package/lib/rango-sdk-basic.esm.js +999 -0
  9. package/lib/rango-sdk-basic.esm.js.map +1 -0
  10. package/lib/services/client.d.ts +21 -21
  11. package/lib/services/client.d.ts.map +1 -1
  12. package/lib/services/executor.d.ts +7 -7
  13. package/lib/services/executor.d.ts.map +1 -1
  14. package/lib/services/httpService.d.ts +1 -1
  15. package/lib/services/httpService.d.ts.map +1 -1
  16. package/lib/services/index.d.ts +1 -1
  17. package/lib/services/index.d.ts.map +1 -1
  18. package/lib/types/api/balance.d.ts +1 -38
  19. package/lib/types/api/balance.d.ts.map +1 -1
  20. package/lib/types/api/common.d.ts +3 -128
  21. package/lib/types/api/common.d.ts.map +1 -1
  22. package/lib/types/api/meta.d.ts +1 -183
  23. package/lib/types/api/meta.d.ts.map +1 -1
  24. package/lib/types/api/routing.d.ts +1 -43
  25. package/lib/types/api/routing.d.ts.map +1 -1
  26. package/lib/types/api/transactions.d.ts +1 -188
  27. package/lib/types/api/transactions.d.ts.map +1 -1
  28. package/lib/types/api/txs/cosmos.d.ts +1 -68
  29. package/lib/types/api/txs/cosmos.d.ts.map +1 -1
  30. package/lib/types/api/txs/evm.d.ts +1 -29
  31. package/lib/types/api/txs/evm.d.ts.map +1 -1
  32. package/lib/types/api/txs/index.d.ts +3 -3
  33. package/lib/types/api/txs/index.d.ts.map +1 -1
  34. package/lib/types/api/txs/transfer.d.ts +1 -28
  35. package/lib/types/api/txs/transfer.d.ts.map +1 -1
  36. package/lib/types/index.d.ts +7 -7
  37. package/lib/types/index.d.ts.map +1 -1
  38. package/lib/types/utils/errors.d.ts +22 -22
  39. package/lib/types/utils/errors.d.ts.map +1 -1
  40. package/lib/utils/errors.d.ts +1 -1
  41. package/lib/utils/errors.d.ts.map +1 -1
  42. package/lib/utils/promise.d.ts +1 -1
  43. package/lib/utils/promise.d.ts.map +1 -1
  44. package/package.json +20 -19
  45. package/lib/index.js.map +0 -1
  46. package/lib/services/client.js +0 -257
  47. package/lib/services/client.js.map +0 -1
  48. package/lib/services/executor.js +0 -196
  49. package/lib/services/executor.js.map +0 -1
  50. package/lib/services/httpService.js +0 -14
  51. package/lib/services/httpService.js.map +0 -1
  52. package/lib/services/index.js +0 -6
  53. package/lib/services/index.js.map +0 -1
  54. package/lib/types/api/balance.js +0 -3
  55. package/lib/types/api/balance.js.map +0 -1
  56. package/lib/types/api/common.js +0 -11
  57. package/lib/types/api/common.js.map +0 -1
  58. package/lib/types/api/meta.js +0 -3
  59. package/lib/types/api/meta.js.map +0 -1
  60. package/lib/types/api/routing.js +0 -3
  61. package/lib/types/api/routing.js.map +0 -1
  62. package/lib/types/api/transactions.js +0 -22
  63. package/lib/types/api/transactions.js.map +0 -1
  64. package/lib/types/api/txs/cosmos.js +0 -3
  65. package/lib/types/api/txs/cosmos.js.map +0 -1
  66. package/lib/types/api/txs/evm.js +0 -3
  67. package/lib/types/api/txs/evm.js.map +0 -1
  68. package/lib/types/api/txs/index.js +0 -20
  69. package/lib/types/api/txs/index.js.map +0 -1
  70. package/lib/types/api/txs/transfer.js +0 -3
  71. package/lib/types/api/txs/transfer.js.map +0 -1
  72. package/lib/types/index.js +0 -24
  73. package/lib/types/index.js.map +0 -1
  74. package/lib/types/utils/errors.js +0 -26
  75. package/lib/types/utils/errors.js.map +0 -1
  76. package/lib/utils/errors.js +0 -31
  77. package/lib/utils/errors.js.map +0 -1
  78. package/lib/utils/promise.js +0 -8
  79. package/lib/utils/promise.js.map +0 -1
@@ -1,189 +1,2 @@
1
- import { Asset, QuoteSimulationResult } from './common';
2
- import { Token } from './meta';
3
- import { CosmosTransaction, EvmTransaction, Transfer } from './txs';
4
- /**
5
- * The type of transaction
6
- */
7
- export declare enum TransactionType {
8
- EVM = "EVM",
9
- TRANSFER = "TRANSFER",
10
- COSMOS = "COSMOS"
11
- }
12
- /**
13
- * A transaction's url that can be displayed to advanced user to track the progress
14
- *
15
- * @property {string} url - Url of the transaction in blockchain explorer. example: https://etherscan.io/tx/0xa1a3...
16
- * @property {string | null} description - A custom display name to help user distinguish the transactions from each
17
- * other. Example: Inbound, Outbound, Bridge, or null
18
- *
19
- */
20
- export type SwapExplorerUrl = {
21
- description: string | null;
22
- url: string;
23
- };
24
- /**
25
- * Request body of check tx status
26
- *
27
- * @property {string} requestId - The unique ID which is generated in the best route endpoint
28
- * @property {number} txId - Tx hash that wallet returned, example: 0xa1a37ce2063c4764da27d990a22a0c89ed8ac585286a77a...
29
- *
30
- */
31
- export type StatusRequest = {
32
- requestId: string;
33
- txId: string;
34
- };
35
- /**
36
- * Request body of swap endpoint
37
- *
38
- * @property {Asset} from - The source asset
39
- * @property {Asset} to - The destination asset
40
- * @property {string} amount - The human-readable amount of asset X that is going to be swapped, example: 0.28
41
- * @property {string[]} [swappers] - List of all accepted swappers, an empty list means no filter is required
42
- * @property {string} fromAddress - User source wallet address
43
- * @property {string} toAddress - User destination wallet address
44
- * @property {string | number} referrerAddress - Referrer address
45
- * @property {string | number} referrerFee - Referrer fee in percent, (e.g. 0.3 means: 0.3% fee based on input amount)
46
- * @property {boolean} disableEstimate - check pre-requests of a swap before creating tx (e.g. check having enough balance)
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
52
- * @property {boolean} contractCall - Mark it true if you are going to call this swap via your own contract, so we
53
- * will filter routes that are not possible to be called from a contract
54
- *
55
- */
56
- export type SwapRequest = {
57
- from: Asset;
58
- to: Asset;
59
- amount: string;
60
- swappers?: string[];
61
- fromAddress: string;
62
- toAddress: string;
63
- referrerAddress: string | null;
64
- referrerFee: string | null;
65
- disableEstimate: boolean;
66
- slippage: string;
67
- messagingProtocols?: string[];
68
- sourceContract?: string;
69
- destinationContract?: string;
70
- imMessage?: string;
71
- contractCall?: boolean;
72
- };
73
- /**
74
- * Data of the event including its type and an extra metadata
75
- * It should be used when an error happened in client and we want to inform server that transaction failed,
76
- * E.g. user rejected the transaction dialog or and an RPC error raised during signing tx by user.
77
- *
78
- * @property {string} requestId - The requestId from best route endpoint
79
- * @property {string} eventType - Type of the event that happened, example: TX_FAIL
80
- * @property {[key: string]: string} data - A list of key-value for extra details
81
- *
82
- */
83
- export type ReportTransactionRequest = {
84
- requestId: string;
85
- eventType: 'TX_FAIL';
86
- data: {
87
- [key: string]: string;
88
- };
89
- };
90
- /**
91
- * The status of transaction in tracking
92
- */
93
- export declare enum TransactionStatus {
94
- FAILED = "failed",
95
- RUNNING = "running",
96
- SUCCESS = "success"
97
- }
98
- /**
99
- * The final received asset and amount for a swap
100
- *
101
- * @property {string} amount - received token amount
102
- * @property {Token} receivedToken - received token asset
103
- * @property {string} type - type of received token
104
- *
105
- */
106
- export type StatusOutput = {
107
- amount: string;
108
- receivedToken: Token;
109
- type: 'REVERTED_TO_INPUT' | 'MIDDLE_ASSET_IN_SRC' | 'MIDDLE_ASSET_IN_DEST' | 'DESIRED_OUTPUT';
110
- };
111
- /**
112
- * Tracking data for bridged token
113
- *
114
- * @property {number} srcChainId - source chain id
115
- * @property {string | null} srcTxHash - source transaction hash
116
- * @property {string | null} srcToken - source token address
117
- * @property {string} srcTokenAmt - source token amount
118
- * @property {number} srcTokenDecimals - source token decimals
119
- * @property {number | null} srcTokenPrice - source token price
120
- * @property {number} destChainId - destination chain id
121
- * @property {string | null} destTxHash - destination transaction hash
122
- * @property {string | null} destToken - destination token address
123
- * @property {string | null} destTokenAmt - destination token amount
124
- * @property {number} destTokenDecimals - destination token decimals
125
- * @property {number | null} destTokenPrice - destination token price
126
- *
127
- */
128
- export type BridgeData = {
129
- srcChainId: number;
130
- srcTxHash: string | null;
131
- srcToken: string | null;
132
- srcTokenAmt: string;
133
- srcTokenDecimals: number;
134
- srcTokenPrice: string | null;
135
- destChainId: number;
136
- destTxHash: string | null;
137
- destToken: string | null;
138
- destTokenAmt: string | null;
139
- destTokenDecimals: number;
140
- destTokenPrice: string | null;
141
- };
142
- /**
143
- * Response of check transaction status containing the latest status of transaction in blockchain
144
- *
145
- * @property {TransactionStatus | null} status - Status of the transaction, while the status is running or null, the
146
- * client should retry until it turns into success or failed
147
- * @property {string | null} error - A message in case of failure, that could be shown to the user
148
- * @property {StatusOutput | null} output - The output asset and amount, it could be different from destination asset in
149
- * case of failures and refund
150
- * @property {SwapExplorerUrl[] | null} explorerUrl - List of explorer URLs for the transactions of this swap.
151
- * @property {BridgeData | null} bridgeData - Status of bridge
152
- *
153
- */
154
- export type StatusResponse = {
155
- status: TransactionStatus | null;
156
- error: string | null;
157
- output: StatusOutput | null;
158
- explorerUrl: SwapExplorerUrl[] | null;
159
- bridgeData: BridgeData | null;
160
- };
161
- /**
162
- * Response body of check-approval
163
- *
164
- * @property {boolean} isApproved - A flag which indicates that the approve tx is done or not
165
- *
166
- */
167
- export type CheckApprovalResponse = {
168
- isApproved: boolean;
169
- };
170
- /**
171
- * Response body of swap API
172
- * @see https://docs.rango.exchange/integration/rango-sdk/sample-transactions
173
- *
174
- * @property {string} requestId - The unique requestId which is generated for this request by the server. It should be
175
- * passed down to all other endpoints if this swap continues on. e.g. d10657ce-b13a-405c-825b-b47f8a5016ad
176
- * @property {string} resultType - Type of result (OK or error type)
177
- * @property {QuoteSimulationResult | null} route - Suggested route
178
- * @property {string | null} error - Error message
179
- * @property {EvmTransaction | CosmosTransaction | Transfer | null} transaction - Transaction data
180
- *
181
- */
182
- export type SwapResponse = {
183
- requestId: string;
184
- resultType: 'OK' | 'HIGH_IMPACT' | 'INPUT_LIMIT_ISSUE' | 'NO_ROUTE';
185
- route: QuoteSimulationResult | null;
186
- error: string | null;
187
- tx: EvmTransaction | CosmosTransaction | Transfer | null;
188
- };
1
+ export * from 'rango-types/lib/api/basic/transactions';
189
2
  //# sourceMappingURL=transactions.d.ts.map
@@ -1 +1 @@
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,MAAM,MAAM,eAAe,GAAG;IAC5B,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,GAAG,EAAE,MAAM,CAAA;CACZ,CAAA;AAED;;;;;;GAMG;AACH,MAAM,MAAM,aAAa,GAAG;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,IAAI,EAAE,MAAM,CAAA;CACb,CAAA;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,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,MAA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MAAM,GAAG,IAAI,CAAA;IAC3B,iBAAiB,EAAE,MAAM,CAAA;IACzB,cAAc,EAAE,MAAM,GAAG,IAAI,CAAA;CAC9B,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,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,MAAM,MAAM,qBAAqB,GAAG;IAClC,UAAU,EAAE,OAAO,CAAA;CACpB,CAAA;AAED;;;;;;;;;;;GAWG;AACH,MAAM,MAAM,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
+ {"version":3,"file":"transactions.d.ts","sourceRoot":"","sources":["../../src/types/api/transactions.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAA"}
@@ -1,69 +1,2 @@
1
- import type { AssetWithTicker } from '../common';
2
- import { CosmosBlockchainMeta } from '../meta';
3
- import { TransactionType } from '../transactions';
4
- /**
5
- * CosmosCoin representing fee coins
6
- */
7
- export type CosmosCoin = {
8
- amount: string;
9
- denom: string;
10
- };
11
- /**
12
- * CosmosStdFee representing fee for cosmos transaction
13
- */
14
- export type CosmosStdFee = {
15
- amount: CosmosCoin[];
16
- gas: string;
17
- };
18
- /**
19
- * Main transaction object for COSMOS type transactions (including Terra, Osmosis, ...)
20
- */
21
- export type CosmosMessage = {
22
- signType: 'AMINO' | 'DIRECT';
23
- sequence: string | null;
24
- source: number | null;
25
- account_number: number | null;
26
- rpcUrl: string | null;
27
- chainId: string | null;
28
- msgs: any[];
29
- protoMsgs: any[];
30
- memo: string | null;
31
- fee: CosmosStdFee | null;
32
- };
33
- /**
34
- * An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages (e.g. XDefi)
35
- *
36
- * @property {AssetWithTicker} asset - The asset to be transferred
37
- * @property {string} amount - The machine-readable amount to transfer, example: 1000000000000000000
38
- * @property {number} decimals - The decimals for this asset, example: 18
39
- * @property {string | null} memo - Memo of transaction, could be null
40
- * @property {string} method - The transaction method, example: transfer, deposit
41
- * @property {string} recipient - The recipient address of transaction
42
- *
43
- */
44
- export type CosmosRawTransferData = {
45
- amount: string;
46
- asset: AssetWithTicker;
47
- decimals: number;
48
- memo: string | null;
49
- method: string;
50
- recipient: string;
51
- };
52
- /**
53
- * A Cosmos transaction, child of GenericTransaction
54
- *
55
- * @property {TransactionType} type - This fields equals to TransactionType.COSMOS for all CosmosTransactions
56
- * @property {CosmosBlockchainMeta} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction
57
- * @property {string} fromWalletAddress - Address of wallet that this transaction should be executed in, same as the create transaction request's input
58
- * @property {CosmosMessage} data - Transaction data
59
- * @property {CosmosRawTransferData} rawTransfer - An alternative to CosmosMessage object for the cosmos wallets that do not support generic Cosmos messages
60
- *
61
- */
62
- export interface CosmosTransaction {
63
- type: TransactionType;
64
- blockChain: CosmosBlockchainMeta;
65
- fromWalletAddress: string;
66
- data: CosmosMessage;
67
- rawTransfer: CosmosRawTransferData;
68
- }
1
+ export * from 'rango-types/lib/api/basic/txs/cosmos';
69
2
  //# sourceMappingURL=cosmos.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/cosmos.ts"],"names":[],"mappings":"AAAA,OAA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AAM,CAAA;IACzB,IAAI,EAAE,aAAa,CAAA;IACnB,WAAW,EAAE,qBAAqB,CAAA;CACnC"}
1
+ {"version":3,"file":"cosmos.d.ts","sourceRoot":"","sources":["../../../src/types/api/txs/cosmos.ts"],"names":[],"mappings":"AAAA,cAAc,sCAAsC,CAAA"}
@@ -1,30 +1,2 @@
1
- import { EvmBlockchainMeta } from '../meta';
2
- import { TransactionType } from '../transactions';
3
- /**
4
- * The transaction object for all EVM-based blockchains, including Ethereum, BSC, Polygon, Harmony, etc
5
- *
6
- * @property {TransactionType} type - This fields equals to TransactionType.EVM for all EVMTransactions
7
- * @property {EvmBlockchainMeta} blockChain - The blockchain info that this transaction is going to run in
8
- * @property {string | null} from - The source wallet address, it can be null
9
- * @property {string} approveTo - Address of source token erc20 contract for increasing approve amount
10
- * @property {string | null} approveData - The data of approve transaction
11
- * @property {string} txTo - Address of dex/bridge smart contract that is going to be called
12
- * @property {string | null} txData - The data of main transaction, it can be null in case of native token transfer
13
- * @property {string | null} value - The amount of transaction in case of native token transfer
14
- * @property {string | null} gasPrice - The suggested gas price for this transaction
15
- * @property {string | null} gasLimit - The suggested gas limit for this transaction
16
- *
17
- */
18
- export interface EvmTransaction {
19
- type: TransactionType;
20
- blockChain: EvmBlockchainMeta;
21
- from: string | null;
22
- approveTo: string | null;
23
- approveData: string | null;
24
- txTo: string;
25
- txData: string | null;
26
- value: string | null;
27
- gasLimit: string | null;
28
- gasPrice: string | null;
29
- }
1
+ export * from 'rango-types/lib/api/basic/txs/evm';
30
2
  //# sourceMappingURL=evm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/evm.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAA;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD;;;;;;;;;;;;;;GAcG;AACH,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,eAAe,CAAA;IACrB,UAAU,EAAE,iBAAiB,CAAA;IAC7B,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;IACnB,SAAS,EAAE,MAAM,GAAG,IAAI,CAAA;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,IAAI,EAAE,MAAM,CAAA;IACZ,MAAM,EAAE,MAAM,GAAG,IAAI,CAAA;IACrB,KAAK,EAAE,MAAM,GAAG,IAAI,CAAA;IACpB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;IACvB,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAA;CACxB"}
1
+ {"version":3,"file":"evm.d.ts","sourceRoot":"","sources":["../../../src/types/api/txs/evm.ts"],"names":[],"mappings":"AAAA,cAAc,mCAAmC,CAAA"}
@@ -1,4 +1,4 @@
1
- export * from './evm';
2
- export * from './cosmos';
3
- export * from './transfer';
1
+ export * from './evm';
2
+ export * from './cosmos';
3
+ export * from './transfer';
4
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/types/api/txs/index.ts"],"names":[],"mappings":"AAAA,cAAc,OAAO,CAAA;AACrB,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA"}
@@ -1,29 +1,2 @@
1
- import type { AssetWithTicker } from '../common';
2
- import { TransferBlockchainMeta } from '../meta';
3
- import { TransactionType } from '../transactions';
4
- /**
5
- * TransferTransaction. This type of transaction is used for non-EVM and non-Cosmos blockchains including BTC, LTC, BCH
6
- *
7
- * @property {TransactionType} type - This fields equals to TransactionType.TRANSFER for all TransferTransactions
8
- * @property {TransferBlockchainMeta} blockChain - The blockchain that this transaction will be executed in, same as the input blockchain of creating transaction
9
- * @property {string} method - The method that should be passed to wallet. examples: deposit, transfer
10
- * @property {AssetWithTicker} asset
11
- * @property {string} amount - The machine-readable amount of transaction, example: 1000000000000000000
12
- * @property {number} decimals - The decimals of the asset
13
- * @property {string} fromWalletAddress - The source wallet address that can sign this transaction
14
- * @property {string} recipientAddress - The destination wallet address that the fund should be sent to
15
- * @property {string | null} memo - The memo of transaction, can be null
16
- *
17
- */
18
- export interface Transfer {
19
- type: TransactionType;
20
- blockChain: TransferBlockchainMeta;
21
- method: string;
22
- asset: AssetWithTicker;
23
- amount: string;
24
- decimals: number;
25
- fromWalletAddress: string;
26
- recipientAddress: string;
27
- memo: string | null;
28
- }
1
+ export * from 'rango-types/lib/api/basic/txs/transfer';
29
2
  //# sourceMappingURL=transfer.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../../src/types/api/txs/transfer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,WAAW,CAAA;AAChD,OAAO,EAAE,sBAAsB,EAAE,MAAM,SAAS,CAAA;AAChD,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAA;AAEjD;;;;;;;;;;;;;GAaG;AACH,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,eAAe,CAAA;IACrB,UAAU,EAAE,sBAAsB,CAAA;IAClC,MAAM,EAAE,MAAM,CAAA;IACd,KAAK,EAAE,eAAe,CAAA;IACtB,MAAM,EAAE,MAAM,CAAA;IACd,QAAQ,EAAE,MAAM,CAAA;IAChB,iBAAiB,EAAE,MAAM,CAAA;IACzB,gBAAgB,EAAE,MAAM,CAAA;IACxB,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CACpB"}
1
+ {"version":3,"file":"transfer.d.ts","sourceRoot":"","sources":["../../../src/types/api/txs/transfer.ts"],"names":[],"mappings":"AAAA,cAAc,wCAAwC,CAAA"}
@@ -1,8 +1,8 @@
1
- export * from './api/balance';
2
- export * from './api/common';
3
- export * from './api/meta';
4
- export * from './api/routing';
5
- export * from './api/transactions';
6
- export * from './api/txs';
7
- export * from './utils/errors';
1
+ export * from './api/balance';
2
+ export * from './api/common';
3
+ export * from './api/meta';
4
+ export * from './api/routing';
5
+ export * from './api/transactions';
6
+ export * from './api/txs';
7
+ export * from './utils/errors';
8
8
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAA;AAC7B,cAAc,cAAc,CAAA;AAC5B,cAAc,YAAY,CAAA;AAC1B,cAAc,eAAe,CAAA;AAC7B,cAAc,oBAAoB,CAAA;AAClC,cAAc,WAAW,CAAA;AACzB,cAAc,gBAAgB,CAAA"}
@@ -1,23 +1,23 @@
1
- export declare const MetamaskErrorCodes: {
2
- rpc: {
3
- invalidInput: number;
4
- resourceNotFound: number;
5
- resourceUnavailable: number;
6
- transactionRejected: number;
7
- methodNotSupported: number;
8
- limitExceeded: number;
9
- parse: number;
10
- invalidRequest: number;
11
- methodNotFound: number;
12
- invalidParams: number;
13
- internal: number;
14
- };
15
- provider: {
16
- userRejectedRequest: number;
17
- unauthorized: number;
18
- unsupportedMethod: number;
19
- disconnected: number;
20
- chainDisconnected: number;
21
- };
22
- };
1
+ export declare const MetamaskErrorCodes: {
2
+ rpc: {
3
+ invalidInput: number;
4
+ resourceNotFound: number;
5
+ resourceUnavailable: number;
6
+ transactionRejected: number;
7
+ methodNotSupported: number;
8
+ limitExceeded: number;
9
+ parse: number;
10
+ invalidRequest: number;
11
+ methodNotFound: number;
12
+ invalidParams: number;
13
+ internal: number;
14
+ };
15
+ provider: {
16
+ userRejectedRequest: number;
17
+ unauthorized: number;
18
+ unsupportedMethod: number;
19
+ disconnected: number;
20
+ chainDisconnected: number;
21
+ };
22
+ };
23
23
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../../src/types/utils/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;CAqB9B,CAAA"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/types/utils/errors.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;CAqB9B,CAAA"}
@@ -1,2 +1,2 @@
1
- export declare const prettifyError: (error: any) => any;
1
+ export declare const prettifyError: (error: any) => any;
2
2
  //# sourceMappingURL=errors.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/utils/errors.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,UAAW,GAAG,QAwBvC,CAAA"}
1
+ {"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../src/utils/errors.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,aAAa,UAAW,GAAG,QAwBvC,CAAA"}
@@ -1,2 +1,2 @@
1
- export declare function sleep(ms: number): Promise<unknown>;
1
+ export declare function sleep(ms: number): Promise<unknown>;
2
2
  //# sourceMappingURL=promise.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../../src/utils/promise.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,oBAE/B"}
1
+ {"version":3,"file":"promise.d.ts","sourceRoot":"","sources":["../src/utils/promise.ts"],"names":[],"mappings":"AAAA,wBAAgB,KAAK,CAAC,EAAE,EAAE,MAAM,oBAE/B"}
package/package.json CHANGED
@@ -1,9 +1,10 @@
1
1
  {
2
2
  "name": "rango-sdk-basic",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "Rango Exchange Basic SDK for dApps",
5
+ "module": "lib/rango-sdk-basic.esm.js",
5
6
  "main": "lib/index.js",
6
- "types": "lib",
7
+ "types": "lib/index.d.ts",
7
8
  "repository": {
8
9
  "type": "git",
9
10
  "url": "git+https://github.com/rango-exchange/rango-sdk.git"
@@ -13,11 +14,12 @@
13
14
  "url": "https://github.com/rango-exchange/rango-sdk/issues"
14
15
  },
15
16
  "scripts": {
16
- "test": "jest --config jestconfig.json",
17
- "build": "tsc",
17
+ "build": "tsdx build --tsconfig ./tsconfig.json && yarn mv:file lib",
18
+ "watch": "tsdx watch",
18
19
  "format": "prettier --write ./src",
19
20
  "lint": "eslint */**/*.{js,ts} --quiet --fix",
20
- "semantic-release": "semantic-release"
21
+ "semantic-release": "semantic-release",
22
+ "mv:file": "sh ./scripts/post-build.sh"
21
23
  },
22
24
  "keywords": [
23
25
  "Rango Exchange",
@@ -31,26 +33,25 @@
31
33
  "author": "rango.exchange",
32
34
  "license": "GPL-3.0",
33
35
  "devDependencies": {
34
- "@types/jest": "^27.4.0",
35
- "@types/uuid": "^8.3.4",
36
+ "@rollup/plugin-replace": "^5.0.2",
37
+ "@types/uuid": "^9.0.0",
38
+ "@types/node": "^18.11.18",
36
39
  "@typescript-eslint/eslint-plugin": "^5.9.1",
37
40
  "@typescript-eslint/parser": "^5.9.1",
38
- "eslint": "^8.6.0",
39
- "eslint-config-prettier": "^8.3.0",
40
- "eslint-plugin-import": "^2.25.4",
41
- "eslint-plugin-prettier": "^4.0.0",
42
- "jest": "^27.4.7",
43
- "prettier": "^2.5.1",
44
- "semantic-release": "^19.0.2",
45
- "ts-jest": "^27.1.3",
46
- "typescript": "^4.5.4"
41
+ "eslint": "^8.33.0",
42
+ "eslint-config-prettier": "^8.6.0",
43
+ "eslint-plugin-import": "^2.27.5",
44
+ "eslint-plugin-prettier": "^4.2.1",
45
+ "prettier": "^2.8.3",
46
+ "typescript": "^4.9.4"
47
47
  },
48
48
  "dependencies": {
49
- "axios": "^0.24.0",
50
- "bignumber.js": "^9.0.2",
49
+ "axios": "^1.2.6",
50
+ "bignumber.js": "^9.1.1",
51
51
  "eth-rpc-errors": "^4.0.3",
52
52
  "ethers": "^5.7.2",
53
- "uuid": "^8.3.2"
53
+ "rango-types": "^0.1.1",
54
+ "uuid": "^9.0.0"
54
55
  },
55
56
  "publishConfig": {
56
57
  "access": "public",
package/lib/index.js.map DELETED
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,uCAAwC;AAA/B,uGAAA,WAAW,OAAA;AACpB,0CAAuB"}