@skip-go/client 0.4.3 → 0.4.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,1868 +0,0 @@
1
- 'use strict';
2
-
3
- // src/types/converters.ts
4
- function affiliateFromJSON(affiliateJSON) {
5
- return {
6
- address: affiliateJSON.address,
7
- basisPointsFee: affiliateJSON.basis_points_fee
8
- };
9
- }
10
- function affiliateToJSON(affiliate) {
11
- return {
12
- address: affiliate.address,
13
- basis_points_fee: affiliate.basisPointsFee
14
- };
15
- }
16
- function assetFromJSON(assetJSON) {
17
- return {
18
- denom: assetJSON.denom,
19
- chainID: assetJSON.chain_id,
20
- originDenom: assetJSON.origin_denom,
21
- originChainID: assetJSON.origin_chain_id,
22
- trace: assetJSON.trace,
23
- isCW20: assetJSON.is_cw20,
24
- isEVM: assetJSON.is_evm,
25
- isSVM: assetJSON.is_svm,
26
- symbol: assetJSON.symbol,
27
- name: assetJSON.name,
28
- logoURI: assetJSON.logo_uri,
29
- decimals: assetJSON.decimals,
30
- tokenContract: assetJSON.token_contract,
31
- description: assetJSON.description,
32
- coingeckoID: assetJSON.coingecko_id,
33
- recommendedSymbol: assetJSON.recommended_symbol
34
- };
35
- }
36
- function assetToJSON(asset) {
37
- return {
38
- denom: asset.denom,
39
- chain_id: asset.chainID,
40
- origin_denom: asset.originDenom,
41
- origin_chain_id: asset.originChainID,
42
- trace: asset.trace,
43
- is_cw20: asset.isCW20,
44
- is_evm: asset.isEVM,
45
- is_svm: asset.isSVM,
46
- symbol: asset.symbol,
47
- name: asset.name,
48
- logo_uri: asset.logoURI,
49
- decimals: asset.decimals,
50
- token_contract: asset.tokenContract,
51
- description: asset.description,
52
- coingecko_id: asset.coingeckoID,
53
- recommended_symbol: asset.recommendedSymbol
54
- };
55
- }
56
- function assetRecommendationFromJSON(assetRecommendationJSON) {
57
- return {
58
- asset: assetFromJSON(assetRecommendationJSON.asset),
59
- reason: assetRecommendationJSON.reason
60
- };
61
- }
62
- function assetRecommendationToJSON(assetRecommendation) {
63
- return {
64
- asset: assetToJSON(assetRecommendation.asset),
65
- reason: assetRecommendation.reason
66
- };
67
- }
68
- function assetsFromSourceRequestFromJSON(assetsFromSourceRequestJSON) {
69
- return {
70
- sourceAssetDenom: assetsFromSourceRequestJSON.source_asset_denom,
71
- sourceAssetChainID: assetsFromSourceRequestJSON.source_asset_chain_id,
72
- allowMultiTx: assetsFromSourceRequestJSON.allow_multi_tx,
73
- includeCW20Assets: assetsFromSourceRequestJSON.include_cw20_assets
74
- };
75
- }
76
- function assetsFromSourceRequestToJSON(assetsFromSourceRequest) {
77
- return {
78
- source_asset_denom: assetsFromSourceRequest.sourceAssetDenom,
79
- source_asset_chain_id: assetsFromSourceRequest.sourceAssetChainID,
80
- allow_multi_tx: assetsFromSourceRequest.allowMultiTx,
81
- include_cw20_assets: assetsFromSourceRequest.includeCW20Assets
82
- };
83
- }
84
- function assetsRequestFromJSON(assetsRequestJSON) {
85
- return {
86
- chainIDs: assetsRequestJSON.chain_ids,
87
- chainID: assetsRequestJSON.chain_id,
88
- nativeOnly: assetsRequestJSON.native_only,
89
- includeNoMetadataAssets: assetsRequestJSON.include_no_metadata_assets,
90
- includeCW20Assets: assetsRequestJSON.include_cw20_assets,
91
- includeEvmAssets: assetsRequestJSON.include_evm_assets,
92
- includeSvmAssets: assetsRequestJSON.include_svm_assets
93
- };
94
- }
95
- function assetsRequestToJSON(assetsRequest) {
96
- return {
97
- chain_ids: assetsRequest.chainIDs,
98
- chain_id: assetsRequest.chainID,
99
- native_only: assetsRequest.nativeOnly,
100
- include_no_metadata_assets: assetsRequest.includeNoMetadataAssets,
101
- include_cw20_assets: assetsRequest.includeCW20Assets,
102
- include_evm_assets: assetsRequest.includeEvmAssets,
103
- include_svm_assets: assetsRequest.includeSvmAssets,
104
- only_testnets: assetsRequest.onlyTestnets
105
- };
106
- }
107
- function chainFromJSON(chainJSON) {
108
- return {
109
- chainName: chainJSON.chain_name,
110
- chainID: chainJSON.chain_id,
111
- pfmEnabled: chainJSON.pfm_enabled,
112
- cosmosSDKVersion: chainJSON.cosmos_sdk_version,
113
- modules: chainJSON.modules,
114
- cosmosModuleSupport: chainJSON.cosmos_module_support,
115
- supportsMemo: chainJSON.supports_memo,
116
- logoURI: chainJSON.logo_uri,
117
- bech32Prefix: chainJSON.bech32_prefix,
118
- feeAssets: chainJSON.fee_assets.map(feeAssetFromJSON),
119
- chainType: chainJSON.chain_type,
120
- ibcCapabilities: ibcCapabilitiesFromJSON(chainJSON.ibc_capabilities),
121
- isTestnet: chainJSON.is_testnet,
122
- prettyName: chainJSON.pretty_name
123
- };
124
- }
125
- function chainToJSON(chain) {
126
- return {
127
- chain_name: chain.chainName,
128
- chain_id: chain.chainID,
129
- pfm_enabled: chain.pfmEnabled,
130
- cosmos_sdk_version: chain.cosmosSDKVersion,
131
- modules: chain.modules,
132
- cosmos_module_support: chain.cosmosModuleSupport,
133
- supports_memo: chain.supportsMemo,
134
- logo_uri: chain.logoURI,
135
- bech32_prefix: chain.bech32Prefix,
136
- fee_assets: chain.feeAssets.map(feeAssetToJSON),
137
- chain_type: chain.chainType,
138
- ibc_capabilities: ibcCapabilitiesToJSON(chain.ibcCapabilities),
139
- is_testnet: chain.isTestnet,
140
- pretty_name: chain.prettyName
141
- };
142
- }
143
- function feeAssetFromJSON(feeAssetJSON) {
144
- return {
145
- denom: feeAssetJSON.denom,
146
- gasPrice: feeAssetJSON.gas_price
147
- };
148
- }
149
- function feeAssetToJSON(feeAsset) {
150
- return {
151
- denom: feeAsset.denom,
152
- gas_price: feeAsset.gasPrice
153
- };
154
- }
155
- function ibcCapabilitiesFromJSON(ibcCapabilitiesJSON) {
156
- return {
157
- cosmosPfm: ibcCapabilitiesJSON.cosmos_pfm,
158
- cosmosIbcHooks: ibcCapabilitiesJSON.cosmos_ibc_hooks,
159
- cosmosMemo: ibcCapabilitiesJSON.cosmos_memo,
160
- cosmosAutopilot: ibcCapabilitiesJSON.cosmos_autopilot
161
- };
162
- }
163
- function ibcCapabilitiesToJSON(ibcCapabilities) {
164
- return {
165
- cosmos_pfm: ibcCapabilities.cosmosPfm,
166
- cosmos_ibc_hooks: ibcCapabilities.cosmosIbcHooks,
167
- cosmos_memo: ibcCapabilities.cosmosMemo,
168
- cosmos_autopilot: ibcCapabilities.cosmosAutopilot
169
- };
170
- }
171
- function recommendAssetsRequestFromJSON(recommendAssetsRequestJSON) {
172
- return {
173
- requests: recommendAssetsRequestJSON.requests.map(
174
- assetRecommendationRequestFromJSON
175
- )
176
- };
177
- }
178
- function recommendAssetsRequestToJSON(recommendAssetsRequest) {
179
- return {
180
- requests: recommendAssetsRequest.requests.map(
181
- assetRecommendationRequestToJSON
182
- )
183
- };
184
- }
185
- function recommendAssetsResponseFromJSON(value) {
186
- return {
187
- recommendations: value.recommendations.map(assetRecommendationFromJSON),
188
- recommendationEntries: value.recommendation_entries.map(
189
- recommendationEntryFromJSON
190
- )
191
- };
192
- }
193
- function recommendAssetsResponseToJSON(value) {
194
- return {
195
- recommendations: value.recommendations.map(assetRecommendationToJSON),
196
- recommendation_entries: value.recommendationEntries.map(
197
- recommendationEntryToJSON
198
- )
199
- };
200
- }
201
- function recommendationEntryFromJSON(value) {
202
- return {
203
- recommendations: value.recommendations.map(assetRecommendationFromJSON),
204
- error: value.error
205
- };
206
- }
207
- function recommendationEntryToJSON(value) {
208
- return {
209
- recommendations: value.recommendations.map(assetRecommendationToJSON),
210
- error: value.error
211
- };
212
- }
213
- function estimatedFeeFromJSON(estimatedFeeJSON) {
214
- return {
215
- amount: estimatedFeeJSON.amount,
216
- bridgeID: estimatedFeeJSON.bridge_id,
217
- chainID: estimatedFeeJSON.chain_id,
218
- feeType: estimatedFeeJSON.fee_type,
219
- originAsset: estimatedFeeJSON.origin_asset && assetFromJSON(estimatedFeeJSON.origin_asset),
220
- txIndex: estimatedFeeJSON.tx_index,
221
- usdAmount: estimatedFeeJSON.usd_amount,
222
- operationIndex: estimatedFeeJSON.operation_index
223
- };
224
- }
225
- function estimatedFeeToJSON(estimatedFee) {
226
- return {
227
- amount: estimatedFee.amount,
228
- bridge_id: estimatedFee.bridgeID,
229
- chain_id: estimatedFee.chainID,
230
- fee_type: estimatedFee.feeType,
231
- origin_asset: estimatedFee.originAsset && assetToJSON(estimatedFee.originAsset),
232
- tx_index: estimatedFee.txIndex,
233
- usd_amount: estimatedFee.usdAmount,
234
- operation_index: estimatedFee.operationIndex
235
- };
236
- }
237
- function swapVenueFromJSON(swapVenueJSON) {
238
- return {
239
- name: swapVenueJSON.name,
240
- chainID: swapVenueJSON.chain_id,
241
- logoUri: swapVenueJSON.logo_uri
242
- };
243
- }
244
- function swapVenueToJSON(swapVenue) {
245
- return {
246
- name: swapVenue.name,
247
- chain_id: swapVenue.chainID,
248
- logo_uri: swapVenue.logoUri
249
- };
250
- }
251
- function swapVenueRequestFromJSON(SwapVenueRequestJSON) {
252
- return {
253
- name: SwapVenueRequestJSON.name,
254
- chainID: SwapVenueRequestJSON.chain_id
255
- };
256
- }
257
- function swapVenueRequestToJSON(swapVenueRequest) {
258
- return {
259
- name: swapVenueRequest.name,
260
- chain_id: swapVenueRequest.chainID
261
- };
262
- }
263
- function routeRequestFromJSON(routeRequestJSON) {
264
- const swapVenues = routeRequestJSON.swap_venues ? routeRequestJSON.swap_venues.map(swapVenueRequestFromJSON) : void 0;
265
- if (routeRequestJSON.amount_in !== void 0) {
266
- return {
267
- sourceAssetDenom: routeRequestJSON.source_asset_denom,
268
- sourceAssetChainID: routeRequestJSON.source_asset_chain_id,
269
- destAssetDenom: routeRequestJSON.dest_asset_denom,
270
- destAssetChainID: routeRequestJSON.dest_asset_chain_id,
271
- amountIn: routeRequestJSON.amount_in,
272
- cumulativeAffiliateFeeBPS: routeRequestJSON.cumulative_affiliate_fee_bps,
273
- swapVenue: routeRequestJSON.swap_venue ? swapVenueRequestFromJSON(routeRequestJSON.swap_venue) : void 0,
274
- swapVenues,
275
- allowUnsafe: routeRequestJSON.allow_unsafe,
276
- experimentalFeatures: routeRequestJSON.experimental_features,
277
- bridges: routeRequestJSON.bridges,
278
- allowMultiTx: routeRequestJSON.allow_multi_tx,
279
- smartRelay: routeRequestJSON.smart_relay,
280
- smartSwapOptions: routeRequestJSON.smart_swap_options ? smartSwapOptionsFromJSON(routeRequestJSON.smart_swap_options) : void 0,
281
- allowSwaps: routeRequestJSON.allow_swaps
282
- };
283
- }
284
- return {
285
- sourceAssetDenom: routeRequestJSON.source_asset_denom,
286
- sourceAssetChainID: routeRequestJSON.source_asset_chain_id,
287
- destAssetDenom: routeRequestJSON.dest_asset_denom,
288
- destAssetChainID: routeRequestJSON.dest_asset_chain_id,
289
- amountOut: routeRequestJSON.amount_out,
290
- cumulativeAffiliateFeeBPS: routeRequestJSON.cumulative_affiliate_fee_bps,
291
- swapVenue: routeRequestJSON.swap_venue ? swapVenueRequestFromJSON(routeRequestJSON.swap_venue) : void 0,
292
- swapVenues,
293
- allowUnsafe: routeRequestJSON.allow_unsafe,
294
- experimentalFeatures: routeRequestJSON.experimental_features,
295
- bridges: routeRequestJSON.bridges,
296
- allowMultiTx: routeRequestJSON.allow_multi_tx,
297
- smartRelay: routeRequestJSON.smart_relay,
298
- smartSwapOptions: routeRequestJSON.smart_swap_options ? smartSwapOptionsFromJSON(routeRequestJSON.smart_swap_options) : void 0,
299
- allowSwaps: routeRequestJSON.allow_swaps
300
- };
301
- }
302
- function routeRequestToJSON(routeRequest) {
303
- const swapVenues = routeRequest.swapVenues ? routeRequest.swapVenues.map(swapVenueRequestToJSON) : void 0;
304
- if (routeRequest.amountIn !== void 0) {
305
- return {
306
- source_asset_denom: routeRequest.sourceAssetDenom,
307
- source_asset_chain_id: routeRequest.sourceAssetChainID,
308
- dest_asset_denom: routeRequest.destAssetDenom,
309
- dest_asset_chain_id: routeRequest.destAssetChainID,
310
- amount_in: routeRequest.amountIn,
311
- cumulative_affiliate_fee_bps: routeRequest.cumulativeAffiliateFeeBPS,
312
- swap_venue: routeRequest.swapVenue ? swapVenueRequestToJSON(routeRequest.swapVenue) : void 0,
313
- swap_venues: swapVenues,
314
- allow_unsafe: routeRequest.allowUnsafe,
315
- experimental_features: routeRequest.experimentalFeatures,
316
- bridges: routeRequest.bridges,
317
- allow_multi_tx: routeRequest.allowMultiTx,
318
- smart_relay: routeRequest.smartRelay,
319
- smart_swap_options: routeRequest.smartSwapOptions ? smartSwapOptionsToJSON(routeRequest.smartSwapOptions) : void 0,
320
- allow_swaps: routeRequest.allowSwaps
321
- };
322
- }
323
- return {
324
- source_asset_denom: routeRequest.sourceAssetDenom,
325
- source_asset_chain_id: routeRequest.sourceAssetChainID,
326
- dest_asset_denom: routeRequest.destAssetDenom,
327
- dest_asset_chain_id: routeRequest.destAssetChainID,
328
- amount_out: routeRequest.amountOut,
329
- cumulative_affiliate_fee_bps: routeRequest.cumulativeAffiliateFeeBPS,
330
- swap_venue: routeRequest.swapVenue ? swapVenueRequestToJSON(routeRequest.swapVenue) : void 0,
331
- swap_venues: swapVenues,
332
- allow_unsafe: routeRequest.allowUnsafe,
333
- experimental_features: routeRequest.experimentalFeatures,
334
- bridges: routeRequest.bridges,
335
- allow_multi_tx: routeRequest.allowMultiTx,
336
- smart_relay: routeRequest.smartRelay,
337
- smart_swap_options: routeRequest.smartSwapOptions ? smartSwapOptionsToJSON(routeRequest.smartSwapOptions) : void 0,
338
- allow_swaps: routeRequest.allowSwaps
339
- };
340
- }
341
- function transferFromJSON(transferJSON) {
342
- return {
343
- port: transferJSON.port,
344
- channel: transferJSON.channel,
345
- fromChainID: transferJSON.from_chain_id,
346
- toChainID: transferJSON.to_chain_id,
347
- pfmEnabled: transferJSON.pfm_enabled,
348
- supportsMemo: transferJSON.supports_memo,
349
- denomIn: transferJSON.denom_in,
350
- denomOut: transferJSON.denom_out,
351
- feeAmount: transferJSON.fee_amount,
352
- usdFeeAmount: transferJSON.usd_fee_amount,
353
- feeAsset: transferJSON.fee_asset && assetFromJSON(transferJSON.fee_asset),
354
- bridgeID: transferJSON.bridge_id,
355
- destDenom: transferJSON.dest_denom,
356
- chainID: transferJSON.chain_id,
357
- smartRelay: transferJSON.smart_relay
358
- };
359
- }
360
- function transferToJSON(transfer) {
361
- return {
362
- port: transfer.port,
363
- channel: transfer.channel,
364
- from_chain_id: transfer.fromChainID,
365
- to_chain_id: transfer.toChainID,
366
- pfm_enabled: transfer.pfmEnabled,
367
- supports_memo: transfer.supportsMemo,
368
- denom_in: transfer.denomIn,
369
- denom_out: transfer.denomOut,
370
- fee_amount: transfer.feeAmount,
371
- usd_fee_amount: transfer.usdFeeAmount,
372
- fee_asset: transfer.feeAsset && assetToJSON(transfer.feeAsset),
373
- bridge_id: transfer.bridgeID,
374
- dest_denom: transfer.destDenom,
375
- chain_id: transfer.chainID,
376
- smart_relay: transfer.smartRelay
377
- };
378
- }
379
- function swapOperationFromJSON(swapOperationJSON) {
380
- return {
381
- pool: swapOperationJSON.pool,
382
- denomIn: swapOperationJSON.denom_in,
383
- denomOut: swapOperationJSON.denom_out,
384
- interface: swapOperationJSON.interface
385
- };
386
- }
387
- function swapOperationToJSON(swapOperation) {
388
- return {
389
- pool: swapOperation.pool,
390
- denom_in: swapOperation.denomIn,
391
- denom_out: swapOperation.denomOut,
392
- interface: swapOperation.interface
393
- };
394
- }
395
- function swapRouteFromJSON(swapRouteJSON) {
396
- return {
397
- swapAmountIn: swapRouteJSON.swap_amount_in,
398
- denomIn: swapRouteJSON.denom_in,
399
- swapOperations: swapRouteJSON.swap_operations.map(swapOperationFromJSON)
400
- };
401
- }
402
- function swapRouteToJSON(swapRoute) {
403
- return {
404
- swap_amount_in: swapRoute.swapAmountIn,
405
- denom_in: swapRoute.denomIn,
406
- swap_operations: swapRoute.swapOperations.map(swapOperationToJSON)
407
- };
408
- }
409
- function swapExactCoinInFromJSON(swapExactCoinInJSON) {
410
- return {
411
- swapVenue: swapVenueFromJSON(swapExactCoinInJSON.swap_venue),
412
- swapOperations: swapExactCoinInJSON.swap_operations.map(
413
- swapOperationFromJSON
414
- ),
415
- swapAmountIn: swapExactCoinInJSON.swap_amount_in,
416
- priceImpactPercent: swapExactCoinInJSON.price_impact_percent
417
- };
418
- }
419
- function swapExactCoinInToJSON(swapExactCoinIn) {
420
- return {
421
- swap_venue: swapVenueToJSON(swapExactCoinIn.swapVenue),
422
- swap_operations: swapExactCoinIn.swapOperations.map(swapOperationToJSON),
423
- swap_amount_in: swapExactCoinIn.swapAmountIn,
424
- price_impact_percent: swapExactCoinIn.priceImpactPercent
425
- };
426
- }
427
- function smartSwapExactCoinInFromJSON(smartSwapExactCoinInJSON) {
428
- return {
429
- swapVenue: swapVenueFromJSON(smartSwapExactCoinInJSON.swap_venue),
430
- swapRoutes: smartSwapExactCoinInJSON.swap_routes.map(swapRouteFromJSON)
431
- };
432
- }
433
- function smartSwapExactCoinInToJSON(smartSwapExactCoinIn) {
434
- return {
435
- swap_venue: swapVenueToJSON(smartSwapExactCoinIn.swapVenue),
436
- swap_routes: smartSwapExactCoinIn.swapRoutes.map(swapRouteToJSON)
437
- };
438
- }
439
- function swapExactCoinOutFromJSON(swapExactCoinOutJSON) {
440
- return {
441
- swapVenue: swapVenueFromJSON(swapExactCoinOutJSON.swap_venue),
442
- swapOperations: swapExactCoinOutJSON.swap_operations.map(
443
- swapOperationFromJSON
444
- ),
445
- swapAmountOut: swapExactCoinOutJSON.swap_amount_out,
446
- priceImpactPercent: swapExactCoinOutJSON.price_impact_percent
447
- };
448
- }
449
- function swapExactCoinOutToJSON(swapExactCoinOut) {
450
- return {
451
- swap_venue: swapVenueToJSON(swapExactCoinOut.swapVenue),
452
- swap_operations: swapExactCoinOut.swapOperations.map(swapOperationToJSON),
453
- swap_amount_out: swapExactCoinOut.swapAmountOut,
454
- price_impact_percent: swapExactCoinOut.priceImpactPercent
455
- };
456
- }
457
- function swapFromJSON(swapJSON) {
458
- if ("swap_in" in swapJSON) {
459
- return {
460
- swapIn: swapExactCoinInFromJSON(swapJSON.swap_in),
461
- estimatedAffiliateFee: swapJSON.estimated_affiliate_fee,
462
- fromChainID: swapJSON.from_chain_id,
463
- chainID: swapJSON.chain_id,
464
- denomIn: swapJSON.denom_in,
465
- denomOut: swapJSON.denom_out,
466
- swapVenues: swapJSON.swap_venues.map(swapVenueFromJSON)
467
- };
468
- } else if ("smart_swap_in" in swapJSON) {
469
- return {
470
- smartSwapIn: smartSwapExactCoinInFromJSON(swapJSON.smart_swap_in),
471
- estimatedAffiliateFee: swapJSON.estimated_affiliate_fee,
472
- fromChainID: swapJSON.from_chain_id,
473
- chainID: swapJSON.chain_id,
474
- denomIn: swapJSON.denom_in,
475
- denomOut: swapJSON.denom_out,
476
- swapVenues: swapJSON.swap_venues.map(swapVenueFromJSON)
477
- };
478
- }
479
- return {
480
- swapOut: swapExactCoinOutFromJSON(swapJSON.swap_out),
481
- estimatedAffiliateFee: swapJSON.estimated_affiliate_fee,
482
- fromChainID: swapJSON.from_chain_id,
483
- chainID: swapJSON.chain_id,
484
- denomIn: swapJSON.denom_in,
485
- denomOut: swapJSON.denom_out,
486
- swapVenues: swapJSON.swap_venues.map(swapVenueFromJSON)
487
- };
488
- }
489
- function swapToJSON(swap) {
490
- if ("swapIn" in swap) {
491
- return {
492
- swap_in: swapExactCoinInToJSON(swap.swapIn),
493
- estimated_affiliate_fee: swap.estimatedAffiliateFee,
494
- from_chain_id: swap.fromChainID,
495
- chain_id: swap.chainID,
496
- denom_in: swap.denomIn,
497
- denom_out: swap.denomOut,
498
- swap_venues: swap.swapVenues.map(swapVenueToJSON)
499
- };
500
- } else if ("smartSwapIn" in swap) {
501
- return {
502
- smart_swap_in: smartSwapExactCoinInToJSON(swap.smartSwapIn),
503
- estimated_affiliate_fee: swap.estimatedAffiliateFee,
504
- from_chain_id: swap.fromChainID,
505
- chain_id: swap.chainID,
506
- denom_in: swap.denomIn,
507
- denom_out: swap.denomOut,
508
- swap_venues: swap.swapVenues.map(swapVenueToJSON)
509
- };
510
- }
511
- return {
512
- swap_out: swapExactCoinOutToJSON(swap.swapOut),
513
- estimated_affiliate_fee: swap.estimatedAffiliateFee,
514
- from_chain_id: swap.fromChainID,
515
- chain_id: swap.chainID,
516
- denom_in: swap.denomIn,
517
- denom_out: swap.denomOut,
518
- swap_venues: swap.swapVenues.map(swapVenueToJSON)
519
- };
520
- }
521
- function evmSwapFromJSON(evmSwapJSON) {
522
- return {
523
- inputToken: evmSwapJSON.input_token,
524
- amountIn: evmSwapJSON.amount_in,
525
- swapCalldata: evmSwapJSON.swap_calldata,
526
- amountOut: evmSwapJSON.amount_out,
527
- fromChainID: evmSwapJSON.from_chain_id,
528
- denomIn: evmSwapJSON.denom_in,
529
- denomOut: evmSwapJSON.denom_out,
530
- swapVenues: evmSwapJSON.swap_venues.map(swapVenueFromJSON)
531
- };
532
- }
533
- function evmSwapToJSON(evmSwap) {
534
- return {
535
- input_token: evmSwap.inputToken,
536
- amount_in: evmSwap.amountIn,
537
- swap_calldata: evmSwap.swapCalldata,
538
- amount_out: evmSwap.amountOut,
539
- from_chain_id: evmSwap.fromChainID,
540
- denom_in: evmSwap.denomIn,
541
- denom_out: evmSwap.denomOut,
542
- swap_venues: evmSwap.swapVenues.map(swapVenueToJSON)
543
- };
544
- }
545
- function operationFromJSON(operationJSON) {
546
- if ("transfer" in operationJSON) {
547
- return {
548
- transfer: transferFromJSON(operationJSON.transfer),
549
- txIndex: operationJSON.tx_index,
550
- amountIn: operationJSON.amount_in,
551
- amountOut: operationJSON.amount_out
552
- };
553
- }
554
- if ("bank_send" in operationJSON) {
555
- return {
556
- bankSend: bankSendFromJSON(operationJSON.bank_send),
557
- txIndex: operationJSON.tx_index,
558
- amountIn: operationJSON.amount_in,
559
- amountOut: operationJSON.amount_out
560
- };
561
- }
562
- if ("axelar_transfer" in operationJSON) {
563
- return {
564
- axelarTransfer: axelarTransferFromJSON(operationJSON.axelar_transfer),
565
- txIndex: operationJSON.tx_index,
566
- amountIn: operationJSON.amount_in,
567
- amountOut: operationJSON.amount_out
568
- };
569
- }
570
- if ("cctp_transfer" in operationJSON) {
571
- return {
572
- cctpTransfer: cctpTransferFromJSON(operationJSON.cctp_transfer),
573
- txIndex: operationJSON.tx_index,
574
- amountIn: operationJSON.amount_in,
575
- amountOut: operationJSON.amount_out
576
- };
577
- }
578
- if ("hyperlane_transfer" in operationJSON) {
579
- return {
580
- hyperlaneTransfer: hyperlaneTransferFromJSON(
581
- operationJSON.hyperlane_transfer
582
- ),
583
- txIndex: operationJSON.tx_index,
584
- amountIn: operationJSON.amount_in,
585
- amountOut: operationJSON.amount_out
586
- };
587
- }
588
- if ("op_init_transfer" in operationJSON) {
589
- return {
590
- opInitTransfer: opInitTransferFromJSON(operationJSON.op_init_transfer),
591
- txIndex: operationJSON.tx_index,
592
- amountIn: operationJSON.amount_in,
593
- amountOut: operationJSON.amount_out
594
- };
595
- }
596
- if ("swap" in operationJSON) {
597
- return {
598
- swap: swapFromJSON(operationJSON.swap),
599
- txIndex: operationJSON.tx_index,
600
- amountIn: operationJSON.amount_in,
601
- amountOut: operationJSON.amount_out
602
- };
603
- }
604
- return {
605
- evmSwap: evmSwapFromJSON(operationJSON.evm_swap),
606
- txIndex: operationJSON.tx_index,
607
- amountIn: operationJSON.amount_in,
608
- amountOut: operationJSON.amount_out
609
- };
610
- }
611
- function operationToJSON(operation) {
612
- if ("transfer" in operation) {
613
- return {
614
- transfer: transferToJSON(operation.transfer),
615
- tx_index: operation.txIndex,
616
- amount_in: operation.amountIn,
617
- amount_out: operation.amountOut
618
- };
619
- }
620
- if ("bankSend" in operation) {
621
- return {
622
- bank_send: bankSendToJSON(operation.bankSend),
623
- tx_index: operation.txIndex,
624
- amount_in: operation.amountIn,
625
- amount_out: operation.amountOut
626
- };
627
- }
628
- if ("axelarTransfer" in operation) {
629
- return {
630
- axelar_transfer: axelarTransferToJSON(operation.axelarTransfer),
631
- tx_index: operation.txIndex,
632
- amount_in: operation.amountIn,
633
- amount_out: operation.amountOut
634
- };
635
- }
636
- if ("cctpTransfer" in operation) {
637
- return {
638
- cctp_transfer: cctpTransferToJSON(operation.cctpTransfer),
639
- tx_index: operation.txIndex,
640
- amount_in: operation.amountIn,
641
- amount_out: operation.amountOut
642
- };
643
- }
644
- if ("hyperlaneTransfer" in operation) {
645
- return {
646
- hyperlane_transfer: hyperlaneTransferToJSON(operation.hyperlaneTransfer),
647
- tx_index: operation.txIndex,
648
- amount_in: operation.amountIn,
649
- amount_out: operation.amountOut
650
- };
651
- }
652
- if ("opInitTransfer" in operation) {
653
- return {
654
- op_init_transfer: opInitTransferToJSON(operation.opInitTransfer),
655
- tx_index: operation.txIndex,
656
- amount_in: operation.amountIn,
657
- amount_out: operation.amountOut
658
- };
659
- }
660
- if ("swap" in operation) {
661
- return {
662
- swap: swapToJSON(operation.swap),
663
- tx_index: operation.txIndex,
664
- amount_in: operation.amountIn,
665
- amount_out: operation.amountOut
666
- };
667
- }
668
- return {
669
- evm_swap: evmSwapToJSON(operation.evmSwap),
670
- tx_index: operation.txIndex,
671
- amount_in: operation.amountIn,
672
- amount_out: operation.amountOut
673
- };
674
- }
675
- function routeResponseFromJSON(routeResponseJSON) {
676
- var _a;
677
- return {
678
- sourceAssetDenom: routeResponseJSON.source_asset_denom,
679
- sourceAssetChainID: routeResponseJSON.source_asset_chain_id,
680
- destAssetDenom: routeResponseJSON.dest_asset_denom,
681
- destAssetChainID: routeResponseJSON.dest_asset_chain_id,
682
- amountIn: routeResponseJSON.amount_in,
683
- amountOut: routeResponseJSON.amount_out,
684
- operations: routeResponseJSON.operations.map(operationFromJSON),
685
- chainIDs: routeResponseJSON.chain_ids,
686
- requiredChainAddresses: routeResponseJSON.required_chain_addresses,
687
- doesSwap: routeResponseJSON.does_swap,
688
- estimatedAmountOut: routeResponseJSON.estimated_amount_out,
689
- swapVenues: routeResponseJSON.swap_venues ? routeResponseJSON.swap_venues.map(swapVenueFromJSON) : void 0,
690
- txsRequired: routeResponseJSON.txs_required,
691
- usdAmountIn: routeResponseJSON.usd_amount_in,
692
- usdAmountOut: routeResponseJSON.usd_amount_out,
693
- swapPriceImpactPercent: routeResponseJSON.swap_price_impact_percent,
694
- warning: routeResponseJSON.warning,
695
- estimatedFees: ((_a = routeResponseJSON.estimated_fees) == null ? void 0 : _a.length) ? routeResponseJSON.estimated_fees.map((i) => estimatedFeeFromJSON(i)) : [],
696
- estimatedRouteDurationSeconds: routeResponseJSON.estimated_route_duration_seconds
697
- };
698
- }
699
- function routeResponseToJSON(routeResponse) {
700
- return {
701
- source_asset_denom: routeResponse.sourceAssetDenom,
702
- source_asset_chain_id: routeResponse.sourceAssetChainID,
703
- dest_asset_denom: routeResponse.destAssetDenom,
704
- dest_asset_chain_id: routeResponse.destAssetChainID,
705
- amount_in: routeResponse.amountIn,
706
- amount_out: routeResponse.amountOut,
707
- operations: routeResponse.operations.map(operationToJSON),
708
- chain_ids: routeResponse.chainIDs,
709
- required_chain_addresses: routeResponse.requiredChainAddresses,
710
- does_swap: routeResponse.doesSwap,
711
- estimated_amount_out: routeResponse.estimatedAmountOut,
712
- swap_venues: routeResponse.swapVenues ? routeResponse.swapVenues.map(swapVenueToJSON) : void 0,
713
- txs_required: routeResponse.txsRequired,
714
- usd_amount_in: routeResponse.usdAmountIn,
715
- usd_amount_out: routeResponse.usdAmountOut,
716
- swap_price_impact_percent: routeResponse.swapPriceImpactPercent,
717
- warning: routeResponse.warning,
718
- estimated_fees: routeResponse.estimatedFees.map(
719
- (i) => estimatedFeeToJSON(i)
720
- ),
721
- estimated_route_duration_seconds: routeResponse.estimatedRouteDurationSeconds
722
- };
723
- }
724
- function cosmWasmContractMsgFromJSON(cosmWasmContractMsgJSON) {
725
- return {
726
- contractAddress: cosmWasmContractMsgJSON.contract_address,
727
- msg: cosmWasmContractMsgJSON.msg
728
- };
729
- }
730
- function cosmWasmContractMsgToJSON(cosmWasmContractMsg) {
731
- return {
732
- contract_address: cosmWasmContractMsg.contractAddress,
733
- msg: cosmWasmContractMsg.msg
734
- };
735
- }
736
- function postHandlerFromJSON(postHandlerJSON) {
737
- if ("wasm_msg" in postHandlerJSON) {
738
- return {
739
- wasmMsg: cosmWasmContractMsgFromJSON(postHandlerJSON.wasm_msg)
740
- };
741
- }
742
- return {
743
- autopilotMsg: postHandlerJSON.autopilot_msg
744
- };
745
- }
746
- function postHandlerToJSON(postHandler) {
747
- if ("wasmMsg" in postHandler) {
748
- return {
749
- wasm_msg: cosmWasmContractMsgToJSON(postHandler.wasmMsg)
750
- };
751
- }
752
- return {
753
- autopilot_msg: postHandler.autopilotMsg
754
- };
755
- }
756
- function msgsRequestFromJSON(msgsRequestJSON) {
757
- var _a;
758
- return {
759
- sourceAssetDenom: msgsRequestJSON.source_asset_denom,
760
- sourceAssetChainID: msgsRequestJSON.source_asset_chain_id,
761
- destAssetDenom: msgsRequestJSON.dest_asset_denom,
762
- destAssetChainID: msgsRequestJSON.dest_asset_chain_id,
763
- amountIn: msgsRequestJSON.amount_in,
764
- amountOut: msgsRequestJSON.amount_out,
765
- addressList: msgsRequestJSON.address_list,
766
- operations: msgsRequestJSON.operations.map(operationFromJSON),
767
- estimatedAmountOut: msgsRequestJSON.estimated_amount_out,
768
- slippageTolerancePercent: msgsRequestJSON.slippage_tolerance_percent,
769
- affiliates: (_a = msgsRequestJSON.affiliates) == null ? void 0 : _a.map(affiliateFromJSON),
770
- chainIDsToAffiliates: msgsRequestJSON.chain_ids_to_affiliates ? chainIDsToAffiliatesMapFromJSON(msgsRequestJSON.chain_ids_to_affiliates) : void 0,
771
- postRouteHandler: msgsRequestJSON.post_route_handler && postHandlerFromJSON(msgsRequestJSON.post_route_handler)
772
- };
773
- }
774
- function msgsRequestToJSON(msgsRequest) {
775
- var _a;
776
- return {
777
- source_asset_denom: msgsRequest.sourceAssetDenom,
778
- source_asset_chain_id: msgsRequest.sourceAssetChainID,
779
- dest_asset_denom: msgsRequest.destAssetDenom,
780
- dest_asset_chain_id: msgsRequest.destAssetChainID,
781
- amount_in: msgsRequest.amountIn,
782
- amount_out: msgsRequest.amountOut,
783
- address_list: msgsRequest.addressList,
784
- operations: msgsRequest.operations.map(operationToJSON),
785
- estimated_amount_out: msgsRequest.estimatedAmountOut,
786
- slippage_tolerance_percent: msgsRequest.slippageTolerancePercent,
787
- affiliates: (_a = msgsRequest.affiliates) == null ? void 0 : _a.map(affiliateToJSON),
788
- chain_ids_to_affiliates: msgsRequest.chainIDsToAffiliates ? chainIDsToAffiliatesMapToJSON(msgsRequest.chainIDsToAffiliates) : void 0,
789
- post_route_handler: msgsRequest.postRouteHandler && postHandlerToJSON(msgsRequest.postRouteHandler)
790
- };
791
- }
792
- function multiChainMsgFromJSON(multiChainMsgJSON) {
793
- return {
794
- chainID: multiChainMsgJSON.chain_id,
795
- path: multiChainMsgJSON.path,
796
- msg: multiChainMsgJSON.msg,
797
- msgTypeURL: multiChainMsgJSON.msg_type_url
798
- };
799
- }
800
- function multiChainMsgToJSON(multiChainMsg) {
801
- return {
802
- chain_id: multiChainMsg.chainID,
803
- path: multiChainMsg.path,
804
- msg: multiChainMsg.msg,
805
- msg_type_url: multiChainMsg.msgTypeURL
806
- };
807
- }
808
- function cosmosMsgFromJSON(cosmosMsgJSON) {
809
- return {
810
- msg: cosmosMsgJSON.msg,
811
- msgTypeURL: cosmosMsgJSON.msg_type_url
812
- };
813
- }
814
- function cosmosMsgToJSON(cosmosMsg) {
815
- return {
816
- msg: cosmosMsg.msg,
817
- msg_type_url: cosmosMsg.msgTypeURL
818
- };
819
- }
820
- function submitTxRequestFromJSON(submitTxRequestJSON) {
821
- return {
822
- tx: submitTxRequestJSON.tx,
823
- chainID: submitTxRequestJSON.chain_id
824
- };
825
- }
826
- function submitTxRequestToJSON(submitTxRequest) {
827
- return {
828
- tx: submitTxRequest.tx,
829
- chain_id: submitTxRequest.chainID
830
- };
831
- }
832
- function submitTxResponseFromJSON(submitTxResponseJSON) {
833
- return {
834
- txHash: submitTxResponseJSON.tx_hash
835
- };
836
- }
837
- function submitTxResponseToJSON(submitTxResponse) {
838
- return {
839
- tx_hash: submitTxResponse.txHash
840
- };
841
- }
842
- function trackTxRequestFromJSON(trackRequestJSON) {
843
- return {
844
- txHash: trackRequestJSON.tx_hash,
845
- chainID: trackRequestJSON.chain_id
846
- };
847
- }
848
- function trackTxRequestToJSON(trackRequest) {
849
- return {
850
- tx_hash: trackRequest.txHash,
851
- chain_id: trackRequest.chainID
852
- };
853
- }
854
- function trackTxResponseFromJSON(trackResponseJSON) {
855
- return {
856
- txHash: trackResponseJSON.tx_hash,
857
- explorerLink: trackResponseJSON.explorer_link
858
- };
859
- }
860
- function trackTxResponseToJSON(trackResponse) {
861
- return {
862
- tx_hash: trackResponse.txHash,
863
- explorer_link: trackResponse.explorerLink
864
- };
865
- }
866
- function txStatusRequestFromJSON(txStatusRequestJSON) {
867
- return {
868
- txHash: txStatusRequestJSON.tx_hash,
869
- chainID: txStatusRequestJSON.chain_id
870
- };
871
- }
872
- function txStatusRequestToJSON(txStatusRequest) {
873
- return {
874
- tx_hash: txStatusRequest.txHash,
875
- chain_id: txStatusRequest.chainID
876
- };
877
- }
878
- function chainTransactionFromJSON(chainTransactionJSON) {
879
- return {
880
- txHash: chainTransactionJSON.tx_hash,
881
- chainID: chainTransactionJSON.chain_id,
882
- explorerLink: chainTransactionJSON.explorer_link
883
- };
884
- }
885
- function chainTransactionToJSON(chainTransaction) {
886
- return {
887
- tx_hash: chainTransaction.txHash,
888
- chain_id: chainTransaction.chainID,
889
- explorer_link: chainTransaction.explorerLink
890
- };
891
- }
892
- function packetFromJSON(packetJSON) {
893
- return {
894
- sendTx: packetJSON.send_tx && chainTransactionFromJSON(packetJSON.send_tx),
895
- receiveTx: packetJSON.receive_tx && chainTransactionFromJSON(packetJSON.receive_tx),
896
- acknowledgeTx: packetJSON.acknowledge_tx && chainTransactionFromJSON(packetJSON.acknowledge_tx),
897
- timeoutTx: packetJSON.timeout_tx && chainTransactionFromJSON(packetJSON.timeout_tx),
898
- error: packetJSON.error
899
- };
900
- }
901
- function packetToJSON(packet) {
902
- return {
903
- send_tx: packet.sendTx && chainTransactionToJSON(packet.sendTx),
904
- receive_tx: packet.receiveTx && chainTransactionToJSON(packet.receiveTx),
905
- acknowledge_tx: packet.acknowledgeTx && chainTransactionToJSON(packet.acknowledgeTx),
906
- timeout_tx: packet.timeoutTx && chainTransactionToJSON(packet.timeoutTx),
907
- error: packet.error
908
- };
909
- }
910
- function transferInfoFromJSON(transferInfoJSON) {
911
- return {
912
- fromChainID: transferInfoJSON.from_chain_id,
913
- toChainID: transferInfoJSON.to_chain_id,
914
- state: transferInfoJSON.state,
915
- packetTXs: transferInfoJSON.packet_txs && packetFromJSON(transferInfoJSON.packet_txs),
916
- srcChainID: transferInfoJSON.src_chain_id,
917
- dstChainID: transferInfoJSON.dst_chain_id
918
- };
919
- }
920
- function transferInfoToJSON(transferInfo) {
921
- return {
922
- from_chain_id: transferInfo.fromChainID,
923
- to_chain_id: transferInfo.toChainID,
924
- state: transferInfo.state,
925
- packet_txs: transferInfo.packetTXs && packetToJSON(transferInfo.packetTXs),
926
- src_chain_id: transferInfo.srcChainID,
927
- dst_chain_id: transferInfo.dstChainID
928
- };
929
- }
930
- function nextBlockingTransferFromJSON(nextBlockingTransferJSON) {
931
- return {
932
- transferSequenceIndex: nextBlockingTransferJSON.transfer_sequence_index
933
- };
934
- }
935
- function nextBlockingTransferToJSON(nextBlockingTransfer) {
936
- return {
937
- transfer_sequence_index: nextBlockingTransfer.transferSequenceIndex
938
- };
939
- }
940
- function transferAssetReleaseFromJSON(transferAssetReleaseJSON) {
941
- return {
942
- chainID: transferAssetReleaseJSON.chain_id,
943
- denom: transferAssetReleaseJSON.denom,
944
- released: transferAssetReleaseJSON.released
945
- };
946
- }
947
- function transferAssetReleaseToJSON(transferAssetRelease) {
948
- return {
949
- chain_id: transferAssetRelease.chainID,
950
- denom: transferAssetRelease.denom,
951
- released: transferAssetRelease.released
952
- };
953
- }
954
- function txStatusResponseFromJSON(statusResponseJSON) {
955
- return {
956
- status: statusResponseJSON.status,
957
- nextBlockingTransfer: statusResponseJSON.next_blocking_transfer && nextBlockingTransferFromJSON(statusResponseJSON.next_blocking_transfer),
958
- transferSequence: statusResponseJSON.transfer_sequence.map(
959
- transferEventFromJSON
960
- ),
961
- transferAssetRelease: statusResponseJSON.transfer_asset_release && transferAssetReleaseFromJSON(statusResponseJSON.transfer_asset_release),
962
- error: statusResponseJSON.error,
963
- state: statusResponseJSON.state,
964
- transfers: statusResponseJSON.transfers.map(transferStatusFromJSON)
965
- };
966
- }
967
- function txStatusResponseToJSON(statusResponse) {
968
- return {
969
- status: statusResponse.status,
970
- next_blocking_transfer: statusResponse.nextBlockingTransfer && nextBlockingTransferToJSON(statusResponse.nextBlockingTransfer),
971
- transfer_sequence: statusResponse.transferSequence.map(transferEventToJSON),
972
- transfer_asset_release: statusResponse.transferAssetRelease && transferAssetReleaseToJSON(statusResponse.transferAssetRelease),
973
- error: statusResponse.error,
974
- state: statusResponse.state,
975
- transfers: statusResponse.transfers.map(transferStatusToJSON)
976
- };
977
- }
978
- function ibcAddressFromJSON(ibcAddressJSON) {
979
- return {
980
- address: ibcAddressJSON.address,
981
- chainID: ibcAddressJSON.chain_id
982
- };
983
- }
984
- function ibcAddressToJSON(ibcAddress) {
985
- return {
986
- address: ibcAddress.address,
987
- chain_id: ibcAddress.chainID
988
- };
989
- }
990
- function axelarTransferFromJSON(axelarTransferJSON) {
991
- return {
992
- fromChain: axelarTransferJSON.from_chain,
993
- fromChainID: axelarTransferJSON.from_chain_id,
994
- toChain: axelarTransferJSON.to_chain,
995
- toChainID: axelarTransferJSON.to_chain_id,
996
- asset: axelarTransferJSON.asset,
997
- shouldUnwrap: axelarTransferJSON.should_unwrap,
998
- denomIn: axelarTransferJSON.denom_in,
999
- denomOut: axelarTransferJSON.denom_out,
1000
- feeAmount: axelarTransferJSON.fee_amount,
1001
- usdFeeAmount: axelarTransferJSON.usd_fee_amount,
1002
- feeAsset: assetFromJSON(axelarTransferJSON.fee_asset),
1003
- isTestnet: axelarTransferJSON.is_testnet,
1004
- ibcTransferToAxelar: axelarTransferJSON.ibc_transfer_to_axelar ? transferFromJSON(axelarTransferJSON.ibc_transfer_to_axelar) : void 0,
1005
- bridgeID: axelarTransferJSON.bridge_id,
1006
- smartRelay: axelarTransferJSON.smart_relay
1007
- };
1008
- }
1009
- function axelarTransferToJSON(axelarTransfer) {
1010
- return {
1011
- from_chain: axelarTransfer.fromChain,
1012
- from_chain_id: axelarTransfer.fromChainID,
1013
- to_chain: axelarTransfer.toChain,
1014
- to_chain_id: axelarTransfer.toChainID,
1015
- asset: axelarTransfer.asset,
1016
- should_unwrap: axelarTransfer.shouldUnwrap,
1017
- denom_in: axelarTransfer.denomIn,
1018
- denom_out: axelarTransfer.denomOut,
1019
- fee_amount: axelarTransfer.feeAmount,
1020
- fee_asset: assetToJSON(axelarTransfer.feeAsset),
1021
- usd_fee_amount: axelarTransfer.usdFeeAmount,
1022
- is_testnet: axelarTransfer.isTestnet,
1023
- ibc_transfer_to_axelar: axelarTransfer.ibcTransferToAxelar ? transferToJSON(axelarTransfer.ibcTransferToAxelar) : void 0,
1024
- bridge_id: axelarTransfer.bridgeID,
1025
- smart_relay: axelarTransfer.smartRelay
1026
- };
1027
- }
1028
- function bankSendFromJSON(value) {
1029
- return {
1030
- chainID: value.chain_id,
1031
- denom: value.denom
1032
- };
1033
- }
1034
- function bankSendToJSON(value) {
1035
- return {
1036
- chain_id: value.chainID,
1037
- denom: value.denom
1038
- };
1039
- }
1040
- function cctpTransferFromJSON(value) {
1041
- return {
1042
- fromChainID: value.from_chain_id,
1043
- toChainID: value.to_chain_id,
1044
- burnToken: value.burn_token,
1045
- bridgeID: value.bridge_id,
1046
- denomIn: value.denom_in,
1047
- denomOut: value.denom_out,
1048
- smartRelay: value.smart_relay
1049
- };
1050
- }
1051
- function cctpTransferToJSON(value) {
1052
- return {
1053
- from_chain_id: value.fromChainID,
1054
- to_chain_id: value.toChainID,
1055
- burn_token: value.burnToken,
1056
- bridge_id: value.bridgeID,
1057
- denom_in: value.denomIn,
1058
- denom_out: value.denomOut,
1059
- smart_relay: value.smartRelay
1060
- };
1061
- }
1062
- function hyperlaneTransferFromJSON(value) {
1063
- return {
1064
- fromChainID: value.from_chain_id,
1065
- toChainID: value.to_chain_id,
1066
- denomIn: value.denom_in,
1067
- denomOut: value.denom_out,
1068
- hyperlaneContractAddress: value.hyperlane_contract_address,
1069
- feeAmount: value.fee_amount,
1070
- usdFeeAmount: value.usd_fee_amount,
1071
- feeAsset: assetFromJSON(value.fee_asset),
1072
- bridgeID: value.bridge_id,
1073
- smartRelay: value.smart_relay
1074
- };
1075
- }
1076
- function hyperlaneTransferToJSON(value) {
1077
- return {
1078
- from_chain_id: value.fromChainID,
1079
- to_chain_id: value.toChainID,
1080
- denom_in: value.denomIn,
1081
- denom_out: value.denomOut,
1082
- hyperlane_contract_address: value.hyperlaneContractAddress,
1083
- fee_amount: value.feeAmount,
1084
- usd_fee_amount: value.usdFeeAmount,
1085
- fee_asset: assetToJSON(value.feeAsset),
1086
- bridge_id: value.bridgeID,
1087
- smart_relay: value.smartRelay
1088
- };
1089
- }
1090
- function opInitTransferFromJSON(value) {
1091
- return {
1092
- fromChainID: value.from_chain_id,
1093
- toChainID: value.to_chain_id,
1094
- denomIn: value.denom_in,
1095
- denomOut: value.denom_out,
1096
- opInitBridgeID: value.op_init_bridge_id,
1097
- bridgeID: value.bridge_id,
1098
- smartRelay: value.smart_relay
1099
- };
1100
- }
1101
- function opInitTransferToJSON(value) {
1102
- return {
1103
- from_chain_id: value.fromChainID,
1104
- to_chain_id: value.toChainID,
1105
- denom_in: value.denomIn,
1106
- denom_out: value.denomOut,
1107
- op_init_bridge_id: value.opInitBridgeID,
1108
- bridge_id: value.bridgeID,
1109
- smart_relay: value.smartRelay
1110
- };
1111
- }
1112
- function erc20ApprovalFromJSON(erc20ApprovalJSON) {
1113
- return {
1114
- tokenContract: erc20ApprovalJSON.token_contract,
1115
- spender: erc20ApprovalJSON.spender,
1116
- amount: erc20ApprovalJSON.amount
1117
- };
1118
- }
1119
- function erc20ApprovalToJSON(erc20Approval) {
1120
- return {
1121
- token_contract: erc20Approval.tokenContract,
1122
- spender: erc20Approval.spender,
1123
- amount: erc20Approval.amount
1124
- };
1125
- }
1126
- function svmTxFromJSON(svmTxJSON) {
1127
- return {
1128
- chainID: svmTxJSON.chain_id,
1129
- tx: svmTxJSON.tx,
1130
- signerAddress: svmTxJSON.signer_address
1131
- };
1132
- }
1133
- function svmTxToJSON(svmTx) {
1134
- return {
1135
- chain_id: svmTx.chainID,
1136
- tx: svmTx.tx,
1137
- signer_address: svmTx.signerAddress
1138
- };
1139
- }
1140
- function evmTxFromJSON(evmTxJSON) {
1141
- return {
1142
- chainID: evmTxJSON.chain_id,
1143
- to: evmTxJSON.to,
1144
- value: evmTxJSON.value,
1145
- data: evmTxJSON.data,
1146
- requiredERC20Approvals: evmTxJSON.required_erc20_approvals.map(
1147
- erc20ApprovalFromJSON
1148
- ),
1149
- signerAddress: evmTxJSON.signer_address
1150
- };
1151
- }
1152
- function evmTxToJSON(evmTx) {
1153
- return {
1154
- chain_id: evmTx.chainID,
1155
- to: evmTx.to,
1156
- value: evmTx.value,
1157
- data: evmTx.data,
1158
- required_erc20_approvals: evmTx.requiredERC20Approvals.map(erc20ApprovalToJSON),
1159
- signer_address: evmTx.signerAddress
1160
- };
1161
- }
1162
- function cosmosTxFromJSON(cosmosTxJSON) {
1163
- return {
1164
- chainID: cosmosTxJSON.chain_id,
1165
- path: cosmosTxJSON.path,
1166
- msgs: cosmosTxJSON.msgs.map(cosmosMsgFromJSON),
1167
- signerAddress: cosmosTxJSON.signer_address
1168
- };
1169
- }
1170
- function cosmosTxToJSON(cosmosTx) {
1171
- return {
1172
- chain_id: cosmosTx.chainID,
1173
- path: cosmosTx.path,
1174
- msgs: cosmosTx.msgs.map(cosmosMsgToJSON),
1175
- signer_address: cosmosTx.signerAddress
1176
- };
1177
- }
1178
- function txFromJSON(txJSON) {
1179
- if ("cosmos_tx" in txJSON) {
1180
- return {
1181
- cosmosTx: cosmosTxFromJSON(txJSON.cosmos_tx),
1182
- operationsIndices: txJSON.operations_indices
1183
- };
1184
- }
1185
- if ("svm_tx" in txJSON) {
1186
- return {
1187
- svmTx: svmTxFromJSON(txJSON.svm_tx),
1188
- operationsIndices: txJSON.operations_indices
1189
- };
1190
- }
1191
- return {
1192
- evmTx: evmTxFromJSON(txJSON.evm_tx),
1193
- operationsIndices: txJSON.operations_indices
1194
- };
1195
- }
1196
- function txToJSON(tx) {
1197
- if ("cosmosTx" in tx) {
1198
- return {
1199
- cosmos_tx: cosmosTxToJSON(tx.cosmosTx),
1200
- operations_indices: tx.operationsIndices
1201
- };
1202
- }
1203
- if ("svmTx" in tx) {
1204
- return {
1205
- svm_tx: svmTxToJSON(tx.svmTx),
1206
- operations_indices: tx.operationsIndices
1207
- };
1208
- }
1209
- return {
1210
- evm_tx: evmTxToJSON(tx.evmTx),
1211
- operations_indices: tx.operationsIndices
1212
- };
1213
- }
1214
- function msgFromJSON(msgJSON) {
1215
- if ("multi_chain_msg" in msgJSON) {
1216
- return {
1217
- multiChainMsg: multiChainMsgFromJSON(msgJSON.multi_chain_msg)
1218
- };
1219
- }
1220
- if ("svm_tx" in msgJSON) {
1221
- return {
1222
- svmTx: svmTxFromJSON(msgJSON.svm_tx)
1223
- };
1224
- }
1225
- return {
1226
- evmTx: evmTxFromJSON(msgJSON.evm_tx)
1227
- };
1228
- }
1229
- function msgToJSON(msg) {
1230
- if ("multiChainMsg" in msg) {
1231
- return {
1232
- multi_chain_msg: multiChainMsgToJSON(msg.multiChainMsg)
1233
- };
1234
- }
1235
- if ("svmTx" in msg) {
1236
- return {
1237
- svm_tx: svmTxToJSON(msg.svmTx)
1238
- };
1239
- }
1240
- return {
1241
- evm_tx: evmTxToJSON(msg.evmTx)
1242
- };
1243
- }
1244
- function messageResponseFromJSON(response) {
1245
- var _a, _b;
1246
- return {
1247
- estimatedFees: (_a = response.estimated_fees) == null ? void 0 : _a.map(
1248
- (fee) => estimatedFeeFromJSON(fee)
1249
- ),
1250
- msgs: response.msgs.map((msg) => msgFromJSON(msg)),
1251
- txs: (_b = response.txs) == null ? void 0 : _b.map((tx) => txFromJSON(tx)),
1252
- warning: response.warning
1253
- };
1254
- }
1255
- function sendTokenTransactionsFromJSON(sendTokenTransactionsJSON) {
1256
- return {
1257
- sendTx: sendTokenTransactionsJSON.send_tx ? chainTransactionFromJSON(sendTokenTransactionsJSON.send_tx) : null,
1258
- confirmTx: sendTokenTransactionsJSON.confirm_tx ? chainTransactionFromJSON(sendTokenTransactionsJSON.confirm_tx) : null,
1259
- executeTx: sendTokenTransactionsJSON.execute_tx ? chainTransactionFromJSON(sendTokenTransactionsJSON.execute_tx) : null,
1260
- error: sendTokenTransactionsJSON.error
1261
- };
1262
- }
1263
- function sendTokenTransactionsToJSON(sendTokenTransactions) {
1264
- return {
1265
- send_tx: sendTokenTransactions.sendTx ? chainTransactionToJSON(sendTokenTransactions.sendTx) : null,
1266
- confirm_tx: sendTokenTransactions.confirmTx ? chainTransactionToJSON(sendTokenTransactions.confirmTx) : null,
1267
- execute_tx: sendTokenTransactions.executeTx ? chainTransactionToJSON(sendTokenTransactions.executeTx) : null,
1268
- error: sendTokenTransactions.error
1269
- };
1270
- }
1271
- function contractCallWithTokenTransactionsFromJSON(value) {
1272
- return {
1273
- sendTx: value.send_tx ? chainTransactionFromJSON(value.send_tx) : null,
1274
- gasPaidTx: value.gas_paid_tx ? chainTransactionFromJSON(value.gas_paid_tx) : null,
1275
- confirmTx: value.confirm_tx ? chainTransactionFromJSON(value.confirm_tx) : null,
1276
- approveTx: value.approve_tx ? chainTransactionFromJSON(value.approve_tx) : null,
1277
- executeTx: value.execute_tx ? chainTransactionFromJSON(value.execute_tx) : null,
1278
- error: value.error
1279
- };
1280
- }
1281
- function contractCallWithTokenTransactionsToJSON(value) {
1282
- return {
1283
- send_tx: value.sendTx ? chainTransactionToJSON(value.sendTx) : null,
1284
- gas_paid_tx: value.gasPaidTx ? chainTransactionToJSON(value.gasPaidTx) : null,
1285
- confirm_tx: value.confirmTx ? chainTransactionToJSON(value.confirmTx) : null,
1286
- approve_tx: value.approveTx ? chainTransactionToJSON(value.approveTx) : null,
1287
- execute_tx: value.executeTx ? chainTransactionToJSON(value.executeTx) : null,
1288
- error: value.error
1289
- };
1290
- }
1291
- function axelarTransferTransactionsFromJSON(value) {
1292
- if ("contract_call_with_token_txs" in value) {
1293
- return {
1294
- contractCallWithTokenTxs: contractCallWithTokenTransactionsFromJSON(
1295
- value.contract_call_with_token_txs
1296
- )
1297
- };
1298
- }
1299
- return {
1300
- sendTokenTxs: sendTokenTransactionsFromJSON(value.send_token_txs)
1301
- };
1302
- }
1303
- function axelarTransferTransactionsToJSON(value) {
1304
- if ("contractCallWithTokenTxs" in value) {
1305
- return {
1306
- contract_call_with_token_txs: contractCallWithTokenTransactionsToJSON(
1307
- value.contractCallWithTokenTxs
1308
- )
1309
- };
1310
- }
1311
- return {
1312
- send_token_txs: sendTokenTransactionsToJSON(value.sendTokenTxs)
1313
- };
1314
- }
1315
- function axelarTransferInfoFromJSON(value) {
1316
- return {
1317
- fromChainID: value.from_chain_id,
1318
- toChainID: value.to_chain_id,
1319
- type: value.type,
1320
- state: value.state,
1321
- txs: value.txs && axelarTransferTransactionsFromJSON(value.txs),
1322
- axelarScanLink: value.axelar_scan_link,
1323
- srcChainID: value.src_chain_id,
1324
- dstChainID: value.dst_chain_id
1325
- };
1326
- }
1327
- function axelarTransferInfoToJSON(value) {
1328
- return {
1329
- from_chain_id: value.fromChainID,
1330
- to_chain_id: value.toChainID,
1331
- type: value.type,
1332
- state: value.state,
1333
- txs: value.txs && axelarTransferTransactionsToJSON(value.txs),
1334
- axelar_scan_link: value.axelarScanLink,
1335
- src_chain_id: value.srcChainID,
1336
- dst_chain_id: value.dstChainID
1337
- };
1338
- }
1339
- function transferEventFromJSON(value) {
1340
- if ("ibc_transfer" in value) {
1341
- return {
1342
- ibcTransfer: transferInfoFromJSON(value.ibc_transfer)
1343
- };
1344
- }
1345
- if ("cctp_transfer" in value) {
1346
- return {
1347
- cctpTransfer: cctpTransferInfoFromJSON(value.cctp_transfer)
1348
- };
1349
- }
1350
- if ("hyperlane_transfer" in value) {
1351
- return {
1352
- hyperlaneTransfer: hyperlaneTransferInfoFromJSON(
1353
- value.hyperlane_transfer
1354
- )
1355
- };
1356
- }
1357
- if ("op_init_transfer" in value) {
1358
- return {
1359
- opInitTransfer: opInitTransferInfoFromJSON(value.op_init_transfer)
1360
- };
1361
- }
1362
- return {
1363
- axelarTransfer: axelarTransferInfoFromJSON(value.axelar_transfer)
1364
- };
1365
- }
1366
- function transferEventToJSON(value) {
1367
- if ("ibcTransfer" in value) {
1368
- return {
1369
- ibc_transfer: transferInfoToJSON(value.ibcTransfer)
1370
- };
1371
- }
1372
- if ("cctpTransfer" in value) {
1373
- return {
1374
- cctp_transfer: cctpTransferInfoToJSON(value.cctpTransfer)
1375
- };
1376
- }
1377
- if ("hyperlaneTransfer" in value) {
1378
- return {
1379
- hyperlane_transfer: hyperlaneTransferInfoToJSON(value.hyperlaneTransfer)
1380
- };
1381
- }
1382
- if ("opInitTransfer" in value) {
1383
- return {
1384
- op_init_transfer: opInitTransferInfoToJSON(value.opInitTransfer)
1385
- };
1386
- }
1387
- return {
1388
- axelar_transfer: axelarTransferInfoToJSON(value.axelarTransfer)
1389
- };
1390
- }
1391
- function transferStatusFromJSON(value) {
1392
- return {
1393
- transferSequence: value.transfer_sequence.map(transferEventFromJSON),
1394
- transferAssetRelease: value.transfer_asset_release && transferAssetReleaseFromJSON(value.transfer_asset_release),
1395
- error: value.error,
1396
- state: value.state,
1397
- nextBlockingTransfer: value.next_blocking_transfer && nextBlockingTransferFromJSON(value.next_blocking_transfer)
1398
- };
1399
- }
1400
- function transferStatusToJSON(value) {
1401
- return {
1402
- transfer_sequence: value.transferSequence.map(transferEventToJSON),
1403
- transfer_asset_release: value.transferAssetRelease && transferAssetReleaseToJSON(value.transferAssetRelease),
1404
- error: value.error,
1405
- state: value.state,
1406
- next_blocking_transfer: value.nextBlockingTransfer && nextBlockingTransferToJSON(value.nextBlockingTransfer)
1407
- };
1408
- }
1409
- function denomWithChainIDFromJSON(value) {
1410
- return {
1411
- chainID: value.chain_id,
1412
- denom: value.denom
1413
- };
1414
- }
1415
- function denomWithChainIDToJSON(value) {
1416
- return {
1417
- chain_id: value.chainID,
1418
- denom: value.denom
1419
- };
1420
- }
1421
- function assetOrErrorFromJSON(value) {
1422
- if ("asset" in value) {
1423
- return { asset: assetFromJSON(value.asset) };
1424
- }
1425
- return { error: value.error };
1426
- }
1427
- function assetOrErrorToJSON(value) {
1428
- if ("asset" in value) {
1429
- return { asset: assetToJSON(value.asset) };
1430
- }
1431
- return { error: value.error };
1432
- }
1433
- function originAssetsRequestFromJSON(value) {
1434
- return {
1435
- assets: value.assets.map(denomWithChainIDFromJSON)
1436
- };
1437
- }
1438
- function originAssetsRequestToJSON(value) {
1439
- return {
1440
- assets: value.assets.map(denomWithChainIDToJSON)
1441
- };
1442
- }
1443
- function originAssetsResponseFromJSON(value) {
1444
- return {
1445
- originAssets: value.origin_assets.map(assetOrErrorFromJSON)
1446
- };
1447
- }
1448
- function originAssetsResponseToJSON(value) {
1449
- return {
1450
- origin_assets: value.originAssets.map(assetOrErrorToJSON)
1451
- };
1452
- }
1453
- function assetBetweenChainsFromJSON(value) {
1454
- return {
1455
- assetOnSource: assetFromJSON(value.asset_on_source),
1456
- assetOnDest: assetFromJSON(value.asset_on_dest),
1457
- txsRequired: value.txs_required,
1458
- bridges: value.bridges
1459
- };
1460
- }
1461
- function assetBetweenChainsToJSON(value) {
1462
- return {
1463
- asset_on_source: assetToJSON(value.assetOnSource),
1464
- asset_on_dest: assetToJSON(value.assetOnDest),
1465
- txs_required: value.txsRequired,
1466
- bridges: value.bridges
1467
- };
1468
- }
1469
- function assetsBetweenChainsRequestFromJSON(value) {
1470
- return {
1471
- sourceChainID: value.source_chain_id,
1472
- destChainID: value.dest_chain_id,
1473
- includeNoMetadataAssets: value.include_no_metadata_assets,
1474
- includeCW20Assets: value.include_cw20_assets,
1475
- includeEvmAssets: value.include_evm_assets,
1476
- allowMultiTx: value.allow_multi_tx
1477
- };
1478
- }
1479
- function assetsBetweenChainsRequestToJSON(value) {
1480
- return {
1481
- source_chain_id: value.sourceChainID,
1482
- dest_chain_id: value.destChainID,
1483
- include_no_metadata_assets: value.includeNoMetadataAssets,
1484
- include_cw20_assets: value.includeCW20Assets,
1485
- include_evm_assets: value.includeEvmAssets,
1486
- allow_multi_tx: value.allowMultiTx
1487
- };
1488
- }
1489
- function assetsBetweenChainsResponseFromJSON(value) {
1490
- return {
1491
- assetsBetweenChains: value.assets_between_chains.map(
1492
- assetBetweenChainsFromJSON
1493
- )
1494
- };
1495
- }
1496
- function assetRecommendationRequestFromJSON(value) {
1497
- return {
1498
- sourceAssetDenom: value.source_asset_denom,
1499
- sourceAssetChainID: value.source_asset_chain_id,
1500
- destChainID: value.dest_chain_id,
1501
- reason: value.reason
1502
- };
1503
- }
1504
- function assetRecommendationRequestToJSON(value) {
1505
- return {
1506
- source_asset_denom: value.sourceAssetDenom,
1507
- source_asset_chain_id: value.sourceAssetChainID,
1508
- dest_chain_id: value.destChainID,
1509
- reason: value.reason
1510
- };
1511
- }
1512
- function bridgesResponseFromJSON(value) {
1513
- return {
1514
- bridges: value.bridges.map(bridgeFromJSON)
1515
- };
1516
- }
1517
- function bridgesResponseToJSON(value) {
1518
- return {
1519
- bridges: value.bridges.map(bridgeToJSON)
1520
- };
1521
- }
1522
- function bridgeFromJSON(value) {
1523
- return {
1524
- id: value.id,
1525
- name: value.name,
1526
- logoURI: value.logo_uri
1527
- };
1528
- }
1529
- function bridgeToJSON(value) {
1530
- return {
1531
- id: value.id,
1532
- name: value.name,
1533
- logo_uri: value.logoURI
1534
- };
1535
- }
1536
- function cctpTransferTransactionsFromJSON(value) {
1537
- return {
1538
- sendTx: value.send_tx ? chainTransactionFromJSON(value.send_tx) : null,
1539
- receiveTx: value.receive_tx ? chainTransactionFromJSON(value.receive_tx) : null
1540
- };
1541
- }
1542
- function cctpTransferTransactionsToJSON(value) {
1543
- return {
1544
- send_tx: value.sendTx ? chainTransactionToJSON(value.sendTx) : null,
1545
- receive_tx: value.receiveTx ? chainTransactionToJSON(value.receiveTx) : null
1546
- };
1547
- }
1548
- function cctpTransferInfoFromJSON(value) {
1549
- return {
1550
- fromChainID: value.from_chain_id,
1551
- toChainID: value.to_chain_id,
1552
- state: value.state,
1553
- txs: value.txs && cctpTransferTransactionsFromJSON(value.txs),
1554
- srcChainID: value.src_chain_id,
1555
- dstChainID: value.dst_chain_id
1556
- };
1557
- }
1558
- function cctpTransferInfoToJSON(value) {
1559
- return {
1560
- from_chain_id: value.fromChainID,
1561
- to_chain_id: value.toChainID,
1562
- state: value.state,
1563
- txs: value.txs && cctpTransferTransactionsToJSON(value.txs),
1564
- src_chain_id: value.srcChainID,
1565
- dst_chain_id: value.dstChainID
1566
- };
1567
- }
1568
- function hyperlaneTransferTransactionsFromJSON(value) {
1569
- return {
1570
- sendTx: value.send_tx ? chainTransactionFromJSON(value.send_tx) : null,
1571
- receiveTx: value.receive_tx ? chainTransactionFromJSON(value.receive_tx) : null
1572
- };
1573
- }
1574
- function hyperlaneTransferTransactionsToJSON(value) {
1575
- return {
1576
- send_tx: value.sendTx ? chainTransactionToJSON(value.sendTx) : null,
1577
- receive_tx: value.receiveTx ? chainTransactionToJSON(value.receiveTx) : null
1578
- };
1579
- }
1580
- function hyperlaneTransferInfoFromJSON(value) {
1581
- return {
1582
- fromChainID: value.from_chain_id,
1583
- toChainID: value.to_chain_id,
1584
- state: value.state,
1585
- txs: value.txs && hyperlaneTransferTransactionsFromJSON(value.txs)
1586
- };
1587
- }
1588
- function hyperlaneTransferInfoToJSON(value) {
1589
- return {
1590
- from_chain_id: value.fromChainID,
1591
- to_chain_id: value.toChainID,
1592
- state: value.state,
1593
- txs: value.txs && hyperlaneTransferTransactionsToJSON(value.txs)
1594
- };
1595
- }
1596
- function opInitTransferTransactionsFromJSON(value) {
1597
- return {
1598
- sendTx: value.send_tx ? chainTransactionFromJSON(value.send_tx) : null,
1599
- receiveTx: value.receive_tx ? chainTransactionFromJSON(value.receive_tx) : null
1600
- };
1601
- }
1602
- function opInitTransferTransactionsToJSON(value) {
1603
- return {
1604
- send_tx: value.sendTx ? chainTransactionToJSON(value.sendTx) : null,
1605
- receive_tx: value.receiveTx ? chainTransactionToJSON(value.receiveTx) : null
1606
- };
1607
- }
1608
- function opInitTransferInfoFromJSON(value) {
1609
- return {
1610
- fromChainID: value.from_chain_id,
1611
- toChainID: value.to_chain_id,
1612
- state: value.state,
1613
- txs: value.txs && opInitTransferTransactionsFromJSON(value.txs)
1614
- };
1615
- }
1616
- function opInitTransferInfoToJSON(value) {
1617
- return {
1618
- from_chain_id: value.fromChainID,
1619
- to_chain_id: value.toChainID,
1620
- state: value.state,
1621
- txs: value.txs && opInitTransferTransactionsToJSON(value.txs)
1622
- };
1623
- }
1624
- function msgsDirectRequestFromJSON(msgDirectRequestJSON) {
1625
- var _a;
1626
- return {
1627
- sourceAssetDenom: msgDirectRequestJSON.source_asset_denom,
1628
- sourceAssetChainID: msgDirectRequestJSON.source_asset_chain_id,
1629
- destAssetDenom: msgDirectRequestJSON.dest_asset_denom,
1630
- destAssetChainID: msgDirectRequestJSON.dest_asset_chain_id,
1631
- amountIn: msgDirectRequestJSON.amount_in,
1632
- amountOut: msgDirectRequestJSON.amount_out,
1633
- chainIdsToAddresses: msgDirectRequestJSON.chain_ids_to_addresses,
1634
- slippageTolerancePercent: msgDirectRequestJSON.slippage_tolerance_percent,
1635
- affiliates: (_a = msgDirectRequestJSON.affiliates) == null ? void 0 : _a.map(affiliateFromJSON),
1636
- chainIDsToAffiliates: msgDirectRequestJSON.chain_ids_to_affiliates ? chainIDsToAffiliatesMapFromJSON(
1637
- msgDirectRequestJSON.chain_ids_to_affiliates
1638
- ) : void 0,
1639
- timeoutSeconds: msgDirectRequestJSON.timeout_seconds,
1640
- postRouteHandler: msgDirectRequestJSON.post_route_handler && postHandlerFromJSON(msgDirectRequestJSON.post_route_handler),
1641
- swapVenue: msgDirectRequestJSON.swap_venue && swapVenueFromJSON(msgDirectRequestJSON.swap_venue),
1642
- swapVenues: msgDirectRequestJSON.swap_venues && msgDirectRequestJSON.swap_venues.map(swapVenueFromJSON),
1643
- smartRelay: msgDirectRequestJSON.smart_relay,
1644
- smartSwapOptions: msgDirectRequestJSON.smart_swap_options ? smartSwapOptionsFromJSON(msgDirectRequestJSON.smart_swap_options) : void 0,
1645
- allowSwaps: msgDirectRequestJSON.allow_swaps
1646
- };
1647
- }
1648
- function msgsDirectRequestToJSON(msgDirectRequest) {
1649
- var _a;
1650
- return {
1651
- source_asset_denom: msgDirectRequest.sourceAssetDenom,
1652
- source_asset_chain_id: msgDirectRequest.sourceAssetChainID,
1653
- dest_asset_denom: msgDirectRequest.destAssetDenom,
1654
- dest_asset_chain_id: msgDirectRequest.destAssetChainID,
1655
- amount_in: msgDirectRequest.amountIn,
1656
- amount_out: msgDirectRequest.amountOut,
1657
- chain_ids_to_addresses: msgDirectRequest.chainIdsToAddresses,
1658
- slippage_tolerance_percent: msgDirectRequest.slippageTolerancePercent,
1659
- affiliates: (_a = msgDirectRequest.affiliates) == null ? void 0 : _a.map(affiliateToJSON),
1660
- chain_ids_to_affiliates: msgDirectRequest.chainIDsToAffiliates ? chainIDsToAffiliatesMapToJSON(msgDirectRequest.chainIDsToAffiliates) : void 0,
1661
- allow_multi_tx: msgDirectRequest.allowMultiTx,
1662
- allow_unsafe: msgDirectRequest.allowUnsafe,
1663
- bridges: msgDirectRequest.bridges,
1664
- timeout_seconds: msgDirectRequest.timeoutSeconds,
1665
- experimental_features: msgDirectRequest.experimentalFeatures,
1666
- swap_venue: msgDirectRequest.swapVenue && swapVenueToJSON(msgDirectRequest.swapVenue),
1667
- swap_venues: msgDirectRequest.swapVenues && msgDirectRequest.swapVenues.map(swapVenueToJSON),
1668
- post_route_handler: msgDirectRequest.postRouteHandler && postHandlerToJSON(msgDirectRequest.postRouteHandler),
1669
- smart_relay: msgDirectRequest.smartRelay,
1670
- smart_swap_options: msgDirectRequest.smartSwapOptions ? smartSwapOptionsToJSON(msgDirectRequest.smartSwapOptions) : void 0,
1671
- allow_swaps: msgDirectRequest.allowSwaps
1672
- };
1673
- }
1674
- function smartSwapOptionsFromJSON(smartSwapOptionsJSON) {
1675
- return {
1676
- splitRoutes: Boolean(smartSwapOptionsJSON.split_routes),
1677
- evmSwaps: Boolean(smartSwapOptionsJSON.evm_swaps)
1678
- };
1679
- }
1680
- function smartSwapOptionsToJSON(smartSwapOptions) {
1681
- return {
1682
- split_routes: Boolean(smartSwapOptions.splitRoutes),
1683
- evm_swaps: Boolean(smartSwapOptions.evmSwaps)
1684
- };
1685
- }
1686
- function chainIDsToAffiliatesMapFromJSON(value) {
1687
- const result = {};
1688
- for (const key of Object.keys(value)) {
1689
- result[key] = chainAffiliatesFromJSON(value[key]);
1690
- }
1691
- return result;
1692
- }
1693
- function chainIDsToAffiliatesMapToJSON(value) {
1694
- const result = {};
1695
- for (const key of Object.keys(value)) {
1696
- result[key] = chainAffiliatesToJSON(value[key]);
1697
- }
1698
- return result;
1699
- }
1700
- function chainAffiliatesFromJSON(value) {
1701
- return {
1702
- affiliates: value.affiliates.map(affiliateFromJSON)
1703
- };
1704
- }
1705
- function chainAffiliatesToJSON(value) {
1706
- return {
1707
- affiliates: value.affiliates.map(affiliateToJSON)
1708
- };
1709
- }
1710
-
1711
- exports.affiliateFromJSON = affiliateFromJSON;
1712
- exports.affiliateToJSON = affiliateToJSON;
1713
- exports.assetBetweenChainsFromJSON = assetBetweenChainsFromJSON;
1714
- exports.assetBetweenChainsToJSON = assetBetweenChainsToJSON;
1715
- exports.assetFromJSON = assetFromJSON;
1716
- exports.assetOrErrorFromJSON = assetOrErrorFromJSON;
1717
- exports.assetOrErrorToJSON = assetOrErrorToJSON;
1718
- exports.assetRecommendationFromJSON = assetRecommendationFromJSON;
1719
- exports.assetRecommendationRequestFromJSON = assetRecommendationRequestFromJSON;
1720
- exports.assetRecommendationRequestToJSON = assetRecommendationRequestToJSON;
1721
- exports.assetRecommendationToJSON = assetRecommendationToJSON;
1722
- exports.assetToJSON = assetToJSON;
1723
- exports.assetsBetweenChainsRequestFromJSON = assetsBetweenChainsRequestFromJSON;
1724
- exports.assetsBetweenChainsRequestToJSON = assetsBetweenChainsRequestToJSON;
1725
- exports.assetsBetweenChainsResponseFromJSON = assetsBetweenChainsResponseFromJSON;
1726
- exports.assetsFromSourceRequestFromJSON = assetsFromSourceRequestFromJSON;
1727
- exports.assetsFromSourceRequestToJSON = assetsFromSourceRequestToJSON;
1728
- exports.assetsRequestFromJSON = assetsRequestFromJSON;
1729
- exports.assetsRequestToJSON = assetsRequestToJSON;
1730
- exports.axelarTransferFromJSON = axelarTransferFromJSON;
1731
- exports.axelarTransferInfoFromJSON = axelarTransferInfoFromJSON;
1732
- exports.axelarTransferInfoToJSON = axelarTransferInfoToJSON;
1733
- exports.axelarTransferToJSON = axelarTransferToJSON;
1734
- exports.axelarTransferTransactionsFromJSON = axelarTransferTransactionsFromJSON;
1735
- exports.axelarTransferTransactionsToJSON = axelarTransferTransactionsToJSON;
1736
- exports.bankSendFromJSON = bankSendFromJSON;
1737
- exports.bankSendToJSON = bankSendToJSON;
1738
- exports.bridgeFromJSON = bridgeFromJSON;
1739
- exports.bridgeToJSON = bridgeToJSON;
1740
- exports.bridgesResponseFromJSON = bridgesResponseFromJSON;
1741
- exports.bridgesResponseToJSON = bridgesResponseToJSON;
1742
- exports.cctpTransferFromJSON = cctpTransferFromJSON;
1743
- exports.cctpTransferInfoFromJSON = cctpTransferInfoFromJSON;
1744
- exports.cctpTransferInfoToJSON = cctpTransferInfoToJSON;
1745
- exports.cctpTransferToJSON = cctpTransferToJSON;
1746
- exports.cctpTransferTransactionsFromJSON = cctpTransferTransactionsFromJSON;
1747
- exports.cctpTransferTransactionsToJSON = cctpTransferTransactionsToJSON;
1748
- exports.chainAffiliatesFromJSON = chainAffiliatesFromJSON;
1749
- exports.chainAffiliatesToJSON = chainAffiliatesToJSON;
1750
- exports.chainFromJSON = chainFromJSON;
1751
- exports.chainIDsToAffiliatesMapFromJSON = chainIDsToAffiliatesMapFromJSON;
1752
- exports.chainIDsToAffiliatesMapToJSON = chainIDsToAffiliatesMapToJSON;
1753
- exports.chainToJSON = chainToJSON;
1754
- exports.chainTransactionFromJSON = chainTransactionFromJSON;
1755
- exports.chainTransactionToJSON = chainTransactionToJSON;
1756
- exports.contractCallWithTokenTransactionsFromJSON = contractCallWithTokenTransactionsFromJSON;
1757
- exports.contractCallWithTokenTransactionsToJSON = contractCallWithTokenTransactionsToJSON;
1758
- exports.cosmWasmContractMsgFromJSON = cosmWasmContractMsgFromJSON;
1759
- exports.cosmWasmContractMsgToJSON = cosmWasmContractMsgToJSON;
1760
- exports.cosmosMsgFromJSON = cosmosMsgFromJSON;
1761
- exports.cosmosMsgToJSON = cosmosMsgToJSON;
1762
- exports.cosmosTxFromJSON = cosmosTxFromJSON;
1763
- exports.cosmosTxToJSON = cosmosTxToJSON;
1764
- exports.denomWithChainIDFromJSON = denomWithChainIDFromJSON;
1765
- exports.denomWithChainIDToJSON = denomWithChainIDToJSON;
1766
- exports.erc20ApprovalFromJSON = erc20ApprovalFromJSON;
1767
- exports.erc20ApprovalToJSON = erc20ApprovalToJSON;
1768
- exports.estimatedFeeFromJSON = estimatedFeeFromJSON;
1769
- exports.estimatedFeeToJSON = estimatedFeeToJSON;
1770
- exports.evmSwapFromJSON = evmSwapFromJSON;
1771
- exports.evmSwapToJSON = evmSwapToJSON;
1772
- exports.evmTxFromJSON = evmTxFromJSON;
1773
- exports.evmTxToJSON = evmTxToJSON;
1774
- exports.feeAssetFromJSON = feeAssetFromJSON;
1775
- exports.feeAssetToJSON = feeAssetToJSON;
1776
- exports.hyperlaneTransferFromJSON = hyperlaneTransferFromJSON;
1777
- exports.hyperlaneTransferInfoFromJSON = hyperlaneTransferInfoFromJSON;
1778
- exports.hyperlaneTransferInfoToJSON = hyperlaneTransferInfoToJSON;
1779
- exports.hyperlaneTransferToJSON = hyperlaneTransferToJSON;
1780
- exports.hyperlaneTransferTransactionsFromJSON = hyperlaneTransferTransactionsFromJSON;
1781
- exports.hyperlaneTransferTransactionsToJSON = hyperlaneTransferTransactionsToJSON;
1782
- exports.ibcAddressFromJSON = ibcAddressFromJSON;
1783
- exports.ibcAddressToJSON = ibcAddressToJSON;
1784
- exports.ibcCapabilitiesFromJSON = ibcCapabilitiesFromJSON;
1785
- exports.ibcCapabilitiesToJSON = ibcCapabilitiesToJSON;
1786
- exports.messageResponseFromJSON = messageResponseFromJSON;
1787
- exports.msgFromJSON = msgFromJSON;
1788
- exports.msgToJSON = msgToJSON;
1789
- exports.msgsDirectRequestFromJSON = msgsDirectRequestFromJSON;
1790
- exports.msgsDirectRequestToJSON = msgsDirectRequestToJSON;
1791
- exports.msgsRequestFromJSON = msgsRequestFromJSON;
1792
- exports.msgsRequestToJSON = msgsRequestToJSON;
1793
- exports.multiChainMsgFromJSON = multiChainMsgFromJSON;
1794
- exports.multiChainMsgToJSON = multiChainMsgToJSON;
1795
- exports.nextBlockingTransferFromJSON = nextBlockingTransferFromJSON;
1796
- exports.nextBlockingTransferToJSON = nextBlockingTransferToJSON;
1797
- exports.opInitTransferFromJSON = opInitTransferFromJSON;
1798
- exports.opInitTransferInfoFromJSON = opInitTransferInfoFromJSON;
1799
- exports.opInitTransferInfoToJSON = opInitTransferInfoToJSON;
1800
- exports.opInitTransferToJSON = opInitTransferToJSON;
1801
- exports.opInitTransferTransactionsFromJSON = opInitTransferTransactionsFromJSON;
1802
- exports.opInitTransferTransactionsToJSON = opInitTransferTransactionsToJSON;
1803
- exports.operationFromJSON = operationFromJSON;
1804
- exports.operationToJSON = operationToJSON;
1805
- exports.originAssetsRequestFromJSON = originAssetsRequestFromJSON;
1806
- exports.originAssetsRequestToJSON = originAssetsRequestToJSON;
1807
- exports.originAssetsResponseFromJSON = originAssetsResponseFromJSON;
1808
- exports.originAssetsResponseToJSON = originAssetsResponseToJSON;
1809
- exports.packetFromJSON = packetFromJSON;
1810
- exports.packetToJSON = packetToJSON;
1811
- exports.postHandlerFromJSON = postHandlerFromJSON;
1812
- exports.postHandlerToJSON = postHandlerToJSON;
1813
- exports.recommendAssetsRequestFromJSON = recommendAssetsRequestFromJSON;
1814
- exports.recommendAssetsRequestToJSON = recommendAssetsRequestToJSON;
1815
- exports.recommendAssetsResponseFromJSON = recommendAssetsResponseFromJSON;
1816
- exports.recommendAssetsResponseToJSON = recommendAssetsResponseToJSON;
1817
- exports.recommendationEntryFromJSON = recommendationEntryFromJSON;
1818
- exports.recommendationEntryToJSON = recommendationEntryToJSON;
1819
- exports.routeRequestFromJSON = routeRequestFromJSON;
1820
- exports.routeRequestToJSON = routeRequestToJSON;
1821
- exports.routeResponseFromJSON = routeResponseFromJSON;
1822
- exports.routeResponseToJSON = routeResponseToJSON;
1823
- exports.sendTokenTransactionsFromJSON = sendTokenTransactionsFromJSON;
1824
- exports.sendTokenTransactionsToJSON = sendTokenTransactionsToJSON;
1825
- exports.smartSwapExactCoinInFromJSON = smartSwapExactCoinInFromJSON;
1826
- exports.smartSwapExactCoinInToJSON = smartSwapExactCoinInToJSON;
1827
- exports.smartSwapOptionsFromJSON = smartSwapOptionsFromJSON;
1828
- exports.smartSwapOptionsToJSON = smartSwapOptionsToJSON;
1829
- exports.submitTxRequestFromJSON = submitTxRequestFromJSON;
1830
- exports.submitTxRequestToJSON = submitTxRequestToJSON;
1831
- exports.submitTxResponseFromJSON = submitTxResponseFromJSON;
1832
- exports.submitTxResponseToJSON = submitTxResponseToJSON;
1833
- exports.svmTxFromJSON = svmTxFromJSON;
1834
- exports.svmTxToJSON = svmTxToJSON;
1835
- exports.swapExactCoinInFromJSON = swapExactCoinInFromJSON;
1836
- exports.swapExactCoinInToJSON = swapExactCoinInToJSON;
1837
- exports.swapExactCoinOutFromJSON = swapExactCoinOutFromJSON;
1838
- exports.swapExactCoinOutToJSON = swapExactCoinOutToJSON;
1839
- exports.swapFromJSON = swapFromJSON;
1840
- exports.swapOperationFromJSON = swapOperationFromJSON;
1841
- exports.swapOperationToJSON = swapOperationToJSON;
1842
- exports.swapRouteFromJSON = swapRouteFromJSON;
1843
- exports.swapRouteToJSON = swapRouteToJSON;
1844
- exports.swapToJSON = swapToJSON;
1845
- exports.swapVenueFromJSON = swapVenueFromJSON;
1846
- exports.swapVenueRequestFromJSON = swapVenueRequestFromJSON;
1847
- exports.swapVenueRequestToJSON = swapVenueRequestToJSON;
1848
- exports.swapVenueToJSON = swapVenueToJSON;
1849
- exports.trackTxRequestFromJSON = trackTxRequestFromJSON;
1850
- exports.trackTxRequestToJSON = trackTxRequestToJSON;
1851
- exports.trackTxResponseFromJSON = trackTxResponseFromJSON;
1852
- exports.trackTxResponseToJSON = trackTxResponseToJSON;
1853
- exports.transferAssetReleaseFromJSON = transferAssetReleaseFromJSON;
1854
- exports.transferAssetReleaseToJSON = transferAssetReleaseToJSON;
1855
- exports.transferEventFromJSON = transferEventFromJSON;
1856
- exports.transferEventToJSON = transferEventToJSON;
1857
- exports.transferFromJSON = transferFromJSON;
1858
- exports.transferInfoFromJSON = transferInfoFromJSON;
1859
- exports.transferInfoToJSON = transferInfoToJSON;
1860
- exports.transferStatusFromJSON = transferStatusFromJSON;
1861
- exports.transferStatusToJSON = transferStatusToJSON;
1862
- exports.transferToJSON = transferToJSON;
1863
- exports.txFromJSON = txFromJSON;
1864
- exports.txStatusRequestFromJSON = txStatusRequestFromJSON;
1865
- exports.txStatusRequestToJSON = txStatusRequestToJSON;
1866
- exports.txStatusResponseFromJSON = txStatusResponseFromJSON;
1867
- exports.txStatusResponseToJSON = txStatusResponseToJSON;
1868
- exports.txToJSON = txToJSON;