New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@waves/waves-transactions

Package Overview
Dependencies
Maintainers
17
Versions
177
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@waves/waves-transactions - npm Package Compare versions

Comparing version 3.11.0 to 3.12.0

3

dist/general.js

@@ -6,2 +6,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const axios_1 = __importDefault(require("axios"));

@@ -8,0 +11,0 @@ const marshall_1 = require("@waves/marshall");

@@ -0,1 +1,4 @@

/**
* @module index
*/
export { massTransfer } from './transactions/mass-transfer';

@@ -17,5 +20,6 @@ export { reissue } from './transactions/reissue';

export { invokeScript } from './transactions/invoke-script';
export { signTx, verify, serialize, submitOrder, cancelSubmittedOrder } from './general';
export { signTx, verify, serialize, submitOrder, cancelSubmittedOrder, WithTxType } from './general';
export { waitForTx, broadcast } from './nodeInteraction';
export { ITransaction, TTx, TTxParams, IAliasTransaction, IAliasParams, IIssueTransaction, IIssueParams, IReissueTransaction, IReissueParams, IBurnTransaction, IBurnParams, IExchangeTransaction, ILeaseTransaction, ILeaseParams, ICancelLeaseTransaction, ICancelLeaseParams, ITransferTransaction, ITransferParams, IMassTransferTransaction, IMassTransferParams, IMassTransferItem, ISetAssetScriptTransaction, ISetScriptParams, ISponsorshipTransaction, ISponsorshipParams, IDataTransaction, IDataParams, IDataEntry, ISetScriptTransaction, ISetAssetScriptParams, IInvokeScriptTransaction, IInvokeScriptParams, IOrder, IOrderV1, IOrderV2, IOrderV3, TOrder, IOrderParams, ICancelOrder, ICancelOrderParams, WithId, WithSender, WithProofs, } from './transactions';
export { INodeRequestOptions } from './nodeInteraction';
export { TSeedTypes, TOption } from './types';

@@ -22,0 +26,0 @@ import * as crypto from '@waves/waves-crypto';

5

dist/index.js
"use strict";
// Copyright (c) 2018 Yuriy Naydenov
//
/**
* @module index
*/
// This software is released under the MIT License.

@@ -5,0 +6,0 @@ // https://opensource.org/licenses/MIT

@@ -0,1 +1,4 @@

/**
* @module nodeInteraction
*/
import { IDataEntry, TTx } from './transactions';

@@ -2,0 +5,0 @@ export declare type CancellablePromise<T> = Promise<T> & {

"use strict";
/**
* @module nodeInteraction
*/
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {

@@ -3,0 +6,0 @@ return new (P || (P = Promise))(function (resolve, reject) {

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const waves_crypto_1 = require("@waves/waves-crypto");

@@ -14,3 +17,3 @@ const marshall_1 = require("@waves/marshall");

orderId: params.orderId,
signature: waves_crypto_1.signBytes(waves_crypto_1.concat(BASE58_STRING(senderPublicKey), BASE58_STRING(params.orderId)), seed),
signature: waves_crypto_1.signBytes(seed, waves_crypto_1.concat(BASE58_STRING(senderPublicKey), BASE58_STRING(params.orderId))),
};

@@ -17,0 +20,0 @@ return cancelOrderBody;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const waves_crypto_1 = require("@waves/waves-crypto");

@@ -34,7 +37,7 @@ const generic_1 = require("../generic");

if (ord.version === 3) {
ord.matcherFeeAssetId = paramsOrOrder.matcherFeeAssetId;
ord.matcherFeeAssetId = paramsOrOrder.matcherFeeAssetId === 'WAVES' ? null : paramsOrOrder.matcherFeeAssetId;
}
const bytes = marshall_1.binary.serializeOrder(ord);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(ord, waves_crypto_1.signBytes(bytes, s), i));
ord.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(ord, waves_crypto_1.signBytes(s, bytes), i));
ord.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
// OrderV1 uses signature instead of proofs

@@ -41,0 +44,0 @@ if (ord.version === undefined || ord.version === 1)

@@ -6,2 +6,5 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module seedUtils
*/
const waves_crypto_1 = require("@waves/waves-crypto");

@@ -74,3 +77,3 @@ const dictionary_1 = __importDefault(require("./dictionary"));

const random = Array.from({ length })
.map(_ => waves_crypto_1.randomUint8Array(4)
.map(_ => waves_crypto_1.randomBytes(4)
.reduce((acc, next, i) => acc + next * Math.pow(2, (i * 4)), 0));

@@ -89,3 +92,3 @@ const wordCount = dictionary_1.default.length;

const bytes = marshall_1.serializePrimitives.STRING(password);
password = waves_crypto_1.byteArrayToHexString(waves_crypto_1.sha256(bytes));
password = waves_crypto_1.base16Encode(waves_crypto_1.sha256(bytes));
}

@@ -103,3 +106,4 @@ return password;

password = strengthenPassword(password, encryptionRounds);
return waves_crypto_1.libs.CryptoJS.AES.encrypt(seed, password).toString();
return waves_crypto_1.base64Encode(waves_crypto_1.aesEncrypt(seed, password));
//return libs.CryptoJS.AES.encrypt(seed, password).toString()
}

