@airgap/stellar 0.13.41-beta.0
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 +65 -0
- package/readme.md +121 -0
- package/v1/block-explorer/StellarBlockExplorer.d.ts +9 -0
- package/v1/block-explorer/StellarBlockExplorer.js +72 -0
- package/v1/block-explorer/StellarBlockExplorer.js.map +1 -0
- package/v1/data/StellarAddress.d.ts +9 -0
- package/v1/data/StellarAddress.js +30 -0
- package/v1/data/StellarAddress.js.map +1 -0
- package/v1/index.d.ts +13 -0
- package/v1/index.js +11 -0
- package/v1/index.js.map +1 -0
- package/v1/module/StellarModule.d.ts +17 -0
- package/v1/module/StellarModule.js +107 -0
- package/v1/module/StellarModule.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/StellarCryptoClient.d.ts +8 -0
- package/v1/protocol/StellarCryptoClient.js +104 -0
- package/v1/protocol/StellarCryptoClient.js.map +1 -0
- package/v1/protocol/StellarProtocol.d.ts +42 -0
- package/v1/protocol/StellarProtocol.js +511 -0
- package/v1/protocol/StellarProtocol.js.map +1 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.d.ts +7 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js +42 -0
- package/v1/serializer/v3/schemas/converter/transaction-converter.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-stellar.d.ts +4 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-stellar.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-request-stellar.js.map +1 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-stellar.d.ts +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-stellar.js +3 -0
- package/v1/serializer/v3/schemas/definitions/transaction-sign-response-stellar.js.map +1 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-request-stellar.json +29 -0
- package/v1/serializer/v3/schemas/generated/transaction-sign-response-stellar.json +19 -0
- package/v1/serializer/v3/serializer-companion.d.ts +14 -0
- package/v1/serializer/v3/serializer-companion.js +158 -0
- package/v1/serializer/v3/serializer-companion.js.map +1 -0
- package/v1/serializer/v3/validators/transaction-validator.d.ts +7 -0
- package/v1/serializer/v3/validators/transaction-validator.js +89 -0
- package/v1/serializer/v3/validators/transaction-validator.js.map +1 -0
- package/v1/serializer/v3/validators/validators.d.ts +6 -0
- package/v1/serializer/v3/validators/validators.js +92 -0
- package/v1/serializer/v3/validators/validators.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 +7 -0
- package/v1/types/protocol.js +3 -0
- package/v1/types/protocol.js.map +1 -0
- package/v1/types/transaction.d.ts +10 -0
- package/v1/types/transaction.js +6 -0
- package/v1/types/transaction.js.map +1 -0
- package/v1/utils/convert.d.ts +3 -0
- package/v1/utils/convert.js +32 -0
- package/v1/utils/convert.js.map +1 -0
- package/v1/utils/key.d.ts +3 -0
- package/v1/utils/key.js +37 -0
- package/v1/utils/key.js.map +1 -0
- package/v1/utils/signature.d.ts +2 -0
- package/v1/utils/signature.js +22 -0
- package/v1/utils/signature.js.map +1 -0
- package/v1/utils/transaction.d.ts +3 -0
- package/v1/utils/transaction.js +22 -0
- package/v1/utils/transaction.js.map +1 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"StellarProtocol.js","sourceRoot":"","sources":["../../../src/v1/protocol/StellarProtocol.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAA+E;AAC/E,mGAA4F;AAC5F,sDAA4E;AAC5E,iDAuB2B;AAC3B,oDAAoI;AACpI,iHAA0F;AAE1F,yDAAu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;wBAC/D,MAAM,GAAG,IAAI,eAAe,EAAE,CAAA;wBACpC,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,WAAW,CAAC,WAAW,CAAC,CAAA;wBAE3B,qBAAM,eAAK,CAAC,IAAI,CAAC,UAAG,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,MAAM,kBAAe,EAAE,MAAM,CAAC,QAAQ,EAAE,EAAE;gCAClG,OAAO,EAAE;oCACP,cAAc,EAAE,mCAAmC;iCACpD;6BACF,CAAC,EAAA;;wBAJM,IAAI,GAAK,CAAA,SAIf,CAAA,KAJU;wBAKZ,sBAAO,IAAI,CAAC,IAAI,EAAA;;;;KACjB;IACH,0BAAC;AAAD,CAAC,AA5XD,IA4XC;AA5XY,kDAAmB;AA8XhC,SAAgB,qBAAqB,CAAC,OAAsD;IAAtD,wBAAA,EAAA,YAAsD;IAC1F,OAAO,IAAI,mBAAmB,CAAC,OAAO,CAAC,CAAA;AACzC,CAAC;AAFD,sDAEC;AAEY,QAAA,gCAAgC,GAA2B;IACtE,IAAI,EAAE,SAAS;IACf,IAAI,EAAE,SAAS;IACf,MAAM,EAAE,qCAAqC;IAC7C,gBAAgB,EAAE,yCAAyC;CAC5D,CAAA;AAED,IAAM,gCAAgC,GAA2B,wCAAgC,CAAA;AAEjG,SAAgB,4BAA4B,CAAC,OAA6C;IAA7C,wBAAA,EAAA,YAA6C;IACxF,OAAO;QACL,OAAO,wBAAO,gCAAgC,GAAK,OAAO,CAAE;KAC7D,CAAA;AACH,CAAC;AAJD,oEAIC;AAED,yBAAyB;AACzB,sDAAsD;AACtD,0FAA0F;AAC1F,iDAAiD;AACjD,IAAI"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { StellarUnsignedTransaction, StellarSignedTransaction } from '../../../../types/transaction';
|
|
2
|
+
import { StellarTransactionSignRequest } from '../definitions/transaction-sign-request-stellar';
|
|
3
|
+
import { StellarTransactionSignResponse } from '../definitions/transaction-sign-response-stellar';
|
|
4
|
+
export declare function stellarUnsignedTransactionToRequest(unsigned: StellarUnsignedTransaction, publicKey: string, callbackUrl?: string): StellarTransactionSignRequest;
|
|
5
|
+
export declare function stellarSignedTransactionToResponse(signed: StellarSignedTransaction, accountIdentifier: string): StellarTransactionSignResponse;
|
|
6
|
+
export declare function stellarTransactionSignRequestToUnsigned(request: StellarTransactionSignRequest): StellarUnsignedTransaction;
|
|
7
|
+
export declare function stellarTransactionSignResponseToSigned(response: StellarTransactionSignResponse): StellarSignedTransaction;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __rest = (this && this.__rest) || function (s, e) {
|
|
3
|
+
var t = {};
|
|
4
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
5
|
+
t[p] = s[p];
|
|
6
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
7
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
8
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
9
|
+
t[p[i]] = s[p[i]];
|
|
10
|
+
}
|
|
11
|
+
return t;
|
|
12
|
+
};
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.stellarTransactionSignResponseToSigned = exports.stellarTransactionSignRequestToUnsigned = exports.stellarSignedTransactionToResponse = exports.stellarUnsignedTransactionToRequest = void 0;
|
|
15
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
16
|
+
function stellarUnsignedTransactionToRequest(unsigned, publicKey, callbackUrl) {
|
|
17
|
+
var _ = unsigned.type, rest = __rest(unsigned, ["type"]);
|
|
18
|
+
return {
|
|
19
|
+
transaction: rest,
|
|
20
|
+
publicKey: publicKey,
|
|
21
|
+
callbackURL: callbackUrl
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
exports.stellarUnsignedTransactionToRequest = stellarUnsignedTransactionToRequest;
|
|
25
|
+
function stellarSignedTransactionToResponse(signed, accountIdentifier) {
|
|
26
|
+
return {
|
|
27
|
+
transaction: signed.transaction,
|
|
28
|
+
accountIdentifier: accountIdentifier
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
exports.stellarSignedTransactionToResponse = stellarSignedTransactionToResponse;
|
|
32
|
+
function stellarTransactionSignRequestToUnsigned(request) {
|
|
33
|
+
return (0, module_kit_1.newUnsignedTransaction)(request.transaction);
|
|
34
|
+
}
|
|
35
|
+
exports.stellarTransactionSignRequestToUnsigned = stellarTransactionSignRequestToUnsigned;
|
|
36
|
+
function stellarTransactionSignResponseToSigned(response) {
|
|
37
|
+
return (0, module_kit_1.newSignedTransaction)({
|
|
38
|
+
transaction: response.transaction
|
|
39
|
+
});
|
|
40
|
+
}
|
|
41
|
+
exports.stellarTransactionSignResponseToSigned = stellarTransactionSignResponseToSigned;
|
|
42
|
+
//# sourceMappingURL=transaction-converter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-converter.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/converter/transaction-converter.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,iDAAiF;AAMjF,SAAgB,mCAAmC,CACjD,QAAoC,EACpC,SAAiB,EACjB,WAAoB;IAEZ,IAAM,CAAC,GAAc,QAAQ,KAAtB,EAAK,IAAI,UAAK,QAAQ,EAA/B,QAAoB,CAAF,CAAa;IAErC,OAAO;QACL,WAAW,EAAE,IAAI;QACjB,SAAS,WAAA;QACT,WAAW,EAAE,WAAW;KACzB,CAAA;AACH,CAAC;AAZD,kFAYC;AAED,SAAgB,kCAAkC,CAChD,MAAgC,EAChC,iBAAyB;IAEzB,OAAO;QACL,WAAW,EAAE,MAAM,CAAC,WAAW;QAC/B,iBAAiB,mBAAA;KAClB,CAAA;AACH,CAAC;AARD,gFAQC;AAED,SAAgB,uCAAuC,CAAC,OAAsC;IAC5F,OAAO,IAAA,mCAAsB,EAA6B,OAAO,CAAC,WAAW,CAAC,CAAA;AAChF,CAAC;AAFD,0FAEC;AAED,SAAgB,sCAAsC,CAAC,QAAwC;IAC7F,OAAO,IAAA,iCAAoB,EAA2B;QACpD,WAAW,EAAE,QAAQ,CAAC,WAAW;KAClC,CAAC,CAAA;AACJ,CAAC;AAJD,wFAIC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-sign-request-stellar.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/definitions/transaction-sign-request-stellar.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction-sign-response-stellar.js","sourceRoot":"","sources":["../../../../../../src/v1/serializer/v3/schemas/definitions/transaction-sign-response-stellar.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/StellarTransactionSignRequest",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"StellarTransactionSignRequest": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"callbackURL": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"publicKey": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
},
|
|
14
|
+
"transaction": {
|
|
15
|
+
"additionalProperties": false,
|
|
16
|
+
"properties": {
|
|
17
|
+
"transaction": {
|
|
18
|
+
"type": "string"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"required": ["transaction"],
|
|
22
|
+
"type": "object"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
"required": ["publicKey", "transaction"],
|
|
26
|
+
"type": "object"
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$ref": "#/definitions/StellarTransactionSignResponse",
|
|
3
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
4
|
+
"definitions": {
|
|
5
|
+
"StellarTransactionSignResponse": {
|
|
6
|
+
"additionalProperties": false,
|
|
7
|
+
"properties": {
|
|
8
|
+
"accountIdentifier": {
|
|
9
|
+
"type": "string"
|
|
10
|
+
},
|
|
11
|
+
"transaction": {
|
|
12
|
+
"type": "string"
|
|
13
|
+
}
|
|
14
|
+
},
|
|
15
|
+
"required": ["accountIdentifier", "transaction"],
|
|
16
|
+
"type": "object"
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { AirGapV3SerializerCompanion, SignedTransaction, UnsignedTransaction } from '@airgap/module-kit';
|
|
2
|
+
import { TransactionSignRequest, TransactionSignResponse } from '@airgap/serializer';
|
|
3
|
+
import { V3SchemaConfiguration } from '@airgap/module-kit/types/serializer';
|
|
4
|
+
export declare class StellarV3SerializerCompanion implements AirGapV3SerializerCompanion {
|
|
5
|
+
readonly schemas: V3SchemaConfiguration[];
|
|
6
|
+
private readonly stellarTransactionValidator;
|
|
7
|
+
constructor();
|
|
8
|
+
toTransactionSignRequest(identifier: string, unsignedTransaction: UnsignedTransaction, publicKey: string, callbackUrl?: string): Promise<TransactionSignRequest>;
|
|
9
|
+
fromTransactionSignRequest(identifier: string, transactionSignRequest: TransactionSignRequest): Promise<UnsignedTransaction>;
|
|
10
|
+
validateTransactionSignRequest(identifier: string, transactionSignRequest: TransactionSignRequest): Promise<boolean>;
|
|
11
|
+
toTransactionSignResponse(identifier: string, signedTransaction: SignedTransaction, accountIdentifier: string): Promise<TransactionSignResponse>;
|
|
12
|
+
fromTransactionSignResponse(identifier: string, transactionSignResponse: TransactionSignResponse): Promise<SignedTransaction>;
|
|
13
|
+
validateTransactionSignResponse(identifier: string, transactionSignResponse: TransactionSignResponse): Promise<boolean>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.StellarV3SerializerCompanion = void 0;
|
|
40
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
41
|
+
var coinlib_core_1 = require("@airgap/coinlib-core");
|
|
42
|
+
var errors_1 = require("@airgap/coinlib-core/errors");
|
|
43
|
+
var serializer_1 = require("@airgap/serializer");
|
|
44
|
+
var transaction_converter_1 = require("./schemas/converter/transaction-converter");
|
|
45
|
+
var transaction_validator_1 = require("./validators/transaction-validator");
|
|
46
|
+
var validators_1 = require("./validators/validators");
|
|
47
|
+
// import { StellarTransactionSignRequest } from './schemas/definitions/transaction-sign-request-stellar'
|
|
48
|
+
// import { StellarTransactionSignResponse } from './schemas/definitions/transaction-sign-response-stellar'
|
|
49
|
+
var stellarTransactionSignRequestSchema = require('./schemas/generated/transaction-sign-request-stellar.json');
|
|
50
|
+
var stellarTransactionSignResponseSchema = require('./schemas/generated/transaction-sign-response-stellar.json');
|
|
51
|
+
var StellarV3SerializerCompanion = /** @class */ (function () {
|
|
52
|
+
function StellarV3SerializerCompanion() {
|
|
53
|
+
this.schemas = [
|
|
54
|
+
{
|
|
55
|
+
type: serializer_1.IACMessageType.TransactionSignRequest,
|
|
56
|
+
schema: { schema: stellarTransactionSignRequestSchema },
|
|
57
|
+
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.XLM
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
type: serializer_1.IACMessageType.TransactionSignResponse,
|
|
61
|
+
schema: { schema: stellarTransactionSignResponseSchema },
|
|
62
|
+
protocolIdentifier: coinlib_core_1.MainProtocolSymbols.XLM
|
|
63
|
+
}
|
|
64
|
+
];
|
|
65
|
+
this.stellarTransactionValidator = new transaction_validator_1.StellarTransactionValidator();
|
|
66
|
+
// Register custom validators globally
|
|
67
|
+
Object.keys(validators_1.stellarValidators).forEach(function (key) {
|
|
68
|
+
validate_1.validators[key] = validators_1.stellarValidators[key];
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
StellarV3SerializerCompanion.prototype.toTransactionSignRequest = function (identifier, unsignedTransaction, publicKey, callbackUrl) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
if (identifier === coinlib_core_1.MainProtocolSymbols.XLM) {
|
|
75
|
+
return [2 /*return*/, (0, transaction_converter_1.stellarUnsignedTransactionToRequest)(unsignedTransaction, publicKey, callbackUrl)];
|
|
76
|
+
}
|
|
77
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.STELLAR, "Protocol ".concat(identifier, " not supported"));
|
|
78
|
+
});
|
|
79
|
+
});
|
|
80
|
+
};
|
|
81
|
+
StellarV3SerializerCompanion.prototype.fromTransactionSignRequest = function (identifier, transactionSignRequest) {
|
|
82
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
83
|
+
return __generator(this, function (_a) {
|
|
84
|
+
if (identifier === coinlib_core_1.MainProtocolSymbols.XLM) {
|
|
85
|
+
return [2 /*return*/, (0, transaction_converter_1.stellarTransactionSignRequestToUnsigned)(transactionSignRequest)];
|
|
86
|
+
}
|
|
87
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.STELLAR, "Protocol ".concat(identifier, " not supported"));
|
|
88
|
+
});
|
|
89
|
+
});
|
|
90
|
+
};
|
|
91
|
+
StellarV3SerializerCompanion.prototype.validateTransactionSignRequest = function (identifier, transactionSignRequest) {
|
|
92
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
93
|
+
var _a;
|
|
94
|
+
return __generator(this, function (_b) {
|
|
95
|
+
switch (_b.label) {
|
|
96
|
+
case 0:
|
|
97
|
+
if (!(identifier === coinlib_core_1.MainProtocolSymbols.XLM)) return [3 /*break*/, 4];
|
|
98
|
+
_b.label = 1;
|
|
99
|
+
case 1:
|
|
100
|
+
_b.trys.push([1, 3, , 4]);
|
|
101
|
+
return [4 /*yield*/, this.stellarTransactionValidator.validateUnsignedTransaction(transactionSignRequest)];
|
|
102
|
+
case 2:
|
|
103
|
+
_b.sent();
|
|
104
|
+
return [2 /*return*/, true];
|
|
105
|
+
case 3:
|
|
106
|
+
_a = _b.sent();
|
|
107
|
+
return [2 /*return*/, false];
|
|
108
|
+
case 4: throw new errors_1.UnsupportedError(coinlib_core_1.Domain.STELLAR, "Protocol ".concat(identifier, " not supported"));
|
|
109
|
+
}
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
};
|
|
113
|
+
StellarV3SerializerCompanion.prototype.toTransactionSignResponse = function (identifier, signedTransaction, accountIdentifier) {
|
|
114
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
115
|
+
return __generator(this, function (_a) {
|
|
116
|
+
if (identifier === coinlib_core_1.MainProtocolSymbols.XLM) {
|
|
117
|
+
return [2 /*return*/, (0, transaction_converter_1.stellarSignedTransactionToResponse)(signedTransaction, accountIdentifier)];
|
|
118
|
+
}
|
|
119
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.STELLAR, "Protocol ".concat(identifier, " not supported"));
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
};
|
|
123
|
+
StellarV3SerializerCompanion.prototype.fromTransactionSignResponse = function (identifier, transactionSignResponse) {
|
|
124
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
125
|
+
return __generator(this, function (_a) {
|
|
126
|
+
if (identifier === coinlib_core_1.MainProtocolSymbols.XLM) {
|
|
127
|
+
return [2 /*return*/, (0, transaction_converter_1.stellarTransactionSignResponseToSigned)(transactionSignResponse)];
|
|
128
|
+
}
|
|
129
|
+
throw new errors_1.UnsupportedError(coinlib_core_1.Domain.STELLAR, "Protocol ".concat(identifier, " not supported"));
|
|
130
|
+
});
|
|
131
|
+
});
|
|
132
|
+
};
|
|
133
|
+
StellarV3SerializerCompanion.prototype.validateTransactionSignResponse = function (identifier, transactionSignResponse) {
|
|
134
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
+
var _a;
|
|
136
|
+
return __generator(this, function (_b) {
|
|
137
|
+
switch (_b.label) {
|
|
138
|
+
case 0:
|
|
139
|
+
if (!(identifier === coinlib_core_1.MainProtocolSymbols.XLM)) return [3 /*break*/, 4];
|
|
140
|
+
_b.label = 1;
|
|
141
|
+
case 1:
|
|
142
|
+
_b.trys.push([1, 3, , 4]);
|
|
143
|
+
return [4 /*yield*/, this.stellarTransactionValidator.validateSignedTransaction(transactionSignResponse)];
|
|
144
|
+
case 2:
|
|
145
|
+
_b.sent();
|
|
146
|
+
return [2 /*return*/, true];
|
|
147
|
+
case 3:
|
|
148
|
+
_a = _b.sent();
|
|
149
|
+
return [2 /*return*/, false];
|
|
150
|
+
case 4: throw new errors_1.UnsupportedError(coinlib_core_1.Domain.STELLAR, "Protocol ".concat(identifier, " not supported"));
|
|
151
|
+
}
|
|
152
|
+
});
|
|
153
|
+
});
|
|
154
|
+
};
|
|
155
|
+
return StellarV3SerializerCompanion;
|
|
156
|
+
}());
|
|
157
|
+
exports.StellarV3SerializerCompanion = StellarV3SerializerCompanion;
|
|
158
|
+
//# sourceMappingURL=serializer-companion.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"serializer-companion.js","sourceRoot":"","sources":["../../../../src/v1/serializer/v3/serializer-companion.ts"],"names":[],"mappings":";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,uBAAgD;;;;;;6BAC3G,CAAA,UAAU,KAAK,kCAAmB,CAAC,GAAG,CAAA,EAAtC,wBAAsC;;;;wBAEtC,qBAAM,IAAI,CAAC,2BAA2B,CAAC,yBAAyB,CAAC,uBAAuB,CAAC,EAAA;;wBAAzF,SAAyF,CAAA;wBACzF,sBAAO,IAAI,EAAA;;;wBAEX,sBAAO,KAAK,EAAA;4BAIhB,MAAM,IAAI,yBAAgB,CAAC,qBAAM,CAAC,OAAO,EAAE,mBAAY,UAAU,mBAAgB,CAAC,CAAA;;;;KACnF;IACH,mCAAC;AAAD,CAAC,AA/FD,IA+FC;AA/FY,oEAA4B"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { TransactionValidator } from '@airgap/serializer';
|
|
2
|
+
import { StellarTransactionSignRequest } from '../schemas/definitions/transaction-sign-request-stellar';
|
|
3
|
+
import { StellarTransactionSignResponse } from '../schemas/definitions/transaction-sign-response-stellar';
|
|
4
|
+
export declare class StellarTransactionValidator implements TransactionValidator {
|
|
5
|
+
validateUnsignedTransaction(request: StellarTransactionSignRequest): Promise<any>;
|
|
6
|
+
validateSignedTransaction(response: StellarTransactionSignResponse): Promise<any>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.StellarTransactionValidator = void 0;
|
|
40
|
+
var validate_1 = require("@airgap/coinlib-core/dependencies/src/validate.js-0.13.1/validate");
|
|
41
|
+
var serializer_1 = require("@airgap/serializer");
|
|
42
|
+
var unsignedTransactionConstraints = {
|
|
43
|
+
transaction: {
|
|
44
|
+
presence: { allowEmpty: false },
|
|
45
|
+
type: 'Object',
|
|
46
|
+
isValidStellarTx: true
|
|
47
|
+
},
|
|
48
|
+
networkId: {
|
|
49
|
+
presence: { allowEmpty: false },
|
|
50
|
+
type: 'String',
|
|
51
|
+
isStellarNetworkId: true
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
var signedTransactionConstraints = {
|
|
55
|
+
transaction: {
|
|
56
|
+
presence: { allowEmpty: false },
|
|
57
|
+
type: 'String',
|
|
58
|
+
isValidStellarTx: true
|
|
59
|
+
},
|
|
60
|
+
accountIdentifier: {
|
|
61
|
+
presence: { allowEmpty: false },
|
|
62
|
+
type: 'String',
|
|
63
|
+
isStellarAddress: true
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
var success = function () { return undefined; };
|
|
67
|
+
var error = function (errors) { return errors; };
|
|
68
|
+
var StellarTransactionValidator = /** @class */ (function () {
|
|
69
|
+
function StellarTransactionValidator() {
|
|
70
|
+
}
|
|
71
|
+
StellarTransactionValidator.prototype.validateUnsignedTransaction = function (request) {
|
|
72
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
73
|
+
return __generator(this, function (_a) {
|
|
74
|
+
(0, serializer_1.validateSyncScheme)({});
|
|
75
|
+
return [2 /*return*/, (0, validate_1.async)(request, unsignedTransactionConstraints).then(success, error)];
|
|
76
|
+
});
|
|
77
|
+
});
|
|
78
|
+
};
|
|
79
|
+
StellarTransactionValidator.prototype.validateSignedTransaction = function (response) {
|
|
80
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
81
|
+
return __generator(this, function (_a) {
|
|
82
|
+
return [2 /*return*/, (0, validate_1.async)(response, signedTransactionConstraints).then(success, error)];
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
return StellarTransactionValidator;
|
|
87
|
+
}());
|
|
88
|
+
exports.StellarTransactionValidator = StellarTransactionValidator;
|
|
89
|
+
//# 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,8FAAyF;AACzF,iDAA6E;AAK7E,IAAM,8BAA8B,GAAG;IACrC,WAAW,EAAE;QACX,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,IAAI,EAAE,QAAQ;QACd,gBAAgB,EAAE,IAAI;KACvB;IACD,SAAS,EAAE;QACT,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,IAAI,EAAE,QAAQ;QACd,kBAAkB,EAAE,IAAI;KACzB;CACF,CAAA;AAED,IAAM,4BAA4B,GAAG;IACnC,WAAW,EAAE;QACX,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,IAAI,EAAE,QAAQ;QACd,gBAAgB,EAAE,IAAI;KACvB;IACD,iBAAiB,EAAE;QACjB,QAAQ,EAAE,EAAE,UAAU,EAAE,KAAK,EAAE;QAC/B,IAAI,EAAE,QAAQ;QACd,gBAAgB,EAAE,IAAI;KACvB;CACF,CAAA;AAED,IAAM,OAAO,GAAG,cAAM,OAAA,SAAS,EAAT,CAAS,CAAA;AAC/B,IAAM,KAAK,GAAG,UAAC,MAAW,IAAK,OAAA,MAAM,EAAN,CAAM,CAAA;AAErC;IAAA;IASA,CAAC;IARc,iEAA2B,GAAxC,UAAyC,OAAsC;;;gBAC7E,IAAA,+BAAkB,EAAC,EAAE,CAAC,CAAA;gBACtB,sBAAO,IAAA,gBAAK,EAAC,OAAO,EAAE,8BAA8B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAAA;;;KAC3E;IAEY,+DAAyB,GAAtC,UAAuC,QAAwC;;;gBAC7E,sBAAO,IAAA,gBAAK,EAAC,QAAQ,EAAE,4BAA4B,CAAC,CAAC,IAAI,CAAC,OAAO,EAAE,KAAK,CAAC,EAAA;;;KAC1E;IACH,kCAAC;AAAD,CAAC,AATD,IASC;AATY,kEAA2B"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const stellarValidators: {
|
|
2
|
+
isStellarNetworkId: (value: unknown) => "is not a valid Stellar mainnet network ID" | null;
|
|
3
|
+
isValidStellarTx: (transaction: unknown) => "is not a valid Stellar transaction XDR" | null;
|
|
4
|
+
isStellarAddress: (address: unknown) => "is not a valid Stellar address" | null;
|
|
5
|
+
isValidStellarAccount: (address: string) => Promise<"not a valid or reachable Stellar account" | null>;
|
|
6
|
+
};
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
12
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
13
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
14
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
15
|
+
function step(op) {
|
|
16
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17
|
+
while (_) try {
|
|
18
|
+
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;
|
|
19
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
20
|
+
switch (op[0]) {
|
|
21
|
+
case 0: case 1: t = op; break;
|
|
22
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
23
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
24
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
25
|
+
default:
|
|
26
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
27
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
28
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
29
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
30
|
+
if (t[2]) _.ops.pop();
|
|
31
|
+
_.trys.pop(); continue;
|
|
32
|
+
}
|
|
33
|
+
op = body.call(thisArg, _);
|
|
34
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
35
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
36
|
+
}
|
|
37
|
+
};
|
|
38
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
39
|
+
exports.stellarValidators = void 0;
|
|
40
|
+
var stellar_sdk_1 = require("@stellar/stellar-sdk");
|
|
41
|
+
var StellarProtocol_1 = require("../../../protocol/StellarProtocol");
|
|
42
|
+
var module_kit_1 = require("@airgap/module-kit");
|
|
43
|
+
exports.stellarValidators = {
|
|
44
|
+
isStellarNetworkId: function (value) {
|
|
45
|
+
if (value === null || typeof value === 'undefined') {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
// You can customize for testnet if needed
|
|
49
|
+
if (value !== stellar_sdk_1.Networks.PUBLIC) {
|
|
50
|
+
return 'is not a valid Stellar mainnet network ID';
|
|
51
|
+
}
|
|
52
|
+
return null;
|
|
53
|
+
},
|
|
54
|
+
isValidStellarTx: function (transaction) {
|
|
55
|
+
if (transaction === null || typeof transaction === 'undefined') {
|
|
56
|
+
return null;
|
|
57
|
+
}
|
|
58
|
+
try {
|
|
59
|
+
var xdr = typeof transaction === 'string' ? transaction : transaction.transaction;
|
|
60
|
+
stellar_sdk_1.TransactionBuilder.fromXDR(xdr, stellar_sdk_1.Networks.PUBLIC);
|
|
61
|
+
return null;
|
|
62
|
+
}
|
|
63
|
+
catch (_a) {
|
|
64
|
+
return 'is not a valid Stellar transaction XDR';
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
isStellarAddress: function (address) {
|
|
68
|
+
if (typeof address !== 'string' || !stellar_sdk_1.StrKey.isValidEd25519PublicKey(address)) {
|
|
69
|
+
return 'is not a valid Stellar address';
|
|
70
|
+
}
|
|
71
|
+
return null;
|
|
72
|
+
},
|
|
73
|
+
isValidStellarAccount: function (address) { return __awaiter(void 0, void 0, void 0, function () {
|
|
74
|
+
var protocol, _a;
|
|
75
|
+
return __generator(this, function (_b) {
|
|
76
|
+
switch (_b.label) {
|
|
77
|
+
case 0:
|
|
78
|
+
_b.trys.push([0, 2, , 3]);
|
|
79
|
+
protocol = (0, StellarProtocol_1.createStellarProtocol)();
|
|
80
|
+
return [4 /*yield*/, protocol.getTransactionsForPublicKey((0, module_kit_1.newPublicKey)(address, 'encoded'), 1)];
|
|
81
|
+
case 1:
|
|
82
|
+
_b.sent();
|
|
83
|
+
return [2 /*return*/, null];
|
|
84
|
+
case 2:
|
|
85
|
+
_a = _b.sent();
|
|
86
|
+
return [2 /*return*/, 'not a valid or reachable Stellar account'];
|
|
87
|
+
case 3: return [2 /*return*/];
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
}); }
|
|
91
|
+
};
|
|
92
|
+
//# sourceMappingURL=validators.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../../../src/v1/serializer/v3/validators/validators.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,oDAA2E;AAC3E,qEAAyE;AACzE,iDAAiD;AAEpC,QAAA,iBAAiB,GAAG;IAC/B,kBAAkB,EAAE,UAAC,KAAc;QACjC,IAAI,KAAK,KAAK,IAAI,IAAI,OAAO,KAAK,KAAK,WAAW,EAAE;YAClD,OAAO,IAAI,CAAA;SACZ;QAED,0CAA0C;QAC1C,IAAI,KAAK,KAAK,sBAAQ,CAAC,MAAM,EAAE;YAC7B,OAAO,2CAA2C,CAAA;SACnD;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,gBAAgB,EAAE,UAAC,WAAoB;QACrC,IAAI,WAAW,KAAK,IAAI,IAAI,OAAO,WAAW,KAAK,WAAW,EAAE;YAC9D,OAAO,IAAI,CAAA;SACZ;QAED,IAAI;YACF,IAAM,GAAG,GAAG,OAAO,WAAW,KAAK,QAAQ,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAE,WAAuC,CAAC,WAAW,CAAA;YAChH,gCAAkB,CAAC,OAAO,CAAC,GAAG,EAAE,sBAAQ,CAAC,MAAM,CAAC,CAAA;YAChD,OAAO,IAAI,CAAA;SACZ;QAAC,WAAM;YACN,OAAO,wCAAwC,CAAA;SAChD;IACH,CAAC;IAED,gBAAgB,EAAE,UAAC,OAAgB;QACjC,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,CAAC,oBAAM,CAAC,uBAAuB,CAAC,OAAO,CAAC,EAAE;YAC3E,OAAO,gCAAgC,CAAA;SACxC;QAED,OAAO,IAAI,CAAA;IACb,CAAC;IAED,qBAAqB,EAAE,UAAO,OAAe;;;;;;oBAEnC,QAAQ,GAAG,IAAA,uCAAqB,GAAE,CAAA;oBACxC,qBAAM,QAAQ,CAAC,2BAA2B,CAAC,IAAA,yBAAY,EAAC,OAAO,EAAE,SAAS,CAAC,EAAE,CAAC,CAAC,EAAA;;oBAA/E,SAA+E,CAAA;oBAC/E,sBAAO,IAAI,EAAA;;;oBAEX,sBAAO,0CAA0C,EAAA;;;;SAEpD;CACF,CAAA"}
|
|
@@ -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,10 @@
|
|
|
1
|
+
import { SignedTransaction, TransactionCursor, UnsignedTransaction } from '@airgap/module-kit';
|
|
2
|
+
export interface StellarUnsignedTransaction extends UnsignedTransaction {
|
|
3
|
+
transaction: string;
|
|
4
|
+
}
|
|
5
|
+
export interface StellarSignedTransaction extends SignedTransaction {
|
|
6
|
+
transaction: string;
|
|
7
|
+
}
|
|
8
|
+
export interface StellarTransactionCursor extends TransactionCursor {
|
|
9
|
+
next: string;
|
|
10
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"transaction.js","sourceRoot":"","sources":["../../../src/v1/types/transaction.ts"],"names":[],"mappings":";;AAcA,wCAAwC;AACxC,oBAAoB;AACpB,IAAI"}
|