@depay/web3-wallets-evm 16.0.8 → 16.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/esm/index.evm.js +310 -33
- package/dist/esm/index.js +10 -0
- package/dist/esm/index.solana.js +10 -0
- package/dist/umd/index.evm.js +310 -33
- package/dist/umd/index.js +10 -0
- package/dist/umd/index.solana.js +10 -0
- package/package.json +4 -4
package/dist/esm/index.evm.js
CHANGED
|
@@ -8123,7 +8123,7 @@ var require$$1$1 = /*@__PURE__*/getAugmentedNamespace(_polyfillNode_buffer);
|
|
|
8123
8123
|
|
|
8124
8124
|
var BN$1 = bn$1.exports;
|
|
8125
8125
|
|
|
8126
|
-
var safeBuffer = {exports: {}};
|
|
8126
|
+
var safeBuffer$1 = {exports: {}};
|
|
8127
8127
|
|
|
8128
8128
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
8129
8129
|
|
|
@@ -8197,7 +8197,7 @@ var safeBuffer = {exports: {}};
|
|
|
8197
8197
|
|
|
8198
8198
|
return buffer.SlowBuffer(size);
|
|
8199
8199
|
};
|
|
8200
|
-
})(safeBuffer, safeBuffer.exports);
|
|
8200
|
+
})(safeBuffer$1, safeBuffer$1.exports);
|
|
8201
8201
|
|
|
8202
8202
|
// Copyright (c) 2018 base-x contributors
|
|
8203
8203
|
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
@@ -8206,9 +8206,9 @@ var safeBuffer = {exports: {}};
|
|
|
8206
8206
|
// @ts-ignore
|
|
8207
8207
|
|
|
8208
8208
|
|
|
8209
|
-
var _Buffer = safeBuffer.exports.Buffer;
|
|
8209
|
+
var _Buffer$1 = safeBuffer$1.exports.Buffer;
|
|
8210
8210
|
|
|
8211
|
-
function base$
|
|
8211
|
+
function base$2(ALPHABET) {
|
|
8212
8212
|
if (ALPHABET.length >= 255) {
|
|
8213
8213
|
throw new TypeError('Alphabet too long');
|
|
8214
8214
|
}
|
|
@@ -8238,10 +8238,10 @@ function base$1(ALPHABET) {
|
|
|
8238
8238
|
|
|
8239
8239
|
function encode(source) {
|
|
8240
8240
|
if (Array.isArray(source) || source instanceof Uint8Array) {
|
|
8241
|
-
source = _Buffer.from(source);
|
|
8241
|
+
source = _Buffer$1.from(source);
|
|
8242
8242
|
}
|
|
8243
8243
|
|
|
8244
|
-
if (!_Buffer.isBuffer(source)) {
|
|
8244
|
+
if (!_Buffer$1.isBuffer(source)) {
|
|
8245
8245
|
throw new TypeError('Expected Buffer');
|
|
8246
8246
|
}
|
|
8247
8247
|
|
|
@@ -8306,7 +8306,7 @@ function base$1(ALPHABET) {
|
|
|
8306
8306
|
}
|
|
8307
8307
|
|
|
8308
8308
|
if (source.length === 0) {
|
|
8309
|
-
return _Buffer.alloc(0);
|
|
8309
|
+
return _Buffer$1.alloc(0);
|
|
8310
8310
|
}
|
|
8311
8311
|
|
|
8312
8312
|
var psz = 0; // Skip and count leading '1's.
|
|
@@ -8355,7 +8355,7 @@ function base$1(ALPHABET) {
|
|
|
8355
8355
|
it4++;
|
|
8356
8356
|
}
|
|
8357
8357
|
|
|
8358
|
-
var vch = _Buffer.allocUnsafe(zeroes + (size - it4));
|
|
8358
|
+
var vch = _Buffer$1.allocUnsafe(zeroes + (size - it4));
|
|
8359
8359
|
|
|
8360
8360
|
vch.fill(0x00, 0, zeroes);
|
|
8361
8361
|
var j = zeroes;
|
|
@@ -8384,12 +8384,12 @@ function base$1(ALPHABET) {
|
|
|
8384
8384
|
};
|
|
8385
8385
|
}
|
|
8386
8386
|
|
|
8387
|
-
var src$
|
|
8387
|
+
var src$2 = base$2;
|
|
8388
8388
|
|
|
8389
|
-
var basex$
|
|
8390
|
-
var ALPHABET$
|
|
8391
|
-
var bs58$
|
|
8392
|
-
var bs58$
|
|
8389
|
+
var basex$2 = src$2;
|
|
8390
|
+
var ALPHABET$2 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
8391
|
+
var bs58$4 = basex$2(ALPHABET$2);
|
|
8392
|
+
var bs58$5 = bs58$4;
|
|
8393
8393
|
|
|
8394
8394
|
var Chi = function Chi(a, b, c) {
|
|
8395
8395
|
return a & b ^ ~a & c;
|
|
@@ -8568,6 +8568,273 @@ wrapConstructor(function () {
|
|
|
8568
8568
|
|
|
8569
8569
|
var lib$1 = {};
|
|
8570
8570
|
|
|
8571
|
+
var safeBuffer = {exports: {}};
|
|
8572
|
+
|
|
8573
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
8574
|
+
|
|
8575
|
+
(function (module, exports) {
|
|
8576
|
+
/* eslint-disable node/no-deprecated-api */
|
|
8577
|
+
var buffer = require$$1$1;
|
|
8578
|
+
var Buffer = buffer.Buffer; // alternative to using Object.keys for old browsers
|
|
8579
|
+
|
|
8580
|
+
function copyProps(src, dst) {
|
|
8581
|
+
for (var key in src) {
|
|
8582
|
+
dst[key] = src[key];
|
|
8583
|
+
}
|
|
8584
|
+
}
|
|
8585
|
+
|
|
8586
|
+
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
|
|
8587
|
+
module.exports = buffer;
|
|
8588
|
+
} else {
|
|
8589
|
+
// Copy properties from require('buffer')
|
|
8590
|
+
copyProps(buffer, exports);
|
|
8591
|
+
exports.Buffer = SafeBuffer;
|
|
8592
|
+
}
|
|
8593
|
+
|
|
8594
|
+
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
8595
|
+
return Buffer(arg, encodingOrOffset, length);
|
|
8596
|
+
}
|
|
8597
|
+
|
|
8598
|
+
SafeBuffer.prototype = Object.create(Buffer.prototype); // Copy static methods from Buffer
|
|
8599
|
+
|
|
8600
|
+
copyProps(Buffer, SafeBuffer);
|
|
8601
|
+
|
|
8602
|
+
SafeBuffer.from = function (arg, encodingOrOffset, length) {
|
|
8603
|
+
if (typeof arg === 'number') {
|
|
8604
|
+
throw new TypeError('Argument must not be a number');
|
|
8605
|
+
}
|
|
8606
|
+
|
|
8607
|
+
return Buffer(arg, encodingOrOffset, length);
|
|
8608
|
+
};
|
|
8609
|
+
|
|
8610
|
+
SafeBuffer.alloc = function (size, fill, encoding) {
|
|
8611
|
+
if (typeof size !== 'number') {
|
|
8612
|
+
throw new TypeError('Argument must be a number');
|
|
8613
|
+
}
|
|
8614
|
+
|
|
8615
|
+
var buf = Buffer(size);
|
|
8616
|
+
|
|
8617
|
+
if (fill !== undefined) {
|
|
8618
|
+
if (typeof encoding === 'string') {
|
|
8619
|
+
buf.fill(fill, encoding);
|
|
8620
|
+
} else {
|
|
8621
|
+
buf.fill(fill);
|
|
8622
|
+
}
|
|
8623
|
+
} else {
|
|
8624
|
+
buf.fill(0);
|
|
8625
|
+
}
|
|
8626
|
+
|
|
8627
|
+
return buf;
|
|
8628
|
+
};
|
|
8629
|
+
|
|
8630
|
+
SafeBuffer.allocUnsafe = function (size) {
|
|
8631
|
+
if (typeof size !== 'number') {
|
|
8632
|
+
throw new TypeError('Argument must be a number');
|
|
8633
|
+
}
|
|
8634
|
+
|
|
8635
|
+
return Buffer(size);
|
|
8636
|
+
};
|
|
8637
|
+
|
|
8638
|
+
SafeBuffer.allocUnsafeSlow = function (size) {
|
|
8639
|
+
if (typeof size !== 'number') {
|
|
8640
|
+
throw new TypeError('Argument must be a number');
|
|
8641
|
+
}
|
|
8642
|
+
|
|
8643
|
+
return buffer.SlowBuffer(size);
|
|
8644
|
+
};
|
|
8645
|
+
})(safeBuffer, safeBuffer.exports);
|
|
8646
|
+
|
|
8647
|
+
// Copyright (c) 2018 base-x contributors
|
|
8648
|
+
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
8649
|
+
// Distributed under the MIT software license, see the accompanying
|
|
8650
|
+
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
8651
|
+
// @ts-ignore
|
|
8652
|
+
|
|
8653
|
+
|
|
8654
|
+
var _Buffer = safeBuffer.exports.Buffer;
|
|
8655
|
+
|
|
8656
|
+
function base$1(ALPHABET) {
|
|
8657
|
+
if (ALPHABET.length >= 255) {
|
|
8658
|
+
throw new TypeError('Alphabet too long');
|
|
8659
|
+
}
|
|
8660
|
+
|
|
8661
|
+
var BASE_MAP = new Uint8Array(256);
|
|
8662
|
+
|
|
8663
|
+
for (var j = 0; j < BASE_MAP.length; j++) {
|
|
8664
|
+
BASE_MAP[j] = 255;
|
|
8665
|
+
}
|
|
8666
|
+
|
|
8667
|
+
for (var i = 0; i < ALPHABET.length; i++) {
|
|
8668
|
+
var x = ALPHABET.charAt(i);
|
|
8669
|
+
var xc = x.charCodeAt(0);
|
|
8670
|
+
|
|
8671
|
+
if (BASE_MAP[xc] !== 255) {
|
|
8672
|
+
throw new TypeError(x + ' is ambiguous');
|
|
8673
|
+
}
|
|
8674
|
+
|
|
8675
|
+
BASE_MAP[xc] = i;
|
|
8676
|
+
}
|
|
8677
|
+
|
|
8678
|
+
var BASE = ALPHABET.length;
|
|
8679
|
+
var LEADER = ALPHABET.charAt(0);
|
|
8680
|
+
var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
|
|
8681
|
+
|
|
8682
|
+
var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
|
|
8683
|
+
|
|
8684
|
+
function encode(source) {
|
|
8685
|
+
if (Array.isArray(source) || source instanceof Uint8Array) {
|
|
8686
|
+
source = _Buffer.from(source);
|
|
8687
|
+
}
|
|
8688
|
+
|
|
8689
|
+
if (!_Buffer.isBuffer(source)) {
|
|
8690
|
+
throw new TypeError('Expected Buffer');
|
|
8691
|
+
}
|
|
8692
|
+
|
|
8693
|
+
if (source.length === 0) {
|
|
8694
|
+
return '';
|
|
8695
|
+
} // Skip & count leading zeroes.
|
|
8696
|
+
|
|
8697
|
+
|
|
8698
|
+
var zeroes = 0;
|
|
8699
|
+
var length = 0;
|
|
8700
|
+
var pbegin = 0;
|
|
8701
|
+
var pend = source.length;
|
|
8702
|
+
|
|
8703
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
8704
|
+
pbegin++;
|
|
8705
|
+
zeroes++;
|
|
8706
|
+
} // Allocate enough space in big-endian base58 representation.
|
|
8707
|
+
|
|
8708
|
+
|
|
8709
|
+
var size = (pend - pbegin) * iFACTOR + 1 >>> 0;
|
|
8710
|
+
var b58 = new Uint8Array(size); // Process the bytes.
|
|
8711
|
+
|
|
8712
|
+
while (pbegin !== pend) {
|
|
8713
|
+
var carry = source[pbegin]; // Apply "b58 = b58 * 256 + ch".
|
|
8714
|
+
|
|
8715
|
+
var i = 0;
|
|
8716
|
+
|
|
8717
|
+
for (var it1 = size - 1; (carry !== 0 || i < length) && it1 !== -1; it1--, i++) {
|
|
8718
|
+
carry += 256 * b58[it1] >>> 0;
|
|
8719
|
+
b58[it1] = carry % BASE >>> 0;
|
|
8720
|
+
carry = carry / BASE >>> 0;
|
|
8721
|
+
}
|
|
8722
|
+
|
|
8723
|
+
if (carry !== 0) {
|
|
8724
|
+
throw new Error('Non-zero carry');
|
|
8725
|
+
}
|
|
8726
|
+
|
|
8727
|
+
length = i;
|
|
8728
|
+
pbegin++;
|
|
8729
|
+
} // Skip leading zeroes in base58 result.
|
|
8730
|
+
|
|
8731
|
+
|
|
8732
|
+
var it2 = size - length;
|
|
8733
|
+
|
|
8734
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
8735
|
+
it2++;
|
|
8736
|
+
} // Translate the result into a string.
|
|
8737
|
+
|
|
8738
|
+
|
|
8739
|
+
var str = LEADER.repeat(zeroes);
|
|
8740
|
+
|
|
8741
|
+
for (; it2 < size; ++it2) {
|
|
8742
|
+
str += ALPHABET.charAt(b58[it2]);
|
|
8743
|
+
}
|
|
8744
|
+
|
|
8745
|
+
return str;
|
|
8746
|
+
}
|
|
8747
|
+
|
|
8748
|
+
function decodeUnsafe(source) {
|
|
8749
|
+
if (typeof source !== 'string') {
|
|
8750
|
+
throw new TypeError('Expected String');
|
|
8751
|
+
}
|
|
8752
|
+
|
|
8753
|
+
if (source.length === 0) {
|
|
8754
|
+
return _Buffer.alloc(0);
|
|
8755
|
+
}
|
|
8756
|
+
|
|
8757
|
+
var psz = 0; // Skip and count leading '1's.
|
|
8758
|
+
|
|
8759
|
+
var zeroes = 0;
|
|
8760
|
+
var length = 0;
|
|
8761
|
+
|
|
8762
|
+
while (source[psz] === LEADER) {
|
|
8763
|
+
zeroes++;
|
|
8764
|
+
psz++;
|
|
8765
|
+
} // Allocate enough space in big-endian base256 representation.
|
|
8766
|
+
|
|
8767
|
+
|
|
8768
|
+
var size = (source.length - psz) * FACTOR + 1 >>> 0; // log(58) / log(256), rounded up.
|
|
8769
|
+
|
|
8770
|
+
var b256 = new Uint8Array(size); // Process the characters.
|
|
8771
|
+
|
|
8772
|
+
while (source[psz]) {
|
|
8773
|
+
// Decode character
|
|
8774
|
+
var carry = BASE_MAP[source.charCodeAt(psz)]; // Invalid character
|
|
8775
|
+
|
|
8776
|
+
if (carry === 255) {
|
|
8777
|
+
return;
|
|
8778
|
+
}
|
|
8779
|
+
|
|
8780
|
+
var i = 0;
|
|
8781
|
+
|
|
8782
|
+
for (var it3 = size - 1; (carry !== 0 || i < length) && it3 !== -1; it3--, i++) {
|
|
8783
|
+
carry += BASE * b256[it3] >>> 0;
|
|
8784
|
+
b256[it3] = carry % 256 >>> 0;
|
|
8785
|
+
carry = carry / 256 >>> 0;
|
|
8786
|
+
}
|
|
8787
|
+
|
|
8788
|
+
if (carry !== 0) {
|
|
8789
|
+
throw new Error('Non-zero carry');
|
|
8790
|
+
}
|
|
8791
|
+
|
|
8792
|
+
length = i;
|
|
8793
|
+
psz++;
|
|
8794
|
+
} // Skip leading zeroes in b256.
|
|
8795
|
+
|
|
8796
|
+
|
|
8797
|
+
var it4 = size - length;
|
|
8798
|
+
|
|
8799
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
8800
|
+
it4++;
|
|
8801
|
+
}
|
|
8802
|
+
|
|
8803
|
+
var vch = _Buffer.allocUnsafe(zeroes + (size - it4));
|
|
8804
|
+
|
|
8805
|
+
vch.fill(0x00, 0, zeroes);
|
|
8806
|
+
var j = zeroes;
|
|
8807
|
+
|
|
8808
|
+
while (it4 !== size) {
|
|
8809
|
+
vch[j++] = b256[it4++];
|
|
8810
|
+
}
|
|
8811
|
+
|
|
8812
|
+
return vch;
|
|
8813
|
+
}
|
|
8814
|
+
|
|
8815
|
+
function decode(string) {
|
|
8816
|
+
var buffer = decodeUnsafe(string);
|
|
8817
|
+
|
|
8818
|
+
if (buffer) {
|
|
8819
|
+
return buffer;
|
|
8820
|
+
}
|
|
8821
|
+
|
|
8822
|
+
throw new Error('Non-base' + BASE + ' character');
|
|
8823
|
+
}
|
|
8824
|
+
|
|
8825
|
+
return {
|
|
8826
|
+
encode: encode,
|
|
8827
|
+
decodeUnsafe: decodeUnsafe,
|
|
8828
|
+
decode: decode
|
|
8829
|
+
};
|
|
8830
|
+
}
|
|
8831
|
+
|
|
8832
|
+
var src$1 = base$1;
|
|
8833
|
+
|
|
8834
|
+
var basex$1 = src$1;
|
|
8835
|
+
var ALPHABET$1 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
8836
|
+
var bs58$3 = basex$1(ALPHABET$1);
|
|
8837
|
+
|
|
8571
8838
|
function inRange(a, min, max) {
|
|
8572
8839
|
return min <= a && a <= max;
|
|
8573
8840
|
}
|
|
@@ -9224,7 +9491,7 @@ var deserializeUnchecked_1 = lib$1.deserializeUnchecked = deserialize_1 = lib$1.
|
|
|
9224
9491
|
|
|
9225
9492
|
var bn_js_1 = __importDefault(bn$1.exports);
|
|
9226
9493
|
|
|
9227
|
-
var bs58_1 = __importDefault(bs58$
|
|
9494
|
+
var bs58_1 = __importDefault(bs58$3); // TODO: Make sure this polyfill not included when not required
|
|
9228
9495
|
|
|
9229
9496
|
|
|
9230
9497
|
var encoding = __importStar(require$$2);
|
|
@@ -18971,7 +19238,7 @@ var PublicKey$1 = /*#__PURE__*/function (_Struct2, _Symbol$toStringTag2) {
|
|
|
18971
19238
|
} else {
|
|
18972
19239
|
if (typeof value === 'string') {
|
|
18973
19240
|
// assume base 58 encoding by default
|
|
18974
|
-
var decoded = bs58$
|
|
19241
|
+
var decoded = bs58$5.decode(value);
|
|
18975
19242
|
|
|
18976
19243
|
if (decoded.length != PUBLIC_KEY_LENGTH) {
|
|
18977
19244
|
throw new Error("Invalid public key input");
|
|
@@ -19015,7 +19282,7 @@ var PublicKey$1 = /*#__PURE__*/function (_Struct2, _Symbol$toStringTag2) {
|
|
|
19015
19282
|
}, {
|
|
19016
19283
|
key: "toBase58",
|
|
19017
19284
|
value: function toBase58() {
|
|
19018
|
-
return bs58$
|
|
19285
|
+
return bs58$5.encode(this.toBytes());
|
|
19019
19286
|
}
|
|
19020
19287
|
}, {
|
|
19021
19288
|
key: "toJSON",
|
|
@@ -19900,7 +20167,7 @@ var Message = /*#__PURE__*/function () {
|
|
|
19900
20167
|
return {
|
|
19901
20168
|
programIdIndex: ix.programIdIndex,
|
|
19902
20169
|
accountKeyIndexes: ix.accounts,
|
|
19903
|
-
data: bs58$
|
|
20170
|
+
data: bs58$5.decode(ix.data)
|
|
19904
20171
|
};
|
|
19905
20172
|
});
|
|
19906
20173
|
}
|
|
@@ -19962,7 +20229,7 @@ var Message = /*#__PURE__*/function () {
|
|
|
19962
20229
|
var instructions = this.instructions.map(function (instruction) {
|
|
19963
20230
|
var accounts = instruction.accounts,
|
|
19964
20231
|
programIdIndex = instruction.programIdIndex;
|
|
19965
|
-
var data = Array.from(bs58$
|
|
20232
|
+
var data = Array.from(bs58$5.decode(instruction.data));
|
|
19966
20233
|
var keyIndicesCount = [];
|
|
19967
20234
|
encodeLength(keyIndicesCount, accounts.length);
|
|
19968
20235
|
var dataCount = [];
|
|
@@ -19995,7 +20262,7 @@ var Message = /*#__PURE__*/function () {
|
|
|
19995
20262
|
keys: this.accountKeys.map(function (key) {
|
|
19996
20263
|
return toBuffer(key.toBytes());
|
|
19997
20264
|
}),
|
|
19998
|
-
recentBlockhash: bs58$
|
|
20265
|
+
recentBlockhash: bs58$5.decode(this.recentBlockhash)
|
|
19999
20266
|
};
|
|
20000
20267
|
var signData = Buffer$1.alloc(2048);
|
|
20001
20268
|
var length = signDataLayout.encode(transaction, signData);
|
|
@@ -20021,7 +20288,7 @@ var Message = /*#__PURE__*/function () {
|
|
|
20021
20288
|
return {
|
|
20022
20289
|
programIdIndex: ix.programIdIndex,
|
|
20023
20290
|
accounts: ix.accountKeyIndexes,
|
|
20024
|
-
data: bs58$
|
|
20291
|
+
data: bs58$5.encode(ix.data)
|
|
20025
20292
|
};
|
|
20026
20293
|
});
|
|
20027
20294
|
return new Message({
|
|
@@ -20068,7 +20335,7 @@ var Message = /*#__PURE__*/function () {
|
|
|
20068
20335
|
byteArray = byteArray.slice(_accountCount);
|
|
20069
20336
|
var dataLength = decodeLength(byteArray);
|
|
20070
20337
|
var dataSlice = byteArray.slice(0, dataLength);
|
|
20071
|
-
var data = bs58$
|
|
20338
|
+
var data = bs58$5.encode(Buffer$1.from(dataSlice));
|
|
20072
20339
|
byteArray = byteArray.slice(dataLength);
|
|
20073
20340
|
instructions.push({
|
|
20074
20341
|
programIdIndex: programIdIndex,
|
|
@@ -20083,7 +20350,7 @@ var Message = /*#__PURE__*/function () {
|
|
|
20083
20350
|
numReadonlySignedAccounts: numReadonlySignedAccounts,
|
|
20084
20351
|
numReadonlyUnsignedAccounts: numReadonlyUnsignedAccounts
|
|
20085
20352
|
},
|
|
20086
|
-
recentBlockhash: bs58$
|
|
20353
|
+
recentBlockhash: bs58$5.encode(Buffer$1.from(recentBlockhash)),
|
|
20087
20354
|
accountKeys: accountKeys,
|
|
20088
20355
|
instructions: instructions
|
|
20089
20356
|
};
|
|
@@ -20279,7 +20546,7 @@ var MessageV0 = /*#__PURE__*/function () {
|
|
|
20279
20546
|
staticAccountKeys: this.staticAccountKeys.map(function (key) {
|
|
20280
20547
|
return key.toBytes();
|
|
20281
20548
|
}),
|
|
20282
|
-
recentBlockhash: bs58$
|
|
20549
|
+
recentBlockhash: bs58$5.decode(this.recentBlockhash),
|
|
20283
20550
|
instructionsLength: new Uint8Array(encodedInstructionsLength),
|
|
20284
20551
|
serializedInstructions: serializedInstructions,
|
|
20285
20552
|
addressTableLookupsLength: new Uint8Array(encodedAddressTableLookupsLength),
|
|
@@ -20431,7 +20698,7 @@ var MessageV0 = /*#__PURE__*/function () {
|
|
|
20431
20698
|
staticAccountKeys.push(new PublicKey$1(byteArray.splice(0, PUBLIC_KEY_LENGTH)));
|
|
20432
20699
|
}
|
|
20433
20700
|
|
|
20434
|
-
var recentBlockhash = bs58$
|
|
20701
|
+
var recentBlockhash = bs58$5.encode(byteArray.splice(0, PUBLIC_KEY_LENGTH));
|
|
20435
20702
|
var instructionCount = decodeLength(byteArray);
|
|
20436
20703
|
var compiledInstructions = [];
|
|
20437
20704
|
|
|
@@ -20903,7 +21170,7 @@ var Transaction$1 = /*#__PURE__*/function () {
|
|
|
20903
21170
|
accounts: instruction.keys.map(function (meta) {
|
|
20904
21171
|
return accountKeys.indexOf(meta.pubkey.toString());
|
|
20905
21172
|
}),
|
|
20906
|
-
data: bs58$
|
|
21173
|
+
data: bs58$5.encode(data)
|
|
20907
21174
|
};
|
|
20908
21175
|
});
|
|
20909
21176
|
compiledInstructions.forEach(function (instruction) {
|
|
@@ -21316,7 +21583,7 @@ var Transaction$1 = /*#__PURE__*/function () {
|
|
|
21316
21583
|
var _signature2 = byteArray.slice(0, SIGNATURE_LENGTH_IN_BYTES);
|
|
21317
21584
|
|
|
21318
21585
|
byteArray = byteArray.slice(SIGNATURE_LENGTH_IN_BYTES);
|
|
21319
|
-
signatures.push(bs58$
|
|
21586
|
+
signatures.push(bs58$5.encode(Buffer$1.from(_signature2)));
|
|
21320
21587
|
}
|
|
21321
21588
|
|
|
21322
21589
|
return Transaction.populate(Message.from(byteArray), signatures);
|
|
@@ -21338,7 +21605,7 @@ var Transaction$1 = /*#__PURE__*/function () {
|
|
|
21338
21605
|
|
|
21339
21606
|
signatures.forEach(function (signature, index) {
|
|
21340
21607
|
var sigPubkeyPair = {
|
|
21341
|
-
signature: signature == bs58$
|
|
21608
|
+
signature: signature == bs58$5.encode(DEFAULT_SIGNATURE) ? null : bs58$5.decode(signature),
|
|
21342
21609
|
publicKey: message.accountKeys[index]
|
|
21343
21610
|
};
|
|
21344
21611
|
transaction.signatures.push(sigPubkeyPair);
|
|
@@ -21357,7 +21624,7 @@ var Transaction$1 = /*#__PURE__*/function () {
|
|
|
21357
21624
|
transaction.instructions.push(new TransactionInstruction({
|
|
21358
21625
|
keys: keys,
|
|
21359
21626
|
programId: message.accountKeys[instruction.programIdIndex],
|
|
21360
|
-
data: bs58$
|
|
21627
|
+
data: bs58$5.decode(instruction.data)
|
|
21361
21628
|
}));
|
|
21362
21629
|
});
|
|
21363
21630
|
transaction._message = message;
|
|
@@ -23514,7 +23781,7 @@ function versionedMessageFromResponse(version, response) {
|
|
|
23514
23781
|
return {
|
|
23515
23782
|
programIdIndex: ix.programIdIndex,
|
|
23516
23783
|
accountKeyIndexes: ix.accounts,
|
|
23517
|
-
data: bs58$
|
|
23784
|
+
data: bs58$5.decode(ix.data)
|
|
23518
23785
|
};
|
|
23519
23786
|
}),
|
|
23520
23787
|
addressTableLookups: response.addressTableLookups
|
|
@@ -25800,7 +26067,7 @@ var Connection = /*#__PURE__*/function () {
|
|
|
25800
26067
|
|
|
25801
26068
|
case 8:
|
|
25802
26069
|
_context31.prev = 8;
|
|
25803
|
-
decodedSignature = bs58$
|
|
26070
|
+
decodedSignature = bs58$5.decode(rawSignature);
|
|
25804
26071
|
_context31.next = 15;
|
|
25805
26072
|
break;
|
|
25806
26073
|
|
|
@@ -34506,14 +34773,14 @@ var src = base;
|
|
|
34506
34773
|
|
|
34507
34774
|
var basex = src;
|
|
34508
34775
|
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
34509
|
-
var bs58$
|
|
34776
|
+
var bs58$2 = basex(ALPHABET);
|
|
34510
34777
|
|
|
34511
34778
|
Object.defineProperty(cjs$1, '__esModule', {
|
|
34512
34779
|
value: true
|
|
34513
34780
|
});
|
|
34514
34781
|
var web3_js = require$$1;
|
|
34515
34782
|
var mobileWalletAdapterProtocol = cjs;
|
|
34516
|
-
var bs58 = bs58$
|
|
34783
|
+
var bs58$1 = bs58$2;
|
|
34517
34784
|
|
|
34518
34785
|
function _interopDefaultLegacy(e) {
|
|
34519
34786
|
return e && _typeof$1(e) === 'object' && 'default' in e ? e : {
|
|
@@ -34521,7 +34788,7 @@ function _interopDefaultLegacy(e) {
|
|
|
34521
34788
|
};
|
|
34522
34789
|
}
|
|
34523
34790
|
|
|
34524
|
-
var bs58__default = /*#__PURE__*/_interopDefaultLegacy(bs58);
|
|
34791
|
+
var bs58__default = /*#__PURE__*/_interopDefaultLegacy(bs58$1);
|
|
34525
34792
|
/******************************************************************************
|
|
34526
34793
|
Copyright (c) Microsoft Corporation.
|
|
34527
34794
|
|
|
@@ -44590,6 +44857,7 @@ const submitSimpleTransfer$1 = async ({ transaction, wallet })=>{
|
|
|
44590
44857
|
};
|
|
44591
44858
|
|
|
44592
44859
|
function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
44860
|
+
|
|
44593
44861
|
const KEY = 'depay:wallets:wc2';
|
|
44594
44862
|
|
|
44595
44863
|
// configurations for wallets that require special handling
|
|
@@ -44910,6 +45178,15 @@ class WalletConnectV2 {
|
|
|
44910
45178
|
}
|
|
44911
45179
|
}
|
|
44912
45180
|
|
|
45181
|
+
async transactionCount({ blockchain, address }) {
|
|
45182
|
+
const smartContractWallet = await getSmartContractWallet(blockchain, address);
|
|
45183
|
+
if(smartContractWallet) {
|
|
45184
|
+
return await smartContractWallet.transactionCount()
|
|
45185
|
+
} else {
|
|
45186
|
+
return await request$1({ blockchain, method: 'transactionCount', address })
|
|
45187
|
+
}
|
|
45188
|
+
}
|
|
45189
|
+
|
|
44913
45190
|
async sign(message) {
|
|
44914
45191
|
if(typeof message === 'object') {
|
|
44915
45192
|
let account = await this.account();
|
package/dist/esm/index.js
CHANGED
|
@@ -1627,6 +1627,7 @@ const submitSimpleTransfer$1 = async ({ transaction, wallet })=>{
|
|
|
1627
1627
|
};
|
|
1628
1628
|
|
|
1629
1629
|
function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1630
|
+
|
|
1630
1631
|
const KEY = 'depay:wallets:wc2';
|
|
1631
1632
|
|
|
1632
1633
|
// configurations for wallets that require special handling
|
|
@@ -1947,6 +1948,15 @@ class WalletConnectV2 {
|
|
|
1947
1948
|
}
|
|
1948
1949
|
}
|
|
1949
1950
|
|
|
1951
|
+
async transactionCount({ blockchain, address }) {
|
|
1952
|
+
const smartContractWallet = await getSmartContractWallet(blockchain, address);
|
|
1953
|
+
if(smartContractWallet) {
|
|
1954
|
+
return await smartContractWallet.transactionCount()
|
|
1955
|
+
} else {
|
|
1956
|
+
return await request({ blockchain, method: 'transactionCount', address })
|
|
1957
|
+
}
|
|
1958
|
+
}
|
|
1959
|
+
|
|
1950
1960
|
async sign(message) {
|
|
1951
1961
|
if(typeof message === 'object') {
|
|
1952
1962
|
let account = await this.account();
|
package/dist/esm/index.solana.js
CHANGED
|
@@ -2463,6 +2463,7 @@ const submitSimpleTransfer$1 = async ({ transaction, wallet })=>{
|
|
|
2463
2463
|
};
|
|
2464
2464
|
|
|
2465
2465
|
function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2466
|
+
|
|
2466
2467
|
const KEY = 'depay:wallets:wc2';
|
|
2467
2468
|
|
|
2468
2469
|
// configurations for wallets that require special handling
|
|
@@ -2783,6 +2784,15 @@ class WalletConnectV2 {
|
|
|
2783
2784
|
}
|
|
2784
2785
|
}
|
|
2785
2786
|
|
|
2787
|
+
async transactionCount({ blockchain, address }) {
|
|
2788
|
+
const smartContractWallet = await getSmartContractWallet(blockchain, address);
|
|
2789
|
+
if(smartContractWallet) {
|
|
2790
|
+
return await smartContractWallet.transactionCount()
|
|
2791
|
+
} else {
|
|
2792
|
+
return await request$1({ blockchain, method: 'transactionCount', address })
|
|
2793
|
+
}
|
|
2794
|
+
}
|
|
2795
|
+
|
|
2786
2796
|
async sign(message) {
|
|
2787
2797
|
if(typeof message === 'object') {
|
|
2788
2798
|
let account = await this.account();
|
package/dist/umd/index.evm.js
CHANGED
|
@@ -8126,7 +8126,7 @@
|
|
|
8126
8126
|
|
|
8127
8127
|
var BN$1 = bn$1.exports;
|
|
8128
8128
|
|
|
8129
|
-
var safeBuffer = {exports: {}};
|
|
8129
|
+
var safeBuffer$1 = {exports: {}};
|
|
8130
8130
|
|
|
8131
8131
|
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
8132
8132
|
|
|
@@ -8200,7 +8200,7 @@
|
|
|
8200
8200
|
|
|
8201
8201
|
return buffer.SlowBuffer(size);
|
|
8202
8202
|
};
|
|
8203
|
-
})(safeBuffer, safeBuffer.exports);
|
|
8203
|
+
})(safeBuffer$1, safeBuffer$1.exports);
|
|
8204
8204
|
|
|
8205
8205
|
// Copyright (c) 2018 base-x contributors
|
|
8206
8206
|
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
@@ -8209,9 +8209,9 @@
|
|
|
8209
8209
|
// @ts-ignore
|
|
8210
8210
|
|
|
8211
8211
|
|
|
8212
|
-
var _Buffer = safeBuffer.exports.Buffer;
|
|
8212
|
+
var _Buffer$1 = safeBuffer$1.exports.Buffer;
|
|
8213
8213
|
|
|
8214
|
-
function base$
|
|
8214
|
+
function base$2(ALPHABET) {
|
|
8215
8215
|
if (ALPHABET.length >= 255) {
|
|
8216
8216
|
throw new TypeError('Alphabet too long');
|
|
8217
8217
|
}
|
|
@@ -8241,10 +8241,10 @@
|
|
|
8241
8241
|
|
|
8242
8242
|
function encode(source) {
|
|
8243
8243
|
if (Array.isArray(source) || source instanceof Uint8Array) {
|
|
8244
|
-
source = _Buffer.from(source);
|
|
8244
|
+
source = _Buffer$1.from(source);
|
|
8245
8245
|
}
|
|
8246
8246
|
|
|
8247
|
-
if (!_Buffer.isBuffer(source)) {
|
|
8247
|
+
if (!_Buffer$1.isBuffer(source)) {
|
|
8248
8248
|
throw new TypeError('Expected Buffer');
|
|
8249
8249
|
}
|
|
8250
8250
|
|
|
@@ -8309,7 +8309,7 @@
|
|
|
8309
8309
|
}
|
|
8310
8310
|
|
|
8311
8311
|
if (source.length === 0) {
|
|
8312
|
-
return _Buffer.alloc(0);
|
|
8312
|
+
return _Buffer$1.alloc(0);
|
|
8313
8313
|
}
|
|
8314
8314
|
|
|
8315
8315
|
var psz = 0; // Skip and count leading '1's.
|
|
@@ -8358,7 +8358,7 @@
|
|
|
8358
8358
|
it4++;
|
|
8359
8359
|
}
|
|
8360
8360
|
|
|
8361
|
-
var vch = _Buffer.allocUnsafe(zeroes + (size - it4));
|
|
8361
|
+
var vch = _Buffer$1.allocUnsafe(zeroes + (size - it4));
|
|
8362
8362
|
|
|
8363
8363
|
vch.fill(0x00, 0, zeroes);
|
|
8364
8364
|
var j = zeroes;
|
|
@@ -8387,12 +8387,12 @@
|
|
|
8387
8387
|
};
|
|
8388
8388
|
}
|
|
8389
8389
|
|
|
8390
|
-
var src$
|
|
8390
|
+
var src$2 = base$2;
|
|
8391
8391
|
|
|
8392
|
-
var basex$
|
|
8393
|
-
var ALPHABET$
|
|
8394
|
-
var bs58$
|
|
8395
|
-
var bs58$
|
|
8392
|
+
var basex$2 = src$2;
|
|
8393
|
+
var ALPHABET$2 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
8394
|
+
var bs58$4 = basex$2(ALPHABET$2);
|
|
8395
|
+
var bs58$5 = bs58$4;
|
|
8396
8396
|
|
|
8397
8397
|
var Chi = function Chi(a, b, c) {
|
|
8398
8398
|
return a & b ^ ~a & c;
|
|
@@ -8571,6 +8571,273 @@
|
|
|
8571
8571
|
|
|
8572
8572
|
var lib$1 = {};
|
|
8573
8573
|
|
|
8574
|
+
var safeBuffer = {exports: {}};
|
|
8575
|
+
|
|
8576
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
8577
|
+
|
|
8578
|
+
(function (module, exports) {
|
|
8579
|
+
/* eslint-disable node/no-deprecated-api */
|
|
8580
|
+
var buffer = require$$1$1;
|
|
8581
|
+
var Buffer = buffer.Buffer; // alternative to using Object.keys for old browsers
|
|
8582
|
+
|
|
8583
|
+
function copyProps(src, dst) {
|
|
8584
|
+
for (var key in src) {
|
|
8585
|
+
dst[key] = src[key];
|
|
8586
|
+
}
|
|
8587
|
+
}
|
|
8588
|
+
|
|
8589
|
+
if (Buffer.from && Buffer.alloc && Buffer.allocUnsafe && Buffer.allocUnsafeSlow) {
|
|
8590
|
+
module.exports = buffer;
|
|
8591
|
+
} else {
|
|
8592
|
+
// Copy properties from require('buffer')
|
|
8593
|
+
copyProps(buffer, exports);
|
|
8594
|
+
exports.Buffer = SafeBuffer;
|
|
8595
|
+
}
|
|
8596
|
+
|
|
8597
|
+
function SafeBuffer(arg, encodingOrOffset, length) {
|
|
8598
|
+
return Buffer(arg, encodingOrOffset, length);
|
|
8599
|
+
}
|
|
8600
|
+
|
|
8601
|
+
SafeBuffer.prototype = Object.create(Buffer.prototype); // Copy static methods from Buffer
|
|
8602
|
+
|
|
8603
|
+
copyProps(Buffer, SafeBuffer);
|
|
8604
|
+
|
|
8605
|
+
SafeBuffer.from = function (arg, encodingOrOffset, length) {
|
|
8606
|
+
if (typeof arg === 'number') {
|
|
8607
|
+
throw new TypeError('Argument must not be a number');
|
|
8608
|
+
}
|
|
8609
|
+
|
|
8610
|
+
return Buffer(arg, encodingOrOffset, length);
|
|
8611
|
+
};
|
|
8612
|
+
|
|
8613
|
+
SafeBuffer.alloc = function (size, fill, encoding) {
|
|
8614
|
+
if (typeof size !== 'number') {
|
|
8615
|
+
throw new TypeError('Argument must be a number');
|
|
8616
|
+
}
|
|
8617
|
+
|
|
8618
|
+
var buf = Buffer(size);
|
|
8619
|
+
|
|
8620
|
+
if (fill !== undefined) {
|
|
8621
|
+
if (typeof encoding === 'string') {
|
|
8622
|
+
buf.fill(fill, encoding);
|
|
8623
|
+
} else {
|
|
8624
|
+
buf.fill(fill);
|
|
8625
|
+
}
|
|
8626
|
+
} else {
|
|
8627
|
+
buf.fill(0);
|
|
8628
|
+
}
|
|
8629
|
+
|
|
8630
|
+
return buf;
|
|
8631
|
+
};
|
|
8632
|
+
|
|
8633
|
+
SafeBuffer.allocUnsafe = function (size) {
|
|
8634
|
+
if (typeof size !== 'number') {
|
|
8635
|
+
throw new TypeError('Argument must be a number');
|
|
8636
|
+
}
|
|
8637
|
+
|
|
8638
|
+
return Buffer(size);
|
|
8639
|
+
};
|
|
8640
|
+
|
|
8641
|
+
SafeBuffer.allocUnsafeSlow = function (size) {
|
|
8642
|
+
if (typeof size !== 'number') {
|
|
8643
|
+
throw new TypeError('Argument must be a number');
|
|
8644
|
+
}
|
|
8645
|
+
|
|
8646
|
+
return buffer.SlowBuffer(size);
|
|
8647
|
+
};
|
|
8648
|
+
})(safeBuffer, safeBuffer.exports);
|
|
8649
|
+
|
|
8650
|
+
// Copyright (c) 2018 base-x contributors
|
|
8651
|
+
// Copyright (c) 2014-2018 The Bitcoin Core developers (base58.cpp)
|
|
8652
|
+
// Distributed under the MIT software license, see the accompanying
|
|
8653
|
+
// file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|
8654
|
+
// @ts-ignore
|
|
8655
|
+
|
|
8656
|
+
|
|
8657
|
+
var _Buffer = safeBuffer.exports.Buffer;
|
|
8658
|
+
|
|
8659
|
+
function base$1(ALPHABET) {
|
|
8660
|
+
if (ALPHABET.length >= 255) {
|
|
8661
|
+
throw new TypeError('Alphabet too long');
|
|
8662
|
+
}
|
|
8663
|
+
|
|
8664
|
+
var BASE_MAP = new Uint8Array(256);
|
|
8665
|
+
|
|
8666
|
+
for (var j = 0; j < BASE_MAP.length; j++) {
|
|
8667
|
+
BASE_MAP[j] = 255;
|
|
8668
|
+
}
|
|
8669
|
+
|
|
8670
|
+
for (var i = 0; i < ALPHABET.length; i++) {
|
|
8671
|
+
var x = ALPHABET.charAt(i);
|
|
8672
|
+
var xc = x.charCodeAt(0);
|
|
8673
|
+
|
|
8674
|
+
if (BASE_MAP[xc] !== 255) {
|
|
8675
|
+
throw new TypeError(x + ' is ambiguous');
|
|
8676
|
+
}
|
|
8677
|
+
|
|
8678
|
+
BASE_MAP[xc] = i;
|
|
8679
|
+
}
|
|
8680
|
+
|
|
8681
|
+
var BASE = ALPHABET.length;
|
|
8682
|
+
var LEADER = ALPHABET.charAt(0);
|
|
8683
|
+
var FACTOR = Math.log(BASE) / Math.log(256); // log(BASE) / log(256), rounded up
|
|
8684
|
+
|
|
8685
|
+
var iFACTOR = Math.log(256) / Math.log(BASE); // log(256) / log(BASE), rounded up
|
|
8686
|
+
|
|
8687
|
+
function encode(source) {
|
|
8688
|
+
if (Array.isArray(source) || source instanceof Uint8Array) {
|
|
8689
|
+
source = _Buffer.from(source);
|
|
8690
|
+
}
|
|
8691
|
+
|
|
8692
|
+
if (!_Buffer.isBuffer(source)) {
|
|
8693
|
+
throw new TypeError('Expected Buffer');
|
|
8694
|
+
}
|
|
8695
|
+
|
|
8696
|
+
if (source.length === 0) {
|
|
8697
|
+
return '';
|
|
8698
|
+
} // Skip & count leading zeroes.
|
|
8699
|
+
|
|
8700
|
+
|
|
8701
|
+
var zeroes = 0;
|
|
8702
|
+
var length = 0;
|
|
8703
|
+
var pbegin = 0;
|
|
8704
|
+
var pend = source.length;
|
|
8705
|
+
|
|
8706
|
+
while (pbegin !== pend && source[pbegin] === 0) {
|
|
8707
|
+
pbegin++;
|
|
8708
|
+
zeroes++;
|
|
8709
|
+
} // Allocate enough space in big-endian base58 representation.
|
|
8710
|
+
|
|
8711
|
+
|
|
8712
|
+
var size = (pend - pbegin) * iFACTOR + 1 >>> 0;
|
|
8713
|
+
var b58 = new Uint8Array(size); // Process the bytes.
|
|
8714
|
+
|
|
8715
|
+
while (pbegin !== pend) {
|
|
8716
|
+
var carry = source[pbegin]; // Apply "b58 = b58 * 256 + ch".
|
|
8717
|
+
|
|
8718
|
+
var i = 0;
|
|
8719
|
+
|
|
8720
|
+
for (var it1 = size - 1; (carry !== 0 || i < length) && it1 !== -1; it1--, i++) {
|
|
8721
|
+
carry += 256 * b58[it1] >>> 0;
|
|
8722
|
+
b58[it1] = carry % BASE >>> 0;
|
|
8723
|
+
carry = carry / BASE >>> 0;
|
|
8724
|
+
}
|
|
8725
|
+
|
|
8726
|
+
if (carry !== 0) {
|
|
8727
|
+
throw new Error('Non-zero carry');
|
|
8728
|
+
}
|
|
8729
|
+
|
|
8730
|
+
length = i;
|
|
8731
|
+
pbegin++;
|
|
8732
|
+
} // Skip leading zeroes in base58 result.
|
|
8733
|
+
|
|
8734
|
+
|
|
8735
|
+
var it2 = size - length;
|
|
8736
|
+
|
|
8737
|
+
while (it2 !== size && b58[it2] === 0) {
|
|
8738
|
+
it2++;
|
|
8739
|
+
} // Translate the result into a string.
|
|
8740
|
+
|
|
8741
|
+
|
|
8742
|
+
var str = LEADER.repeat(zeroes);
|
|
8743
|
+
|
|
8744
|
+
for (; it2 < size; ++it2) {
|
|
8745
|
+
str += ALPHABET.charAt(b58[it2]);
|
|
8746
|
+
}
|
|
8747
|
+
|
|
8748
|
+
return str;
|
|
8749
|
+
}
|
|
8750
|
+
|
|
8751
|
+
function decodeUnsafe(source) {
|
|
8752
|
+
if (typeof source !== 'string') {
|
|
8753
|
+
throw new TypeError('Expected String');
|
|
8754
|
+
}
|
|
8755
|
+
|
|
8756
|
+
if (source.length === 0) {
|
|
8757
|
+
return _Buffer.alloc(0);
|
|
8758
|
+
}
|
|
8759
|
+
|
|
8760
|
+
var psz = 0; // Skip and count leading '1's.
|
|
8761
|
+
|
|
8762
|
+
var zeroes = 0;
|
|
8763
|
+
var length = 0;
|
|
8764
|
+
|
|
8765
|
+
while (source[psz] === LEADER) {
|
|
8766
|
+
zeroes++;
|
|
8767
|
+
psz++;
|
|
8768
|
+
} // Allocate enough space in big-endian base256 representation.
|
|
8769
|
+
|
|
8770
|
+
|
|
8771
|
+
var size = (source.length - psz) * FACTOR + 1 >>> 0; // log(58) / log(256), rounded up.
|
|
8772
|
+
|
|
8773
|
+
var b256 = new Uint8Array(size); // Process the characters.
|
|
8774
|
+
|
|
8775
|
+
while (source[psz]) {
|
|
8776
|
+
// Decode character
|
|
8777
|
+
var carry = BASE_MAP[source.charCodeAt(psz)]; // Invalid character
|
|
8778
|
+
|
|
8779
|
+
if (carry === 255) {
|
|
8780
|
+
return;
|
|
8781
|
+
}
|
|
8782
|
+
|
|
8783
|
+
var i = 0;
|
|
8784
|
+
|
|
8785
|
+
for (var it3 = size - 1; (carry !== 0 || i < length) && it3 !== -1; it3--, i++) {
|
|
8786
|
+
carry += BASE * b256[it3] >>> 0;
|
|
8787
|
+
b256[it3] = carry % 256 >>> 0;
|
|
8788
|
+
carry = carry / 256 >>> 0;
|
|
8789
|
+
}
|
|
8790
|
+
|
|
8791
|
+
if (carry !== 0) {
|
|
8792
|
+
throw new Error('Non-zero carry');
|
|
8793
|
+
}
|
|
8794
|
+
|
|
8795
|
+
length = i;
|
|
8796
|
+
psz++;
|
|
8797
|
+
} // Skip leading zeroes in b256.
|
|
8798
|
+
|
|
8799
|
+
|
|
8800
|
+
var it4 = size - length;
|
|
8801
|
+
|
|
8802
|
+
while (it4 !== size && b256[it4] === 0) {
|
|
8803
|
+
it4++;
|
|
8804
|
+
}
|
|
8805
|
+
|
|
8806
|
+
var vch = _Buffer.allocUnsafe(zeroes + (size - it4));
|
|
8807
|
+
|
|
8808
|
+
vch.fill(0x00, 0, zeroes);
|
|
8809
|
+
var j = zeroes;
|
|
8810
|
+
|
|
8811
|
+
while (it4 !== size) {
|
|
8812
|
+
vch[j++] = b256[it4++];
|
|
8813
|
+
}
|
|
8814
|
+
|
|
8815
|
+
return vch;
|
|
8816
|
+
}
|
|
8817
|
+
|
|
8818
|
+
function decode(string) {
|
|
8819
|
+
var buffer = decodeUnsafe(string);
|
|
8820
|
+
|
|
8821
|
+
if (buffer) {
|
|
8822
|
+
return buffer;
|
|
8823
|
+
}
|
|
8824
|
+
|
|
8825
|
+
throw new Error('Non-base' + BASE + ' character');
|
|
8826
|
+
}
|
|
8827
|
+
|
|
8828
|
+
return {
|
|
8829
|
+
encode: encode,
|
|
8830
|
+
decodeUnsafe: decodeUnsafe,
|
|
8831
|
+
decode: decode
|
|
8832
|
+
};
|
|
8833
|
+
}
|
|
8834
|
+
|
|
8835
|
+
var src$1 = base$1;
|
|
8836
|
+
|
|
8837
|
+
var basex$1 = src$1;
|
|
8838
|
+
var ALPHABET$1 = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
8839
|
+
var bs58$3 = basex$1(ALPHABET$1);
|
|
8840
|
+
|
|
8574
8841
|
function inRange(a, min, max) {
|
|
8575
8842
|
return min <= a && a <= max;
|
|
8576
8843
|
}
|
|
@@ -9227,7 +9494,7 @@
|
|
|
9227
9494
|
|
|
9228
9495
|
var bn_js_1 = __importDefault(bn$1.exports);
|
|
9229
9496
|
|
|
9230
|
-
var bs58_1 = __importDefault(bs58$
|
|
9497
|
+
var bs58_1 = __importDefault(bs58$3); // TODO: Make sure this polyfill not included when not required
|
|
9231
9498
|
|
|
9232
9499
|
|
|
9233
9500
|
var encoding = __importStar(require$$2);
|
|
@@ -18974,7 +19241,7 @@
|
|
|
18974
19241
|
} else {
|
|
18975
19242
|
if (typeof value === 'string') {
|
|
18976
19243
|
// assume base 58 encoding by default
|
|
18977
|
-
var decoded = bs58$
|
|
19244
|
+
var decoded = bs58$5.decode(value);
|
|
18978
19245
|
|
|
18979
19246
|
if (decoded.length != PUBLIC_KEY_LENGTH) {
|
|
18980
19247
|
throw new Error("Invalid public key input");
|
|
@@ -19018,7 +19285,7 @@
|
|
|
19018
19285
|
}, {
|
|
19019
19286
|
key: "toBase58",
|
|
19020
19287
|
value: function toBase58() {
|
|
19021
|
-
return bs58$
|
|
19288
|
+
return bs58$5.encode(this.toBytes());
|
|
19022
19289
|
}
|
|
19023
19290
|
}, {
|
|
19024
19291
|
key: "toJSON",
|
|
@@ -19903,7 +20170,7 @@
|
|
|
19903
20170
|
return {
|
|
19904
20171
|
programIdIndex: ix.programIdIndex,
|
|
19905
20172
|
accountKeyIndexes: ix.accounts,
|
|
19906
|
-
data: bs58$
|
|
20173
|
+
data: bs58$5.decode(ix.data)
|
|
19907
20174
|
};
|
|
19908
20175
|
});
|
|
19909
20176
|
}
|
|
@@ -19965,7 +20232,7 @@
|
|
|
19965
20232
|
var instructions = this.instructions.map(function (instruction) {
|
|
19966
20233
|
var accounts = instruction.accounts,
|
|
19967
20234
|
programIdIndex = instruction.programIdIndex;
|
|
19968
|
-
var data = Array.from(bs58$
|
|
20235
|
+
var data = Array.from(bs58$5.decode(instruction.data));
|
|
19969
20236
|
var keyIndicesCount = [];
|
|
19970
20237
|
encodeLength(keyIndicesCount, accounts.length);
|
|
19971
20238
|
var dataCount = [];
|
|
@@ -19998,7 +20265,7 @@
|
|
|
19998
20265
|
keys: this.accountKeys.map(function (key) {
|
|
19999
20266
|
return toBuffer(key.toBytes());
|
|
20000
20267
|
}),
|
|
20001
|
-
recentBlockhash: bs58$
|
|
20268
|
+
recentBlockhash: bs58$5.decode(this.recentBlockhash)
|
|
20002
20269
|
};
|
|
20003
20270
|
var signData = Buffer$1.alloc(2048);
|
|
20004
20271
|
var length = signDataLayout.encode(transaction, signData);
|
|
@@ -20024,7 +20291,7 @@
|
|
|
20024
20291
|
return {
|
|
20025
20292
|
programIdIndex: ix.programIdIndex,
|
|
20026
20293
|
accounts: ix.accountKeyIndexes,
|
|
20027
|
-
data: bs58$
|
|
20294
|
+
data: bs58$5.encode(ix.data)
|
|
20028
20295
|
};
|
|
20029
20296
|
});
|
|
20030
20297
|
return new Message({
|
|
@@ -20071,7 +20338,7 @@
|
|
|
20071
20338
|
byteArray = byteArray.slice(_accountCount);
|
|
20072
20339
|
var dataLength = decodeLength(byteArray);
|
|
20073
20340
|
var dataSlice = byteArray.slice(0, dataLength);
|
|
20074
|
-
var data = bs58$
|
|
20341
|
+
var data = bs58$5.encode(Buffer$1.from(dataSlice));
|
|
20075
20342
|
byteArray = byteArray.slice(dataLength);
|
|
20076
20343
|
instructions.push({
|
|
20077
20344
|
programIdIndex: programIdIndex,
|
|
@@ -20086,7 +20353,7 @@
|
|
|
20086
20353
|
numReadonlySignedAccounts: numReadonlySignedAccounts,
|
|
20087
20354
|
numReadonlyUnsignedAccounts: numReadonlyUnsignedAccounts
|
|
20088
20355
|
},
|
|
20089
|
-
recentBlockhash: bs58$
|
|
20356
|
+
recentBlockhash: bs58$5.encode(Buffer$1.from(recentBlockhash)),
|
|
20090
20357
|
accountKeys: accountKeys,
|
|
20091
20358
|
instructions: instructions
|
|
20092
20359
|
};
|
|
@@ -20282,7 +20549,7 @@
|
|
|
20282
20549
|
staticAccountKeys: this.staticAccountKeys.map(function (key) {
|
|
20283
20550
|
return key.toBytes();
|
|
20284
20551
|
}),
|
|
20285
|
-
recentBlockhash: bs58$
|
|
20552
|
+
recentBlockhash: bs58$5.decode(this.recentBlockhash),
|
|
20286
20553
|
instructionsLength: new Uint8Array(encodedInstructionsLength),
|
|
20287
20554
|
serializedInstructions: serializedInstructions,
|
|
20288
20555
|
addressTableLookupsLength: new Uint8Array(encodedAddressTableLookupsLength),
|
|
@@ -20434,7 +20701,7 @@
|
|
|
20434
20701
|
staticAccountKeys.push(new PublicKey$1(byteArray.splice(0, PUBLIC_KEY_LENGTH)));
|
|
20435
20702
|
}
|
|
20436
20703
|
|
|
20437
|
-
var recentBlockhash = bs58$
|
|
20704
|
+
var recentBlockhash = bs58$5.encode(byteArray.splice(0, PUBLIC_KEY_LENGTH));
|
|
20438
20705
|
var instructionCount = decodeLength(byteArray);
|
|
20439
20706
|
var compiledInstructions = [];
|
|
20440
20707
|
|
|
@@ -20906,7 +21173,7 @@
|
|
|
20906
21173
|
accounts: instruction.keys.map(function (meta) {
|
|
20907
21174
|
return accountKeys.indexOf(meta.pubkey.toString());
|
|
20908
21175
|
}),
|
|
20909
|
-
data: bs58$
|
|
21176
|
+
data: bs58$5.encode(data)
|
|
20910
21177
|
};
|
|
20911
21178
|
});
|
|
20912
21179
|
compiledInstructions.forEach(function (instruction) {
|
|
@@ -21319,7 +21586,7 @@
|
|
|
21319
21586
|
var _signature2 = byteArray.slice(0, SIGNATURE_LENGTH_IN_BYTES);
|
|
21320
21587
|
|
|
21321
21588
|
byteArray = byteArray.slice(SIGNATURE_LENGTH_IN_BYTES);
|
|
21322
|
-
signatures.push(bs58$
|
|
21589
|
+
signatures.push(bs58$5.encode(Buffer$1.from(_signature2)));
|
|
21323
21590
|
}
|
|
21324
21591
|
|
|
21325
21592
|
return Transaction.populate(Message.from(byteArray), signatures);
|
|
@@ -21341,7 +21608,7 @@
|
|
|
21341
21608
|
|
|
21342
21609
|
signatures.forEach(function (signature, index) {
|
|
21343
21610
|
var sigPubkeyPair = {
|
|
21344
|
-
signature: signature == bs58$
|
|
21611
|
+
signature: signature == bs58$5.encode(DEFAULT_SIGNATURE) ? null : bs58$5.decode(signature),
|
|
21345
21612
|
publicKey: message.accountKeys[index]
|
|
21346
21613
|
};
|
|
21347
21614
|
transaction.signatures.push(sigPubkeyPair);
|
|
@@ -21360,7 +21627,7 @@
|
|
|
21360
21627
|
transaction.instructions.push(new TransactionInstruction({
|
|
21361
21628
|
keys: keys,
|
|
21362
21629
|
programId: message.accountKeys[instruction.programIdIndex],
|
|
21363
|
-
data: bs58$
|
|
21630
|
+
data: bs58$5.decode(instruction.data)
|
|
21364
21631
|
}));
|
|
21365
21632
|
});
|
|
21366
21633
|
transaction._message = message;
|
|
@@ -23517,7 +23784,7 @@
|
|
|
23517
23784
|
return {
|
|
23518
23785
|
programIdIndex: ix.programIdIndex,
|
|
23519
23786
|
accountKeyIndexes: ix.accounts,
|
|
23520
|
-
data: bs58$
|
|
23787
|
+
data: bs58$5.decode(ix.data)
|
|
23521
23788
|
};
|
|
23522
23789
|
}),
|
|
23523
23790
|
addressTableLookups: response.addressTableLookups
|
|
@@ -25803,7 +26070,7 @@
|
|
|
25803
26070
|
|
|
25804
26071
|
case 8:
|
|
25805
26072
|
_context31.prev = 8;
|
|
25806
|
-
decodedSignature = bs58$
|
|
26073
|
+
decodedSignature = bs58$5.decode(rawSignature);
|
|
25807
26074
|
_context31.next = 15;
|
|
25808
26075
|
break;
|
|
25809
26076
|
|
|
@@ -34509,14 +34776,14 @@
|
|
|
34509
34776
|
|
|
34510
34777
|
var basex = src;
|
|
34511
34778
|
var ALPHABET = '123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz';
|
|
34512
|
-
var bs58$
|
|
34779
|
+
var bs58$2 = basex(ALPHABET);
|
|
34513
34780
|
|
|
34514
34781
|
Object.defineProperty(cjs$1, '__esModule', {
|
|
34515
34782
|
value: true
|
|
34516
34783
|
});
|
|
34517
34784
|
var web3_js = require$$1;
|
|
34518
34785
|
var mobileWalletAdapterProtocol = cjs;
|
|
34519
|
-
var bs58 = bs58$
|
|
34786
|
+
var bs58$1 = bs58$2;
|
|
34520
34787
|
|
|
34521
34788
|
function _interopDefaultLegacy$1(e) {
|
|
34522
34789
|
return e && _typeof$1(e) === 'object' && 'default' in e ? e : {
|
|
@@ -34524,7 +34791,7 @@
|
|
|
34524
34791
|
};
|
|
34525
34792
|
}
|
|
34526
34793
|
|
|
34527
|
-
var bs58__default = /*#__PURE__*/_interopDefaultLegacy$1(bs58);
|
|
34794
|
+
var bs58__default = /*#__PURE__*/_interopDefaultLegacy$1(bs58$1);
|
|
34528
34795
|
/******************************************************************************
|
|
34529
34796
|
Copyright (c) Microsoft Corporation.
|
|
34530
34797
|
|
|
@@ -44593,6 +44860,7 @@
|
|
|
44593
44860
|
};
|
|
44594
44861
|
|
|
44595
44862
|
function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
44863
|
+
|
|
44596
44864
|
const KEY = 'depay:wallets:wc2';
|
|
44597
44865
|
|
|
44598
44866
|
// configurations for wallets that require special handling
|
|
@@ -44913,6 +45181,15 @@
|
|
|
44913
45181
|
}
|
|
44914
45182
|
}
|
|
44915
45183
|
|
|
45184
|
+
async transactionCount({ blockchain, address }) {
|
|
45185
|
+
const smartContractWallet = await getSmartContractWallet(blockchain, address);
|
|
45186
|
+
if(smartContractWallet) {
|
|
45187
|
+
return await smartContractWallet.transactionCount()
|
|
45188
|
+
} else {
|
|
45189
|
+
return await web3ClientEvm.request({ blockchain, method: 'transactionCount', address })
|
|
45190
|
+
}
|
|
45191
|
+
}
|
|
45192
|
+
|
|
44916
45193
|
async sign(message) {
|
|
44917
45194
|
if(typeof message === 'object') {
|
|
44918
45195
|
let account = await this.account();
|
package/dist/umd/index.js
CHANGED
|
@@ -1629,6 +1629,7 @@
|
|
|
1629
1629
|
};
|
|
1630
1630
|
|
|
1631
1631
|
function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
1632
|
+
|
|
1632
1633
|
const KEY = 'depay:wallets:wc2';
|
|
1633
1634
|
|
|
1634
1635
|
// configurations for wallets that require special handling
|
|
@@ -1949,6 +1950,15 @@
|
|
|
1949
1950
|
}
|
|
1950
1951
|
}
|
|
1951
1952
|
|
|
1953
|
+
async transactionCount({ blockchain, address }) {
|
|
1954
|
+
const smartContractWallet = await getSmartContractWallet(blockchain, address);
|
|
1955
|
+
if(smartContractWallet) {
|
|
1956
|
+
return await smartContractWallet.transactionCount()
|
|
1957
|
+
} else {
|
|
1958
|
+
return await web3Client.request({ blockchain, method: 'transactionCount', address })
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
|
|
1952
1962
|
async sign(message) {
|
|
1953
1963
|
if(typeof message === 'object') {
|
|
1954
1964
|
let account = await this.account();
|
package/dist/umd/index.solana.js
CHANGED
|
@@ -2465,6 +2465,7 @@
|
|
|
2465
2465
|
};
|
|
2466
2466
|
|
|
2467
2467
|
function _optionalChain$1(ops) { let lastAccessLHS = undefined; let value = ops[0]; let i = 1; while (i < ops.length) { const op = ops[i]; const fn = ops[i + 1]; i += 2; if ((op === 'optionalAccess' || op === 'optionalCall') && value == null) { return undefined; } if (op === 'access' || op === 'optionalAccess') { lastAccessLHS = value; value = fn(value); } else if (op === 'call' || op === 'optionalCall') { value = fn((...args) => value.call(lastAccessLHS, ...args)); lastAccessLHS = undefined; } } return value; }
|
|
2468
|
+
|
|
2468
2469
|
const KEY = 'depay:wallets:wc2';
|
|
2469
2470
|
|
|
2470
2471
|
// configurations for wallets that require special handling
|
|
@@ -2785,6 +2786,15 @@
|
|
|
2785
2786
|
}
|
|
2786
2787
|
}
|
|
2787
2788
|
|
|
2789
|
+
async transactionCount({ blockchain, address }) {
|
|
2790
|
+
const smartContractWallet = await getSmartContractWallet(blockchain, address);
|
|
2791
|
+
if(smartContractWallet) {
|
|
2792
|
+
return await smartContractWallet.transactionCount()
|
|
2793
|
+
} else {
|
|
2794
|
+
return await web3ClientSolana.request({ blockchain, method: 'transactionCount', address })
|
|
2795
|
+
}
|
|
2796
|
+
}
|
|
2797
|
+
|
|
2788
2798
|
async sign(message) {
|
|
2789
2799
|
if(typeof message === 'object') {
|
|
2790
2800
|
let account = await this.account();
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@depay/web3-wallets-evm",
|
|
3
3
|
"moduleName": "Web3Wallets",
|
|
4
|
-
"version": "16.0
|
|
4
|
+
"version": "16.1.0",
|
|
5
5
|
"description": "One-Stop-Shop JavaScript library to integrate various web3 crypto wallets and multiple blockchains at once with a single interface.",
|
|
6
6
|
"main": "dist/umd/index.evm.js",
|
|
7
7
|
"module": "dist/esm/index.evm.js",
|
|
@@ -26,9 +26,9 @@
|
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"@depay/coinbase-wallet-sdk": "3.6.4",
|
|
28
28
|
"@depay/walletconnect-v1": "^1.8.0",
|
|
29
|
-
"@depay/walletconnect-v2": "^2.
|
|
30
|
-
"@depay/web3-blockchains": "^
|
|
31
|
-
"@depay/web3-client-evm": "^10.
|
|
29
|
+
"@depay/walletconnect-v2": "^2.9.2",
|
|
30
|
+
"@depay/web3-blockchains": "^9.0.2",
|
|
31
|
+
"@depay/web3-client-evm": "^10.17.0",
|
|
32
32
|
"ethers": "^5.7.1"
|
|
33
33
|
},
|
|
34
34
|
"engines": {
|