@airgap/coinlib-core 0.13.45-beta.3 → 0.13.45-beta.4
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/actions/Action.js +83 -30
- package/actions/Action.js.map +1 -1
- package/actions/LinkedAction.js +82 -18
- package/actions/LinkedAction.js.map +1 -1
- package/actions/RepeatableAction.js +83 -20
- package/actions/RepeatableAction.js.map +1 -1
- package/actions/SimpleAction.js +74 -12
- package/actions/SimpleAction.js.map +1 -1
- package/actions/StateMachine.js +17 -16
- package/actions/StateMachine.js.map +1 -1
- package/data/KeyPair.d.ts +1 -0
- package/data/Lazy.js +64 -15
- package/data/Lazy.js.map +1 -1
- package/data/RPCBody.js +6 -3
- package/data/RPCBody.js.map +1 -1
- package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.d.ts +12 -12
- package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.js +130 -88
- package/dependencies/src/@stablelib/binary-1.0.1/packages/binary/binary.js.map +1 -1
- package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.d.ts +3 -3
- package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.js +61 -57
- package/dependencies/src/@stablelib/blake2b-1.0.1/packages/blake2b/blake2b.js.map +1 -1
- package/dependencies/src/@stablelib/ed25519-1.0.3/packages/ed25519/ed25519.js +96 -96
- package/dependencies/src/@stablelib/ed25519-1.0.3/packages/ed25519/ed25519.js.map +1 -1
- package/dependencies/src/@stablelib/hash-1.0.1/packages/hash/hash.js +2 -1
- package/dependencies/src/@stablelib/hash-1.0.1/packages/hash/hash.js.map +1 -1
- package/dependencies/src/@stablelib/int-1.0.1/packages/int/int.js +10 -8
- package/dependencies/src/@stablelib/int-1.0.1/packages/int/int.js.map +1 -1
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/random.js +28 -22
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/random.js.map +1 -1
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/browser.js +10 -9
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/browser.js.map +1 -1
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/node.js +11 -10
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/node.js.map +1 -1
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/system.js +8 -7
- package/dependencies/src/@stablelib/random-1.0.2/packages/random/source/system.js.map +1 -1
- package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.d.ts +3 -3
- package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.js +63 -61
- package/dependencies/src/@stablelib/sha512/packages/sha512/sha512.js.map +1 -1
- package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.d.ts +4 -4
- package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.js +63 -61
- package/dependencies/src/@stablelib/sha512-1.0.1/packages/sha512/sha512.js.map +1 -1
- package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.d.ts +1 -1
- package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.js +3 -2
- package/dependencies/src/@stablelib/wipe-1.0.1/packages/wipe/wipe.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/codec.js +111 -111
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/codec.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/constants.js +15 -15
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/constants.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.js +76 -47
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/decoder.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.js +61 -46
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/encoder.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/error.js +106 -61
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/error.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/interface.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.d.ts +6 -6
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.js +100 -95
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/michelson/codec.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/codec-proto14.js +33 -33
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/codec-proto14.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/constants-proto14.js +9 -9
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/constants-proto14.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.js +75 -46
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/decoder-proto14.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.js +70 -45
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/encoder-proto14.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/michelson/codec-proto14.js +41 -41
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/proto14-kathmandu/michelson/codec-proto14.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/protocols.js +4 -4
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/protocols.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.d.ts +2 -2
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.js +63 -58
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/schema/operation.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging.js +33 -30
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/taquito-local-forging.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/uint8array-consumer.js +20 -18
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/uint8array-consumer.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.d.ts +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.js +12 -5
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/utils.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/validator.js +13 -13
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-local-forging/src/validator.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/opkind.js +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/opkind.js.map +1 -1
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.d.ts +78 -78
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.js +2 -2
- package/dependencies/src/@taquito/local-forging-15.0.1/packages/taquito-rpc/src/types.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.d.ts +45 -45
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.js +76 -75
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/constants.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/errors.js +178 -115
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/errors.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.d.ts +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.js +9 -6
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/format.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/taquito-utils.js +83 -78
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/taquito-utils.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/validators.js +36 -27
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/validators.js.map +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.d.ts +1 -1
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.js +26 -25
- package/dependencies/src/@taquito/utils-15.0.1/packages/taquito-utils/src/verify-signature.js.map +1 -1
- package/dependencies/src/cosmjs/index.d.ts +230 -14
- package/dependencies/src/cosmjs/index.js +480 -373
- package/dependencies/src/cosmjs/index.js.map +1 -1
- package/dependencies/src/eciesjs-0.3.9/src/index.d.ts +1 -0
- package/dependencies/src/eciesjs-0.3.9/src/index.js +19 -15
- package/dependencies/src/eciesjs-0.3.9/src/index.js.map +1 -1
- package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.d.ts +1 -0
- package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.js +28 -37
- package/dependencies/src/eciesjs-0.3.9/src/keys/PrivateKey.js.map +1 -1
- package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.d.ts +1 -0
- package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.js +30 -38
- package/dependencies/src/eciesjs-0.3.9/src/keys/PublicKey.js.map +1 -1
- package/dependencies/src/eciesjs-0.3.9/src/utils.d.ts +1 -0
- package/dependencies/src/eciesjs-0.3.9/src/utils.js +24 -33
- package/dependencies/src/eciesjs-0.3.9/src/utils.js.map +1 -1
- package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js +34 -42
- package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js.map +1 -1
- package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js +10 -6
- package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js.map +1 -1
- package/errors/coinlib-error.d.ts +2 -1
- package/errors/coinlib-error.js +38 -16
- package/errors/coinlib-error.js.map +1 -1
- package/errors/index.d.ts +2 -2
- package/errors/index.js +148 -89
- package/errors/index.js.map +1 -1
- package/index.js +19 -19
- package/index.js.map +1 -1
- package/interfaces/IAirGapSignedTransaction.d.ts +1 -1
- package/interfaces/IAirGapTransaction.js +3 -3
- package/interfaces/IAirGapTransaction.js.map +1 -1
- package/networks.js +9 -9
- package/networks.js.map +1 -1
- package/package.json +1 -1
- package/protocols/BlockExplorerProtocol.js +54 -7
- package/protocols/BlockExplorerProtocol.js.map +1 -1
- package/protocols/CryptoClient.js +78 -19
- package/protocols/CryptoClient.js.map +1 -1
- package/protocols/Ed25519CryptoClient.js +98 -30
- package/protocols/Ed25519CryptoClient.js.map +1 -1
- package/protocols/ICoinSubProtocol.js +1 -1
- package/protocols/ICoinSubProtocol.js.map +1 -1
- package/protocols/NonExtendedProtocol.js +29 -26
- package/protocols/NonExtendedProtocol.js.map +1 -1
- package/protocols/Secp256k1CryptoClient.js +73 -9
- package/protocols/Secp256k1CryptoClient.js.map +1 -1
- package/protocols/Sr25519CryptoClient.js +76 -12
- package/protocols/Sr25519CryptoClient.js.map +1 -1
- package/utils/AES.js +132 -81
- package/utils/AES.js.map +1 -1
- package/utils/ErrorWithData.js +23 -5
- package/utils/ErrorWithData.js.map +1 -1
- package/utils/Network.js +1 -1
- package/utils/Network.js.map +1 -1
- package/utils/ProtocolBlockExplorer.js +4 -3
- package/utils/ProtocolBlockExplorer.js.map +1 -1
- package/utils/ProtocolNetwork.js +16 -11
- package/utils/ProtocolNetwork.js.map +1 -1
- package/utils/ProtocolSymbols.d.ts +3 -1
- package/utils/ProtocolSymbols.js +8 -6
- package/utils/ProtocolSymbols.js.map +1 -1
- package/utils/array.js +15 -14
- package/utils/array.js.map +1 -1
- package/utils/assert.js +12 -8
- package/utils/assert.js.map +1 -1
- package/utils/base64Check.d.ts +1 -0
- package/utils/base64Check.js +15 -15
- package/utils/base64Check.js.map +1 -1
- package/utils/blake2b.js +14 -11
- package/utils/blake2b.js.map +1 -1
- package/utils/buffer.d.ts +1 -0
- package/utils/buffer.js +1 -1
- package/utils/buffer.js.map +1 -1
- package/utils/cache.js +87 -38
- package/utils/cache.js.map +1 -1
- package/utils/error.js +3 -2
- package/utils/error.js.map +1 -1
- package/utils/hex.d.ts +2 -1
- package/utils/hex.js +38 -31
- package/utils/hex.js.map +1 -1
- package/utils/interfaces.js +4 -3
- package/utils/interfaces.js.map +1 -1
- package/utils/object.js +7 -5
- package/utils/object.js.map +1 -1
- package/utils/padStart.js +2 -1
- package/utils/padStart.js.map +1 -1
- package/utils/remote-data/HttpRemoteData.js +107 -24
- package/utils/remote-data/HttpRemoteData.js.map +1 -1
- package/utils/remote-data/IpfsRemoteData.js +116 -32
- package/utils/remote-data/IpfsRemoteData.js.map +1 -1
- package/utils/remote-data/RemoteData.d.ts +1 -0
- package/utils/remote-data/RemoteData.js +4 -3
- package/utils/remote-data/RemoteData.js.map +1 -1
- package/utils/remote-data/RemoteDataFactory.d.ts +2 -2
- package/utils/remote-data/RemoteDataFactory.js +20 -13
- package/utils/remote-data/RemoteDataFactory.js.map +1 -1
- package/utils/remote-data/Sha256RemoteData.d.ts +1 -0
- package/utils/remote-data/Sha256RemoteData.js +117 -44
- package/utils/remote-data/Sha256RemoteData.js.map +1 -1
- package/utils/string.js +9 -8
- package/utils/string.js.map +1 -1
- package/utils/type.js +4 -3
- package/utils/type.js.map +1 -1
- package/utils/xxhash.d.ts +1 -0
- package/utils/xxhash.js +11 -9
- package/utils/xxhash.js.map +1 -1
- package/wallet/AirGapCoinWallet.js +183 -64
- package/wallet/AirGapCoinWallet.js.map +1 -1
- package/wallet/AirGapMarketWallet.js +201 -88
- package/wallet/AirGapMarketWallet.js.map +1 -1
- package/wallet/AirGapNFTWallet.js +165 -48
- package/wallet/AirGapNFTWallet.js.map +1 -1
- package/wallet/AirGapWallet.js +145 -58
- package/wallet/AirGapWallet.js.map +1 -1
package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js
CHANGED
|
@@ -31,79 +31,71 @@ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (
|
|
|
31
31
|
}) : function(o, v) {
|
|
32
32
|
o["default"] = v;
|
|
33
33
|
});
|
|
34
|
-
var __importStar = (this && this.__importStar) ||
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return ownKeys(o);
|
|
42
|
-
};
|
|
43
|
-
return function (mod) {
|
|
44
|
-
if (mod && mod.__esModule) return mod;
|
|
45
|
-
var result = {};
|
|
46
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
47
|
-
__setModuleDefault(result, mod);
|
|
48
|
-
return result;
|
|
49
|
-
};
|
|
50
|
-
})();
|
|
34
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
51
41
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
52
|
-
exports.getMasterKeyFromSeed =
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
const naclAuth = __importStar(require("../../tweetnacl-auth-1.0.1/nacl-auth"));
|
|
59
|
-
const index_1 = require("../../bip32-path-0.4.2/index");
|
|
60
|
-
const ED25519_CURVE = Buffer.from('ed25519 seed');
|
|
61
|
-
const HARDENED_OFFSET = 0x80000000;
|
|
42
|
+
exports.derivePathFromSeed = exports.derivePathFromKey = exports.getKeyPair = exports.deriveChild = exports.getMasterKeyFromSeed = void 0;
|
|
43
|
+
var nacl = __importStar(require("../../tweetnacl-1.0.1/nacl"));
|
|
44
|
+
var naclAuth = __importStar(require("../../tweetnacl-auth-1.0.1/nacl-auth"));
|
|
45
|
+
var index_1 = require("../../bip32-path-0.4.2/index");
|
|
46
|
+
var ED25519_CURVE = Buffer.from('ed25519 seed');
|
|
47
|
+
var HARDENED_OFFSET = 0x80000000;
|
|
62
48
|
function getMasterKeyFromSeed(seed) {
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
49
|
+
var I = naclAuth.full(seed, ED25519_CURVE);
|
|
50
|
+
var IL = I.slice(0, 32);
|
|
51
|
+
var IR = I.slice(32);
|
|
66
52
|
return {
|
|
67
53
|
privateKey: IL,
|
|
68
54
|
chainCode: IR
|
|
69
55
|
};
|
|
70
56
|
}
|
|
71
|
-
|
|
57
|
+
exports.getMasterKeyFromSeed = getMasterKeyFromSeed;
|
|
58
|
+
function deriveChild(_a, index) {
|
|
59
|
+
var privateKey = _a.privateKey, chainCode = _a.chainCode;
|
|
72
60
|
if (index < HARDENED_OFFSET) {
|
|
73
|
-
throw new Error(
|
|
61
|
+
throw new Error("Child index #".concat(index, " is not supported"));
|
|
74
62
|
}
|
|
75
|
-
|
|
63
|
+
var indexBuffer = Buffer.allocUnsafe(4);
|
|
76
64
|
indexBuffer.writeUInt32BE(index, 0);
|
|
77
|
-
|
|
65
|
+
var data = Buffer.concat([
|
|
78
66
|
Buffer.alloc(1, 0),
|
|
79
67
|
Buffer.from(privateKey),
|
|
80
68
|
Buffer.from(indexBuffer)
|
|
81
69
|
]);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
70
|
+
var I = naclAuth.full(data, Buffer.from(chainCode));
|
|
71
|
+
var IL = I.slice(0, 32);
|
|
72
|
+
var IR = I.slice(32);
|
|
85
73
|
return {
|
|
86
74
|
privateKey: IL,
|
|
87
75
|
chainCode: IR
|
|
88
76
|
};
|
|
89
77
|
}
|
|
78
|
+
exports.deriveChild = deriveChild;
|
|
90
79
|
function getKeyPair(privateKey) {
|
|
91
80
|
return nacl.sign.keyPair.fromSeed(privateKey);
|
|
92
81
|
}
|
|
82
|
+
exports.getKeyPair = getKeyPair;
|
|
93
83
|
function derivePathFromKey(path, key) {
|
|
94
|
-
|
|
95
|
-
segments.forEach((segment, i)
|
|
84
|
+
var segments = path === '' ? [] : (0, index_1.fromString)(path).toPathArray();
|
|
85
|
+
segments.forEach(function (segment, i) {
|
|
96
86
|
if (segment < HARDENED_OFFSET) {
|
|
97
|
-
throw new Error(
|
|
87
|
+
throw new Error("Segment #".concat(i + 1, " is not hardened"));
|
|
98
88
|
}
|
|
99
89
|
});
|
|
100
|
-
return segments.reduce((parentKey, segment)
|
|
90
|
+
return segments.reduce(function (parentKey, segment) { return deriveChild(parentKey, segment); }, key);
|
|
101
91
|
}
|
|
92
|
+
exports.derivePathFromKey = derivePathFromKey;
|
|
102
93
|
function derivePathFromSeed(path, seed) {
|
|
103
94
|
if (!['m', 'm/'].includes(path.slice(0, 2))) {
|
|
104
95
|
throw new Error('Invalid path');
|
|
105
96
|
}
|
|
106
|
-
|
|
97
|
+
var masterKey = getMasterKeyFromSeed(seed);
|
|
107
98
|
return derivePathFromKey(path.slice(2), masterKey);
|
|
108
99
|
}
|
|
100
|
+
exports.derivePathFromSeed = derivePathFromSeed;
|
|
109
101
|
//# sourceMappingURL=hd-key.js.map
|
package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hd-key.js","sourceRoot":"","sources":["../../../../../src/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG
|
|
1
|
+
{"version":3,"file":"hd-key.js","sourceRoot":"","sources":["../../../../../src/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-key.ts"],"names":[],"mappings":"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"}
|
package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js
CHANGED
|
@@ -16,18 +16,22 @@
|
|
|
16
16
|
* PERFORMANCE OF THIS SOFTWARE.
|
|
17
17
|
*/
|
|
18
18
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
19
|
-
exports.generateHDWallet =
|
|
20
|
-
|
|
21
|
-
exports.getHDWalletAccounts = getHDWalletAccounts;
|
|
22
|
-
const hd_key_1 = require("./hd-key");
|
|
19
|
+
exports.getHDWalletAccounts = exports.generateWalletUsingDerivationPath = exports.generateHDWallet = void 0;
|
|
20
|
+
var hd_key_1 = require("./hd-key");
|
|
23
21
|
function generateHDWallet(seed) {
|
|
24
22
|
return (0, hd_key_1.derivePathFromSeed)('m/44h/457h', seed);
|
|
25
23
|
}
|
|
26
|
-
|
|
24
|
+
exports.generateHDWallet = generateHDWallet;
|
|
25
|
+
function generateWalletUsingDerivationPath(seed, derivationPath) {
|
|
26
|
+
if (derivationPath === void 0) { derivationPath = 'm/44h/457h/0h/0h/0h'; }
|
|
27
27
|
return (0, hd_key_1.getKeyPair)((0, hd_key_1.derivePathFromSeed)(derivationPath, seed).privateKey);
|
|
28
28
|
}
|
|
29
|
+
exports.generateWalletUsingDerivationPath = generateWalletUsingDerivationPath;
|
|
29
30
|
function getHDWalletAccounts(wallet, accountCount) {
|
|
30
31
|
return new Array(accountCount).fill()
|
|
31
|
-
.map((_, idx)
|
|
32
|
+
.map(function (_, idx) {
|
|
33
|
+
return (0, hd_key_1.getKeyPair)((0, hd_key_1.derivePathFromKey)("".concat(idx, "h/0h/0h"), wallet).privateKey);
|
|
34
|
+
});
|
|
32
35
|
}
|
|
36
|
+
exports.getHDWalletAccounts = getHDWalletAccounts;
|
|
33
37
|
//# sourceMappingURL=hd-wallet.js.map
|
package/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hd-wallet.js","sourceRoot":"","sources":["../../../../../src/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG
|
|
1
|
+
{"version":3,"file":"hd-wallet.js","sourceRoot":"","sources":["../../../../../src/dependencies/src/hd-wallet-js-b216450e56954a6e82ace0aade9474673de5d9d5/src/hd-wallet.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;GAeG;;;AAEH,mCAA4E;AAE5E,SAAgB,gBAAgB,CAAE,IAAI;IACpC,OAAO,IAAA,2BAAkB,EAAC,YAAY,EAAE,IAAI,CAAC,CAAA;AAC/C,CAAC;AAFD,4CAEC;AAED,SAAgB,iCAAiC,CAAE,IAAI,EAAE,cAAsC;IAAtC,+BAAA,EAAA,sCAAsC;IAC7F,OAAO,IAAA,mBAAU,EAAC,IAAA,2BAAkB,EAAC,cAAc,EAAE,IAAI,CAAC,CAAC,UAAU,CAAC,CAAA;AACxE,CAAC;AAFD,8EAEC;AAED,SAAgB,mBAAmB,CAAE,MAAM,EAAE,YAAY;IACvD,OAAQ,IAAI,KAAK,CAAC,YAAY,CAAS,CAAC,IAAI,EAAE;SAC3C,GAAG,CAAC,UAAC,CAAC,EAAE,GAAG;QACV,OAAA,IAAA,mBAAU,EAAC,IAAA,0BAAiB,EAAC,UAAG,GAAG,YAAS,EAAE,MAAM,CAAC,CAAC,UAAU,CAAC;IAAjE,CAAiE,CAAC,CAAA;AACxE,CAAC;AAJD,kDAIC"}
|
package/errors/coinlib-error.js
CHANGED
|
@@ -1,4 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.CoinlibAssertionError = exports.CoinlibError = exports.Domain = void 0;
|
|
4
19
|
var Domain;
|
|
@@ -22,24 +37,31 @@ var Domain;
|
|
|
22
37
|
Domain["OPTIMISM"] = "OPTIMISM";
|
|
23
38
|
Domain["MINA"] = "MINA";
|
|
24
39
|
Domain["STELLAR"] = "STELLAR";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
this.code
|
|
31
|
-
|
|
40
|
+
Domain["BASE"] = "BASE";
|
|
41
|
+
})(Domain = exports.Domain || (exports.Domain = {}));
|
|
42
|
+
var CoinlibError = /** @class */ (function (_super) {
|
|
43
|
+
__extends(CoinlibError, _super);
|
|
44
|
+
function CoinlibError(domain, code, description) {
|
|
45
|
+
var _this = _super.call(this, description ? "".concat(domain, "(").concat(code, "): ").concat(description) : "".concat(domain, "(").concat(code, ")")) || this;
|
|
46
|
+
_this.domain = domain;
|
|
47
|
+
_this.code = code;
|
|
48
|
+
_this.description = description;
|
|
49
|
+
return _this;
|
|
32
50
|
}
|
|
33
|
-
|
|
51
|
+
return CoinlibError;
|
|
52
|
+
}(Error));
|
|
34
53
|
exports.CoinlibError = CoinlibError;
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
this.domain
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
54
|
+
var CoinlibAssertionError = /** @class */ (function (_super) {
|
|
55
|
+
__extends(CoinlibAssertionError, _super);
|
|
56
|
+
function CoinlibAssertionError(domain, code, expected, actual) {
|
|
57
|
+
var _this = _super.call(this, "".concat(domain, "(").concat(code, "): expected ").concat(expected, " but got ").concat(actual, ".")) || this;
|
|
58
|
+
_this.domain = domain;
|
|
59
|
+
_this.code = code;
|
|
60
|
+
_this.expected = expected;
|
|
61
|
+
_this.actual = actual;
|
|
62
|
+
return _this;
|
|
42
63
|
}
|
|
43
|
-
|
|
64
|
+
return CoinlibAssertionError;
|
|
65
|
+
}(Error));
|
|
44
66
|
exports.CoinlibAssertionError = CoinlibAssertionError;
|
|
45
67
|
//# sourceMappingURL=coinlib-error.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"coinlib-error.js","sourceRoot":"","sources":["../../src/errors/coinlib-error.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"coinlib-error.js","sourceRoot":"","sources":["../../src/errors/coinlib-error.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,IAAY,MAqBX;AArBD,WAAY,MAAM;IAChB,mCAAyB,CAAA;IACzB,uCAA6B,CAAA;IAC7B,2BAAiB,CAAA;IACjB,6BAAmB,CAAA;IACnB,+BAAqB,CAAA;IACrB,yBAAe,CAAA;IACf,2BAAiB,CAAA;IACjB,iCAAuB,CAAA;IACvB,iCAAuB,CAAA;IACvB,qCAA2B,CAAA;IAC3B,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,yBAAe,CAAA;IACf,6BAAmB,CAAA;IACnB,qBAAW,CAAA;IACX,2BAAiB,CAAA;IACjB,+BAAqB,CAAA;IACrB,uBAAa,CAAA;IACb,6BAAmB,CAAA;IACnB,uBAAa,CAAA;AACf,CAAC,EArBW,MAAM,GAAN,cAAM,KAAN,cAAM,QAqBjB;AAED;IAAkC,gCAAK;IACrC,sBACS,MAAc,EACd,IAAY,EACZ,WAAoB;QAH7B,YAKE,kBAAM,WAAW,CAAC,CAAC,CAAC,UAAG,MAAM,cAAI,IAAI,gBAAM,WAAW,CAAE,CAAC,CAAC,CAAC,UAAG,MAAM,cAAI,IAAI,MAAG,CAAC,SACjF;QALQ,YAAM,GAAN,MAAM,CAAQ;QACd,UAAI,GAAJ,IAAI,CAAQ;QACZ,iBAAW,GAAX,WAAW,CAAS;;IAG7B,CAAC;IACH,mBAAC;AAAD,CAAC,AARD,CAAkC,KAAK,GAQtC;AARY,oCAAY;AAUzB;IAA2C,yCAAK;IAC9C,+BACS,MAAc,EACd,IAAY,EACZ,QAAgB,EAChB,MAAM;QAJf,YAME,kBAAM,UAAG,MAAM,cAAI,IAAI,yBAAe,QAAQ,sBAAY,MAAM,MAAG,CAAC,SACrE;QANQ,YAAM,GAAN,MAAM,CAAQ;QACd,UAAI,GAAJ,IAAI,CAAQ;QACZ,cAAQ,GAAR,QAAQ,CAAQ;QAChB,YAAM,GAAN,MAAM,CAAA;;IAGf,CAAC;IACH,4BAAC;AAAD,CAAC,AATD,CAA2C,KAAK,GAS/C;AATY,sDAAqB"}
|
package/errors/index.d.ts
CHANGED
|
@@ -70,8 +70,8 @@ export declare class BalanceError extends CoinlibError {
|
|
|
70
70
|
constructor(domain: Domain, description?: string);
|
|
71
71
|
}
|
|
72
72
|
export declare class TransactionError extends CoinlibError {
|
|
73
|
-
data?: unknown
|
|
74
|
-
constructor(domain: Domain, description?: string, data?: unknown
|
|
73
|
+
data?: unknown;
|
|
74
|
+
constructor(domain: Domain, description?: string, data?: unknown);
|
|
75
75
|
}
|
|
76
76
|
/**
|
|
77
77
|
* Gets thrown if an accessed object property is undefined
|
package/errors/index.js
CHANGED
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __extends = (this && this.__extends) || (function () {
|
|
3
|
+
var extendStatics = function (d, b) {
|
|
4
|
+
extendStatics = Object.setPrototypeOf ||
|
|
5
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
+
return extendStatics(d, b);
|
|
8
|
+
};
|
|
9
|
+
return function (d, b) {
|
|
10
|
+
if (typeof b !== "function" && b !== null)
|
|
11
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
+
extendStatics(d, b);
|
|
13
|
+
function __() { this.constructor = d; }
|
|
14
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
+
};
|
|
16
|
+
})();
|
|
2
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
18
|
exports.InvalidString = exports.InvalidHexString = exports.InvalidPayloadError = exports.InvalidSchemaType = exports.InvalidSchema = exports.TypeNotSupported = exports.ProtocolVersionMismatch = exports.ProtocolNotSupported = exports.SerializerVersionMismatch = exports.SerializerError = exports.InvalidValueError = exports.NotImplementedError = exports.OperationFailedError = exports.PropertyUndefinedError = exports.TransactionError = exports.BalanceError = exports.NotFoundError = exports.UnsupportedError = exports.ConditionViolationError = exports.NetworkError = exports.ProtocolErrorType = exports.SerializerErrorType = void 0;
|
|
4
|
-
|
|
19
|
+
var coinlib_error_1 = require("./coinlib-error");
|
|
5
20
|
var SerializerErrorType;
|
|
6
21
|
(function (SerializerErrorType) {
|
|
7
22
|
SerializerErrorType["SERIALIZER_VERSION_MISMATCH"] = "SERIALIZER_VERSION_MISMATCH";
|
|
@@ -21,7 +36,7 @@ var SerializerErrorType;
|
|
|
21
36
|
SerializerErrorType["PAYLOAD_TYPE_NOT_SUPPORTED"] = "PAYLOAD_TYPE_NOT_SUPPORTED";
|
|
22
37
|
SerializerErrorType["PROPERTY_IS_EMPTY"] = "PROPERTY_IS_EMPTY";
|
|
23
38
|
SerializerErrorType["PROPERTY_INVALID"] = "PROPERTY_INVALID";
|
|
24
|
-
})(SerializerErrorType
|
|
39
|
+
})(SerializerErrorType = exports.SerializerErrorType || (exports.SerializerErrorType = {}));
|
|
25
40
|
var ProtocolErrorType;
|
|
26
41
|
(function (ProtocolErrorType) {
|
|
27
42
|
ProtocolErrorType["NETWORK"] = "NETWORK";
|
|
@@ -34,189 +49,233 @@ var ProtocolErrorType;
|
|
|
34
49
|
ProtocolErrorType["NOT_IMPLEMENTED"] = "NOT_IMPLEMENTED";
|
|
35
50
|
ProtocolErrorType["INVALID_VALUE"] = "INVALID_VALUE";
|
|
36
51
|
ProtocolErrorType["TRANSACTION_FAILED"] = "TRANSACTION_FAILED";
|
|
37
|
-
})(ProtocolErrorType
|
|
52
|
+
})(ProtocolErrorType = exports.ProtocolErrorType || (exports.ProtocolErrorType = {}));
|
|
38
53
|
/**
|
|
39
54
|
* Gets thrown if an error occurs when making a network request
|
|
40
55
|
* Partial<AxiosError> is either an AxiosError or an AxiosResponse,
|
|
41
56
|
* as we sometimes want to throw an Error even though we get a 200 response
|
|
42
57
|
* from the API (as in case of internal operation errors for Tezos).
|
|
43
58
|
*/
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
this.
|
|
50
|
-
|
|
51
|
-
|
|
59
|
+
var NetworkError = /** @class */ (function (_super) {
|
|
60
|
+
__extends(NetworkError, _super);
|
|
61
|
+
function NetworkError(domain, error, description) {
|
|
62
|
+
var _this = this;
|
|
63
|
+
var _a, _b, _c, _d, _e;
|
|
64
|
+
_this = _super.call(this, domain, ProtocolErrorType.NETWORK) || this;
|
|
65
|
+
_this.data = description !== null && description !== void 0 ? description : (_a = error.response) === null || _a === void 0 ? void 0 : _a.data;
|
|
66
|
+
_this.status = (_b = error === null || error === void 0 ? void 0 : error.response) === null || _b === void 0 ? void 0 : _b.status;
|
|
67
|
+
_this.url = (_c = error.config) === null || _c === void 0 ? void 0 : _c.url;
|
|
68
|
+
_this.method = (_d = error.config) === null || _d === void 0 ? void 0 : _d.method;
|
|
69
|
+
_this.requestBody = (_e = error.config) === null || _e === void 0 ? void 0 : _e.data;
|
|
70
|
+
return _this;
|
|
52
71
|
}
|
|
53
|
-
|
|
72
|
+
return NetworkError;
|
|
73
|
+
}(coinlib_error_1.CoinlibError));
|
|
54
74
|
exports.NetworkError = NetworkError;
|
|
55
75
|
/**
|
|
56
76
|
* Gets thrown if a value ist expected to fulfill a certain condition such as having a certain length, but the condition is not satisfied
|
|
57
77
|
*/
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
78
|
+
var ConditionViolationError = /** @class */ (function (_super) {
|
|
79
|
+
__extends(ConditionViolationError, _super);
|
|
80
|
+
function ConditionViolationError(domain, description) {
|
|
81
|
+
return _super.call(this, domain, ProtocolErrorType.CONDITION_VIOLATION, description) || this;
|
|
61
82
|
}
|
|
62
|
-
|
|
83
|
+
return ConditionViolationError;
|
|
84
|
+
}(coinlib_error_1.CoinlibError));
|
|
63
85
|
exports.ConditionViolationError = ConditionViolationError;
|
|
64
86
|
/**
|
|
65
87
|
* Gets thrown if a variable assumes a value for which an operation is not supported
|
|
66
88
|
*/
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
89
|
+
var UnsupportedError = /** @class */ (function (_super) {
|
|
90
|
+
__extends(UnsupportedError, _super);
|
|
91
|
+
function UnsupportedError(domain, description) {
|
|
92
|
+
return _super.call(this, domain, ProtocolErrorType.UNSUPPORTED, description) || this;
|
|
70
93
|
}
|
|
71
|
-
|
|
94
|
+
return UnsupportedError;
|
|
95
|
+
}(coinlib_error_1.CoinlibError));
|
|
72
96
|
exports.UnsupportedError = UnsupportedError;
|
|
73
97
|
/**
|
|
74
98
|
* Gets thrown if a variable is unexpectedly undefined
|
|
75
99
|
*/
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
100
|
+
var NotFoundError = /** @class */ (function (_super) {
|
|
101
|
+
__extends(NotFoundError, _super);
|
|
102
|
+
function NotFoundError(domain, description) {
|
|
103
|
+
return _super.call(this, domain, ProtocolErrorType.NOT_FOUND, description) || this;
|
|
79
104
|
}
|
|
80
|
-
|
|
105
|
+
return NotFoundError;
|
|
106
|
+
}(coinlib_error_1.CoinlibError));
|
|
81
107
|
exports.NotFoundError = NotFoundError;
|
|
82
108
|
/**
|
|
83
109
|
* Gets thrown if an account has an insufficient balance to perform a certain kind of operation
|
|
84
110
|
*/
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
111
|
+
var BalanceError = /** @class */ (function (_super) {
|
|
112
|
+
__extends(BalanceError, _super);
|
|
113
|
+
function BalanceError(domain, description) {
|
|
114
|
+
return _super.call(this, domain, ProtocolErrorType.BALANCE, description) || this;
|
|
88
115
|
}
|
|
89
|
-
|
|
116
|
+
return BalanceError;
|
|
117
|
+
}(coinlib_error_1.CoinlibError));
|
|
90
118
|
exports.BalanceError = BalanceError;
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
this.
|
|
119
|
+
var TransactionError = /** @class */ (function (_super) {
|
|
120
|
+
__extends(TransactionError, _super);
|
|
121
|
+
function TransactionError(domain, description, data) {
|
|
122
|
+
var _this = _super.call(this, domain, ProtocolErrorType.TRANSACTION_FAILED, description) || this;
|
|
123
|
+
_this.data = data;
|
|
124
|
+
return _this;
|
|
95
125
|
}
|
|
96
|
-
|
|
126
|
+
return TransactionError;
|
|
127
|
+
}(coinlib_error_1.CoinlibError));
|
|
97
128
|
exports.TransactionError = TransactionError;
|
|
98
129
|
/**
|
|
99
130
|
* Gets thrown if an accessed object property is undefined
|
|
100
131
|
*/
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
132
|
+
var PropertyUndefinedError = /** @class */ (function (_super) {
|
|
133
|
+
__extends(PropertyUndefinedError, _super);
|
|
134
|
+
function PropertyUndefinedError(domain, description) {
|
|
135
|
+
return _super.call(this, domain, ProtocolErrorType.PROPERTY_UNDEFINED, description) || this;
|
|
104
136
|
}
|
|
105
|
-
|
|
137
|
+
return PropertyUndefinedError;
|
|
138
|
+
}(coinlib_error_1.CoinlibError));
|
|
106
139
|
exports.PropertyUndefinedError = PropertyUndefinedError;
|
|
107
140
|
/**
|
|
108
141
|
* Gets thrown if an internal method fails
|
|
109
142
|
*/
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
143
|
+
var OperationFailedError = /** @class */ (function (_super) {
|
|
144
|
+
__extends(OperationFailedError, _super);
|
|
145
|
+
function OperationFailedError(domain, description) {
|
|
146
|
+
return _super.call(this, domain, ProtocolErrorType.OPERATION_FAILED, description) || this;
|
|
113
147
|
}
|
|
114
|
-
|
|
148
|
+
return OperationFailedError;
|
|
149
|
+
}(coinlib_error_1.CoinlibError));
|
|
115
150
|
exports.OperationFailedError = OperationFailedError;
|
|
116
151
|
/**
|
|
117
152
|
* Gets thrown if a method is executed which is not implemented
|
|
118
153
|
*/
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
154
|
+
var NotImplementedError = /** @class */ (function (_super) {
|
|
155
|
+
__extends(NotImplementedError, _super);
|
|
156
|
+
function NotImplementedError(domain, description) {
|
|
157
|
+
return _super.call(this, domain, ProtocolErrorType.NOT_IMPLEMENTED, description) || this;
|
|
122
158
|
}
|
|
123
|
-
|
|
159
|
+
return NotImplementedError;
|
|
160
|
+
}(coinlib_error_1.CoinlibError));
|
|
124
161
|
exports.NotImplementedError = NotImplementedError;
|
|
125
162
|
/**
|
|
126
163
|
* Gets thrown if a variable has a value which cannot be handled
|
|
127
164
|
*/
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
165
|
+
var InvalidValueError = /** @class */ (function (_super) {
|
|
166
|
+
__extends(InvalidValueError, _super);
|
|
167
|
+
function InvalidValueError(domain, description) {
|
|
168
|
+
return _super.call(this, domain, ProtocolErrorType.INVALID_VALUE, description) || this;
|
|
131
169
|
}
|
|
132
|
-
|
|
170
|
+
return InvalidValueError;
|
|
171
|
+
}(coinlib_error_1.CoinlibError));
|
|
133
172
|
exports.InvalidValueError = InvalidValueError;
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
173
|
+
var SerializerError = /** @class */ (function (_super) {
|
|
174
|
+
__extends(SerializerError, _super);
|
|
175
|
+
function SerializerError(code, description) {
|
|
176
|
+
return _super.call(this, coinlib_error_1.Domain.SERIALIZER, code, description) || this;
|
|
137
177
|
}
|
|
138
|
-
|
|
178
|
+
return SerializerError;
|
|
179
|
+
}(coinlib_error_1.CoinlibError));
|
|
139
180
|
exports.SerializerError = SerializerError;
|
|
140
181
|
// tslint:disable:max-classes-per-file
|
|
141
182
|
/**
|
|
142
183
|
* Gets thrown if the serializer version does not match
|
|
143
184
|
*/
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
185
|
+
var SerializerVersionMismatch = /** @class */ (function (_super) {
|
|
186
|
+
__extends(SerializerVersionMismatch, _super);
|
|
187
|
+
function SerializerVersionMismatch(description) {
|
|
188
|
+
return _super.call(this, SerializerErrorType.SERIALIZER_VERSION_MISMATCH, description) || this;
|
|
147
189
|
}
|
|
148
|
-
|
|
190
|
+
return SerializerVersionMismatch;
|
|
191
|
+
}(SerializerError));
|
|
149
192
|
exports.SerializerVersionMismatch = SerializerVersionMismatch;
|
|
150
193
|
/**
|
|
151
194
|
* Gets thrown if the serializer cannot handle the specified coin/protocol
|
|
152
195
|
*/
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
196
|
+
var ProtocolNotSupported = /** @class */ (function (_super) {
|
|
197
|
+
__extends(ProtocolNotSupported, _super);
|
|
198
|
+
function ProtocolNotSupported(description) {
|
|
199
|
+
return _super.call(this, SerializerErrorType.PROTOCOL_NOT_SUPPORTED, description) || this;
|
|
156
200
|
}
|
|
157
|
-
|
|
201
|
+
return ProtocolNotSupported;
|
|
202
|
+
}(SerializerError));
|
|
158
203
|
exports.ProtocolNotSupported = ProtocolNotSupported;
|
|
159
204
|
/**
|
|
160
205
|
* Gets thrown if the serializer CAN handle the specified coin/protocol, but not in this version
|
|
161
206
|
*/
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
207
|
+
var ProtocolVersionMismatch = /** @class */ (function (_super) {
|
|
208
|
+
__extends(ProtocolVersionMismatch, _super);
|
|
209
|
+
function ProtocolVersionMismatch(description) {
|
|
210
|
+
return _super.call(this, SerializerErrorType.PROTOCOL_VERSION_MISMATCH, description) || this;
|
|
165
211
|
}
|
|
166
|
-
|
|
212
|
+
return ProtocolVersionMismatch;
|
|
213
|
+
}(SerializerError));
|
|
167
214
|
exports.ProtocolVersionMismatch = ProtocolVersionMismatch;
|
|
168
215
|
/**
|
|
169
216
|
* Gets thrown if the specified Type is not supported
|
|
170
217
|
*/
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
218
|
+
var TypeNotSupported = /** @class */ (function (_super) {
|
|
219
|
+
__extends(TypeNotSupported, _super);
|
|
220
|
+
function TypeNotSupported(description) {
|
|
221
|
+
return _super.call(this, SerializerErrorType.TYPE_NOT_SUPPORTED, description) || this;
|
|
174
222
|
}
|
|
175
|
-
|
|
223
|
+
return TypeNotSupported;
|
|
224
|
+
}(SerializerError));
|
|
176
225
|
exports.TypeNotSupported = TypeNotSupported;
|
|
177
226
|
/**
|
|
178
227
|
* Gets thrown if the schema in the serializer is invalid
|
|
179
228
|
*/
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
229
|
+
var InvalidSchema = /** @class */ (function (_super) {
|
|
230
|
+
__extends(InvalidSchema, _super);
|
|
231
|
+
function InvalidSchema(description) {
|
|
232
|
+
return _super.call(this, SerializerErrorType.INVALID_SCHEMA, description) || this;
|
|
183
233
|
}
|
|
184
|
-
|
|
234
|
+
return InvalidSchema;
|
|
235
|
+
}(SerializerError));
|
|
185
236
|
exports.InvalidSchema = InvalidSchema;
|
|
186
237
|
/**
|
|
187
238
|
* Gets thrown if the 2 types provided are not compatible
|
|
188
239
|
*/
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
240
|
+
var InvalidSchemaType = /** @class */ (function (_super) {
|
|
241
|
+
__extends(InvalidSchemaType, _super);
|
|
242
|
+
function InvalidSchemaType(description) {
|
|
243
|
+
return _super.call(this, SerializerErrorType.INVALID_SCHEMA_TYPE, description) || this;
|
|
192
244
|
}
|
|
193
|
-
|
|
245
|
+
return InvalidSchemaType;
|
|
246
|
+
}(SerializerError));
|
|
194
247
|
exports.InvalidSchemaType = InvalidSchemaType;
|
|
195
248
|
/**
|
|
196
249
|
* Gets thrown if the payload that is being decoded does not match the schema
|
|
197
250
|
*/
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
251
|
+
var InvalidPayloadError = /** @class */ (function (_super) {
|
|
252
|
+
__extends(InvalidPayloadError, _super);
|
|
253
|
+
function InvalidPayloadError(description) {
|
|
254
|
+
return _super.call(this, SerializerErrorType.INVALID_PAYLOAD, description) || this;
|
|
201
255
|
}
|
|
202
|
-
|
|
256
|
+
return InvalidPayloadError;
|
|
257
|
+
}(SerializerError));
|
|
203
258
|
exports.InvalidPayloadError = InvalidPayloadError;
|
|
204
259
|
/**
|
|
205
260
|
* Gets thrown if the string is not a valid hex string
|
|
206
261
|
*/
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
262
|
+
var InvalidHexString = /** @class */ (function (_super) {
|
|
263
|
+
__extends(InvalidHexString, _super);
|
|
264
|
+
function InvalidHexString(description) {
|
|
265
|
+
return _super.call(this, SerializerErrorType.INVALID_HEX_STRING, description) || this;
|
|
210
266
|
}
|
|
211
|
-
|
|
267
|
+
return InvalidHexString;
|
|
268
|
+
}(SerializerError));
|
|
212
269
|
exports.InvalidHexString = InvalidHexString;
|
|
213
270
|
/**
|
|
214
271
|
* Gets thrown if the string starts with "0x". This causes problems with RLP
|
|
215
272
|
*/
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
273
|
+
var InvalidString = /** @class */ (function (_super) {
|
|
274
|
+
__extends(InvalidString, _super);
|
|
275
|
+
function InvalidString(description) {
|
|
276
|
+
return _super.call(this, SerializerErrorType.INVALID_STRING, description) || this;
|
|
219
277
|
}
|
|
220
|
-
|
|
278
|
+
return InvalidString;
|
|
279
|
+
}(SerializerError));
|
|
221
280
|
exports.InvalidString = InvalidString;
|
|
222
281
|
//# sourceMappingURL=index.js.map
|