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