@@ -115,4 +119,4 @@ exports.encryptSeed = encryptSeed;

password = strengthenPassword(password, encryptionRounds);
const hexSeed = waves_crypto_1.libs.CryptoJS.AES.decrypt(encryptedSeed, password);
const byteSeed = waves_crypto_1.hexStringToByteArray(hexSeed.toString());
const byteSeed = waves_crypto_1.aesDecrypt(waves_crypto_1.base64Decode(encryptedSeed), waves_crypto_1.stringToBytes(password)); //libs.CryptoJS.AES.decrypt(encryptedSeed, password)
//const byteSeed = base16Decode(hexSeed.toString())
return marshall_1.parsePrimitives.P_STRING_FIXED(byteSeed.length)(Uint8Array.from(byteSeed)).value;

@@ -119,0 +123,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { TypelessDataEntry } from './transactions/data';

@@ -231,3 +234,6 @@ export declare enum TRANSACTION_TYPE {

*/
args: any[];
args: {
type: 'binary' | 'integer' | 'boolean' | 'string';
value: string | number | boolean;
}[];
}

@@ -234,0 +240,0 @@ /**

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { IAliasParams, IAliasTransaction, WithId, WithSender } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -24,5 +27,5 @@ const marshall_1 = require("@waves/marshall");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
const idBytes = [bytes[0], ...bytes.slice(36, -16)];
tx.id = waves_crypto_1.hashBytes(Uint8Array.from(idBytes));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(Uint8Array.from(idBytes)));
return tx;

@@ -29,0 +32,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { IBurnTransaction, IBurnParams, WithId, WithSender } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -25,4 +28,4 @@ const marshall_1 = require("@waves/marshall");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
return tx;

@@ -29,0 +32,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { ICancelLeaseTransaction, ICancelLeaseParams, WithId, WithSender } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -24,4 +27,4 @@ const marshall_1 = require("@waves/marshall");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
return tx;

@@ -28,0 +31,0 @@ }

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const marshall_1 = require("@waves/marshall");

@@ -50,4 +53,4 @@ const { BASE58_STRING, BASE64_STRING, BYTE, BYTES, COUNT, LEN, LONG, SHORT, STRING, } = marshall_1.serializePrimitives;

const bytes1 = marshall_2.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes1, s), i));
tx.id = waves_crypto_1.hashBytes(bytes1);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes1), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes1));
return tx;

@@ -54,0 +57,0 @@ }

@@ -0,3 +1,6 @@

/**
* @module index
*/
import { IExchangeTransaction, WithId } from '../transactions';
import { TSeedTypes } from '../types';
export declare function exchange(tx: IExchangeTransaction, seed?: TSeedTypes): IExchangeTransaction & WithId;

@@ -10,6 +10,6 @@ "use strict";

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
return Object.assign({}, tx, { id: waves_crypto_1.hashBytes(bytes) });
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
return Object.assign({}, tx, { id: waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes)) });
}
exports.exchange = exchange;
//# sourceMappingURL=exchange.js.map

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { WithId, WithSender, IInvokeScriptParams, IInvokeScriptTransaction } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -19,3 +22,3 @@ const waves_crypto_1 = require("@waves/waves-crypto");

payment: paramsOrTx.payment || [],
fee: generic_1.fee(paramsOrTx, 1000000),
fee: generic_1.fee(paramsOrTx, 500000),
feeAssetId: paramsOrTx.feeAssetId,

@@ -28,4 +31,4 @@ timestamp: paramsOrTx.timestamp || Date.now(),

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes)));
return tx;

@@ -32,0 +35,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { IIssueTransaction, IIssueParams, WithId, WithSender } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -29,4 +32,4 @@ const waves_crypto_1 = require("@waves/waves-crypto");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
return tx;

