@airgap/ethereum 0.13.8-beta.9 → 0.13.8
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 +4 -4
- package/v1/index.d.ts +6 -2
- package/v1/index.js +11 -1
- package/v1/index.js.map +1 -1
- package/v1/module/ERC20Module.d.ts +9 -0
- package/v1/module/ERC20Module.js +69 -0
- package/v1/module/ERC20Module.js.map +1 -0
- package/v1/module/EthereumBaseModule.d.ts +13 -0
- package/v1/module/EthereumBaseModule.js +83 -0
- package/v1/module/EthereumBaseModule.js.map +1 -0
- package/v1/module/EthereumClassicModule.d.ts +7 -0
- package/v1/module/EthereumClassicModule.js +32 -0
- package/v1/module/EthereumClassicModule.js.map +1 -0
- package/v1/module/EthereumModule.d.ts +5 -11
- package/v1/module/EthereumModule.js +21 -114
- package/v1/module/EthereumModule.js.map +1 -1
- package/v1/module/EthereumRopstenModule.d.ts +7 -0
- package/v1/module/EthereumRopstenModule.js +32 -0
- package/v1/module/EthereumRopstenModule.js.map +1 -0
- package/v1/protocol/EthereumBaseProtocol.d.ts +16 -28
- package/v1/protocol/EthereumBaseProtocol.js +17 -137
- package/v1/protocol/EthereumBaseProtocol.js.map +1 -1
- package/v1/protocol/EthereumClassicProtocol.d.ts +8 -0
- package/v1/protocol/EthereumClassicProtocol.js +87 -0
- package/v1/protocol/EthereumClassicProtocol.js.map +1 -0
- package/v1/protocol/EthereumProtocol.d.ts +2 -2
- package/v1/protocol/EthereumProtocol.js +250 -1
- package/v1/protocol/EthereumProtocol.js.map +1 -1
- package/v1/protocol/EthereumRopstenProtocol.d.ts +8 -0
- package/v1/protocol/EthereumRopstenProtocol.js +64 -0
- package/v1/protocol/EthereumRopstenProtocol.js.map +1 -0
- package/v1/protocol/erc20/ERC20Token.d.ts +1 -3
- package/v1/protocol/erc20/ERC20Token.js +6 -22
- package/v1/protocol/erc20/ERC20Token.js.map +1 -1
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +1 -3
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +5 -56
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum-typed.d.ts +1 -1
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-ethereum.d.ts +1 -1
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum-typed.json +5 -1
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-ethereum.json +5 -1
- package/v1/serializer/v3/validators/transaction-validator.d.ts +4 -1
- package/v1/serializer/v3/validators/transaction-validator.js +10 -1
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -1
- package/v1/types/transaction.d.ts +0 -2
- package/v1/utils/transaction.d.ts +3 -0
- package/v1/utils/transaction.js +29 -0
- package/v1/utils/transaction.js.map +1 -0
- package/v1/module/ERC20Tokens.d.ts +0 -3
- package/v1/module/ERC20Tokens.js +0 -815
- package/v1/module/ERC20Tokens.js.map +0 -1
- package/v1/serializer/v3/serializer-companion.d.ts +0 -13
- package/v1/serializer/v3/serializer-companion.js +0 -190
- package/v1/serializer/v3/serializer-companion.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { TransactionSignRequest } from '@airgap/serializer';
|
|
2
2
|
import { HexString } from '@airgap/serializer/v3/schemas/definitions/hex-string';
|
|
3
3
|
import { EthereumRawUnsignedTransaction } from '../../../../types/transaction';
|
|
4
|
-
export interface SerializableEthereumRawUnsignedTransaction extends
|
|
4
|
+
export interface SerializableEthereumRawUnsignedTransaction extends EthereumRawUnsignedTransaction {
|
|
5
5
|
nonce: HexString;
|
|
6
6
|
gasPrice: HexString;
|
|
7
7
|
gasLimit: HexString;
|
|
@@ -32,9 +32,13 @@
|
|
|
32
32
|
"serialized": {
|
|
33
33
|
"$ref": "#/definitions/HexString",
|
|
34
34
|
"type": "string"
|
|
35
|
+
},
|
|
36
|
+
"type": {
|
|
37
|
+
"enum": ["unsigned"],
|
|
38
|
+
"type": "string"
|
|
35
39
|
}
|
|
36
40
|
},
|
|
37
|
-
"required": ["derivationPath", "masterFingerprint", "serialized"],
|
|
41
|
+
"required": ["derivationPath", "masterFingerprint", "serialized", "type"],
|
|
38
42
|
"type": "object"
|
|
39
43
|
}
|
|
40
44
|
}
|
|
@@ -46,12 +46,16 @@
|
|
|
46
46
|
"$ref": "#/definitions/HexString",
|
|
47
47
|
"type": "string"
|
|
48
48
|
},
|
|
49
|
+
"type": {
|
|
50
|
+
"enum": ["unsigned"],
|
|
51
|
+
"type": "string"
|
|
52
|
+
},
|
|
49
53
|
"value": {
|
|
50
54
|
"$ref": "#/definitions/HexString",
|
|
51
55
|
"type": "string"
|
|
52
56
|
}
|
|
53
57
|
},
|
|
54
|
-
"required": ["chainId", "data", "gasLimit", "gasPrice", "nonce", "to", "value"],
|
|
58
|
+
"required": ["chainId", "data", "gasLimit", "gasPrice", "nonce", "to", "type", "value"],
|
|
55
59
|
"type": "object"
|
|
56
60
|
}
|
|
57
61
|
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { TransactionValidator, TransactionValidatorV2 } from '@airgap/serializer';
|
|
1
|
+
import { TransactionValidator, TransactionValidatorFactory, TransactionValidatorV2 } from '@airgap/serializer';
|
|
2
2
|
import { EthereumTransactionSignRequest } from '../schemas/definitions/transaction-sign-request-ethereum';
|
|
3
3
|
import { EthereumTransactionSignResponse } from '../schemas/definitions/transaction-sign-response-ethereum';
|
|
4
4
|
export declare class EthereumTransactionValidator implements TransactionValidator, TransactionValidatorV2 {
|
|
5
5
|
validateUnsignedTransaction(request: EthereumTransactionSignRequest): Promise<any>;
|
|
6
6
|
validateSignedTransaction(signedTx: EthereumTransactionSignResponse): any;
|
|
7
7
|
}
|
|
8
|
+
export declare class EthereumTransactionValidatorFactory implements TransactionValidatorFactory<EthereumTransactionValidator> {
|
|
9
|
+
create(): EthereumTransactionValidator;
|
|
10
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.EthereumTransactionValidator = void 0;
|
|
3
|
+
exports.EthereumTransactionValidatorFactory = exports.EthereumTransactionValidator = void 0;
|
|
4
4
|
// tslint:disable: max-classes-per-file
|
|
5
5
|
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
6
6
|
var serializer_1 = require("@airgap/serializer");
|
|
@@ -68,4 +68,13 @@ var EthereumTransactionValidator = /** @class */ (function () {
|
|
|
68
68
|
return EthereumTransactionValidator;
|
|
69
69
|
}());
|
|
70
70
|
exports.EthereumTransactionValidator = EthereumTransactionValidator;
|
|
71
|
+
var EthereumTransactionValidatorFactory = /** @class */ (function () {
|
|
72
|
+
function EthereumTransactionValidatorFactory() {
|
|
73
|
+
}
|
|
74
|
+
EthereumTransactionValidatorFactory.prototype.create = function () {
|
|
75
|
+
return new EthereumTransactionValidator();
|
|
76
|
+
};
|
|
77
|
+
return EthereumTransactionValidatorFactory;
|
|
78
|
+
}());
|
|
79
|
+
exports.EthereumTransactionValidatorFactory = EthereumTransactionValidatorFactory;
|
|
71
80
|
//# sourceMappingURL=transaction-validator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validator.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,8FAAyF;AACzF,
|
|
1
|
+
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validator.ts"],"names":[],"mappings":";;;AAAA,uCAAuC;AACvC,8FAAyF;AACzF,iDAAkI;AAMlI,IAAM,8BAA8B,GAAG;IACrC,KAAK,EAAE;QACL,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,IAAI,EAAE,QAAQ;QACd,qBAAqB,EAAE,IAAI;KAC5B;IACD,QAAQ,EAAE;QAC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AAuC;QACxE,IAAM,WAAW,GAAgC,OAAO,CAAC,WAAW,CAAA;QACpE,IAAA,+BAAkB,EAAC,EAAE,CAAC,CAAA;QAEtB,OAAO,IAAA,gBAAK,EAAC,WAAW,EAAE,8BAA8B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAChF,CAAC;IACM,gEAAyB,GAAhC,UAAiC,QAAyC;QACxE,OAAO,IAAA,gBAAK,EAAC,QAAQ,EAAE,4BAA4B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAC3E,CAAC;IACH,mCAAC;AAAD,CAAC,AAVD,IAUC;AAVY,oEAA4B;AAYzC;IAAA;IAIA,CAAC;IAHQ,oDAAM,GAAb;QACE,OAAO,IAAI,4BAA4B,EAAE,CAAA;IAC3C,CAAC;IACH,0CAAC;AAAD,CAAC,AAJD,IAIC;AAJY,kFAAmC"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { SignedTransaction, TransactionCursor, UnsignedTransaction } from '@airgap/module-kit';
|
|
2
2
|
export interface EthereumRawUnsignedTransaction extends UnsignedTransaction {
|
|
3
|
-
ethereumType: 'raw';
|
|
4
3
|
nonce: string;
|
|
5
4
|
gasPrice: string;
|
|
6
5
|
gasLimit: string;
|
|
@@ -10,7 +9,6 @@ export interface EthereumRawUnsignedTransaction extends UnsignedTransaction {
|
|
|
10
9
|
data: string;
|
|
11
10
|
}
|
|
12
11
|
export interface EthereumTypedUnsignedTransaction extends UnsignedTransaction {
|
|
13
|
-
ethereumType: 'typed';
|
|
14
12
|
serialized: string;
|
|
15
13
|
derivationPath: string;
|
|
16
14
|
masterFingerprint: string;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import { EthereumRawUnsignedTransaction, EthereumTypedUnsignedTransaction, EthereumUnsignedTransaction } from '../types/transaction';
|
|
2
|
+
export declare function isRawUnsignedTransaction(transaction: EthereumUnsignedTransaction): transaction is EthereumRawUnsignedTransaction;
|
|
3
|
+
export declare function isTypedUnsignedTransaction(transaction: EthereumUnsignedTransaction): transaction is EthereumTypedUnsignedTransaction;
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isTypedUnsignedTransaction = exports.isRawUnsignedTransaction = void 0;
|
|
4
|
+
var interface_1 = require("@airgap/module-kit/utils/interface");
|
|
5
|
+
var rawUnsignedTransactionSchema = {
|
|
6
|
+
chainId: 'required',
|
|
7
|
+
data: 'required',
|
|
8
|
+
gasLimit: 'required',
|
|
9
|
+
gasPrice: 'required',
|
|
10
|
+
nonce: 'required',
|
|
11
|
+
to: 'required',
|
|
12
|
+
type: 'required',
|
|
13
|
+
value: 'required'
|
|
14
|
+
};
|
|
15
|
+
var typedUnsignedTransactionSchema = {
|
|
16
|
+
derivationPath: 'required',
|
|
17
|
+
masterFingerprint: 'required',
|
|
18
|
+
serialized: 'required',
|
|
19
|
+
type: 'required'
|
|
20
|
+
};
|
|
21
|
+
function isRawUnsignedTransaction(transaction) {
|
|
22
|
+
return (0, interface_1.implementsInterface)(transaction, rawUnsignedTransactionSchema);
|
|
23
|
+
}
|
|
24
|
+
exports.isRawUnsignedTransaction = isRawUnsignedTransaction;
|
|
25
|
+
function isTypedUnsignedTransaction(transaction) {
|
|
26
|
+
return (0, interface_1.implementsInterface)(transaction, typedUnsignedTransactionSchema);
|
|
27
|
+
}
|
|
28
|
+
exports.isTypedUnsignedTransaction = isTypedUnsignedTransaction;
|
|
29
|
+
//# sourceMappingURL=transaction.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../src/v1/utils/transaction.ts"],"names":[],"mappings":";;;AAAA,gEAAgF;AAIhF,IAAM,4BAA4B,GAA2C;IAC3E,OAAO,EAAE,UAAU;IACnB,IAAI,EAAE,UAAU;IAChB,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,UAAU;IACjB,EAAE,EAAE,UAAU;IACd,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,UAAU;CAClB,CAAA;AAED,IAAM,8BAA8B,GAA6C;IAC/E,cAAc,EAAE,UAAU;IAC1B,iBAAiB,EAAE,UAAU;IAC7B,UAAU,EAAE,UAAU;IACtB,IAAI,EAAE,UAAU;CACjB,CAAA;AAED,SAAgB,wBAAwB,CAAC,WAAwC;IAC/E,OAAO,IAAA,+BAAmB,EAAC,WAAW,EAAE,4BAA4B,CAAC,CAAA;AACvE,CAAC;AAFD,4DAEC;AAED,SAAgB,0BAA0B,CAAC,WAAwC;IACjF,OAAO,IAAA,+BAAmB,EAAC,WAAW,EAAE,8BAA8B,CAAC,CAAA;AACzE,CAAC;AAFD,gEAEC"}
|