@paraspell/sdk 5.10.0 → 6.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -643,6 +643,34 @@ var Kusama$1 = {
643
643
  otherAssets: [
644
644
  ]
645
645
  };
646
+ var Polimec$3 = {
647
+ paraId: 3344,
648
+ relayChainAssetSymbol: "DOT",
649
+ nativeAssetSymbol: "PLMC",
650
+ nativeAssets: [
651
+ {
652
+ symbol: "PLMC",
653
+ decimals: 10
654
+ }
655
+ ],
656
+ otherAssets: [
657
+ {
658
+ assetId: "10",
659
+ symbol: "DOT",
660
+ decimals: 10
661
+ },
662
+ {
663
+ assetId: "1984",
664
+ symbol: "USDt",
665
+ decimals: 6
666
+ },
667
+ {
668
+ assetId: "1337",
669
+ symbol: "USDC",
670
+ decimals: 6
671
+ }
672
+ ]
673
+ };
646
674
  var Acala$3 = {
647
675
  paraId: 2000,
648
676
  relayChainAssetSymbol: "DOT",
@@ -1858,6 +1886,11 @@ var Moonbeam$3 = {
1858
1886
  symbol: "PDEX",
1859
1887
  decimals: 12
1860
1888
  },
1889
+ {
1890
+ assetId: "178794693648360392906933130845919698647",
1891
+ symbol: "WETH.e",
1892
+ decimals: 18
1893
+ },
1861
1894
  {
1862
1895
  assetId: "314077021455772878282433861213184736939",
1863
1896
  symbol: "PEAQ",
@@ -1883,6 +1916,11 @@ var Moonbeam$3 = {
1883
1916
  symbol: "EQD",
1884
1917
  decimals: 9
1885
1918
  },
1919
+ {
1920
+ assetId: "124105859028862849477017063633156007283",
1921
+ symbol: "wstETH.e",
1922
+ decimals: 18
1923
+ },
1886
1924
  {
1887
1925
  assetId: "69606720909260275826784788104880799692",
1888
1926
  symbol: "HDX",
@@ -1918,6 +1956,11 @@ var Moonbeam$3 = {
1918
1956
  symbol: "LDOT",
1919
1957
  decimals: 10
1920
1958
  },
1959
+ {
1960
+ assetId: "36282181791341254438422467838694599751",
1961
+ symbol: "WBTC.e",
1962
+ decimals: 8
1963
+ },
1921
1964
  {
1922
1965
  assetId: "124463719055550872076363892993240202694",
1923
1966
  symbol: "DED",
@@ -2261,6 +2304,10 @@ var AssetHubPolkadot$3 = {
2261
2304
  {
2262
2305
  symbol: "DOT",
2263
2306
  decimals: 10
2307
+ },
2308
+ {
2309
+ symbol: "KSM",
2310
+ decimals: 12
2264
2311
  }
2265
2312
  ],
2266
2313
  otherAssets: [
@@ -2279,6 +2326,11 @@ var AssetHubPolkadot$3 = {
2279
2326
  symbol: "TOM",
2280
2327
  decimals: 10
2281
2328
  },
2329
+ {
2330
+ assetId: "22222087",
2331
+ symbol: "KAIBYO",
2332
+ decimals: 12
2333
+ },
2282
2334
  {
2283
2335
  assetId: "20090142",
2284
2336
  symbol: "ELONA",
@@ -2354,6 +2406,11 @@ var AssetHubPolkadot$3 = {
2354
2406
  symbol: "GABE",
2355
2407
  decimals: 20
2356
2408
  },
2409
+ {
2410
+ assetId: "50000003",
2411
+ symbol: "ARMY",
2412
+ decimals: 12
2413
+ },
2357
2414
  {
2358
2415
  assetId: "47",
2359
2416
  symbol: "TeMe6Pump",
@@ -2394,6 +2451,11 @@ var AssetHubPolkadot$3 = {
2394
2451
  symbol: "COKE",
2395
2452
  decimals: 12
2396
2453
  },
2454
+ {
2455
+ assetId: "22222079",
2456
+ symbol: "GR",
2457
+ decimals: 12
2458
+ },
2397
2459
  {
2398
2460
  assetId: "20090110",
2399
2461
  symbol: "test1",
@@ -2439,6 +2501,11 @@ var AssetHubPolkadot$3 = {
2439
2501
  symbol: "USDT",
2440
2502
  decimals: 16
2441
2503
  },
2504
+ {
2505
+ assetId: "22222084",
2506
+ symbol: "SOPHIA",
2507
+ decimals: 12
2508
+ },
2442
2509
  {
2443
2510
  assetId: "22222008",
2444
2511
  symbol: "ALIEN",
@@ -2469,6 +2536,11 @@ var AssetHubPolkadot$3 = {
2469
2536
  symbol: "SAX",
2470
2537
  decimals: 2
2471
2538
  },
2539
+ {
2540
+ assetId: "50000000",
2541
+ symbol: "AGA",
2542
+ decimals: 12
2543
+ },
2472
2544
  {
2473
2545
  assetId: "22222064",
2474
2546
  symbol: "RIDEMY",
@@ -2574,6 +2646,11 @@ var AssetHubPolkadot$3 = {
2574
2646
  symbol: "Shit",
2575
2647
  decimals: 12
2576
2648
  },
2649
+ {
2650
+ assetId: "50000002",
2651
+ symbol: "NYBORG",
2652
+ decimals: 12
2653
+ },
2577
2654
  {
2578
2655
  assetId: "99",
2579
2656
  symbol: "Cypress",
@@ -2954,6 +3031,16 @@ var AssetHubPolkadot$3 = {
2954
3031
  symbol: "PMATIC",
2955
3032
  decimals: 10
2956
3033
  },
3034
+ {
3035
+ assetId: "3164",
3036
+ symbol: "TTT",
3037
+ decimals: 3
3038
+ },
3039
+ {
3040
+ assetId: "1828",
3041
+ symbol: "CPLS",
3042
+ decimals: 10
3043
+ },
2957
3044
  {
2958
3045
  assetId: "20090116",
2959
3046
  symbol: "POO",
@@ -2969,6 +3056,11 @@ var AssetHubPolkadot$3 = {
2969
3056
  symbol: "GIT",
2970
3057
  decimals: 12
2971
3058
  },
3059
+ {
3060
+ assetId: "1810",
3061
+ symbol: "TSTD",
3062
+ decimals: 6
3063
+ },
2972
3064
  {
2973
3065
  assetId: "20090129",
2974
3066
  symbol: "FCD",
@@ -2999,11 +3091,6 @@ var AssetHubPolkadot$3 = {
2999
3091
  symbol: "HTG",
3000
3092
  decimals: 10
3001
3093
  },
3002
- {
3003
- assetId: "12746",
3004
- symbol: "TTTT",
3005
- decimals: 6
3006
- },
3007
3094
  {
3008
3095
  assetId: "32",
3009
3096
  symbol: "CLAY",
@@ -3075,9 +3162,14 @@ var AssetHubPolkadot$3 = {
3075
3162
  decimals: 9
3076
3163
  },
3077
3164
  {
3078
- assetId: "1994",
3079
- symbol: "CRT",
3080
- decimals: 4
3165
+ assetId: "5361",
3166
+ symbol: "NAT",
3167
+ decimals: 10
3168
+ },
3169
+ {
3170
+ assetId: "50000001",
3171
+ symbol: "PHU",
3172
+ decimals: 12
3081
3173
  },
3082
3174
  {
3083
3175
  assetId: "2829",
@@ -3199,6 +3291,11 @@ var AssetHubPolkadot$3 = {
3199
3291
  symbol: "DOTC",
3200
3292
  decimals: 10
3201
3293
  },
3294
+ {
3295
+ assetId: "22222082",
3296
+ symbol: "Ax",
3297
+ decimals: 12
3298
+ },
3202
3299
  {
3203
3300
  assetId: "20090103",
3204
3301
  symbol: "BTC",
@@ -3209,6 +3306,11 @@ var AssetHubPolkadot$3 = {
3209
3306
  symbol: "NOTDED",
3210
3307
  decimals: 10
3211
3308
  },
3309
+ {
3310
+ assetId: "22222085",
3311
+ symbol: "ANU",
3312
+ decimals: 12
3313
+ },
3212
3314
  {
3213
3315
  assetId: "20090124",
3214
3316
  symbol: "test1",
@@ -3299,6 +3401,11 @@ var AssetHubPolkadot$3 = {
3299
3401
  symbol: "LURPIS",
3300
3402
  decimals: 12
3301
3403
  },
3404
+ {
3405
+ assetId: "22222088",
3406
+ symbol: "KOYM",
3407
+ decimals: 12
3408
+ },
3302
3409
  {
3303
3410
  assetId: "22222066",
3304
3411
  symbol: "DUW",
@@ -3394,6 +3501,11 @@ var AssetHubPolkadot$3 = {
3394
3501
  symbol: "HYDRA",
3395
3502
  decimals: 10
3396
3503
  },
3504
+ {
3505
+ assetId: "22222080",
3506
+ symbol: "GREEN",
3507
+ decimals: 12
3508
+ },
3397
3509
  {
3398
3510
  assetId: "22222057",
3399
3511
  symbol: "DIO",
@@ -3404,6 +3516,11 @@ var AssetHubPolkadot$3 = {
3404
3516
  symbol: "DOGE",
3405
3517
  decimals: 6
3406
3518
  },
3519
+ {
3520
+ assetId: "8277",
3521
+ symbol: "KH5usdt",
3522
+ decimals: 20
3523
+ },
3407
3524
  {
3408
3525
  assetId: "59",
3409
3526
  symbol: "OK",
@@ -3414,6 +3531,11 @@ var AssetHubPolkadot$3 = {
3414
3531
  symbol: "HOOT",
3415
3532
  decimals: 6
3416
3533
  },
3534
+ {
3535
+ assetId: "22222083",
3536
+ symbol: "TAG",
3537
+ decimals: 12
3538
+ },
3417
3539
  {
3418
3540
  assetId: "20090125",
3419
3541
  symbol: "PP",
@@ -3429,11 +3551,6 @@ var AssetHubPolkadot$3 = {
3429
3551
  symbol: "NaCl",
3430
3552
  decimals: 12
3431
3553
  },
3432
- {
3433
- assetId: "2567",
3434
- symbol: "TSTRM",
3435
- decimals: 6
3436
- },
3437
3554
  {
3438
3555
  assetId: "51",
3439
3556
  symbol: "JAMA",
@@ -3494,6 +3611,11 @@ var AssetHubPolkadot$3 = {
3494
3611
  symbol: "PIGS",
3495
3612
  decimals: 12
3496
3613
  },
3614
+ {
3615
+ assetId: "22222086",
3616
+ symbol: "BIFF",
3617
+ decimals: 12
3618
+ },
3497
3619
  {
3498
3620
  assetId: "60",
3499
3621
  symbol: "ANT",
@@ -3631,7 +3753,7 @@ var AssetHubPolkadot$3 = {
3631
3753
  },
3632
3754
  {
3633
3755
  assetId: "112233",
3634
- symbol: "MTA",
3756
+ symbol: "MTC",
3635
3757
  decimals: 10
3636
3758
  },
3637
3759
  {
@@ -3649,6 +3771,11 @@ var AssetHubPolkadot$3 = {
3649
3771
  symbol: "KRAK",
3650
3772
  decimals: 10
3651
3773
  },
3774
+ {
3775
+ assetId: "1148",
3776
+ symbol: "NT2",
3777
+ decimals: 10
3778
+ },
3652
3779
  {
3653
3780
  assetId: "25",
3654
3781
  symbol: "T54",
@@ -3784,6 +3911,11 @@ var AssetHubPolkadot$3 = {
3784
3911
  symbol: "DDOT",
3785
3912
  decimals: 12
3786
3913
  },
3914
+ {
3915
+ assetId: "6594",
3916
+ symbol: "MVPW",
3917
+ decimals: 3
3918
+ },
3787
3919
  {
3788
3920
  assetId: "660301",
3789
3921
  symbol: "GRL",
@@ -3814,6 +3946,11 @@ var AssetHubPolkadot$3 = {
3814
3946
  symbol: "TATE",
3815
3947
  decimals: 12
3816
3948
  },
3949
+ {
3950
+ assetId: "22222081",
3951
+ symbol: "NAR",
3952
+ decimals: 12
3953
+ },
3817
3954
  {
3818
3955
  assetId: "22222011",
3819
3956
  symbol: "PM",
@@ -3864,6 +4001,376 @@ var AssetHubPolkadot$3 = {
3864
4001
  symbol: "PBTC",
3865
4002
  decimals: 10
3866
4003
  }
4004
+ ],
4005
+ multiLocations: [
4006
+ {
4007
+ parents: 1,
4008
+ interior: {
4009
+ x1: {
4010
+ parachain: 2011
4011
+ }
4012
+ }
4013
+ },
4014
+ {
4015
+ parents: 2,
4016
+ interior: {
4017
+ x2: [
4018
+ {
4019
+ globalConsensus: {
4020
+ ethereum: {
4021
+ chainId: 1
4022
+ }
4023
+ }
4024
+ },
4025
+ {
4026
+ accountKey20: {
4027
+ network: null,
4028
+ key: "0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2"
4029
+ }
4030
+ }
4031
+ ]
4032
+ }
4033
+ },
4034
+ {
4035
+ parents: 2,
4036
+ interior: {
4037
+ x2: [
4038
+ {
4039
+ globalConsensus: {
4040
+ ethereum: {
4041
+ chainId: 1
4042
+ }
4043
+ }
4044
+ },
4045
+ {
4046
+ accountKey20: {
4047
+ network: null,
4048
+ key: "0x6982508145454ce325ddbe47a25d4ec3d2311933"
4049
+ }
4050
+ }
4051
+ ]
4052
+ }
4053
+ },
4054
+ {
4055
+ parents: 2,
4056
+ interior: {
4057
+ x1: {
4058
+ globalConsensus: {
4059
+ kusama: null
4060
+ }
4061
+ }
4062
+ }
4063
+ },
4064
+ {
4065
+ parents: 1,
4066
+ interior: {
4067
+ x2: [
4068
+ {
4069
+ parachain: 2030
4070
+ },
4071
+ {
4072
+ generalKey: {
4073
+ length: 2,
4074
+ data: "0x0001000000000000000000000000000000000000000000000000000000000000"
4075
+ }
4076
+ }
4077
+ ]
4078
+ }
4079
+ },
4080
+ {
4081
+ parents: 2,
4082
+ interior: {
4083
+ x2: [
4084
+ {
4085
+ globalConsensus: {
4086
+ ethereum: {
4087
+ chainId: 1
4088
+ }
4089
+ }
4090
+ },
4091
+ {
4092
+ accountKey20: {
4093
+ network: null,
4094
+ key: "0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48"
4095
+ }
4096
+ }
4097
+ ]
4098
+ }
4099
+ },
4100
+ {
4101
+ parents: 2,
4102
+ interior: {
4103
+ x2: [
4104
+ {
4105
+ globalConsensus: {
4106
+ ethereum: {
4107
+ chainId: 1
4108
+ }
4109
+ }
4110
+ },
4111
+ {
4112
+ accountKey20: {
4113
+ network: null,
4114
+ key: "0xba41ddf06b7ffd89d1267b5a93bfef2424eb2003"
4115
+ }
4116
+ }
4117
+ ]
4118
+ }
4119
+ },
4120
+ {
4121
+ parents: 2,
4122
+ interior: {
4123
+ x2: [
4124
+ {
4125
+ globalConsensus: {
4126
+ ethereum: {
4127
+ chainId: 1
4128
+ }
4129
+ }
4130
+ },
4131
+ {
4132
+ accountKey20: {
4133
+ network: null,
4134
+ key: "0x18084fba666a33d37592fa2633fd49a74dd93a88"
4135
+ }
4136
+ }
4137
+ ]
4138
+ }
4139
+ },
4140
+ {
4141
+ parents: 2,
4142
+ interior: {
4143
+ x2: [
4144
+ {
4145
+ globalConsensus: {
4146
+ ethereum: {
4147
+ chainId: 1
4148
+ }
4149
+ }
4150
+ },
4151
+ {
4152
+ accountKey20: {
4153
+ network: null,
4154
+ key: "0x7f39c581f595b53c5cb19bd0b3f8da6c935e2ca0"
4155
+ }
4156
+ }
4157
+ ]
4158
+ }
4159
+ },
4160
+ {
4161
+ parents: 2,
4162
+ interior: {
4163
+ x2: [
4164
+ {
4165
+ globalConsensus: {
4166
+ ethereum: {
4167
+ chainId: 1
4168
+ }
4169
+ }
4170
+ },
4171
+ {
4172
+ accountKey20: {
4173
+ network: null,
4174
+ key: "0x582d872a1b094fc48f5de31d3b73f2d9be47def1"
4175
+ }
4176
+ }
4177
+ ]
4178
+ }
4179
+ },
4180
+ {
4181
+ parents: 2,
4182
+ interior: {
4183
+ x2: [
4184
+ {
4185
+ globalConsensus: {
4186
+ ethereum: {
4187
+ chainId: 1
4188
+ }
4189
+ }
4190
+ },
4191
+ {
4192
+ accountKey20: {
4193
+ network: null,
4194
+ key: "0x6b175474e89094c44da98b954eedeac495271d0f"
4195
+ }
4196
+ }
4197
+ ]
4198
+ }
4199
+ },
4200
+ {
4201
+ parents: 2,
4202
+ interior: {
4203
+ x2: [
4204
+ {
4205
+ globalConsensus: {
4206
+ ethereum: {
4207
+ chainId: 1
4208
+ }
4209
+ }
4210
+ },
4211
+ {
4212
+ accountKey20: {
4213
+ network: null,
4214
+ key: "0x95ad61b0a150d79219dcf64e1e6cc01f0b64c4ce"
4215
+ }
4216
+ }
4217
+ ]
4218
+ }
4219
+ },
4220
+ {
4221
+ parents: 1,
4222
+ interior: {
4223
+ x2: [
4224
+ {
4225
+ parachain: 2011
4226
+ },
4227
+ {
4228
+ generalKey: {
4229
+ length: 3,
4230
+ data: "0x6571640000000000000000000000000000000000000000000000000000000000"
4231
+ }
4232
+ }
4233
+ ]
4234
+ }
4235
+ },
4236
+ {
4237
+ parents: 2,
4238
+ interior: {
4239
+ x2: [
4240
+ {
4241
+ globalConsensus: {
4242
+ ethereum: {
4243
+ chainId: 1
4244
+ }
4245
+ }
4246
+ },
4247
+ {
4248
+ accountKey20: {
4249
+ network: null,
4250
+ key: "0x2260fac5e5542a773aa44fbcfedf7c193bc2c599"
4251
+ }
4252
+ }
4253
+ ]
4254
+ }
4255
+ },
4256
+ {
4257
+ parents: 1,
4258
+ interior: {
4259
+ x2: [
4260
+ {
4261
+ parachain: 2004
4262
+ },
4263
+ {
4264
+ palletInstance: 10
4265
+ }
4266
+ ]
4267
+ }
4268
+ },
4269
+ {
4270
+ parents: 1,
4271
+ interior: {
4272
+ x1: {
4273
+ parachain: 3369
4274
+ }
4275
+ }
4276
+ },
4277
+ {
4278
+ parents: 1,
4279
+ interior: {
4280
+ x2: [
4281
+ {
4282
+ parachain: 2030
4283
+ },
4284
+ {
4285
+ generalKey: {
4286
+ length: 2,
4287
+ data: "0x0900000000000000000000000000000000000000000000000000000000000000"
4288
+ }
4289
+ }
4290
+ ]
4291
+ }
4292
+ },
4293
+ {
4294
+ parents: 2,
4295
+ interior: {
4296
+ x2: [
4297
+ {
4298
+ globalConsensus: {
4299
+ ethereum: {
4300
+ chainId: 1
4301
+ }
4302
+ }
4303
+ },
4304
+ {
4305
+ accountKey20: {
4306
+ network: null,
4307
+ key: "0x8daebade922df735c38c80c7ebd708af50815faa"
4308
+ }
4309
+ }
4310
+ ]
4311
+ }
4312
+ },
4313
+ {
4314
+ parents: 1,
4315
+ interior: {
4316
+ x2: [
4317
+ {
4318
+ parachain: 2034
4319
+ },
4320
+ {
4321
+ generalIndex: 0
4322
+ }
4323
+ ]
4324
+ }
4325
+ },
4326
+ {
4327
+ parents: 2,
4328
+ interior: {
4329
+ x2: [
4330
+ {
4331
+ globalConsensus: {
4332
+ ethereum: {
4333
+ chainId: 1
4334
+ }
4335
+ }
4336
+ },
4337
+ {
4338
+ accountKey20: {
4339
+ network: null,
4340
+ key: "0x5d3d01fd6d2ad1169b17918eb4f153c6616288eb"
4341
+ }
4342
+ }
4343
+ ]
4344
+ }
4345
+ },
4346
+ {
4347
+ parents: 2,
4348
+ interior: {
4349
+ x2: [
4350
+ {
4351
+ globalConsensus: {
4352
+ ethereum: {
4353
+ chainId: 1
4354
+ }
4355
+ }
4356
+ },
4357
+ {
4358
+ accountKey20: {
4359
+ network: null,
4360
+ key: "0xdac17f958d2ee523a2206206994597c13d831ec7"
4361
+ }
4362
+ }
4363
+ ]
4364
+ }
4365
+ },
4366
+ {
4367
+ parents: 1,
4368
+ interior: {
4369
+ x1: {
4370
+ parachain: 2051
4371
+ }
4372
+ }
4373
+ }
3867
4374
  ]
3868
4375
  };
3869
4376
  var Altair$3 = {
@@ -4337,6 +4844,11 @@ var Curio$3 = {
4337
4844
  symbol: "VAL",
4338
4845
  decimals: 18
4339
4846
  },
4847
+ {
4848
+ assetId: "3",
4849
+ symbol: "PSWAP",
4850
+ decimals: 18
4851
+ },
4340
4852
  {
4341
4853
  assetId: "1",
4342
4854
  symbol: "XOR",
@@ -5523,6 +6035,10 @@ var AssetHubKusama$3 = {
5523
6035
  {
5524
6036
  symbol: "KSM",
5525
6037
  decimals: 12
6038
+ },
6039
+ {
6040
+ symbol: "DOT",
6041
+ decimals: 10
5526
6042
  }
5527
6043
  ],
5528
6044
  otherAssets: [
@@ -6421,6 +6937,60 @@ var AssetHubKusama$3 = {
6421
6937
  symbol: "RUEPP",
6422
6938
  decimals: 10
6423
6939
  }
6940
+ ],
6941
+ multiLocations: [
6942
+ {
6943
+ parents: 2,
6944
+ interior: {
6945
+ x1: {
6946
+ globalConsensus: {
6947
+ polkadot: null
6948
+ }
6949
+ }
6950
+ }
6951
+ },
6952
+ {
6953
+ parents: 1,
6954
+ interior: {
6955
+ x2: [
6956
+ {
6957
+ parachain: 2125
6958
+ },
6959
+ {
6960
+ generalIndex: 0
6961
+ }
6962
+ ]
6963
+ }
6964
+ },
6965
+ {
6966
+ parents: 1,
6967
+ interior: {
6968
+ x1: {
6969
+ parachain: 2123
6970
+ }
6971
+ }
6972
+ },
6973
+ {
6974
+ parents: 1,
6975
+ interior: {
6976
+ x2: [
6977
+ {
6978
+ parachain: 2023
6979
+ },
6980
+ {
6981
+ palletInstance: 10
6982
+ }
6983
+ ]
6984
+ }
6985
+ },
6986
+ {
6987
+ parents: 1,
6988
+ interior: {
6989
+ x1: {
6990
+ parachain: 2015
6991
+ }
6992
+ }
6993
+ }
6424
6994
  ]
6425
6995
  };
6426
6996
  var CoretimeKusama$3 = {
@@ -6436,6 +7006,19 @@ var CoretimeKusama$3 = {
6436
7006
  otherAssets: [
6437
7007
  ]
6438
7008
  };
7009
+ var CoretimePolkadot$3 = {
7010
+ paraId: 1005,
7011
+ relayChainAssetSymbol: "DOT",
7012
+ nativeAssetSymbol: "DOT",
7013
+ nativeAssets: [
7014
+ {
7015
+ symbol: "DOT",
7016
+ decimals: 10
7017
+ }
7018
+ ],
7019
+ otherAssets: [
7020
+ ]
7021
+ };
6439
7022
  var Turing$3 = {
6440
7023
  paraId: 2114,
6441
7024
  relayChainAssetSymbol: "KSM",
@@ -6804,9 +7387,6 @@ var Polkadex$3 = {
6804
7387
  symbol: "PINK",
6805
7388
  decimals: 12
6806
7389
  },
6807
- {
6808
- assetId: "313524628741076911470961827389955394913"
6809
- },
6810
7390
  {
6811
7391
  assetId: "3496813586714279103986568049643838918",
6812
7392
  symbol: "USDT",
@@ -6848,11 +7428,26 @@ var Zeitgeist$3 = {
6848
7428
  symbol: "USDC",
6849
7429
  decimals: 6
6850
7430
  },
7431
+ {
7432
+ assetId: "11",
7433
+ symbol: "vASTR",
7434
+ decimals: 18
7435
+ },
6851
7436
  {
6852
7437
  assetId: "4",
6853
7438
  symbol: "USDC",
6854
7439
  decimals: 6
6855
7440
  },
7441
+ {
7442
+ assetId: "9",
7443
+ symbol: "vDOT",
7444
+ decimals: 10
7445
+ },
7446
+ {
7447
+ assetId: "7",
7448
+ symbol: "INTR",
7449
+ decimals: 10
7450
+ },
6856
7451
  {
6857
7452
  assetId: "2",
6858
7453
  symbol: "WSX",
@@ -6868,10 +7463,30 @@ var Zeitgeist$3 = {
6868
7463
  symbol: "DOT",
6869
7464
  decimals: 10
6870
7465
  },
7466
+ {
7467
+ assetId: "8",
7468
+ symbol: "BNC",
7469
+ decimals: 12
7470
+ },
6871
7471
  {
6872
7472
  assetId: "5",
6873
7473
  symbol: "USDT",
6874
7474
  decimals: 6
7475
+ },
7476
+ {
7477
+ assetId: "10",
7478
+ symbol: "vGLMR",
7479
+ decimals: 18
7480
+ },
7481
+ {
7482
+ assetId: "12",
7483
+ symbol: "vMANTA",
7484
+ decimals: 18
7485
+ },
7486
+ {
7487
+ assetId: "6",
7488
+ symbol: "HDX",
7489
+ decimals: 12
6875
7490
  }
6876
7491
  ]
6877
7492
  };
@@ -7184,6 +7799,7 @@ var Peaq$3 = {
7184
7799
  var assets = {
7185
7800
  Polkadot: Polkadot$1,
7186
7801
  Kusama: Kusama$1,
7802
+ Polimec: Polimec$3,
7187
7803
  Acala: Acala$3,
7188
7804
  BridgeHubPolkadot: BridgeHubPolkadot$3,
7189
7805
  BridgeHubKusama: BridgeHubKusama$3,
@@ -7226,6 +7842,7 @@ var assets = {
7226
7842
  Shiden: Shiden$3,
7227
7843
  AssetHubKusama: AssetHubKusama$3,
7228
7844
  CoretimeKusama: CoretimeKusama$3,
7845
+ CoretimePolkadot: CoretimePolkadot$3,
7229
7846
  Turing: Turing$3,
7230
7847
  Unique: Unique$3,
7231
7848
  Crust: Crust$3,
@@ -7263,6 +7880,7 @@ var assetsMapJson = /*#__PURE__*/Object.freeze({
7263
7880
  Collectives: Collectives$3,
7264
7881
  ComposableFinance: ComposableFinance$3,
7265
7882
  CoretimeKusama: CoretimeKusama$3,
7883
+ CoretimePolkadot: CoretimePolkadot$3,
7266
7884
  Crab: Crab$3,
7267
7885
  Crust: Crust$3,
7268
7886
  CrustShadow: CrustShadow$3,
@@ -7295,6 +7913,7 @@ var assetsMapJson = /*#__PURE__*/Object.freeze({
7295
7913
  Phala: Phala$3,
7296
7914
  Picasso: Picasso$3,
7297
7915
  Pioneer: Pioneer$3,
7916
+ Polimec: Polimec$3,
7298
7917
  Polkadex: Polkadex$3,
7299
7918
  Polkadot: Polkadot$1,
7300
7919
  Quartz: Quartz$3,
@@ -7370,397 +7989,54 @@ var DuplicateAssetError = /*#__PURE__*/function (_Error) {
7370
7989
  return _createClass(DuplicateAssetError);
7371
7990
  }(/*#__PURE__*/_wrapNativeSuper(Error));
7372
7991
 
7373
- var constructRelayToParaParameters = function constructRelayToParaParameters(_ref, version) {
7374
- var api = _ref.api,
7375
- destination = _ref.destination,
7376
- address = _ref.address,
7377
- amount = _ref.amount,
7378
- paraIdTo = _ref.paraIdTo;
7379
- var includeFee = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7380
- var paraId = destination !== undefined && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
7381
- var parameters = [createPolkadotXcmHeader('RelayToPara', version, destination, paraId), generateAddressPayload(api, 'RelayToPara', null, address, version, paraId), createCurrencySpec(amount, version, Parents.ZERO), 0];
7382
- if (includeFee) {
7383
- parameters.push('Unlimited');
7384
- }
7385
- return parameters;
7386
- };
7387
- var isTMulti = function isTMulti(value) {
7388
- return value && _typeof(value) === 'object' || Array.isArray(value);
7992
+ var AssetHubPolkadot$2 = {
7993
+ defaultPallet: "PolkadotXcm",
7994
+ supportedPallets: [
7995
+ "PolkadotXcm"
7996
+ ]
7389
7997
  };
7390
- var isTMultiLocation = function isTMultiLocation(value) {
7391
- return value && typeof value.parents !== 'undefined' && typeof value.interior !== 'undefined';
7998
+ var Acala$2 = {
7999
+ defaultPallet: "XTokens",
8000
+ supportedPallets: [
8001
+ "PolkadotXcm",
8002
+ "XTokens"
8003
+ ]
7392
8004
  };
7393
- var isTCurrencySpecifier = function isTCurrencySpecifier(value) {
7394
- if (_typeof(value) !== 'object' || value === null) {
7395
- return false;
7396
- }
7397
- return 'symbol' in value && typeof value.symbol === 'string' || 'id' in value && (typeof value.id === 'string' || typeof value.id === 'number' || typeof value.id === 'bigint');
8005
+ var Astar$2 = {
8006
+ defaultPallet: "XTokens",
8007
+ supportedPallets: [
8008
+ "PolkadotXcm",
8009
+ "XTokens"
8010
+ ]
7398
8011
  };
7399
- var createBridgeCurrencySpec = function createBridgeCurrencySpec(amount, ecosystem) {
7400
- return _defineProperty({}, Version.V4, [{
7401
- id: {
7402
- parents: Parents.TWO,
7403
- interior: {
7404
- X1: [{
7405
- GlobalConsensus: ecosystem
7406
- }]
7407
- }
7408
- },
7409
- fun: {
7410
- Fungible: amount
7411
- }
7412
- }]);
8012
+ var BifrostPolkadot$2 = {
8013
+ defaultPallet: "XTokens",
8014
+ supportedPallets: [
8015
+ "PolkadotXcm",
8016
+ "XTokens"
8017
+ ]
7413
8018
  };
7414
- var createCurrencySpec = function createCurrencySpec(amount, version, parents, overriddenCurrency) {
7415
- var interior = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'Here';
7416
- if (!overriddenCurrency) {
7417
- return _defineProperty({}, version, [{
7418
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
7419
- id: version === Version.V4 ? {
7420
- parents: parents,
7421
- interior: interior
7422
- } : {
7423
- Concrete: {
7424
- parents: parents,
7425
- interior: interior
7426
- }
7427
- },
7428
- fun: {
7429
- Fungible: amount
7430
- }
7431
- }]);
7432
- }
7433
- return isTMultiLocation(overriddenCurrency) ? _defineProperty({}, version, [{
7434
- id: version === Version.V4 ? overriddenCurrency : {
7435
- Concrete: overriddenCurrency
7436
- },
7437
- fun: {
7438
- Fungible: amount
7439
- }
7440
- }]) : // It must be TMultiAsset if not TMultiLocation
7441
- _defineProperty({}, version, overriddenCurrency);
8019
+ var Bitgreen$2 = {
8020
+ defaultPallet: "PolkadotXcm",
8021
+ supportedPallets: [
8022
+ "PolkadotXcm"
8023
+ ]
7442
8024
  };
7443
- var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId, junction, parents) {
7444
- var parentsResolved = parents !== null && parents !== void 0 ? parents : scenario === 'RelayToPara' ? Parents.ZERO : Parents.ONE;
7445
- var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && junction !== void 0 ? junction : {
7446
- Parachain: nodeId
7447
- });
7448
- var isMultiLocationDestination = _typeof(destination) === 'object';
7449
- return _defineProperty({}, version, isMultiLocationDestination ? destination : {
7450
- parents: parentsResolved,
7451
- interior: interior
7452
- });
7453
- };
7454
- var createBridgePolkadotXcmDest = function createBridgePolkadotXcmDest(version, ecosystem, destination, nodeId) {
7455
- var multiLocation = {
7456
- parents: Parents.TWO,
7457
- interior: {
7458
- X2: [{
7459
- GlobalConsensus: ecosystem
7460
- }, {
7461
- Parachain: nodeId
7462
- }]
7463
- }
7464
- };
7465
- var isMultiLocationDestination = _typeof(destination) === 'object';
7466
- return _defineProperty({}, version, isMultiLocationDestination ? destination : multiLocation);
7467
- };
7468
- var calculateTransactionFee$1 = function calculateTransactionFee(tx, address) {
7469
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7470
- var _yield$tx$paymentInfo, partialFee;
7471
- return _regeneratorRuntime().wrap(function _callee$(_context) {
7472
- while (1) switch (_context.prev = _context.next) {
7473
- case 0:
7474
- _context.next = 2;
7475
- return tx.paymentInfo(address);
7476
- case 2:
7477
- _yield$tx$paymentInfo = _context.sent;
7478
- partialFee = _yield$tx$paymentInfo.partialFee;
7479
- return _context.abrupt("return", partialFee.toBn());
7480
- case 5:
7481
- case "end":
7482
- return _context.stop();
7483
- }
7484
- }, _callee);
7485
- }));
7486
- };
7487
- // TODO: Refactor this function to eliminate the any type
7488
- var findParachainJunction = function findParachainJunction(multilocation) {
7489
- var interior = multilocation.interior;
7490
- for (var key in interior) {
7491
- // eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
7492
- var junctions = interior[key];
7493
- if (Array.isArray(junctions)) {
7494
- var _iterator = _createForOfIteratorHelper(junctions),
7495
- _step;
7496
- try {
7497
- for (_iterator.s(); !(_step = _iterator.n()).done;) {
7498
- var junction = _step.value;
7499
- if ('Parachain' in junction) {
7500
- return Number(junction.Parachain);
7501
- }
7502
- }
7503
- } catch (err) {
7504
- _iterator.e(err);
7505
- } finally {
7506
- _iterator.f();
7507
- }
7508
- } else if (junctions !== undefined && 'Parachain' in junctions) {
7509
- return Number(junctions.Parachain);
7510
- }
7511
- }
7512
- return null;
7513
- };
7514
- var resolveTNodeFromMultiLocation = function resolveTNodeFromMultiLocation(multiLocation) {
7515
- var parachainId = findParachainJunction(multiLocation);
7516
- if (parachainId === null) {
7517
- throw new Error('Parachain ID not found in destination multi location.');
7518
- }
7519
- var node = getTNode(parachainId);
7520
- if (node === null) {
7521
- throw new Error('Node with specified paraId not found in destination multi location.');
7522
- }
7523
- return node;
7524
- };
7525
-
7526
- var findAssetBySymbol = function findAssetBySymbol(node, destination, otherAssets, nativeAssets, combinedAssets, symbol, isRelayDestination, isSymbol) {
7527
- if (destination === 'Ethereum') {
7528
- return combinedAssets.find(function (_ref) {
7529
- var assetSymbol = _ref.symbol;
7530
- return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
7531
- });
7532
- }
7533
- var otherAssetsMatches = otherAssets.filter(function (_ref2) {
7534
- var assetSymbol = _ref2.symbol;
7535
- return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
7536
- });
7537
- var nativeAssetsMatches = nativeAssets.filter(function (_ref3) {
7538
- var assetSymbol = _ref3.symbol;
7539
- return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
7540
- });
7541
- if (node === 'Astar' || node === 'Shiden') {
7542
- return nativeAssetsMatches[0] || otherAssetsMatches[0] || null;
7543
- }
7544
- if (otherAssetsMatches.length > 1 && !isRelayDestination && isSymbol === undefined) {
7545
- throw new DuplicateAssetError(symbol);
7546
- }
7547
- return otherAssetsMatches[0] || nativeAssetsMatches[0] || null;
7548
- };
7549
- var findAssetById = function findAssetById(assets, assetId) {
7550
- return assets.find(function (_ref4) {
7551
- var currentAssetId = _ref4.assetId;
7552
- return currentAssetId === assetId;
7553
- });
7554
- };
7555
- var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency) {
7556
- var isRelayDestination = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
7557
- var isSymbol = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : undefined;
7558
- var destination = arguments.length > 4 ? arguments[4] : undefined;
7559
- if (isTMulti(currency)) {
7560
- return null;
7561
- }
7562
- var currencyString = currency.toString();
7563
- var _getAssetsObject = getAssetsObject(node),
7564
- otherAssets = _getAssetsObject.otherAssets,
7565
- nativeAssets = _getAssetsObject.nativeAssets,
7566
- relayChainAssetSymbol = _getAssetsObject.relayChainAssetSymbol;
7567
- var combinedAssets = destination === 'Ethereum' ? _toConsumableArray(getOtherAssets('Ethereum')) : [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets));
7568
- var asset;
7569
- if (isSymbol === true) {
7570
- asset = findAssetBySymbol(node, destination, otherAssets, nativeAssets, combinedAssets, currencyString, isRelayDestination, isSymbol);
7571
- } else if (isSymbol === false) {
7572
- asset = findAssetById(combinedAssets, currencyString);
7573
- } else {
7574
- asset = findAssetBySymbol(node, destination, otherAssets, nativeAssets, combinedAssets, currencyString, isRelayDestination, isSymbol) || findAssetById(combinedAssets, currencyString);
7575
- }
7576
- if (asset) {
7577
- return asset;
7578
- }
7579
- if (relayChainAssetSymbol.toLowerCase() === currencyString.toLowerCase() && isSymbol !== false) {
7580
- var relayChainAsset = {
7581
- symbol: relayChainAssetSymbol,
7582
- decimals: getAssetDecimals(node, relayChainAssetSymbol)
7583
- };
7584
- return relayChainAsset;
7585
- }
7586
- return null;
7587
- };
7588
-
7589
- var assetsMap = assetsMapJson;
7590
- var getAssetsObject = function getAssetsObject(node) {
7591
- return assetsMap[node];
7592
- };
7593
- var getAssetId = function getAssetId(node, symbol) {
7594
- var info = getAssetsObject(node).otherAssets.find(function (o) {
7595
- return o.symbol === symbol;
7596
- });
7597
- return info != null ? info.assetId : null;
7598
- };
7599
- var getRelayChainSymbol = function getRelayChainSymbol(node) {
7600
- return getAssetsObject(node).relayChainAssetSymbol;
7601
- };
7602
- var getNativeAssets = function getNativeAssets(node) {
7603
- return getAssetsObject(node).nativeAssets;
7604
- };
7605
- var getOtherAssets = function getOtherAssets(node) {
7606
- return getAssetsObject(node).otherAssets;
7607
- };
7608
- var getAssets = function getAssets(node) {
7609
- var _getAssetsObject = getAssetsObject(node),
7610
- nativeAssets = _getAssetsObject.nativeAssets,
7611
- otherAssets = _getAssetsObject.otherAssets;
7612
- var relayChainAsset = getAssetBySymbolOrId(determineRelayChain(node), getRelayChainSymbol(node));
7613
- return [].concat(_toConsumableArray(relayChainAsset ? [relayChainAsset] : []), _toConsumableArray(nativeAssets), _toConsumableArray(otherAssets));
7614
- };
7615
- var getAllAssetsSymbols = function getAllAssetsSymbols(node) {
7616
- var _getAssetsObject2 = getAssetsObject(node),
7617
- relayChainAssetSymbol = _getAssetsObject2.relayChainAssetSymbol,
7618
- nativeAssets = _getAssetsObject2.nativeAssets,
7619
- otherAssets = _getAssetsObject2.otherAssets;
7620
- var nativeAssetsSymbols = nativeAssets.map(function (_ref) {
7621
- var symbol = _ref.symbol;
7622
- return symbol;
7623
- });
7624
- var otherAssetsSymbols = otherAssets.filter(function (asset) {
7625
- return asset.symbol !== undefined;
7626
- }).map(function (_ref2) {
7627
- var symbol = _ref2.symbol;
7628
- return symbol;
7629
- });
7630
- return [relayChainAssetSymbol].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols));
7631
- };
7632
- var getNativeAssetSymbol = function getNativeAssetSymbol(node) {
7633
- if (node === 'Polkadot') {
7634
- return 'DOT';
7635
- } else if (node === 'Kusama') {
7636
- return 'KSM';
7637
- }
7638
- return getAssetsObject(node).nativeAssetSymbol;
7639
- };
7640
- var hasSupportForAsset = function hasSupportForAsset(node, symbol) {
7641
- return getAllAssetsSymbols(node).map(function (s) {
7642
- return s.toLowerCase();
7643
- }).includes(symbol.toLowerCase());
7644
- };
7645
- var getSupportedAssets = function getSupportedAssets(origin, destination) {
7646
- var originAssets = getAssets(origin);
7647
- var destinationAssets = getAssets(destination);
7648
- if (destination === 'Ethereum' || origin === 'Ethereum') {
7649
- return getOtherAssets('Ethereum');
7650
- }
7651
- if (origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot') {
7652
- var polkadotAsset = getAssetBySymbolOrId('Polkadot', 'DOT');
7653
- var kusamaAsset = getAssetBySymbolOrId('Kusama', 'KSM');
7654
- return [].concat(_toConsumableArray(polkadotAsset ? [polkadotAsset] : []), _toConsumableArray(kusamaAsset ? [kusamaAsset] : []));
7655
- }
7656
- return _toConsumableArray(originAssets.filter(function (asset) {
7657
- return destinationAssets.some(function (a) {
7658
- return a.symbol === asset.symbol;
7659
- });
7660
- }));
7661
- };
7662
- var getAssetDecimals = function getAssetDecimals(node, symbol) {
7663
- var _getAssetsObject3 = getAssetsObject(node),
7664
- otherAssets = _getAssetsObject3.otherAssets,
7665
- nativeAssets = _getAssetsObject3.nativeAssets;
7666
- var asset = [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets)).find(function (o) {
7667
- return o.symbol === symbol;
7668
- });
7669
- return (asset === null || asset === void 0 ? void 0 : asset.decimals) !== undefined ? asset.decimals : null;
7670
- };
7671
- var getParaId = function getParaId(node) {
7672
- return getAssetsObject(node).paraId;
7673
- };
7674
- var getTNode = function getTNode(paraId) {
7675
- var _a;
7676
- return (_a = NODE_NAMES.find(function (node) {
7677
- return getParaId(node) === paraId;
7678
- })) !== null && _a !== void 0 ? _a : null;
7679
- };
7680
-
7681
- var getBalanceNative = function getBalanceNative(address, node, api) {
7682
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
7683
- var apiWithFallback, _yield$apiWithFallbac, data, balance;
7684
- return _regeneratorRuntime().wrap(function _callee$(_context) {
7685
- while (1) switch (_context.prev = _context.next) {
7686
- case 0:
7687
- if (!(api !== null && api !== void 0)) {
7688
- _context.next = 4;
7689
- break;
7690
- }
7691
- _context.t0 = api;
7692
- _context.next = 7;
7693
- break;
7694
- case 4:
7695
- _context.next = 6;
7696
- return createApiInstanceForNode(node);
7697
- case 6:
7698
- _context.t0 = _context.sent;
7699
- case 7:
7700
- apiWithFallback = _context.t0;
7701
- _context.next = 10;
7702
- return apiWithFallback.query.system.account(address);
7703
- case 10:
7704
- _yield$apiWithFallbac = _context.sent;
7705
- data = _yield$apiWithFallbac.data;
7706
- balance = data.free.toBn();
7707
- return _context.abrupt("return", BigInt(balance.toString()));
7708
- case 14:
7709
- case "end":
7710
- return _context.stop();
7711
- }
7712
- }, _callee);
7713
- }));
7714
- };
7715
-
7716
- var AssetHubPolkadot$2 = {
8025
+ var CoretimeKusama$2 = {
7717
8026
  defaultPallet: "PolkadotXcm",
7718
8027
  supportedPallets: [
7719
8028
  "PolkadotXcm"
7720
8029
  ]
7721
8030
  };
7722
- var Acala$2 = {
8031
+ var Centrifuge$2 = {
7723
8032
  defaultPallet: "XTokens",
7724
8033
  supportedPallets: [
7725
8034
  "PolkadotXcm",
7726
- "XTokens"
8035
+ "XTokens",
8036
+ "OrmlXTokens"
7727
8037
  ]
7728
8038
  };
7729
- var Astar$2 = {
7730
- defaultPallet: "XTokens",
7731
- supportedPallets: [
7732
- "PolkadotXcm",
7733
- "XTokens"
7734
- ]
7735
- };
7736
- var BifrostPolkadot$2 = {
7737
- defaultPallet: "XTokens",
7738
- supportedPallets: [
7739
- "PolkadotXcm",
7740
- "XTokens"
7741
- ]
7742
- };
7743
- var Bitgreen$2 = {
7744
- defaultPallet: "PolkadotXcm",
7745
- supportedPallets: [
7746
- "PolkadotXcm"
7747
- ]
7748
- };
7749
- var CoretimeKusama$2 = {
7750
- defaultPallet: "PolkadotXcm",
7751
- supportedPallets: [
7752
- "PolkadotXcm"
7753
- ]
7754
- };
7755
- var Centrifuge$2 = {
7756
- defaultPallet: "XTokens",
7757
- supportedPallets: [
7758
- "PolkadotXcm",
7759
- "XTokens",
7760
- "OrmlXTokens"
7761
- ]
7762
- };
7763
- var ComposableFinance$2 = {
8039
+ var ComposableFinance$2 = {
7764
8040
  defaultPallet: "XTokens",
7765
8041
  supportedPallets: [
7766
8042
  "PolkadotXcm",
@@ -8093,6 +8369,18 @@ var Peaq$2 = {
8093
8369
  "XTokens"
8094
8370
  ]
8095
8371
  };
8372
+ var CoretimePolkadot$2 = {
8373
+ defaultPallet: "PolkadotXcm",
8374
+ supportedPallets: [
8375
+ "PolkadotXcm"
8376
+ ]
8377
+ };
8378
+ var Polimec$2 = {
8379
+ defaultPallet: "PolkadotXcm",
8380
+ supportedPallets: [
8381
+ "PolkadotXcm"
8382
+ ]
8383
+ };
8096
8384
  var pallets = {
8097
8385
  AssetHubPolkadot: AssetHubPolkadot$2,
8098
8386
  Acala: Acala$2,
@@ -8149,7 +8437,9 @@ var pallets = {
8149
8437
  BridgeHubPolkadot: BridgeHubPolkadot$2,
8150
8438
  BridgeHubKusama: BridgeHubKusama$2,
8151
8439
  Mythos: Mythos$2,
8152
- Peaq: Peaq$2
8440
+ Peaq: Peaq$2,
8441
+ CoretimePolkadot: CoretimePolkadot$2,
8442
+ Polimec: Polimec$2
8153
8443
  };
8154
8444
 
8155
8445
  var palletsMapJson = /*#__PURE__*/Object.freeze({
@@ -8172,6 +8462,7 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
8172
8462
  Collectives: Collectives$2,
8173
8463
  ComposableFinance: ComposableFinance$2,
8174
8464
  CoretimeKusama: CoretimeKusama$2,
8465
+ CoretimePolkadot: CoretimePolkadot$2,
8175
8466
  Crab: Crab$2,
8176
8467
  Crust: Crust$2,
8177
8468
  CrustShadow: CrustShadow$2,
@@ -8202,6 +8493,7 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
8202
8493
  Phala: Phala$2,
8203
8494
  Picasso: Picasso$2,
8204
8495
  Pioneer: Pioneer$2,
8496
+ Polimec: Polimec$2,
8205
8497
  Polkadex: Polkadex$2,
8206
8498
  Quartz: Quartz$2,
8207
8499
  Robonomics: Robonomics$2,
@@ -8213,18 +8505,405 @@ var palletsMapJson = /*#__PURE__*/Object.freeze({
8213
8505
  default: pallets
8214
8506
  });
8215
8507
 
8216
- // Script that pulls XCM Pallets for selected Parachain
8217
- var palletsMap$1 = palletsMapJson;
8218
- var getDefaultPallet = function getDefaultPallet(node) {
8219
- return palletsMap$1[node].defaultPallet;
8508
+ // Script that pulls XCM Pallets for selected Parachain
8509
+ var palletsMap$1 = palletsMapJson;
8510
+ var getDefaultPallet = function getDefaultPallet(node) {
8511
+ return palletsMap$1[node].defaultPallet;
8512
+ };
8513
+ var getSupportedPallets = function getSupportedPallets(node) {
8514
+ return palletsMap$1[node].supportedPallets;
8515
+ };
8516
+
8517
+ // Contains function for getting Asset ID or Symbol used in XCM call creation
8518
+ var findAssetBySymbol = function findAssetBySymbol(node, destination, otherAssets, nativeAssets, combinedAssets, symbol, isRelayDestination) {
8519
+ if (destination === 'Ethereum') {
8520
+ return combinedAssets.find(function (_ref) {
8521
+ var assetSymbol = _ref.symbol;
8522
+ return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
8523
+ });
8524
+ }
8525
+ var otherAssetsMatches = otherAssets.filter(function (_ref2) {
8526
+ var assetSymbol = _ref2.symbol;
8527
+ return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
8528
+ });
8529
+ var nativeAssetsMatches = nativeAssets.filter(function (_ref3) {
8530
+ var assetSymbol = _ref3.symbol;
8531
+ return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === symbol.toLowerCase();
8532
+ });
8533
+ var isPolkadotXcm = !isRelayChain(node) && node !== 'Ethereum' && getDefaultPallet(node) === 'PolkadotXcm';
8534
+ if (node === 'Astar' || node === 'Shiden' || isPolkadotXcm) {
8535
+ return nativeAssetsMatches[0] || otherAssetsMatches[0] || null;
8536
+ }
8537
+ if (otherAssetsMatches.length > 1 && !isRelayDestination) {
8538
+ throw new DuplicateAssetError(symbol);
8539
+ }
8540
+ return otherAssetsMatches[0] || nativeAssetsMatches[0] || null;
8541
+ };
8542
+
8543
+ var findAssetById = function findAssetById(assets, assetId) {
8544
+ return assets.find(function (_ref) {
8545
+ var currentAssetId = _ref.assetId;
8546
+ return currentAssetId === assetId;
8547
+ });
8548
+ };
8549
+ var getAssetBySymbolOrId = function getAssetBySymbolOrId(node, currency) {
8550
+ var isRelayDestination = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
8551
+ var destination = arguments.length > 3 ? arguments[3] : undefined;
8552
+ if ('multilocation' in currency || 'multiasset' in currency) {
8553
+ return null;
8554
+ }
8555
+ var _getAssetsObject = getAssetsObject(node),
8556
+ otherAssets = _getAssetsObject.otherAssets,
8557
+ nativeAssets = _getAssetsObject.nativeAssets,
8558
+ relayChainAssetSymbol = _getAssetsObject.relayChainAssetSymbol;
8559
+ var combinedAssets = destination === 'Ethereum' ? _toConsumableArray(getOtherAssets('Ethereum')) : [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets));
8560
+ var asset;
8561
+ if ('symbol' in currency) {
8562
+ asset = findAssetBySymbol(node, destination, otherAssets, nativeAssets, combinedAssets, currency.symbol, isRelayDestination);
8563
+ } else {
8564
+ asset = findAssetById(combinedAssets, currency.id);
8565
+ }
8566
+ if (asset) {
8567
+ return asset;
8568
+ }
8569
+ if ('symbol' in currency && relayChainAssetSymbol.toLowerCase() === currency.symbol.toLowerCase()) {
8570
+ var relayChainAsset = {
8571
+ symbol: relayChainAssetSymbol,
8572
+ decimals: getAssetDecimals(node, relayChainAssetSymbol)
8573
+ };
8574
+ return relayChainAsset;
8575
+ }
8576
+ return null;
8577
+ };
8578
+
8579
+ var assetsMap = assetsMapJson;
8580
+ var getAssetsObject = function getAssetsObject(node) {
8581
+ return assetsMap[node];
8582
+ };
8583
+ var getAssetId = function getAssetId(node, symbol) {
8584
+ var info = getAssetsObject(node).otherAssets.find(function (o) {
8585
+ return o.symbol === symbol;
8586
+ });
8587
+ return info != null ? info.assetId : null;
8588
+ };
8589
+ var getRelayChainSymbol = function getRelayChainSymbol(node) {
8590
+ return getAssetsObject(node).relayChainAssetSymbol;
8591
+ };
8592
+ var getNativeAssets = function getNativeAssets(node) {
8593
+ return getAssetsObject(node).nativeAssets;
8594
+ };
8595
+ var getOtherAssets = function getOtherAssets(node) {
8596
+ return getAssetsObject(node).otherAssets;
8597
+ };
8598
+ var getAssets = function getAssets(node) {
8599
+ var _getAssetsObject = getAssetsObject(node),
8600
+ nativeAssets = _getAssetsObject.nativeAssets,
8601
+ otherAssets = _getAssetsObject.otherAssets;
8602
+ var relayChainAsset = getAssetBySymbolOrId(determineRelayChain(node), {
8603
+ symbol: getRelayChainSymbol(node)
8604
+ });
8605
+ return [].concat(_toConsumableArray(relayChainAsset ? [relayChainAsset] : []), _toConsumableArray(nativeAssets), _toConsumableArray(otherAssets));
8606
+ };
8607
+ var getAllAssetsSymbols = function getAllAssetsSymbols(node) {
8608
+ var _getAssetsObject2 = getAssetsObject(node),
8609
+ relayChainAssetSymbol = _getAssetsObject2.relayChainAssetSymbol,
8610
+ nativeAssets = _getAssetsObject2.nativeAssets,
8611
+ otherAssets = _getAssetsObject2.otherAssets;
8612
+ var nativeAssetsSymbols = nativeAssets.map(function (_ref) {
8613
+ var symbol = _ref.symbol;
8614
+ return symbol;
8615
+ });
8616
+ var otherAssetsSymbols = otherAssets.filter(function (asset) {
8617
+ return asset.symbol !== undefined;
8618
+ }).map(function (_ref2) {
8619
+ var symbol = _ref2.symbol;
8620
+ return symbol;
8621
+ });
8622
+ return [relayChainAssetSymbol].concat(_toConsumableArray(nativeAssetsSymbols), _toConsumableArray(otherAssetsSymbols));
8623
+ };
8624
+ var getNativeAssetSymbol = function getNativeAssetSymbol(node) {
8625
+ if (node === 'Polkadot') {
8626
+ return 'DOT';
8627
+ } else if (node === 'Kusama') {
8628
+ return 'KSM';
8629
+ }
8630
+ return getAssetsObject(node).nativeAssetSymbol;
8631
+ };
8632
+ var hasSupportForAsset = function hasSupportForAsset(node, symbol) {
8633
+ return getAllAssetsSymbols(node).map(function (s) {
8634
+ return s.toLowerCase();
8635
+ }).includes(symbol.toLowerCase());
8636
+ };
8637
+ var getSupportedAssets = function getSupportedAssets(origin, destination) {
8638
+ var originAssets = getAssets(origin);
8639
+ var destinationAssets = getAssets(destination);
8640
+ if (destination === 'Ethereum' || origin === 'Ethereum') {
8641
+ return getOtherAssets('Ethereum');
8642
+ }
8643
+ if (origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot') {
8644
+ var polkadotAsset = getAssetBySymbolOrId('Polkadot', {
8645
+ symbol: 'DOT'
8646
+ });
8647
+ var kusamaAsset = getAssetBySymbolOrId('Kusama', {
8648
+ symbol: 'KSM'
8649
+ });
8650
+ return [].concat(_toConsumableArray(polkadotAsset ? [polkadotAsset] : []), _toConsumableArray(kusamaAsset ? [kusamaAsset] : []));
8651
+ }
8652
+ return _toConsumableArray(originAssets.filter(function (asset) {
8653
+ return destinationAssets.some(function (a) {
8654
+ return a.symbol === asset.symbol;
8655
+ });
8656
+ }));
8657
+ };
8658
+ var getAssetDecimals = function getAssetDecimals(node, symbol) {
8659
+ var _getAssetsObject3 = getAssetsObject(node),
8660
+ otherAssets = _getAssetsObject3.otherAssets,
8661
+ nativeAssets = _getAssetsObject3.nativeAssets;
8662
+ var asset = [].concat(_toConsumableArray(otherAssets), _toConsumableArray(nativeAssets)).find(function (o) {
8663
+ return o.symbol === symbol;
8664
+ });
8665
+ return (asset === null || asset === void 0 ? void 0 : asset.decimals) !== undefined ? asset.decimals : null;
8666
+ };
8667
+ var getParaId = function getParaId(node) {
8668
+ return getAssetsObject(node).paraId;
8669
+ };
8670
+ var getTNode = function getTNode(paraId) {
8671
+ var _a;
8672
+ return (_a = NODE_NAMES.find(function (node) {
8673
+ return getParaId(node) === paraId;
8674
+ })) !== null && _a !== void 0 ? _a : null;
8675
+ };
8676
+
8677
+ var AssetHubPolkadot$1 = "100000000";
8678
+ var Acala$1 = "100000000000";
8679
+ var Astar$1 = "1000000";
8680
+ var BifrostPolkadot$1 = "10000000000";
8681
+ var Bitgreen$1 = "1000000000";
8682
+ var Centrifuge$1 = "1000000000000";
8683
+ var ComposableFinance$1 = "100000000000";
8684
+ var Darwinia$1 = "0";
8685
+ var Hydration$1 = "1000000000000";
8686
+ var Litentry$1 = "100000000000000000";
8687
+ var Moonbeam$1 = "0";
8688
+ var Parallel$1 = "100000000000";
8689
+ var AssetHubKusama$1 = "3333333";
8690
+ var CoretimeKusama$1 = "33333333";
8691
+ var Encointer$1 = "33333333";
8692
+ var Altair$1 = "1000000000000";
8693
+ var Amplitude$1 = "1000000000";
8694
+ var Bajun$1 = "1000000000";
8695
+ var Basilisk$1 = "1000000000000";
8696
+ var BifrostKusama$1 = "10000000000";
8697
+ var Pioneer$1 = "100000000000000000";
8698
+ var Calamari$1 = "100000000000";
8699
+ var CrustShadow$1 = "100000000000";
8700
+ var Crab$1 = "0";
8701
+ var Imbue$1 = "1000000";
8702
+ var Integritee$1 = "1000000000";
8703
+ var InvArchTinker$1 = "1000000000";
8704
+ var Karura$1 = "100000000000";
8705
+ var Litmus$1 = "100000000000000000";
8706
+ var Moonriver$1 = "0";
8707
+ var ParallelHeiko$1 = "10000000000";
8708
+ var Picasso$1 = "100000000000";
8709
+ var Quartz$1 = "0";
8710
+ var Robonomics$1 = "1000";
8711
+ var Shiden$1 = "1000000";
8712
+ var Turing$1 = "100000000";
8713
+ var Unique$1 = "0";
8714
+ var Crust$1 = "100000000";
8715
+ var Manta$1 = "100000000000000000";
8716
+ var Nodle$1 = "10000";
8717
+ var NeuroWeb$1 = "1000000000000";
8718
+ var Pendulum$1 = "1000000000";
8719
+ var Polkadex$1 = "1000000000000";
8720
+ var Zeitgeist$1 = "50000000";
8721
+ var Polkadot = "10000000000";
8722
+ var Kusama = "333333333";
8723
+ var Interlay$1 = "0";
8724
+ var Kintsugi$1 = "0";
8725
+ var Collectives$1 = "1000000000";
8726
+ var Khala$1 = "10000000000";
8727
+ var Phala$1 = "10000000000";
8728
+ var Subsocial$1 = "100000000";
8729
+ var KiltSpiritnet$1 = "10000000000000";
8730
+ var Curio$1 = "10000000000000000";
8731
+ var BridgeHubPolkadot$1 = "1000000000";
8732
+ var BridgeHubKusama$1 = "33333333";
8733
+ var Mythos$1 = "10000000000000000";
8734
+ var Peaq$1 = "500";
8735
+ var CoretimePolkadot$1 = "1000000000";
8736
+ var Polimec$1 = "100000000";
8737
+ var existentialDeposits = {
8738
+ AssetHubPolkadot: AssetHubPolkadot$1,
8739
+ Acala: Acala$1,
8740
+ Astar: Astar$1,
8741
+ BifrostPolkadot: BifrostPolkadot$1,
8742
+ Bitgreen: Bitgreen$1,
8743
+ Centrifuge: Centrifuge$1,
8744
+ ComposableFinance: ComposableFinance$1,
8745
+ Darwinia: Darwinia$1,
8746
+ Hydration: Hydration$1,
8747
+ Litentry: Litentry$1,
8748
+ Moonbeam: Moonbeam$1,
8749
+ Parallel: Parallel$1,
8750
+ AssetHubKusama: AssetHubKusama$1,
8751
+ CoretimeKusama: CoretimeKusama$1,
8752
+ Encointer: Encointer$1,
8753
+ Altair: Altair$1,
8754
+ Amplitude: Amplitude$1,
8755
+ Bajun: Bajun$1,
8756
+ Basilisk: Basilisk$1,
8757
+ BifrostKusama: BifrostKusama$1,
8758
+ Pioneer: Pioneer$1,
8759
+ Calamari: Calamari$1,
8760
+ CrustShadow: CrustShadow$1,
8761
+ Crab: Crab$1,
8762
+ Imbue: Imbue$1,
8763
+ Integritee: Integritee$1,
8764
+ InvArchTinker: InvArchTinker$1,
8765
+ Karura: Karura$1,
8766
+ Litmus: Litmus$1,
8767
+ Moonriver: Moonriver$1,
8768
+ ParallelHeiko: ParallelHeiko$1,
8769
+ Picasso: Picasso$1,
8770
+ Quartz: Quartz$1,
8771
+ Robonomics: Robonomics$1,
8772
+ Shiden: Shiden$1,
8773
+ Turing: Turing$1,
8774
+ Unique: Unique$1,
8775
+ Crust: Crust$1,
8776
+ Manta: Manta$1,
8777
+ Nodle: Nodle$1,
8778
+ NeuroWeb: NeuroWeb$1,
8779
+ Pendulum: Pendulum$1,
8780
+ Polkadex: Polkadex$1,
8781
+ Zeitgeist: Zeitgeist$1,
8782
+ Polkadot: Polkadot,
8783
+ Kusama: Kusama,
8784
+ Interlay: Interlay$1,
8785
+ Kintsugi: Kintsugi$1,
8786
+ Collectives: Collectives$1,
8787
+ Khala: Khala$1,
8788
+ Phala: Phala$1,
8789
+ Subsocial: Subsocial$1,
8790
+ KiltSpiritnet: KiltSpiritnet$1,
8791
+ Curio: Curio$1,
8792
+ BridgeHubPolkadot: BridgeHubPolkadot$1,
8793
+ BridgeHubKusama: BridgeHubKusama$1,
8794
+ Mythos: Mythos$1,
8795
+ Peaq: Peaq$1,
8796
+ CoretimePolkadot: CoretimePolkadot$1,
8797
+ Polimec: Polimec$1
8798
+ };
8799
+
8800
+ var edsMapJson = /*#__PURE__*/Object.freeze({
8801
+ __proto__: null,
8802
+ Acala: Acala$1,
8803
+ Altair: Altair$1,
8804
+ Amplitude: Amplitude$1,
8805
+ AssetHubKusama: AssetHubKusama$1,
8806
+ AssetHubPolkadot: AssetHubPolkadot$1,
8807
+ Astar: Astar$1,
8808
+ Bajun: Bajun$1,
8809
+ Basilisk: Basilisk$1,
8810
+ BifrostKusama: BifrostKusama$1,
8811
+ BifrostPolkadot: BifrostPolkadot$1,
8812
+ Bitgreen: Bitgreen$1,
8813
+ BridgeHubKusama: BridgeHubKusama$1,
8814
+ BridgeHubPolkadot: BridgeHubPolkadot$1,
8815
+ Calamari: Calamari$1,
8816
+ Centrifuge: Centrifuge$1,
8817
+ Collectives: Collectives$1,
8818
+ ComposableFinance: ComposableFinance$1,
8819
+ CoretimeKusama: CoretimeKusama$1,
8820
+ CoretimePolkadot: CoretimePolkadot$1,
8821
+ Crab: Crab$1,
8822
+ Crust: Crust$1,
8823
+ CrustShadow: CrustShadow$1,
8824
+ Curio: Curio$1,
8825
+ Darwinia: Darwinia$1,
8826
+ Encointer: Encointer$1,
8827
+ Hydration: Hydration$1,
8828
+ Imbue: Imbue$1,
8829
+ Integritee: Integritee$1,
8830
+ Interlay: Interlay$1,
8831
+ InvArchTinker: InvArchTinker$1,
8832
+ Karura: Karura$1,
8833
+ Khala: Khala$1,
8834
+ KiltSpiritnet: KiltSpiritnet$1,
8835
+ Kintsugi: Kintsugi$1,
8836
+ Kusama: Kusama,
8837
+ Litentry: Litentry$1,
8838
+ Litmus: Litmus$1,
8839
+ Manta: Manta$1,
8840
+ Moonbeam: Moonbeam$1,
8841
+ Moonriver: Moonriver$1,
8842
+ Mythos: Mythos$1,
8843
+ NeuroWeb: NeuroWeb$1,
8844
+ Nodle: Nodle$1,
8845
+ Parallel: Parallel$1,
8846
+ ParallelHeiko: ParallelHeiko$1,
8847
+ Peaq: Peaq$1,
8848
+ Pendulum: Pendulum$1,
8849
+ Phala: Phala$1,
8850
+ Picasso: Picasso$1,
8851
+ Pioneer: Pioneer$1,
8852
+ Polimec: Polimec$1,
8853
+ Polkadex: Polkadex$1,
8854
+ Polkadot: Polkadot,
8855
+ Quartz: Quartz$1,
8856
+ Robonomics: Robonomics$1,
8857
+ Shiden: Shiden$1,
8858
+ Subsocial: Subsocial$1,
8859
+ Turing: Turing$1,
8860
+ Unique: Unique$1,
8861
+ Zeitgeist: Zeitgeist$1,
8862
+ default: existentialDeposits
8863
+ });
8864
+
8865
+ var edMap = edsMapJson;
8866
+ var getExistentialDeposit$1 = function getExistentialDeposit(node) {
8867
+ return edMap[node];
8220
8868
  };
8221
- var getSupportedPallets = function getSupportedPallets(node) {
8222
- return palletsMap$1[node].supportedPallets;
8869
+
8870
+ var getBalanceNative = function getBalanceNative(address, node, api) {
8871
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8872
+ var apiWithFallback, response, balance;
8873
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
8874
+ while (1) switch (_context.prev = _context.next) {
8875
+ case 0:
8876
+ if (!(api !== null && api !== void 0)) {
8877
+ _context.next = 4;
8878
+ break;
8879
+ }
8880
+ _context.t0 = api;
8881
+ _context.next = 7;
8882
+ break;
8883
+ case 4:
8884
+ _context.next = 6;
8885
+ return createApiInstanceForNode(node);
8886
+ case 6:
8887
+ _context.t0 = _context.sent;
8888
+ case 7:
8889
+ apiWithFallback = _context.t0;
8890
+ _context.next = 10;
8891
+ return apiWithFallback.query.system.account(address);
8892
+ case 10:
8893
+ response = _context.sent;
8894
+ balance = response.data.free.toBn();
8895
+ return _context.abrupt("return", BigInt(balance.toString()));
8896
+ case 13:
8897
+ case "end":
8898
+ return _context.stop();
8899
+ }
8900
+ }, _callee);
8901
+ }));
8223
8902
  };
8224
8903
 
8225
8904
  var getBalanceForeignXTokens = function getBalanceForeignXTokens(address, symbolOrId, symbol, id, api) {
8226
8905
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8227
- var response, entry;
8906
+ var response, entry, accountData;
8228
8907
  return _regeneratorRuntime().wrap(function _callee$(_context) {
8229
8908
  while (1) switch (_context.prev = _context.next) {
8230
8909
  case 0:
@@ -8238,17 +8917,19 @@ var getBalanceForeignXTokens = function getBalanceForeignXTokens(address, symbol
8238
8917
  _ref2$0$args[0];
8239
8918
  var asset = _ref2$0$args[1];
8240
8919
  _ref2[1];
8241
- var _a, _b, _c;
8242
- return asset.toString() === symbolOrId || asset.toString() === id || asset.toString() === symbol || Object.values((_a = asset.toHuman()) !== null && _a !== void 0 ? _a : {}).toString() === symbolOrId || Object.values((_b = asset.toHuman()) !== null && _b !== void 0 ? _b : {}).toString() === id || Object.values((_c = asset.toHuman()) !== null && _c !== void 0 ? _c : {}).toString() === symbol;
8920
+ var _a, _b, _c, _d;
8921
+ return 'symbol' in symbolOrId && asset.toString() === symbolOrId.symbol || 'id' in symbolOrId && asset.toString() === symbolOrId.id || asset.toString() === id || asset.toString() === symbol || 'symbol' in symbolOrId && Object.values((_a = asset.toHuman()) !== null && _a !== void 0 ? _a : {}).toString() === symbolOrId.symbol || 'id' in symbolOrId && Object.values((_b = asset.toHuman()) !== null && _b !== void 0 ? _b : {}).toString() === symbolOrId.id || Object.values((_c = asset.toHuman()) !== null && _c !== void 0 ? _c : {}).toString() === id || Object.values((_d = asset.toHuman()) !== null && _d !== void 0 ? _d : {}).toString() === symbol;
8243
8922
  });
8244
- return _context.abrupt("return", entry ? BigInt(entry[1].free.toString()) : null);
8245
- case 5:
8923
+ accountData = entry ? entry[1] : null;
8924
+ return _context.abrupt("return", accountData ? BigInt(accountData.free.toString()) : null);
8925
+ case 6:
8246
8926
  case "end":
8247
8927
  return _context.stop();
8248
8928
  }
8249
8929
  }, _callee);
8250
8930
  }));
8251
8931
  };
8932
+
8252
8933
  var getAssetHubMultiLocation = function getAssetHubMultiLocation(symbol) {
8253
8934
  if (symbol === 'MYTH') {
8254
8935
  return {
@@ -8294,295 +8975,170 @@ var getAssetHubMultiLocation = function getAssetHubMultiLocation(symbol) {
8294
8975
  }
8295
8976
  return null;
8296
8977
  };
8978
+
8297
8979
  var getBalanceForeignPolkadotXcm = function getBalanceForeignPolkadotXcm(address, id, api, node, symbol) {
8298
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
8980
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
8299
8981
  var _response, _obj, multiLocation, _response2, _obj2, parsedId, response, obj;
8300
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
8301
- while (1) switch (_context2.prev = _context2.next) {
8982
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
8983
+ while (1) switch (_context.prev = _context.next) {
8302
8984
  case 0:
8303
- _context2.prev = 0;
8985
+ _context.prev = 0;
8304
8986
  if (!(node === 'Mythos')) {
8305
- _context2.next = 7;
8987
+ _context.next = 7;
8306
8988
  break;
8307
8989
  }
8308
- _context2.next = 4;
8990
+ _context.next = 4;
8309
8991
  return api.query.balances.account(address);
8310
8992
  case 4:
8311
- _response = _context2.sent;
8993
+ _response = _context.sent;
8312
8994
  _obj = _response.toJSON();
8313
- return _context2.abrupt("return", BigInt(_obj.free));
8995
+ return _context.abrupt("return", _obj.free ? BigInt(_obj.free) : null);
8314
8996
  case 7:
8315
8997
  if (!(node === 'AssetHubPolkadot')) {
8316
- _context2.next = 15;
8998
+ _context.next = 15;
8317
8999
  break;
8318
9000
  }
8319
9001
  multiLocation = getAssetHubMultiLocation(symbol !== null && symbol !== void 0 ? symbol : id);
8320
9002
  if (!multiLocation) {
8321
- _context2.next = 15;
9003
+ _context.next = 15;
8322
9004
  break;
8323
9005
  }
8324
- _context2.next = 12;
9006
+ _context.next = 12;
8325
9007
  return api.query.foreignAssets.account(multiLocation, address);
8326
9008
  case 12:
8327
- _response2 = _context2.sent;
9009
+ _response2 = _context.sent;
8328
9010
  _obj2 = _response2.toJSON();
8329
- return _context2.abrupt("return", BigInt(_obj2 === null ? 0 : _obj2.balance));
9011
+ return _context.abrupt("return", BigInt(_obj2 === null || !_obj2.balance ? 0 : _obj2.balance));
8330
9012
  case 15:
8331
9013
  parsedId = new u32(api.registry, id);
8332
- _context2.next = 18;
9014
+ _context.next = 18;
8333
9015
  return api.query.assets.account(parsedId, address);
8334
9016
  case 18:
8335
- response = _context2.sent;
9017
+ response = _context.sent;
8336
9018
  obj = response.toJSON();
8337
- return _context2.abrupt("return", BigInt(obj.balance));
9019
+ return _context.abrupt("return", obj.balance ? BigInt(obj.balance) : null);
8338
9020
  case 23:
8339
- _context2.prev = 23;
8340
- _context2.t0 = _context2["catch"](0);
8341
- console.log('Error while fetching balance', _context2.t0);
8342
- return _context2.abrupt("return", null);
9021
+ _context.prev = 23;
9022
+ _context.t0 = _context["catch"](0);
9023
+ console.log('Error while fetching balance', _context.t0);
9024
+ return _context.abrupt("return", null);
8343
9025
  case 27:
8344
9026
  case "end":
8345
- return _context2.stop();
9027
+ return _context.stop();
8346
9028
  }
8347
- }, _callee2, null, [[0, 23]]);
9029
+ }, _callee, null, [[0, 23]]);
8348
9030
  }));
8349
9031
  };
9032
+
8350
9033
  var getBalanceForeign = function getBalanceForeign(address, node, symbolOrId, api) {
8351
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee3() {
8352
- var _a, apiWithFallback, asset;
8353
- return _regeneratorRuntime().wrap(function _callee3$(_context3) {
8354
- while (1) switch (_context3.prev = _context3.next) {
9034
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9035
+ var _a, apiWithFallback, asset, currencyStr;
9036
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9037
+ while (1) switch (_context.prev = _context.next) {
8355
9038
  case 0:
8356
9039
  if (!(api !== null && api !== void 0)) {
8357
- _context3.next = 4;
9040
+ _context.next = 4;
8358
9041
  break;
8359
9042
  }
8360
- _context3.t0 = api;
8361
- _context3.next = 7;
9043
+ _context.t0 = api;
9044
+ _context.next = 7;
8362
9045
  break;
8363
9046
  case 4:
8364
- _context3.next = 6;
9047
+ _context.next = 6;
8365
9048
  return createApiInstanceForNode(node);
8366
9049
  case 6:
8367
- _context3.t0 = _context3.sent;
9050
+ _context.t0 = _context.sent;
8368
9051
  case 7:
8369
- apiWithFallback = _context3.t0;
9052
+ apiWithFallback = _context.t0;
8370
9053
  asset = getAssetBySymbolOrId(node, symbolOrId);
8371
9054
  if (!(getDefaultPallet(node) === 'XTokens')) {
8372
- _context3.next = 15;
9055
+ _context.next = 15;
8373
9056
  break;
8374
9057
  }
8375
- _context3.next = 12;
9058
+ _context.next = 12;
8376
9059
  return getBalanceForeignXTokens(address, symbolOrId, asset === null || asset === void 0 ? void 0 : asset.symbol, asset === null || asset === void 0 ? void 0 : asset.assetId, apiWithFallback);
8377
9060
  case 12:
8378
- return _context3.abrupt("return", _context3.sent);
9061
+ return _context.abrupt("return", _context.sent);
8379
9062
  case 15:
8380
9063
  if (!(getDefaultPallet(node) === 'PolkadotXcm')) {
8381
- _context3.next = 19;
9064
+ _context.next = 20;
8382
9065
  break;
8383
9066
  }
8384
- _context3.next = 18;
8385
- return getBalanceForeignPolkadotXcm(address, (_a = asset === null || asset === void 0 ? void 0 : asset.assetId) !== null && _a !== void 0 ? _a : symbolOrId, apiWithFallback, node, asset === null || asset === void 0 ? void 0 : asset.symbol);
8386
- case 18:
8387
- return _context3.abrupt("return", _context3.sent);
9067
+ currencyStr = 'symbol' in symbolOrId ? symbolOrId.symbol : 'id' in symbolOrId ? symbolOrId.id.toString() : undefined;
9068
+ _context.next = 19;
9069
+ return getBalanceForeignPolkadotXcm(address, (_a = asset === null || asset === void 0 ? void 0 : asset.assetId) !== null && _a !== void 0 ? _a : currencyStr, apiWithFallback, node, asset === null || asset === void 0 ? void 0 : asset.symbol);
8388
9070
  case 19:
8389
- throw new Error('Unsupported pallet');
9071
+ return _context.abrupt("return", _context.sent);
8390
9072
  case 20:
9073
+ throw new Error('Unsupported pallet');
9074
+ case 21:
8391
9075
  case "end":
8392
- return _context3.stop();
9076
+ return _context.stop();
8393
9077
  }
8394
- }, _callee3);
9078
+ }, _callee);
8395
9079
  }));
8396
9080
  };
8397
9081
 
8398
- var AssetHubPolkadot$1 = "100000000";
8399
- var Acala$1 = "100000000000";
8400
- var Astar$1 = "1000000";
8401
- var BifrostPolkadot$1 = "10000000000";
8402
- var Bitgreen$1 = "1000000000";
8403
- var Centrifuge$1 = "1000000000000";
8404
- var ComposableFinance$1 = "100000000000";
8405
- var Darwinia$1 = "0";
8406
- var Hydration$1 = "1000000000000";
8407
- var Litentry$1 = "100000000000000000";
8408
- var Moonbeam$1 = "0";
8409
- var Parallel$1 = "100000000000";
8410
- var AssetHubKusama$1 = "3333333";
8411
- var CoretimeKusama$1 = "33333333";
8412
- var Encointer$1 = "33333333";
8413
- var Altair$1 = "1000000000000";
8414
- var Amplitude$1 = "1000000000";
8415
- var Bajun$1 = "1000000000";
8416
- var Basilisk$1 = "1000000000000";
8417
- var BifrostKusama$1 = "10000000000";
8418
- var Pioneer$1 = "100000000000000000";
8419
- var Calamari$1 = "100000000000";
8420
- var CrustShadow$1 = "100000000000";
8421
- var Crab$1 = "0";
8422
- var Imbue$1 = "1000000";
8423
- var Integritee$1 = "1000000000";
8424
- var InvArchTinker$1 = "1000000000";
8425
- var Karura$1 = "100000000000";
8426
- var Litmus$1 = "100000000000000000";
8427
- var Moonriver$1 = "0";
8428
- var ParallelHeiko$1 = "10000000000";
8429
- var Picasso$1 = "100000000000";
8430
- var Quartz$1 = "0";
8431
- var Robonomics$1 = "1000";
8432
- var Shiden$1 = "1000000";
8433
- var Turing$1 = "100000000";
8434
- var Unique$1 = "0";
8435
- var Crust$1 = "100000000";
8436
- var Manta$1 = "100000000000000000";
8437
- var Nodle$1 = "10000";
8438
- var NeuroWeb$1 = "1000000000000";
8439
- var Pendulum$1 = "1000000000";
8440
- var Polkadex$1 = "1000000000000";
8441
- var Zeitgeist$1 = "50000000";
8442
- var Polkadot = "10000000000";
8443
- var Kusama = "333333333";
8444
- var Interlay$1 = "0";
8445
- var Kintsugi$1 = "0";
8446
- var Collectives$1 = "1000000000";
8447
- var Khala$1 = "10000000000";
8448
- var Phala$1 = "10000000000";
8449
- var Subsocial$1 = "100000000";
8450
- var KiltSpiritnet$1 = "10000000000000";
8451
- var Curio$1 = "10000000000000000";
8452
- var BridgeHubPolkadot$1 = "1000000000";
8453
- var BridgeHubKusama$1 = "33333333";
8454
- var Mythos$1 = "10000000000000000";
8455
- var Peaq$1 = "500";
8456
- var existentialDeposits = {
8457
- AssetHubPolkadot: AssetHubPolkadot$1,
8458
- Acala: Acala$1,
8459
- Astar: Astar$1,
8460
- BifrostPolkadot: BifrostPolkadot$1,
8461
- Bitgreen: Bitgreen$1,
8462
- Centrifuge: Centrifuge$1,
8463
- ComposableFinance: ComposableFinance$1,
8464
- Darwinia: Darwinia$1,
8465
- Hydration: Hydration$1,
8466
- Litentry: Litentry$1,
8467
- Moonbeam: Moonbeam$1,
8468
- Parallel: Parallel$1,
8469
- AssetHubKusama: AssetHubKusama$1,
8470
- CoretimeKusama: CoretimeKusama$1,
8471
- Encointer: Encointer$1,
8472
- Altair: Altair$1,
8473
- Amplitude: Amplitude$1,
8474
- Bajun: Bajun$1,
8475
- Basilisk: Basilisk$1,
8476
- BifrostKusama: BifrostKusama$1,
8477
- Pioneer: Pioneer$1,
8478
- Calamari: Calamari$1,
8479
- CrustShadow: CrustShadow$1,
8480
- Crab: Crab$1,
8481
- Imbue: Imbue$1,
8482
- Integritee: Integritee$1,
8483
- InvArchTinker: InvArchTinker$1,
8484
- Karura: Karura$1,
8485
- Litmus: Litmus$1,
8486
- Moonriver: Moonriver$1,
8487
- ParallelHeiko: ParallelHeiko$1,
8488
- Picasso: Picasso$1,
8489
- Quartz: Quartz$1,
8490
- Robonomics: Robonomics$1,
8491
- Shiden: Shiden$1,
8492
- Turing: Turing$1,
8493
- Unique: Unique$1,
8494
- Crust: Crust$1,
8495
- Manta: Manta$1,
8496
- Nodle: Nodle$1,
8497
- NeuroWeb: NeuroWeb$1,
8498
- Pendulum: Pendulum$1,
8499
- Polkadex: Polkadex$1,
8500
- Zeitgeist: Zeitgeist$1,
8501
- Polkadot: Polkadot,
8502
- Kusama: Kusama,
8503
- Interlay: Interlay$1,
8504
- Kintsugi: Kintsugi$1,
8505
- Collectives: Collectives$1,
8506
- Khala: Khala$1,
8507
- Phala: Phala$1,
8508
- Subsocial: Subsocial$1,
8509
- KiltSpiritnet: KiltSpiritnet$1,
8510
- Curio: Curio$1,
8511
- BridgeHubPolkadot: BridgeHubPolkadot$1,
8512
- BridgeHubKusama: BridgeHubKusama$1,
8513
- Mythos: Mythos$1,
8514
- Peaq: Peaq$1
9082
+ var getAssetBalance = function getAssetBalance(account, node, currency) {
9083
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9084
+ var _a, api, isNativeSymbol;
9085
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
9086
+ while (1) switch (_context.prev = _context.next) {
9087
+ case 0:
9088
+ _context.next = 2;
9089
+ return createApiInstanceForNode(node);
9090
+ case 2:
9091
+ api = _context.sent;
9092
+ isNativeSymbol = 'symbol' in currency && getNativeAssetSymbol(node) === currency.symbol;
9093
+ if (!isNativeSymbol) {
9094
+ _context.next = 10;
9095
+ break;
9096
+ }
9097
+ _context.next = 7;
9098
+ return getBalanceNative(account, node, api);
9099
+ case 7:
9100
+ _context.t0 = _context.sent;
9101
+ _context.next = 22;
9102
+ break;
9103
+ case 10:
9104
+ _context.next = 12;
9105
+ return getBalanceForeign(account, node, currency, api);
9106
+ case 12:
9107
+ _context.t2 = _a = _context.sent;
9108
+ _context.t1 = _context.t2 !== null;
9109
+ if (!_context.t1) {
9110
+ _context.next = 16;
9111
+ break;
9112
+ }
9113
+ _context.t1 = _a !== void 0;
9114
+ case 16:
9115
+ if (!_context.t1) {
9116
+ _context.next = 20;
9117
+ break;
9118
+ }
9119
+ _context.t3 = _a;
9120
+ _context.next = 21;
9121
+ break;
9122
+ case 20:
9123
+ _context.t3 = BigInt(0);
9124
+ case 21:
9125
+ _context.t0 = _context.t3;
9126
+ case 22:
9127
+ return _context.abrupt("return", _context.t0);
9128
+ case 23:
9129
+ case "end":
9130
+ return _context.stop();
9131
+ }
9132
+ }, _callee);
9133
+ }));
8515
9134
  };
8516
9135
 
8517
- var edMapJson = /*#__PURE__*/Object.freeze({
8518
- __proto__: null,
8519
- Acala: Acala$1,
8520
- Altair: Altair$1,
8521
- Amplitude: Amplitude$1,
8522
- AssetHubKusama: AssetHubKusama$1,
8523
- AssetHubPolkadot: AssetHubPolkadot$1,
8524
- Astar: Astar$1,
8525
- Bajun: Bajun$1,
8526
- Basilisk: Basilisk$1,
8527
- BifrostKusama: BifrostKusama$1,
8528
- BifrostPolkadot: BifrostPolkadot$1,
8529
- Bitgreen: Bitgreen$1,
8530
- BridgeHubKusama: BridgeHubKusama$1,
8531
- BridgeHubPolkadot: BridgeHubPolkadot$1,
8532
- Calamari: Calamari$1,
8533
- Centrifuge: Centrifuge$1,
8534
- Collectives: Collectives$1,
8535
- ComposableFinance: ComposableFinance$1,
8536
- CoretimeKusama: CoretimeKusama$1,
8537
- Crab: Crab$1,
8538
- Crust: Crust$1,
8539
- CrustShadow: CrustShadow$1,
8540
- Curio: Curio$1,
8541
- Darwinia: Darwinia$1,
8542
- Encointer: Encointer$1,
8543
- Hydration: Hydration$1,
8544
- Imbue: Imbue$1,
8545
- Integritee: Integritee$1,
8546
- Interlay: Interlay$1,
8547
- InvArchTinker: InvArchTinker$1,
8548
- Karura: Karura$1,
8549
- Khala: Khala$1,
8550
- KiltSpiritnet: KiltSpiritnet$1,
8551
- Kintsugi: Kintsugi$1,
8552
- Kusama: Kusama,
8553
- Litentry: Litentry$1,
8554
- Litmus: Litmus$1,
8555
- Manta: Manta$1,
8556
- Moonbeam: Moonbeam$1,
8557
- Moonriver: Moonriver$1,
8558
- Mythos: Mythos$1,
8559
- NeuroWeb: NeuroWeb$1,
8560
- Nodle: Nodle$1,
8561
- Parallel: Parallel$1,
8562
- ParallelHeiko: ParallelHeiko$1,
8563
- Peaq: Peaq$1,
8564
- Pendulum: Pendulum$1,
8565
- Phala: Phala$1,
8566
- Picasso: Picasso$1,
8567
- Pioneer: Pioneer$1,
8568
- Polkadex: Polkadex$1,
8569
- Polkadot: Polkadot,
8570
- Quartz: Quartz$1,
8571
- Robonomics: Robonomics$1,
8572
- Shiden: Shiden$1,
8573
- Subsocial: Subsocial$1,
8574
- Turing: Turing$1,
8575
- Unique: Unique$1,
8576
- Zeitgeist: Zeitgeist$1,
8577
- default: existentialDeposits
8578
- });
8579
-
8580
- var palletsMap = edMapJson;
8581
- var getExistentialDeposit$1 = function getExistentialDeposit(node) {
9136
+ var palletsMap = edsMapJson;
9137
+ var getExistentialDeposit = function getExistentialDeposit(node) {
8582
9138
  return BigInt(palletsMap[node]);
8583
9139
  };
8584
9140
  var getMinNativeTransferableAmount = function getMinNativeTransferableAmount(node) {
8585
- var ed = getExistentialDeposit$1(node);
9141
+ var ed = getExistentialDeposit(node);
8586
9142
  var tenPercent = ed / BigInt(10);
8587
9143
  return ed + tenPercent;
8588
9144
  };
@@ -8592,7 +9148,7 @@ var getMaxNativeTransferableAmount = function getMaxNativeTransferableAmount(add
8592
9148
  return _regeneratorRuntime().wrap(function _callee$(_context) {
8593
9149
  while (1) switch (_context.prev = _context.next) {
8594
9150
  case 0:
8595
- ed = getExistentialDeposit$1(node);
9151
+ ed = getExistentialDeposit(node);
8596
9152
  _context.next = 3;
8597
9153
  return getBalanceNative(address, node);
8598
9154
  case 3:
@@ -8607,180 +9163,6 @@ var getMaxNativeTransferableAmount = function getMaxNativeTransferableAmount(add
8607
9163
  }));
8608
9164
  };
8609
9165
 
8610
- // Contains call formatting for closing HRMP channels functionality
8611
- var closeChannelInternal = function closeChannelInternal(options) {
8612
- var _api$tx$module;
8613
- var api = options.api,
8614
- origin = options.origin,
8615
- inbound = options.inbound,
8616
- outbound = options.outbound,
8617
- _options$serializedAp = options.serializedApiCallEnabled,
8618
- serializedApiCallEnabled = _options$serializedAp === void 0 ? false : _options$serializedAp;
8619
- var module = 'hrmp';
8620
- var section = 'forceCleanHrmp';
8621
- var parameters = [getParaId(origin), inbound, outbound];
8622
- if (serializedApiCallEnabled) {
8623
- return {
8624
- module: module,
8625
- section: section,
8626
- parameters: parameters
8627
- };
8628
- }
8629
- return api.tx.sudo.sudo((_api$tx$module = api.tx[module])[section].apply(_api$tx$module, parameters));
8630
- };
8631
- var closeChannel = function closeChannel(options) {
8632
- return closeChannelInternal(options);
8633
- };
8634
- var closeChannelSerializedApiCall = function closeChannelSerializedApiCall(options) {
8635
- return closeChannelInternal(Object.assign(Object.assign({}, options), {
8636
- serializedApiCallEnabled: true
8637
- }));
8638
- };
8639
-
8640
- var index$3 = /*#__PURE__*/Object.freeze({
8641
- __proto__: null,
8642
- closeChannel: closeChannel,
8643
- closeChannelSerializedApiCall: closeChannelSerializedApiCall
8644
- });
8645
-
8646
- var CloseChannelBuilder = /*#__PURE__*/function () {
8647
- function CloseChannelBuilder(api, from) {
8648
- _classCallCheck(this, CloseChannelBuilder);
8649
- this.api = api;
8650
- this.from = from;
8651
- }
8652
- return _createClass(CloseChannelBuilder, [{
8653
- key: "inbound",
8654
- value: function inbound(_inbound) {
8655
- this._inbound = _inbound;
8656
- return this;
8657
- }
8658
- }, {
8659
- key: "outbound",
8660
- value: function outbound(_outbound) {
8661
- this._outbound = _outbound;
8662
- return this;
8663
- }
8664
- }, {
8665
- key: "buildOptions",
8666
- value: function buildOptions() {
8667
- return {
8668
- api: this.api,
8669
- origin: this.from,
8670
- inbound: this._inbound,
8671
- outbound: this._outbound
8672
- };
8673
- }
8674
- }, {
8675
- key: "build",
8676
- value: function build() {
8677
- var options = this.buildOptions();
8678
- return closeChannel(options);
8679
- }
8680
- }, {
8681
- key: "buildSerializedApiCall",
8682
- value: function buildSerializedApiCall() {
8683
- var options = this.buildOptions();
8684
- return closeChannelSerializedApiCall(options);
8685
- }
8686
- }], [{
8687
- key: "create",
8688
- value: function create(api, from) {
8689
- return new CloseChannelBuilder(api, from);
8690
- }
8691
- }]);
8692
- }();
8693
-
8694
- // Contains call formatting for opening HRMP channels functionality
8695
- var openChannelInternal = function openChannelInternal(options) {
8696
- var _api$tx$module;
8697
- var api = options.api,
8698
- origin = options.origin,
8699
- destination = options.destination,
8700
- maxSize = options.maxSize,
8701
- maxMessageSize = options.maxMessageSize,
8702
- _options$serializedAp = options.serializedApiCallEnabled,
8703
- serializedApiCallEnabled = _options$serializedAp === void 0 ? false : _options$serializedAp;
8704
- var module = 'parasSudoWrapper';
8705
- var section = 'sudoEstablishHrmpChannel';
8706
- var parameters = [getParaId(origin), getParaId(destination), maxSize, maxMessageSize];
8707
- if (serializedApiCallEnabled) {
8708
- return {
8709
- module: module,
8710
- section: section,
8711
- parameters: parameters
8712
- };
8713
- }
8714
- return api.tx.sudo.sudo((_api$tx$module = api.tx[module])[section].apply(_api$tx$module, parameters));
8715
- };
8716
- var openChannel = function openChannel(options) {
8717
- return openChannelInternal(options);
8718
- };
8719
- var openChannelSerializedApiCall = function openChannelSerializedApiCall(options) {
8720
- return openChannelInternal(Object.assign(Object.assign({}, options), {
8721
- serializedApiCallEnabled: true
8722
- }));
8723
- };
8724
-
8725
- var index$2 = /*#__PURE__*/Object.freeze({
8726
- __proto__: null,
8727
- openChannel: openChannel,
8728
- openChannelSerializedApiCall: openChannelSerializedApiCall
8729
- });
8730
-
8731
- var OpenChannelBuilder = /*#__PURE__*/function () {
8732
- function OpenChannelBuilder(api, from, to) {
8733
- _classCallCheck(this, OpenChannelBuilder);
8734
- this.api = api;
8735
- this.from = from;
8736
- this.to = to;
8737
- }
8738
- return _createClass(OpenChannelBuilder, [{
8739
- key: "maxSize",
8740
- value: function maxSize(size) {
8741
- this._maxSize = size;
8742
- return this;
8743
- }
8744
- }, {
8745
- key: "maxMessageSize",
8746
- value: function maxMessageSize(size) {
8747
- this._maxMessageSize = size;
8748
- return this;
8749
- }
8750
- }, {
8751
- key: "buildOptions",
8752
- value: function buildOptions() {
8753
- if (_typeof(this.to) === 'object') {
8754
- throw new Error('Channels do not support multi-location destinations');
8755
- }
8756
- return {
8757
- api: this.api,
8758
- origin: this.from,
8759
- destination: this.to,
8760
- maxSize: this._maxSize,
8761
- maxMessageSize: this._maxMessageSize
8762
- };
8763
- }
8764
- }, {
8765
- key: "build",
8766
- value: function build() {
8767
- var options = this.buildOptions();
8768
- return openChannel(options);
8769
- }
8770
- }, {
8771
- key: "buildSerializedApiCall",
8772
- value: function buildSerializedApiCall() {
8773
- var options = this.buildOptions();
8774
- return openChannelSerializedApiCall(options);
8775
- }
8776
- }], [{
8777
- key: "create",
8778
- value: function create(api, from, to) {
8779
- return new OpenChannelBuilder(api, from, to);
8780
- }
8781
- }]);
8782
- }();
8783
-
8784
9166
  var RelayToParaBuilder = /*#__PURE__*/function () {
8785
9167
  function RelayToParaBuilder(api, to, batchManager, paraIdTo) {
8786
9168
  _classCallCheck(this, RelayToParaBuilder);
@@ -9040,7 +9422,9 @@ var ParaToRelayBuilder = /*#__PURE__*/function () {
9040
9422
  return {
9041
9423
  api: this.api,
9042
9424
  origin: this.from,
9043
- currency: currency,
9425
+ currency: {
9426
+ symbol: currency
9427
+ },
9044
9428
  amount: this.amount,
9045
9429
  address: this._address,
9046
9430
  feeAsset: this.feeAsset,
@@ -9103,20 +9487,134 @@ var ParaToRelayBuilder = /*#__PURE__*/function () {
9103
9487
  value: function create(api, from, amount, batchManager, feeAsset) {
9104
9488
  return new ParaToRelayBuilder(api, from, amount, batchManager, feeAsset);
9105
9489
  }
9106
- }]);
9107
- }();
9108
-
9109
- var MissingApiPromiseError = /*#__PURE__*/function (_Error) {
9110
- function MissingApiPromiseError() {
9111
- var _this;
9112
- _classCallCheck(this, MissingApiPromiseError);
9113
- _this = _callSuper(this, MissingApiPromiseError, ['Please provide ApiPromise instance.']);
9114
- _this.name = 'MissingApiPromise';
9115
- return _this;
9490
+ }]);
9491
+ }();
9492
+
9493
+ var findParachainJunction = function findParachainJunction(multilocation) {
9494
+ var interior = multilocation.interior;
9495
+ if (interior === 'Here') {
9496
+ return null;
9497
+ }
9498
+ for (var key in interior) {
9499
+ var junctions = interior[key];
9500
+ if (Array.isArray(junctions)) {
9501
+ var _iterator = _createForOfIteratorHelper(junctions),
9502
+ _step;
9503
+ try {
9504
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
9505
+ var junction = _step.value;
9506
+ if ('Parachain' in junction) {
9507
+ return Number(junction.Parachain);
9508
+ }
9509
+ }
9510
+ } catch (err) {
9511
+ _iterator.e(err);
9512
+ } finally {
9513
+ _iterator.f();
9514
+ }
9515
+ } else if (_typeof(junctions) === 'object' && junctions !== null && 'Parachain' in junctions) {
9516
+ return Number(junctions.Parachain);
9517
+ }
9518
+ }
9519
+ return null;
9520
+ };
9521
+
9522
+ var constructRelayToParaParameters = function constructRelayToParaParameters(_ref, version) {
9523
+ var api = _ref.api,
9524
+ destination = _ref.destination,
9525
+ address = _ref.address,
9526
+ amount = _ref.amount,
9527
+ paraIdTo = _ref.paraIdTo;
9528
+ var includeFee = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
9529
+ var paraId = destination !== undefined && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
9530
+ var parameters = [createPolkadotXcmHeader('RelayToPara', version, destination, paraId), generateAddressPayload(api, 'RelayToPara', null, address, version, paraId), createCurrencySpec(amount, version, Parents.ZERO), 0];
9531
+ if (includeFee) {
9532
+ parameters.push('Unlimited');
9533
+ }
9534
+ return parameters;
9535
+ };
9536
+ var isTMultiLocation = function isTMultiLocation(value) {
9537
+ return _typeof(value) === 'object' && value !== null && 'parents' in value && 'interior' in value;
9538
+ };
9539
+ var createBridgeCurrencySpec = function createBridgeCurrencySpec(amount, ecosystem) {
9540
+ return _defineProperty({}, Version.V4, [{
9541
+ id: {
9542
+ parents: Parents.TWO,
9543
+ interior: {
9544
+ X1: [{
9545
+ GlobalConsensus: ecosystem
9546
+ }]
9547
+ }
9548
+ },
9549
+ fun: {
9550
+ Fungible: amount
9551
+ }
9552
+ }]);
9553
+ };
9554
+ var createCurrencySpec = function createCurrencySpec(amount, version, parents, overriddenCurrency) {
9555
+ var interior = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : 'Here';
9556
+ if (!overriddenCurrency) {
9557
+ return _defineProperty({}, version, [{
9558
+ id: version === Version.V4 ? {
9559
+ parents: parents,
9560
+ interior: interior
9561
+ } : {
9562
+ Concrete: {
9563
+ parents: parents,
9564
+ interior: interior
9565
+ }
9566
+ },
9567
+ fun: {
9568
+ Fungible: amount
9569
+ }
9570
+ }]);
9571
+ }
9572
+ return isTMultiLocation(overriddenCurrency) ? _defineProperty({}, version, [{
9573
+ id: version === Version.V4 ? overriddenCurrency : {
9574
+ Concrete: overriddenCurrency
9575
+ },
9576
+ fun: {
9577
+ Fungible: amount
9578
+ }
9579
+ }]) : // It must be TMultiAsset if not TMultiLocation
9580
+ _defineProperty({}, version, overriddenCurrency);
9581
+ };
9582
+ var createPolkadotXcmHeader = function createPolkadotXcmHeader(scenario, version, destination, nodeId, junction, parents) {
9583
+ var parentsResolved = parents !== null && parents !== void 0 ? parents : scenario === 'RelayToPara' ? Parents.ZERO : Parents.ONE;
9584
+ var interior = scenario === 'ParaToRelay' ? 'Here' : createX1Payload(version, junction !== null && junction !== void 0 ? junction : {
9585
+ Parachain: nodeId
9586
+ });
9587
+ var isMultiLocationDestination = _typeof(destination) === 'object';
9588
+ return _defineProperty({}, version, isMultiLocationDestination ? destination : {
9589
+ parents: parentsResolved,
9590
+ interior: interior
9591
+ });
9592
+ };
9593
+ var createBridgePolkadotXcmDest = function createBridgePolkadotXcmDest(version, ecosystem, destination, nodeId) {
9594
+ var multiLocation = {
9595
+ parents: Parents.TWO,
9596
+ interior: {
9597
+ X2: [{
9598
+ GlobalConsensus: ecosystem
9599
+ }, {
9600
+ Parachain: nodeId
9601
+ }]
9602
+ }
9603
+ };
9604
+ var isMultiLocationDestination = _typeof(destination) === 'object';
9605
+ return _defineProperty({}, version, isMultiLocationDestination ? destination : multiLocation);
9606
+ };
9607
+ var resolveTNodeFromMultiLocation = function resolveTNodeFromMultiLocation(multiLocation) {
9608
+ var parachainId = findParachainJunction(multiLocation);
9609
+ if (parachainId === null) {
9610
+ throw new Error('Parachain ID not found in destination multi location.');
9116
9611
  }
9117
- _inherits(MissingApiPromiseError, _Error);
9118
- return _createClass(MissingApiPromiseError);
9119
- }(/*#__PURE__*/_wrapNativeSuper(Error));
9612
+ var node = getTNode(parachainId);
9613
+ if (node === null) {
9614
+ throw new Error('Node with specified paraId not found in destination multi location.');
9615
+ }
9616
+ return node;
9617
+ };
9120
9618
 
9121
9619
  var buildBeneficiaryInput = function buildBeneficiaryInput(api, address) {
9122
9620
  if (isTMultiLocation(address)) {
@@ -9387,14 +9885,6 @@ var ToGeneralBuilder = /*#__PURE__*/function () {
9387
9885
  value: function currency(_currency) {
9388
9886
  return ParaToParaBuilder.createParaToPara(this.api, this.from, this.to, _currency, this.batchManager, this.paraIdTo);
9389
9887
  }
9390
- }, {
9391
- key: "openChannel",
9392
- value: function openChannel() {
9393
- if (this.api === undefined) {
9394
- throw new MissingApiPromiseError();
9395
- }
9396
- return OpenChannelBuilder.create(this.api, this.from, this.to);
9397
- }
9398
9888
  }]);
9399
9889
  }();
9400
9890
  var FromGeneralBuilder = /*#__PURE__*/function () {
@@ -9420,14 +9910,6 @@ var FromGeneralBuilder = /*#__PURE__*/function () {
9420
9910
  value: function amount(_amount) {
9421
9911
  return ParaToRelayBuilder.create(this.api, this.from, _amount, this.batchManager, this._feeAsset);
9422
9912
  }
9423
- }, {
9424
- key: "closeChannel",
9425
- value: function closeChannel() {
9426
- if (this.api === undefined) {
9427
- throw new MissingApiPromiseError();
9428
- }
9429
- return CloseChannelBuilder.create(this.api, this.from);
9430
- }
9431
9913
  }]);
9432
9914
  }();
9433
9915
  var GeneralBuilder = /*#__PURE__*/function () {
@@ -9476,11 +9958,13 @@ var Builder = function Builder(api) {
9476
9958
 
9477
9959
  var findEthAsset = function findEthAsset(currency) {
9478
9960
  var ethAssets = getOtherAssets('Ethereum');
9479
- var ethAsset = ethAssets.find(function (asset) {
9480
- return asset.symbol === currency;
9961
+ var ethAsset = 'symbol' in currency ? ethAssets.find(function (asset) {
9962
+ return asset.symbol === currency.symbol;
9963
+ }) : ethAssets.find(function (asset) {
9964
+ return asset.assetId === currency.id;
9481
9965
  });
9482
9966
  if (!ethAsset) {
9483
- throw new InvalidCurrencyError("Currency ".concat(currency, " is not supported for Ethereum transfers"));
9967
+ throw new InvalidCurrencyError("Currency ".concat(JSON.stringify(currency), " is not supported for Ethereum transfers"));
9484
9968
  }
9485
9969
  return ethAsset;
9486
9970
  };
@@ -9645,7 +10129,7 @@ var EvmBuilder = function EvmBuilder(provider) {
9645
10129
  return new EvmBuilderClass(provider);
9646
10130
  };
9647
10131
 
9648
- var createTx$1 = function createTx(originApi, address, amount, currencySymbol, originNode, destNode) {
10132
+ var createTx$1 = function createTx(originApi, address, amount, currency, originNode, destNode) {
9649
10133
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9650
10134
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9651
10135
  while (1) switch (_context.prev = _context.next) {
@@ -9669,7 +10153,7 @@ var createTx$1 = function createTx(originApi, address, amount, currencySymbol, o
9669
10153
  return _context.abrupt("return", _context.sent);
9670
10154
  case 12:
9671
10155
  _context.next = 14;
9672
- return Builder(originApi).from(originNode).to(destNode).currency(currencySymbol).amount(amount).address(address).build();
10156
+ return Builder(originApi).from(originNode).to(destNode).currency(currency).amount(amount).address(address).build();
9673
10157
  case 14:
9674
10158
  return _context.abrupt("return", _context.sent);
9675
10159
  case 15:
@@ -9679,7 +10163,7 @@ var createTx$1 = function createTx(originApi, address, amount, currencySymbol, o
9679
10163
  }, _callee);
9680
10164
  }));
9681
10165
  };
9682
- var calculateTransactionFee = function calculateTransactionFee(tx, address) {
10166
+ var calculateTransactionFee$1 = function calculateTransactionFee(tx, address) {
9683
10167
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9684
10168
  var _yield$tx$paymentInfo, partialFee;
9685
10169
  return _regeneratorRuntime().wrap(function _callee2$(_context2) {
@@ -9728,7 +10212,7 @@ var getOriginFeeDetails = function getOriginFeeDetails(origin, destination, curr
9728
10212
  case 14:
9729
10213
  tx = _context3.sent;
9730
10214
  _context3.next = 17;
9731
- return calculateTransactionFee(tx, account);
10215
+ return calculateTransactionFee$1(tx, account);
9732
10216
  case 17:
9733
10217
  xcmFee = _context3.sent;
9734
10218
  xcmFeeBigInt = BigInt(xcmFee.toString());
@@ -9750,148 +10234,88 @@ var getOriginFeeDetails = function getOriginFeeDetails(origin, destination, curr
9750
10234
  }));
9751
10235
  };
9752
10236
 
9753
- var getAssetSymbol = function getAssetSymbol(node, assetId) {
9754
- if (node === 'Polkadot' || node === 'Kusama') {
9755
- return getNativeAssetSymbol(node);
9756
- }
9757
- var asset = getAssetBySymbolOrId(node, assetId, false, true);
9758
- return asset === null || asset === void 0 ? void 0 : asset.symbol;
9759
- };
9760
- var getAssetBalance = function getAssetBalance(account, node, assetSymbolOrId) {
10237
+ var getTransferInfo = function getTransferInfo(origin, destination, accountOrigin, accountDestination, currency, amount) {
9761
10238
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
9762
- var _a, api, isNativeSymbol;
10239
+ var _a, _b, originApi, originBalance, _yield$getOriginFeeDe, destXcmFee, expectedBalanceAfterXCMDelivery, asset;
9763
10240
  return _regeneratorRuntime().wrap(function _callee$(_context) {
9764
10241
  while (1) switch (_context.prev = _context.next) {
9765
10242
  case 0:
9766
10243
  _context.next = 2;
9767
- return createApiInstanceForNode(node);
9768
- case 2:
9769
- api = _context.sent;
9770
- isNativeSymbol = getNativeAssetSymbol(node) === assetSymbolOrId;
9771
- if (!isNativeSymbol) {
9772
- _context.next = 10;
9773
- break;
9774
- }
9775
- _context.next = 7;
9776
- return getBalanceNative(account, node, api);
9777
- case 7:
9778
- _context.t0 = _context.sent;
9779
- _context.next = 22;
9780
- break;
9781
- case 10:
9782
- _context.next = 12;
9783
- return getBalanceForeign(account, node, assetSymbolOrId, api);
9784
- case 12:
9785
- _context.t2 = _a = _context.sent;
9786
- _context.t1 = _context.t2 !== null;
9787
- if (!_context.t1) {
9788
- _context.next = 16;
9789
- break;
9790
- }
9791
- _context.t1 = _a !== void 0;
9792
- case 16:
9793
- if (!_context.t1) {
9794
- _context.next = 20;
9795
- break;
9796
- }
9797
- _context.t3 = _a;
9798
- _context.next = 21;
9799
- break;
9800
- case 20:
9801
- _context.t3 = BigInt(0);
9802
- case 21:
9803
- _context.t0 = _context.t3;
9804
- case 22:
9805
- return _context.abrupt("return", _context.t0);
9806
- case 23:
9807
- case "end":
9808
- return _context.stop();
9809
- }
9810
- }, _callee);
9811
- }));
9812
- };
9813
- var getTransferInfo = function getTransferInfo(origin, destination, accountOrigin, accountDestination, assetSymbolOrId, amount) {
9814
- return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
9815
- var _a, originApi, originBalance, _yield$getOriginFeeDe, destXcmFee, expectedBalanceAfterXCMDelivery, asset;
9816
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
9817
- while (1) switch (_context2.prev = _context2.next) {
9818
- case 0:
9819
- _context2.next = 2;
9820
10244
  return createApiInstanceForNode(origin);
9821
10245
  case 2:
9822
- originApi = _context2.sent;
9823
- _context2.next = 5;
10246
+ originApi = _context.sent;
10247
+ _context.next = 5;
9824
10248
  return getBalanceNative(accountOrigin, origin, originApi);
9825
10249
  case 5:
9826
- originBalance = _context2.sent;
9827
- _context2.next = 8;
9828
- return getOriginFeeDetails(origin, destination, assetSymbolOrId, amount, accountOrigin, originApi);
10250
+ originBalance = _context.sent;
10251
+ _context.next = 8;
10252
+ return getOriginFeeDetails(origin, destination, currency, amount, accountOrigin, originApi);
9829
10253
  case 8:
9830
- _yield$getOriginFeeDe = _context2.sent;
10254
+ _yield$getOriginFeeDe = _context.sent;
9831
10255
  destXcmFee = _yield$getOriginFeeDe.xcmFee;
9832
10256
  expectedBalanceAfterXCMDelivery = originBalance - destXcmFee;
9833
- asset = getAssetSymbol(origin, assetSymbolOrId);
9834
- _context2.t0 = {
10257
+ asset = getAssetBySymbolOrId(origin, currency);
10258
+ _context.t0 = {
9835
10259
  origin: origin,
9836
10260
  destination: destination,
9837
10261
  ecosystem: determineRelayChainSymbol(origin)
9838
10262
  };
9839
- _context2.next = 15;
9840
- return getAssetBalance(accountOrigin, origin, assetSymbolOrId);
10263
+ _context.next = 15;
10264
+ return getAssetBalance(accountOrigin, origin, currency);
9841
10265
  case 15:
9842
- _context2.t1 = _context2.sent;
9843
- _context2.t2 = asset !== null && asset !== void 0 ? asset : '';
9844
- _context2.t3 = {
9845
- balance: _context2.t1,
9846
- currency: _context2.t2
10266
+ _context.t1 = _context.sent;
10267
+ _context.t2 = (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : '';
10268
+ _context.t3 = {
10269
+ balance: _context.t1,
10270
+ currency: _context.t2
9847
10271
  };
9848
- _context2.next = 20;
10272
+ _context.next = 20;
9849
10273
  return getBalanceNative(accountOrigin, origin, originApi);
9850
10274
  case 20:
9851
- _context2.t4 = _context2.sent;
9852
- _context2.t5 = expectedBalanceAfterXCMDelivery;
9853
- _context2.next = 24;
9854
- return getOriginFeeDetails(origin, destination, assetSymbolOrId, amount, accountOrigin, originApi);
10275
+ _context.t4 = _context.sent;
10276
+ _context.t5 = expectedBalanceAfterXCMDelivery;
10277
+ _context.next = 24;
10278
+ return getOriginFeeDetails(origin, destination, currency, amount, accountOrigin, originApi);
9855
10279
  case 24:
9856
- _context2.t6 = _context2.sent;
9857
- _context2.t7 = BigInt((_a = getExistentialDeposit$1(origin)) !== null && _a !== void 0 ? _a : 0);
9858
- _context2.t8 = getNativeAssetSymbol(origin);
9859
- _context2.t9 = getMinNativeTransferableAmount(origin);
9860
- _context2.next = 30;
10280
+ _context.t6 = _context.sent;
10281
+ _context.t7 = BigInt((_b = getExistentialDeposit(origin)) !== null && _b !== void 0 ? _b : 0);
10282
+ _context.t8 = getNativeAssetSymbol(origin);
10283
+ _context.t9 = getMinNativeTransferableAmount(origin);
10284
+ _context.next = 30;
9861
10285
  return getMaxNativeTransferableAmount(accountOrigin, origin);
9862
10286
  case 30:
9863
- _context2.t10 = _context2.sent;
9864
- _context2.t11 = {
9865
- balance: _context2.t4,
9866
- expectedBalanceAfterXCMFee: _context2.t5,
9867
- xcmFee: _context2.t6,
9868
- existentialDeposit: _context2.t7,
9869
- asset: _context2.t8,
9870
- minNativeTransferableAmount: _context2.t9,
9871
- maxNativeTransferableAmount: _context2.t10
10287
+ _context.t10 = _context.sent;
10288
+ _context.t11 = {
10289
+ balance: _context.t4,
10290
+ expectedBalanceAfterXCMFee: _context.t5,
10291
+ xcmFee: _context.t6,
10292
+ existentialDeposit: _context.t7,
10293
+ asset: _context.t8,
10294
+ minNativeTransferableAmount: _context.t9,
10295
+ maxNativeTransferableAmount: _context.t10
9872
10296
  };
9873
- _context2.next = 34;
10297
+ _context.next = 34;
9874
10298
  return getBalanceNative(accountDestination, destination);
9875
10299
  case 34:
9876
- _context2.t12 = _context2.sent;
9877
- _context2.t13 = getNativeAssetSymbol(destination);
9878
- _context2.t14 = getExistentialDeposit$1(destination);
9879
- _context2.t15 = {
9880
- balance: _context2.t12,
9881
- currency: _context2.t13,
9882
- existentialDeposit: _context2.t14
10300
+ _context.t12 = _context.sent;
10301
+ _context.t13 = getNativeAssetSymbol(destination);
10302
+ _context.t14 = getExistentialDeposit(destination);
10303
+ _context.t15 = {
10304
+ balance: _context.t12,
10305
+ currency: _context.t13,
10306
+ existentialDeposit: _context.t14
9883
10307
  };
9884
- return _context2.abrupt("return", {
9885
- chain: _context2.t0,
9886
- currencyBalanceOrigin: _context2.t3,
9887
- originFeeBalance: _context2.t11,
9888
- destinationFeeBalance: _context2.t15
10308
+ return _context.abrupt("return", {
10309
+ chain: _context.t0,
10310
+ currencyBalanceOrigin: _context.t3,
10311
+ originFeeBalance: _context.t11,
10312
+ destinationFeeBalance: _context.t15
9889
10313
  });
9890
10314
  case 39:
9891
10315
  case "end":
9892
- return _context2.stop();
10316
+ return _context.stop();
9893
10317
  }
9894
- }, _callee2);
10318
+ }, _callee);
9895
10319
  }));
9896
10320
  };
9897
10321
 
@@ -9904,6 +10328,7 @@ var index$1 = /*#__PURE__*/Object.freeze({
9904
10328
  getAssetsObject: getAssetsObject,
9905
10329
  getBalanceForeign: getBalanceForeign,
9906
10330
  getBalanceNative: getBalanceNative,
10331
+ getExistentialDeposit: getExistentialDeposit$1,
9907
10332
  getNativeAssetSymbol: getNativeAssetSymbol,
9908
10333
  getNativeAssets: getNativeAssets,
9909
10334
  getOtherAssets: getOtherAssets,
@@ -9915,14 +10340,76 @@ var index$1 = /*#__PURE__*/Object.freeze({
9915
10340
  hasSupportForAsset: hasSupportForAsset
9916
10341
  });
9917
10342
 
10343
+ var isPrimitive = function isPrimitive(obj) {
10344
+ return obj !== Object(obj);
10345
+ };
10346
+ var _deepEqual = function deepEqual(obj1, obj2) {
10347
+ if (obj1 === obj2) return true;
10348
+ if (isPrimitive(obj1) && isPrimitive(obj2)) return obj1 === obj2;
10349
+ if (_typeof(obj1) !== 'object' || obj1 === null || _typeof(obj2) !== 'object' || obj2 === null) {
10350
+ return false;
10351
+ }
10352
+ if (Array.isArray(obj1) !== Array.isArray(obj2)) {
10353
+ return false;
10354
+ }
10355
+ var obj1Keys = Object.keys(obj1).map(function (key) {
10356
+ return key.toLowerCase();
10357
+ });
10358
+ var obj2Keys = Object.keys(obj2).map(function (key) {
10359
+ return key.toLowerCase();
10360
+ });
10361
+ if (obj1Keys.length !== obj2Keys.length) return false;
10362
+ var _iterator = _createForOfIteratorHelper(obj1Keys),
10363
+ _step;
10364
+ try {
10365
+ var _loop = function _loop() {
10366
+ var key = _step.value;
10367
+ var keyInObj2 = obj2Keys.find(function (k) {
10368
+ return k === key;
10369
+ });
10370
+ if (!keyInObj2) return {
10371
+ v: false
10372
+ };
10373
+ var obj1Value = obj1[Object.keys(obj1).find(function (k) {
10374
+ return k.toLowerCase() === key;
10375
+ })];
10376
+ var obj2Value = obj2[Object.keys(obj2).find(function (k) {
10377
+ return k.toLowerCase() === key;
10378
+ })];
10379
+ if (!_deepEqual(obj1Value, obj2Value)) return {
10380
+ v: false
10381
+ };
10382
+ },
10383
+ _ret;
10384
+ for (_iterator.s(); !(_step = _iterator.n()).done;) {
10385
+ _ret = _loop();
10386
+ if (_ret) return _ret.v;
10387
+ }
10388
+ } catch (err) {
10389
+ _iterator.e(err);
10390
+ } finally {
10391
+ _iterator.f();
10392
+ }
10393
+ return true;
10394
+ };
10395
+
10396
+ var verifyMultiLocation = function verifyMultiLocation(node, multiLocation) {
10397
+ var _getAssetsObject = getAssetsObject(node),
10398
+ multiLocations = _getAssetsObject.multiLocations;
10399
+ if (!multiLocations) return true;
10400
+ return multiLocations.some(function (location) {
10401
+ return _deepEqual(location, multiLocation);
10402
+ });
10403
+ };
10404
+
9918
10405
  var supportsXTokens = function supportsXTokens(obj) {
9919
- return 'transferXTokens' in obj;
10406
+ return _typeof(obj) === 'object' && obj !== null && 'transferXTokens' in obj;
9920
10407
  };
9921
10408
  var supportsXTransfer = function supportsXTransfer(obj) {
9922
- return 'transferXTransfer' in obj;
10409
+ return _typeof(obj) === 'object' && obj !== null && 'transferXTransfer' in obj;
9923
10410
  };
9924
10411
  var supportsPolkadotXCM = function supportsPolkadotXCM(obj) {
9925
- return 'transferPolkadotXCM' in obj;
10412
+ return _typeof(obj) === 'object' && obj !== null && 'transferPolkadotXCM' in obj;
9926
10413
  };
9927
10414
  var ParachainNode = /*#__PURE__*/function () {
9928
10415
  function ParachainNode(node, name, type, version) {
@@ -9981,6 +10468,9 @@ var ParachainNode = /*#__PURE__*/function () {
9981
10468
  serializedApiCallEnabled = _options$serializedAp === void 0 ? false : _options$serializedAp;
9982
10469
  var scenario = destination !== undefined ? 'ParaToPara' : 'ParaToRelay';
9983
10470
  var paraId = destination !== undefined && _typeof(destination) !== 'object' ? paraIdTo !== null && paraIdTo !== void 0 ? paraIdTo : getParaId(destination) : undefined;
10471
+ if (destination === 'Polimec' && this.node !== 'AssetHubPolkadot') {
10472
+ throw new Error('Sending assets to Polimec is supported only from AssetHubPolkadot');
10473
+ }
9984
10474
  if (supportsXTokens(this) && this.canUseXTokens(options)) {
9985
10475
  return this.transferXTokens({
9986
10476
  api: api,
@@ -10011,6 +10501,9 @@ var ParachainNode = /*#__PURE__*/function () {
10011
10501
  serializedApiCallEnabled: serializedApiCallEnabled
10012
10502
  });
10013
10503
  } else if (supportsPolkadotXCM(this)) {
10504
+ if (isTMultiLocation(overridedCurrencyMultiLocation) && !verifyMultiLocation(this.node, overridedCurrencyMultiLocation)) {
10505
+ throw new InvalidCurrencyError('Provided Multi-location is not a valid currency.');
10506
+ }
10014
10507
  return this.transferPolkadotXCM({
10015
10508
  api: api,
10016
10509
  header: this.createPolkadotXcmHeader(scenario, version, destination, paraId),
@@ -10104,12 +10597,13 @@ var getModifiedCurrencySelection = function getModifiedCurrencySelection(version
10104
10597
  }
10105
10598
  });
10106
10599
  };
10107
- var getCurrencySelection = function getCurrencySelection(_ref2, isAssetHub, currencySelection) {
10108
- var origin = _ref2.origin,
10109
- amount = _ref2.amount,
10110
- currencyID = _ref2.currencyID,
10111
- paraIdTo = _ref2.paraIdTo,
10112
- overridedCurrencyMultiLocation = _ref2.overridedCurrencyMultiLocation;
10600
+
10601
+ var getCurrencySelection = function getCurrencySelection(_ref, isAssetHub, currencySelection) {
10602
+ var origin = _ref.origin,
10603
+ amount = _ref.amount,
10604
+ currencyID = _ref.currencyID,
10605
+ paraIdTo = _ref.paraIdTo,
10606
+ overridedCurrencyMultiLocation = _ref.overridedCurrencyMultiLocation;
10113
10607
  var _getNode = getNode(origin),
10114
10608
  version = _getNode.version;
10115
10609
  if (overridedCurrencyMultiLocation !== undefined) return _defineProperty({}, version, overridedCurrencyMultiLocation);
@@ -10118,14 +10612,14 @@ var getCurrencySelection = function getCurrencySelection(_ref2, isAssetHub, curr
10118
10612
  }
10119
10613
  return currencySelection;
10120
10614
  };
10121
- var getParameters = function getParameters(isAssetHub, currencySelection, addressSelection, amount, fees, feeAsset
10122
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
10123
- ) {
10615
+
10616
+ var getParameters = function getParameters(isAssetHub, currencySelection, addressSelection, amount, fees, feeAsset) {
10124
10617
  if (isAssetHub) {
10125
10618
  return feeAsset !== undefined ? [currencySelection, feeAsset, addressSelection, fees] : [currencySelection, addressSelection, fees];
10126
10619
  }
10127
10620
  return [currencySelection, amount, addressSelection, fees];
10128
10621
  };
10622
+
10129
10623
  var XTokensTransferImpl = /*#__PURE__*/function () {
10130
10624
  function XTokensTransferImpl() {
10131
10625
  _classCallCheck(this, XTokensTransferImpl);
@@ -10135,7 +10629,6 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
10135
10629
  value: function transferXTokens(input, currencySelection) {
10136
10630
  var _api$tx$module;
10137
10631
  var fees = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'Unlimited';
10138
- var pallet = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : 'XTokens';
10139
10632
  var api = input.api,
10140
10633
  amount = input.amount,
10141
10634
  addressSelection = input.addressSelection,
@@ -10146,9 +10639,9 @@ var XTokensTransferImpl = /*#__PURE__*/function () {
10146
10639
  if (isMultiLocationDestination) {
10147
10640
  throw new Error('Multilocation destinations are not supported for specific transfer you are trying to create. In special cases such as xTokens or xTransfer pallet try using address multilocation instead (for both destination and address in same multilocation set (eg. X2 - Parachain, Address). For further assistance please open issue in our repository.');
10148
10641
  }
10149
- var module = lowercaseFirstLetter(pallet.toString());
10150
10642
  var isAssetHub = destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama';
10151
10643
  var modifiedCurrencySelection = getCurrencySelection(input, isAssetHub, currencySelection);
10644
+ var module = 'xTokens';
10152
10645
  var section = isAssetHub ? 'transferMultiasset' : 'transfer';
10153
10646
  var parameters = getParameters(isAssetHub, modifiedCurrencySelection, addressSelection, amount, fees, feeAsset);
10154
10647
  if (serializedApiCallEnabled === true) {
@@ -10473,6 +10966,12 @@ var Basilisk = /*#__PURE__*/function (_ParachainNode) {
10473
10966
  var currencyID = input.currencyID;
10474
10967
  return XTokensTransferImpl.transferXTokens(input, currencyID);
10475
10968
  }
10969
+ }, {
10970
+ key: "getProvider",
10971
+ value: function getProvider() {
10972
+ // Prefer Dwellir RPC endpoint
10973
+ return getAllNodeProviders(this.node)[1];
10974
+ }
10476
10975
  }]);
10477
10976
  }(ParachainNode);
10478
10977
 
@@ -10594,6 +11093,11 @@ var Litmus = /*#__PURE__*/function (_ParachainNode) {
10594
11093
  // Multiple asset options needs addressing
10595
11094
  return getNode('Litentry').transferXTokens(input);
10596
11095
  }
11096
+ }, {
11097
+ key: "getProvider",
11098
+ value: function getProvider() {
11099
+ return 'wss:///rpc.litmus-parachain.litentry.io';
11100
+ }
10597
11101
  }]);
10598
11102
  }(ParachainNode);
10599
11103
 
@@ -10744,7 +11248,7 @@ var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
10744
11248
  }
10745
11249
  return _createClass(PolkadotXCMTransferImpl, null, [{
10746
11250
  key: "transferPolkadotXCM",
10747
- value: function transferPolkadotXCM(_ref, method) {
11251
+ value: function transferPolkadotXCM(_ref, section) {
10748
11252
  var api = _ref.api,
10749
11253
  header = _ref.header,
10750
11254
  addressSelection = _ref.addressSelection,
@@ -10753,14 +11257,15 @@ var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
10753
11257
  feeAsset = _ref$feeAsset === void 0 ? DEFAULT_FEE_ASSET : _ref$feeAsset,
10754
11258
  serializedApiCallEnabled = _ref.serializedApiCallEnabled;
10755
11259
  var fees = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
11260
+ var module = 'polkadotXcm';
10756
11261
  if (serializedApiCallEnabled === true) {
10757
11262
  return {
10758
- module: 'polkadotXcm',
10759
- section: method,
11263
+ module: module,
11264
+ section: section,
10760
11265
  parameters: [header, addressSelection, currencySelection, feeAsset].concat(_toConsumableArray(fees !== undefined ? [fees] : []))
10761
11266
  };
10762
11267
  }
10763
- return fees !== undefined ? api.tx.polkadotXcm[method](header, addressSelection, currencySelection, feeAsset, fees) : api.tx.polkadotXcm[method](header, addressSelection, currencySelection, feeAsset);
11268
+ return fees !== undefined ? api.tx[module][section](header, addressSelection, currencySelection, feeAsset, fees) : api.tx[module][section](header, addressSelection, currencySelection, feeAsset);
10764
11269
  }
10765
11270
  }]);
10766
11271
  }();
@@ -10865,7 +11370,9 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
10865
11370
  }, {
10866
11371
  key: "transferPolkadotXCM",
10867
11372
  value: function transferPolkadotXCM(input) {
10868
- var scenario = input.scenario;
11373
+ var scenario = input.scenario,
11374
+ currencySymbol = input.currencySymbol,
11375
+ currencyId = input.currencyId;
10869
11376
  if (input.destination === 'AssetHubKusama') {
10870
11377
  return this.handleBridgeTransfer(input, 'Kusama');
10871
11378
  }
@@ -10875,8 +11382,14 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
10875
11382
  if (input.destination === 'Mythos') {
10876
11383
  return this.handleMythosTransfer(input);
10877
11384
  }
10878
- var method = scenario === 'ParaToPara' ? 'limitedReserveTransferAssets' : 'limitedTeleportAssets';
10879
- return PolkadotXCMTransferImpl.transferPolkadotXCM(input, method, 'Unlimited');
11385
+ if (scenario === 'ParaToPara' && currencySymbol === 'DOT' && currencyId === undefined) {
11386
+ throw new ScenarioNotSupportedError(this.node, scenario, 'Para to Para scenarios for DOT transfer from AssetHub are not supported, you have to transfer DOT to Relay chain and transfer to destination chain from Relay chain.');
11387
+ }
11388
+ if (scenario === 'ParaToPara' && currencySymbol === 'KSM' && currencyId === undefined) {
11389
+ throw new ScenarioNotSupportedError(this.node, scenario, 'Bridged KSM cannot currently be transfered from AssetHubPolkadot, if you are sending different KSM asset, please specify {id: <KSMID>}.');
11390
+ }
11391
+ var section = scenario === 'ParaToPara' ? 'limitedReserveTransferAssets' : 'limitedTeleportAssets';
11392
+ return PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited');
10880
11393
  }
10881
11394
  }, {
10882
11395
  key: "transferRelayToPara",
@@ -10897,7 +11410,8 @@ var AssetHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
10897
11410
  X2: [{
10898
11411
  PalletInstance: 50
10899
11412
  }, {
10900
- GeneralIndex: currencyId
11413
+ // TODO: Handle the case where currencyId is undefined
11414
+ GeneralIndex: currencyId !== null && currencyId !== void 0 ? currencyId : ''
10901
11415
  }]
10902
11416
  };
10903
11417
  return createCurrencySpec(amount, version, Parents.ZERO, overridedMultiLocation, interior);
@@ -10917,14 +11431,23 @@ var AssetHubKusama = /*#__PURE__*/function (_ParachainNode) {
10917
11431
  return _createClass(AssetHubKusama, [{
10918
11432
  key: "transferPolkadotXCM",
10919
11433
  value: function transferPolkadotXCM(input) {
11434
+ var destination = input.destination,
11435
+ currencySymbol = input.currencySymbol,
11436
+ currencyId = input.currencyId,
11437
+ scenario = input.scenario;
10920
11438
  // TESTED https://kusama.subscan.io/xcm_message/kusama-ddc2a48f0d8e0337832d7aae26f6c3053e1f4ffd
10921
11439
  // TESTED https://kusama.subscan.io/xcm_message/kusama-8e423130a4d8b61679af95dbea18a55124f99672
10922
- if (input.destination === 'AssetHubPolkadot') {
11440
+ if (destination === 'AssetHubPolkadot') {
10923
11441
  return getNode('AssetHubPolkadot').handleBridgeTransfer(input, 'Polkadot');
10924
11442
  }
10925
- var scenario = input.scenario;
10926
- var method = scenario === 'ParaToPara' ? 'limitedReserveTransferAssets' : 'limitedTeleportAssets';
10927
- return PolkadotXCMTransferImpl.transferPolkadotXCM(input, method, 'Unlimited');
11443
+ if (scenario === 'ParaToPara' && currencySymbol === 'KSM' && currencyId === undefined) {
11444
+ throw new ScenarioNotSupportedError(this.node, scenario, 'Para to Para scenarios for KSM transfer from AssetHub are not supported, you have to transfer KSM to Relay chain and transfer to destination chain from Relay chain.');
11445
+ }
11446
+ if (scenario === 'ParaToPara' && currencySymbol === 'DOT' && currencyId === undefined) {
11447
+ throw new ScenarioNotSupportedError(this.node, scenario, 'Bridged DOT cannot currently be transfered from AssetHubKusama, if you are sending different DOT asset, please specify {id: <DOTID>}.');
11448
+ }
11449
+ var section = scenario === 'ParaToPara' ? 'limitedReserveTransferAssets' : 'limitedTeleportAssets';
11450
+ return PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited');
10928
11451
  }
10929
11452
  }, {
10930
11453
  key: "transferRelayToPara",
@@ -10959,8 +11482,8 @@ var CoretimeKusama = /*#__PURE__*/function (_ParachainNode) {
10959
11482
  value: function transferPolkadotXCM(input) {
10960
11483
  // TESTED block hash on Rococo: 0x78ace0f1bf7cac9a42e56143321b617d98327e2750f795efb0abb833025c9082
10961
11484
  var scenario = input.scenario;
10962
- var method = scenario === 'ParaToPara' ? 'limitedReserveTransferAssets' : 'limitedTeleportAssets';
10963
- return PolkadotXCMTransferImpl.transferPolkadotXCM(input, method, 'Unlimited');
11485
+ var section = scenario === 'ParaToPara' ? 'limitedReserveTransferAssets' : 'limitedTeleportAssets';
11486
+ return PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited');
10964
11487
  }
10965
11488
  }, {
10966
11489
  key: "transferRelayToPara",
@@ -10978,6 +11501,42 @@ var CoretimeKusama = /*#__PURE__*/function (_ParachainNode) {
10978
11501
  }]);
10979
11502
  }(ParachainNode);
10980
11503
 
11504
+ var CoretimePolkadot = /*#__PURE__*/function (_ParachainNode) {
11505
+ function CoretimePolkadot() {
11506
+ var _this;
11507
+ _classCallCheck(this, CoretimePolkadot);
11508
+ _this = _callSuper(this, CoretimePolkadot, ['CoretimePolkadot', 'polkadotCoretime', 'polkadot', Version.V3]);
11509
+ _this._assetCheckEnabled = false;
11510
+ return _this;
11511
+ }
11512
+ _inherits(CoretimePolkadot, _ParachainNode);
11513
+ return _createClass(CoretimePolkadot, [{
11514
+ key: "transferPolkadotXCM",
11515
+ value: function transferPolkadotXCM(input) {
11516
+ var scenario = input.scenario;
11517
+ var section = scenario === 'ParaToPara' ? 'limitedReserveTransferAssets' : 'limitedTeleportAssets';
11518
+ return PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited');
11519
+ }
11520
+ }, {
11521
+ key: "transferRelayToPara",
11522
+ value: function transferRelayToPara(options) {
11523
+ var _options$version = options.version,
11524
+ version = _options$version === void 0 ? Version.V3 : _options$version;
11525
+ return {
11526
+ module: 'xcmPallet',
11527
+ section: 'limitedTeleportAssets',
11528
+ parameters: constructRelayToParaParameters(options, version, true)
11529
+ };
11530
+ }
11531
+ }, {
11532
+ key: "getProvider",
11533
+ value: function getProvider() {
11534
+ // TODO: Temporary solution, will be solved after updating @polkadot/apps-config package
11535
+ return 'wss://polkadot-coretime-rpc.polkadot.io';
11536
+ }
11537
+ }]);
11538
+ }(ParachainNode);
11539
+
10981
11540
  var Encointer = /*#__PURE__*/function (_ParachainNode) {
10982
11541
  function Encointer() {
10983
11542
  _classCallCheck(this, Encointer);
@@ -11011,22 +11570,16 @@ var Encointer = /*#__PURE__*/function (_ParachainNode) {
11011
11570
  var Robonomics = /*#__PURE__*/function (_ParachainNode) {
11012
11571
  function Robonomics() {
11013
11572
  _classCallCheck(this, Robonomics);
11014
- return _callSuper(this, Robonomics, ['Robonomics', 'robonomics', 'kusama', Version.V1]);
11573
+ return _callSuper(this, Robonomics, ['Robonomics', 'robonomics', 'kusama', Version.V3]);
11015
11574
  }
11016
11575
  _inherits(Robonomics, _ParachainNode);
11017
11576
  return _createClass(Robonomics, [{
11018
11577
  key: "transferPolkadotXCM",
11019
11578
  value: function transferPolkadotXCM(input) {
11020
- if (input.scenario === 'ParaToPara') {
11021
- return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limitedReserveTransferAssets', {
11022
- Limited: Robonomics.FEE
11023
- });
11024
- }
11025
- return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'reserveWithdrawAssets');
11579
+ return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limitedReserveTransferAssets', 'Unlimited');
11026
11580
  }
11027
11581
  }]);
11028
11582
  }(ParachainNode);
11029
- Robonomics.FEE = '400000000';
11030
11583
 
11031
11584
  var Astar = /*#__PURE__*/function (_ParachainNode) {
11032
11585
  function Astar() {
@@ -11038,8 +11591,8 @@ var Astar = /*#__PURE__*/function (_ParachainNode) {
11038
11591
  key: "transferPolkadotXCM",
11039
11592
  value: function transferPolkadotXCM(input) {
11040
11593
  // TESTED https://polkadot.subscan.io/xcm_message/polkadot-f2b697df74ebe4b62853fe81b8b7d0522464972d
11041
- var method = input.scenario === 'ParaToPara' ? 'reserveTransferAssets' : 'reserveWithdrawAssets';
11042
- return PolkadotXCMTransferImpl.transferPolkadotXCM(input, method);
11594
+ var section = input.scenario === 'ParaToPara' ? 'reserveTransferAssets' : 'reserveWithdrawAssets';
11595
+ return PolkadotXCMTransferImpl.transferPolkadotXCM(input, section);
11043
11596
  }
11044
11597
  }, {
11045
11598
  key: "transferXTokens",
@@ -11338,6 +11891,7 @@ var determineDestWeight = function determineDestWeight(destNode) {
11338
11891
  }
11339
11892
  throw new NodeNotSupportedError("Node ".concat(destNode, " is not supported"));
11340
11893
  };
11894
+
11341
11895
  var getDestination = function getDestination(_ref) {
11342
11896
  var recipientAddress = _ref.recipientAddress,
11343
11897
  paraId = _ref.paraId,
@@ -11365,6 +11919,7 @@ var getDestination = function getDestination(_ref) {
11365
11919
  }
11366
11920
  };
11367
11921
  };
11922
+
11368
11923
  var XTransferTransferImpl = /*#__PURE__*/function () {
11369
11924
  function XTransferTransferImpl() {
11370
11925
  _classCallCheck(this, XTransferTransferImpl);
@@ -11384,14 +11939,17 @@ var XTransferTransferImpl = /*#__PURE__*/function () {
11384
11939
  }
11385
11940
  var currencySpec = Object.values(createCurrencySpec(amount, Version.V1, Parents.ZERO, overridedCurrencyMultiLocation))[0][0];
11386
11941
  var dest = getDestination(input);
11942
+ var module = 'xTransfer';
11943
+ var section = 'transfer';
11944
+ var destWeight = origin === 'Khala' ? null : determineDestWeight(destination);
11387
11945
  if (serializedApiCallEnabled === true) {
11388
11946
  return {
11389
- module: 'xTransfer',
11390
- section: 'transfer',
11391
- parameters: [currencySpec, dest, origin === 'Khala' ? null : determineDestWeight(destination)]
11947
+ module: module,
11948
+ section: section,
11949
+ parameters: [currencySpec, dest, destWeight]
11392
11950
  };
11393
11951
  }
11394
- return api.tx.xTransfer.transfer(currencySpec, dest, origin === 'Khala' ? null : determineDestWeight(destination));
11952
+ return api.tx[module][section](currencySpec, dest, destWeight);
11395
11953
  }
11396
11954
  }]);
11397
11955
  }();
@@ -11435,10 +11993,23 @@ var Phala = /*#__PURE__*/function (_ParachainNode) {
11435
11993
  var Subsocial = /*#__PURE__*/function (_ParachainNode) {
11436
11994
  function Subsocial() {
11437
11995
  _classCallCheck(this, Subsocial);
11438
- return _callSuper(this, Subsocial, ['Subsocial', 'subsocial', 'polkadot', Version.V1]);
11996
+ return _callSuper(this, Subsocial, ['Subsocial', 'subsocial', 'polkadot', Version.V3]);
11439
11997
  }
11440
11998
  _inherits(Subsocial, _ParachainNode);
11441
- return _createClass(Subsocial);
11999
+ return _createClass(Subsocial, [{
12000
+ key: "transferPolkadotXCM",
12001
+ value: function transferPolkadotXCM(input) {
12002
+ var scenario = input.scenario,
12003
+ currencySymbol = input.currencySymbol;
12004
+ if (scenario !== 'ParaToPara') {
12005
+ throw new ScenarioNotSupportedError(this.node, scenario);
12006
+ }
12007
+ if (currencySymbol !== this.getNativeAssetSymbol()) {
12008
+ throw new InvalidCurrencyError("Asset ".concat(currencySymbol, " is not supported by node ").concat(this.node, "."));
12009
+ }
12010
+ return PolkadotXCMTransferImpl.transferPolkadotXCM(input, 'limitedReserveTransferAssets', 'Unlimited');
12011
+ }
12012
+ }]);
11442
12013
  }(ParachainNode);
11443
12014
 
11444
12015
  var KiltSpiritnet = /*#__PURE__*/function (_ParachainNode) {
@@ -11508,8 +12079,8 @@ var BridgeHubPolkadot = /*#__PURE__*/function (_ParachainNode) {
11508
12079
  if (scenario === 'ParaToPara') {
11509
12080
  throw new ScenarioNotSupportedError(this.node, scenario, 'Unable to use bridge hub for transfers to other Parachains. Please move your currency to AssetHub to transfer to other Parachains.');
11510
12081
  }
11511
- var method = 'limitedTeleportAssets';
11512
- return PolkadotXCMTransferImpl.transferPolkadotXCM(input, method, 'Unlimited');
12082
+ var section = 'limitedTeleportAssets';
12083
+ return PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited');
11513
12084
  }
11514
12085
  }, {
11515
12086
  key: "transferRelayToPara",
@@ -11541,8 +12112,8 @@ var BridgeHubKusama = /*#__PURE__*/function (_ParachainNode) {
11541
12112
  if (scenario === 'ParaToPara') {
11542
12113
  throw new ScenarioNotSupportedError(this.node, scenario, 'Unable to use bridge hub for transfers to other Parachains. Please move your currency to AssetHub to transfer to other Parachains.');
11543
12114
  }
11544
- var method = 'limitedTeleportAssets';
11545
- return PolkadotXCMTransferImpl.transferPolkadotXCM(input, method, 'Unlimited');
12115
+ var section = 'limitedTeleportAssets';
12116
+ return PolkadotXCMTransferImpl.transferPolkadotXCM(input, section, 'Unlimited');
11546
12117
  }
11547
12118
  }, {
11548
12119
  key: "transferRelayToPara",
@@ -11625,7 +12196,16 @@ var Peaq = /*#__PURE__*/function (_ParachainNode) {
11625
12196
  }]);
11626
12197
  }(ParachainNode);
11627
12198
 
11628
- var NODE_NAMES_DOT_KSM = ['AssetHubPolkadot', 'Acala', 'Astar', 'BifrostPolkadot', 'Bitgreen', 'BridgeHubPolkadot', 'BridgeHubKusama', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'Hydration', 'Interlay', 'Litentry', 'Moonbeam', 'Parallel', 'AssetHubKusama', 'CoretimeKusama', 'Encointer', 'Altair', 'Amplitude', 'Bajun', 'Basilisk', 'BifrostKusama', 'Pioneer', 'Calamari', 'CrustShadow', 'Crab', 'Imbue', 'Integritee', 'InvArchTinker', 'Karura', 'Kintsugi', 'Litmus', 'Moonriver', 'ParallelHeiko', 'Picasso', 'Quartz', 'Robonomics', 'Shiden', 'Turing', 'Unique', 'Crust', 'Manta', 'Nodle', 'NeuroWeb', 'Pendulum', 'Polkadex', 'Zeitgeist', 'Collectives', 'Khala', 'Phala', 'Subsocial', 'KiltSpiritnet', 'Curio', 'Mythos', 'Peaq'];
12199
+ var Polimec = /*#__PURE__*/function (_ParachainNode) {
12200
+ function Polimec() {
12201
+ _classCallCheck(this, Polimec);
12202
+ return _callSuper(this, Polimec, ['Polimec', 'polimec', 'polkadot', Version.V3]);
12203
+ }
12204
+ _inherits(Polimec, _ParachainNode);
12205
+ return _createClass(Polimec);
12206
+ }(ParachainNode);
12207
+
12208
+ var NODE_NAMES_DOT_KSM = ['AssetHubPolkadot', 'Acala', 'Astar', 'BifrostPolkadot', 'Bitgreen', 'BridgeHubPolkadot', 'BridgeHubKusama', 'Centrifuge', 'ComposableFinance', 'Darwinia', 'Hydration', 'Interlay', 'Litentry', 'Moonbeam', 'Parallel', 'AssetHubKusama', 'CoretimeKusama', 'CoretimePolkadot', 'Encointer', 'Altair', 'Amplitude', 'Bajun', 'Basilisk', 'BifrostKusama', 'Pioneer', 'Calamari', 'CrustShadow', 'Crab', 'Imbue', 'Integritee', 'InvArchTinker', 'Karura', 'Kintsugi', 'Litmus', 'Moonriver', 'ParallelHeiko', 'Picasso', 'Quartz', 'Robonomics', 'Shiden', 'Turing', 'Unique', 'Crust', 'Manta', 'Nodle', 'NeuroWeb', 'Pendulum', 'Polkadex', 'Zeitgeist', 'Collectives', 'Khala', 'Phala', 'Subsocial', 'KiltSpiritnet', 'Curio', 'Mythos', 'Peaq', 'Polimec'];
11629
12209
  var NODE_NAMES = [].concat(NODE_NAMES_DOT_KSM, ['Ethereum']);
11630
12210
  var NODES_WITH_RELAY_CHAINS = [].concat(_toConsumableArray(NODE_NAMES), ['Polkadot', 'Kusama']);
11631
12211
  var NODES_WITH_RELAY_CHAINS_DOT_KSM = [].concat(NODE_NAMES_DOT_KSM, ['Polkadot', 'Kusama']);
@@ -11649,6 +12229,7 @@ var nodes = {
11649
12229
  Parallel: new Parallel(),
11650
12230
  AssetHubKusama: new AssetHubKusama(),
11651
12231
  CoretimeKusama: new CoretimeKusama(),
12232
+ CoretimePolkadot: new CoretimePolkadot(),
11652
12233
  Encointer: new Encointer(),
11653
12234
  Altair: new Altair(),
11654
12235
  Amplitude: new Amplitude(),
@@ -11686,7 +12267,8 @@ var nodes = {
11686
12267
  Curio: new Curio(),
11687
12268
  Ethereum: new Ethereum(),
11688
12269
  Mythos: new Mythos(),
11689
- Peaq: new Peaq()
12270
+ Peaq: new Peaq(),
12271
+ Polimec: new Polimec()
11690
12272
  };
11691
12273
  var SUPPORTED_PALLETS = ['XTokens', 'OrmlXTokens', 'PolkadotXcm', 'RelayerXcm', 'XTransfer'];
11692
12274
 
@@ -11889,11 +12471,7 @@ var createApiInstanceForNode = function createApiInstanceForNode(node) {
11889
12471
  }, _callee2);
11890
12472
  }));
11891
12473
  };
11892
- var lowercaseFirstLetter = function lowercaseFirstLetter(str) {
11893
- return str.charAt(0).toLowerCase() + str.slice(1);
11894
- };
11895
- var callPolkadotJsTxFunction = function callPolkadotJsTxFunction(api, _ref10 // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
11896
- ) {
12474
+ var callPolkadotJsTxFunction = function callPolkadotJsTxFunction(api, _ref10) {
11897
12475
  var _api$tx$module;
11898
12476
  var module = _ref10.module,
11899
12477
  section = _ref10.section,
@@ -11928,10 +12506,26 @@ var KeepAliveError = /*#__PURE__*/function (_Error) {
11928
12506
  return _createClass(KeepAliveError);
11929
12507
  }(/*#__PURE__*/_wrapNativeSuper(Error));
11930
12508
 
11931
- var edMap = edMapJson;
11932
- var getExistentialDeposit = function getExistentialDeposit(node) {
11933
- return edMap[node];
12509
+ var calculateTransactionFee = function calculateTransactionFee(tx, address) {
12510
+ return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
12511
+ var _yield$tx$paymentInfo, partialFee;
12512
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12513
+ while (1) switch (_context.prev = _context.next) {
12514
+ case 0:
12515
+ _context.next = 2;
12516
+ return tx.paymentInfo(address);
12517
+ case 2:
12518
+ _yield$tx$paymentInfo = _context.sent;
12519
+ partialFee = _yield$tx$paymentInfo.partialFee;
12520
+ return _context.abrupt("return", partialFee.toBn());
12521
+ case 5:
12522
+ case "end":
12523
+ return _context.stop();
12524
+ }
12525
+ }, _callee);
12526
+ }));
11934
12527
  };
12528
+
11935
12529
  var createTx = function createTx(originApi, destApi, address, amount, currencySymbol, originNode, destNode) {
11936
12530
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
11937
12531
  return _regeneratorRuntime().wrap(function _callee$(_context) {
@@ -11942,7 +12536,9 @@ var createTx = function createTx(originApi, destApi, address, amount, currencySy
11942
12536
  break;
11943
12537
  }
11944
12538
  _context.next = 3;
11945
- return Builder(destApi).from(destNode).to(originNode).currency(currencySymbol).amount(amount).address(address).build();
12539
+ return Builder(destApi).from(destNode).to(originNode).currency({
12540
+ symbol: currencySymbol
12541
+ }).amount(amount).address(address).build();
11946
12542
  case 3:
11947
12543
  return _context.abrupt("return", _context.sent);
11948
12544
  case 4:
@@ -11972,6 +12568,7 @@ var createTx = function createTx(originApi, destApi, address, amount, currencySy
11972
12568
  }, _callee);
11973
12569
  }));
11974
12570
  };
12571
+
11975
12572
  var checkKeepAlive = function checkKeepAlive(_a) {
11976
12573
  return __awaiter(void 0, [_a], void 0, function (_ref) {
11977
12574
  var originApi = _ref.originApi,
@@ -11981,66 +12578,66 @@ var checkKeepAlive = function checkKeepAlive(_a) {
11981
12578
  destApi = _ref.destApi,
11982
12579
  currencySymbol = _ref.currencySymbol,
11983
12580
  destNode = _ref.destNode;
11984
- return /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
12581
+ return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
11985
12582
  var _yield$destApi$query$, data, balance, _yield$originApi$quer, originData, balanceOrigin, amountBN, ed, edOrigin, tx, xcmFee, amountBNWithoutFee, amountOriginBNWithoutFee;
11986
- return _regeneratorRuntime().wrap(function _callee2$(_context2) {
11987
- while (1) switch (_context2.prev = _context2.next) {
12583
+ return _regeneratorRuntime().wrap(function _callee$(_context) {
12584
+ while (1) switch (_context.prev = _context.next) {
11988
12585
  case 0:
11989
12586
  if (!(destApi === undefined)) {
11990
- _context2.next = 2;
12587
+ _context.next = 2;
11991
12588
  break;
11992
12589
  }
11993
- return _context2.abrupt("return");
12590
+ return _context.abrupt("return");
11994
12591
  case 2:
11995
12592
  if (!(currencySymbol === undefined)) {
11996
- _context2.next = 4;
12593
+ _context.next = 4;
11997
12594
  break;
11998
12595
  }
11999
12596
  throw new KeepAliveError('Currency symbol not found for this asset. Cannot check keep alive.');
12000
12597
  case 4:
12001
12598
  if (!(originNode !== undefined && destNode !== undefined && currencySymbol !== getAssetsObject(destNode).nativeAssetSymbol)) {
12002
- _context2.next = 6;
12599
+ _context.next = 6;
12003
12600
  break;
12004
12601
  }
12005
12602
  throw new KeepAliveError('Keep alive check is only supported when sending native asset of destination parachain.');
12006
12603
  case 6:
12007
- _context2.next = 8;
12604
+ _context.next = 8;
12008
12605
  return destApi.query.system.account(address);
12009
12606
  case 8:
12010
- _yield$destApi$query$ = _context2.sent;
12607
+ _yield$destApi$query$ = _context.sent;
12011
12608
  data = _yield$destApi$query$.data;
12012
12609
  balance = data.free.toBn();
12013
- _context2.next = 13;
12610
+ _context.next = 13;
12014
12611
  return originApi.query.system.account(address);
12015
12612
  case 13:
12016
- _yield$originApi$quer = _context2.sent;
12613
+ _yield$originApi$quer = _context.sent;
12017
12614
  originData = _yield$originApi$quer.data;
12018
12615
  balanceOrigin = originData.free.toBn();
12019
12616
  amountBN = new BN(amount);
12020
- ed = getExistentialDeposit(destNode !== null && destNode !== void 0 ? destNode : determineRelayChain(originNode));
12021
- edOrigin = getExistentialDeposit(originNode !== null && originNode !== void 0 ? originNode : determineRelayChain(destNode));
12022
- _context2.next = 21;
12617
+ ed = getExistentialDeposit$1(destNode !== null && destNode !== void 0 ? destNode : determineRelayChain(originNode));
12618
+ edOrigin = getExistentialDeposit$1(originNode !== null && originNode !== void 0 ? originNode : determineRelayChain(destNode));
12619
+ _context.next = 21;
12023
12620
  return createTx(originApi, destApi, address, amount, currencySymbol, originNode, destNode);
12024
12621
  case 21:
12025
- tx = _context2.sent;
12622
+ tx = _context.sent;
12026
12623
  if (!(tx === null)) {
12027
- _context2.next = 24;
12624
+ _context.next = 24;
12028
12625
  break;
12029
12626
  }
12030
12627
  throw new KeepAliveError('Transaction for XCM fee calculation could not be created.');
12031
12628
  case 24:
12032
- _context2.next = 26;
12033
- return calculateTransactionFee$1(tx, address);
12629
+ _context.next = 26;
12630
+ return calculateTransactionFee(tx, address);
12034
12631
  case 26:
12035
- xcmFee = _context2.sent;
12632
+ xcmFee = _context.sent;
12036
12633
  if (!(ed === null)) {
12037
- _context2.next = 29;
12634
+ _context.next = 29;
12038
12635
  break;
12039
12636
  }
12040
12637
  throw new KeepAliveError('Existential deposit not found for destination parachain.');
12041
12638
  case 29:
12042
12639
  if (!(edOrigin === null)) {
12043
- _context2.next = 31;
12640
+ _context.next = 31;
12044
12641
  break;
12045
12642
  }
12046
12643
  throw new KeepAliveError('Existential deposit not found for origin parachain.');
@@ -12056,98 +12653,77 @@ var checkKeepAlive = function checkKeepAlive(_a) {
12056
12653
  console.log('ORIGIN BALANCE - AMOUNT WITH FEE: ', balanceOrigin.sub(amountBN.sub(xcmFee.mul(new BN(1.5)))).toString());
12057
12654
  amountBNWithoutFee = amountBN.sub(xcmFee.mul(new BN(1.5)));
12058
12655
  if (!balance.add(amountBNWithoutFee).lt(new BN(ed))) {
12059
- _context2.next = 43;
12656
+ _context.next = 43;
12060
12657
  break;
12061
12658
  }
12062
- throw new KeepAliveError("Keep alive check failed: Sending ".concat(amount, " ").concat(currencySymbol, " to ").concat(destNode, " would result in an account balance below the required existential deposit.\n Please increase the amount to meet the minimum balance requirement of the destination chain."));
12659
+ throw new KeepAliveError("Keep alive check failed: Sending ".concat(amount, " ").concat(currencySymbol, " to ").concat(destNode, " would result in an account balance below the required existential deposit.\n Please increase the amount to meet the minimum balance requirement of the destination chain."));
12063
12660
  case 43:
12064
12661
  amountOriginBNWithoutFee = amountBN.sub(xcmFee.mul(new BN(1.5)));
12065
12662
  if (!((currencySymbol === 'DOT' || currencySymbol === 'KSM') && balanceOrigin.sub(amountOriginBNWithoutFee).lt(new BN(edOrigin)))) {
12066
- _context2.next = 46;
12663
+ _context.next = 46;
12067
12664
  break;
12068
12665
  }
12069
- throw new KeepAliveError("Keep alive check failed: Sending ".concat(amount, " ").concat(currencySymbol, " to ").concat(destNode, " would result in an account balance below the required existential deposit on origin.\n Please decrease the amount to meet the minimum balance requirement of the origin chain."));
12666
+ throw new KeepAliveError("Keep alive check failed: Sending ".concat(amount, " ").concat(currencySymbol, " to ").concat(destNode, " would result in an account balance below the required existential deposit on origin.\n Please decrease the amount to meet the minimum balance requirement of the origin chain."));
12070
12667
  case 46:
12071
12668
  case "end":
12072
- return _context2.stop();
12669
+ return _context.stop();
12073
12670
  }
12074
- }, _callee2);
12671
+ }, _callee);
12075
12672
  })();
12076
12673
  });
12077
12674
  };
12078
12675
 
12079
- var transformSendOptions = function transformSendOptions(options) {
12080
- var currency = options.currency;
12081
- if (isTCurrencySpecifier(currency)) {
12082
- if ('symbol' in currency) {
12083
- return Object.assign(Object.assign({}, options), {
12084
- currency: currency.symbol,
12085
- isSymbol: true
12086
- });
12087
- } else if ('id' in currency) {
12088
- return Object.assign(Object.assign({}, options), {
12089
- currency: currency.id,
12090
- isSymbol: false
12091
- });
12092
- }
12093
- }
12094
- return Object.assign(Object.assign({}, options), {
12095
- currency: currency,
12096
- isSymbol: undefined
12097
- });
12098
- };
12099
-
12100
12676
  var sendCommon = function sendCommon(options) {
12101
12677
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
12102
- var _a, _b, _transformSendOptions, api, origin, currency, amount, address, destination, paraIdTo, destApiForKeepAlive, feeAsset, version, isSymbol, _transformSendOptions2, serializedApiCallEnabled, isMultiLocationDestination, isMultiLocationCurrency, isBridge, isRelayDestination, originRelayChainSymbol, destinationRelayChainSymbol, originNode, assetCheckEnabled, asset, apiWithFallback, amountStr, currencyStr;
12678
+ var _a, _b, api, origin, currency, amount, address, destination, paraIdTo, destApiForKeepAlive, feeAsset, version, _options$serializedAp, serializedApiCallEnabled, isMultiLocationDestination, isBridge, isRelayDestination, originRelayChainSymbol, destinationRelayChainSymbol, originNode, assetCheckEnabled, asset, apiWithFallback, amountStr, currencyStr;
12103
12679
  return _regeneratorRuntime().wrap(function _callee$(_context) {
12104
12680
  while (1) switch (_context.prev = _context.next) {
12105
12681
  case 0:
12106
- _transformSendOptions = transformSendOptions(options), api = _transformSendOptions.api, origin = _transformSendOptions.origin, currency = _transformSendOptions.currency, amount = _transformSendOptions.amount, address = _transformSendOptions.address, destination = _transformSendOptions.destination, paraIdTo = _transformSendOptions.paraIdTo, destApiForKeepAlive = _transformSendOptions.destApiForKeepAlive, feeAsset = _transformSendOptions.feeAsset, version = _transformSendOptions.version, isSymbol = _transformSendOptions.isSymbol, _transformSendOptions2 = _transformSendOptions.serializedApiCallEnabled, serializedApiCallEnabled = _transformSendOptions2 === void 0 ? false : _transformSendOptions2;
12107
- if (!((!isTMulti(currency) || isTMultiLocation(currency)) && amount === null)) {
12682
+ api = options.api, origin = options.origin, currency = options.currency, amount = options.amount, address = options.address, destination = options.destination, paraIdTo = options.paraIdTo, destApiForKeepAlive = options.destApiForKeepAlive, feeAsset = options.feeAsset, version = options.version, _options$serializedAp = options.serializedApiCallEnabled, serializedApiCallEnabled = _options$serializedAp === void 0 ? false : _options$serializedAp;
12683
+ if (!((!('multiasset' in currency) || 'multilocation' in currency) && amount === null)) {
12108
12684
  _context.next = 3;
12109
12685
  break;
12110
12686
  }
12111
12687
  throw new Error('Amount is required');
12112
12688
  case 3:
12113
- if (!(typeof currency === 'number' && currency > Number.MAX_SAFE_INTEGER)) {
12689
+ if (!('id' in currency && typeof currency === 'number' && currency > Number.MAX_SAFE_INTEGER)) {
12114
12690
  _context.next = 5;
12115
12691
  break;
12116
12692
  }
12117
12693
  throw new InvalidCurrencyError('The provided asset ID is larger than the maximum safe integer value. Please provide it as a string.');
12118
12694
  case 5:
12119
- if (!(isTMultiLocation(currency) && (feeAsset === 0 || feeAsset !== undefined))) {
12695
+ if (!('multilocation' in currency && (feeAsset === 0 || feeAsset !== undefined))) {
12120
12696
  _context.next = 7;
12121
12697
  break;
12122
12698
  }
12123
12699
  throw new InvalidCurrencyError('Overrided single multi asset cannot be used with fee asset');
12124
12700
  case 7:
12125
- if (!(isTMulti(currency) && Array.isArray(currency))) {
12701
+ if (!('multiasset' in currency)) {
12126
12702
  _context.next = 17;
12127
12703
  break;
12128
12704
  }
12129
12705
  if (amount !== null) {
12130
12706
  console.warn('Amount is ignored when using overriding currency using multiple multi locations. Please set it to null.');
12131
12707
  }
12132
- if (!(currency.length === 0)) {
12708
+ if (!(currency.multiasset.length === 0)) {
12133
12709
  _context.next = 11;
12134
12710
  break;
12135
12711
  }
12136
12712
  throw new InvalidCurrencyError('Overrided multi assets cannot be empty');
12137
12713
  case 11:
12138
- if (!(currency.length === 1 && (feeAsset === 0 || feeAsset !== undefined))) {
12714
+ if (!(currency.multiasset.length === 1 && (feeAsset === 0 || feeAsset !== undefined))) {
12139
12715
  _context.next = 13;
12140
12716
  break;
12141
12717
  }
12142
12718
  throw new InvalidCurrencyError('Overrided single multi asset cannot be used with fee asset');
12143
12719
  case 13:
12144
- if (!(currency.length > 1 && feeAsset === undefined)) {
12720
+ if (!(currency.multiasset.length > 1 && feeAsset === undefined)) {
12145
12721
  _context.next = 15;
12146
12722
  break;
12147
12723
  }
12148
12724
  throw new InvalidCurrencyError('Overrided multi assets cannot be used without specifying fee asset');
12149
12725
  case 15:
12150
- if (!(currency.length > 1 && feeAsset !== undefined && (feeAsset < 0 || feeAsset >= currency.length))) {
12726
+ if (!(currency.multiasset.length > 1 && feeAsset !== undefined && (feeAsset < 0 || feeAsset >= currency.multiasset.length))) {
12151
12727
  _context.next = 17;
12152
12728
  break;
12153
12729
  }
@@ -12160,95 +12736,94 @@ var sendCommon = function sendCommon(options) {
12160
12736
  throw new IncompatibleNodesError('Transfers to Ethereum are only supported from AssetHubPolkadot.');
12161
12737
  case 19:
12162
12738
  isMultiLocationDestination = _typeof(destination) === 'object';
12163
- isMultiLocationCurrency = _typeof(currency) === 'object';
12164
12739
  isBridge = origin === 'AssetHubPolkadot' && destination === 'AssetHubKusama' || origin === 'AssetHubKusama' && destination === 'AssetHubPolkadot';
12165
12740
  isRelayDestination = destination === undefined;
12166
12741
  if (!(!isRelayDestination && !isMultiLocationDestination)) {
12167
- _context.next = 28;
12742
+ _context.next = 27;
12168
12743
  break;
12169
12744
  }
12170
12745
  originRelayChainSymbol = getRelayChainSymbol(origin);
12171
12746
  destinationRelayChainSymbol = getRelayChainSymbol(destination);
12172
12747
  if (!(!isBridge && originRelayChainSymbol !== destinationRelayChainSymbol)) {
12173
- _context.next = 28;
12748
+ _context.next = 27;
12174
12749
  break;
12175
12750
  }
12176
12751
  throw new IncompatibleNodesError();
12177
- case 28:
12752
+ case 27:
12178
12753
  originNode = getNode(origin);
12179
- assetCheckEnabled = isMultiLocationCurrency || isBridge ? false : originNode.assetCheckEnabled;
12180
- asset = assetCheckEnabled ? getAssetBySymbolOrId(origin, currency, isRelayDestination, isSymbol, isTMultiLocation(destination) ? undefined : destination) : null;
12754
+ assetCheckEnabled = 'multilocation' in currency || 'multiasset' in currency || isBridge ? false : originNode.assetCheckEnabled;
12755
+ asset = assetCheckEnabled ? getAssetBySymbolOrId(origin, currency, isRelayDestination, isTMultiLocation(destination) ? undefined : destination) : null;
12181
12756
  if (!(!isBridge && asset === null && assetCheckEnabled)) {
12182
- _context.next = 33;
12757
+ _context.next = 32;
12183
12758
  break;
12184
12759
  }
12185
- throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency or currencyId ").concat(JSON.stringify(currency), "."));
12186
- case 33:
12187
- if (!(!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && isSymbol !== false && asset.assetId !== currency && !hasSupportForAsset(destination, asset.symbol))) {
12188
- _context.next = 35;
12760
+ throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency ").concat(JSON.stringify(currency), "."));
12761
+ case 32:
12762
+ if (!(!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && !('id' in currency) && !hasSupportForAsset(destination, asset.symbol))) {
12763
+ _context.next = 34;
12189
12764
  break;
12190
12765
  }
12191
- throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency or currencyId ").concat(JSON.stringify(currency), "."));
12192
- case 35:
12766
+ throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency ").concat(JSON.stringify(currency), "."));
12767
+ case 34:
12193
12768
  if (!(api !== null && api !== void 0)) {
12194
- _context.next = 39;
12769
+ _context.next = 38;
12195
12770
  break;
12196
12771
  }
12197
12772
  _context.t0 = api;
12198
- _context.next = 42;
12199
- break;
12200
- case 39:
12201
12773
  _context.next = 41;
12774
+ break;
12775
+ case 38:
12776
+ _context.next = 40;
12202
12777
  return createApiInstanceForNode(origin);
12203
- case 41:
12778
+ case 40:
12204
12779
  _context.t0 = _context.sent;
12205
- case 42:
12780
+ case 41:
12206
12781
  apiWithFallback = _context.t0;
12207
12782
  amountStr = amount === null || amount === void 0 ? void 0 : amount.toString();
12208
- if (!isTMulti(currency)) {
12209
- _context.next = 48;
12783
+ if (!('multilocation' in currency || 'multiasset' in currency)) {
12784
+ _context.next = 47;
12210
12785
  break;
12211
12786
  }
12212
12787
  console.warn('Keep alive check is not supported when using MultiLocation as currency.');
12213
- _context.next = 62;
12788
+ _context.next = 61;
12214
12789
  break;
12215
- case 48:
12790
+ case 47:
12216
12791
  if (!(_typeof(address) === 'object')) {
12217
- _context.next = 52;
12792
+ _context.next = 51;
12218
12793
  break;
12219
12794
  }
12220
12795
  console.warn('Keep alive check is not supported when using MultiLocation as address.');
12221
- _context.next = 62;
12796
+ _context.next = 61;
12222
12797
  break;
12223
- case 52:
12798
+ case 51:
12224
12799
  if (!(_typeof(destination) === 'object')) {
12225
- _context.next = 56;
12800
+ _context.next = 55;
12226
12801
  break;
12227
12802
  }
12228
12803
  console.warn('Keep alive check is not supported when using MultiLocation as destination.');
12229
- _context.next = 62;
12804
+ _context.next = 61;
12230
12805
  break;
12231
- case 56:
12806
+ case 55:
12232
12807
  if (!(origin === 'Ethereum' || destination === 'Ethereum')) {
12233
- _context.next = 60;
12808
+ _context.next = 59;
12234
12809
  break;
12235
12810
  }
12236
12811
  console.warn('Keep alive check is not supported when using Ethereum as origin or destination.');
12237
- _context.next = 62;
12812
+ _context.next = 61;
12238
12813
  break;
12239
- case 60:
12240
- _context.next = 62;
12814
+ case 59:
12815
+ _context.next = 61;
12241
12816
  return checkKeepAlive({
12242
12817
  originApi: apiWithFallback,
12243
12818
  address: address,
12244
12819
  amount: amountStr !== null && amountStr !== void 0 ? amountStr : '',
12245
12820
  originNode: origin,
12246
12821
  destApi: destApiForKeepAlive,
12247
- currencySymbol: (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : currency.toString(),
12822
+ currencySymbol: (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : 'symbol' in currency ? currency.symbol : undefined,
12248
12823
  destNode: destination
12249
12824
  });
12250
- case 62:
12251
- currencyStr = isTMulti(currency) ? undefined : currency.toString();
12825
+ case 61:
12826
+ currencyStr = 'symbol' in currency ? currency.symbol : 'id' in currency ? currency.id.toString() : undefined;
12252
12827
  return _context.abrupt("return", originNode.transfer({
12253
12828
  api: apiWithFallback,
12254
12829
  currencySymbol: (_b = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _b !== void 0 ? _b : currencyStr,
@@ -12257,12 +12832,12 @@ var sendCommon = function sendCommon(options) {
12257
12832
  address: address,
12258
12833
  destination: destination,
12259
12834
  paraIdTo: paraIdTo,
12260
- overridedCurrencyMultiLocation: isTMulti(currency) ? currency : undefined,
12835
+ overridedCurrencyMultiLocation: 'multilocation' in currency ? currency.multilocation : 'multiasset' in currency ? currency.multiasset : undefined,
12261
12836
  feeAsset: feeAsset,
12262
12837
  version: version,
12263
12838
  serializedApiCallEnabled: serializedApiCallEnabled
12264
12839
  }));
12265
- case 64:
12840
+ case 63:
12266
12841
  case "end":
12267
12842
  return _context.stop();
12268
12843
  }
@@ -12299,11 +12874,11 @@ var send = function send(options) {
12299
12874
  };
12300
12875
  var transferRelayToParaCommon = function transferRelayToParaCommon(options) {
12301
12876
  return __awaiter(void 0, void 0, void 0, /*#__PURE__*/_regeneratorRuntime().mark(function _callee4() {
12302
- var api, destination, amount, address, paraIdTo, destApiForKeepAlive, version, _options$serializedAp, serializedApiCallEnabled, isMultiLocationDestination, isAddressMultiLocation, apiWithFallback, amountStr, serializedApiCall;
12877
+ var api, destination, amount, address, paraIdTo, destApiForKeepAlive, version, _options$serializedAp2, serializedApiCallEnabled, isMultiLocationDestination, isAddressMultiLocation, apiWithFallback, amountStr, serializedApiCall;
12303
12878
  return _regeneratorRuntime().wrap(function _callee4$(_context4) {
12304
12879
  while (1) switch (_context4.prev = _context4.next) {
12305
12880
  case 0:
12306
- api = options.api, destination = options.destination, amount = options.amount, address = options.address, paraIdTo = options.paraIdTo, destApiForKeepAlive = options.destApiForKeepAlive, version = options.version, _options$serializedAp = options.serializedApiCallEnabled, serializedApiCallEnabled = _options$serializedAp === void 0 ? false : _options$serializedAp;
12881
+ api = options.api, destination = options.destination, amount = options.amount, address = options.address, paraIdTo = options.paraIdTo, destApiForKeepAlive = options.destApiForKeepAlive, version = options.version, _options$serializedAp2 = options.serializedApiCallEnabled, serializedApiCallEnabled = _options$serializedAp2 === void 0 ? false : _options$serializedAp2;
12307
12882
  isMultiLocationDestination = _typeof(destination) === 'object';
12308
12883
  isAddressMultiLocation = _typeof(address) === 'object';
12309
12884
  if (!(api === undefined && isMultiLocationDestination)) {
@@ -12453,7 +13028,8 @@ var buildEthTransferOptions = function buildEthTransferOptions(_a) {
12453
13028
  token: plan.success.token,
12454
13029
  destinationParaId: plan.success.destinationParaId,
12455
13030
  destinationFee: plan.success.destinationFee,
12456
- amount: plan.success.amount
13031
+ amount: plan.success.amount,
13032
+ fee: plan.success.fee
12457
13033
  });
12458
13034
  case 15:
12459
13035
  case "end":
@@ -12474,4 +13050,4 @@ var index = /*#__PURE__*/Object.freeze({
12474
13050
  transferRelayToParaSerializedApiCall: transferRelayToParaSerializedApiCall
12475
13051
  });
12476
13052
 
12477
- export { BatchMode, Builder, CloseChannelBuilder, DuplicateAssetError, EvmBuilder, IncompatibleNodesError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, OpenChannelBuilder, Parents, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, index$1 as assets, buildEthTransferOptions, index$3 as closeChannels, createApiInstanceForNode, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, index$2 as openChannels, send, sendSerializedApiCall, transferRelayToPara, transferRelayToParaCommon, transferRelayToParaSerializedApiCall, index as xcmPallet };
13053
+ export { BatchMode, Builder, DuplicateAssetError, EvmBuilder, GeneralBuilder, IncompatibleNodesError, InvalidCurrencyError, NODES_WITH_RELAY_CHAINS, NODES_WITH_RELAY_CHAINS_DOT_KSM, NODE_NAMES, NODE_NAMES_DOT_KSM, NoXCMSupportImplementedError, NodeNotSupportedError, Parents, SUPPORTED_PALLETS, ScenarioNotSupportedError, Version, index$1 as assets, buildEthTransferOptions, createApiInstanceForNode, determineRelayChain, getAllAssetsSymbols, getAllNodeProviders, getAssetDecimals, getAssetId, getAssets, getAssetsObject, getBalanceForeign, getBalanceNative, getDefaultPallet, getExistentialDeposit$1 as getExistentialDeposit, getNativeAssetSymbol, getNativeAssets, getNode, getNodeEndpointOption, getNodeProvider, getOtherAssets, getParaId, getRelayChainSymbol, getSupportedAssets, getSupportedPallets, getTNode, getTransferInfo, hasSupportForAsset, isRelayChain, send, sendSerializedApiCall, transferRelayToPara, transferRelayToParaCommon, transferRelayToParaSerializedApiCall, index as xcmPallet };