@@ -33,0 +36,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { ILeaseTransaction, ILeaseParams, WithId, WithSender } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -24,4 +27,4 @@ const waves_crypto_1 = require("@waves/waves-crypto");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
return tx;

@@ -28,0 +31,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { IMassTransferTransaction, IMassTransferParams, WithId, WithSender } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -27,4 +30,4 @@ const generic_1 = require("../generic");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
return tx;

@@ -31,0 +34,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { IReissueTransaction, IReissueParams, WithId, WithSender } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -26,4 +29,4 @@ const waves_crypto_1 = require("@waves/waves-crypto");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
return tx;

@@ -30,0 +33,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { ISetAssetScriptTransaction, ISetAssetScriptParams, WithId, WithSender } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -27,4 +30,4 @@ const waves_crypto_1 = require("@waves/waves-crypto");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
return tx;

@@ -31,0 +34,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { ISetScriptTransaction, ISetScriptParams, WithId, WithSender } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -26,4 +29,4 @@ const waves_crypto_1 = require("@waves/waves-crypto");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
return tx;

@@ -30,0 +33,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { WithId, WithSender, ISponsorshipParams, ISponsorshipTransaction } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -24,4 +27,4 @@ const waves_crypto_1 = require("@waves/waves-crypto");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
return tx;

@@ -28,0 +31,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { ITransferTransaction, ITransferParams, WithId, WithSender } from '../transactions';

@@ -2,0 +5,0 @@ import { TSeedTypes } from '../types';

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
/**
* @module index
*/
const transactions_1 = require("../transactions");

@@ -27,4 +30,4 @@ const waves_crypto_1 = require("@waves/waves-crypto");

const bytes = marshall_1.binary.serializeTx(tx);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(bytes, s), i));
tx.id = waves_crypto_1.hashBytes(bytes);
seedsAndIndexes.forEach(([s, i]) => generic_1.addProof(tx, waves_crypto_1.signBytes(s, bytes), i));
tx.id = waves_crypto_1.base58Encode(waves_crypto_1.blake2b(bytes));
return tx;

@@ -31,0 +34,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
export declare type TOption<T> = T | undefined | null;

@@ -2,0 +5,0 @@ export interface IIndexSeedMap {

"use strict";
/**
* @module index
*/
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=types.js.map
{
"name": "@waves/waves-transactions",
"version": "3.11.0",
"version": "3.12.0",
"description": "Build and sign(multi-sign) transactions for Waves blockchain.",

@@ -27,4 +27,3 @@ "keywords": [

"author": {
"name": "Yuriy Naydenov",
"email": "ebceu44@gmail.com"
"name": "wavesplatform"
},

@@ -35,2 +34,6 @@ "contributors": [

"email": "siemarell@gmail.com"
},
{
"name": "Yuriy Naydenov",
"email": "ebceu44@gmail.com"
}

@@ -60,2 +63,3 @@ ],

"typedoc-clarity-theme": "^1.1.0",
"typedoc-plugin-external-module-name": "^2.1.0",
"typescript": "^3.2.2",

@@ -72,5 +76,5 @@ "typescript-json-schema": "^0.33.0",

"@waves/marshall": "^0.8.0",
"@waves/waves-crypto": "^2.1.2",
"@waves/waves-crypto": "^3.0.16",
"axios": "^0.19.0"
}
}

