@airgap/bnb 0.13.45-beta.6
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/LICENSE.md +7 -0
- package/index.d.ts +1 -0
- package/index.js +18 -0
- package/index.js.map +1 -0
- package/package.json +63 -0
- package/readme.md +121 -0
- package/v1/client/info/BnbinfoClient.d.ts +2 -0
- package/v1/client/info/BnbinfoClient.js +3 -0
- package/v1/client/info/BnbinfoClient.js.map +1 -0
- package/v1/client/node/BnbNodeClient.d.ts +3 -0
- package/v1/client/node/BnbNodeClient.js +3 -0
- package/v1/client/node/BnbNodeClient.js.map +1 -0
- package/v1/client/node/HttpBnbNodeClient.d.ts +5 -0
- package/v1/client/node/HttpBnbNodeClient.js +28 -0
- package/v1/client/node/HttpBnbNodeClient.js.map +1 -0
- package/v1/index.d.ts +11 -0
- package/v1/index.js +14 -0
- package/v1/index.js.map +1 -0
- package/v1/module/BnbModule.d.ts +18 -0
- package/v1/module/BnbModule.js +182 -0
- package/v1/module/BnbModule.js.map +1 -0
- package/v1/module/ERC20Tokens.d.ts +3 -0
- package/v1/module/ERC20Tokens.js +95 -0
- package/v1/module/ERC20Tokens.js.map +1 -0
- package/v1/module.d.ts +3 -0
- package/v1/module.js +24 -0
- package/v1/module.js.map +1 -0
- package/v1/protocol/BnbBaseProtocol.d.ts +58 -0
- package/v1/protocol/BnbBaseProtocol.js +265 -0
- package/v1/protocol/BnbBaseProtocol.js.map +1 -0
- package/v1/protocol/BnbProtocol.d.ts +8 -0
- package/v1/protocol/BnbProtocol.js +84 -0
- package/v1/protocol/BnbProtocol.js.map +1 -0
- package/v1/protocol/erc20/ERC20Token.d.ts +20 -0
- package/v1/protocol/erc20/ERC20Token.js +198 -0
- package/v1/protocol/erc20/ERC20Token.js.map +1 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +8 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +21 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bnb-typed.d.ts +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bnb-typed.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bnb-typed.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bnb.d.ts +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bnb.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-bnb.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bnb.d.ts +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bnb.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-bnb.js.map +1 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-bnb-typed.json +39 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-bnb.json +56 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-bnb.json +19 -0
- package/v1/serializer/v3/serializer-companion.d.ts +13 -0
- package/v1/serializer/v3/serializer-companion.js +190 -0
- package/v1/serializer/v3/serializer-companion.js.map +1 -0
- package/v1/serializer/v3/validators/transaction-validator.d.ts +4 -0
- package/v1/serializer/v3/validators/transaction-validator.js +29 -0
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
- package/v1/types/crypto.d.ts +2 -0
- package/v1/types/crypto.js +3 -0
- package/v1/types/crypto.js.map +1 -0
- package/v1/types/protocol.d.ts +5 -0
- package/v1/types/protocol.js +3 -0
- package/v1/types/protocol.js.map +1 -0
- package/v1/types/transaction.d.ts +6 -0
- package/v1/types/transaction.js +3 -0
- package/v1/types/transaction.js.map +1 -0
- package/v1/utils/protocol.d.ts +10 -0
- package/v1/utils/protocol.js +33 -0
- package/v1/utils/protocol.js.map +1 -0
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
exports.BnbTransactionValidator = void 0;
|
|
19
|
+
// tslint:disable: max-classes-per-file
|
|
20
|
+
var v1_1 = require("@airgap/ethereum/v1");
|
|
21
|
+
var BnbTransactionValidator = /** @class */ (function (_super) {
|
|
22
|
+
__extends(BnbTransactionValidator, _super);
|
|
23
|
+
function BnbTransactionValidator() {
|
|
24
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
25
|
+
}
|
|
26
|
+
return BnbTransactionValidator;
|
|
27
|
+
}(v1_1.EthereumTransactionValidator));
|
|
28
|
+
exports.BnbTransactionValidator = BnbTransactionValidator;
|
|
29
|
+
//# sourceMappingURL=transaction-validator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-validator.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/transaction-validator.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAAuC;AACvC,0CAAkE;AAGlE;IAA6C,2CAA4B;IAAzE;;IAA2G,CAAC;IAAD,8BAAC;AAAD,CAAC,AAA5G,CAA6C,iCAA4B,GAAmC;AAA/F,0DAAuB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"crypto.js","sourceRoot":"","sources":["../../../src/v1/types/crypto.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/v1/types/protocol.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EthereumRawUnsignedTransaction, EthereumSignedTransaction, EthereumTransactionCursor, EthereumTypedUnsignedTransaction } from '@airgap/ethereum/v1';
|
|
2
|
+
export declare type BnbRawUnsignedTransaction = EthereumRawUnsignedTransaction;
|
|
3
|
+
export declare type BnbTypedUnsignedTransaction = EthereumTypedUnsignedTransaction;
|
|
4
|
+
export declare type BnbUnsignedTransaction = BnbRawUnsignedTransaction | BnbTypedUnsignedTransaction;
|
|
5
|
+
export declare type BnbSignedTransaction = EthereumSignedTransaction;
|
|
6
|
+
export declare type BnbTransactionCursor = EthereumTransactionCursor;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../src/v1/types/transaction.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { AirGapAnyProtocol, Schema } from '@airgap/module-kit';
|
|
2
|
+
import { ERC20Token } from '../protocol/erc20/ERC20Token';
|
|
3
|
+
import { BnbBaseProtocol } from '../protocol/BnbBaseProtocol';
|
|
4
|
+
import { BnbProtocol } from '../protocol/BnbProtocol';
|
|
5
|
+
export declare const bnbBaseProtocolSchema: Schema<BnbBaseProtocol>;
|
|
6
|
+
export declare const bnbProtocolSchema: Schema<BnbProtocol>;
|
|
7
|
+
export declare const bnbERC20TokenSchema: Schema<ERC20Token>;
|
|
8
|
+
export declare function isAnyBnbProtocol(protocol: AirGapAnyProtocol): protocol is BnbBaseProtocol;
|
|
9
|
+
export declare function isBnbProtocol(protocol: AirGapAnyProtocol): protocol is BnbProtocol;
|
|
10
|
+
export declare function isBnbERC20Token(protocol: AirGapAnyProtocol): protocol is ERC20Token;
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __assign = (this && this.__assign) || function () {
|
|
3
|
+
__assign = Object.assign || function(t) {
|
|
4
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
5
|
+
s = arguments[i];
|
|
6
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
7
|
+
t[p] = s[p];
|
|
8
|
+
}
|
|
9
|
+
return t;
|
|
10
|
+
};
|
|
11
|
+
return __assign.apply(this, arguments);
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.isBnbERC20Token = exports.isBnbProtocol = exports.isAnyBnbProtocol = exports.bnbERC20TokenSchema = exports.bnbProtocolSchema = exports.bnbBaseProtocolSchema = void 0;
|
|
15
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
16
|
+
// Schemas
|
|
17
|
+
exports.bnbBaseProtocolSchema = __assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign(__assign({}, module_kit_1.offlineProtocolSchema), module_kit_1.onlineProtocolSchema), module_kit_1.bip32OfflineProtocolSchema), module_kit_1.bip32OnlineProtocolSchema), module_kit_1.aesEncryptionSchema), module_kit_1.asymmetricEncryptionOfflineSchema), module_kit_1.signMessageOfflineSchema), module_kit_1.fetchDataForAddressProtocolSchema), module_kit_1.fetchDataForMultipleAddressesProtocolSchema), module_kit_1.getTokenBalancesSchema), module_kit_1.transactionStatusCheckerSchema), module_kit_1.walletConnectProtocolSchema);
|
|
18
|
+
exports.bnbProtocolSchema = __assign({}, exports.bnbBaseProtocolSchema);
|
|
19
|
+
exports.bnbERC20TokenSchema = __assign(__assign(__assign({}, exports.bnbBaseProtocolSchema), module_kit_1.singleTokenSubProtocolSchema), { name: 'required', symbol: 'required', decimals: 'required', tokenMetadata: 'required' });
|
|
20
|
+
// Implementation Checks
|
|
21
|
+
function isAnyBnbProtocol(protocol) {
|
|
22
|
+
return (0, module_kit_1.implementsInterface)(protocol, exports.bnbBaseProtocolSchema);
|
|
23
|
+
}
|
|
24
|
+
exports.isAnyBnbProtocol = isAnyBnbProtocol;
|
|
25
|
+
function isBnbProtocol(protocol) {
|
|
26
|
+
return (0, module_kit_1.implementsInterface)(protocol, exports.bnbProtocolSchema);
|
|
27
|
+
}
|
|
28
|
+
exports.isBnbProtocol = isBnbProtocol;
|
|
29
|
+
function isBnbERC20Token(protocol) {
|
|
30
|
+
return (0, module_kit_1.implementsInterface)(protocol, exports.bnbERC20TokenSchema);
|
|
31
|
+
}
|
|
32
|
+
exports.isBnbERC20Token = isBnbERC20Token;
|
|
33
|
+
//# sourceMappingURL=protocol.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"protocol.js","sourceRoot":"","sources":["../../../src/v1/utils/protocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iDAiB2B;AAM3B,UAAU;AAEG,QAAA,qBAAqB,mHAC7B,kCAAqB,GACrB,iCAAoB,GACpB,uCAA0B,GAC1B,sCAAyB,GACzB,gCAAmB,GACnB,8CAAiC,GACjC,qCAAwB,GACxB,8CAAiC,GACjC,wDAA2C,GAC3C,mCAAsB,GACtB,2CAA8B,GAC9B,wCAA2B,EAC/B;AAEY,QAAA,iBAAiB,gBACzB,6BAAqB,EACzB;AAEY,QAAA,mBAAmB,kCAC3B,6BAAqB,GACrB,yCAA4B,KAC/B,IAAI,EAAE,UAAU,EAChB,MAAM,EAAE,UAAU,EAClB,QAAQ,EAAE,UAAU,EACpB,aAAa,EAAE,UAAU,IAC1B;AAED,wBAAwB;AAExB,SAAgB,gBAAgB,CAAC,QAA2B;IAC1D,OAAO,IAAA,gCAAmB,EAAkB,QAAQ,EAAE,6BAAqB,CAAC,CAAA;AAC9E,CAAC;AAFD,4CAEC;AAED,SAAgB,aAAa,CAAC,QAA2B;IACvD,OAAO,IAAA,gCAAmB,EAAc,QAAQ,EAAE,yBAAiB,CAAC,CAAA;AACtE,CAAC;AAFD,sCAEC;AAED,SAAgB,eAAe,CAAC,QAA2B;IACzD,OAAO,IAAA,gCAAmB,EAAa,QAAQ,EAAE,2BAAmB,CAAC,CAAA;AACvE,CAAC;AAFD,0CAEC"}
|