@paraspell/sdk 7.0.0 → 7.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +284 -161
- package/dist/index.d.ts +35 -3
- package/dist/index.mjs +284 -162
- package/dist/papi/index.cjs +285 -164
- package/dist/papi/index.d.ts +35 -3
- package/dist/papi/index.mjs +285 -165
- package/package.json +1 -1
package/dist/papi/index.cjs
CHANGED
|
@@ -2066,22 +2066,22 @@ var Moonbeam$3 = {
|
|
|
2066
2066
|
otherAssets: [
|
|
2067
2067
|
{
|
|
2068
2068
|
assetId: "78407957940239408223554844611219482002",
|
|
2069
|
-
symbol: "
|
|
2069
|
+
symbol: "xcibcMOVR",
|
|
2070
2070
|
decimals: 18
|
|
2071
2071
|
},
|
|
2072
2072
|
{
|
|
2073
2073
|
assetId: "150874409661081770150564009349448205842",
|
|
2074
|
-
symbol: "
|
|
2074
|
+
symbol: "xcZTG",
|
|
2075
2075
|
decimals: 10
|
|
2076
2076
|
},
|
|
2077
2077
|
{
|
|
2078
2078
|
assetId: "283870493414747423842723289889816153538",
|
|
2079
|
-
symbol: "
|
|
2079
|
+
symbol: "xcUNQ",
|
|
2080
2080
|
decimals: 18
|
|
2081
2081
|
},
|
|
2082
2082
|
{
|
|
2083
2083
|
assetId: "90225766094594282577230355136633846906",
|
|
2084
|
-
symbol: "
|
|
2084
|
+
symbol: "xcPDEX",
|
|
2085
2085
|
decimals: 12
|
|
2086
2086
|
},
|
|
2087
2087
|
{
|
|
@@ -2091,27 +2091,27 @@ var Moonbeam$3 = {
|
|
|
2091
2091
|
},
|
|
2092
2092
|
{
|
|
2093
2093
|
assetId: "314077021455772878282433861213184736939",
|
|
2094
|
-
symbol: "
|
|
2094
|
+
symbol: "xcPEAQ",
|
|
2095
2095
|
decimals: 18
|
|
2096
2096
|
},
|
|
2097
2097
|
{
|
|
2098
2098
|
assetId: "144012926827374458669278577633504620722",
|
|
2099
|
-
symbol: "
|
|
2099
|
+
symbol: "xcFIL",
|
|
2100
2100
|
decimals: 18
|
|
2101
2101
|
},
|
|
2102
2102
|
{
|
|
2103
2103
|
assetId: "125699734534028342599692732320197985871",
|
|
2104
|
-
symbol: "
|
|
2104
|
+
symbol: "xcRING",
|
|
2105
2105
|
decimals: 18
|
|
2106
2106
|
},
|
|
2107
2107
|
{
|
|
2108
2108
|
assetId: "91372035960551235635465443179559840483",
|
|
2109
|
-
symbol: "
|
|
2109
|
+
symbol: "xcCFG",
|
|
2110
2110
|
decimals: 18
|
|
2111
2111
|
},
|
|
2112
2112
|
{
|
|
2113
2113
|
assetId: "187224307232923873519830480073807488153",
|
|
2114
|
-
symbol: "
|
|
2114
|
+
symbol: "xcEQD",
|
|
2115
2115
|
decimals: 9
|
|
2116
2116
|
},
|
|
2117
2117
|
{
|
|
@@ -2121,37 +2121,37 @@ var Moonbeam$3 = {
|
|
|
2121
2121
|
},
|
|
2122
2122
|
{
|
|
2123
2123
|
assetId: "69606720909260275826784788104880799692",
|
|
2124
|
-
symbol: "
|
|
2124
|
+
symbol: "xcHDX",
|
|
2125
2125
|
decimals: 12
|
|
2126
2126
|
},
|
|
2127
2127
|
{
|
|
2128
2128
|
assetId: "133307414193833606001516599592873928539",
|
|
2129
|
-
symbol: "
|
|
2129
|
+
symbol: "xcibcTIA",
|
|
2130
2130
|
decimals: 6
|
|
2131
2131
|
},
|
|
2132
2132
|
{
|
|
2133
2133
|
assetId: "190590555344745888270686124937537713878",
|
|
2134
|
-
symbol: "
|
|
2134
|
+
symbol: "xcEQ",
|
|
2135
2135
|
decimals: 9
|
|
2136
2136
|
},
|
|
2137
2137
|
{
|
|
2138
2138
|
assetId: "61295607754960722617854661686514597014",
|
|
2139
|
-
symbol: "
|
|
2139
|
+
symbol: "xcWIFD",
|
|
2140
2140
|
decimals: 10
|
|
2141
2141
|
},
|
|
2142
2142
|
{
|
|
2143
2143
|
assetId: "141196559012917796508928734717797136690",
|
|
2144
|
-
symbol: "
|
|
2144
|
+
symbol: "xcibcIST",
|
|
2145
2145
|
decimals: 6
|
|
2146
2146
|
},
|
|
2147
2147
|
{
|
|
2148
2148
|
assetId: "29085784439601774464560083082574142143",
|
|
2149
|
-
symbol: "
|
|
2149
|
+
symbol: "xcvDOT",
|
|
2150
2150
|
decimals: 10
|
|
2151
2151
|
},
|
|
2152
2152
|
{
|
|
2153
2153
|
assetId: "225719522181998468294117309041779353812",
|
|
2154
|
-
symbol: "
|
|
2154
|
+
symbol: "xcLDOT",
|
|
2155
2155
|
decimals: 10
|
|
2156
2156
|
},
|
|
2157
2157
|
{
|
|
@@ -2161,142 +2161,142 @@ var Moonbeam$3 = {
|
|
|
2161
2161
|
},
|
|
2162
2162
|
{
|
|
2163
2163
|
assetId: "124463719055550872076363892993240202694",
|
|
2164
|
-
symbol: "
|
|
2164
|
+
symbol: "xcDED",
|
|
2165
2165
|
decimals: 10
|
|
2166
2166
|
},
|
|
2167
2167
|
{
|
|
2168
2168
|
assetId: "224077081838586484055667086558292981199",
|
|
2169
|
-
symbol: "
|
|
2169
|
+
symbol: "xcASTR",
|
|
2170
2170
|
decimals: 18
|
|
2171
2171
|
},
|
|
2172
2172
|
{
|
|
2173
2173
|
assetId: "199907282886248358976504623107230837230",
|
|
2174
|
-
symbol: "
|
|
2174
|
+
symbol: "xcibcBLD",
|
|
2175
2175
|
decimals: 6
|
|
2176
2176
|
},
|
|
2177
2177
|
{
|
|
2178
2178
|
assetId: "166377000701797186346254371275954761085",
|
|
2179
|
-
symbol: "
|
|
2179
|
+
symbol: "xcUSDC",
|
|
2180
2180
|
decimals: 6
|
|
2181
2181
|
},
|
|
2182
2182
|
{
|
|
2183
2183
|
assetId: "142155548796783636521833385094843759961",
|
|
2184
|
-
symbol: "
|
|
2184
|
+
symbol: "xcBNCS",
|
|
2185
2185
|
decimals: 12
|
|
2186
2186
|
},
|
|
2187
2187
|
{
|
|
2188
2188
|
assetId: "89994634370519791027168048838578580624",
|
|
2189
|
-
symbol: "
|
|
2189
|
+
symbol: "xcSUB",
|
|
2190
2190
|
decimals: 10
|
|
2191
2191
|
},
|
|
2192
2192
|
{
|
|
2193
2193
|
assetId: "138280378441551394289980644963240827219",
|
|
2194
|
-
symbol: "
|
|
2194
|
+
symbol: "xcibcATOM",
|
|
2195
2195
|
decimals: 6
|
|
2196
2196
|
},
|
|
2197
2197
|
{
|
|
2198
2198
|
assetId: "228510780171552721666262089780561563481",
|
|
2199
|
-
symbol: "
|
|
2199
|
+
symbol: "xcibcPICA",
|
|
2200
2200
|
decimals: 12
|
|
2201
2201
|
},
|
|
2202
2202
|
{
|
|
2203
2203
|
assetId: "204507659831918931608354793288110796652",
|
|
2204
|
-
symbol: "
|
|
2204
|
+
symbol: "xcvGLMR",
|
|
2205
2205
|
decimals: 18
|
|
2206
2206
|
},
|
|
2207
2207
|
{
|
|
2208
2208
|
assetId: "184218609779515850660274730699350567246",
|
|
2209
|
-
symbol: "
|
|
2209
|
+
symbol: "xcNCTR",
|
|
2210
2210
|
decimals: 18
|
|
2211
2211
|
},
|
|
2212
2212
|
{
|
|
2213
2213
|
assetId: "289989900872525819559124583375550296953",
|
|
2214
|
-
symbol: "
|
|
2214
|
+
symbol: "xcvMANTA",
|
|
2215
2215
|
decimals: 18
|
|
2216
2216
|
},
|
|
2217
2217
|
{
|
|
2218
2218
|
assetId: "110021739665376159354538090254163045594",
|
|
2219
|
-
symbol: "
|
|
2219
|
+
symbol: "xcaUSD",
|
|
2220
2220
|
decimals: 12
|
|
2221
2221
|
},
|
|
2222
2222
|
{
|
|
2223
2223
|
assetId: "311091173110107856861649819128533077277",
|
|
2224
|
-
symbol: "
|
|
2224
|
+
symbol: "xcUSDT",
|
|
2225
2225
|
decimals: 6
|
|
2226
2226
|
},
|
|
2227
2227
|
{
|
|
2228
2228
|
assetId: "64174511183114006009298114091987195453",
|
|
2229
|
-
symbol: "
|
|
2229
|
+
symbol: "xcPINK",
|
|
2230
2230
|
decimals: 10
|
|
2231
2231
|
},
|
|
2232
2232
|
{
|
|
2233
2233
|
assetId: "309163521958167876851250718453738106865",
|
|
2234
|
-
symbol: "
|
|
2234
|
+
symbol: "xcNODL",
|
|
2235
2235
|
decimals: 11
|
|
2236
2236
|
},
|
|
2237
2237
|
{
|
|
2238
2238
|
assetId: "120637696315203257380661607956669368914",
|
|
2239
|
-
symbol: "
|
|
2239
|
+
symbol: "xcIBTC",
|
|
2240
2240
|
decimals: 8
|
|
2241
2241
|
},
|
|
2242
2242
|
{
|
|
2243
2243
|
assetId: "166446646689194205559791995948102903873",
|
|
2244
|
-
symbol: "
|
|
2244
|
+
symbol: "xcMANTA",
|
|
2245
2245
|
decimals: 18
|
|
2246
2246
|
},
|
|
2247
2247
|
{
|
|
2248
2248
|
assetId: "101170542313601871197860408087030232491",
|
|
2249
|
-
symbol: "
|
|
2249
|
+
symbol: "xcINTR",
|
|
2250
2250
|
decimals: 10
|
|
2251
2251
|
},
|
|
2252
2252
|
{
|
|
2253
2253
|
assetId: "165823357460190568952172802245839421906",
|
|
2254
|
-
symbol: "
|
|
2254
|
+
symbol: "xcBNC",
|
|
2255
2255
|
decimals: 12
|
|
2256
2256
|
},
|
|
2257
2257
|
{
|
|
2258
2258
|
assetId: "32615670524745285411807346420584982855",
|
|
2259
|
-
symbol: "
|
|
2259
|
+
symbol: "xcPARA",
|
|
2260
2260
|
decimals: 12
|
|
2261
2261
|
},
|
|
2262
2262
|
{
|
|
2263
2263
|
assetId: "42259045809535163221576417993425387648",
|
|
2264
|
-
symbol: "
|
|
2264
|
+
symbol: "xcDOT",
|
|
2265
2265
|
decimals: 10
|
|
2266
2266
|
},
|
|
2267
2267
|
{
|
|
2268
2268
|
assetId: "45647473099451451833602657905356404688",
|
|
2269
|
-
symbol: "
|
|
2269
|
+
symbol: "xcPEN",
|
|
2270
2270
|
decimals: 12
|
|
2271
2271
|
},
|
|
2272
2272
|
{
|
|
2273
2273
|
assetId: "224821240862170613278369189818311486111",
|
|
2274
|
-
symbol: "
|
|
2274
|
+
symbol: "xcACA",
|
|
2275
2275
|
decimals: 12
|
|
2276
2276
|
},
|
|
2277
2277
|
{
|
|
2278
2278
|
assetId: "272547899416482196831721420898811311297",
|
|
2279
|
-
symbol: "
|
|
2279
|
+
symbol: "xcvFIL",
|
|
2280
2280
|
decimals: 18
|
|
2281
2281
|
},
|
|
2282
2282
|
{
|
|
2283
2283
|
assetId: "114018676402354620972806895487280206446",
|
|
2284
|
-
symbol: "
|
|
2284
|
+
symbol: "xcvASTR",
|
|
2285
2285
|
decimals: 18
|
|
2286
2286
|
},
|
|
2287
2287
|
{
|
|
2288
2288
|
assetId: "238111524681612888331172110363070489924",
|
|
2289
|
-
symbol: "
|
|
2289
|
+
symbol: "xcNEURO",
|
|
2290
2290
|
decimals: 12
|
|
2291
2291
|
},
|
|
2292
2292
|
{
|
|
2293
2293
|
assetId: "112679793397406599376365943185137098326",
|
|
2294
|
-
symbol: "
|
|
2294
|
+
symbol: "xcSTINK",
|
|
2295
2295
|
decimals: 10
|
|
2296
2296
|
},
|
|
2297
2297
|
{
|
|
2298
2298
|
assetId: "132685552157663328694213725410064821485",
|
|
2299
|
-
symbol: "
|
|
2299
|
+
symbol: "xcPHA",
|
|
2300
2300
|
decimals: 12
|
|
2301
2301
|
}
|
|
2302
2302
|
]
|
|
@@ -5471,122 +5471,122 @@ var Moonriver$3 = {
|
|
|
5471
5471
|
otherAssets: [
|
|
5472
5472
|
{
|
|
5473
5473
|
assetId: "108457044225666871745333730479173774551",
|
|
5474
|
-
symbol: "
|
|
5474
|
+
symbol: "xcCSM",
|
|
5475
5475
|
decimals: 12
|
|
5476
5476
|
},
|
|
5477
5477
|
{
|
|
5478
5478
|
assetId: "16797826370226091782818345603793389938",
|
|
5479
|
-
symbol: "
|
|
5479
|
+
symbol: "xcSDN",
|
|
5480
5480
|
decimals: 18
|
|
5481
5481
|
},
|
|
5482
5482
|
{
|
|
5483
5483
|
assetId: "76100021443485661246318545281171740067",
|
|
5484
|
-
symbol: "
|
|
5484
|
+
symbol: "xcHKO",
|
|
5485
5485
|
decimals: 12
|
|
5486
5486
|
},
|
|
5487
5487
|
{
|
|
5488
5488
|
assetId: "138512078356357941985706694377215053953",
|
|
5489
|
-
symbol: "
|
|
5489
|
+
symbol: "xcTNKR",
|
|
5490
5490
|
decimals: 12
|
|
5491
5491
|
},
|
|
5492
5492
|
{
|
|
5493
5493
|
assetId: "328179947973504579459046439826496046832",
|
|
5494
|
-
symbol: "
|
|
5494
|
+
symbol: "xcKBTC",
|
|
5495
5495
|
decimals: 8
|
|
5496
5496
|
},
|
|
5497
5497
|
{
|
|
5498
5498
|
assetId: "108036400430056508975016746969135344601",
|
|
5499
|
-
symbol: "
|
|
5499
|
+
symbol: "xcXRT",
|
|
5500
5500
|
decimals: 9
|
|
5501
5501
|
},
|
|
5502
5502
|
{
|
|
5503
5503
|
assetId: "133300872918374599700079037156071917454",
|
|
5504
|
-
symbol: "
|
|
5504
|
+
symbol: "xcTUR",
|
|
5505
5505
|
decimals: 10
|
|
5506
5506
|
},
|
|
5507
5507
|
{
|
|
5508
5508
|
assetId: "213357169630950964874127107356898319277",
|
|
5509
|
-
symbol: "
|
|
5509
|
+
symbol: "xcKMA",
|
|
5510
5510
|
decimals: 12
|
|
5511
5511
|
},
|
|
5512
5512
|
{
|
|
5513
5513
|
assetId: "65216491554813189869575508812319036608",
|
|
5514
|
-
symbol: "
|
|
5514
|
+
symbol: "xcLIT",
|
|
5515
5515
|
decimals: 12
|
|
5516
5516
|
},
|
|
5517
5517
|
{
|
|
5518
5518
|
assetId: "173481220575862801646329923366065693029",
|
|
5519
|
-
symbol: "
|
|
5519
|
+
symbol: "xcCRAB",
|
|
5520
5520
|
decimals: 18
|
|
5521
5521
|
},
|
|
5522
5522
|
{
|
|
5523
5523
|
assetId: "189307976387032586987344677431204943363",
|
|
5524
|
-
symbol: "
|
|
5524
|
+
symbol: "xcPHA",
|
|
5525
5525
|
decimals: 12
|
|
5526
5526
|
},
|
|
5527
5527
|
{
|
|
5528
5528
|
assetId: "264344629840762281112027368930249420542",
|
|
5529
|
-
symbol: "
|
|
5529
|
+
symbol: "xcvKSM",
|
|
5530
5530
|
decimals: 12
|
|
5531
5531
|
},
|
|
5532
5532
|
{
|
|
5533
5533
|
assetId: "72145018963825376852137222787619937732",
|
|
5534
|
-
symbol: "
|
|
5534
|
+
symbol: "xcvBNC",
|
|
5535
5535
|
decimals: 12
|
|
5536
5536
|
},
|
|
5537
5537
|
{
|
|
5538
5538
|
assetId: "214920334981412447805621250067209749032",
|
|
5539
|
-
symbol: "
|
|
5539
|
+
symbol: "xcaSeed",
|
|
5540
5540
|
decimals: 12
|
|
5541
5541
|
},
|
|
5542
5542
|
{
|
|
5543
5543
|
assetId: "175400718394635817552109270754364440562",
|
|
5544
|
-
symbol: "
|
|
5544
|
+
symbol: "xcKINT",
|
|
5545
5545
|
decimals: 12
|
|
5546
5546
|
},
|
|
5547
5547
|
{
|
|
5548
5548
|
assetId: "167283995827706324502761431814209211090",
|
|
5549
|
-
symbol: "
|
|
5549
|
+
symbol: "xcPICA",
|
|
5550
5550
|
decimals: 12
|
|
5551
5551
|
},
|
|
5552
5552
|
{
|
|
5553
5553
|
assetId: "105075627293246237499203909093923548958",
|
|
5554
|
-
symbol: "
|
|
5554
|
+
symbol: "xcTEER",
|
|
5555
5555
|
decimals: 12
|
|
5556
5556
|
},
|
|
5557
5557
|
{
|
|
5558
5558
|
assetId: "118095707745084482624853002839493125353",
|
|
5559
|
-
symbol: "
|
|
5559
|
+
symbol: "xcMGX",
|
|
5560
5560
|
decimals: 18
|
|
5561
5561
|
},
|
|
5562
5562
|
{
|
|
5563
5563
|
assetId: "203223821023327994093278529517083736593",
|
|
5564
|
-
symbol: "
|
|
5564
|
+
symbol: "xcvMOVR",
|
|
5565
5565
|
decimals: 18
|
|
5566
5566
|
},
|
|
5567
5567
|
{
|
|
5568
5568
|
assetId: "311091173110107856861649819128533077277",
|
|
5569
|
-
symbol: "
|
|
5569
|
+
symbol: "xcUSDT",
|
|
5570
5570
|
decimals: 6
|
|
5571
5571
|
},
|
|
5572
5572
|
{
|
|
5573
5573
|
assetId: "182365888117048807484804376330534607370",
|
|
5574
|
-
symbol: "
|
|
5574
|
+
symbol: "xcRMRK",
|
|
5575
5575
|
decimals: 10
|
|
5576
5576
|
},
|
|
5577
5577
|
{
|
|
5578
5578
|
assetId: "42259045809535163221576417993425387648",
|
|
5579
|
-
symbol: "
|
|
5579
|
+
symbol: "xcKSM",
|
|
5580
5580
|
decimals: 12
|
|
5581
5581
|
},
|
|
5582
5582
|
{
|
|
5583
5583
|
assetId: "10810581592933651521121702237638664357",
|
|
5584
|
-
symbol: "
|
|
5584
|
+
symbol: "xcKAR",
|
|
5585
5585
|
decimals: 12
|
|
5586
5586
|
},
|
|
5587
5587
|
{
|
|
5588
5588
|
assetId: "319623561105283008236062145480775032445",
|
|
5589
|
-
symbol: "
|
|
5589
|
+
symbol: "xcBNC",
|
|
5590
5590
|
decimals: 12
|
|
5591
5591
|
}
|
|
5592
5592
|
]
|
|
@@ -9064,6 +9064,45 @@ var Crust$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9064
9064
|
}]);
|
|
9065
9065
|
}(ParachainNode);
|
|
9066
9066
|
|
|
9067
|
+
var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
|
|
9068
|
+
function PolkadotXCMTransferImpl() {
|
|
9069
|
+
_classCallCheck(this, PolkadotXCMTransferImpl);
|
|
9070
|
+
}
|
|
9071
|
+
return _createClass(PolkadotXCMTransferImpl, null, [{
|
|
9072
|
+
key: "transferPolkadotXCM",
|
|
9073
|
+
value: function transferPolkadotXCM(_ref, section) {
|
|
9074
|
+
var api = _ref.api,
|
|
9075
|
+
header = _ref.header,
|
|
9076
|
+
addressSelection = _ref.addressSelection,
|
|
9077
|
+
currencySelection = _ref.currencySelection,
|
|
9078
|
+
_ref$feeAsset = _ref.feeAsset,
|
|
9079
|
+
feeAsset = _ref$feeAsset === void 0 ? DEFAULT_FEE_ASSET : _ref$feeAsset,
|
|
9080
|
+
serializedApiCallEnabled = _ref.serializedApiCallEnabled;
|
|
9081
|
+
var fees = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
9082
|
+
var module = 'PolkadotXcm';
|
|
9083
|
+
var call = {
|
|
9084
|
+
module: module,
|
|
9085
|
+
section: section,
|
|
9086
|
+
parameters: Object.assign({
|
|
9087
|
+
dest: header,
|
|
9088
|
+
beneficiary: addressSelection,
|
|
9089
|
+
assets: currencySelection,
|
|
9090
|
+
fee_asset_item: feeAsset
|
|
9091
|
+
}, fees !== undefined ? {
|
|
9092
|
+
weight_limit: fees
|
|
9093
|
+
} : {})
|
|
9094
|
+
};
|
|
9095
|
+
if (serializedApiCallEnabled === true) {
|
|
9096
|
+
// Keep compatible with old serialized call type
|
|
9097
|
+
return Object.assign(Object.assign({}, call), {
|
|
9098
|
+
parameters: Object.values(call.parameters)
|
|
9099
|
+
});
|
|
9100
|
+
}
|
|
9101
|
+
return api.callTxMethod(call);
|
|
9102
|
+
}
|
|
9103
|
+
}]);
|
|
9104
|
+
}();
|
|
9105
|
+
|
|
9067
9106
|
var BifrostPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
9068
9107
|
function BifrostPolkadot() {
|
|
9069
9108
|
_classCallCheck(this, BifrostPolkadot);
|
|
@@ -9111,6 +9150,39 @@ var BifrostPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9111
9150
|
var currencySelection = this.getCurrencySelection(currency, currencyID);
|
|
9112
9151
|
return XTokensTransferImpl.transferXTokens(input, currencySelection);
|
|
9113
9152
|
}
|
|
9153
|
+
// Handles DOT, WETH transfers to AssetHubPolkadot
|
|
9154
|
+
}, {
|
|
9155
|
+
key: "transferPolkadotXCM",
|
|
9156
|
+
value: function transferPolkadotXCM(input) {
|
|
9157
|
+
var _a;
|
|
9158
|
+
var amount = input.amount,
|
|
9159
|
+
overridedCurrency = input.overridedCurrency,
|
|
9160
|
+
currencySymbol = input.currencySymbol;
|
|
9161
|
+
var ETH_CHAIN_ID = BigInt(1);
|
|
9162
|
+
var ethJunction = {
|
|
9163
|
+
GlobalConsensus: {
|
|
9164
|
+
Ethereum: {
|
|
9165
|
+
chain_id: ETH_CHAIN_ID
|
|
9166
|
+
}
|
|
9167
|
+
}
|
|
9168
|
+
};
|
|
9169
|
+
return PolkadotXCMTransferImpl.transferPolkadotXCM(Object.assign(Object.assign({}, input), {
|
|
9170
|
+
currencySelection: createCurrencySpec(amount, this.version, currencySymbol === 'DOT' ? exports.Parents.ONE : exports.Parents.TWO, overridedCurrency, currencySymbol === 'WETH' ? {
|
|
9171
|
+
X2: [ethJunction, {
|
|
9172
|
+
AccountKey20: {
|
|
9173
|
+
key: (_a = getAssetId('Ethereum', 'WETH')) !== null && _a !== void 0 ? _a : ''
|
|
9174
|
+
}
|
|
9175
|
+
}]
|
|
9176
|
+
} : undefined)
|
|
9177
|
+
}), 'transfer_assets', 'Unlimited');
|
|
9178
|
+
}
|
|
9179
|
+
}, {
|
|
9180
|
+
key: "canUseXTokens",
|
|
9181
|
+
value: function canUseXTokens(_ref) {
|
|
9182
|
+
var currencySymbol = _ref.currencySymbol,
|
|
9183
|
+
destination = _ref.destination;
|
|
9184
|
+
return currencySymbol !== 'WETH' && currencySymbol !== 'DOT' || destination !== 'AssetHubPolkadot';
|
|
9185
|
+
}
|
|
9114
9186
|
}]);
|
|
9115
9187
|
}(ParachainNode);
|
|
9116
9188
|
|
|
@@ -9594,45 +9666,6 @@ var Karura$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
|
9594
9666
|
}]);
|
|
9595
9667
|
}(ParachainNode);
|
|
9596
9668
|
|
|
9597
|
-
var PolkadotXCMTransferImpl = /*#__PURE__*/function () {
|
|
9598
|
-
function PolkadotXCMTransferImpl() {
|
|
9599
|
-
_classCallCheck(this, PolkadotXCMTransferImpl);
|
|
9600
|
-
}
|
|
9601
|
-
return _createClass(PolkadotXCMTransferImpl, null, [{
|
|
9602
|
-
key: "transferPolkadotXCM",
|
|
9603
|
-
value: function transferPolkadotXCM(_ref, section) {
|
|
9604
|
-
var api = _ref.api,
|
|
9605
|
-
header = _ref.header,
|
|
9606
|
-
addressSelection = _ref.addressSelection,
|
|
9607
|
-
currencySelection = _ref.currencySelection,
|
|
9608
|
-
_ref$feeAsset = _ref.feeAsset,
|
|
9609
|
-
feeAsset = _ref$feeAsset === void 0 ? DEFAULT_FEE_ASSET : _ref$feeAsset,
|
|
9610
|
-
serializedApiCallEnabled = _ref.serializedApiCallEnabled;
|
|
9611
|
-
var fees = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : undefined;
|
|
9612
|
-
var module = 'PolkadotXcm';
|
|
9613
|
-
var call = {
|
|
9614
|
-
module: module,
|
|
9615
|
-
section: section,
|
|
9616
|
-
parameters: Object.assign({
|
|
9617
|
-
dest: header,
|
|
9618
|
-
beneficiary: addressSelection,
|
|
9619
|
-
assets: currencySelection,
|
|
9620
|
-
fee_asset_item: feeAsset
|
|
9621
|
-
}, fees !== undefined ? {
|
|
9622
|
-
weight_limit: fees
|
|
9623
|
-
} : {})
|
|
9624
|
-
};
|
|
9625
|
-
if (serializedApiCallEnabled === true) {
|
|
9626
|
-
// Keep compatible with old serialized call type
|
|
9627
|
-
return Object.assign(Object.assign({}, call), {
|
|
9628
|
-
parameters: Object.values(call.parameters)
|
|
9629
|
-
});
|
|
9630
|
-
}
|
|
9631
|
-
return api.callTxMethod(call);
|
|
9632
|
-
}
|
|
9633
|
-
}]);
|
|
9634
|
-
}();
|
|
9635
|
-
|
|
9636
9669
|
var AssetHubPolkadot$2 = /*#__PURE__*/function (_ParachainNode) {
|
|
9637
9670
|
function AssetHubPolkadot() {
|
|
9638
9671
|
_classCallCheck(this, AssetHubPolkadot);
|
|
@@ -11286,21 +11319,63 @@ var getSupportedPallets = function getSupportedPallets(node) {
|
|
|
11286
11319
|
|
|
11287
11320
|
// Contains function for getting Asset ID or Symbol used in XCM call creation
|
|
11288
11321
|
var findAssetBySymbol = function findAssetBySymbol(node, destination, otherAssets, nativeAssets, combinedAssets, symbol, isRelayDestination) {
|
|
11322
|
+
var lowerSymbol = symbol.toLowerCase();
|
|
11289
11323
|
if (destination === 'Ethereum') {
|
|
11290
11324
|
return combinedAssets.find(function (_ref) {
|
|
11291
11325
|
var assetSymbol = _ref.symbol;
|
|
11292
|
-
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) ===
|
|
11326
|
+
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === lowerSymbol;
|
|
11293
11327
|
});
|
|
11294
11328
|
}
|
|
11295
11329
|
var otherAssetsMatches = otherAssets.filter(function (_ref2) {
|
|
11296
11330
|
var assetSymbol = _ref2.symbol;
|
|
11297
|
-
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) ===
|
|
11331
|
+
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === lowerSymbol;
|
|
11298
11332
|
});
|
|
11299
11333
|
var nativeAssetsMatches = nativeAssets.filter(function (_ref3) {
|
|
11300
11334
|
var assetSymbol = _ref3.symbol;
|
|
11301
|
-
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) ===
|
|
11335
|
+
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === lowerSymbol;
|
|
11302
11336
|
});
|
|
11303
11337
|
var isPolkadotXcm = !isRelayChain(node) && node !== 'Ethereum' && getDefaultPallet(node) === 'PolkadotXcm';
|
|
11338
|
+
if (otherAssetsMatches.length === 0 && nativeAssetsMatches.length === 0) {
|
|
11339
|
+
if (lowerSymbol.startsWith('xc')) {
|
|
11340
|
+
// No exact matches found, and symbol starts with 'xc', try stripping 'xc'
|
|
11341
|
+
var strippedSymbol = symbol.substring(2);
|
|
11342
|
+
var strippedLowerSymbol = strippedSymbol.toLowerCase();
|
|
11343
|
+
otherAssetsMatches = otherAssets.filter(function (_ref4) {
|
|
11344
|
+
var assetSymbol = _ref4.symbol;
|
|
11345
|
+
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === strippedLowerSymbol;
|
|
11346
|
+
});
|
|
11347
|
+
nativeAssetsMatches = nativeAssets.filter(function (_ref5) {
|
|
11348
|
+
var assetSymbol = _ref5.symbol;
|
|
11349
|
+
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === strippedLowerSymbol;
|
|
11350
|
+
});
|
|
11351
|
+
if (node === 'Astar' || node === 'Shiden' || isPolkadotXcm) {
|
|
11352
|
+
return nativeAssetsMatches[0] || otherAssetsMatches[0] || null;
|
|
11353
|
+
}
|
|
11354
|
+
var totalMatches = otherAssetsMatches.length + nativeAssetsMatches.length;
|
|
11355
|
+
if (totalMatches > 1) {
|
|
11356
|
+
throw new InvalidCurrencyError("Multiple assets found for symbol ".concat(symbol, " after stripping 'xc' prefix. Please specify by ID."));
|
|
11357
|
+
}
|
|
11358
|
+
} else {
|
|
11359
|
+
// No matches found, and symbol does not start with 'xc', try adding 'xc' prefix
|
|
11360
|
+
var prefixedSymbol = "xc".concat(symbol);
|
|
11361
|
+
var prefixedLowerSymbol = prefixedSymbol.toLowerCase();
|
|
11362
|
+
otherAssetsMatches = otherAssets.filter(function (_ref6) {
|
|
11363
|
+
var assetSymbol = _ref6.symbol;
|
|
11364
|
+
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === prefixedLowerSymbol;
|
|
11365
|
+
});
|
|
11366
|
+
nativeAssetsMatches = nativeAssets.filter(function (_ref7) {
|
|
11367
|
+
var assetSymbol = _ref7.symbol;
|
|
11368
|
+
return (assetSymbol === null || assetSymbol === void 0 ? void 0 : assetSymbol.toLowerCase()) === prefixedLowerSymbol;
|
|
11369
|
+
});
|
|
11370
|
+
if (node === 'Astar' || node === 'Shiden' || isPolkadotXcm) {
|
|
11371
|
+
return nativeAssetsMatches[0] || otherAssetsMatches[0] || null;
|
|
11372
|
+
}
|
|
11373
|
+
var _totalMatches = otherAssetsMatches.length + nativeAssetsMatches.length;
|
|
11374
|
+
if (_totalMatches > 1) {
|
|
11375
|
+
throw new InvalidCurrencyError("Multiple assets found for symbol ".concat(symbol, " after adding 'xc' prefix. Please specify by ID."));
|
|
11376
|
+
}
|
|
11377
|
+
}
|
|
11378
|
+
}
|
|
11304
11379
|
if (node === 'Astar' || node === 'Shiden' || isPolkadotXcm) {
|
|
11305
11380
|
return nativeAssetsMatches[0] || otherAssetsMatches[0] || null;
|
|
11306
11381
|
}
|
|
@@ -11310,15 +11385,15 @@ var findAssetBySymbol = function findAssetBySymbol(node, destination, otherAsset
|
|
|
11310
11385
|
return otherAssetsMatches[0] || nativeAssetsMatches[0] || null;
|
|
11311
11386
|
};
|
|
11312
11387
|
var findAssetById = function findAssetById(assets, assetId) {
|
|
11313
|
-
var otherAssetsMatches = assets.filter(function (
|
|
11314
|
-
var currentAssetId =
|
|
11388
|
+
var otherAssetsMatches = assets.filter(function (_ref8) {
|
|
11389
|
+
var currentAssetId = _ref8.assetId;
|
|
11315
11390
|
return currentAssetId === assetId.toString();
|
|
11316
11391
|
});
|
|
11317
11392
|
if (otherAssetsMatches.length > 1) {
|
|
11318
11393
|
throw new DuplicateAssetIdError(assetId.toString());
|
|
11319
11394
|
}
|
|
11320
|
-
return assets.find(function (
|
|
11321
|
-
var currentAssetId =
|
|
11395
|
+
return assets.find(function (_ref9) {
|
|
11396
|
+
var currentAssetId = _ref9.assetId;
|
|
11322
11397
|
return currentAssetId === assetId.toString();
|
|
11323
11398
|
});
|
|
11324
11399
|
};
|
|
@@ -11463,9 +11538,20 @@ var getNativeAssetSymbol = function getNativeAssetSymbol(node) {
|
|
|
11463
11538
|
* @returns True if the asset is supported; otherwise, false.
|
|
11464
11539
|
*/
|
|
11465
11540
|
var hasSupportForAsset = function hasSupportForAsset(node, symbol) {
|
|
11466
|
-
|
|
11541
|
+
var lowerSymbol = symbol.toLowerCase();
|
|
11542
|
+
var symbolsToCheck = new Set();
|
|
11543
|
+
symbolsToCheck.add(lowerSymbol);
|
|
11544
|
+
if (lowerSymbol.startsWith('xc')) {
|
|
11545
|
+
symbolsToCheck.add(lowerSymbol.substring(2));
|
|
11546
|
+
} else {
|
|
11547
|
+
symbolsToCheck.add("xc".concat(lowerSymbol));
|
|
11548
|
+
}
|
|
11549
|
+
var nodeSymbols = getAllAssetsSymbols(node).map(function (s) {
|
|
11467
11550
|
return s.toLowerCase();
|
|
11468
|
-
})
|
|
11551
|
+
});
|
|
11552
|
+
return nodeSymbols.some(function (nodeSymbol) {
|
|
11553
|
+
return symbolsToCheck.has(nodeSymbol);
|
|
11554
|
+
});
|
|
11469
11555
|
};
|
|
11470
11556
|
/**
|
|
11471
11557
|
* Retrieves the number of decimals for an asset with the given symbol on a specified node.
|
|
@@ -13103,12 +13189,16 @@ var createTx$1 = function createTx(originApi, address, amount, currency, originN
|
|
|
13103
13189
|
}, _callee);
|
|
13104
13190
|
}));
|
|
13105
13191
|
};
|
|
13106
|
-
var getOriginFeeDetails = function getOriginFeeDetails(
|
|
13107
|
-
|
|
13108
|
-
|
|
13109
|
-
|
|
13110
|
-
|
|
13111
|
-
|
|
13192
|
+
var getOriginFeeDetails$1 = function getOriginFeeDetails(_a) {
|
|
13193
|
+
return __awaiter(void 0, [_a], void 0, function (_ref) {
|
|
13194
|
+
var api = _ref.api,
|
|
13195
|
+
account = _ref.account,
|
|
13196
|
+
amount = _ref.amount,
|
|
13197
|
+
currency = _ref.currency,
|
|
13198
|
+
origin = _ref.origin,
|
|
13199
|
+
destination = _ref.destination,
|
|
13200
|
+
_ref$feeMarginPercent = _ref.feeMarginPercentage,
|
|
13201
|
+
feeMarginPercentage = _ref$feeMarginPercent === void 0 ? 10 : _ref$feeMarginPercent;
|
|
13112
13202
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee2() {
|
|
13113
13203
|
var nativeBalance, minTransferableAmount, tx, xcmFee, xcmFeeWithMargin, sufficientForXCM;
|
|
13114
13204
|
return _regeneratorRuntime().wrap(function _callee2$(_context2) {
|
|
@@ -13172,7 +13262,14 @@ var getTransferInfo$1 = function getTransferInfo(_a) {
|
|
|
13172
13262
|
case 4:
|
|
13173
13263
|
originBalance = _context.sent;
|
|
13174
13264
|
_context.next = 7;
|
|
13175
|
-
return getOriginFeeDetails(
|
|
13265
|
+
return getOriginFeeDetails$1({
|
|
13266
|
+
origin: origin,
|
|
13267
|
+
destination: destination,
|
|
13268
|
+
currency: currency,
|
|
13269
|
+
amount: amount,
|
|
13270
|
+
account: accountOrigin,
|
|
13271
|
+
api: originApi
|
|
13272
|
+
});
|
|
13176
13273
|
case 7:
|
|
13177
13274
|
_yield$getOriginFeeDe = _context.sent;
|
|
13178
13275
|
destXcmFee = _yield$getOriginFeeDe.xcmFee;
|
|
@@ -13213,7 +13310,14 @@ var getTransferInfo$1 = function getTransferInfo(_a) {
|
|
|
13213
13310
|
_context.t4 = _context.sent;
|
|
13214
13311
|
_context.t5 = expectedBalanceAfterXCMDelivery;
|
|
13215
13312
|
_context.next = 25;
|
|
13216
|
-
return getOriginFeeDetails(
|
|
13313
|
+
return getOriginFeeDetails$1({
|
|
13314
|
+
origin: origin,
|
|
13315
|
+
destination: destination,
|
|
13316
|
+
currency: currency,
|
|
13317
|
+
amount: amount,
|
|
13318
|
+
account: accountOrigin,
|
|
13319
|
+
api: originApi
|
|
13320
|
+
});
|
|
13217
13321
|
case 25:
|
|
13218
13322
|
_context.t6 = _context.sent;
|
|
13219
13323
|
_context.t7 = BigInt((_d = getExistentialDeposit(origin)) !== null && _d !== void 0 ? _d : 0);
|
|
@@ -13262,6 +13366,17 @@ var getTransferInfo$1 = function getTransferInfo(_a) {
|
|
|
13262
13366
|
});
|
|
13263
13367
|
};
|
|
13264
13368
|
|
|
13369
|
+
/**
|
|
13370
|
+
* Normalizes an asset symbol by stripping the 'xc' prefix (if present) and converting it to lowercase.
|
|
13371
|
+
*
|
|
13372
|
+
* @param symbol - The symbol to normalize.
|
|
13373
|
+
* @returns The normalized symbol.
|
|
13374
|
+
*/
|
|
13375
|
+
var normalizeSymbol = function normalizeSymbol(symbol) {
|
|
13376
|
+
if (!symbol) return '';
|
|
13377
|
+
var lowerSymbol = symbol.toLowerCase();
|
|
13378
|
+
return lowerSymbol.startsWith('xc') ? lowerSymbol.substring(2) : lowerSymbol;
|
|
13379
|
+
};
|
|
13265
13380
|
/**
|
|
13266
13381
|
* Retrieves the list of assets that are supported for transfers between two specified nodes.
|
|
13267
13382
|
*
|
|
@@ -13287,17 +13402,16 @@ var getSupportedAssets = function getSupportedAssets(origin, destination) {
|
|
|
13287
13402
|
if (!isRelayChain(origin) && getDefaultPallet(origin) === 'XTokens' && (destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama')) {
|
|
13288
13403
|
return getOtherAssets(destination).filter(function (asset) {
|
|
13289
13404
|
return originAssets.some(function (a) {
|
|
13290
|
-
|
|
13291
|
-
return ((_a = a.symbol) === null || _a === void 0 ? void 0 : _a.toLowerCase()) === ((_b = asset.symbol) === null || _b === void 0 ? void 0 : _b.toLowerCase());
|
|
13405
|
+
return normalizeSymbol(a.symbol) === normalizeSymbol(asset.symbol);
|
|
13292
13406
|
}) && asset.assetId !== '';
|
|
13293
13407
|
});
|
|
13294
13408
|
}
|
|
13295
|
-
|
|
13409
|
+
var supportedAssets = originAssets.filter(function (asset) {
|
|
13296
13410
|
return destinationAssets.some(function (a) {
|
|
13297
|
-
|
|
13298
|
-
return ((_a = a.symbol) === null || _a === void 0 ? void 0 : _a.toLocaleLowerCase()) === ((_b = asset.symbol) === null || _b === void 0 ? void 0 : _b.toLowerCase());
|
|
13411
|
+
return normalizeSymbol(a.symbol) === normalizeSymbol(asset.symbol);
|
|
13299
13412
|
});
|
|
13300
13413
|
});
|
|
13414
|
+
return supportedAssets;
|
|
13301
13415
|
};
|
|
13302
13416
|
|
|
13303
13417
|
var createTx = function createTx(originApi, destApi, address, amount, currencySymbol, originNode, destNode) {
|
|
@@ -13442,7 +13556,7 @@ var sendCommon = function sendCommon(options_1) {
|
|
|
13442
13556
|
return __awaiter(void 0, [options_1].concat(args_1), void 0, function (options) {
|
|
13443
13557
|
var serializedApiCallEnabled = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
|
|
13444
13558
|
return /*#__PURE__*/_regeneratorRuntime().mark(function _callee() {
|
|
13445
|
-
var _a, _b, api, origin, currency, amount, address, destination, paraIdTo, destApiForKeepAlive, feeAsset, version, isMultiLocationDestination, isBridge, isRelayDestination, originRelayChainSymbol, destinationRelayChainSymbol, originNode, assetCheckEnabled, isDestAssetHub, pallet, asset, amountStr, currencyStr;
|
|
13559
|
+
var _a, _b, api, origin, currency, amount, address, destination, paraIdTo, destApiForKeepAlive, feeAsset, version, isMultiLocationDestination, isBridge, isRelayDestination, originRelayChainSymbol, destinationRelayChainSymbol, originNode, assetCheckEnabled, isDestAssetHub, pallet, asset, nativeAssets, amountStr, currencyStr;
|
|
13446
13560
|
return _regeneratorRuntime().wrap(function _callee$(_context) {
|
|
13447
13561
|
while (1) switch (_context.prev = _context.next) {
|
|
13448
13562
|
case 0:
|
|
@@ -13522,83 +13636,89 @@ var sendCommon = function sendCommon(options_1) {
|
|
|
13522
13636
|
isDestAssetHub = destination === 'AssetHubPolkadot' || destination === 'AssetHubKusama';
|
|
13523
13637
|
pallet = getDefaultPallet(origin);
|
|
13524
13638
|
if (!(!isBridge && isDestAssetHub && pallet === 'XTokens')) {
|
|
13525
|
-
_context.next =
|
|
13639
|
+
_context.next = 43;
|
|
13526
13640
|
break;
|
|
13527
13641
|
}
|
|
13528
13642
|
asset = getAssetBySymbolOrId(destination, currency, false, destination);
|
|
13529
|
-
|
|
13643
|
+
nativeAssets = getNativeAssets(destination);
|
|
13644
|
+
if (origin === 'BifrostPolkadot' && (asset === null || asset === void 0 ? void 0 : asset.symbol) === 'DOT') {
|
|
13645
|
+
nativeAssets = nativeAssets.filter(function (nativeAsset) {
|
|
13646
|
+
return nativeAsset.symbol !== 'DOT';
|
|
13647
|
+
});
|
|
13648
|
+
}
|
|
13649
|
+
if (!('symbol' in currency && nativeAssets.some(function (nativeAsset) {
|
|
13530
13650
|
return nativeAsset.symbol.toLowerCase() === currency.symbol.toLowerCase();
|
|
13531
13651
|
}))) {
|
|
13532
|
-
_context.next =
|
|
13652
|
+
_context.next = 37;
|
|
13533
13653
|
break;
|
|
13534
13654
|
}
|
|
13535
13655
|
throw new InvalidCurrencyError("".concat(currency.symbol, " is not supported for transfers to ").concat(destination, "."));
|
|
13536
|
-
case
|
|
13656
|
+
case 37:
|
|
13537
13657
|
if (!(assetCheckEnabled && asset === null)) {
|
|
13538
|
-
_context.next =
|
|
13658
|
+
_context.next = 39;
|
|
13539
13659
|
break;
|
|
13540
13660
|
}
|
|
13541
13661
|
throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency ").concat(JSON.stringify(currency), "."));
|
|
13542
|
-
case
|
|
13662
|
+
case 39:
|
|
13543
13663
|
if (!((asset === null || asset === void 0 ? void 0 : asset.symbol) && !hasSupportForAsset(origin, asset.symbol))) {
|
|
13544
|
-
_context.next =
|
|
13664
|
+
_context.next = 41;
|
|
13545
13665
|
break;
|
|
13546
13666
|
}
|
|
13547
13667
|
throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency ").concat(asset.symbol, "."));
|
|
13548
|
-
case 39:
|
|
13549
|
-
_context.next = 46;
|
|
13550
|
-
break;
|
|
13551
13668
|
case 41:
|
|
13669
|
+
_context.next = 48;
|
|
13670
|
+
break;
|
|
13671
|
+
case 43:
|
|
13552
13672
|
asset = assetCheckEnabled ? getAssetBySymbolOrId(origin, currency, isRelayDestination, isTMultiLocation(destination) ? undefined : destination) : null;
|
|
13553
13673
|
if (!(!isBridge && asset === null && assetCheckEnabled)) {
|
|
13554
|
-
_context.next =
|
|
13674
|
+
_context.next = 46;
|
|
13555
13675
|
break;
|
|
13556
13676
|
}
|
|
13557
13677
|
throw new InvalidCurrencyError("Origin node ".concat(origin, " does not support currency ").concat(JSON.stringify(currency), "."));
|
|
13558
|
-
case
|
|
13678
|
+
case 46:
|
|
13559
13679
|
if (!(!isBridge && !isRelayDestination && !isMultiLocationDestination && (asset === null || asset === void 0 ? void 0 : asset.symbol) !== undefined && assetCheckEnabled && !('id' in currency) && !hasSupportForAsset(destination, asset.symbol))) {
|
|
13560
|
-
_context.next =
|
|
13680
|
+
_context.next = 48;
|
|
13561
13681
|
break;
|
|
13562
13682
|
}
|
|
13563
13683
|
throw new InvalidCurrencyError("Destination node ".concat(destination, " does not support currency ").concat(JSON.stringify(currency), "."));
|
|
13564
|
-
case 46:
|
|
13565
|
-
_context.next = 48;
|
|
13566
|
-
return api.init(origin);
|
|
13567
13684
|
case 48:
|
|
13685
|
+
_context.next = 50;
|
|
13686
|
+
return api.init(origin);
|
|
13687
|
+
case 50:
|
|
13568
13688
|
amountStr = amount === null || amount === void 0 ? void 0 : amount.toString();
|
|
13569
13689
|
if (!('multilocation' in currency || 'multiasset' in currency)) {
|
|
13570
|
-
_context.next =
|
|
13690
|
+
_context.next = 55;
|
|
13571
13691
|
break;
|
|
13572
13692
|
}
|
|
13573
13693
|
console.warn('Keep alive check is not supported when using MultiLocation as currency.');
|
|
13574
|
-
_context.next =
|
|
13694
|
+
_context.next = 69;
|
|
13575
13695
|
break;
|
|
13576
|
-
case
|
|
13696
|
+
case 55:
|
|
13577
13697
|
if (!(_typeof(address) === 'object')) {
|
|
13578
|
-
_context.next =
|
|
13698
|
+
_context.next = 59;
|
|
13579
13699
|
break;
|
|
13580
13700
|
}
|
|
13581
13701
|
console.warn('Keep alive check is not supported when using MultiLocation as address.');
|
|
13582
|
-
_context.next =
|
|
13702
|
+
_context.next = 69;
|
|
13583
13703
|
break;
|
|
13584
|
-
case
|
|
13704
|
+
case 59:
|
|
13585
13705
|
if (!(_typeof(destination) === 'object')) {
|
|
13586
|
-
_context.next =
|
|
13706
|
+
_context.next = 63;
|
|
13587
13707
|
break;
|
|
13588
13708
|
}
|
|
13589
13709
|
console.warn('Keep alive check is not supported when using MultiLocation as destination.');
|
|
13590
|
-
_context.next =
|
|
13710
|
+
_context.next = 69;
|
|
13591
13711
|
break;
|
|
13592
|
-
case
|
|
13712
|
+
case 63:
|
|
13593
13713
|
if (!(origin === 'Ethereum' || destination === 'Ethereum')) {
|
|
13594
|
-
_context.next =
|
|
13714
|
+
_context.next = 67;
|
|
13595
13715
|
break;
|
|
13596
13716
|
}
|
|
13597
13717
|
console.warn('Keep alive check is not supported when using Ethereum as origin or destination.');
|
|
13598
|
-
_context.next =
|
|
13718
|
+
_context.next = 69;
|
|
13599
13719
|
break;
|
|
13600
|
-
case
|
|
13601
|
-
_context.next =
|
|
13720
|
+
case 67:
|
|
13721
|
+
_context.next = 69;
|
|
13602
13722
|
return checkKeepAlive({
|
|
13603
13723
|
originApi: api,
|
|
13604
13724
|
address: address,
|
|
@@ -13608,7 +13728,7 @@ var sendCommon = function sendCommon(options_1) {
|
|
|
13608
13728
|
currencySymbol: (_a = asset === null || asset === void 0 ? void 0 : asset.symbol) !== null && _a !== void 0 ? _a : 'symbol' in currency ? currency.symbol : undefined,
|
|
13609
13729
|
destNode: destination
|
|
13610
13730
|
});
|
|
13611
|
-
case
|
|
13731
|
+
case 69:
|
|
13612
13732
|
currencyStr = 'symbol' in currency ? currency.symbol : 'id' in currency ? currency.id.toString() : undefined;
|
|
13613
13733
|
return _context.abrupt("return", originNode.transfer({
|
|
13614
13734
|
api: api,
|
|
@@ -13624,7 +13744,7 @@ var sendCommon = function sendCommon(options_1) {
|
|
|
13624
13744
|
destApiForKeepAlive: destApiForKeepAlive,
|
|
13625
13745
|
serializedApiCallEnabled: serializedApiCallEnabled
|
|
13626
13746
|
}));
|
|
13627
|
-
case
|
|
13747
|
+
case 71:
|
|
13628
13748
|
case "end":
|
|
13629
13749
|
return _context.stop();
|
|
13630
13750
|
}
|
|
@@ -14115,10 +14235,8 @@ var PapiApi = /*#__PURE__*/function () {
|
|
|
14115
14235
|
return this.api.getUnsafeApi().query.Assets.Account.getValue(id, address);
|
|
14116
14236
|
case 2:
|
|
14117
14237
|
res = _context5.sent;
|
|
14118
|
-
console.log(res);
|
|
14119
|
-
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-member-access
|
|
14120
14238
|
return _context5.abrupt("return", res && res.balance ? BigInt(res.balance) : BigInt(0));
|
|
14121
|
-
case
|
|
14239
|
+
case 4:
|
|
14122
14240
|
case "end":
|
|
14123
14241
|
return _context5.stop();
|
|
14124
14242
|
}
|
|
@@ -14289,6 +14407,7 @@ var getAssetBalance = createPapiApiCall(getAssetBalance$1);
|
|
|
14289
14407
|
* @returns An extrinsic representing the claim transaction.
|
|
14290
14408
|
*/
|
|
14291
14409
|
var claimAssets = createPapiApiCall(claimAssets$1);
|
|
14410
|
+
var getOriginFeeDetails = createPapiApiCall(getOriginFeeDetails$1);
|
|
14292
14411
|
|
|
14293
14412
|
var assets = /*#__PURE__*/Object.freeze({
|
|
14294
14413
|
__proto__: null,
|
|
@@ -14304,6 +14423,7 @@ var assets = /*#__PURE__*/Object.freeze({
|
|
|
14304
14423
|
getExistentialDeposit: getExistentialDeposit$1,
|
|
14305
14424
|
getNativeAssetSymbol: getNativeAssetSymbol,
|
|
14306
14425
|
getNativeAssets: getNativeAssets,
|
|
14426
|
+
getOriginFeeDetails: getOriginFeeDetails,
|
|
14307
14427
|
getOtherAssets: getOtherAssets,
|
|
14308
14428
|
getParaId: getParaId,
|
|
14309
14429
|
getRelayChainSymbol: getRelayChainSymbol,
|
|
@@ -14363,6 +14483,7 @@ exports.getNativeAssets = getNativeAssets;
|
|
|
14363
14483
|
exports.getNode = getNode;
|
|
14364
14484
|
exports.getNodeEndpointOption = getNodeEndpointOption;
|
|
14365
14485
|
exports.getNodeProvider = getNodeProvider;
|
|
14486
|
+
exports.getOriginFeeDetails = getOriginFeeDetails;
|
|
14366
14487
|
exports.getOtherAssets = getOtherAssets;
|
|
14367
14488
|
exports.getParaId = getParaId;
|
|
14368
14489
|
exports.getRelayChainSymbol = getRelayChainSymbol;
|