@@ -44,2 +44,9 @@ # waves-transactions [![npm version](https://badge.fury.io/js/%40waves%2Fwaves-transactions.svg)](https://badge.fury.io/js/%40waves%2Fwaves-transactions)

}, seed)
// or using alias
const signedTranserTx = transfer({
amount: 1,
recipient: 'alias:W:aliasForMyAddress'
}, seed)
```

@@ -46,0 +53,0 @@

@@ -0,1 +1,4 @@

/**
* @module index
*/
import axios from 'axios'

@@ -2,0 +5,0 @@ import { binary, json } from '@waves/marshall'

@@ -1,3 +0,4 @@

// Copyright (c) 2018 Yuriy Naydenov
//
/**
* @module index
*/
// This software is released under the MIT License.

@@ -22,3 +23,3 @@ // https://opensource.org/licenses/MIT

export { invokeScript } from './transactions/invoke-script'
export { signTx, verify, serialize, submitOrder, cancelSubmittedOrder } from './general'
export { signTx, verify, serialize, submitOrder, cancelSubmittedOrder, WithTxType } from './general'
export { waitForTx, broadcast } from './nodeInteraction'

@@ -73,2 +74,4 @@

export { INodeRequestOptions } from './nodeInteraction'
export {

@@ -75,0 +78,0 @@ TSeedTypes, TOption

@@ -0,1 +1,5 @@

/**
* @module nodeInteraction
*/
import { IDataEntry, TTx } from './transactions'

@@ -2,0 +6,0 @@ import axios from 'axios'

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { concat, signBytes } from '@waves/waves-crypto'

@@ -21,4 +24,4 @@ import { serializePrimitives } from '@waves/marshall'

signature: signBytes(
concat(BASE58_STRING(senderPublicKey), BASE58_STRING(params.orderId)),
seed
seed,
concat(BASE58_STRING(senderPublicKey), BASE58_STRING(params.orderId))
),

@@ -25,0 +28,0 @@ }

@@ -1,2 +0,5 @@

import { signBytes, hashBytes } from '@waves/waves-crypto'
/**
* @module index
*/
import { signBytes, blake2b, base58Encode } from '@waves/waves-crypto'
import { addProof, getSenderPublicKey, convertToPairs, isOrder } from '../generic'

@@ -88,3 +91,3 @@ import { IOrder, IOrderParams, TOrder, WithId, WithSender } from '../transactions'

if (ord.version === 3) {
ord.matcherFeeAssetId = paramsOrOrder.matcherFeeAssetId
ord.matcherFeeAssetId = paramsOrOrder.matcherFeeAssetId === 'WAVES' ? null : paramsOrOrder.matcherFeeAssetId
}

@@ -94,4 +97,4 @@

seedsAndIndexes.forEach(([s, i]) => addProof(ord, signBytes(bytes, s), i))
ord.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s, i]) => addProof(ord, signBytes(s, bytes), i))
ord.id = base58Encode(blake2b(bytes))

@@ -98,0 +101,0 @@ // OrderV1 uses signature instead of proofs

@@ -0,1 +1,4 @@

/**
* @module seedUtils
*/
import {

@@ -5,7 +8,9 @@ address,

publicKey,
randomUint8Array,
libs,
byteArrayToHexString,
hexStringToByteArray,
sha256
randomBytes,
//libs,
aesDecrypt,
aesEncrypt,
bytesToString,
base16Decode,
sha256, base16Encode, stringToBytes, base64Encode, base64Decode, base58Decode
} from '@waves/waves-crypto'

@@ -109,3 +114,3 @@ import dictionary from './dictionary'

const random = Array.from({ length })
.map(_ => randomUint8Array(4)
.map(_ => randomBytes(4)
.reduce((acc, next, i) => acc + next * 2 ** (i * 4), 0)

@@ -129,3 +134,3 @@ )

const bytes = serializePrimitives.STRING(password)
password = byteArrayToHexString(sha256(bytes))
password = base16Encode(sha256(bytes))
}

@@ -146,3 +151,4 @@ return password

password = strengthenPassword(password, encryptionRounds)
return libs.CryptoJS.AES.encrypt(seed, password).toString()
return base64Encode(aesEncrypt(seed, password))
//return libs.CryptoJS.AES.encrypt(seed, password).toString()

@@ -162,4 +168,4 @@ }

password = strengthenPassword(password, encryptionRounds)
const hexSeed = libs.CryptoJS.AES.decrypt(encryptedSeed, password)
const byteSeed = hexStringToByteArray(hexSeed.toString())
const byteSeed = aesDecrypt(base64Decode(encryptedSeed), stringToBytes(password))//libs.CryptoJS.AES.decrypt(encryptedSeed, password)
//const byteSeed = base16Decode(hexSeed.toString())
return parsePrimitives.P_STRING_FIXED(byteSeed.length)(Uint8Array.from(byteSeed)).value

@@ -166,0 +172,0 @@ }

@@ -0,1 +1,4 @@

/**
* @module index
*/
import { TypelessDataEntry } from './transactions/data'

@@ -272,4 +275,8 @@

*/
args: any[]
args: {
type: 'binary' | 'integer' | 'boolean' | 'string',
value: string | number | boolean
}[]
}
/**

@@ -304,11 +311,11 @@ * @typeparam LONG Generic type representing LONG type. Default to string | number. Since javascript number more than 2 ** 53 -1 cannot be precisely represented, generic type is used

export interface IOrderV1<LONG = string | number> extends IOrder<LONG > {
export interface IOrderV1<LONG = string | number> extends IOrder<LONG> {
version: 1 | undefined
}
export interface IOrderV2<LONG = string | number> extends IOrder<LONG > {
export interface IOrderV2<LONG = string | number> extends IOrder<LONG> {
version: 2
}
export interface IOrderV3<LONG = string | number> extends IOrder<LONG > {
export interface IOrderV3<LONG = string | number> extends IOrder<LONG> {
version: 3

@@ -315,0 +322,0 @@ matcherFeeAssetId?: string | null

@@ -0,4 +1,7 @@

/**
* @module index
*/
import { TRANSACTION_TYPE, IAliasParams, IAliasTransaction, WithId, WithSender } from '../transactions'
import { binary } from '@waves/marshall'
import { hashBytes, signBytes } from '@waves/waves-crypto'
import { base58Encode, blake2b, signBytes } from '@waves/waves-crypto'
import { addProof, convertToPairs, fee, getSenderPublicKey, networkByte } from '../generic'

@@ -31,8 +34,8 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
const idBytes = [bytes[0], ...bytes.slice(36, -16)]
tx.id = hashBytes(Uint8Array.from(idBytes))
tx.id = base58Encode(blake2b(Uint8Array.from(idBytes)))
return tx
}

@@ -0,4 +1,7 @@

/**
* @module index
*/
import { TRANSACTION_TYPE, IBurnTransaction, IBurnParams, WithId, WithSender } from '../transactions'
import { binary } from '@waves/marshall'
import { signBytes, hashBytes } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode } from '@waves/waves-crypto'
import { addProof, getSenderPublicKey, convertToPairs, networkByte, fee } from '../generic'

@@ -31,6 +34,6 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
tx.id = base58Encode(blake2b(bytes))
return tx
}

@@ -0,4 +1,7 @@

/**
* @module index
*/
import { TRANSACTION_TYPE, ICancelLeaseTransaction, ICancelLeaseParams, WithId, WithSender } from '../transactions'
import { binary } from '@waves/marshall'
import { signBytes, hashBytes } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode } from '@waves/waves-crypto'
import { addProof, getSenderPublicKey, convertToPairs, networkByte, fee } from '../generic'

@@ -31,6 +34,6 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
tx.id = base58Encode(blake2b(bytes))
return tx
}

@@ -0,1 +1,4 @@

/**
* @module index
*/
import {serializePrimitives} from '@waves/marshall'

@@ -13,3 +16,3 @@ const {

} = serializePrimitives
import { concat, hashBytes, signBytes } from '@waves/waves-crypto'
import { concat, blake2b, signBytes, base58Encode } from '@waves/waves-crypto'
import {

@@ -93,6 +96,6 @@ IDataTransaction,

seedsAndIndexes.forEach(([s,i]) => addProof(tx, signBytes(bytes1, s),i))
tx.id = hashBytes(bytes1)
seedsAndIndexes.forEach(([s,i]) => addProof(tx, signBytes(s, bytes1),i))
tx.id = base58Encode(blake2b(bytes1))
return tx
}

@@ -0,4 +1,7 @@

/**
* @module index
*/
import { TRANSACTION_TYPE, IExchangeTransaction, WithId, WithSender } from '../transactions'
import { binary } from '@waves/marshall'
import { signBytes, hashBytes } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode } from '@waves/waves-crypto'
import { addProof, getSenderPublicKey, convertToPairs, fee } from '../generic'

@@ -14,5 +17,5 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
return {...tx, id: hashBytes(bytes)}
return {...tx, id: base58Encode(blake2b(bytes))}
}

@@ -0,1 +1,4 @@

/**
* @module index
*/
import {

@@ -8,3 +11,3 @@ TRANSACTION_TYPE,

} from '../transactions'
import { signBytes, hashBytes, } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode, } from '@waves/waves-crypto'
import { addProof, getSenderPublicKey, convertToPairs, fee, networkByte } from '../generic'

@@ -31,3 +34,3 @@ import { TSeedTypes } from '../types'

payment: paramsOrTx.payment || [],
fee: fee(paramsOrTx, 1000000),
fee: fee(paramsOrTx, 500000),
feeAssetId: paramsOrTx.feeAssetId,

@@ -42,6 +45,6 @@ timestamp: paramsOrTx.timestamp || Date.now(),

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
tx.id = base58Encode(base58Encode(blake2b(bytes)))
return tx
}

@@ -0,3 +1,6 @@

/**
* @module index
*/
import { IIssueTransaction, TRANSACTION_TYPE, IIssueParams, WithId, WithSender } from '../transactions'
import { signBytes, hashBytes } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode } from '@waves/waves-crypto'
import { addProof, getSenderPublicKey, base64Prefix, convertToPairs, fee, networkByte } from '../generic'

@@ -36,6 +39,6 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
tx.id = base58Encode(blake2b(bytes))
return tx
}

@@ -0,3 +1,6 @@

/**
* @module index
*/
import { TRANSACTION_TYPE, ILeaseTransaction, ILeaseParams, WithId, WithSender } from '../transactions'
import { signBytes, hashBytes } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode } from '@waves/waves-crypto'
import { addProof, convertToPairs, fee, getSenderPublicKey } from '../generic'

@@ -31,6 +34,6 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
tx.id = base58Encode(blake2b(bytes))
return tx
}

@@ -0,5 +1,8 @@

/**
* @module index
*/
import { TRANSACTION_TYPE, IMassTransferTransaction, IMassTransferParams, WithId, WithSender } from '../transactions'
import { addProof, convertToPairs, fee, getSenderPublicKey } from '../generic'
import { TSeedTypes } from '../types'
import { hashBytes, signBytes } from '@waves/waves-crypto'
import { base58Encode, blake2b, signBytes } from '@waves/waves-crypto'
import { binary } from '@waves/marshall'

@@ -34,6 +37,6 @@

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
tx.id = base58Encode(blake2b(bytes))
return tx
}

@@ -0,3 +1,6 @@

/**
* @module index
*/
import { TRANSACTION_TYPE, IReissueTransaction, IReissueParams, WithId, WithSender } from '../transactions'
import { signBytes, hashBytes } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode } from '@waves/waves-crypto'
import { addProof, convertToPairs, fee, getSenderPublicKey, networkByte } from '../generic'

@@ -33,6 +36,6 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s,i]) => addProof(tx, signBytes(bytes, s),i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s,i]) => addProof(tx, signBytes(s, bytes),i))
tx.id = base58Encode(blake2b(bytes))
return tx
}

@@ -0,1 +1,4 @@

/**
* @module index
*/
import {

@@ -8,3 +11,3 @@ TRANSACTION_TYPE,

} from '../transactions'
import { signBytes, hashBytes, } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode, } from '@waves/waves-crypto'
import { addProof, getSenderPublicKey, base64Prefix, convertToPairs, networkByte, fee } from '../generic'

@@ -39,6 +42,6 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
tx.id = base58Encode(blake2b(bytes))
return tx
}

@@ -0,3 +1,6 @@

/**
* @module index
*/
import { TRANSACTION_TYPE, ISetScriptTransaction, ISetScriptParams, WithId, WithSender } from '../transactions'
import { signBytes, hashBytes, } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode, } from '@waves/waves-crypto'
import { addProof, getSenderPublicKey, base64Prefix, convertToPairs, networkByte, fee } from '../generic'

@@ -31,6 +34,6 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s,i]) => addProof(tx, signBytes(bytes, s),i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s,i]) => addProof(tx, signBytes(s, bytes),i))
tx.id = base58Encode(blake2b(bytes))
return tx
}

@@ -0,3 +1,6 @@

/**
* @module index
*/
import { TRANSACTION_TYPE, WithId, WithSender, ISponsorshipParams, ISponsorshipTransaction } from '../transactions'
import { signBytes, hashBytes } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode } from '@waves/waves-crypto'
import { addProof, getSenderPublicKey, convertToPairs, fee } from '../generic'

@@ -31,6 +34,6 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
tx.id = base58Encode(blake2b(bytes))
return tx
}

@@ -0,3 +1,6 @@

/**
* @module index
*/
import { TRANSACTION_TYPE, ITransferTransaction, ITransferParams, WithId, WithSender } from '../transactions'
import { signBytes, hashBytes } from '@waves/waves-crypto'
import { signBytes, blake2b, base58Encode } from '@waves/waves-crypto'
import { addProof, getSenderPublicKey, convertToPairs, fee } from '../generic'

@@ -33,6 +36,6 @@ import { TSeedTypes } from '../types'

seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(bytes, s), i))
tx.id = hashBytes(bytes)
seedsAndIndexes.forEach(([s, i]) => addProof(tx, signBytes(s, bytes), i))
tx.id = base58Encode(blake2b(bytes))
return tx
}

@@ -0,1 +1,5 @@

/**
* @module index
*/
export type TOption<T> = T | undefined | null

@@ -2,0 +6,0 @@

Sorry, the diff of this file is not supported yet

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 not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc