@depay/widgets 6.20.0 → 6.21.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/esm/index.bundle.js +106 -52
- package/dist/esm/index.js +8 -0
- package/dist/umd/index.bundle.js +106 -52
- package/dist/umd/index.js +8 -0
- package/package.json +3 -3
package/dist/esm/index.bundle.js
CHANGED
|
@@ -10513,7 +10513,7 @@ var bn$4 = createCommonjsModule$4(function (module) {
|
|
|
10513
10513
|
})(module, commonjsGlobal$4);
|
|
10514
10514
|
});
|
|
10515
10515
|
|
|
10516
|
-
const version$y = "logger/5.
|
|
10516
|
+
const version$y = "logger/5.6.0";
|
|
10517
10517
|
|
|
10518
10518
|
let _permanentCensorErrors$4 = false;
|
|
10519
10519
|
let _censorErrors$4 = false;
|
|
@@ -10692,6 +10692,40 @@ class Logger$4 {
|
|
|
10692
10692
|
messageDetails.push(`code=${code}`);
|
|
10693
10693
|
messageDetails.push(`version=${this.version}`);
|
|
10694
10694
|
const reason = message;
|
|
10695
|
+
let url = "";
|
|
10696
|
+
switch (code) {
|
|
10697
|
+
case ErrorCode$4.NUMERIC_FAULT: {
|
|
10698
|
+
url = "NUMERIC_FAULT";
|
|
10699
|
+
const fault = message;
|
|
10700
|
+
switch (fault) {
|
|
10701
|
+
case "overflow":
|
|
10702
|
+
case "underflow":
|
|
10703
|
+
case "division-by-zero":
|
|
10704
|
+
url += "-" + fault;
|
|
10705
|
+
break;
|
|
10706
|
+
case "negative-power":
|
|
10707
|
+
case "negative-width":
|
|
10708
|
+
url += "-unsupported";
|
|
10709
|
+
break;
|
|
10710
|
+
case "unbound-bitwise-result":
|
|
10711
|
+
url += "-unbound-result";
|
|
10712
|
+
break;
|
|
10713
|
+
}
|
|
10714
|
+
break;
|
|
10715
|
+
}
|
|
10716
|
+
case ErrorCode$4.CALL_EXCEPTION:
|
|
10717
|
+
case ErrorCode$4.INSUFFICIENT_FUNDS:
|
|
10718
|
+
case ErrorCode$4.MISSING_NEW:
|
|
10719
|
+
case ErrorCode$4.NONCE_EXPIRED:
|
|
10720
|
+
case ErrorCode$4.REPLACEMENT_UNDERPRICED:
|
|
10721
|
+
case ErrorCode$4.TRANSACTION_REPLACED:
|
|
10722
|
+
case ErrorCode$4.UNPREDICTABLE_GAS_LIMIT:
|
|
10723
|
+
url = code;
|
|
10724
|
+
break;
|
|
10725
|
+
}
|
|
10726
|
+
if (url) {
|
|
10727
|
+
message += " [ See: https:/\/links.ethers.org/v5-errors-" + url + " ]";
|
|
10728
|
+
}
|
|
10695
10729
|
if (messageDetails.length) {
|
|
10696
10730
|
message += " (" + messageDetails.join(", ") + ")";
|
|
10697
10731
|
}
|
|
@@ -10825,7 +10859,7 @@ class Logger$4 {
|
|
|
10825
10859
|
Logger$4.errors = ErrorCode$4;
|
|
10826
10860
|
Logger$4.levels = LogLevel$4;
|
|
10827
10861
|
|
|
10828
|
-
const version$x = "bytes/5.
|
|
10862
|
+
const version$x = "bytes/5.6.0";
|
|
10829
10863
|
|
|
10830
10864
|
const logger$J = new Logger$4(version$x);
|
|
10831
10865
|
///////////////////////////////
|
|
@@ -10845,7 +10879,7 @@ function addSlice$4(array) {
|
|
|
10845
10879
|
function isBytesLike$2(value) {
|
|
10846
10880
|
return ((isHexString$4(value) && !(value.length % 2)) || isBytes$4(value));
|
|
10847
10881
|
}
|
|
10848
|
-
function isInteger(value) {
|
|
10882
|
+
function isInteger$1(value) {
|
|
10849
10883
|
return (typeof (value) === "number" && value == value && (value % 1) === 0);
|
|
10850
10884
|
}
|
|
10851
10885
|
function isBytes$4(value) {
|
|
@@ -10858,12 +10892,12 @@ function isBytes$4(value) {
|
|
|
10858
10892
|
if (typeof (value) === "string") {
|
|
10859
10893
|
return false;
|
|
10860
10894
|
}
|
|
10861
|
-
if (!isInteger(value.length) || value.length < 0) {
|
|
10895
|
+
if (!isInteger$1(value.length) || value.length < 0) {
|
|
10862
10896
|
return false;
|
|
10863
10897
|
}
|
|
10864
10898
|
for (let i = 0; i < value.length; i++) {
|
|
10865
10899
|
const v = value[i];
|
|
10866
|
-
if (!isInteger(v) || v < 0 || v >= 256) {
|
|
10900
|
+
if (!isInteger$1(v) || v < 0 || v >= 256) {
|
|
10867
10901
|
return false;
|
|
10868
10902
|
}
|
|
10869
10903
|
}
|
|
@@ -11060,7 +11094,7 @@ function hexZeroPad$4(value, length) {
|
|
|
11060
11094
|
return value;
|
|
11061
11095
|
}
|
|
11062
11096
|
|
|
11063
|
-
const version$w = "bignumber/5.
|
|
11097
|
+
const version$w = "bignumber/5.6.0";
|
|
11064
11098
|
|
|
11065
11099
|
var BN$4 = bn$4.BN;
|
|
11066
11100
|
const logger$I = new Logger$4(version$w);
|
|
@@ -11109,7 +11143,7 @@ class BigNumber$4 {
|
|
|
11109
11143
|
div(other) {
|
|
11110
11144
|
const o = BigNumber$4.from(other);
|
|
11111
11145
|
if (o.isZero()) {
|
|
11112
|
-
throwFault$6("division
|
|
11146
|
+
throwFault$6("division-by-zero", "div");
|
|
11113
11147
|
}
|
|
11114
11148
|
return toBigNumber$4(toBN$4(this).div(toBN$4(other)));
|
|
11115
11149
|
}
|
|
@@ -11119,53 +11153,53 @@ class BigNumber$4 {
|
|
|
11119
11153
|
mod(other) {
|
|
11120
11154
|
const value = toBN$4(other);
|
|
11121
11155
|
if (value.isNeg()) {
|
|
11122
|
-
throwFault$6("
|
|
11156
|
+
throwFault$6("division-by-zero", "mod");
|
|
11123
11157
|
}
|
|
11124
11158
|
return toBigNumber$4(toBN$4(this).umod(value));
|
|
11125
11159
|
}
|
|
11126
11160
|
pow(other) {
|
|
11127
11161
|
const value = toBN$4(other);
|
|
11128
11162
|
if (value.isNeg()) {
|
|
11129
|
-
throwFault$6("
|
|
11163
|
+
throwFault$6("negative-power", "pow");
|
|
11130
11164
|
}
|
|
11131
11165
|
return toBigNumber$4(toBN$4(this).pow(value));
|
|
11132
11166
|
}
|
|
11133
11167
|
and(other) {
|
|
11134
11168
|
const value = toBN$4(other);
|
|
11135
11169
|
if (this.isNegative() || value.isNeg()) {
|
|
11136
|
-
throwFault$6("
|
|
11170
|
+
throwFault$6("unbound-bitwise-result", "and");
|
|
11137
11171
|
}
|
|
11138
11172
|
return toBigNumber$4(toBN$4(this).and(value));
|
|
11139
11173
|
}
|
|
11140
11174
|
or(other) {
|
|
11141
11175
|
const value = toBN$4(other);
|
|
11142
11176
|
if (this.isNegative() || value.isNeg()) {
|
|
11143
|
-
throwFault$6("
|
|
11177
|
+
throwFault$6("unbound-bitwise-result", "or");
|
|
11144
11178
|
}
|
|
11145
11179
|
return toBigNumber$4(toBN$4(this).or(value));
|
|
11146
11180
|
}
|
|
11147
11181
|
xor(other) {
|
|
11148
11182
|
const value = toBN$4(other);
|
|
11149
11183
|
if (this.isNegative() || value.isNeg()) {
|
|
11150
|
-
throwFault$6("
|
|
11184
|
+
throwFault$6("unbound-bitwise-result", "xor");
|
|
11151
11185
|
}
|
|
11152
11186
|
return toBigNumber$4(toBN$4(this).xor(value));
|
|
11153
11187
|
}
|
|
11154
11188
|
mask(value) {
|
|
11155
11189
|
if (this.isNegative() || value < 0) {
|
|
11156
|
-
throwFault$6("
|
|
11190
|
+
throwFault$6("negative-width", "mask");
|
|
11157
11191
|
}
|
|
11158
11192
|
return toBigNumber$4(toBN$4(this).maskn(value));
|
|
11159
11193
|
}
|
|
11160
11194
|
shl(value) {
|
|
11161
11195
|
if (this.isNegative() || value < 0) {
|
|
11162
|
-
throwFault$6("
|
|
11196
|
+
throwFault$6("negative-width", "shl");
|
|
11163
11197
|
}
|
|
11164
11198
|
return toBigNumber$4(toBN$4(this).shln(value));
|
|
11165
11199
|
}
|
|
11166
11200
|
shr(value) {
|
|
11167
11201
|
if (this.isNegative() || value < 0) {
|
|
11168
|
-
throwFault$6("
|
|
11202
|
+
throwFault$6("negative-width", "shr");
|
|
11169
11203
|
}
|
|
11170
11204
|
return toBigNumber$4(toBN$4(this).shrn(value));
|
|
11171
11205
|
}
|
|
@@ -11707,7 +11741,7 @@ class FixedNumber$3 {
|
|
|
11707
11741
|
const ONE$3 = FixedNumber$3.from(1);
|
|
11708
11742
|
const BUMP$3 = FixedNumber$3.from("0.5");
|
|
11709
11743
|
|
|
11710
|
-
const version$v = "properties/5.
|
|
11744
|
+
const version$v = "properties/5.6.0";
|
|
11711
11745
|
|
|
11712
11746
|
var __awaiter$d = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11713
11747
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -11822,7 +11856,7 @@ class Description$2 {
|
|
|
11822
11856
|
}
|
|
11823
11857
|
}
|
|
11824
11858
|
|
|
11825
|
-
const version$u = "abi/5.
|
|
11859
|
+
const version$u = "abi/5.6.0";
|
|
11826
11860
|
|
|
11827
11861
|
const logger$F = new Logger$4(version$u);
|
|
11828
11862
|
const _constructorGuard$7 = {};
|
|
@@ -13463,7 +13497,7 @@ function keccak256$3(data) {
|
|
|
13463
13497
|
return '0x' + sha3$5.keccak_256(arrayify$4(data));
|
|
13464
13498
|
}
|
|
13465
13499
|
|
|
13466
|
-
const version$t = "rlp/5.
|
|
13500
|
+
const version$t = "rlp/5.6.0";
|
|
13467
13501
|
|
|
13468
13502
|
const logger$D = new Logger$4(version$t);
|
|
13469
13503
|
function arrayifyInteger$2(value) {
|
|
@@ -13507,7 +13541,7 @@ function encode$4(object) {
|
|
|
13507
13541
|
return hexlify$4(_encode$2(object));
|
|
13508
13542
|
}
|
|
13509
13543
|
|
|
13510
|
-
const version$s = "address/5.
|
|
13544
|
+
const version$s = "address/5.6.0";
|
|
13511
13545
|
|
|
13512
13546
|
const logger$C = new Logger$4(version$s);
|
|
13513
13547
|
function getChecksumAddress$3(address) {
|
|
@@ -13978,7 +14012,7 @@ class NumberCoder$1 extends Coder$1 {
|
|
|
13978
14012
|
}
|
|
13979
14013
|
}
|
|
13980
14014
|
|
|
13981
|
-
const version$r = "strings/5.
|
|
14015
|
+
const version$r = "strings/5.6.0";
|
|
13982
14016
|
|
|
13983
14017
|
const logger$A = new Logger$4(version$r);
|
|
13984
14018
|
///////////////////////////////
|
|
@@ -14664,9 +14698,7 @@ class Interface$1 {
|
|
|
14664
14698
|
errorName = error.name;
|
|
14665
14699
|
errorSignature = error.format();
|
|
14666
14700
|
}
|
|
14667
|
-
catch (error) {
|
|
14668
|
-
console.log(error);
|
|
14669
|
-
}
|
|
14701
|
+
catch (error) { }
|
|
14670
14702
|
}
|
|
14671
14703
|
break;
|
|
14672
14704
|
}
|
|
@@ -14931,7 +14963,7 @@ class Interface$1 {
|
|
|
14931
14963
|
}
|
|
14932
14964
|
}
|
|
14933
14965
|
|
|
14934
|
-
const version$q = "abstract-provider/5.
|
|
14966
|
+
const version$q = "abstract-provider/5.6.0";
|
|
14935
14967
|
|
|
14936
14968
|
var __awaiter$c = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14937
14969
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -14965,7 +14997,7 @@ class Provider$2 {
|
|
|
14965
14997
|
// We may want to compute this more accurately in the future,
|
|
14966
14998
|
// using the formula "check if the base fee is correct".
|
|
14967
14999
|
// See: https://eips.ethereum.org/EIPS/eip-1559
|
|
14968
|
-
maxPriorityFeePerGas = BigNumber$4.from("
|
|
15000
|
+
maxPriorityFeePerGas = BigNumber$4.from("1500000000");
|
|
14969
15001
|
maxFeePerGas = block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas);
|
|
14970
15002
|
}
|
|
14971
15003
|
return { maxFeePerGas, maxPriorityFeePerGas, gasPrice };
|
|
@@ -14984,7 +15016,7 @@ class Provider$2 {
|
|
|
14984
15016
|
}
|
|
14985
15017
|
}
|
|
14986
15018
|
|
|
14987
|
-
const version$p = "abstract-signer/5.
|
|
15019
|
+
const version$p = "abstract-signer/5.6.0";
|
|
14988
15020
|
|
|
14989
15021
|
var __awaiter$b = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14990
15022
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -14997,7 +15029,7 @@ var __awaiter$b = (undefined && undefined.__awaiter) || function (thisArg, _argu
|
|
|
14997
15029
|
};
|
|
14998
15030
|
const logger$w = new Logger$4(version$p);
|
|
14999
15031
|
const allowedTransactionKeys$3 = [
|
|
15000
|
-
"accessList", "chainId", "customData", "data", "from", "gasLimit", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "to", "type", "value"
|
|
15032
|
+
"accessList", "ccipReadEnabled", "chainId", "customData", "data", "from", "gasLimit", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "to", "type", "value"
|
|
15001
15033
|
];
|
|
15002
15034
|
const forwardErrors$2 = [
|
|
15003
15035
|
Logger$4.errors.INSUFFICIENT_FUNDS,
|
|
@@ -15284,7 +15316,7 @@ class VoidSigner$1 extends Signer$2 {
|
|
|
15284
15316
|
}
|
|
15285
15317
|
}
|
|
15286
15318
|
|
|
15287
|
-
const version$o = "transactions/5.
|
|
15319
|
+
const version$o = "transactions/5.6.0";
|
|
15288
15320
|
|
|
15289
15321
|
const logger$v = new Logger$4(version$o);
|
|
15290
15322
|
var TransactionTypes$2;
|
|
@@ -15327,7 +15359,7 @@ function accessListify$2(value) {
|
|
|
15327
15359
|
return result;
|
|
15328
15360
|
}
|
|
15329
15361
|
|
|
15330
|
-
const version$n = "contracts/5.
|
|
15362
|
+
const version$n = "contracts/5.6.0";
|
|
15331
15363
|
|
|
15332
15364
|
var __awaiter$a = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15333
15365
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -15495,6 +15527,9 @@ function populateTransaction$1(contract, fragment, args) {
|
|
|
15495
15527
|
if (ro.customData) {
|
|
15496
15528
|
tx.customData = shallowCopy$2(ro.customData);
|
|
15497
15529
|
}
|
|
15530
|
+
if (ro.ccipReadEnabled) {
|
|
15531
|
+
tx.ccipReadEnabled = !!ro.ccipReadEnabled;
|
|
15532
|
+
}
|
|
15498
15533
|
// Remove the overrides
|
|
15499
15534
|
delete overrides.nonce;
|
|
15500
15535
|
delete overrides.gasLimit;
|
|
@@ -15506,6 +15541,7 @@ function populateTransaction$1(contract, fragment, args) {
|
|
|
15506
15541
|
delete overrides.maxFeePerGas;
|
|
15507
15542
|
delete overrides.maxPriorityFeePerGas;
|
|
15508
15543
|
delete overrides.customData;
|
|
15544
|
+
delete overrides.ccipReadEnabled;
|
|
15509
15545
|
// Make sure there are no stray overrides, which may indicate a
|
|
15510
15546
|
// typo or using an unsupported key.
|
|
15511
15547
|
const leftovers = Object.keys(overrides).filter((key) => (overrides[key] != null));
|
|
@@ -15851,6 +15887,8 @@ class BaseContract$1 {
|
|
|
15851
15887
|
});
|
|
15852
15888
|
}
|
|
15853
15889
|
}
|
|
15890
|
+
// Swallow bad ENS names to prevent Unhandled Exceptions
|
|
15891
|
+
this.resolvedAddress.catch((e) => { });
|
|
15854
15892
|
const uniqueNames = {};
|
|
15855
15893
|
const uniqueSignatures = {};
|
|
15856
15894
|
Object.keys(this.interface.functions).forEach((signature) => {
|
|
@@ -16204,7 +16242,7 @@ class BaseContract$1 {
|
|
|
16204
16242
|
class Contract$1 extends BaseContract$1 {
|
|
16205
16243
|
}
|
|
16206
16244
|
|
|
16207
|
-
const version$m = "units/5.
|
|
16245
|
+
const version$m = "units/5.6.0";
|
|
16208
16246
|
|
|
16209
16247
|
const logger$t = new Logger$4(version$m);
|
|
16210
16248
|
const names$3 = [
|
|
@@ -61858,6 +61896,10 @@ var ChangableAmountProvider = (function (props) {
|
|
|
61858
61896
|
fromAddress: account,
|
|
61859
61897
|
toAddress: account
|
|
61860
61898
|
}).then(function (routes) {
|
|
61899
|
+
if (routes[0] == undefined) {
|
|
61900
|
+
return;
|
|
61901
|
+
}
|
|
61902
|
+
|
|
61861
61903
|
Token.readable({
|
|
61862
61904
|
amount: routes[0].amountOut,
|
|
61863
61905
|
blockchain: maxRoute.blockchain,
|
|
@@ -61881,6 +61923,10 @@ var ChangableAmountProvider = (function (props) {
|
|
|
61881
61923
|
fromAddress: account,
|
|
61882
61924
|
toAddress: account
|
|
61883
61925
|
}).then(function (routes) {
|
|
61926
|
+
if (routes[0] == undefined) {
|
|
61927
|
+
return;
|
|
61928
|
+
}
|
|
61929
|
+
|
|
61884
61930
|
Token.readable({
|
|
61885
61931
|
amount: routes[0].amountOut,
|
|
61886
61932
|
blockchain: maxRoute.blockchain,
|
|
@@ -66370,7 +66416,7 @@ var bn = createCommonjsModule(function (module) {
|
|
|
66370
66416
|
})(module, commonjsGlobal);
|
|
66371
66417
|
});
|
|
66372
66418
|
|
|
66373
|
-
const version$3 = "logger/5.
|
|
66419
|
+
const version$3 = "logger/5.5.0";
|
|
66374
66420
|
|
|
66375
66421
|
let _permanentCensorErrors = false;
|
|
66376
66422
|
let _censorErrors = false;
|
|
@@ -66467,7 +66513,7 @@ var ErrorCode;
|
|
|
66467
66513
|
// - errorArgs?: The EIP848 error parameters
|
|
66468
66514
|
// - reason: The reason (only for EIP848 "Error(string)")
|
|
66469
66515
|
ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION";
|
|
66470
|
-
//
|
|
66516
|
+
// Insufficient funds (< value + gasLimit * gasPrice)
|
|
66471
66517
|
// - transaction: the transaction attempted
|
|
66472
66518
|
ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
|
|
66473
66519
|
// Nonce has already been used
|
|
@@ -66682,7 +66728,7 @@ class Logger {
|
|
|
66682
66728
|
Logger.errors = ErrorCode;
|
|
66683
66729
|
Logger.levels = LogLevel;
|
|
66684
66730
|
|
|
66685
|
-
const version$2 = "bytes/5.
|
|
66731
|
+
const version$2 = "bytes/5.5.0";
|
|
66686
66732
|
|
|
66687
66733
|
const logger$3 = new Logger(version$2);
|
|
66688
66734
|
///////////////////////////////
|
|
@@ -66699,6 +66745,9 @@ function addSlice(array) {
|
|
|
66699
66745
|
};
|
|
66700
66746
|
return array;
|
|
66701
66747
|
}
|
|
66748
|
+
function isInteger(value) {
|
|
66749
|
+
return (typeof (value) === "number" && value == value && (value % 1) === 0);
|
|
66750
|
+
}
|
|
66702
66751
|
function isBytes(value) {
|
|
66703
66752
|
if (value == null) {
|
|
66704
66753
|
return false;
|
|
@@ -66709,12 +66758,12 @@ function isBytes(value) {
|
|
|
66709
66758
|
if (typeof (value) === "string") {
|
|
66710
66759
|
return false;
|
|
66711
66760
|
}
|
|
66712
|
-
if (value.length
|
|
66761
|
+
if (!isInteger(value.length) || value.length < 0) {
|
|
66713
66762
|
return false;
|
|
66714
66763
|
}
|
|
66715
66764
|
for (let i = 0; i < value.length; i++) {
|
|
66716
66765
|
const v = value[i];
|
|
66717
|
-
if (
|
|
66766
|
+
if (!isInteger(v) || v < 0 || v >= 256) {
|
|
66718
66767
|
return false;
|
|
66719
66768
|
}
|
|
66720
66769
|
}
|
|
@@ -66848,7 +66897,7 @@ function hexZeroPad(value, length) {
|
|
|
66848
66897
|
return value;
|
|
66849
66898
|
}
|
|
66850
66899
|
|
|
66851
|
-
const version$1 = "bignumber/5.
|
|
66900
|
+
const version$1 = "bignumber/5.5.0";
|
|
66852
66901
|
|
|
66853
66902
|
var BN = bn.BN;
|
|
66854
66903
|
const logger$2 = new Logger(version$1);
|
|
@@ -67050,7 +67099,7 @@ class BigNumber {
|
|
|
67050
67099
|
return BigNumber.from(hexlify(anyValue));
|
|
67051
67100
|
}
|
|
67052
67101
|
if (anyValue) {
|
|
67053
|
-
// Hexable interface (takes
|
|
67102
|
+
// Hexable interface (takes priority)
|
|
67054
67103
|
if (anyValue.toHexString) {
|
|
67055
67104
|
const hex = anyValue.toHexString();
|
|
67056
67105
|
if (typeof (hex) === "string") {
|
|
@@ -67087,7 +67136,7 @@ function toHex(value) {
|
|
|
67087
67136
|
if (value[0] === "-") {
|
|
67088
67137
|
// Strip off the negative sign
|
|
67089
67138
|
value = value.substring(1);
|
|
67090
|
-
// Cannot have
|
|
67139
|
+
// Cannot have multiple negative signs (e.g. "--0x04")
|
|
67091
67140
|
if (value[0] === "-") {
|
|
67092
67141
|
logger$2.throwArgumentError("invalid hex", "value", value);
|
|
67093
67142
|
}
|
|
@@ -67199,7 +67248,7 @@ function parseFixed(value, decimals) {
|
|
|
67199
67248
|
decimals = 0;
|
|
67200
67249
|
}
|
|
67201
67250
|
const multiplier = getMultiplier(decimals);
|
|
67202
|
-
if (typeof (value) !== "string" || !value.match(/^-?[0-9
|
|
67251
|
+
if (typeof (value) !== "string" || !value.match(/^-?[0-9.]+$/)) {
|
|
67203
67252
|
logger$1.throwArgumentError("invalid decimal value", "value", value);
|
|
67204
67253
|
}
|
|
67205
67254
|
// Is it negative?
|
|
@@ -67222,12 +67271,17 @@ function parseFixed(value, decimals) {
|
|
|
67222
67271
|
if (!fraction) {
|
|
67223
67272
|
fraction = "0";
|
|
67224
67273
|
}
|
|
67225
|
-
//
|
|
67226
|
-
{
|
|
67227
|
-
|
|
67228
|
-
|
|
67229
|
-
|
|
67230
|
-
|
|
67274
|
+
// Trim trailing zeros
|
|
67275
|
+
while (fraction[fraction.length - 1] === "0") {
|
|
67276
|
+
fraction = fraction.substring(0, fraction.length - 1);
|
|
67277
|
+
}
|
|
67278
|
+
// Check the fraction doesn't exceed our decimals size
|
|
67279
|
+
if (fraction.length > multiplier.length - 1) {
|
|
67280
|
+
throwFault("fractional component exceeds decimals", "underflow", "parseFixed");
|
|
67281
|
+
}
|
|
67282
|
+
// If decimals is 0, we have an empty string for fraction
|
|
67283
|
+
if (fraction === "") {
|
|
67284
|
+
fraction = "0";
|
|
67231
67285
|
}
|
|
67232
67286
|
// Fully pad the string with zeros to get to wei
|
|
67233
67287
|
while (fraction.length < multiplier.length - 1) {
|
|
@@ -67486,7 +67540,7 @@ class FixedNumber {
|
|
|
67486
67540
|
const ONE = FixedNumber.from(1);
|
|
67487
67541
|
const BUMP = FixedNumber.from("0.5");
|
|
67488
67542
|
|
|
67489
|
-
const version = "units/5.
|
|
67543
|
+
const version = "units/5.5.0";
|
|
67490
67544
|
|
|
67491
67545
|
const logger = new Logger(version);
|
|
67492
67546
|
const names = [
|
|
@@ -67721,7 +67775,7 @@ class PaymentRoute {
|
|
|
67721
67775
|
}
|
|
67722
67776
|
}
|
|
67723
67777
|
|
|
67724
|
-
async function getAllAssetsFromAggregator({ accept
|
|
67778
|
+
async function getAllAssetsFromAggregator({ accept }) {
|
|
67725
67779
|
|
|
67726
67780
|
let routes = [
|
|
67727
67781
|
...new Set(
|
|
@@ -67735,7 +67789,7 @@ async function getAllAssetsFromAggregator({ accept, apiKey }) {
|
|
|
67735
67789
|
routes.map(
|
|
67736
67790
|
async (route)=> {
|
|
67737
67791
|
route = JSON.parse(route);
|
|
67738
|
-
return await getAssets({ blockchain: route.blockchain, account: route.fromAddress
|
|
67792
|
+
return await getAssets({ blockchain: route.blockchain, account: route.fromAddress })
|
|
67739
67793
|
}
|
|
67740
67794
|
)
|
|
67741
67795
|
).then((assets)=>{
|
|
@@ -67756,10 +67810,10 @@ async function onlyGetWhitelistedAssets({ whitelist }) {
|
|
|
67756
67810
|
return assets
|
|
67757
67811
|
}
|
|
67758
67812
|
|
|
67759
|
-
async function getAllAssets({ accept,
|
|
67813
|
+
async function getAllAssets({ accept, whitelist }) {
|
|
67760
67814
|
|
|
67761
67815
|
if(whitelist == undefined) {
|
|
67762
|
-
return getAllAssetsFromAggregator({ accept
|
|
67816
|
+
return getAllAssetsFromAggregator({ accept })
|
|
67763
67817
|
} else {
|
|
67764
67818
|
return onlyGetWhitelistedAssets({ whitelist })
|
|
67765
67819
|
}
|
|
@@ -67810,8 +67864,8 @@ function convertToRoutes({ tokens, accept }) {
|
|
|
67810
67864
|
})).then((routes)=> routes.flat().filter(el => el))
|
|
67811
67865
|
}
|
|
67812
67866
|
|
|
67813
|
-
async function route({ accept, whitelist, blacklist,
|
|
67814
|
-
let paymentRoutes = getAllAssets({ accept, whitelist
|
|
67867
|
+
async function route({ accept, whitelist, blacklist, event, fee }) {
|
|
67868
|
+
let paymentRoutes = getAllAssets({ accept, whitelist })
|
|
67815
67869
|
.then((assets)=>filterBlacklistedAssets({ assets, blacklist }))
|
|
67816
67870
|
.then(assetsToTokens)
|
|
67817
67871
|
.then((tokens) => convertToRoutes({ tokens, accept }))
|
package/dist/esm/index.js
CHANGED
|
@@ -2143,6 +2143,10 @@ var ChangableAmountProvider = (function (props) {
|
|
|
2143
2143
|
fromAddress: account,
|
|
2144
2144
|
toAddress: account
|
|
2145
2145
|
}).then(function (routes) {
|
|
2146
|
+
if (routes[0] == undefined) {
|
|
2147
|
+
return;
|
|
2148
|
+
}
|
|
2149
|
+
|
|
2146
2150
|
Token.readable({
|
|
2147
2151
|
amount: routes[0].amountOut,
|
|
2148
2152
|
blockchain: maxRoute.blockchain,
|
|
@@ -2166,6 +2170,10 @@ var ChangableAmountProvider = (function (props) {
|
|
|
2166
2170
|
fromAddress: account,
|
|
2167
2171
|
toAddress: account
|
|
2168
2172
|
}).then(function (routes) {
|
|
2173
|
+
if (routes[0] == undefined) {
|
|
2174
|
+
return;
|
|
2175
|
+
}
|
|
2176
|
+
|
|
2169
2177
|
Token.readable({
|
|
2170
2178
|
amount: routes[0].amountOut,
|
|
2171
2179
|
blockchain: maxRoute.blockchain,
|
package/dist/umd/index.bundle.js
CHANGED
|
@@ -10519,7 +10519,7 @@
|
|
|
10519
10519
|
})(module, commonjsGlobal$4);
|
|
10520
10520
|
});
|
|
10521
10521
|
|
|
10522
|
-
const version$y = "logger/5.
|
|
10522
|
+
const version$y = "logger/5.6.0";
|
|
10523
10523
|
|
|
10524
10524
|
let _permanentCensorErrors$4 = false;
|
|
10525
10525
|
let _censorErrors$4 = false;
|
|
@@ -10698,6 +10698,40 @@
|
|
|
10698
10698
|
messageDetails.push(`code=${code}`);
|
|
10699
10699
|
messageDetails.push(`version=${this.version}`);
|
|
10700
10700
|
const reason = message;
|
|
10701
|
+
let url = "";
|
|
10702
|
+
switch (code) {
|
|
10703
|
+
case ErrorCode$4.NUMERIC_FAULT: {
|
|
10704
|
+
url = "NUMERIC_FAULT";
|
|
10705
|
+
const fault = message;
|
|
10706
|
+
switch (fault) {
|
|
10707
|
+
case "overflow":
|
|
10708
|
+
case "underflow":
|
|
10709
|
+
case "division-by-zero":
|
|
10710
|
+
url += "-" + fault;
|
|
10711
|
+
break;
|
|
10712
|
+
case "negative-power":
|
|
10713
|
+
case "negative-width":
|
|
10714
|
+
url += "-unsupported";
|
|
10715
|
+
break;
|
|
10716
|
+
case "unbound-bitwise-result":
|
|
10717
|
+
url += "-unbound-result";
|
|
10718
|
+
break;
|
|
10719
|
+
}
|
|
10720
|
+
break;
|
|
10721
|
+
}
|
|
10722
|
+
case ErrorCode$4.CALL_EXCEPTION:
|
|
10723
|
+
case ErrorCode$4.INSUFFICIENT_FUNDS:
|
|
10724
|
+
case ErrorCode$4.MISSING_NEW:
|
|
10725
|
+
case ErrorCode$4.NONCE_EXPIRED:
|
|
10726
|
+
case ErrorCode$4.REPLACEMENT_UNDERPRICED:
|
|
10727
|
+
case ErrorCode$4.TRANSACTION_REPLACED:
|
|
10728
|
+
case ErrorCode$4.UNPREDICTABLE_GAS_LIMIT:
|
|
10729
|
+
url = code;
|
|
10730
|
+
break;
|
|
10731
|
+
}
|
|
10732
|
+
if (url) {
|
|
10733
|
+
message += " [ See: https:/\/links.ethers.org/v5-errors-" + url + " ]";
|
|
10734
|
+
}
|
|
10701
10735
|
if (messageDetails.length) {
|
|
10702
10736
|
message += " (" + messageDetails.join(", ") + ")";
|
|
10703
10737
|
}
|
|
@@ -10831,7 +10865,7 @@
|
|
|
10831
10865
|
Logger$4.errors = ErrorCode$4;
|
|
10832
10866
|
Logger$4.levels = LogLevel$4;
|
|
10833
10867
|
|
|
10834
|
-
const version$x = "bytes/5.
|
|
10868
|
+
const version$x = "bytes/5.6.0";
|
|
10835
10869
|
|
|
10836
10870
|
const logger$J = new Logger$4(version$x);
|
|
10837
10871
|
///////////////////////////////
|
|
@@ -10851,7 +10885,7 @@
|
|
|
10851
10885
|
function isBytesLike$2(value) {
|
|
10852
10886
|
return ((isHexString$4(value) && !(value.length % 2)) || isBytes$4(value));
|
|
10853
10887
|
}
|
|
10854
|
-
function isInteger(value) {
|
|
10888
|
+
function isInteger$1(value) {
|
|
10855
10889
|
return (typeof (value) === "number" && value == value && (value % 1) === 0);
|
|
10856
10890
|
}
|
|
10857
10891
|
function isBytes$4(value) {
|
|
@@ -10864,12 +10898,12 @@
|
|
|
10864
10898
|
if (typeof (value) === "string") {
|
|
10865
10899
|
return false;
|
|
10866
10900
|
}
|
|
10867
|
-
if (!isInteger(value.length) || value.length < 0) {
|
|
10901
|
+
if (!isInteger$1(value.length) || value.length < 0) {
|
|
10868
10902
|
return false;
|
|
10869
10903
|
}
|
|
10870
10904
|
for (let i = 0; i < value.length; i++) {
|
|
10871
10905
|
const v = value[i];
|
|
10872
|
-
if (!isInteger(v) || v < 0 || v >= 256) {
|
|
10906
|
+
if (!isInteger$1(v) || v < 0 || v >= 256) {
|
|
10873
10907
|
return false;
|
|
10874
10908
|
}
|
|
10875
10909
|
}
|
|
@@ -11066,7 +11100,7 @@
|
|
|
11066
11100
|
return value;
|
|
11067
11101
|
}
|
|
11068
11102
|
|
|
11069
|
-
const version$w = "bignumber/5.
|
|
11103
|
+
const version$w = "bignumber/5.6.0";
|
|
11070
11104
|
|
|
11071
11105
|
var BN$4 = bn$4.BN;
|
|
11072
11106
|
const logger$I = new Logger$4(version$w);
|
|
@@ -11115,7 +11149,7 @@
|
|
|
11115
11149
|
div(other) {
|
|
11116
11150
|
const o = BigNumber$4.from(other);
|
|
11117
11151
|
if (o.isZero()) {
|
|
11118
|
-
throwFault$6("division
|
|
11152
|
+
throwFault$6("division-by-zero", "div");
|
|
11119
11153
|
}
|
|
11120
11154
|
return toBigNumber$4(toBN$4(this).div(toBN$4(other)));
|
|
11121
11155
|
}
|
|
@@ -11125,53 +11159,53 @@
|
|
|
11125
11159
|
mod(other) {
|
|
11126
11160
|
const value = toBN$4(other);
|
|
11127
11161
|
if (value.isNeg()) {
|
|
11128
|
-
throwFault$6("
|
|
11162
|
+
throwFault$6("division-by-zero", "mod");
|
|
11129
11163
|
}
|
|
11130
11164
|
return toBigNumber$4(toBN$4(this).umod(value));
|
|
11131
11165
|
}
|
|
11132
11166
|
pow(other) {
|
|
11133
11167
|
const value = toBN$4(other);
|
|
11134
11168
|
if (value.isNeg()) {
|
|
11135
|
-
throwFault$6("
|
|
11169
|
+
throwFault$6("negative-power", "pow");
|
|
11136
11170
|
}
|
|
11137
11171
|
return toBigNumber$4(toBN$4(this).pow(value));
|
|
11138
11172
|
}
|
|
11139
11173
|
and(other) {
|
|
11140
11174
|
const value = toBN$4(other);
|
|
11141
11175
|
if (this.isNegative() || value.isNeg()) {
|
|
11142
|
-
throwFault$6("
|
|
11176
|
+
throwFault$6("unbound-bitwise-result", "and");
|
|
11143
11177
|
}
|
|
11144
11178
|
return toBigNumber$4(toBN$4(this).and(value));
|
|
11145
11179
|
}
|
|
11146
11180
|
or(other) {
|
|
11147
11181
|
const value = toBN$4(other);
|
|
11148
11182
|
if (this.isNegative() || value.isNeg()) {
|
|
11149
|
-
throwFault$6("
|
|
11183
|
+
throwFault$6("unbound-bitwise-result", "or");
|
|
11150
11184
|
}
|
|
11151
11185
|
return toBigNumber$4(toBN$4(this).or(value));
|
|
11152
11186
|
}
|
|
11153
11187
|
xor(other) {
|
|
11154
11188
|
const value = toBN$4(other);
|
|
11155
11189
|
if (this.isNegative() || value.isNeg()) {
|
|
11156
|
-
throwFault$6("
|
|
11190
|
+
throwFault$6("unbound-bitwise-result", "xor");
|
|
11157
11191
|
}
|
|
11158
11192
|
return toBigNumber$4(toBN$4(this).xor(value));
|
|
11159
11193
|
}
|
|
11160
11194
|
mask(value) {
|
|
11161
11195
|
if (this.isNegative() || value < 0) {
|
|
11162
|
-
throwFault$6("
|
|
11196
|
+
throwFault$6("negative-width", "mask");
|
|
11163
11197
|
}
|
|
11164
11198
|
return toBigNumber$4(toBN$4(this).maskn(value));
|
|
11165
11199
|
}
|
|
11166
11200
|
shl(value) {
|
|
11167
11201
|
if (this.isNegative() || value < 0) {
|
|
11168
|
-
throwFault$6("
|
|
11202
|
+
throwFault$6("negative-width", "shl");
|
|
11169
11203
|
}
|
|
11170
11204
|
return toBigNumber$4(toBN$4(this).shln(value));
|
|
11171
11205
|
}
|
|
11172
11206
|
shr(value) {
|
|
11173
11207
|
if (this.isNegative() || value < 0) {
|
|
11174
|
-
throwFault$6("
|
|
11208
|
+
throwFault$6("negative-width", "shr");
|
|
11175
11209
|
}
|
|
11176
11210
|
return toBigNumber$4(toBN$4(this).shrn(value));
|
|
11177
11211
|
}
|
|
@@ -11713,7 +11747,7 @@
|
|
|
11713
11747
|
const ONE$3 = FixedNumber$3.from(1);
|
|
11714
11748
|
const BUMP$3 = FixedNumber$3.from("0.5");
|
|
11715
11749
|
|
|
11716
|
-
const version$v = "properties/5.
|
|
11750
|
+
const version$v = "properties/5.6.0";
|
|
11717
11751
|
|
|
11718
11752
|
var __awaiter$d = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
11719
11753
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -11828,7 +11862,7 @@
|
|
|
11828
11862
|
}
|
|
11829
11863
|
}
|
|
11830
11864
|
|
|
11831
|
-
const version$u = "abi/5.
|
|
11865
|
+
const version$u = "abi/5.6.0";
|
|
11832
11866
|
|
|
11833
11867
|
const logger$F = new Logger$4(version$u);
|
|
11834
11868
|
const _constructorGuard$7 = {};
|
|
@@ -13469,7 +13503,7 @@
|
|
|
13469
13503
|
return '0x' + sha3$5.keccak_256(arrayify$4(data));
|
|
13470
13504
|
}
|
|
13471
13505
|
|
|
13472
|
-
const version$t = "rlp/5.
|
|
13506
|
+
const version$t = "rlp/5.6.0";
|
|
13473
13507
|
|
|
13474
13508
|
const logger$D = new Logger$4(version$t);
|
|
13475
13509
|
function arrayifyInteger$2(value) {
|
|
@@ -13513,7 +13547,7 @@
|
|
|
13513
13547
|
return hexlify$4(_encode$2(object));
|
|
13514
13548
|
}
|
|
13515
13549
|
|
|
13516
|
-
const version$s = "address/5.
|
|
13550
|
+
const version$s = "address/5.6.0";
|
|
13517
13551
|
|
|
13518
13552
|
const logger$C = new Logger$4(version$s);
|
|
13519
13553
|
function getChecksumAddress$3(address) {
|
|
@@ -13984,7 +14018,7 @@
|
|
|
13984
14018
|
}
|
|
13985
14019
|
}
|
|
13986
14020
|
|
|
13987
|
-
const version$r = "strings/5.
|
|
14021
|
+
const version$r = "strings/5.6.0";
|
|
13988
14022
|
|
|
13989
14023
|
const logger$A = new Logger$4(version$r);
|
|
13990
14024
|
///////////////////////////////
|
|
@@ -14670,9 +14704,7 @@
|
|
|
14670
14704
|
errorName = error.name;
|
|
14671
14705
|
errorSignature = error.format();
|
|
14672
14706
|
}
|
|
14673
|
-
catch (error) {
|
|
14674
|
-
console.log(error);
|
|
14675
|
-
}
|
|
14707
|
+
catch (error) { }
|
|
14676
14708
|
}
|
|
14677
14709
|
break;
|
|
14678
14710
|
}
|
|
@@ -14937,7 +14969,7 @@
|
|
|
14937
14969
|
}
|
|
14938
14970
|
}
|
|
14939
14971
|
|
|
14940
|
-
const version$q = "abstract-provider/5.
|
|
14972
|
+
const version$q = "abstract-provider/5.6.0";
|
|
14941
14973
|
|
|
14942
14974
|
var __awaiter$c = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14943
14975
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -14971,7 +15003,7 @@
|
|
|
14971
15003
|
// We may want to compute this more accurately in the future,
|
|
14972
15004
|
// using the formula "check if the base fee is correct".
|
|
14973
15005
|
// See: https://eips.ethereum.org/EIPS/eip-1559
|
|
14974
|
-
maxPriorityFeePerGas = BigNumber$4.from("
|
|
15006
|
+
maxPriorityFeePerGas = BigNumber$4.from("1500000000");
|
|
14975
15007
|
maxFeePerGas = block.baseFeePerGas.mul(2).add(maxPriorityFeePerGas);
|
|
14976
15008
|
}
|
|
14977
15009
|
return { maxFeePerGas, maxPriorityFeePerGas, gasPrice };
|
|
@@ -14990,7 +15022,7 @@
|
|
|
14990
15022
|
}
|
|
14991
15023
|
}
|
|
14992
15024
|
|
|
14993
|
-
const version$p = "abstract-signer/5.
|
|
15025
|
+
const version$p = "abstract-signer/5.6.0";
|
|
14994
15026
|
|
|
14995
15027
|
var __awaiter$b = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
14996
15028
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -15003,7 +15035,7 @@
|
|
|
15003
15035
|
};
|
|
15004
15036
|
const logger$w = new Logger$4(version$p);
|
|
15005
15037
|
const allowedTransactionKeys$3 = [
|
|
15006
|
-
"accessList", "chainId", "customData", "data", "from", "gasLimit", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "to", "type", "value"
|
|
15038
|
+
"accessList", "ccipReadEnabled", "chainId", "customData", "data", "from", "gasLimit", "gasPrice", "maxFeePerGas", "maxPriorityFeePerGas", "nonce", "to", "type", "value"
|
|
15007
15039
|
];
|
|
15008
15040
|
const forwardErrors$2 = [
|
|
15009
15041
|
Logger$4.errors.INSUFFICIENT_FUNDS,
|
|
@@ -15290,7 +15322,7 @@
|
|
|
15290
15322
|
}
|
|
15291
15323
|
}
|
|
15292
15324
|
|
|
15293
|
-
const version$o = "transactions/5.
|
|
15325
|
+
const version$o = "transactions/5.6.0";
|
|
15294
15326
|
|
|
15295
15327
|
const logger$v = new Logger$4(version$o);
|
|
15296
15328
|
var TransactionTypes$2;
|
|
@@ -15333,7 +15365,7 @@
|
|
|
15333
15365
|
return result;
|
|
15334
15366
|
}
|
|
15335
15367
|
|
|
15336
|
-
const version$n = "contracts/5.
|
|
15368
|
+
const version$n = "contracts/5.6.0";
|
|
15337
15369
|
|
|
15338
15370
|
var __awaiter$a = (undefined && undefined.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
15339
15371
|
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
@@ -15501,6 +15533,9 @@
|
|
|
15501
15533
|
if (ro.customData) {
|
|
15502
15534
|
tx.customData = shallowCopy$2(ro.customData);
|
|
15503
15535
|
}
|
|
15536
|
+
if (ro.ccipReadEnabled) {
|
|
15537
|
+
tx.ccipReadEnabled = !!ro.ccipReadEnabled;
|
|
15538
|
+
}
|
|
15504
15539
|
// Remove the overrides
|
|
15505
15540
|
delete overrides.nonce;
|
|
15506
15541
|
delete overrides.gasLimit;
|
|
@@ -15512,6 +15547,7 @@
|
|
|
15512
15547
|
delete overrides.maxFeePerGas;
|
|
15513
15548
|
delete overrides.maxPriorityFeePerGas;
|
|
15514
15549
|
delete overrides.customData;
|
|
15550
|
+
delete overrides.ccipReadEnabled;
|
|
15515
15551
|
// Make sure there are no stray overrides, which may indicate a
|
|
15516
15552
|
// typo or using an unsupported key.
|
|
15517
15553
|
const leftovers = Object.keys(overrides).filter((key) => (overrides[key] != null));
|
|
@@ -15857,6 +15893,8 @@
|
|
|
15857
15893
|
});
|
|
15858
15894
|
}
|
|
15859
15895
|
}
|
|
15896
|
+
// Swallow bad ENS names to prevent Unhandled Exceptions
|
|
15897
|
+
this.resolvedAddress.catch((e) => { });
|
|
15860
15898
|
const uniqueNames = {};
|
|
15861
15899
|
const uniqueSignatures = {};
|
|
15862
15900
|
Object.keys(this.interface.functions).forEach((signature) => {
|
|
@@ -16210,7 +16248,7 @@
|
|
|
16210
16248
|
class Contract$1 extends BaseContract$1 {
|
|
16211
16249
|
}
|
|
16212
16250
|
|
|
16213
|
-
const version$m = "units/5.
|
|
16251
|
+
const version$m = "units/5.6.0";
|
|
16214
16252
|
|
|
16215
16253
|
const logger$t = new Logger$4(version$m);
|
|
16216
16254
|
const names$3 = [
|
|
@@ -61864,6 +61902,10 @@
|
|
|
61864
61902
|
fromAddress: account,
|
|
61865
61903
|
toAddress: account
|
|
61866
61904
|
}).then(function (routes) {
|
|
61905
|
+
if (routes[0] == undefined) {
|
|
61906
|
+
return;
|
|
61907
|
+
}
|
|
61908
|
+
|
|
61867
61909
|
Token.readable({
|
|
61868
61910
|
amount: routes[0].amountOut,
|
|
61869
61911
|
blockchain: maxRoute.blockchain,
|
|
@@ -61887,6 +61929,10 @@
|
|
|
61887
61929
|
fromAddress: account,
|
|
61888
61930
|
toAddress: account
|
|
61889
61931
|
}).then(function (routes) {
|
|
61932
|
+
if (routes[0] == undefined) {
|
|
61933
|
+
return;
|
|
61934
|
+
}
|
|
61935
|
+
|
|
61890
61936
|
Token.readable({
|
|
61891
61937
|
amount: routes[0].amountOut,
|
|
61892
61938
|
blockchain: maxRoute.blockchain,
|
|
@@ -66376,7 +66422,7 @@
|
|
|
66376
66422
|
})(module, commonjsGlobal);
|
|
66377
66423
|
});
|
|
66378
66424
|
|
|
66379
|
-
const version$3 = "logger/5.
|
|
66425
|
+
const version$3 = "logger/5.5.0";
|
|
66380
66426
|
|
|
66381
66427
|
let _permanentCensorErrors = false;
|
|
66382
66428
|
let _censorErrors = false;
|
|
@@ -66473,7 +66519,7 @@
|
|
|
66473
66519
|
// - errorArgs?: The EIP848 error parameters
|
|
66474
66520
|
// - reason: The reason (only for EIP848 "Error(string)")
|
|
66475
66521
|
ErrorCode["CALL_EXCEPTION"] = "CALL_EXCEPTION";
|
|
66476
|
-
//
|
|
66522
|
+
// Insufficient funds (< value + gasLimit * gasPrice)
|
|
66477
66523
|
// - transaction: the transaction attempted
|
|
66478
66524
|
ErrorCode["INSUFFICIENT_FUNDS"] = "INSUFFICIENT_FUNDS";
|
|
66479
66525
|
// Nonce has already been used
|
|
@@ -66688,7 +66734,7 @@
|
|
|
66688
66734
|
Logger.errors = ErrorCode;
|
|
66689
66735
|
Logger.levels = LogLevel;
|
|
66690
66736
|
|
|
66691
|
-
const version$2 = "bytes/5.
|
|
66737
|
+
const version$2 = "bytes/5.5.0";
|
|
66692
66738
|
|
|
66693
66739
|
const logger$3 = new Logger(version$2);
|
|
66694
66740
|
///////////////////////////////
|
|
@@ -66705,6 +66751,9 @@
|
|
|
66705
66751
|
};
|
|
66706
66752
|
return array;
|
|
66707
66753
|
}
|
|
66754
|
+
function isInteger(value) {
|
|
66755
|
+
return (typeof (value) === "number" && value == value && (value % 1) === 0);
|
|
66756
|
+
}
|
|
66708
66757
|
function isBytes(value) {
|
|
66709
66758
|
if (value == null) {
|
|
66710
66759
|
return false;
|
|
@@ -66715,12 +66764,12 @@
|
|
|
66715
66764
|
if (typeof (value) === "string") {
|
|
66716
66765
|
return false;
|
|
66717
66766
|
}
|
|
66718
|
-
if (value.length
|
|
66767
|
+
if (!isInteger(value.length) || value.length < 0) {
|
|
66719
66768
|
return false;
|
|
66720
66769
|
}
|
|
66721
66770
|
for (let i = 0; i < value.length; i++) {
|
|
66722
66771
|
const v = value[i];
|
|
66723
|
-
if (
|
|
66772
|
+
if (!isInteger(v) || v < 0 || v >= 256) {
|
|
66724
66773
|
return false;
|
|
66725
66774
|
}
|
|
66726
66775
|
}
|
|
@@ -66854,7 +66903,7 @@
|
|
|
66854
66903
|
return value;
|
|
66855
66904
|
}
|
|
66856
66905
|
|
|
66857
|
-
const version$1 = "bignumber/5.
|
|
66906
|
+
const version$1 = "bignumber/5.5.0";
|
|
66858
66907
|
|
|
66859
66908
|
var BN = bn.BN;
|
|
66860
66909
|
const logger$2 = new Logger(version$1);
|
|
@@ -67056,7 +67105,7 @@
|
|
|
67056
67105
|
return BigNumber.from(hexlify(anyValue));
|
|
67057
67106
|
}
|
|
67058
67107
|
if (anyValue) {
|
|
67059
|
-
// Hexable interface (takes
|
|
67108
|
+
// Hexable interface (takes priority)
|
|
67060
67109
|
if (anyValue.toHexString) {
|
|
67061
67110
|
const hex = anyValue.toHexString();
|
|
67062
67111
|
if (typeof (hex) === "string") {
|
|
@@ -67093,7 +67142,7 @@
|
|
|
67093
67142
|
if (value[0] === "-") {
|
|
67094
67143
|
// Strip off the negative sign
|
|
67095
67144
|
value = value.substring(1);
|
|
67096
|
-
// Cannot have
|
|
67145
|
+
// Cannot have multiple negative signs (e.g. "--0x04")
|
|
67097
67146
|
if (value[0] === "-") {
|
|
67098
67147
|
logger$2.throwArgumentError("invalid hex", "value", value);
|
|
67099
67148
|
}
|
|
@@ -67205,7 +67254,7 @@
|
|
|
67205
67254
|
decimals = 0;
|
|
67206
67255
|
}
|
|
67207
67256
|
const multiplier = getMultiplier(decimals);
|
|
67208
|
-
if (typeof (value) !== "string" || !value.match(/^-?[0-9
|
|
67257
|
+
if (typeof (value) !== "string" || !value.match(/^-?[0-9.]+$/)) {
|
|
67209
67258
|
logger$1.throwArgumentError("invalid decimal value", "value", value);
|
|
67210
67259
|
}
|
|
67211
67260
|
// Is it negative?
|
|
@@ -67228,12 +67277,17 @@
|
|
|
67228
67277
|
if (!fraction) {
|
|
67229
67278
|
fraction = "0";
|
|
67230
67279
|
}
|
|
67231
|
-
//
|
|
67232
|
-
{
|
|
67233
|
-
|
|
67234
|
-
|
|
67235
|
-
|
|
67236
|
-
|
|
67280
|
+
// Trim trailing zeros
|
|
67281
|
+
while (fraction[fraction.length - 1] === "0") {
|
|
67282
|
+
fraction = fraction.substring(0, fraction.length - 1);
|
|
67283
|
+
}
|
|
67284
|
+
// Check the fraction doesn't exceed our decimals size
|
|
67285
|
+
if (fraction.length > multiplier.length - 1) {
|
|
67286
|
+
throwFault("fractional component exceeds decimals", "underflow", "parseFixed");
|
|
67287
|
+
}
|
|
67288
|
+
// If decimals is 0, we have an empty string for fraction
|
|
67289
|
+
if (fraction === "") {
|
|
67290
|
+
fraction = "0";
|
|
67237
67291
|
}
|
|
67238
67292
|
// Fully pad the string with zeros to get to wei
|
|
67239
67293
|
while (fraction.length < multiplier.length - 1) {
|
|
@@ -67492,7 +67546,7 @@
|
|
|
67492
67546
|
const ONE = FixedNumber.from(1);
|
|
67493
67547
|
const BUMP = FixedNumber.from("0.5");
|
|
67494
67548
|
|
|
67495
|
-
const version = "units/5.
|
|
67549
|
+
const version = "units/5.5.0";
|
|
67496
67550
|
|
|
67497
67551
|
const logger = new Logger(version);
|
|
67498
67552
|
const names = [
|
|
@@ -67727,7 +67781,7 @@
|
|
|
67727
67781
|
}
|
|
67728
67782
|
}
|
|
67729
67783
|
|
|
67730
|
-
async function getAllAssetsFromAggregator({ accept
|
|
67784
|
+
async function getAllAssetsFromAggregator({ accept }) {
|
|
67731
67785
|
|
|
67732
67786
|
let routes = [
|
|
67733
67787
|
...new Set(
|
|
@@ -67741,7 +67795,7 @@
|
|
|
67741
67795
|
routes.map(
|
|
67742
67796
|
async (route)=> {
|
|
67743
67797
|
route = JSON.parse(route);
|
|
67744
|
-
return await getAssets({ blockchain: route.blockchain, account: route.fromAddress
|
|
67798
|
+
return await getAssets({ blockchain: route.blockchain, account: route.fromAddress })
|
|
67745
67799
|
}
|
|
67746
67800
|
)
|
|
67747
67801
|
).then((assets)=>{
|
|
@@ -67762,10 +67816,10 @@
|
|
|
67762
67816
|
return assets
|
|
67763
67817
|
}
|
|
67764
67818
|
|
|
67765
|
-
async function getAllAssets({ accept,
|
|
67819
|
+
async function getAllAssets({ accept, whitelist }) {
|
|
67766
67820
|
|
|
67767
67821
|
if(whitelist == undefined) {
|
|
67768
|
-
return getAllAssetsFromAggregator({ accept
|
|
67822
|
+
return getAllAssetsFromAggregator({ accept })
|
|
67769
67823
|
} else {
|
|
67770
67824
|
return onlyGetWhitelistedAssets({ whitelist })
|
|
67771
67825
|
}
|
|
@@ -67816,8 +67870,8 @@
|
|
|
67816
67870
|
})).then((routes)=> routes.flat().filter(el => el))
|
|
67817
67871
|
}
|
|
67818
67872
|
|
|
67819
|
-
async function route({ accept, whitelist, blacklist,
|
|
67820
|
-
let paymentRoutes = getAllAssets({ accept, whitelist
|
|
67873
|
+
async function route({ accept, whitelist, blacklist, event, fee }) {
|
|
67874
|
+
let paymentRoutes = getAllAssets({ accept, whitelist })
|
|
67821
67875
|
.then((assets)=>filterBlacklistedAssets({ assets, blacklist }))
|
|
67822
67876
|
.then(assetsToTokens)
|
|
67823
67877
|
.then((tokens) => convertToRoutes({ tokens, accept }))
|
package/dist/umd/index.js
CHANGED
|
@@ -2138,6 +2138,10 @@
|
|
|
2138
2138
|
fromAddress: account,
|
|
2139
2139
|
toAddress: account
|
|
2140
2140
|
}).then(function (routes) {
|
|
2141
|
+
if (routes[0] == undefined) {
|
|
2142
|
+
return;
|
|
2143
|
+
}
|
|
2144
|
+
|
|
2141
2145
|
web3Tokens.Token.readable({
|
|
2142
2146
|
amount: routes[0].amountOut,
|
|
2143
2147
|
blockchain: maxRoute.blockchain,
|
|
@@ -2161,6 +2165,10 @@
|
|
|
2161
2165
|
fromAddress: account,
|
|
2162
2166
|
toAddress: account
|
|
2163
2167
|
}).then(function (routes) {
|
|
2168
|
+
if (routes[0] == undefined) {
|
|
2169
|
+
return;
|
|
2170
|
+
}
|
|
2171
|
+
|
|
2164
2172
|
web3Tokens.Token.readable({
|
|
2165
2173
|
amount: routes[0].amountOut,
|
|
2166
2174
|
blockchain: maxRoute.blockchain,
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depay/widgets",
|
|
3
3
|
"moduleName": "DePayWidgets",
|
|
4
|
-
"version": "6.
|
|
4
|
+
"version": "6.21.1",
|
|
5
5
|
"description": "Web3 Payments with any token. DePay simplifies and improves Web3 Payments with the power of DeFi. Accept any token with on-the-fly conversion.",
|
|
6
6
|
"main": "./dist/umd/index.js",
|
|
7
7
|
"module": "./dist/esm/index.js",
|
|
@@ -38,12 +38,12 @@
|
|
|
38
38
|
"@depay/react-shadow-dom": "^4.0.0",
|
|
39
39
|
"@depay/react-token-image": "^3.0.0",
|
|
40
40
|
"@depay/walletconnect-v1": "^1.1.0",
|
|
41
|
-
"@depay/web3-assets": "^5.3.
|
|
41
|
+
"@depay/web3-assets": "^5.3.2",
|
|
42
42
|
"@depay/web3-blockchains": "^4.2.0",
|
|
43
43
|
"@depay/web3-client": "^8.0.0",
|
|
44
44
|
"@depay/web3-constants": "^5.0.0",
|
|
45
45
|
"@depay/web3-exchanges": "^8.1.0",
|
|
46
|
-
"@depay/web3-payments": "^9.
|
|
46
|
+
"@depay/web3-payments": "^9.4.1",
|
|
47
47
|
"@depay/web3-tokens": "^8.0.1",
|
|
48
48
|
"@depay/web3-wallets": "^9.1.0",
|
|
49
49
|
"decimal.js": "^10.3.1",
|