@waves/waves-transactions
Advanced tools
Comparing version 3.12.2 to 3.13.0
@@ -1,6 +0,3 @@ | ||
import { ICancelOrder, TRANSACTION_TYPE, TTx, TTxParams, TOrder } from './transactions'; | ||
import { ICancelOrder, TTx, TTxParams, TOrder, WithTxType } from './transactions'; | ||
import { TSeedTypes } from './types'; | ||
export interface WithTxType { | ||
type: TRANSACTION_TYPE; | ||
} | ||
export declare const txTypeMap: { | ||
@@ -7,0 +4,0 @@ [type: number]: { |
@@ -20,6 +20,6 @@ /** | ||
export { invokeScript } from './transactions/invoke-script'; | ||
export { signTx, verify, serialize, submitOrder, cancelSubmittedOrder, WithTxType } from './general'; | ||
export { signTx, verify, serialize, submitOrder, cancelSubmittedOrder } 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 { 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, WithTxType, WithChainId, } from './transactions'; | ||
export { INodeRequestOptions, IStateChangeResponse } from './nodeInteraction'; | ||
export { TSeedTypes, TOption } from './types'; | ||
@@ -26,0 +26,0 @@ import * as crypto from '@waves/waves-crypto'; |
@@ -0,5 +1,5 @@ | ||
/// <reference types="node" /> | ||
/** | ||
* @module index | ||
*/ | ||
import { TypelessDataEntry } from './transactions/data'; | ||
export declare enum TRANSACTION_TYPE { | ||
@@ -57,2 +57,5 @@ GENESIS = 1, | ||
} | ||
export interface WithTxType { | ||
type: TRANSACTION_TYPE; | ||
} | ||
/** | ||
@@ -197,2 +200,6 @@ * This interface has common fields for all transactions | ||
} | ||
export interface ITypelessDataEntry { | ||
key: string; | ||
value: string | number | boolean | Buffer | Uint8Array | number[]; | ||
} | ||
/** | ||
@@ -344,3 +351,3 @@ * @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 IDataParams<LONG = string | number> extends IBasicParams<LONG> { | ||
data: Array<IDataEntry | TypelessDataEntry>; | ||
data: Array<IDataEntry | ITypelessDataEntry>; | ||
} | ||
@@ -347,0 +354,0 @@ /** |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
/** | ||
* @module index | ||
*/ | ||
var TRANSACTION_TYPE; | ||
@@ -4,0 +7,0 @@ (function (TRANSACTION_TYPE) { |
@@ -1,9 +0,4 @@ | ||
/// <reference types="node" /> | ||
import { IDataTransaction, IDataParams, WithId, WithSender } from '../transactions'; | ||
import { TSeedTypes } from '../types'; | ||
export interface TypelessDataEntry { | ||
key: string; | ||
value: string | number | boolean | Buffer | Uint8Array | number[]; | ||
} | ||
export declare function data(params: IDataParams, seed: TSeedTypes): IDataTransaction & WithId; | ||
export declare function data(paramsOrTx: IDataParams & WithSender | IDataTransaction, seed?: TSeedTypes): IDataTransaction & WithId; |
{ | ||
"name": "@waves/waves-transactions", | ||
"version": "3.12.2", | ||
"version": "3.13.0", | ||
"description": "Build and sign(multi-sign) transactions for Waves blockchain.", | ||
@@ -17,4 +17,6 @@ "keywords": [ | ||
"scripts": { | ||
"preversion": "npm run build", | ||
"postversion": "npm publish", | ||
"postpublish": "git push origin head", | ||
"build": "ts-node build/build.ts && webpack --config webpack.config.js --env", | ||
"prepublishOnly": "npm run build", | ||
"fix-style": "tslint --fix -c tslint.json '{src,test,usage}/**/*{.ts,.tsx}'", | ||
@@ -21,0 +23,0 @@ "test": "jest" |
@@ -24,3 +24,3 @@ /** | ||
TTxParams, | ||
IInvokeScriptTransaction, TOrder | ||
IInvokeScriptTransaction, TOrder, WithTxType | ||
} from './transactions' | ||
@@ -44,5 +44,2 @@ import { TSeedTypes } from './types' | ||
export interface WithTxType { | ||
type: TRANSACTION_TYPE | ||
} | ||
@@ -49,0 +46,0 @@ export const txTypeMap: { [type: number]: { sign: (tx: TTx | TTxParams & WithTxType, seed: TSeedTypes) => TTx } } = { |
@@ -23,3 +23,3 @@ /** | ||
export { invokeScript } from './transactions/invoke-script' | ||
export { signTx, verify, serialize, submitOrder, cancelSubmittedOrder, WithTxType } from './general' | ||
export { signTx, verify, serialize, submitOrder, cancelSubmittedOrder } from './general' | ||
export { waitForTx, broadcast } from './nodeInteraction' | ||
@@ -72,5 +72,7 @@ | ||
WithProofs, | ||
WithTxType, | ||
WithChainId, | ||
} from './transactions' | ||
export { INodeRequestOptions } from './nodeInteraction' | ||
export { INodeRequestOptions, IStateChangeResponse } from './nodeInteraction' | ||
@@ -77,0 +79,0 @@ export { |
/** | ||
* @module index | ||
*/ | ||
import { TypelessDataEntry } from './transactions/data' | ||
export enum TRANSACTION_TYPE { | ||
@@ -65,2 +63,6 @@ GENESIS = 1, | ||
export interface WithTxType { | ||
type: TRANSACTION_TYPE | ||
} | ||
/** | ||
@@ -235,2 +237,7 @@ * This interface has common fields for all transactions | ||
export interface ITypelessDataEntry { | ||
key: string | ||
value: string | number | boolean | Buffer | Uint8Array | number[] | ||
} | ||
/** | ||
@@ -413,3 +420,3 @@ * @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 IDataParams<LONG = string | number> extends IBasicParams<LONG> { | ||
data: Array<IDataEntry | TypelessDataEntry> | ||
data: Array<IDataEntry | ITypelessDataEntry> | ||
} | ||
@@ -416,0 +423,0 @@ |
@@ -24,3 +24,3 @@ /** | ||
WithId, | ||
WithSender | ||
WithSender, ITypelessDataEntry | ||
} from '../transactions' | ||
@@ -31,9 +31,3 @@ import { addProof, convertToPairs, fee, getSenderPublicKey } from '../generic' | ||
export interface TypelessDataEntry { | ||
key: string | ||
value: string | number | boolean | Buffer | Uint8Array | number[] | ||
} | ||
const typeMap: any = { | ||
@@ -69,3 +63,3 @@ integer: ['integer', 0, LONG], | ||
BASE58_STRING(senderPublicKey), | ||
COUNT(SHORT)((x: IDataEntry | TypelessDataEntry) => concat(LEN(SHORT)(STRING)(x.key), [mapType(x.value)[1]], mapType(x.value)[2](x.value)))(paramsOrTx.data), | ||
COUNT(SHORT)((x: IDataEntry | ITypelessDataEntry) => concat(LEN(SHORT)(STRING)(x.key), [mapType(x.value)[1]], mapType(x.value)[2](x.value)))(paramsOrTx.data), | ||
LONG(_timestamp) | ||
@@ -84,3 +78,3 @@ ) | ||
id: '', | ||
data: paramsOrTx.data && (paramsOrTx.data as any).map((x: IDataEntry | TypelessDataEntry) => { | ||
data: paramsOrTx.data && (paramsOrTx.data as any).map((x: IDataEntry | ITypelessDataEntry) => { | ||
if ((<any>x).type) return x | ||
@@ -87,0 +81,0 @@ else { |
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
763722
5957