@vostokplatform/signature-generator
Advanced tools
Comparing version 2.0.0-RC2 to 2.0.0-RC3
@@ -65,2 +65,7 @@ import { BigNumber } from '@waves/data-entities'; | ||
} | ||
export declare class Attachment extends ByteProcessor<Uint8Array | string> { | ||
constructor(required: boolean); | ||
getValidationError(value: Uint8Array | string): string; | ||
getBytes(value: Uint8Array | string): Promise<Uint8Array>; | ||
} | ||
export declare class Alias extends ByteProcessor<string> { | ||
@@ -67,0 +72,0 @@ constructor(required: boolean); |
@@ -33,3 +33,2 @@ "use strict"; | ||
var converters_1 = require("../libs/converters"); | ||
// StringWithLength Attachment | ||
// NOTE : Waves asset ID in blockchain transactions equals to an empty string | ||
@@ -272,2 +271,26 @@ function blockchainifyAssetId(assetId) { | ||
exports.StringWithLength = StringWithLength; | ||
var Attachment = /** @class */ (function (_super) { | ||
__extends(Attachment, _super); | ||
function Attachment(required) { | ||
return _super.call(this, required) || this; | ||
} | ||
Attachment.prototype.getValidationError = function (value) { | ||
if (typeof value === 'string') { | ||
value = Uint8Array.from(convert_1.default.stringToByteArray(value)); | ||
} | ||
if (value.length > constants_2.TRANSFER_ATTACHMENT_BYTE_LIMIT) { | ||
return 'Maximum attachment length is exceeded'; | ||
} | ||
return null; | ||
}; | ||
Attachment.prototype.getBytes = function (value) { | ||
if (typeof value === 'string') { | ||
value = Uint8Array.from(convert_1.default.stringToByteArray(value)); | ||
} | ||
var valueWithLength = convert_1.default.bytesToByteArrayWithSize(value); | ||
return Promise.resolve(Uint8Array.from(valueWithLength)); | ||
}; | ||
return Attachment; | ||
}(ByteProcessor)); | ||
exports.Attachment = Attachment; | ||
// COMPLEX | ||
@@ -274,0 +297,0 @@ var Alias = /** @class */ (function (_super) { |
{ | ||
"name": "@vostokplatform/signature-generator", | ||
"version": "2.0.0-RC2", | ||
"version": "2.0.0-RC3", | ||
"main": "dist/index.js", | ||
@@ -5,0 +5,0 @@ "files": [ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
5927488
101238