@skip-go/client 0.4.5 → 0.5.1

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.
@@ -0,0 +1,1872 @@
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
+ enableGasWarnings: msgsRequestJSON.enable_gas_warnings
773
+ };
774
+ }
775
+ function msgsRequestToJSON(msgsRequest) {
776
+ var _a;
777
+ return {
778
+ source_asset_denom: msgsRequest.sourceAssetDenom,
779
+ source_asset_chain_id: msgsRequest.sourceAssetChainID,
780
+ dest_asset_denom: msgsRequest.destAssetDenom,
781
+ dest_asset_chain_id: msgsRequest.destAssetChainID,
782
+ amount_in: msgsRequest.amountIn,
783
+ amount_out: msgsRequest.amountOut,
784
+ address_list: msgsRequest.addressList,
785
+ operations: msgsRequest.operations.map(operationToJSON),
786
+ estimated_amount_out: msgsRequest.estimatedAmountOut,
787
+ slippage_tolerance_percent: msgsRequest.slippageTolerancePercent,
788
+ affiliates: (_a = msgsRequest.affiliates) == null ? void 0 : _a.map(affiliateToJSON),
789
+ chain_ids_to_affiliates: msgsRequest.chainIDsToAffiliates ? chainIDsToAffiliatesMapToJSON(msgsRequest.chainIDsToAffiliates) : void 0,
790
+ post_route_handler: msgsRequest.postRouteHandler && postHandlerToJSON(msgsRequest.postRouteHandler),
791
+ enable_gas_warnings: msgsRequest.enableGasWarnings
792
+ };
793
+ }
794
+ function multiChainMsgFromJSON(multiChainMsgJSON) {
795
+ return {
796
+ chainID: multiChainMsgJSON.chain_id,
797
+ path: multiChainMsgJSON.path,
798
+ msg: multiChainMsgJSON.msg,
799
+ msgTypeURL: multiChainMsgJSON.msg_type_url
800
+ };
801
+ }
802
+ function multiChainMsgToJSON(multiChainMsg) {
803
+ return {
804
+ chain_id: multiChainMsg.chainID,
805
+ path: multiChainMsg.path,
806
+ msg: multiChainMsg.msg,
807
+ msg_type_url: multiChainMsg.msgTypeURL
808
+ };
809
+ }
810
+ function cosmosMsgFromJSON(cosmosMsgJSON) {
811
+ return {
812
+ msg: cosmosMsgJSON.msg,
813
+ msgTypeURL: cosmosMsgJSON.msg_type_url
814
+ };
815
+ }
816
+ function cosmosMsgToJSON(cosmosMsg) {
817
+ return {
818
+ msg: cosmosMsg.msg,
819
+ msg_type_url: cosmosMsg.msgTypeURL
820
+ };
821
+ }
822
+ function submitTxRequestFromJSON(submitTxRequestJSON) {
823
+ return {
824
+ tx: submitTxRequestJSON.tx,
825
+ chainID: submitTxRequestJSON.chain_id
826
+ };
827
+ }
828
+ function submitTxRequestToJSON(submitTxRequest) {
829
+ return {
830
+ tx: submitTxRequest.tx,
831
+ chain_id: submitTxRequest.chainID
832
+ };
833
+ }
834
+ function submitTxResponseFromJSON(submitTxResponseJSON) {
835
+ return {
836
+ txHash: submitTxResponseJSON.tx_hash
837
+ };
838
+ }
839
+ function submitTxResponseToJSON(submitTxResponse) {
840
+ return {
841
+ tx_hash: submitTxResponse.txHash
842
+ };
843
+ }
844
+ function trackTxRequestFromJSON(trackRequestJSON) {
845
+ return {
846
+ txHash: trackRequestJSON.tx_hash,
847
+ chainID: trackRequestJSON.chain_id
848
+ };
849
+ }
850
+ function trackTxRequestToJSON(trackRequest) {
851
+ return {
852
+ tx_hash: trackRequest.txHash,
853
+ chain_id: trackRequest.chainID
854
+ };
855
+ }
856
+ function trackTxResponseFromJSON(trackResponseJSON) {
857
+ return {
858
+ txHash: trackResponseJSON.tx_hash,
859
+ explorerLink: trackResponseJSON.explorer_link
860
+ };
861
+ }
862
+ function trackTxResponseToJSON(trackResponse) {
863
+ return {
864
+ tx_hash: trackResponse.txHash,
865
+ explorer_link: trackResponse.explorerLink
866
+ };
867
+ }
868
+ function txStatusRequestFromJSON(txStatusRequestJSON) {
869
+ return {
870
+ txHash: txStatusRequestJSON.tx_hash,
871
+ chainID: txStatusRequestJSON.chain_id
872
+ };
873
+ }
874
+ function txStatusRequestToJSON(txStatusRequest) {
875
+ return {
876
+ tx_hash: txStatusRequest.txHash,
877
+ chain_id: txStatusRequest.chainID
878
+ };
879
+ }
880
+ function chainTransactionFromJSON(chainTransactionJSON) {
881
+ return {
882
+ txHash: chainTransactionJSON.tx_hash,
883
+ chainID: chainTransactionJSON.chain_id,
884
+ explorerLink: chainTransactionJSON.explorer_link
885
+ };
886
+ }
887
+ function chainTransactionToJSON(chainTransaction) {
888
+ return {
889
+ tx_hash: chainTransaction.txHash,
890
+ chain_id: chainTransaction.chainID,
891
+ explorer_link: chainTransaction.explorerLink
892
+ };
893
+ }
894
+ function packetFromJSON(packetJSON) {
895
+ return {
896
+ sendTx: packetJSON.send_tx && chainTransactionFromJSON(packetJSON.send_tx),
897
+ receiveTx: packetJSON.receive_tx && chainTransactionFromJSON(packetJSON.receive_tx),
898
+ acknowledgeTx: packetJSON.acknowledge_tx && chainTransactionFromJSON(packetJSON.acknowledge_tx),
899
+ timeoutTx: packetJSON.timeout_tx && chainTransactionFromJSON(packetJSON.timeout_tx),
900
+ error: packetJSON.error
901
+ };
902
+ }
903
+ function packetToJSON(packet) {
904
+ return {
905
+ send_tx: packet.sendTx && chainTransactionToJSON(packet.sendTx),
906
+ receive_tx: packet.receiveTx && chainTransactionToJSON(packet.receiveTx),
907
+ acknowledge_tx: packet.acknowledgeTx && chainTransactionToJSON(packet.acknowledgeTx),
908
+ timeout_tx: packet.timeoutTx && chainTransactionToJSON(packet.timeoutTx),
909
+ error: packet.error
910
+ };
911
+ }
912
+ function transferInfoFromJSON(transferInfoJSON) {
913
+ return {
914
+ fromChainID: transferInfoJSON.from_chain_id,
915
+ toChainID: transferInfoJSON.to_chain_id,
916
+ state: transferInfoJSON.state,
917
+ packetTXs: transferInfoJSON.packet_txs && packetFromJSON(transferInfoJSON.packet_txs),
918
+ srcChainID: transferInfoJSON.src_chain_id,
919
+ dstChainID: transferInfoJSON.dst_chain_id
920
+ };
921
+ }
922
+ function transferInfoToJSON(transferInfo) {
923
+ return {
924
+ from_chain_id: transferInfo.fromChainID,
925
+ to_chain_id: transferInfo.toChainID,
926
+ state: transferInfo.state,
927
+ packet_txs: transferInfo.packetTXs && packetToJSON(transferInfo.packetTXs),
928
+ src_chain_id: transferInfo.srcChainID,
929
+ dst_chain_id: transferInfo.dstChainID
930
+ };
931
+ }
932
+ function nextBlockingTransferFromJSON(nextBlockingTransferJSON) {
933
+ return {
934
+ transferSequenceIndex: nextBlockingTransferJSON.transfer_sequence_index
935
+ };
936
+ }
937
+ function nextBlockingTransferToJSON(nextBlockingTransfer) {
938
+ return {
939
+ transfer_sequence_index: nextBlockingTransfer.transferSequenceIndex
940
+ };
941
+ }
942
+ function transferAssetReleaseFromJSON(transferAssetReleaseJSON) {
943
+ return {
944
+ chainID: transferAssetReleaseJSON.chain_id,
945
+ denom: transferAssetReleaseJSON.denom,
946
+ released: transferAssetReleaseJSON.released
947
+ };
948
+ }
949
+ function transferAssetReleaseToJSON(transferAssetRelease) {
950
+ return {
951
+ chain_id: transferAssetRelease.chainID,
952
+ denom: transferAssetRelease.denom,
953
+ released: transferAssetRelease.released
954
+ };
955
+ }
956
+ function txStatusResponseFromJSON(statusResponseJSON) {
957
+ return {
958
+ status: statusResponseJSON.status,
959
+ nextBlockingTransfer: statusResponseJSON.next_blocking_transfer && nextBlockingTransferFromJSON(statusResponseJSON.next_blocking_transfer),
960
+ transferSequence: statusResponseJSON.transfer_sequence.map(
961
+ transferEventFromJSON
962
+ ),
963
+ transferAssetRelease: statusResponseJSON.transfer_asset_release && transferAssetReleaseFromJSON(statusResponseJSON.transfer_asset_release),
964
+ error: statusResponseJSON.error,
965
+ state: statusResponseJSON.state,
966
+ transfers: statusResponseJSON.transfers.map(transferStatusFromJSON)
967
+ };
968
+ }
969
+ function txStatusResponseToJSON(statusResponse) {
970
+ return {
971
+ status: statusResponse.status,
972
+ next_blocking_transfer: statusResponse.nextBlockingTransfer && nextBlockingTransferToJSON(statusResponse.nextBlockingTransfer),
973
+ transfer_sequence: statusResponse.transferSequence.map(transferEventToJSON),
974
+ transfer_asset_release: statusResponse.transferAssetRelease && transferAssetReleaseToJSON(statusResponse.transferAssetRelease),
975
+ error: statusResponse.error,
976
+ state: statusResponse.state,
977
+ transfers: statusResponse.transfers.map(transferStatusToJSON)
978
+ };
979
+ }
980
+ function ibcAddressFromJSON(ibcAddressJSON) {
981
+ return {
982
+ address: ibcAddressJSON.address,
983
+ chainID: ibcAddressJSON.chain_id
984
+ };
985
+ }
986
+ function ibcAddressToJSON(ibcAddress) {
987
+ return {
988
+ address: ibcAddress.address,
989
+ chain_id: ibcAddress.chainID
990
+ };
991
+ }
992
+ function axelarTransferFromJSON(axelarTransferJSON) {
993
+ return {
994
+ fromChain: axelarTransferJSON.from_chain,
995
+ fromChainID: axelarTransferJSON.from_chain_id,
996
+ toChain: axelarTransferJSON.to_chain,
997
+ toChainID: axelarTransferJSON.to_chain_id,
998
+ asset: axelarTransferJSON.asset,
999
+ shouldUnwrap: axelarTransferJSON.should_unwrap,
1000
+ denomIn: axelarTransferJSON.denom_in,
1001
+ denomOut: axelarTransferJSON.denom_out,
1002
+ feeAmount: axelarTransferJSON.fee_amount,
1003
+ usdFeeAmount: axelarTransferJSON.usd_fee_amount,
1004
+ feeAsset: assetFromJSON(axelarTransferJSON.fee_asset),
1005
+ isTestnet: axelarTransferJSON.is_testnet,
1006
+ ibcTransferToAxelar: axelarTransferJSON.ibc_transfer_to_axelar ? transferFromJSON(axelarTransferJSON.ibc_transfer_to_axelar) : void 0,
1007
+ bridgeID: axelarTransferJSON.bridge_id,
1008
+ smartRelay: axelarTransferJSON.smart_relay
1009
+ };
1010
+ }
1011
+ function axelarTransferToJSON(axelarTransfer) {
1012
+ return {
1013
+ from_chain: axelarTransfer.fromChain,
1014
+ from_chain_id: axelarTransfer.fromChainID,
1015
+ to_chain: axelarTransfer.toChain,
1016
+ to_chain_id: axelarTransfer.toChainID,
1017
+ asset: axelarTransfer.asset,
1018
+ should_unwrap: axelarTransfer.shouldUnwrap,
1019
+ denom_in: axelarTransfer.denomIn,
1020
+ denom_out: axelarTransfer.denomOut,
1021
+ fee_amount: axelarTransfer.feeAmount,
1022
+ fee_asset: assetToJSON(axelarTransfer.feeAsset),
1023
+ usd_fee_amount: axelarTransfer.usdFeeAmount,
1024
+ is_testnet: axelarTransfer.isTestnet,
1025
+ ibc_transfer_to_axelar: axelarTransfer.ibcTransferToAxelar ? transferToJSON(axelarTransfer.ibcTransferToAxelar) : void 0,
1026
+ bridge_id: axelarTransfer.bridgeID,
1027
+ smart_relay: axelarTransfer.smartRelay
1028
+ };
1029
+ }
1030
+ function bankSendFromJSON(value) {
1031
+ return {
1032
+ chainID: value.chain_id,
1033
+ denom: value.denom
1034
+ };
1035
+ }
1036
+ function bankSendToJSON(value) {
1037
+ return {
1038
+ chain_id: value.chainID,
1039
+ denom: value.denom
1040
+ };
1041
+ }
1042
+ function cctpTransferFromJSON(value) {
1043
+ return {
1044
+ fromChainID: value.from_chain_id,
1045
+ toChainID: value.to_chain_id,
1046
+ burnToken: value.burn_token,
1047
+ bridgeID: value.bridge_id,
1048
+ denomIn: value.denom_in,
1049
+ denomOut: value.denom_out,
1050
+ smartRelay: value.smart_relay
1051
+ };
1052
+ }
1053
+ function cctpTransferToJSON(value) {
1054
+ return {
1055
+ from_chain_id: value.fromChainID,
1056
+ to_chain_id: value.toChainID,
1057
+ burn_token: value.burnToken,
1058
+ bridge_id: value.bridgeID,
1059
+ denom_in: value.denomIn,
1060
+ denom_out: value.denomOut,
1061
+ smart_relay: value.smartRelay
1062
+ };
1063
+ }
1064
+ function hyperlaneTransferFromJSON(value) {
1065
+ return {
1066
+ fromChainID: value.from_chain_id,
1067
+ toChainID: value.to_chain_id,
1068
+ denomIn: value.denom_in,
1069
+ denomOut: value.denom_out,
1070
+ hyperlaneContractAddress: value.hyperlane_contract_address,
1071
+ feeAmount: value.fee_amount,
1072
+ usdFeeAmount: value.usd_fee_amount,
1073
+ feeAsset: assetFromJSON(value.fee_asset),
1074
+ bridgeID: value.bridge_id,
1075
+ smartRelay: value.smart_relay
1076
+ };
1077
+ }
1078
+ function hyperlaneTransferToJSON(value) {
1079
+ return {
1080
+ from_chain_id: value.fromChainID,
1081
+ to_chain_id: value.toChainID,
1082
+ denom_in: value.denomIn,
1083
+ denom_out: value.denomOut,
1084
+ hyperlane_contract_address: value.hyperlaneContractAddress,
1085
+ fee_amount: value.feeAmount,
1086
+ usd_fee_amount: value.usdFeeAmount,
1087
+ fee_asset: assetToJSON(value.feeAsset),
1088
+ bridge_id: value.bridgeID,
1089
+ smart_relay: value.smartRelay
1090
+ };
1091
+ }
1092
+ function opInitTransferFromJSON(value) {
1093
+ return {
1094
+ fromChainID: value.from_chain_id,
1095
+ toChainID: value.to_chain_id,
1096
+ denomIn: value.denom_in,
1097
+ denomOut: value.denom_out,
1098
+ opInitBridgeID: value.op_init_bridge_id,
1099
+ bridgeID: value.bridge_id,
1100
+ smartRelay: value.smart_relay
1101
+ };
1102
+ }
1103
+ function opInitTransferToJSON(value) {
1104
+ return {
1105
+ from_chain_id: value.fromChainID,
1106
+ to_chain_id: value.toChainID,
1107
+ denom_in: value.denomIn,
1108
+ denom_out: value.denomOut,
1109
+ op_init_bridge_id: value.opInitBridgeID,
1110
+ bridge_id: value.bridgeID,
1111
+ smart_relay: value.smartRelay
1112
+ };
1113
+ }
1114
+ function erc20ApprovalFromJSON(erc20ApprovalJSON) {
1115
+ return {
1116
+ tokenContract: erc20ApprovalJSON.token_contract,
1117
+ spender: erc20ApprovalJSON.spender,
1118
+ amount: erc20ApprovalJSON.amount
1119
+ };
1120
+ }
1121
+ function erc20ApprovalToJSON(erc20Approval) {
1122
+ return {
1123
+ token_contract: erc20Approval.tokenContract,
1124
+ spender: erc20Approval.spender,
1125
+ amount: erc20Approval.amount
1126
+ };
1127
+ }
1128
+ function svmTxFromJSON(svmTxJSON) {
1129
+ return {
1130
+ chainID: svmTxJSON.chain_id,
1131
+ tx: svmTxJSON.tx,
1132
+ signerAddress: svmTxJSON.signer_address
1133
+ };
1134
+ }
1135
+ function svmTxToJSON(svmTx) {
1136
+ return {
1137
+ chain_id: svmTx.chainID,
1138
+ tx: svmTx.tx,
1139
+ signer_address: svmTx.signerAddress
1140
+ };
1141
+ }
1142
+ function evmTxFromJSON(evmTxJSON) {
1143
+ return {
1144
+ chainID: evmTxJSON.chain_id,
1145
+ to: evmTxJSON.to,
1146
+ value: evmTxJSON.value,
1147
+ data: evmTxJSON.data,
1148
+ requiredERC20Approvals: evmTxJSON.required_erc20_approvals.map(
1149
+ erc20ApprovalFromJSON
1150
+ ),
1151
+ signerAddress: evmTxJSON.signer_address
1152
+ };
1153
+ }
1154
+ function evmTxToJSON(evmTx) {
1155
+ return {
1156
+ chain_id: evmTx.chainID,
1157
+ to: evmTx.to,
1158
+ value: evmTx.value,
1159
+ data: evmTx.data,
1160
+ required_erc20_approvals: evmTx.requiredERC20Approvals.map(erc20ApprovalToJSON),
1161
+ signer_address: evmTx.signerAddress
1162
+ };
1163
+ }
1164
+ function cosmosTxFromJSON(cosmosTxJSON) {
1165
+ return {
1166
+ chainID: cosmosTxJSON.chain_id,
1167
+ path: cosmosTxJSON.path,
1168
+ msgs: cosmosTxJSON.msgs.map(cosmosMsgFromJSON),
1169
+ signerAddress: cosmosTxJSON.signer_address
1170
+ };
1171
+ }
1172
+ function cosmosTxToJSON(cosmosTx) {
1173
+ return {
1174
+ chain_id: cosmosTx.chainID,
1175
+ path: cosmosTx.path,
1176
+ msgs: cosmosTx.msgs.map(cosmosMsgToJSON),
1177
+ signer_address: cosmosTx.signerAddress
1178
+ };
1179
+ }
1180
+ function txFromJSON(txJSON) {
1181
+ if ("cosmos_tx" in txJSON) {
1182
+ return {
1183
+ cosmosTx: cosmosTxFromJSON(txJSON.cosmos_tx),
1184
+ operationsIndices: txJSON.operations_indices
1185
+ };
1186
+ }
1187
+ if ("svm_tx" in txJSON) {
1188
+ return {
1189
+ svmTx: svmTxFromJSON(txJSON.svm_tx),
1190
+ operationsIndices: txJSON.operations_indices
1191
+ };
1192
+ }
1193
+ return {
1194
+ evmTx: evmTxFromJSON(txJSON.evm_tx),
1195
+ operationsIndices: txJSON.operations_indices
1196
+ };
1197
+ }
1198
+ function txToJSON(tx) {
1199
+ if ("cosmosTx" in tx) {
1200
+ return {
1201
+ cosmos_tx: cosmosTxToJSON(tx.cosmosTx),
1202
+ operations_indices: tx.operationsIndices
1203
+ };
1204
+ }
1205
+ if ("svmTx" in tx) {
1206
+ return {
1207
+ svm_tx: svmTxToJSON(tx.svmTx),
1208
+ operations_indices: tx.operationsIndices
1209
+ };
1210
+ }
1211
+ return {
1212
+ evm_tx: evmTxToJSON(tx.evmTx),
1213
+ operations_indices: tx.operationsIndices
1214
+ };
1215
+ }
1216
+ function msgFromJSON(msgJSON) {
1217
+ if ("multi_chain_msg" in msgJSON) {
1218
+ return {
1219
+ multiChainMsg: multiChainMsgFromJSON(msgJSON.multi_chain_msg)
1220
+ };
1221
+ }
1222
+ if ("svm_tx" in msgJSON) {
1223
+ return {
1224
+ svmTx: svmTxFromJSON(msgJSON.svm_tx)
1225
+ };
1226
+ }
1227
+ return {
1228
+ evmTx: evmTxFromJSON(msgJSON.evm_tx)
1229
+ };
1230
+ }
1231
+ function msgToJSON(msg) {
1232
+ if ("multiChainMsg" in msg) {
1233
+ return {
1234
+ multi_chain_msg: multiChainMsgToJSON(msg.multiChainMsg)
1235
+ };
1236
+ }
1237
+ if ("svmTx" in msg) {
1238
+ return {
1239
+ svm_tx: svmTxToJSON(msg.svmTx)
1240
+ };
1241
+ }
1242
+ return {
1243
+ evm_tx: evmTxToJSON(msg.evmTx)
1244
+ };
1245
+ }
1246
+ function messageResponseFromJSON(response) {
1247
+ var _a, _b;
1248
+ return {
1249
+ estimatedFees: (_a = response.estimated_fees) == null ? void 0 : _a.map(
1250
+ (fee) => estimatedFeeFromJSON(fee)
1251
+ ),
1252
+ msgs: response.msgs.map((msg) => msgFromJSON(msg)),
1253
+ txs: (_b = response.txs) == null ? void 0 : _b.map((tx) => txFromJSON(tx)),
1254
+ warning: response.warning
1255
+ };
1256
+ }
1257
+ function sendTokenTransactionsFromJSON(sendTokenTransactionsJSON) {
1258
+ return {
1259
+ sendTx: sendTokenTransactionsJSON.send_tx ? chainTransactionFromJSON(sendTokenTransactionsJSON.send_tx) : null,
1260
+ confirmTx: sendTokenTransactionsJSON.confirm_tx ? chainTransactionFromJSON(sendTokenTransactionsJSON.confirm_tx) : null,
1261
+ executeTx: sendTokenTransactionsJSON.execute_tx ? chainTransactionFromJSON(sendTokenTransactionsJSON.execute_tx) : null,
1262
+ error: sendTokenTransactionsJSON.error
1263
+ };
1264
+ }
1265
+ function sendTokenTransactionsToJSON(sendTokenTransactions) {
1266
+ return {
1267
+ send_tx: sendTokenTransactions.sendTx ? chainTransactionToJSON(sendTokenTransactions.sendTx) : null,
1268
+ confirm_tx: sendTokenTransactions.confirmTx ? chainTransactionToJSON(sendTokenTransactions.confirmTx) : null,
1269
+ execute_tx: sendTokenTransactions.executeTx ? chainTransactionToJSON(sendTokenTransactions.executeTx) : null,
1270
+ error: sendTokenTransactions.error
1271
+ };
1272
+ }
1273
+ function contractCallWithTokenTransactionsFromJSON(value) {
1274
+ return {
1275
+ sendTx: value.send_tx ? chainTransactionFromJSON(value.send_tx) : null,
1276
+ gasPaidTx: value.gas_paid_tx ? chainTransactionFromJSON(value.gas_paid_tx) : null,
1277
+ confirmTx: value.confirm_tx ? chainTransactionFromJSON(value.confirm_tx) : null,
1278
+ approveTx: value.approve_tx ? chainTransactionFromJSON(value.approve_tx) : null,
1279
+ executeTx: value.execute_tx ? chainTransactionFromJSON(value.execute_tx) : null,
1280
+ error: value.error
1281
+ };
1282
+ }
1283
+ function contractCallWithTokenTransactionsToJSON(value) {
1284
+ return {
1285
+ send_tx: value.sendTx ? chainTransactionToJSON(value.sendTx) : null,
1286
+ gas_paid_tx: value.gasPaidTx ? chainTransactionToJSON(value.gasPaidTx) : null,
1287
+ confirm_tx: value.confirmTx ? chainTransactionToJSON(value.confirmTx) : null,
1288
+ approve_tx: value.approveTx ? chainTransactionToJSON(value.approveTx) : null,
1289
+ execute_tx: value.executeTx ? chainTransactionToJSON(value.executeTx) : null,
1290
+ error: value.error
1291
+ };
1292
+ }
1293
+ function axelarTransferTransactionsFromJSON(value) {
1294
+ if ("contract_call_with_token_txs" in value) {
1295
+ return {
1296
+ contractCallWithTokenTxs: contractCallWithTokenTransactionsFromJSON(
1297
+ value.contract_call_with_token_txs
1298
+ )
1299
+ };
1300
+ }
1301
+ return {
1302
+ sendTokenTxs: sendTokenTransactionsFromJSON(value.send_token_txs)
1303
+ };
1304
+ }
1305
+ function axelarTransferTransactionsToJSON(value) {
1306
+ if ("contractCallWithTokenTxs" in value) {
1307
+ return {
1308
+ contract_call_with_token_txs: contractCallWithTokenTransactionsToJSON(
1309
+ value.contractCallWithTokenTxs
1310
+ )
1311
+ };
1312
+ }
1313
+ return {
1314
+ send_token_txs: sendTokenTransactionsToJSON(value.sendTokenTxs)
1315
+ };
1316
+ }
1317
+ function axelarTransferInfoFromJSON(value) {
1318
+ return {
1319
+ fromChainID: value.from_chain_id,
1320
+ toChainID: value.to_chain_id,
1321
+ type: value.type,
1322
+ state: value.state,
1323
+ txs: value.txs && axelarTransferTransactionsFromJSON(value.txs),
1324
+ axelarScanLink: value.axelar_scan_link,
1325
+ srcChainID: value.src_chain_id,
1326
+ dstChainID: value.dst_chain_id
1327
+ };
1328
+ }
1329
+ function axelarTransferInfoToJSON(value) {
1330
+ return {
1331
+ from_chain_id: value.fromChainID,
1332
+ to_chain_id: value.toChainID,
1333
+ type: value.type,
1334
+ state: value.state,
1335
+ txs: value.txs && axelarTransferTransactionsToJSON(value.txs),
1336
+ axelar_scan_link: value.axelarScanLink,
1337
+ src_chain_id: value.srcChainID,
1338
+ dst_chain_id: value.dstChainID
1339
+ };
1340
+ }
1341
+ function transferEventFromJSON(value) {
1342
+ if ("ibc_transfer" in value) {
1343
+ return {
1344
+ ibcTransfer: transferInfoFromJSON(value.ibc_transfer)
1345
+ };
1346
+ }
1347
+ if ("cctp_transfer" in value) {
1348
+ return {
1349
+ cctpTransfer: cctpTransferInfoFromJSON(value.cctp_transfer)
1350
+ };
1351
+ }
1352
+ if ("hyperlane_transfer" in value) {
1353
+ return {
1354
+ hyperlaneTransfer: hyperlaneTransferInfoFromJSON(
1355
+ value.hyperlane_transfer
1356
+ )
1357
+ };
1358
+ }
1359
+ if ("op_init_transfer" in value) {
1360
+ return {
1361
+ opInitTransfer: opInitTransferInfoFromJSON(value.op_init_transfer)
1362
+ };
1363
+ }
1364
+ return {
1365
+ axelarTransfer: axelarTransferInfoFromJSON(value.axelar_transfer)
1366
+ };
1367
+ }
1368
+ function transferEventToJSON(value) {
1369
+ if ("ibcTransfer" in value) {
1370
+ return {
1371
+ ibc_transfer: transferInfoToJSON(value.ibcTransfer)
1372
+ };
1373
+ }
1374
+ if ("cctpTransfer" in value) {
1375
+ return {
1376
+ cctp_transfer: cctpTransferInfoToJSON(value.cctpTransfer)
1377
+ };
1378
+ }
1379
+ if ("hyperlaneTransfer" in value) {
1380
+ return {
1381
+ hyperlane_transfer: hyperlaneTransferInfoToJSON(value.hyperlaneTransfer)
1382
+ };
1383
+ }
1384
+ if ("opInitTransfer" in value) {
1385
+ return {
1386
+ op_init_transfer: opInitTransferInfoToJSON(value.opInitTransfer)
1387
+ };
1388
+ }
1389
+ return {
1390
+ axelar_transfer: axelarTransferInfoToJSON(value.axelarTransfer)
1391
+ };
1392
+ }
1393
+ function transferStatusFromJSON(value) {
1394
+ return {
1395
+ transferSequence: value.transfer_sequence.map(transferEventFromJSON),
1396
+ transferAssetRelease: value.transfer_asset_release && transferAssetReleaseFromJSON(value.transfer_asset_release),
1397
+ error: value.error,
1398
+ state: value.state,
1399
+ nextBlockingTransfer: value.next_blocking_transfer && nextBlockingTransferFromJSON(value.next_blocking_transfer)
1400
+ };
1401
+ }
1402
+ function transferStatusToJSON(value) {
1403
+ return {
1404
+ transfer_sequence: value.transferSequence.map(transferEventToJSON),
1405
+ transfer_asset_release: value.transferAssetRelease && transferAssetReleaseToJSON(value.transferAssetRelease),
1406
+ error: value.error,
1407
+ state: value.state,
1408
+ next_blocking_transfer: value.nextBlockingTransfer && nextBlockingTransferToJSON(value.nextBlockingTransfer)
1409
+ };
1410
+ }
1411
+ function denomWithChainIDFromJSON(value) {
1412
+ return {
1413
+ chainID: value.chain_id,
1414
+ denom: value.denom
1415
+ };
1416
+ }
1417
+ function denomWithChainIDToJSON(value) {
1418
+ return {
1419
+ chain_id: value.chainID,
1420
+ denom: value.denom
1421
+ };
1422
+ }
1423
+ function assetOrErrorFromJSON(value) {
1424
+ if ("asset" in value) {
1425
+ return { asset: assetFromJSON(value.asset) };
1426
+ }
1427
+ return { error: value.error };
1428
+ }
1429
+ function assetOrErrorToJSON(value) {
1430
+ if ("asset" in value) {
1431
+ return { asset: assetToJSON(value.asset) };
1432
+ }
1433
+ return { error: value.error };
1434
+ }
1435
+ function originAssetsRequestFromJSON(value) {
1436
+ return {
1437
+ assets: value.assets.map(denomWithChainIDFromJSON)
1438
+ };
1439
+ }
1440
+ function originAssetsRequestToJSON(value) {
1441
+ return {
1442
+ assets: value.assets.map(denomWithChainIDToJSON)
1443
+ };
1444
+ }
1445
+ function originAssetsResponseFromJSON(value) {
1446
+ return {
1447
+ originAssets: value.origin_assets.map(assetOrErrorFromJSON)
1448
+ };
1449
+ }
1450
+ function originAssetsResponseToJSON(value) {
1451
+ return {
1452
+ origin_assets: value.originAssets.map(assetOrErrorToJSON)
1453
+ };
1454
+ }
1455
+ function assetBetweenChainsFromJSON(value) {
1456
+ return {
1457
+ assetOnSource: assetFromJSON(value.asset_on_source),
1458
+ assetOnDest: assetFromJSON(value.asset_on_dest),
1459
+ txsRequired: value.txs_required,
1460
+ bridges: value.bridges
1461
+ };
1462
+ }
1463
+ function assetBetweenChainsToJSON(value) {
1464
+ return {
1465
+ asset_on_source: assetToJSON(value.assetOnSource),
1466
+ asset_on_dest: assetToJSON(value.assetOnDest),
1467
+ txs_required: value.txsRequired,
1468
+ bridges: value.bridges
1469
+ };
1470
+ }
1471
+ function assetsBetweenChainsRequestFromJSON(value) {
1472
+ return {
1473
+ sourceChainID: value.source_chain_id,
1474
+ destChainID: value.dest_chain_id,
1475
+ includeNoMetadataAssets: value.include_no_metadata_assets,
1476
+ includeCW20Assets: value.include_cw20_assets,
1477
+ includeEvmAssets: value.include_evm_assets,
1478
+ allowMultiTx: value.allow_multi_tx
1479
+ };
1480
+ }
1481
+ function assetsBetweenChainsRequestToJSON(value) {
1482
+ return {
1483
+ source_chain_id: value.sourceChainID,
1484
+ dest_chain_id: value.destChainID,
1485
+ include_no_metadata_assets: value.includeNoMetadataAssets,
1486
+ include_cw20_assets: value.includeCW20Assets,
1487
+ include_evm_assets: value.includeEvmAssets,
1488
+ allow_multi_tx: value.allowMultiTx
1489
+ };
1490
+ }
1491
+ function assetsBetweenChainsResponseFromJSON(value) {
1492
+ return {
1493
+ assetsBetweenChains: value.assets_between_chains.map(
1494
+ assetBetweenChainsFromJSON
1495
+ )
1496
+ };
1497
+ }
1498
+ function assetRecommendationRequestFromJSON(value) {
1499
+ return {
1500
+ sourceAssetDenom: value.source_asset_denom,
1501
+ sourceAssetChainID: value.source_asset_chain_id,
1502
+ destChainID: value.dest_chain_id,
1503
+ reason: value.reason
1504
+ };
1505
+ }
1506
+ function assetRecommendationRequestToJSON(value) {
1507
+ return {
1508
+ source_asset_denom: value.sourceAssetDenom,
1509
+ source_asset_chain_id: value.sourceAssetChainID,
1510
+ dest_chain_id: value.destChainID,
1511
+ reason: value.reason
1512
+ };
1513
+ }
1514
+ function bridgesResponseFromJSON(value) {
1515
+ return {
1516
+ bridges: value.bridges.map(bridgeFromJSON)
1517
+ };
1518
+ }
1519
+ function bridgesResponseToJSON(value) {
1520
+ return {
1521
+ bridges: value.bridges.map(bridgeToJSON)
1522
+ };
1523
+ }
1524
+ function bridgeFromJSON(value) {
1525
+ return {
1526
+ id: value.id,
1527
+ name: value.name,
1528
+ logoURI: value.logo_uri
1529
+ };
1530
+ }
1531
+ function bridgeToJSON(value) {
1532
+ return {
1533
+ id: value.id,
1534
+ name: value.name,
1535
+ logo_uri: value.logoURI
1536
+ };
1537
+ }
1538
+ function cctpTransferTransactionsFromJSON(value) {
1539
+ return {
1540
+ sendTx: value.send_tx ? chainTransactionFromJSON(value.send_tx) : null,
1541
+ receiveTx: value.receive_tx ? chainTransactionFromJSON(value.receive_tx) : null
1542
+ };
1543
+ }
1544
+ function cctpTransferTransactionsToJSON(value) {
1545
+ return {
1546
+ send_tx: value.sendTx ? chainTransactionToJSON(value.sendTx) : null,
1547
+ receive_tx: value.receiveTx ? chainTransactionToJSON(value.receiveTx) : null
1548
+ };
1549
+ }
1550
+ function cctpTransferInfoFromJSON(value) {
1551
+ return {
1552
+ fromChainID: value.from_chain_id,
1553
+ toChainID: value.to_chain_id,
1554
+ state: value.state,
1555
+ txs: value.txs && cctpTransferTransactionsFromJSON(value.txs),
1556
+ srcChainID: value.src_chain_id,
1557
+ dstChainID: value.dst_chain_id
1558
+ };
1559
+ }
1560
+ function cctpTransferInfoToJSON(value) {
1561
+ return {
1562
+ from_chain_id: value.fromChainID,
1563
+ to_chain_id: value.toChainID,
1564
+ state: value.state,
1565
+ txs: value.txs && cctpTransferTransactionsToJSON(value.txs),
1566
+ src_chain_id: value.srcChainID,
1567
+ dst_chain_id: value.dstChainID
1568
+ };
1569
+ }
1570
+ function hyperlaneTransferTransactionsFromJSON(value) {
1571
+ return {
1572
+ sendTx: value.send_tx ? chainTransactionFromJSON(value.send_tx) : null,
1573
+ receiveTx: value.receive_tx ? chainTransactionFromJSON(value.receive_tx) : null
1574
+ };
1575
+ }
1576
+ function hyperlaneTransferTransactionsToJSON(value) {
1577
+ return {
1578
+ send_tx: value.sendTx ? chainTransactionToJSON(value.sendTx) : null,
1579
+ receive_tx: value.receiveTx ? chainTransactionToJSON(value.receiveTx) : null
1580
+ };
1581
+ }
1582
+ function hyperlaneTransferInfoFromJSON(value) {
1583
+ return {
1584
+ fromChainID: value.from_chain_id,
1585
+ toChainID: value.to_chain_id,
1586
+ state: value.state,
1587
+ txs: value.txs && hyperlaneTransferTransactionsFromJSON(value.txs)
1588
+ };
1589
+ }
1590
+ function hyperlaneTransferInfoToJSON(value) {
1591
+ return {
1592
+ from_chain_id: value.fromChainID,
1593
+ to_chain_id: value.toChainID,
1594
+ state: value.state,
1595
+ txs: value.txs && hyperlaneTransferTransactionsToJSON(value.txs)
1596
+ };
1597
+ }
1598
+ function opInitTransferTransactionsFromJSON(value) {
1599
+ return {
1600
+ sendTx: value.send_tx ? chainTransactionFromJSON(value.send_tx) : null,
1601
+ receiveTx: value.receive_tx ? chainTransactionFromJSON(value.receive_tx) : null
1602
+ };
1603
+ }
1604
+ function opInitTransferTransactionsToJSON(value) {
1605
+ return {
1606
+ send_tx: value.sendTx ? chainTransactionToJSON(value.sendTx) : null,
1607
+ receive_tx: value.receiveTx ? chainTransactionToJSON(value.receiveTx) : null
1608
+ };
1609
+ }
1610
+ function opInitTransferInfoFromJSON(value) {
1611
+ return {
1612
+ fromChainID: value.from_chain_id,
1613
+ toChainID: value.to_chain_id,
1614
+ state: value.state,
1615
+ txs: value.txs && opInitTransferTransactionsFromJSON(value.txs)
1616
+ };
1617
+ }
1618
+ function opInitTransferInfoToJSON(value) {
1619
+ return {
1620
+ from_chain_id: value.fromChainID,
1621
+ to_chain_id: value.toChainID,
1622
+ state: value.state,
1623
+ txs: value.txs && opInitTransferTransactionsToJSON(value.txs)
1624
+ };
1625
+ }
1626
+ function msgsDirectRequestFromJSON(msgDirectRequestJSON) {
1627
+ var _a;
1628
+ return {
1629
+ sourceAssetDenom: msgDirectRequestJSON.source_asset_denom,
1630
+ sourceAssetChainID: msgDirectRequestJSON.source_asset_chain_id,
1631
+ destAssetDenom: msgDirectRequestJSON.dest_asset_denom,
1632
+ destAssetChainID: msgDirectRequestJSON.dest_asset_chain_id,
1633
+ amountIn: msgDirectRequestJSON.amount_in,
1634
+ amountOut: msgDirectRequestJSON.amount_out,
1635
+ chainIdsToAddresses: msgDirectRequestJSON.chain_ids_to_addresses,
1636
+ slippageTolerancePercent: msgDirectRequestJSON.slippage_tolerance_percent,
1637
+ affiliates: (_a = msgDirectRequestJSON.affiliates) == null ? void 0 : _a.map(affiliateFromJSON),
1638
+ chainIDsToAffiliates: msgDirectRequestJSON.chain_ids_to_affiliates ? chainIDsToAffiliatesMapFromJSON(
1639
+ msgDirectRequestJSON.chain_ids_to_affiliates
1640
+ ) : void 0,
1641
+ timeoutSeconds: msgDirectRequestJSON.timeout_seconds,
1642
+ postRouteHandler: msgDirectRequestJSON.post_route_handler && postHandlerFromJSON(msgDirectRequestJSON.post_route_handler),
1643
+ swapVenue: msgDirectRequestJSON.swap_venue && swapVenueFromJSON(msgDirectRequestJSON.swap_venue),
1644
+ swapVenues: msgDirectRequestJSON.swap_venues && msgDirectRequestJSON.swap_venues.map(swapVenueFromJSON),
1645
+ smartRelay: msgDirectRequestJSON.smart_relay,
1646
+ smartSwapOptions: msgDirectRequestJSON.smart_swap_options ? smartSwapOptionsFromJSON(msgDirectRequestJSON.smart_swap_options) : void 0,
1647
+ allowSwaps: msgDirectRequestJSON.allow_swaps,
1648
+ enableGasWarnings: msgDirectRequestJSON.enable_gas_warnings
1649
+ };
1650
+ }
1651
+ function msgsDirectRequestToJSON(msgDirectRequest) {
1652
+ var _a;
1653
+ return {
1654
+ source_asset_denom: msgDirectRequest.sourceAssetDenom,
1655
+ source_asset_chain_id: msgDirectRequest.sourceAssetChainID,
1656
+ dest_asset_denom: msgDirectRequest.destAssetDenom,
1657
+ dest_asset_chain_id: msgDirectRequest.destAssetChainID,
1658
+ amount_in: msgDirectRequest.amountIn,
1659
+ amount_out: msgDirectRequest.amountOut,
1660
+ chain_ids_to_addresses: msgDirectRequest.chainIdsToAddresses,
1661
+ slippage_tolerance_percent: msgDirectRequest.slippageTolerancePercent,
1662
+ affiliates: (_a = msgDirectRequest.affiliates) == null ? void 0 : _a.map(affiliateToJSON),
1663
+ chain_ids_to_affiliates: msgDirectRequest.chainIDsToAffiliates ? chainIDsToAffiliatesMapToJSON(msgDirectRequest.chainIDsToAffiliates) : void 0,
1664
+ allow_multi_tx: msgDirectRequest.allowMultiTx,
1665
+ allow_unsafe: msgDirectRequest.allowUnsafe,
1666
+ bridges: msgDirectRequest.bridges,
1667
+ timeout_seconds: msgDirectRequest.timeoutSeconds,
1668
+ experimental_features: msgDirectRequest.experimentalFeatures,
1669
+ swap_venue: msgDirectRequest.swapVenue && swapVenueToJSON(msgDirectRequest.swapVenue),
1670
+ swap_venues: msgDirectRequest.swapVenues && msgDirectRequest.swapVenues.map(swapVenueToJSON),
1671
+ post_route_handler: msgDirectRequest.postRouteHandler && postHandlerToJSON(msgDirectRequest.postRouteHandler),
1672
+ smart_relay: msgDirectRequest.smartRelay,
1673
+ smart_swap_options: msgDirectRequest.smartSwapOptions ? smartSwapOptionsToJSON(msgDirectRequest.smartSwapOptions) : void 0,
1674
+ allow_swaps: msgDirectRequest.allowSwaps,
1675
+ enable_gas_warnings: msgDirectRequest.enableGasWarnings
1676
+ };
1677
+ }
1678
+ function smartSwapOptionsFromJSON(smartSwapOptionsJSON) {
1679
+ return {
1680
+ splitRoutes: Boolean(smartSwapOptionsJSON.split_routes),
1681
+ evmSwaps: Boolean(smartSwapOptionsJSON.evm_swaps)
1682
+ };
1683
+ }
1684
+ function smartSwapOptionsToJSON(smartSwapOptions) {
1685
+ return {
1686
+ split_routes: Boolean(smartSwapOptions.splitRoutes),
1687
+ evm_swaps: Boolean(smartSwapOptions.evmSwaps)
1688
+ };
1689
+ }
1690
+ function chainIDsToAffiliatesMapFromJSON(value) {
1691
+ const result = {};
1692
+ for (const key of Object.keys(value)) {
1693
+ result[key] = chainAffiliatesFromJSON(value[key]);
1694
+ }
1695
+ return result;
1696
+ }
1697
+ function chainIDsToAffiliatesMapToJSON(value) {
1698
+ const result = {};
1699
+ for (const key of Object.keys(value)) {
1700
+ result[key] = chainAffiliatesToJSON(value[key]);
1701
+ }
1702
+ return result;
1703
+ }
1704
+ function chainAffiliatesFromJSON(value) {
1705
+ return {
1706
+ affiliates: value.affiliates.map(affiliateFromJSON)
1707
+ };
1708
+ }
1709
+ function chainAffiliatesToJSON(value) {
1710
+ return {
1711
+ affiliates: value.affiliates.map(affiliateToJSON)
1712
+ };
1713
+ }
1714
+
1715
+ exports.affiliateFromJSON = affiliateFromJSON;
1716
+ exports.affiliateToJSON = affiliateToJSON;
1717
+ exports.assetBetweenChainsFromJSON = assetBetweenChainsFromJSON;
1718
+ exports.assetBetweenChainsToJSON = assetBetweenChainsToJSON;
1719
+ exports.assetFromJSON = assetFromJSON;
1720
+ exports.assetOrErrorFromJSON = assetOrErrorFromJSON;
1721
+ exports.assetOrErrorToJSON = assetOrErrorToJSON;
1722
+ exports.assetRecommendationFromJSON = assetRecommendationFromJSON;
1723
+ exports.assetRecommendationRequestFromJSON = assetRecommendationRequestFromJSON;
1724
+ exports.assetRecommendationRequestToJSON = assetRecommendationRequestToJSON;
1725
+ exports.assetRecommendationToJSON = assetRecommendationToJSON;
1726
+ exports.assetToJSON = assetToJSON;
1727
+ exports.assetsBetweenChainsRequestFromJSON = assetsBetweenChainsRequestFromJSON;
1728
+ exports.assetsBetweenChainsRequestToJSON = assetsBetweenChainsRequestToJSON;
1729
+ exports.assetsBetweenChainsResponseFromJSON = assetsBetweenChainsResponseFromJSON;
1730
+ exports.assetsFromSourceRequestFromJSON = assetsFromSourceRequestFromJSON;
1731
+ exports.assetsFromSourceRequestToJSON = assetsFromSourceRequestToJSON;
1732
+ exports.assetsRequestFromJSON = assetsRequestFromJSON;
1733
+ exports.assetsRequestToJSON = assetsRequestToJSON;
1734
+ exports.axelarTransferFromJSON = axelarTransferFromJSON;
1735
+ exports.axelarTransferInfoFromJSON = axelarTransferInfoFromJSON;
1736
+ exports.axelarTransferInfoToJSON = axelarTransferInfoToJSON;
1737
+ exports.axelarTransferToJSON = axelarTransferToJSON;
1738
+ exports.axelarTransferTransactionsFromJSON = axelarTransferTransactionsFromJSON;
1739
+ exports.axelarTransferTransactionsToJSON = axelarTransferTransactionsToJSON;
1740
+ exports.bankSendFromJSON = bankSendFromJSON;
1741
+ exports.bankSendToJSON = bankSendToJSON;
1742
+ exports.bridgeFromJSON = bridgeFromJSON;
1743
+ exports.bridgeToJSON = bridgeToJSON;
1744
+ exports.bridgesResponseFromJSON = bridgesResponseFromJSON;
1745
+ exports.bridgesResponseToJSON = bridgesResponseToJSON;
1746
+ exports.cctpTransferFromJSON = cctpTransferFromJSON;
1747
+ exports.cctpTransferInfoFromJSON = cctpTransferInfoFromJSON;
1748
+ exports.cctpTransferInfoToJSON = cctpTransferInfoToJSON;
1749
+ exports.cctpTransferToJSON = cctpTransferToJSON;
1750
+ exports.cctpTransferTransactionsFromJSON = cctpTransferTransactionsFromJSON;
1751
+ exports.cctpTransferTransactionsToJSON = cctpTransferTransactionsToJSON;
1752
+ exports.chainAffiliatesFromJSON = chainAffiliatesFromJSON;
1753
+ exports.chainAffiliatesToJSON = chainAffiliatesToJSON;
1754
+ exports.chainFromJSON = chainFromJSON;
1755
+ exports.chainIDsToAffiliatesMapFromJSON = chainIDsToAffiliatesMapFromJSON;
1756
+ exports.chainIDsToAffiliatesMapToJSON = chainIDsToAffiliatesMapToJSON;
1757
+ exports.chainToJSON = chainToJSON;
1758
+ exports.chainTransactionFromJSON = chainTransactionFromJSON;
1759
+ exports.chainTransactionToJSON = chainTransactionToJSON;
1760
+ exports.contractCallWithTokenTransactionsFromJSON = contractCallWithTokenTransactionsFromJSON;
1761
+ exports.contractCallWithTokenTransactionsToJSON = contractCallWithTokenTransactionsToJSON;
1762
+ exports.cosmWasmContractMsgFromJSON = cosmWasmContractMsgFromJSON;
1763
+ exports.cosmWasmContractMsgToJSON = cosmWasmContractMsgToJSON;
1764
+ exports.cosmosMsgFromJSON = cosmosMsgFromJSON;
1765
+ exports.cosmosMsgToJSON = cosmosMsgToJSON;
1766
+ exports.cosmosTxFromJSON = cosmosTxFromJSON;
1767
+ exports.cosmosTxToJSON = cosmosTxToJSON;
1768
+ exports.denomWithChainIDFromJSON = denomWithChainIDFromJSON;
1769
+ exports.denomWithChainIDToJSON = denomWithChainIDToJSON;
1770
+ exports.erc20ApprovalFromJSON = erc20ApprovalFromJSON;
1771
+ exports.erc20ApprovalToJSON = erc20ApprovalToJSON;
1772
+ exports.estimatedFeeFromJSON = estimatedFeeFromJSON;
1773
+ exports.estimatedFeeToJSON = estimatedFeeToJSON;
1774
+ exports.evmSwapFromJSON = evmSwapFromJSON;
1775
+ exports.evmSwapToJSON = evmSwapToJSON;
1776
+ exports.evmTxFromJSON = evmTxFromJSON;
1777
+ exports.evmTxToJSON = evmTxToJSON;
1778
+ exports.feeAssetFromJSON = feeAssetFromJSON;
1779
+ exports.feeAssetToJSON = feeAssetToJSON;
1780
+ exports.hyperlaneTransferFromJSON = hyperlaneTransferFromJSON;
1781
+ exports.hyperlaneTransferInfoFromJSON = hyperlaneTransferInfoFromJSON;
1782
+ exports.hyperlaneTransferInfoToJSON = hyperlaneTransferInfoToJSON;
1783
+ exports.hyperlaneTransferToJSON = hyperlaneTransferToJSON;
1784
+ exports.hyperlaneTransferTransactionsFromJSON = hyperlaneTransferTransactionsFromJSON;
1785
+ exports.hyperlaneTransferTransactionsToJSON = hyperlaneTransferTransactionsToJSON;
1786
+ exports.ibcAddressFromJSON = ibcAddressFromJSON;
1787
+ exports.ibcAddressToJSON = ibcAddressToJSON;
1788
+ exports.ibcCapabilitiesFromJSON = ibcCapabilitiesFromJSON;
1789
+ exports.ibcCapabilitiesToJSON = ibcCapabilitiesToJSON;
1790
+ exports.messageResponseFromJSON = messageResponseFromJSON;
1791
+ exports.msgFromJSON = msgFromJSON;
1792
+ exports.msgToJSON = msgToJSON;
1793
+ exports.msgsDirectRequestFromJSON = msgsDirectRequestFromJSON;
1794
+ exports.msgsDirectRequestToJSON = msgsDirectRequestToJSON;
1795
+ exports.msgsRequestFromJSON = msgsRequestFromJSON;
1796
+ exports.msgsRequestToJSON = msgsRequestToJSON;
1797
+ exports.multiChainMsgFromJSON = multiChainMsgFromJSON;
1798
+ exports.multiChainMsgToJSON = multiChainMsgToJSON;
1799
+ exports.nextBlockingTransferFromJSON = nextBlockingTransferFromJSON;
1800
+ exports.nextBlockingTransferToJSON = nextBlockingTransferToJSON;
1801
+ exports.opInitTransferFromJSON = opInitTransferFromJSON;
1802
+ exports.opInitTransferInfoFromJSON = opInitTransferInfoFromJSON;
1803
+ exports.opInitTransferInfoToJSON = opInitTransferInfoToJSON;
1804
+ exports.opInitTransferToJSON = opInitTransferToJSON;
1805
+ exports.opInitTransferTransactionsFromJSON = opInitTransferTransactionsFromJSON;
1806
+ exports.opInitTransferTransactionsToJSON = opInitTransferTransactionsToJSON;
1807
+ exports.operationFromJSON = operationFromJSON;
1808
+ exports.operationToJSON = operationToJSON;
1809
+ exports.originAssetsRequestFromJSON = originAssetsRequestFromJSON;
1810
+ exports.originAssetsRequestToJSON = originAssetsRequestToJSON;
1811
+ exports.originAssetsResponseFromJSON = originAssetsResponseFromJSON;
1812
+ exports.originAssetsResponseToJSON = originAssetsResponseToJSON;
1813
+ exports.packetFromJSON = packetFromJSON;
1814
+ exports.packetToJSON = packetToJSON;
1815
+ exports.postHandlerFromJSON = postHandlerFromJSON;
1816
+ exports.postHandlerToJSON = postHandlerToJSON;
1817
+ exports.recommendAssetsRequestFromJSON = recommendAssetsRequestFromJSON;
1818
+ exports.recommendAssetsRequestToJSON = recommendAssetsRequestToJSON;
1819
+ exports.recommendAssetsResponseFromJSON = recommendAssetsResponseFromJSON;
1820
+ exports.recommendAssetsResponseToJSON = recommendAssetsResponseToJSON;
1821
+ exports.recommendationEntryFromJSON = recommendationEntryFromJSON;
1822
+ exports.recommendationEntryToJSON = recommendationEntryToJSON;
1823
+ exports.routeRequestFromJSON = routeRequestFromJSON;
1824
+ exports.routeRequestToJSON = routeRequestToJSON;
1825
+ exports.routeResponseFromJSON = routeResponseFromJSON;
1826
+ exports.routeResponseToJSON = routeResponseToJSON;
1827
+ exports.sendTokenTransactionsFromJSON = sendTokenTransactionsFromJSON;
1828
+ exports.sendTokenTransactionsToJSON = sendTokenTransactionsToJSON;
1829
+ exports.smartSwapExactCoinInFromJSON = smartSwapExactCoinInFromJSON;
1830
+ exports.smartSwapExactCoinInToJSON = smartSwapExactCoinInToJSON;
1831
+ exports.smartSwapOptionsFromJSON = smartSwapOptionsFromJSON;
1832
+ exports.smartSwapOptionsToJSON = smartSwapOptionsToJSON;
1833
+ exports.submitTxRequestFromJSON = submitTxRequestFromJSON;
1834
+ exports.submitTxRequestToJSON = submitTxRequestToJSON;
1835
+ exports.submitTxResponseFromJSON = submitTxResponseFromJSON;
1836
+ exports.submitTxResponseToJSON = submitTxResponseToJSON;
1837
+ exports.svmTxFromJSON = svmTxFromJSON;
1838
+ exports.svmTxToJSON = svmTxToJSON;
1839
+ exports.swapExactCoinInFromJSON = swapExactCoinInFromJSON;
1840
+ exports.swapExactCoinInToJSON = swapExactCoinInToJSON;
1841
+ exports.swapExactCoinOutFromJSON = swapExactCoinOutFromJSON;
1842
+ exports.swapExactCoinOutToJSON = swapExactCoinOutToJSON;
1843
+ exports.swapFromJSON = swapFromJSON;
1844
+ exports.swapOperationFromJSON = swapOperationFromJSON;
1845
+ exports.swapOperationToJSON = swapOperationToJSON;
1846
+ exports.swapRouteFromJSON = swapRouteFromJSON;
1847
+ exports.swapRouteToJSON = swapRouteToJSON;
1848
+ exports.swapToJSON = swapToJSON;
1849
+ exports.swapVenueFromJSON = swapVenueFromJSON;
1850
+ exports.swapVenueRequestFromJSON = swapVenueRequestFromJSON;
1851
+ exports.swapVenueRequestToJSON = swapVenueRequestToJSON;
1852
+ exports.swapVenueToJSON = swapVenueToJSON;
1853
+ exports.trackTxRequestFromJSON = trackTxRequestFromJSON;
1854
+ exports.trackTxRequestToJSON = trackTxRequestToJSON;
1855
+ exports.trackTxResponseFromJSON = trackTxResponseFromJSON;
1856
+ exports.trackTxResponseToJSON = trackTxResponseToJSON;
1857
+ exports.transferAssetReleaseFromJSON = transferAssetReleaseFromJSON;
1858
+ exports.transferAssetReleaseToJSON = transferAssetReleaseToJSON;
1859
+ exports.transferEventFromJSON = transferEventFromJSON;
1860
+ exports.transferEventToJSON = transferEventToJSON;
1861
+ exports.transferFromJSON = transferFromJSON;
1862
+ exports.transferInfoFromJSON = transferInfoFromJSON;
1863
+ exports.transferInfoToJSON = transferInfoToJSON;
1864
+ exports.transferStatusFromJSON = transferStatusFromJSON;
1865
+ exports.transferStatusToJSON = transferStatusToJSON;
1866
+ exports.transferToJSON = transferToJSON;
1867
+ exports.txFromJSON = txFromJSON;
1868
+ exports.txStatusRequestFromJSON = txStatusRequestFromJSON;
1869
+ exports.txStatusRequestToJSON = txStatusRequestToJSON;
1870
+ exports.txStatusResponseFromJSON = txStatusResponseFromJSON;
1871
+ exports.txStatusResponseToJSON = txStatusResponseToJSON;
1872
+ exports.txToJSON = txToJSON;