@airgap/tezos 0.13.45-beta.8 → 0.13.45
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/package.json +5 -5
- package/v1/data/TezosAddress.d.ts +0 -1
- package/v1/data/TezosAddress.js +0 -3
- package/v1/data/TezosAddress.js.map +1 -1
- package/v1/index.d.ts +6 -8
- package/v1/index.js +2 -7
- package/v1/index.js.map +1 -1
- package/v1/module/TezosModule.js +1 -4
- package/v1/module/TezosModule.js.map +1 -1
- package/v1/protocol/TezosProtocol.js +1 -1
- package/v1/protocol/TezosProtocol.js.map +1 -1
- package/v1/types/crypto.d.ts +1 -2
- package/v1/utils/address.d.ts +0 -1
- package/v1/utils/address.js +2 -8
- package/v1/utils/address.js.map +1 -1
- package/v1/utils/operations.d.ts +1 -3
- package/v1/utils/operations.js +2 -3
- package/v1/utils/operations.js.map +1 -1
- package/v1/utils/protocol/instance.d.ts +0 -3
- package/v1/utils/protocol/instance.js +1 -6
- package/v1/utils/protocol/instance.js.map +1 -1
- package/v1/utils/signature.d.ts +1 -3
- package/v1/utils/signature.js +3 -4
- package/v1/utils/signature.js.map +1 -1
- package/v1/crypto/TezosSecp256k1CryptoClient.d.ts +0 -12
- package/v1/crypto/TezosSecp256k1CryptoClient.js +0 -148
- package/v1/crypto/TezosSecp256k1CryptoClient.js.map +0 -1
- package/v1/protocol/TezosSecp256k1Protocol.d.ts +0 -110
- package/v1/protocol/TezosSecp256k1Protocol.js +0 -1441
- package/v1/protocol/TezosSecp256k1Protocol.js.map +0 -1
package/v1/utils/signature.js
CHANGED
|
@@ -5,16 +5,15 @@ var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
|
5
5
|
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
6
6
|
var module_kit_1 = require("@airgap/module-kit");
|
|
7
7
|
var convert_1 = require("./convert");
|
|
8
|
-
function convertSignature(signature, targetFormat
|
|
9
|
-
if (signatureType === void 0) { signatureType = 'ed25519Signature'; }
|
|
8
|
+
function convertSignature(signature, targetFormat) {
|
|
10
9
|
if (signature.format === targetFormat) {
|
|
11
10
|
return signature;
|
|
12
11
|
}
|
|
13
12
|
switch (signature.format) {
|
|
14
13
|
case 'encoded':
|
|
15
|
-
return (0, module_kit_1.newSignature)((0, convert_1.convertEncodedBytesString)(
|
|
14
|
+
return (0, module_kit_1.newSignature)((0, convert_1.convertEncodedBytesString)('ed25519Signature', signature.value, targetFormat), targetFormat);
|
|
16
15
|
case 'hex':
|
|
17
|
-
return (0, module_kit_1.newSignature)((0, convert_1.convertHexBytesString)(
|
|
16
|
+
return (0, module_kit_1.newSignature)((0, convert_1.convertHexBytesString)('ed25519Signature', signature.value, targetFormat), targetFormat);
|
|
18
17
|
default:
|
|
19
18
|
(0, coinlib_core_1.assertNever)(signature.format);
|
|
20
19
|
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.TEZOS, 'Unsupported signature format.');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../../src/v1/utils/signature.ts"],"names":[],"mappings":";;;AAAA,qDAA0D;AAC1D,sDAA8D;AAC9D,iDAA4D;AAE5D,qCAA4E;
|
|
1
|
+
{"version":3,"file":"signature.js","sourceRoot":"","sources":["../../../src/v1/utils/signature.ts"],"names":[],"mappings":";;;AAAA,qDAA0D;AAC1D,sDAA8D;AAC9D,iDAA4D;AAE5D,qCAA4E;AAE5E,SAAgB,gBAAgB,CAAC,SAAoB,EAAE,YAAiC;IACtF,IAAI,SAAS,CAAC,MAAM,KAAK,YAAY,EAAE;QACrC,OAAO,SAAS,CAAA;KACjB;IAED,QAAQ,SAAS,CAAC,MAAM,EAAE;QACxB,KAAK,SAAS;YACZ,OAAO,IAAA,yBAAY,EAAC,IAAA,mCAAyB,EAAC,kBAAkB,EAAE,SAAS,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,YAAY,CAAC,CAAA;QACjH,KAAK,KAAK;YACR,OAAO,IAAA,yBAAY,EAAC,IAAA,+BAAqB,EAAC,kBAAkB,EAAE,SAAS,CAAC,KAAK,EAAE,YAAY,CAAC,EAAE,YAAY,CAAC,CAAA;QAC7G;YACE,IAAA,0BAAW,EAAC,SAAS,CAAC,MAAM,CAAC,CAAA;YAC7B,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,KAAK,EAAE,+BAA+B,CAAC,CAAA;KAC5E;AACH,CAAC;AAdD,4CAcC"}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/// <reference types="node" />
|
|
2
|
-
import { Secp256k1CryptoClient } from '@airgap/coinlib-core/protocols/Secp256k1CryptoClient';
|
|
3
|
-
export declare class TezosSecp256k1CryptoClient extends Secp256k1CryptoClient {
|
|
4
|
-
constructor();
|
|
5
|
-
signMessage(message: string, keypair: {
|
|
6
|
-
privateKey: string;
|
|
7
|
-
}): Promise<string>;
|
|
8
|
-
operationSignature(privateKey: Buffer, binaryTransaction: Buffer): Buffer;
|
|
9
|
-
verifyMessage(message: string, signature: string, publicKey: string): Promise<boolean>;
|
|
10
|
-
private toBuffer;
|
|
11
|
-
private hash;
|
|
12
|
-
}
|
|
@@ -1,148 +0,0 @@
|
|
|
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
|
-
})();
|
|
17
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
18
|
-
if (k2 === undefined) k2 = k;
|
|
19
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
20
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
21
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
22
|
-
}
|
|
23
|
-
Object.defineProperty(o, k2, desc);
|
|
24
|
-
}) : (function(o, m, k, k2) {
|
|
25
|
-
if (k2 === undefined) k2 = k;
|
|
26
|
-
o[k2] = m[k];
|
|
27
|
-
}));
|
|
28
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
29
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
30
|
-
}) : function(o, v) {
|
|
31
|
-
o["default"] = v;
|
|
32
|
-
});
|
|
33
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
34
|
-
if (mod && mod.__esModule) return mod;
|
|
35
|
-
var result = {};
|
|
36
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
37
|
-
__setModuleDefault(result, mod);
|
|
38
|
-
return result;
|
|
39
|
-
};
|
|
40
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
41
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
42
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
43
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
44
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
45
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
46
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
47
|
-
});
|
|
48
|
-
};
|
|
49
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
50
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
51
|
-
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
52
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
53
|
-
function step(op) {
|
|
54
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
55
|
-
while (_) try {
|
|
56
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
57
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
58
|
-
switch (op[0]) {
|
|
59
|
-
case 0: case 1: t = op; break;
|
|
60
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
61
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
62
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
63
|
-
default:
|
|
64
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
65
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
66
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
67
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
68
|
-
if (t[2]) _.ops.pop();
|
|
69
|
-
_.trys.pop(); continue;
|
|
70
|
-
}
|
|
71
|
-
op = body.call(thisArg, _);
|
|
72
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
73
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
74
|
-
}
|
|
75
|
-
};
|
|
76
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
77
|
-
exports.TezosSecp256k1CryptoClient = void 0;
|
|
78
|
-
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
79
|
-
var coinlib_error_1 = require("@airgap/coinlib-core/errors/coinlib-error");
|
|
80
|
-
var Secp256k1CryptoClient_1 = require("@airgap/coinlib-core/protocols/Secp256k1CryptoClient");
|
|
81
|
-
var secp256k1 = __importStar(require("@airgap/coinlib-core/dependencies/src/secp256k1-4.0.2/elliptic"));
|
|
82
|
-
var blake2b_1 = require("@stablelib/blake2b");
|
|
83
|
-
var encoding_1 = require("../utils/encoding");
|
|
84
|
-
var transaction_1 = require("../utils/transaction");
|
|
85
|
-
var TezosSecp256k1CryptoClient = /** @class */ (function (_super) {
|
|
86
|
-
__extends(TezosSecp256k1CryptoClient, _super);
|
|
87
|
-
function TezosSecp256k1CryptoClient() {
|
|
88
|
-
return _super.call(this) || this;
|
|
89
|
-
}
|
|
90
|
-
TezosSecp256k1CryptoClient.prototype.signMessage = function (message, keypair) {
|
|
91
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
92
|
-
var bufferMessage, hashBytes, privateKeyBuffer, signatureObj, signature;
|
|
93
|
-
return __generator(this, function (_a) {
|
|
94
|
-
bufferMessage = this.toBuffer(message);
|
|
95
|
-
hashBytes = this.hash(bufferMessage);
|
|
96
|
-
privateKeyBuffer = Buffer.from(keypair.privateKey, 'hex');
|
|
97
|
-
signatureObj = secp256k1.ecdsaSign(hashBytes, privateKeyBuffer);
|
|
98
|
-
signature = (0, encoding_1.encodeBase58)(signatureObj.signature, 'secp256K1Signature');
|
|
99
|
-
return [2 /*return*/, signature];
|
|
100
|
-
});
|
|
101
|
-
});
|
|
102
|
-
};
|
|
103
|
-
TezosSecp256k1CryptoClient.prototype.operationSignature = function (privateKey, binaryTransaction) {
|
|
104
|
-
var watermarkedForgedOperationBytes = Buffer.concat([transaction_1.WATERMARK.operation, binaryTransaction]);
|
|
105
|
-
var hashedWatermarkedOpBytes = this.hash(watermarkedForgedOperationBytes);
|
|
106
|
-
var signatureObj = secp256k1.ecdsaSign(hashedWatermarkedOpBytes, privateKey);
|
|
107
|
-
return Buffer.from(signatureObj.signature);
|
|
108
|
-
};
|
|
109
|
-
TezosSecp256k1CryptoClient.prototype.verifyMessage = function (message, signature, publicKey) {
|
|
110
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
111
|
-
var rawSignature, bufferMessage, hashBytes, publicKeyBuffer, result;
|
|
112
|
-
return __generator(this, function (_a) {
|
|
113
|
-
if (signature.startsWith('spsig1')) {
|
|
114
|
-
rawSignature = (0, encoding_1.decodeBase58)(signature, 'secp256K1Signature');
|
|
115
|
-
}
|
|
116
|
-
else {
|
|
117
|
-
throw new errors_1.InvalidValueError(coinlib_error_1.Domain.TEZOS, "invalid signature: ".concat(JSON.stringify(signature)));
|
|
118
|
-
}
|
|
119
|
-
bufferMessage = this.toBuffer(message);
|
|
120
|
-
hashBytes = this.hash(bufferMessage);
|
|
121
|
-
publicKeyBuffer = Buffer.from(publicKey, 'hex');
|
|
122
|
-
result = secp256k1.ecdsaVerify(rawSignature, hashBytes, publicKeyBuffer);
|
|
123
|
-
return [2 /*return*/, result === 0];
|
|
124
|
-
});
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
TezosSecp256k1CryptoClient.prototype.toBuffer = function (message) {
|
|
128
|
-
if (message.length % 2 !== 0) {
|
|
129
|
-
return Buffer.from(message, 'utf8');
|
|
130
|
-
}
|
|
131
|
-
var adjustedMessage = message;
|
|
132
|
-
if (message.startsWith('0x')) {
|
|
133
|
-
adjustedMessage = message.slice(2);
|
|
134
|
-
}
|
|
135
|
-
var buffer = Buffer.from(adjustedMessage, 'hex');
|
|
136
|
-
if (buffer.length === adjustedMessage.length / 2) {
|
|
137
|
-
return buffer;
|
|
138
|
-
}
|
|
139
|
-
return Buffer.from(message, 'utf8');
|
|
140
|
-
};
|
|
141
|
-
TezosSecp256k1CryptoClient.prototype.hash = function (message, size) {
|
|
142
|
-
if (size === void 0) { size = 32; }
|
|
143
|
-
return Buffer.from((0, blake2b_1.hash)(message, size));
|
|
144
|
-
};
|
|
145
|
-
return TezosSecp256k1CryptoClient;
|
|
146
|
-
}(Secp256k1CryptoClient_1.Secp256k1CryptoClient));
|
|
147
|
-
exports.TezosSecp256k1CryptoClient = TezosSecp256k1CryptoClient;
|
|
148
|
-
//# sourceMappingURL=TezosSecp256k1CryptoClient.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TezosSecp256k1CryptoClient.js","sourceRoot":"","sources":["../../../src/v1/crypto/TezosSecp256k1CryptoClient.ts"],"names":[],"mappings":"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"}
|
|
@@ -1,110 +0,0 @@
|
|
|
1
|
-
import { DelegateeDetails, DelegationDetails, DelegatorDetails } from '@airgap/coinlib-core';
|
|
2
|
-
import { Address, AirGapProtocol, AirGapTransaction, AirGapTransactionsWithCursor, Amount, Balance, CryptoDerivative, FeeDefaults, KeyPair, ProtocolAccountMetadata, ProtocolMetadata, PublicKey, RecursivePartial, SecretKey, Signature, TransactionFullConfiguration, TransactionDetails, TransactionSimpleConfiguration } from '@airgap/module-kit';
|
|
3
|
-
import { AirGapDelegateProtocol } from '@airgap/module-kit/internal';
|
|
4
|
-
import { TezosSecp256k1CryptoConfiguration } from '../types/crypto';
|
|
5
|
-
import { TezosOperation } from '../types/operations/kinds/TezosOperation';
|
|
6
|
-
import { TezosTransactionParameters } from '../types/operations/kinds/Transaction';
|
|
7
|
-
import { TezosWrappedOperation } from '../types/operations/TezosWrappedOperation';
|
|
8
|
-
import { TezosProtocolNetwork, TezosProtocolOptions, TezosUnits, TezosUnstakeRequest } from '../types/protocol';
|
|
9
|
-
import { BakerDetails } from '../types/staking/BakerDetails';
|
|
10
|
-
import { TezosSignedTransaction, TezosTransactionCursor, TezosUnsignedTransaction } from '../types/transaction';
|
|
11
|
-
export interface TezosSecp256k1Protocol extends AirGapProtocol<{
|
|
12
|
-
AddressResult: Address;
|
|
13
|
-
ProtocolNetwork: TezosProtocolNetwork;
|
|
14
|
-
CryptoConfiguration: TezosSecp256k1CryptoConfiguration;
|
|
15
|
-
Units: TezosUnits;
|
|
16
|
-
FeeEstimation: FeeDefaults<TezosUnits>;
|
|
17
|
-
UnsignedTransaction: TezosUnsignedTransaction;
|
|
18
|
-
SignedTransaction: TezosSignedTransaction;
|
|
19
|
-
TransactionCursor: TezosTransactionCursor;
|
|
20
|
-
}, 'Crypto', 'FetchDataForAddress'>, AirGapDelegateProtocol {
|
|
21
|
-
isTezosSecp256k1Protocol: true;
|
|
22
|
-
getMinCycleDuration(): Promise<number>;
|
|
23
|
-
getstakeBalance(address: string): Promise<Balance<TezosUnits>>;
|
|
24
|
-
getUnstakeBalance(address: string): Promise<Balance<TezosUnits>>;
|
|
25
|
-
getDetailsFromWrappedOperation(wrappedOperation: TezosWrappedOperation): Promise<AirGapTransaction<TezosUnits, TezosUnits>[]>;
|
|
26
|
-
forgeOperation(wrappedOperation: TezosWrappedOperation): Promise<string>;
|
|
27
|
-
unforgeOperation(forged: string, type?: (TezosSignedTransaction | TezosUnsignedTransaction)['type']): Promise<TezosWrappedOperation>;
|
|
28
|
-
getOperationFeeDefaults(publicKey: PublicKey, operations: TezosOperation[]): Promise<FeeDefaults<TezosUnits>>;
|
|
29
|
-
prepareOperations(publicKey: PublicKey, operationRequests: TezosOperation[], overrideParameters?: boolean): Promise<TezosWrappedOperation>;
|
|
30
|
-
prepareTransactionsWithPublicKey(publicKey: PublicKey, details: TransactionDetails<TezosUnits>[], configuration?: TransactionFullConfiguration<TezosUnits> & {
|
|
31
|
-
operationsPerGroup?: number;
|
|
32
|
-
}): Promise<TezosUnsignedTransaction[]>;
|
|
33
|
-
bakerDetails(address: string | undefined): Promise<BakerDetails>;
|
|
34
|
-
getUnfinalizeRequest(address: string): Promise<TezosUnstakeRequest>;
|
|
35
|
-
getFinalizeableBalance(address: string): Promise<Balance<TezosUnits>>;
|
|
36
|
-
getTransactionFee(publicKey: PublicKey, details: TransactionDetails<TezosUnits>[], parameters?: TezosTransactionParameters): Promise<FeeDefaults<TezosUnits>>;
|
|
37
|
-
}
|
|
38
|
-
export declare const TEZOS_SECP256K1_DERIVATION_PATH: string;
|
|
39
|
-
export declare const TEZOS_SECP256K1_ACCOUNT_METADATA: ProtocolAccountMetadata;
|
|
40
|
-
export declare class TezosSecp256k1ProtocolImpl implements TezosSecp256k1Protocol {
|
|
41
|
-
readonly isTezosSecp256k1Protocol: true;
|
|
42
|
-
private readonly options;
|
|
43
|
-
private readonly forger;
|
|
44
|
-
private readonly accountant;
|
|
45
|
-
private readonly indexerClient;
|
|
46
|
-
private readonly cryptoClient;
|
|
47
|
-
constructor(options: RecursivePartial<TezosProtocolOptions>);
|
|
48
|
-
private readonly units;
|
|
49
|
-
private readonly feeDefaults;
|
|
50
|
-
private readonly metadata;
|
|
51
|
-
getMetadata(): Promise<ProtocolMetadata<TezosUnits>>;
|
|
52
|
-
getAddressFromPublicKey(publicKey: PublicKey): Promise<string>;
|
|
53
|
-
getDetailsFromTransaction(transaction: TezosUnsignedTransaction | TezosSignedTransaction, _publicKey: PublicKey): Promise<AirGapTransaction<TezosUnits>[]>;
|
|
54
|
-
verifyMessageWithPublicKey(message: string, signature: Signature, publicKey: PublicKey): Promise<boolean>;
|
|
55
|
-
encryptAsymmetricWithPublicKey(payload: string, publicKey: PublicKey): Promise<string>;
|
|
56
|
-
private readonly cryptoConfiguration;
|
|
57
|
-
getCryptoConfiguration(): Promise<TezosSecp256k1CryptoConfiguration>;
|
|
58
|
-
getKeyPairFromDerivative(derivative: CryptoDerivative): Promise<KeyPair>;
|
|
59
|
-
signTransactionWithSecretKey(transaction: TezosUnsignedTransaction, secretKey: SecretKey): Promise<TezosSignedTransaction>;
|
|
60
|
-
signMessageWithKeyPair(message: string, keyPair: KeyPair): Promise<Signature>;
|
|
61
|
-
decryptAsymmetricWithKeyPair(payload: string, keyPair: KeyPair): Promise<string>;
|
|
62
|
-
encryptAESWithSecretKey(payload: string, secretKey: SecretKey): Promise<string>;
|
|
63
|
-
decryptAESWithSecretKey(payload: string, secretKey: SecretKey): Promise<string>;
|
|
64
|
-
getNetwork(): Promise<TezosProtocolNetwork>;
|
|
65
|
-
getTransactionsForPublicKey(publicKey: PublicKey, limit: number, cursor?: TezosTransactionCursor): Promise<AirGapTransactionsWithCursor<TezosTransactionCursor, TezosUnits, TezosUnits>>;
|
|
66
|
-
getTransactionsForAddress(address: string, limit: number, cursor?: TezosTransactionCursor): Promise<AirGapTransactionsWithCursor<TezosTransactionCursor, TezosUnits, TezosUnits>>;
|
|
67
|
-
getBalanceOfPublicKey(publicKey: PublicKey): Promise<Balance<TezosUnits>>;
|
|
68
|
-
getstakeBalance(address: string): Promise<Balance<TezosUnits>>;
|
|
69
|
-
getUnstakeBalance(address: string): Promise<Balance<TezosUnits>>;
|
|
70
|
-
getUnfinalizeRequest(address: string): Promise<TezosUnstakeRequest>;
|
|
71
|
-
getFinalizeableBalance(address: string): Promise<Balance<TezosUnits>>;
|
|
72
|
-
getBalanceOfAddress(address: string): Promise<Balance<TezosUnits>>;
|
|
73
|
-
getTransactionMaxAmountWithPublicKey(publicKey: PublicKey, to: string[], configuration?: TransactionFullConfiguration<TezosUnits>): Promise<Amount<TezosUnits>>;
|
|
74
|
-
private getTansactionMaxAmountWithBalance;
|
|
75
|
-
getTransactionFeeWithPublicKey(publicKey: PublicKey, details: TransactionDetails<TezosUnits>[], _configuration?: TransactionSimpleConfiguration): Promise<FeeDefaults<TezosUnits>>;
|
|
76
|
-
getTransactionFee(publicKey: PublicKey, details: TransactionDetails<TezosUnits>[], parameters?: TezosTransactionParameters): Promise<FeeDefaults<TezosUnits>>;
|
|
77
|
-
getOperationFeeDefaults(publicKey: PublicKey, operations: TezosOperation[]): Promise<FeeDefaults<TezosUnits>>;
|
|
78
|
-
prepareTransactionWithPublicKey(publicKey: PublicKey, details: TransactionDetails<TezosUnits>[], configuration?: TransactionFullConfiguration<TezosUnits>): Promise<TezosUnsignedTransaction>;
|
|
79
|
-
broadcastTransaction(transaction: TezosSignedTransaction): Promise<string>;
|
|
80
|
-
getDefaultDelegatee(): Promise<string>;
|
|
81
|
-
getCurrentDelegateesForPublicKey(publicKey: PublicKey): Promise<string[]>;
|
|
82
|
-
getCurrentDelegateesForAddress(address: string): Promise<string[]>;
|
|
83
|
-
getDelegateeDetails(address: string): Promise<DelegateeDetails>;
|
|
84
|
-
isPublicKeyDelegating(publicKey: PublicKey): Promise<boolean>;
|
|
85
|
-
isAddressDelegating(address: string): Promise<boolean>;
|
|
86
|
-
getDelegatorDetailsFromPublicKey(publicKey: PublicKey): Promise<DelegatorDetails>;
|
|
87
|
-
getDelegatorDetailsFromAddress(address: string): Promise<DelegatorDetails>;
|
|
88
|
-
getDelegationDetailsFromPublicKey(publicKey: PublicKey, delegatees: string[]): Promise<DelegationDetails>;
|
|
89
|
-
getDelegationDetailsFromAddress(address: string, delegatees: string[]): Promise<DelegationDetails>;
|
|
90
|
-
private getDelegatorDetails;
|
|
91
|
-
private prepareTransactions;
|
|
92
|
-
private stake;
|
|
93
|
-
private unstake;
|
|
94
|
-
private finalizeUnstake;
|
|
95
|
-
prepareDelegatorActionFromPublicKey(publicKey: PublicKey, type: any, data?: any): Promise<any[]>;
|
|
96
|
-
undelegate(publicKey: PublicKey): Promise<TezosUnsignedTransaction>;
|
|
97
|
-
delegate(publicKey: PublicKey, delegate?: string | string[]): Promise<TezosUnsignedTransaction>;
|
|
98
|
-
getMinCycleDuration(): Promise<number>;
|
|
99
|
-
getDetailsFromWrappedOperation(wrappedOperation: TezosWrappedOperation): Promise<AirGapTransaction<TezosUnits, TezosUnits>[]>;
|
|
100
|
-
forgeOperation(wrappedOperation: TezosWrappedOperation): Promise<string>;
|
|
101
|
-
unforgeOperation(forged: string, type?: (TezosSignedTransaction | TezosUnsignedTransaction)['type']): Promise<TezosWrappedOperation>;
|
|
102
|
-
prepareTransactionsWithPublicKey(publicKey: PublicKey, details: TransactionDetails<TezosUnits>[], configuration?: TransactionFullConfiguration<TezosUnits> & {
|
|
103
|
-
operationsPerGroup?: number;
|
|
104
|
-
}): Promise<TezosUnsignedTransaction[]>;
|
|
105
|
-
prepareOperations(publicKey: PublicKey, operationRequests: TezosOperation[], overrideParameters?: boolean): Promise<TezosWrappedOperation>;
|
|
106
|
-
private estimateAndReplaceLimitsAndFee;
|
|
107
|
-
private createTransactionOperations;
|
|
108
|
-
bakerDetails(address: string | undefined): Promise<BakerDetails>;
|
|
109
|
-
}
|
|
110
|
-
export declare function createTezosSecp256k1Protocol(options?: RecursivePartial<TezosProtocolOptions>): TezosSecp256k1Protocol;
|