@airgap/coinlib-core 0.13.6 → 0.13.7-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actions/GetKtAccountsAction.js +1 -1
- package/actions/GetKtAccountsAction.js.map +1 -1
- package/airgap-coinlib-core.min.js +389 -298
- package/interfaces/IAirGapAddress.d.ts +19 -0
- package/interfaces/IAirGapAddress.js +3 -0
- package/interfaces/IAirGapAddress.js.map +1 -0
- package/package.json +1 -1
- package/protocols/CryptoClient.d.ts +4 -5
- package/protocols/Ed25519CryptoClient.d.ts +1 -2
- package/protocols/Ed25519CryptoClient.js +1 -1
- package/protocols/Ed25519CryptoClient.js.map +1 -1
- package/protocols/ICoinBaseProtocol.d.ts +47 -0
- package/protocols/ICoinBaseProtocol.js +3 -0
- package/protocols/ICoinBaseProtocol.js.map +1 -0
- package/protocols/ICoinOfflineProtocol.d.ts +22 -0
- package/protocols/ICoinOfflineProtocol.js +3 -0
- package/protocols/ICoinOfflineProtocol.js.map +1 -0
- package/protocols/ICoinOnlineProtocol.d.ts +46 -0
- package/protocols/ICoinOnlineProtocol.js +3 -0
- package/protocols/ICoinOnlineProtocol.js.map +1 -0
- package/protocols/ICoinProtocol.d.ts +4 -110
- package/protocols/NonExtendedProtocol.d.ts +4 -3
- package/protocols/NonExtendedProtocol.js +4 -1
- package/protocols/NonExtendedProtocol.js.map +1 -1
- package/protocols/Secp256k1CryptoClient.d.ts +1 -2
- package/protocols/Secp256k1CryptoClient.js +1 -1
- package/protocols/Secp256k1CryptoClient.js.map +1 -1
- package/protocols/Sr25519CryptoClient.d.ts +1 -2
- package/protocols/aeternity/AeternityAddress.d.ts +1 -1
- package/protocols/aeternity/AeternityAddress.js +1 -1
- package/protocols/aeternity/AeternityCryptoClient.d.ts +1 -2
- package/protocols/aeternity/AeternityCryptoClient.js +1 -1
- package/protocols/aeternity/AeternityCryptoClient.js.map +1 -1
- package/protocols/aeternity/AeternityProtocol.d.ts +10 -13
- package/protocols/aeternity/AeternityProtocol.js +16 -20
- package/protocols/aeternity/AeternityProtocol.js.map +1 -1
- package/protocols/aeternity/AeternityTypes.d.ts +6 -0
- package/protocols/bitcoin/BitcoinAddress.d.ts +1 -1
- package/protocols/bitcoin/BitcoinAddress.js +1 -1
- package/protocols/bitcoin/BitcoinCryptoClient.d.ts +1 -2
- package/protocols/bitcoin/BitcoinCryptoClient.js +2 -2
- package/protocols/bitcoin/BitcoinCryptoClient.js.map +1 -1
- package/protocols/bitcoin/BitcoinProtocol.d.ts +12 -15
- package/protocols/bitcoin/BitcoinProtocol.js +35 -30
- package/protocols/bitcoin/BitcoinProtocol.js.map +1 -1
- package/protocols/bitcoin/BitcoinSegwitAddress.d.ts +1 -1
- package/protocols/bitcoin/BitcoinSegwitAddress.js +1 -1
- package/protocols/bitcoin/BitcoinSegwitProtocol.d.ts +6 -7
- package/protocols/bitcoin/BitcoinSegwitProtocol.js +28 -15
- package/protocols/bitcoin/BitcoinSegwitProtocol.js.map +1 -1
- package/protocols/bitcoin/BitcoinTypes.d.ts +6 -0
- package/protocols/cosmos/CosmosAddress.d.ts +1 -1
- package/protocols/cosmos/CosmosAddress.js +1 -1
- package/protocols/cosmos/CosmosCryptoClient.d.ts +1 -2
- package/protocols/cosmos/CosmosCryptoClient.js +1 -1
- package/protocols/cosmos/CosmosCryptoClient.js.map +1 -1
- package/protocols/cosmos/CosmosProtocol.d.ts +10 -13
- package/protocols/cosmos/CosmosProtocol.js +26 -27
- package/protocols/cosmos/CosmosProtocol.js.map +1 -1
- package/protocols/cosmos/CosmosTypes.d.ts +6 -0
- package/protocols/cosmos/CosmosTypes.js.map +1 -1
- package/protocols/ethereum/BaseEthereumProtocol.d.ts +12 -14
- package/protocols/ethereum/BaseEthereumProtocol.js +20 -22
- package/protocols/ethereum/BaseEthereumProtocol.js.map +1 -1
- package/protocols/ethereum/EthereumAddress.d.ts +1 -1
- package/protocols/ethereum/EthereumAddress.js +1 -1
- package/protocols/ethereum/EthereumCryptoClient.d.ts +1 -2
- package/protocols/ethereum/EthereumCryptoClient.js +8 -7
- package/protocols/ethereum/EthereumCryptoClient.js.map +1 -1
- package/protocols/ethereum/EthereumTypes.d.ts +6 -0
- package/protocols/ethereum/erc20/GenericERC20.d.ts +1 -2
- package/protocols/ethereum/erc20/GenericERC20.js +5 -5
- package/protocols/ethereum/erc20/GenericERC20.js.map +1 -1
- package/protocols/substrate/SubstrateCryptoClient.d.ts +1 -2
- package/protocols/substrate/SubstrateCryptoClient.js +7 -7
- package/protocols/substrate/SubstrateCryptoClient.js.map +1 -1
- package/protocols/substrate/SubstrateDelegateProtocol.js +3 -3
- package/protocols/substrate/SubstrateDelegateProtocol.js.map +1 -1
- package/protocols/substrate/SubstrateProtocol.d.ts +12 -13
- package/protocols/substrate/SubstrateProtocol.js +22 -20
- package/protocols/substrate/SubstrateProtocol.js.map +1 -1
- package/protocols/substrate/SubstrateTypes.d.ts +6 -0
- package/protocols/substrate/common/SubstrateAccountController.js +4 -4
- package/protocols/substrate/common/data/account/SubstrateAddress.d.ts +1 -1
- package/protocols/substrate/common/data/account/SubstrateAddress.js +2 -2
- package/protocols/substrate/common/data/scale/type/SCALEAccountId.js +1 -1
- package/protocols/substrate/common/data/transaction/method/SubstrateTransactionMethodArgs.js +12 -12
- package/protocols/substrate/moonbeam/MoonbeamProtocol.js +4 -4
- package/protocols/substrate/moonbeam/MoonbeamProtocol.js.map +1 -1
- package/protocols/substrate/moonbeam/controllers/MoonbeamAccountController.js +3 -3
- package/protocols/substrate/moonbeam/data/account/MoonbeamAddress.d.ts +1 -1
- package/protocols/substrate/moonbeam/data/account/MoonbeamAddress.js +3 -3
- package/protocols/tezos/TezosAddress.d.ts +1 -1
- package/protocols/tezos/TezosAddress.js +1 -1
- package/protocols/tezos/TezosCryptoClient.d.ts +1 -1
- package/protocols/tezos/TezosCryptoClient.js +1 -1
- package/protocols/tezos/TezosCryptoClient.js.map +1 -1
- package/protocols/tezos/TezosProtocol.d.ts +11 -12
- package/protocols/tezos/TezosProtocol.js +24 -22
- package/protocols/tezos/TezosProtocol.js.map +1 -1
- package/protocols/tezos/fa/TezosFA1Protocol.js +4 -4
- package/protocols/tezos/fa/TezosFA1Protocol.js.map +1 -1
- package/protocols/tezos/fa/TezosFA2Protocol.js +2 -2
- package/protocols/tezos/fa/TezosFA2Protocol.js.map +1 -1
- package/protocols/tezos/fa/TezosFAProtocol.js +1 -1
- package/protocols/tezos/fa/TezosFAProtocol.js.map +1 -1
- package/protocols/tezos/kt/TezosKtProtocol.d.ts +4 -3
- package/protocols/tezos/kt/TezosKtProtocol.js +44 -16
- package/protocols/tezos/kt/TezosKtProtocol.js.map +1 -1
- package/protocols/tezos/sapling/TezosSaplingCryptoClient.d.ts +1 -1
- package/protocols/tezos/sapling/TezosSaplingProtocol.d.ts +12 -12
- package/protocols/tezos/sapling/TezosSaplingProtocol.js +74 -29
- package/protocols/tezos/sapling/TezosSaplingProtocol.js.map +1 -1
- package/protocols/tezos/sapling/utils/TezosSaplingBookkeeper.js +7 -7
- package/protocols/tezos/sapling/utils/TezosSaplingBookkeeper.js.map +1 -1
- package/protocols/tezos/types/TezosAddressCursor.d.ts +3 -0
- package/protocols/tezos/types/TezosAddressCursor.js +3 -0
- package/protocols/tezos/types/TezosAddressCursor.js.map +1 -0
- package/protocols/tezos/types/TezosAddressResult.d.ts +4 -0
- package/protocols/tezos/types/TezosAddressResult.js +3 -0
- package/protocols/tezos/types/TezosAddressResult.js.map +1 -0
- package/protocols/tezos/types/kt/TezosKtAddressCursor.d.ts +4 -0
- package/protocols/tezos/types/kt/TezosKtAddressCursor.js +3 -0
- package/protocols/tezos/types/kt/TezosKtAddressCursor.js.map +1 -0
- package/protocols/tezos/types/kt/TezosKtAddressResult.d.ts +5 -0
- package/protocols/tezos/types/kt/TezosKtAddressResult.js +3 -0
- package/protocols/tezos/types/kt/TezosKtAddressResult.js.map +1 -0
- package/protocols/tezos/types/sapling/TezosSaplingAddressCursor.d.ts +4 -0
- package/protocols/tezos/types/sapling/TezosSaplingAddressCursor.js +3 -0
- package/protocols/tezos/types/sapling/TezosSaplingAddressCursor.js.map +1 -0
- package/protocols/tezos/types/sapling/TezosSaplingAddressResult.d.ts +4 -0
- package/protocols/tezos/types/sapling/TezosSaplingAddressResult.js +3 -0
- package/protocols/tezos/types/sapling/TezosSaplingAddressResult.js.map +1 -0
- package/utils/AES.d.ts +2 -3
- package/utils/AES.js +3 -1
- package/utils/AES.js.map +1 -1
- package/utils/protocolsByIdentifier.js +1 -10
- package/utils/protocolsByIdentifier.js.map +1 -1
- package/wallet/AirGapWallet.js +1 -1
- package/wallet/AirGapWallet.js.map +1 -1
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AeternityAddressCursor } from '../protocols/aeternity/AeternityTypes';
|
|
2
|
+
import { BitcoinAddressCursor } from '../protocols/bitcoin/BitcoinTypes';
|
|
3
|
+
import { CosmosAddressCursor } from '../protocols/cosmos/CosmosTypes';
|
|
4
|
+
import { EthereumAddressCursor } from '../protocols/ethereum/EthereumTypes';
|
|
5
|
+
import { SubstrateAddressCursor } from '../protocols/substrate/SubstrateTypes';
|
|
6
|
+
import { TezosKtAddressCursor } from '../protocols/tezos/types/kt/TezosKtAddressCursor';
|
|
7
|
+
import { TezosSaplingAddressCursor } from '../protocols/tezos/types/sapling/TezosSaplingAddressCursor';
|
|
8
|
+
import { TezosAddressCursor } from '../protocols/tezos/types/TezosAddressCursor';
|
|
9
|
+
export interface IAirGapAddress {
|
|
10
|
+
getValue(): string;
|
|
11
|
+
}
|
|
12
|
+
export interface IBaseProtocolAddressCursor {
|
|
13
|
+
hasNext: boolean;
|
|
14
|
+
}
|
|
15
|
+
export declare type IProtocolAddressCursor = AeternityAddressCursor | BitcoinAddressCursor | CosmosAddressCursor | EthereumAddressCursor | SubstrateAddressCursor | TezosAddressCursor | TezosKtAddressCursor | TezosSaplingAddressCursor;
|
|
16
|
+
export interface IAirGapAddressResult<T extends IBaseProtocolAddressCursor = IProtocolAddressCursor> {
|
|
17
|
+
address: string;
|
|
18
|
+
cursor: T;
|
|
19
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"IAirGapAddress.js","sourceRoot":"","sources":["../../src/interfaces/IAirGapAddress.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
|
@@ -1,16 +1,15 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
export declare abstract class CryptoClient {
|
|
3
2
|
abstract signMessage(message: string, keypair: {
|
|
4
3
|
publicKey?: string;
|
|
5
|
-
privateKey:
|
|
4
|
+
privateKey: string;
|
|
6
5
|
}): Promise<string>;
|
|
7
6
|
abstract verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
8
|
-
encryptAES(payload: string, privateKey:
|
|
9
|
-
decryptAES(encryptedPayload: string, privateKey:
|
|
7
|
+
encryptAES(payload: string, privateKey: string): Promise<string>;
|
|
8
|
+
decryptAES(encryptedPayload: string, privateKey: string): Promise<string>;
|
|
10
9
|
encryptAsymmetric(payload: string, publicKey: string): Promise<string>;
|
|
11
10
|
decryptAsymmetric(encryptedPayload: string, keypair: {
|
|
12
11
|
publicKey?: string;
|
|
13
|
-
privateKey:
|
|
12
|
+
privateKey: string;
|
|
14
13
|
}): Promise<string>;
|
|
15
14
|
recoverPublicKeyFromSignature(): Promise<void>;
|
|
16
15
|
}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { CryptoClient } from './CryptoClient';
|
|
3
2
|
export declare abstract class Ed25519CryptoClient extends CryptoClient {
|
|
4
3
|
encryptAsymmetric(payload: string, publicKey: string): Promise<string>;
|
|
5
4
|
decryptAsymmetric(encryptedPayload: string, keypair: {
|
|
6
5
|
publicKey: string;
|
|
7
|
-
privateKey:
|
|
6
|
+
privateKey: string;
|
|
8
7
|
}): Promise<string>;
|
|
9
8
|
}
|
|
@@ -80,7 +80,7 @@ var Ed25519CryptoClient = /** @class */ (function (_super) {
|
|
|
80
80
|
return __awaiter(this, void 0, void 0, function () {
|
|
81
81
|
var kxSelfPrivateKey, kxSelfPublicKey, decryptedMessage;
|
|
82
82
|
return __generator(this, function (_a) {
|
|
83
|
-
kxSelfPrivateKey = sodium.crypto_sign_ed25519_sk_to_curve25519(Buffer.from(keypair.privateKey)) // Secret bytes to scalar bytes
|
|
83
|
+
kxSelfPrivateKey = sodium.crypto_sign_ed25519_sk_to_curve25519(Buffer.from(keypair.privateKey, 'hex')) // Secret bytes to scalar bytes
|
|
84
84
|
;
|
|
85
85
|
kxSelfPublicKey = sodium.crypto_sign_ed25519_pk_to_curve25519(Buffer.from(keypair.publicKey, 'hex')) // Secret bytes to scalar bytes
|
|
86
86
|
;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Ed25519CryptoClient.js","sourceRoot":"","sources":["../../src/protocols/Ed25519CryptoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6C;AAE7C,+CAA6C;AAE7C,SAAS,KAAK,CAAC,KAAU;IACvB,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC3C,CAAC;AAED;IAAkD,uCAAY;IAA9D;;IAsBA,CAAC;IArBc,+CAAiB,GAA9B,UAA+B,OAAe,EAAE,SAAiB;;;;;4BAC/D,qBAAM,MAAM,CAAC,KAAK,EAAA;;wBAAlB,SAAkB,CAAA;wBAEZ,eAAe,GAAe,MAAM,CAAC,oCAAoC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,+BAA+B;wBAAhC,CAAA;wBACxG,gBAAgB,GAAe,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,CAAA;wBAErF,sBAAO,KAAK,CAAC,gBAAgB,CAAC,EAAA;;;;KAC/B;IAEY,+CAAiB,GAA9B,UAA+B,gBAAwB,EAAE,OAAkD;;;;gBACnG,gBAAgB,GAAe,MAAM,CAAC,oCAAoC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,+BAA+B;gBAAhC,CAAA;
|
|
1
|
+
{"version":3,"file":"Ed25519CryptoClient.js","sourceRoot":"","sources":["../../src/protocols/Ed25519CryptoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6C;AAE7C,+CAA6C;AAE7C,SAAS,KAAK,CAAC,KAAU;IACvB,OAAO,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAA;AAC3C,CAAC;AAED;IAAkD,uCAAY;IAA9D;;IAsBA,CAAC;IArBc,+CAAiB,GAA9B,UAA+B,OAAe,EAAE,SAAiB;;;;;4BAC/D,qBAAM,MAAM,CAAC,KAAK,EAAA;;wBAAlB,SAAkB,CAAA;wBAEZ,eAAe,GAAe,MAAM,CAAC,oCAAoC,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,+BAA+B;wBAAhC,CAAA;wBACxG,gBAAgB,GAAe,MAAM,CAAC,eAAe,CAAC,OAAO,EAAE,eAAe,CAAC,CAAA;wBAErF,sBAAO,KAAK,CAAC,gBAAgB,CAAC,EAAA;;;;KAC/B;IAEY,+CAAiB,GAA9B,UAA+B,gBAAwB,EAAE,OAAkD;;;;gBACnG,gBAAgB,GAAe,MAAM,CAAC,oCAAoC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAC,+BAA+B;gBAAhC,CAAA;gBAClH,eAAe,GAAe,MAAM,CAAC,oCAAoC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,CAAC,+BAA+B;gBAAhC,CAAA;gBAEhH,gBAAgB,GAAe,MAAM,CAAC,oBAAoB,CAC9D,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,EACpC,eAAe,EACf,gBAAgB,CACjB,CAAA;gBAED,sBAAO,MAAM,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,EAAE,EAAA;;;KAChD;IACH,0BAAC;AAAD,CAAC,AAtBD,CAAkD,2BAAY,GAsB7D;AAtBqB,kDAAmB"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { CryptoClient, IAirGapTransaction } from '..';
|
|
2
|
+
import { IAirGapAddressResult, IProtocolAddressCursor } from '../interfaces/IAirGapAddress';
|
|
3
|
+
import { SignedTransaction } from '../serializer/schemas/definitions/signed-transaction';
|
|
4
|
+
import { UnsignedTransaction } from '../serializer/schemas/definitions/unsigned-transaction';
|
|
5
|
+
import { ProtocolOptions } from '../utils/ProtocolOptions';
|
|
6
|
+
import { ProtocolSymbols } from '../utils/ProtocolSymbols';
|
|
7
|
+
export interface FeeDefaults {
|
|
8
|
+
low: string;
|
|
9
|
+
medium: string;
|
|
10
|
+
high: string;
|
|
11
|
+
}
|
|
12
|
+
export interface CoinAddress {
|
|
13
|
+
asString(): string;
|
|
14
|
+
}
|
|
15
|
+
export interface ICoinBaseProtocol {
|
|
16
|
+
symbol: string;
|
|
17
|
+
name: string;
|
|
18
|
+
marketSymbol: string;
|
|
19
|
+
feeSymbol: string;
|
|
20
|
+
feeDefaults: FeeDefaults;
|
|
21
|
+
decimals: number;
|
|
22
|
+
feeDecimals: number;
|
|
23
|
+
identifier: ProtocolSymbols;
|
|
24
|
+
units: {
|
|
25
|
+
unitSymbol: string;
|
|
26
|
+
factor: string;
|
|
27
|
+
}[];
|
|
28
|
+
supportsHD: boolean;
|
|
29
|
+
standardDerivationPath: string;
|
|
30
|
+
addressIsCaseSensitive: boolean;
|
|
31
|
+
addressValidationPattern: string;
|
|
32
|
+
addressPlaceholder: string;
|
|
33
|
+
options: ProtocolOptions;
|
|
34
|
+
cryptoClient: CryptoClient;
|
|
35
|
+
getAddressFromPublicKey(publicKey: string, cursor?: IProtocolAddressCursor): Promise<IAirGapAddressResult>;
|
|
36
|
+
getAddressesFromPublicKey(publicKey: string, cursor?: IProtocolAddressCursor): Promise<IAirGapAddressResult[]>;
|
|
37
|
+
getAddressFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressDerivationIndex: number): Promise<IAirGapAddressResult>;
|
|
38
|
+
getAddressesFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressCount: number, offset: number): Promise<IAirGapAddressResult[]>;
|
|
39
|
+
getTransactionDetails(transaction: UnsignedTransaction, data?: {
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}): Promise<IAirGapTransaction[]>;
|
|
42
|
+
getTransactionDetailsFromSigned(transaction: SignedTransaction, data?: {
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}): Promise<IAirGapTransaction[]>;
|
|
45
|
+
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
46
|
+
encryptAsymmetric(payload: string, publicKey: string): Promise<string>;
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ICoinBaseProtocol.js","sourceRoot":"","sources":["../../src/protocols/ICoinBaseProtocol.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IAirGapSignedTransaction } from '../interfaces/IAirGapSignedTransaction';
|
|
2
|
+
import { ICoinBaseProtocol } from './ICoinBaseProtocol';
|
|
3
|
+
export interface ICoinOfflineProtocol extends ICoinBaseProtocol {
|
|
4
|
+
getPublicKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
5
|
+
getPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
6
|
+
getExtendedPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
7
|
+
getPublicKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
8
|
+
getPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
9
|
+
signWithExtendedPrivateKey(extendedPrivateKey: string, transaction: any, childDerivationPath?: string): Promise<IAirGapSignedTransaction>;
|
|
10
|
+
signWithPrivateKey(privateKey: string, transaction: any): Promise<IAirGapSignedTransaction>;
|
|
11
|
+
getExtendedPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
12
|
+
signMessage(message: string, keypair: {
|
|
13
|
+
publicKey?: string;
|
|
14
|
+
privateKey: string;
|
|
15
|
+
}): Promise<string>;
|
|
16
|
+
decryptAsymmetric(encryptedPayload: string, keypair: {
|
|
17
|
+
publicKey?: string;
|
|
18
|
+
privateKey: string;
|
|
19
|
+
}): Promise<string>;
|
|
20
|
+
encryptAES(payload: string, privateKey: string): Promise<string>;
|
|
21
|
+
decryptAES(encryptedPayload: string, privateKey: string): Promise<string>;
|
|
22
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ICoinOfflineProtocol.js","sourceRoot":"","sources":["../../src/protocols/ICoinOfflineProtocol.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { AirGapTransactionStatus, IAirGapTransactionResult } from '../interfaces/IAirGapTransaction';
|
|
2
|
+
import { IProtocolTransactionCursor } from './../interfaces/IAirGapTransaction';
|
|
3
|
+
import { FeeDefaults, ICoinBaseProtocol } from './ICoinBaseProtocol';
|
|
4
|
+
import { ICoinSubProtocol } from './ICoinSubProtocol';
|
|
5
|
+
export interface ICoinOnlineProtocol extends ICoinBaseProtocol {
|
|
6
|
+
getBlockExplorerLinkForAddress(address: string): Promise<string>;
|
|
7
|
+
getBlockExplorerLinkForTxId(txId: string): Promise<string>;
|
|
8
|
+
getTransactionsFromPublicKey(publicKey: string, limit: number, cursor?: IProtocolTransactionCursor): Promise<IAirGapTransactionResult>;
|
|
9
|
+
getTransactionsFromExtendedPublicKey(extendedPublicKey: string, limit: number, cursor?: IProtocolTransactionCursor): Promise<IAirGapTransactionResult>;
|
|
10
|
+
getTransactionsFromAddresses(addresses: string[], limit: number, cursor?: IProtocolTransactionCursor): Promise<IAirGapTransactionResult>;
|
|
11
|
+
getBalanceOfAddresses(addresses: string[], data?: {
|
|
12
|
+
[key: string]: unknown;
|
|
13
|
+
}): Promise<string>;
|
|
14
|
+
getBalanceOfPublicKey(publicKey: string, data?: {
|
|
15
|
+
addressIndex?: number;
|
|
16
|
+
[key: string]: unknown;
|
|
17
|
+
}): Promise<string>;
|
|
18
|
+
getBalanceOfExtendedPublicKey(extendedPublicKey: string, offset: number, data?: {
|
|
19
|
+
[key: string]: unknown;
|
|
20
|
+
}): Promise<string>;
|
|
21
|
+
getAvailableBalanceOfAddresses(addresses: string[], data?: {
|
|
22
|
+
[key: string]: unknown;
|
|
23
|
+
}): Promise<string>;
|
|
24
|
+
getTransactionStatuses(transactionHash: string[]): Promise<AirGapTransactionStatus[]>;
|
|
25
|
+
getBalanceOfPublicKeyForSubProtocols(publicKey: string, subProtocols: ICoinSubProtocol[]): Promise<string[]>;
|
|
26
|
+
estimateMaxTransactionValueFromExtendedPublicKey(extendedPublicKey: string, recipients: string[], fee?: string, data?: {
|
|
27
|
+
[key: string]: unknown;
|
|
28
|
+
}): Promise<string>;
|
|
29
|
+
estimateMaxTransactionValueFromPublicKey(publicKey: string, recipients: string[], fee?: string, data?: {
|
|
30
|
+
addressIndex?: number;
|
|
31
|
+
[key: string]: unknown;
|
|
32
|
+
}): Promise<string>;
|
|
33
|
+
estimateFeeDefaultsFromExtendedPublicKey(publicKey: string, recipients: string[], values: string[], data?: {
|
|
34
|
+
[key: string]: unknown;
|
|
35
|
+
}): Promise<FeeDefaults>;
|
|
36
|
+
estimateFeeDefaultsFromPublicKey(publicKey: string, recipients: string[], values: string[], data?: {
|
|
37
|
+
[key: string]: unknown;
|
|
38
|
+
}): Promise<FeeDefaults>;
|
|
39
|
+
prepareTransactionFromExtendedPublicKey(extendedPublicKey: string, offset: number, recipients: string[], values: string[], fee: string, extras?: {
|
|
40
|
+
[key: string]: unknown;
|
|
41
|
+
}): Promise<any>;
|
|
42
|
+
prepareTransactionFromPublicKey(publicKey: string, recipients: string[], values: string[], fee: string, extras?: {
|
|
43
|
+
[key: string]: unknown;
|
|
44
|
+
}): Promise<any>;
|
|
45
|
+
broadcastTransaction(rawTransaction: any): Promise<string>;
|
|
46
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ICoinOnlineProtocol.js","sourceRoot":"","sources":["../../src/protocols/ICoinOnlineProtocol.ts"],"names":[],"mappings":""}
|
|
@@ -1,115 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
import { AirGapTransactionStatus, IAirGapTransaction, IAirGapTransactionResult } from '../interfaces/IAirGapTransaction';
|
|
5
|
-
import { SignedTransaction } from '../serializer/schemas/definitions/signed-transaction';
|
|
6
|
-
import { UnsignedTransaction } from '../serializer/schemas/definitions/unsigned-transaction';
|
|
7
|
-
import { ProtocolOptions } from '../utils/ProtocolOptions';
|
|
8
|
-
import { ProtocolSymbols } from '../utils/ProtocolSymbols';
|
|
9
|
-
import { IProtocolTransactionCursor } from './../interfaces/IAirGapTransaction';
|
|
10
|
-
import { ICoinSubProtocol } from './ICoinSubProtocol';
|
|
11
|
-
export interface FeeDefaults {
|
|
12
|
-
low: string;
|
|
13
|
-
medium: string;
|
|
14
|
-
high: string;
|
|
15
|
-
}
|
|
1
|
+
import { ICoinOfflineProtocol } from './ICoinOfflineProtocol';
|
|
2
|
+
import { ICoinOnlineProtocol } from './ICoinOnlineProtocol';
|
|
3
|
+
export { CoinAddress, FeeDefaults } from './ICoinBaseProtocol';
|
|
16
4
|
export interface CurrencyUnit {
|
|
17
5
|
unitSymbol: string;
|
|
18
6
|
factor: string;
|
|
19
7
|
}
|
|
20
|
-
export interface
|
|
21
|
-
getValue(): string;
|
|
22
|
-
}
|
|
23
|
-
export interface ICoinProtocol {
|
|
24
|
-
symbol: string;
|
|
25
|
-
name: string;
|
|
26
|
-
marketSymbol: string;
|
|
27
|
-
feeSymbol: string;
|
|
28
|
-
feeDefaults: FeeDefaults;
|
|
29
|
-
decimals: number;
|
|
30
|
-
feeDecimals: number;
|
|
31
|
-
identifier: ProtocolSymbols;
|
|
32
|
-
units: {
|
|
33
|
-
unitSymbol: string;
|
|
34
|
-
factor: string;
|
|
35
|
-
}[];
|
|
36
|
-
supportsHD: boolean;
|
|
37
|
-
standardDerivationPath: string;
|
|
38
|
-
addressIsCaseSensitive: boolean;
|
|
39
|
-
addressValidationPattern: string;
|
|
40
|
-
addressPlaceholder: string;
|
|
41
|
-
subProtocols?: ICoinSubProtocol[];
|
|
42
|
-
options: ProtocolOptions;
|
|
43
|
-
cryptoClient: CryptoClient;
|
|
44
|
-
getBlockExplorerLinkForAddress(address: string): Promise<string>;
|
|
45
|
-
getBlockExplorerLinkForTxId(txId: string): Promise<string>;
|
|
46
|
-
getPublicKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
47
|
-
getPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<Buffer>;
|
|
48
|
-
getExtendedPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
49
|
-
getPublicKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
50
|
-
getPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<Buffer>;
|
|
51
|
-
getExtendedPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
52
|
-
getAddressFromPublicKey(publicKey: string): Promise<CoinAddress>;
|
|
53
|
-
getAddressesFromPublicKey(publicKey: string): Promise<CoinAddress[]>;
|
|
54
|
-
getAddressFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressDerivationIndex: number): Promise<CoinAddress>;
|
|
55
|
-
getAddressesFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressCount: number, offset: number): Promise<CoinAddress[]>;
|
|
56
|
-
getNextAddressFromPublicKey(publicKey: string, current: CoinAddress): Promise<CoinAddress>;
|
|
57
|
-
getTransactionsFromPublicKey(publicKey: string, limit: number, cursor?: IProtocolTransactionCursor): Promise<IAirGapTransactionResult>;
|
|
58
|
-
getTransactionsFromExtendedPublicKey(extendedPublicKey: string, limit: number, cursor?: IProtocolTransactionCursor): Promise<IAirGapTransactionResult>;
|
|
59
|
-
getTransactionsFromAddresses(addresses: string[], limit: number, cursor?: IProtocolTransactionCursor): Promise<IAirGapTransactionResult>;
|
|
60
|
-
signWithExtendedPrivateKey(extendedPrivateKey: string, transaction: any, childDerivationPath?: string): Promise<IAirGapSignedTransaction>;
|
|
61
|
-
signWithPrivateKey(privateKey: Buffer, transaction: any): Promise<IAirGapSignedTransaction>;
|
|
62
|
-
getTransactionDetails(transaction: UnsignedTransaction, data?: {
|
|
63
|
-
[key: string]: unknown;
|
|
64
|
-
}): Promise<IAirGapTransaction[]>;
|
|
65
|
-
getTransactionDetailsFromSigned(transaction: SignedTransaction, data?: {
|
|
66
|
-
[key: string]: unknown;
|
|
67
|
-
}): Promise<IAirGapTransaction[]>;
|
|
68
|
-
getBalanceOfAddresses(addresses: string[], data?: {
|
|
69
|
-
[key: string]: unknown;
|
|
70
|
-
}): Promise<string>;
|
|
71
|
-
getBalanceOfPublicKey(publicKey: string, data?: {
|
|
72
|
-
addressIndex?: number;
|
|
73
|
-
[key: string]: unknown;
|
|
74
|
-
}): Promise<string>;
|
|
75
|
-
getBalanceOfExtendedPublicKey(extendedPublicKey: string, offset: number, data?: {
|
|
76
|
-
[key: string]: unknown;
|
|
77
|
-
}): Promise<string>;
|
|
78
|
-
getAvailableBalanceOfAddresses(addresses: string[], data?: {
|
|
79
|
-
[key: string]: unknown;
|
|
80
|
-
}): Promise<string>;
|
|
81
|
-
getTransactionStatuses(transactionHash: string[]): Promise<AirGapTransactionStatus[]>;
|
|
82
|
-
getBalanceOfPublicKeyForSubProtocols(publicKey: string, subProtocols: ICoinSubProtocol[]): Promise<string[]>;
|
|
83
|
-
estimateMaxTransactionValueFromExtendedPublicKey(extendedPublicKey: string, recipients: string[], fee?: string, data?: {
|
|
84
|
-
[key: string]: unknown;
|
|
85
|
-
}): Promise<string>;
|
|
86
|
-
estimateMaxTransactionValueFromPublicKey(publicKey: string, recipients: string[], fee?: string, data?: {
|
|
87
|
-
addressIndex?: number;
|
|
88
|
-
[key: string]: unknown;
|
|
89
|
-
}): Promise<string>;
|
|
90
|
-
estimateFeeDefaultsFromExtendedPublicKey(publicKey: string, recipients: string[], values: string[], data?: {
|
|
91
|
-
[key: string]: unknown;
|
|
92
|
-
}): Promise<FeeDefaults>;
|
|
93
|
-
estimateFeeDefaultsFromPublicKey(publicKey: string, recipients: string[], values: string[], data?: {
|
|
94
|
-
[key: string]: unknown;
|
|
95
|
-
}): Promise<FeeDefaults>;
|
|
96
|
-
prepareTransactionFromExtendedPublicKey(extendedPublicKey: string, offset: number, recipients: string[], values: string[], fee: string, extras?: {
|
|
97
|
-
[key: string]: unknown;
|
|
98
|
-
}): Promise<any>;
|
|
99
|
-
prepareTransactionFromPublicKey(publicKey: string, recipients: string[], values: string[], fee: string, extras?: {
|
|
100
|
-
[key: string]: unknown;
|
|
101
|
-
}): Promise<any>;
|
|
102
|
-
broadcastTransaction(rawTransaction: any): Promise<string>;
|
|
103
|
-
signMessage(message: string, keypair: {
|
|
104
|
-
publicKey?: string;
|
|
105
|
-
privateKey: Buffer;
|
|
106
|
-
}): Promise<string>;
|
|
107
|
-
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
108
|
-
encryptAsymmetric(payload: string, publicKey: string): Promise<string>;
|
|
109
|
-
decryptAsymmetric(encryptedPayload: string, keypair: {
|
|
110
|
-
publicKey?: string;
|
|
111
|
-
privateKey: Buffer;
|
|
112
|
-
}): Promise<string>;
|
|
113
|
-
encryptAES(payload: string, privateKey: Buffer): Promise<string>;
|
|
114
|
-
decryptAES(encryptedPayload: string, privateKey: Buffer): Promise<string>;
|
|
8
|
+
export interface ICoinProtocol extends ICoinOnlineProtocol, ICoinOfflineProtocol {
|
|
115
9
|
}
|
|
@@ -1,13 +1,14 @@
|
|
|
1
|
+
import { IAirGapAddressResult } from '../interfaces/IAirGapAddress';
|
|
1
2
|
import { IProtocolTransactionCursor } from '../interfaces/IAirGapTransaction';
|
|
2
|
-
import { FeeDefaults
|
|
3
|
+
import { FeeDefaults } from './ICoinProtocol';
|
|
3
4
|
import { TezosTransactionResult } from './tezos/types/TezosTransactionResult';
|
|
4
5
|
export declare abstract class NonExtendedProtocol {
|
|
5
6
|
getExtendedPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
6
7
|
getExtendedPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
7
8
|
getBalanceOfExtendedPublicKey(extendedPublicKey: string, offset: number): Promise<string>;
|
|
8
9
|
signWithExtendedPrivateKey(extendedPrivateKey: string, transaction: any, childDerivationPath: string): Promise<string>;
|
|
9
|
-
getAddressFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressDerivationIndex: number): Promise<
|
|
10
|
-
getAddressesFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressCount: number, offset: number): Promise<
|
|
10
|
+
getAddressFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressDerivationIndex: number): Promise<IAirGapAddressResult>;
|
|
11
|
+
getAddressesFromExtendedPublicKey(extendedPublicKey: string, visibilityDerivationIndex: number, addressCount: number, offset: number): Promise<IAirGapAddressResult[]>;
|
|
11
12
|
estimateMaxTransactionValueFromExtendedPublicKey(extendedPublicKey: string, recipients: string[], fee: string): Promise<string>;
|
|
12
13
|
estimateFeeDefaultsFromExtendedPublicKey(publicKey: string, recipients: string[], values: string[], data?: any): Promise<FeeDefaults>;
|
|
13
14
|
getTransactionsFromExtendedPublicKey(extendedPublicKey: string, limit: number, cursor: IProtocolTransactionCursor): Promise<TezosTransactionResult>;
|
|
@@ -17,7 +17,10 @@ var NonExtendedProtocol = /** @class */ (function () {
|
|
|
17
17
|
return Promise.reject('extended private key signing for not implemented');
|
|
18
18
|
};
|
|
19
19
|
NonExtendedProtocol.prototype.getAddressFromExtendedPublicKey = function (extendedPublicKey, visibilityDerivationIndex, addressDerivationIndex) {
|
|
20
|
-
return Promise.resolve({
|
|
20
|
+
return Promise.resolve({
|
|
21
|
+
address: '',
|
|
22
|
+
cursor: { hasNext: false }
|
|
23
|
+
});
|
|
21
24
|
};
|
|
22
25
|
NonExtendedProtocol.prototype.getAddressesFromExtendedPublicKey = function (extendedPublicKey, visibilityDerivationIndex, addressCount, offset) {
|
|
23
26
|
return Promise.resolve([]);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NonExtendedProtocol.js","sourceRoot":"","sources":["../../src/protocols/NonExtendedProtocol.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"NonExtendedProtocol.js","sourceRoot":"","sources":["../../src/protocols/NonExtendedProtocol.ts"],"names":[],"mappings":";;;AAMA;IAAA;IAmEA,CAAC;IAlEQ,+DAAiC,GAAxC,UAAyC,QAAgB,EAAE,cAAsB,EAAE,QAAiB;QAClG,MAAM,OAAO,CAAC,MAAM,CAAC,8CAA8C,CAAC,CAAA;IACtE,CAAC;IAEM,gEAAkC,GAAzC,UAA0C,MAAc,EAAE,cAAsB;QAC9E,MAAM,OAAO,CAAC,MAAM,CAAC,8CAA8C,CAAC,CAAA;IACtE,CAAC;IAEM,2DAA6B,GAApC,UAAqC,iBAAyB,EAAE,MAAc;QAC5E,OAAO,OAAO,CAAC,MAAM,CAAC,yCAAyC,CAAC,CAAA;IAClE,CAAC;IAEM,wDAA0B,GAAjC,UAAkC,kBAA0B,EAAE,WAAgB,EAAE,mBAA2B;QACzG,OAAO,OAAO,CAAC,MAAM,CAAC,kDAAkD,CAAC,CAAA;IAC3E,CAAC;IAEM,6DAA+B,GAAtC,UACE,iBAAyB,EACzB,yBAAiC,EACjC,sBAA8B;QAE9B,OAAO,OAAO,CAAC,OAAO,CAAC;YACrB,OAAO,EAAE,EAAE;YACX,MAAM,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE;SAC3B,CAAC,CAAA;IACJ,CAAC;IAEM,+DAAiC,GAAxC,UACE,iBAAyB,EACzB,yBAAiC,EACjC,YAAoB,EACpB,MAAc;QAEd,OAAO,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,CAAA;IAC5B,CAAC;IAEM,8EAAgD,GAAvD,UAAwD,iBAAyB,EAAE,UAAoB,EAAE,GAAW;QAClH,OAAO,OAAO,CAAC,MAAM,CAAC,gEAAgE,CAAC,CAAA;IACzF,CAAC;IAEM,sEAAwC,GAA/C,UACE,SAAiB,EACjB,UAAoB,EACpB,MAAgB,EAChB,IAAU;QAEV,OAAO,OAAO,CAAC,MAAM,CAAC,mEAAmE,CAAC,CAAA;IAC5F,CAAC;IAEM,kEAAoC,GAA3C,UACE,iBAAyB,EACzB,KAAa,EACb,MAAkC;QAElC,OAAO,OAAO,CAAC,MAAM,CAAC,wDAAwD,CAAC,CAAA;IACjF,CAAC;IAEM,qEAAuC,GAA9C,UACE,iBAAyB,EACzB,MAAc,EACd,UAAoB,EACpB,MAAgB,EAChB,GAAW;QAEX,OAAO,OAAO,CAAC,MAAM,CAAC,wCAAwC,CAAC,CAAA;IACjE,CAAC;IACH,0BAAC;AAAD,CAAC,AAnED,IAmEC;AAnEqB,kDAAmB"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { CryptoClient } from './CryptoClient';
|
|
3
2
|
export declare abstract class Secp256k1CryptoClient extends CryptoClient {
|
|
4
3
|
encryptAsymmetric(payload: string, publicKey: string): Promise<string>;
|
|
5
4
|
decryptAsymmetric(encryptedPayload: string, keypair: {
|
|
6
5
|
publicKey: string;
|
|
7
|
-
privateKey:
|
|
6
|
+
privateKey: string;
|
|
8
7
|
}): Promise<string>;
|
|
9
8
|
}
|
|
@@ -67,7 +67,7 @@ var Secp256k1CryptoClient = /** @class */ (function (_super) {
|
|
|
67
67
|
Secp256k1CryptoClient.prototype.decryptAsymmetric = function (encryptedPayload, keypair) {
|
|
68
68
|
return __awaiter(this, void 0, void 0, function () {
|
|
69
69
|
return __generator(this, function (_a) {
|
|
70
|
-
return [2 /*return*/, index_1.decrypt(keypair.privateKey
|
|
70
|
+
return [2 /*return*/, index_1.decrypt(keypair.privateKey, Buffer.from(encryptedPayload, 'hex')).toString()];
|
|
71
71
|
});
|
|
72
72
|
});
|
|
73
73
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Secp256k1CryptoClient.js","sourceRoot":"","sources":["../../src/protocols/Secp256k1CryptoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAA8E;AAE9E,+CAA6C;AAE7C;IAAoD,yCAAY;IAAhE;;IAQA,CAAC;IAPc,iDAAiB,GAA9B,UAA+B,OAAe,EAAE,SAAiB;;;gBAC/D,sBAAO,eAAO,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;;KAChE;IAEY,iDAAiB,GAA9B,UAA+B,gBAAwB,EAAE,OAAkD;;;gBACzG,sBAAO,eAAO,CAAC,OAAO,CAAC,UAAU,
|
|
1
|
+
{"version":3,"file":"Secp256k1CryptoClient.js","sourceRoot":"","sources":["../../src/protocols/Secp256k1CryptoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qEAA8E;AAE9E,+CAA6C;AAE7C;IAAoD,yCAAY;IAAhE;;IAQA,CAAC;IAPc,iDAAiB,GAA9B,UAA+B,OAAe,EAAE,SAAiB;;;gBAC/D,sBAAO,eAAO,CAAC,SAAS,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;;KAChE;IAEY,iDAAiB,GAA9B,UAA+B,gBAAwB,EAAE,OAAkD;;;gBACzG,sBAAO,eAAO,CAAC,OAAO,CAAC,UAAU,EAAE,MAAM,CAAC,IAAI,CAAC,gBAAgB,EAAE,KAAK,CAAC,CAAC,CAAC,QAAQ,EAAE,EAAA;;;KACpF;IACH,4BAAC;AAAD,CAAC,AARD,CAAoD,2BAAY,GAQ/D;AARqB,sDAAqB"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { CryptoClient } from './CryptoClient';
|
|
3
2
|
export declare abstract class Sr25519CryptoClient extends CryptoClient {
|
|
4
3
|
encryptAsymmetric(payload: string, publicKey: string): Promise<string>;
|
|
5
4
|
decryptAsymmetric(encryptedPayload: string, keypair: {
|
|
6
5
|
publicKey: string;
|
|
7
|
-
privateKey:
|
|
6
|
+
privateKey: string;
|
|
8
7
|
}): Promise<string>;
|
|
9
8
|
}
|
|
@@ -29,7 +29,7 @@ var AeternityAddress = /** @class */ (function () {
|
|
|
29
29
|
var base58 = bs58check.encode(Buffer.from(publicKey, 'hex'));
|
|
30
30
|
return new AeternityAddress("ak_" + base58);
|
|
31
31
|
};
|
|
32
|
-
AeternityAddress.prototype.
|
|
32
|
+
AeternityAddress.prototype.asString = function () {
|
|
33
33
|
return this.value;
|
|
34
34
|
};
|
|
35
35
|
return AeternityAddress;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { Ed25519CryptoClient } from '../Ed25519CryptoClient';
|
|
3
2
|
export declare class AeternityCryptoClient extends Ed25519CryptoClient {
|
|
4
3
|
constructor();
|
|
5
4
|
signMessage(message: string, keypair: {
|
|
6
|
-
privateKey:
|
|
5
|
+
privateKey: string;
|
|
7
6
|
}): Promise<string>;
|
|
8
7
|
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
9
8
|
}
|
|
@@ -76,7 +76,7 @@ var AeternityCryptoClient = /** @class */ (function (_super) {
|
|
|
76
76
|
case 1:
|
|
77
77
|
_a.sent();
|
|
78
78
|
messageBuffer = personalMessageToBinary(message);
|
|
79
|
-
rawSignature = sodium.crypto_sign_detached(messageBuffer, keypair.privateKey);
|
|
79
|
+
rawSignature = sodium.crypto_sign_detached(messageBuffer, Buffer.from(keypair.privateKey, 'hex'));
|
|
80
80
|
return [2 /*return*/, Buffer.from(rawSignature).toString('hex')];
|
|
81
81
|
}
|
|
82
82
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AeternityCryptoClient.js","sourceRoot":"","sources":["../../../src/protocols/aeternity/AeternityCryptoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6C;AAC7C,uCAAgD;AAChD,4DAAmD;AAEnD,8DAA4D;AAE5D,IAAM,uBAAuB,GAAG,UAAC,OAAe;IAC9C,IAAM,MAAM,GAAW,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAA;IACzE,IAAM,aAAa,GAAW,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC1D,IAAI,aAAa,CAAC,MAAM,IAAI,IAAI,EAAE;QAChC,MAAM,IAAI,0BAAiB,CAAC,sBAAM,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAA;KAClE;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAA;AAClH,CAAC,CAAA;AAED;IAA2C,yCAAmB;IAC5D;eACE,iBAAO;IACT,CAAC;IAEY,2CAAW,GAAxB,UAAyB,OAAe,EAAE,OAA+B;;;;;4BACvE,qBAAM,MAAM,CAAC,KAAK,EAAA;;wBAAlB,SAAkB,CAAA;wBAEZ,aAAa,GAAW,uBAAuB,CAAC,OAAO,CAAC,CAAA;wBACxD,YAAY,GAAe,MAAM,CAAC,oBAAoB,CAAC,aAAa,EAAE,OAAO,CAAC,UAAU,CAAC,CAAA;
|
|
1
|
+
{"version":3,"file":"AeternityCryptoClient.js","sourceRoot":"","sources":["../../../src/protocols/aeternity/AeternityCryptoClient.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,2CAA6C;AAC7C,uCAAgD;AAChD,4DAAmD;AAEnD,8DAA4D;AAE5D,IAAM,uBAAuB,GAAG,UAAC,OAAe;IAC9C,IAAM,MAAM,GAAW,MAAM,CAAC,IAAI,CAAC,6BAA6B,EAAE,MAAM,CAAC,CAAA;IACzE,IAAM,aAAa,GAAW,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAA;IAC1D,IAAI,aAAa,CAAC,MAAM,IAAI,IAAI,EAAE;QAChC,MAAM,IAAI,0BAAiB,CAAC,sBAAM,CAAC,SAAS,EAAE,kBAAkB,CAAC,CAAA;KAClE;IAED,OAAO,MAAM,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,IAAI,CAAC,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,EAAE,aAAa,CAAC,CAAC,CAAA;AAClH,CAAC,CAAA;AAED;IAA2C,yCAAmB;IAC5D;eACE,iBAAO;IACT,CAAC;IAEY,2CAAW,GAAxB,UAAyB,OAAe,EAAE,OAA+B;;;;;4BACvE,qBAAM,MAAM,CAAC,KAAK,EAAA;;wBAAlB,SAAkB,CAAA;wBAEZ,aAAa,GAAW,uBAAuB,CAAC,OAAO,CAAC,CAAA;wBACxD,YAAY,GAAe,MAAM,CAAC,oBAAoB,CAAC,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,KAAK,CAAC,CAAC,CAAA;wBAEnH,sBAAO,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,EAAA;;;;KACjD;IAEY,6CAAa,GAA1B,UAA2B,OAAe,EAAE,SAAiB,EAAE,SAAiB;;;;;4BAC9E,qBAAM,MAAM,CAAC,KAAK,EAAA;;wBAAlB,SAAkB,CAAA;wBAEZ,YAAY,GAAW,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAA;wBACpD,aAAa,GAAW,uBAAuB,CAAC,OAAO,CAAC,CAAA;wBAE9D,sBAAO,MAAM,CAAC,2BAA2B,CAAC,YAAY,EAAE,aAAa,EAAE,MAAM,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC,EAAA;;;;KACtG;IACH,4BAAC;AAAD,CAAC,AAtBD,CAA2C,yCAAmB,GAsB7D;AAtBY,sDAAqB"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
1
|
import { IAirGapSignedTransaction } from '../../interfaces/IAirGapSignedTransaction';
|
|
3
2
|
import { AirGapTransactionStatus, IAirGapTransaction } from '../../interfaces/IAirGapTransaction';
|
|
4
3
|
import { SignedAeternityTransaction } from '../../serializer/schemas/definitions/signed-transaction-aeternity';
|
|
@@ -8,10 +7,9 @@ import { ProtocolSymbols } from '../../utils/ProtocolSymbols';
|
|
|
8
7
|
import { CurrencyUnit, FeeDefaults, ICoinProtocol } from '../ICoinProtocol';
|
|
9
8
|
import { ICoinSubProtocol } from '../ICoinSubProtocol';
|
|
10
9
|
import { NonExtendedProtocol } from '../NonExtendedProtocol';
|
|
11
|
-
import { AeternityTransactionCursor, AeternityTransactionResult } from './AeternityTypes';
|
|
12
|
-
import { AeternityAddress } from './AeternityAddress';
|
|
13
10
|
import { AeternityCryptoClient } from './AeternityCryptoClient';
|
|
14
11
|
import { AeternityProtocolOptions } from './AeternityProtocolOptions';
|
|
12
|
+
import { AeternityAddressCursor, AeternityAddressResult, AeternityTransactionCursor, AeternityTransactionResult } from './AeternityTypes';
|
|
15
13
|
export declare class AeternityProtocol extends NonExtendedProtocol implements ICoinProtocol {
|
|
16
14
|
readonly options: AeternityProtocolOptions;
|
|
17
15
|
symbol: string;
|
|
@@ -39,7 +37,7 @@ export declare class AeternityProtocol extends NonExtendedProtocol implements IC
|
|
|
39
37
|
getBlockExplorerLinkForAddress(address: string): Promise<string>;
|
|
40
38
|
getBlockExplorerLinkForTxId(txId: string): Promise<string>;
|
|
41
39
|
getPublicKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
42
|
-
getPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<
|
|
40
|
+
getPrivateKeyFromMnemonic(mnemonic: string, derivationPath: string, password?: string): Promise<string>;
|
|
43
41
|
/**
|
|
44
42
|
* Returns the PublicKey as String, derived from a supplied hex-string
|
|
45
43
|
* @param secret HEX-Secret from BIP39
|
|
@@ -51,14 +49,13 @@ export declare class AeternityProtocol extends NonExtendedProtocol implements IC
|
|
|
51
49
|
* @param secret HEX-Secret from BIP39
|
|
52
50
|
* @param derivationPath DerivationPath for Key
|
|
53
51
|
*/
|
|
54
|
-
getPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<
|
|
55
|
-
getAddressFromPublicKey(publicKey: string): Promise<
|
|
56
|
-
getAddressesFromPublicKey(publicKey: string): Promise<
|
|
57
|
-
getNextAddressFromPublicKey(publicKey: string, current: AeternityAddress): Promise<AeternityAddress>;
|
|
52
|
+
getPrivateKeyFromHexSecret(secret: string, derivationPath: string): Promise<string>;
|
|
53
|
+
getAddressFromPublicKey(publicKey: string, cursor?: AeternityAddressCursor): Promise<AeternityAddressResult>;
|
|
54
|
+
getAddressesFromPublicKey(publicKey: string, cursor?: AeternityAddressCursor): Promise<AeternityAddressResult[]>;
|
|
58
55
|
getTransactionsFromPublicKey(publicKey: string, limit: number, cursor?: AeternityTransactionCursor): Promise<AeternityTransactionResult>;
|
|
59
56
|
getTransactionsFromAddresses(addresses: string[], limit: number, cursor?: AeternityTransactionCursor): Promise<AeternityTransactionResult>;
|
|
60
57
|
protected getPageNumber(limit: number, offset: number): number;
|
|
61
|
-
signWithPrivateKey(privateKey:
|
|
58
|
+
signWithPrivateKey(privateKey: string, transaction: RawAeternityTransaction): Promise<IAirGapSignedTransaction>;
|
|
62
59
|
private decodeTx;
|
|
63
60
|
getTransactionDetails(unsignedTx: UnsignedAeternityTransaction): Promise<IAirGapTransaction[]>;
|
|
64
61
|
getTransactionDetailsFromSigned(signedTx: SignedAeternityTransaction): Promise<IAirGapTransaction[]>;
|
|
@@ -81,15 +78,15 @@ export declare class AeternityProtocol extends NonExtendedProtocol implements IC
|
|
|
81
78
|
broadcastTransaction(rawTransaction: string): Promise<string>;
|
|
82
79
|
private toHexBuffer;
|
|
83
80
|
signMessage(message: string, keypair: {
|
|
84
|
-
privateKey:
|
|
81
|
+
privateKey: string;
|
|
85
82
|
}): Promise<string>;
|
|
86
83
|
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
87
84
|
encryptAsymmetric(message: string, publicKey: string): Promise<string>;
|
|
88
85
|
decryptAsymmetric(message: string, keypair: {
|
|
89
86
|
publicKey: string;
|
|
90
|
-
privateKey:
|
|
87
|
+
privateKey: string;
|
|
91
88
|
}): Promise<string>;
|
|
92
|
-
encryptAES(message: string, privateKey:
|
|
93
|
-
decryptAES(message: string, privateKey:
|
|
89
|
+
encryptAES(message: string, privateKey: string): Promise<string>;
|
|
90
|
+
decryptAES(message: string, privateKey: string): Promise<string>;
|
|
94
91
|
getTransactionStatuses(transactionHashes: string[]): Promise<AirGapTransactionStatus[]>;
|
|
95
92
|
}
|