Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@dydxprotocol/starkex-lib

Package Overview
Dependencies
Maintainers
10
Versions
62
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dydxprotocol/starkex-lib - npm Package Compare versions

Comparing version 0.6.0 to 0.6.1

__tests__/signable/conditional-transfer.test.ts

2

__tests__/helpers/assets.test.ts

@@ -5,2 +5,4 @@ /**

import expect from 'expect';
import {

@@ -7,0 +9,0 @@ ASSET_ID_MAP,

@@ -5,2 +5,4 @@ /**

import expect from 'expect';
import { KeyPair } from '../../src/types';

@@ -7,0 +9,0 @@

@@ -5,2 +5,4 @@ /**

import expect from 'expect';
// Module under test.

@@ -7,0 +9,0 @@ import {

@@ -5,2 +5,4 @@ /**

import expect from 'expect';
import {

@@ -7,0 +9,0 @@ KeyPair,

@@ -5,2 +5,4 @@ /**

import expect from 'expect';
import {

@@ -7,0 +9,0 @@ ApiMethod,

@@ -5,2 +5,4 @@ /**

import expect from 'expect';
import {

@@ -7,0 +9,0 @@ KeyPair,

3

__tests__/signable/order.test.ts

@@ -6,2 +6,3 @@ /**

import Big, { RoundingMode } from 'big.js';
import expect from 'expect';

@@ -193,3 +194,3 @@ import {

// Repeat some number of times.
for (let i = 0; i < 1; i++) {
for (let i = 0; i < 3; i++) {
const keyPair: KeyPair = generateKeyPairUnsafe();

@@ -196,0 +197,0 @@ const signableOrder = SignableOrder.fromOrder(mockOrder);

/**
* Unit tests for signable/withdrawals.ts.
* Unit tests for signable/withdrawal.ts.
*/
import expect from 'expect';
import {

@@ -122,3 +124,3 @@ KeyPair,

// Repeat some number of times.
for (let i = 0; i < 1; i++) {
for (let i = 0; i < 3; i++) {
const keyPair: KeyPair = generateKeyPairUnsafe();

@@ -125,0 +127,0 @@ const signableWithdrawal = SignableWithdrawal.fromWithdrawal(mockWithdrawal);

@@ -5,2 +5,4 @@ /**

import expect from 'expect';
// Module under test.

@@ -7,0 +9,0 @@ import {

@@ -5,3 +5,7 @@ "use strict";

*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const expect_1 = __importDefault(require("expect"));
const constants_1 = require("../../src/constants");

@@ -14,6 +18,6 @@ const types_1 = require("../../src/types");

it('converts a number of quantums to a human-readable amount', () => {
expect(assets_1.fromQuantums('1000', types_1.DydxAsset.ETH)).toBe('0.00001');
expect_1.default(assets_1.fromQuantums('1000', types_1.DydxAsset.ETH)).toBe('0.00001');
});
it('throws if the asset is unknown', () => {
expect(() => {
expect_1.default(() => {
assets_1.fromQuantums('1000', 'UNKNOWN');

@@ -25,3 +29,3 @@ }).toThrow('Unknown asset');

it('converts order params to Starkware order params', () => {
expect(assets_1.getStarkwareAmounts({
expect_1.default(assets_1.getStarkwareAmounts({
market: types_1.DydxMarket.BTC_USD,

@@ -40,3 +44,3 @@ side: types_1.StarkwareOrderSide.SELL,

it('converts order params with a quote amount instead of price', () => {
expect(assets_1.getStarkwareAmounts({
expect_1.default(assets_1.getStarkwareAmounts({
market: types_1.DydxMarket.BTC_USD,

@@ -55,3 +59,3 @@ side: types_1.StarkwareOrderSide.SELL,

it('throws if the order size is not a multiple of the Starkware quantum', () => {
expect(() => {
expect_1.default(() => {
assets_1.getStarkwareAmounts({

@@ -66,3 +70,3 @@ market: types_1.DydxMarket.BTC_USD,

it('throws if the quote amount is given and is not a multiple of the Starkware quantum', () => {
expect(() => {
expect_1.default(() => {
assets_1.getStarkwareAmounts({

@@ -79,6 +83,6 @@ market: types_1.DydxMarket.BTC_USD,

it('converts a human readable amount to an integer number of quantums', () => {
expect(assets_1.toQuantumsExact('12.0000003', types_1.DydxAsset.LINK)).toBe('120000003');
expect_1.default(assets_1.toQuantumsExact('12.0000003', types_1.DydxAsset.LINK)).toBe('120000003');
});
it('throws if the amount does not divide evenly by the quantum size', () => {
expect(() => {
expect_1.default(() => {
assets_1.toQuantumsExact('12.00000031', types_1.DydxAsset.LINK);

@@ -90,6 +94,6 @@ }).toThrow('not a multiple of the quantum size');

it('converts a human readable amount to an integer number of quantums', () => {
expect(assets_1.toQuantumsRoundDown('12.0000003', types_1.DydxAsset.LINK)).toBe('120000003');
expect_1.default(assets_1.toQuantumsRoundDown('12.0000003', types_1.DydxAsset.LINK)).toBe('120000003');
});
it('rounds down if the amount does not divide evenly by the quantum size', () => {
expect(assets_1.toQuantumsRoundDown('12.00000031', types_1.DydxAsset.LINK)).toBe('120000003');
expect_1.default(assets_1.toQuantumsRoundDown('12.00000031', types_1.DydxAsset.LINK)).toBe('120000003');
});

@@ -99,9 +103,9 @@ });

it('converts a human readable amount to an integer number of quantums', () => {
expect(assets_1.toQuantumsRoundUp('12.0000003', types_1.DydxAsset.LINK)).toBe('120000003');
expect_1.default(assets_1.toQuantumsRoundUp('12.0000003', types_1.DydxAsset.LINK)).toBe('120000003');
});
it('rounds up if the amount does not divide evenly by the quantum size', () => {
expect(assets_1.toQuantumsRoundUp('12.00000031', types_1.DydxAsset.LINK)).toBe('120000004');
expect_1.default(assets_1.toQuantumsRoundUp('12.00000031', types_1.DydxAsset.LINK)).toBe('120000004');
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXRzLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9fX3Rlc3RzX18vaGVscGVycy9hc3NldHMudGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7O0dBRUc7O0FBRUgsbURBRzZCO0FBQzdCLDJDQUl5QjtBQUV6QixxQkFBcUI7QUFDckIscURBTWtDO0FBRWxDLFFBQVEsQ0FBQyxnQkFBZ0IsRUFBRSxHQUFHLEVBQUU7SUFFOUIsUUFBUSxDQUFDLGdCQUFnQixFQUFFLEdBQUcsRUFBRTtRQUU5QixFQUFFLENBQUMsMERBQTBELEVBQUUsR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BQ0osNEJBQW1CLENBQUMsWUFBWSxFQUFFLGlCQUFTLENBQUMsSUFBSSxDQUFDLENBQ2xELENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDO1FBQ3RCLENBQUMsQ0FBQyxDQUFDO1FBRUgsRUFBRSxDQUFDLHNFQUFzRSxFQUFFLEdBQUcsRUFBRTtZQUM5RSxnQkFBTSxDQUNKLDRCQUFtQixDQUFDLGFBQWEsRUFBRSxpQkFBUyxDQUFDLElBQUksQ0FBQyxDQUNuRCxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQztRQUN0QixDQUFDLENBQUMsQ0FBQztJQUNMLENBQUMsQ0FBQyxDQUFDO0lBRUgsUUFBUSxDQUFDLHFCQUFxQixFQUFFLEdBQUcsRUFBRTtRQUVuQyxFQUFFLENBQUMsbUVBQW1FLEVBQUUsR0FBRyxFQUFFO1lBQzNFLGdCQUFNLENBQ0osMEJBQWlCLENBQUMsWUFBWSxFQUFFLGlCQUFTLENBQUMsSUFBSSxDQUFDLENBQ2hELENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDO1FBQ3RCLENBQUMsQ0FBQyxDQUFDO1FBRUgsRUFBRSxDQUFDLG9FQUFvRSxFQUFFLEdBQUcsRUFBRTtZQUM1RSxnQkFBTSxDQUNKLDBCQUFpQixDQUFDLGFBQWEsRUFBRSxpQkFBUyxDQUFDLElBQUksQ0FBQyxDQUNqRCxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQztRQUN0QixDQUFDLENBQUMsQ0FBQztJQUNMLENBQUMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyxDQUFDLENBQUMifQ==

@@ -5,3 +5,7 @@ "use strict";

*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const expect_1 = __importDefault(require("expect"));
// Module under test.

@@ -32,11 +36,11 @@ const crypto_1 = require("../../src/helpers/crypto");

const ecKeyPair = crypto_1.asEcKeyPair(mockKeyPair);
expect(crypto_1.asSimpleKeyPair(ecKeyPair)).toEqual(mockPaddedKeyPair);
expect_1.default(crypto_1.asSimpleKeyPair(ecKeyPair)).toEqual(mockPaddedKeyPair);
});
it('accepts a padded key pair as argument', () => {
const ecKeyPair = crypto_1.asEcKeyPair(mockPaddedKeyPair);
expect(crypto_1.asSimpleKeyPair(ecKeyPair)).toEqual(mockPaddedKeyPair);
expect_1.default(crypto_1.asSimpleKeyPair(ecKeyPair)).toEqual(mockPaddedKeyPair);
});
it('accepts a private key as argument', () => {
const ecKeyPair = crypto_1.asEcKeyPair(mockKeyPair.privateKey);
expect(crypto_1.asSimpleKeyPair(ecKeyPair)).toEqual(mockPaddedKeyPair);
expect_1.default(crypto_1.asSimpleKeyPair(ecKeyPair)).toEqual(mockPaddedKeyPair);
});

@@ -47,7 +51,7 @@ });

const ecKeyPair = crypto_1.asEcKeyPairPublic(mockKeyPair.publicKey, false);
expect(crypto_1.asSimplePublicKey(ecKeyPair.getPublic())).toEqual(mockPaddedKeyPair.publicKey);
expect_1.default(crypto_1.asSimplePublicKey(ecKeyPair.getPublic())).toEqual(mockPaddedKeyPair.publicKey);
});
it('gets a public key from an x-coordinate (odd y)', () => {
const ecKeyPair = crypto_1.asEcKeyPairPublic(mockKeyPairEvenY.publicKey, true);
expect(crypto_1.asSimplePublicKey(ecKeyPair.getPublic())).toEqual(mockPaddedKeyPairEvenY.publicKey);
expect_1.default(crypto_1.asSimplePublicKey(ecKeyPair.getPublic())).toEqual(mockPaddedKeyPairEvenY.publicKey);
});

@@ -58,3 +62,3 @@ });

const ecKeyPair = crypto_1.asEcKeyPairPublic(mockKeyPair.publicKey, false);
expect(() => crypto_1.asSimpleKeyPair(ecKeyPair)).toThrow('Key pair has no private key');
expect_1.default(() => crypto_1.asSimpleKeyPair(ecKeyPair)).toThrow('Key pair has no private key');
});

@@ -68,3 +72,3 @@ });

};
expect(crypto_1.serializeSignature(signatureStruct)).toBe(mockSignature);
expect_1.default(crypto_1.serializeSignature(signatureStruct)).toBe(mockSignature);
});

@@ -76,3 +80,3 @@ it('pads s', () => {

};
expect(crypto_1.serializeSignature(signatureStruct)).toBe(mockSignature);
expect_1.default(crypto_1.serializeSignature(signatureStruct)).toBe(mockSignature);
});

@@ -82,6 +86,6 @@ });

it('throws if the serialized signature has the wrong length', () => {
expect(() => crypto_1.deserializeSignature(mockSignature.slice(1))).toThrow('Invalid serialized signature');
expect_1.default(() => crypto_1.deserializeSignature(mockSignature.slice(1))).toThrow('Invalid serialized signature');
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiY3J5cHRvLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9fX3Rlc3RzX18vaGVscGVycy9jcnlwdG8udGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7O0dBRUc7O0FBSUgscUJBQXFCO0FBQ3JCLHFEQU9rQztBQUVsQyxlQUFlO0FBQ2YsTUFBTSxXQUFXLEdBQVk7SUFDM0IsU0FBUyxFQUFFLGlFQUFpRTtJQUM1RSxVQUFVLEVBQUUsaUVBQWlFO0NBQzlFLENBQUM7QUFDRixNQUFNLGlCQUFpQixHQUFZO0lBQ2pDLFNBQVMsRUFBRSxJQUFJLFdBQVcsQ0FBQyxTQUFTLEVBQUU7SUFDdEMsVUFBVSxFQUFFLElBQUksV0FBVyxDQUFDLFVBQVUsRUFBRTtDQUN6QyxDQUFDO0FBQ0YsTUFBTSxnQkFBZ0IsR0FBWTtJQUNoQyxTQUFTLEVBQUUsaUVBQWlFO0lBQzVFLFVBQVUsRUFBRSxpRUFBaUU7Q0FDOUUsQ0FBQztBQUNGLE1BQU0sc0JBQXNCLEdBQVk7SUFDdEMsU0FBUyxFQUFFLElBQUksZ0JBQWdCLENBQUMsU0FBUyxFQUFFO0lBQzNDLFVBQ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yxDQUFDLEVBQUUsQ0FBQzthQUMzQixDQUFDO1lBQ0YsZ0JBQU0sQ0FBQywyQkFBa0IsQ0FBQyxlQUFlLENBQUMsQ0FBQyxDQUFDLElBQUksQ0FBQyxhQUFhLENBQUMsQ0FBQztRQUNsRSxDQUFDLENBQUMsQ0FBQztRQUVILEVBQUUsQ0FBQyxRQUFRLEVBQUUsR0FBRyxFQUFFO1lBQ2hCLE1BQU0sZUFBZSxHQUFHO2dCQUN0QixDQUFDLEVBQUUsYUFBYSxDQUFDLEtBQUssQ0FBQyxDQUFDLEVBQUUsRUFBRSxDQUFDO2dCQUM3QixDQUFDLEVBQUUsYUFBYSxDQUFDLEtBQUssQ0FBQyxFQUFFLENBQUM7YUFDM0IsQ0FBQztZQUNGLGdCQUFNLENBQUMsMkJBQWtCLENBQUMsZUFBZSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsYUFBYSxDQUFDLENBQUM7UUFDbEUsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDLENBQUMsQ0FBQztJQUVILFFBQVEsQ0FBQyx3QkFBd0IsRUFBRSxHQUFHLEVBQUU7UUFFdEMsRUFBRSxDQUFDLHlEQUF5RCxFQUFFLEdBQUcsRUFBRTtZQUNqRSxnQkFBTSxDQUFDLEdBQUcsRUFBRSxDQUFDLDZCQUFvQixDQUFDLGFBQWEsQ0FBQyxLQUFLLENBQUMsQ0FBQyxDQUFDLENBQUMsQ0FBQyxDQUFDLE9BQU8sQ0FDaEUsOEJBQThCLENBQy9CLENBQUM7UUFDSixDQUFDLENBQUMsQ0FBQztJQUNMLENBQUMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyxDQUFDLENBQUMifQ==

@@ -5,3 +5,7 @@ "use strict";

*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const expect_1 = __importDefault(require("expect"));
// Module under test.

@@ -12,10 +16,10 @@ const misc_1 = require("../../src/helpers/misc");

it('produces the expected nonces', () => {
expect(misc_1.nonceFromClientId('')).toBe('2018687061');
expect(misc_1.nonceFromClientId('1')).toBe('3079101259');
expect(misc_1.nonceFromClientId('a')).toBe('2951628987');
expect(misc_1.nonceFromClientId('A really long client ID used to identify an order or withdrawal')).toBe('2913863714');
expect(misc_1.nonceFromClientId('A really long client ID used to identify an order or withdrawal!')).toBe('230317226');
expect_1.default(misc_1.nonceFromClientId('')).toBe('2018687061');
expect_1.default(misc_1.nonceFromClientId('1')).toBe('3079101259');
expect_1.default(misc_1.nonceFromClientId('a')).toBe('2951628987');
expect_1.default(misc_1.nonceFromClientId('A really long client ID used to identify an order or withdrawal')).toBe('2913863714');
expect_1.default(misc_1.nonceFromClientId('A really long client ID used to identify an order or withdrawal!')).toBe('230317226');
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoibWlzYy50ZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vX190ZXN0c19fL2hlbHBlcnMvbWlzYy50ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7R0FFRzs7QUFFSCxxQkFBcUI7QUFDckIsaURBRWdDO0FBRWhDLFFBQVEsQ0FBQyxjQUFjLEVBQUUsR0FBRyxFQUFFO0lBRTVCLFFBQVEsQ0FBQyxxQkFBcUIsRUFBRSxHQUFHLEVBQUU7UUFFbkMsRUFBRSxDQUFDLDhCQUE4QixFQUFFLEdBQUcsRUFBRTtZQUN0QyxNQUFNLENBQUMsd0JBQWlCLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQyxJQUFJLENBQUMsWUFBWSxDQUFDLENBQUM7WUFDakQsTUFBTSxDQUFDLHdCQUFpQixDQUFDLEdBQUcsQ0FBQyxDQUFDLENBQUMsSUFBSSxDQUFDLFlBQVksQ0FBQyxDQUFDO1lBQ2xELE1BQU0sQ0FBQyx3QkFBaUI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QUMsWUFBWSxDQUFDLENBQUM7WUFDbEQsZ0JBQU0sQ0FBQyx3QkFBaUIsQ0FDdEIsaUVBQWlFLENBQ2xFLENBQUMsQ0FBQyxJQUFJLENBQUMsWUFBWSxDQUFDLENBQUM7WUFDdEIsZ0JBQU0sQ0FBQyx3QkFBaUIsQ0FDdEIsa0VBQWtFLENBQ25FLENBQUMsQ0FBQyxJQUFJLENBQUMsV0FBVyxDQUFDLENBQUM7UUFDdkIsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDLENBQUMsQ0FBQztBQUNMLENBQUMsQ0FBQyxDQUFDIn0=

@@ -5,3 +5,7 @@ "use strict";

*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const expect_1 = __importDefault(require("expect"));
const util_1 = require("../src/lib/util");

@@ -15,7 +19,7 @@ // Module under test.

const keyPair = keys_1.generateKeyPairUnsafe();
expect(keyPair.publicKey).toMatch(HEX_32_BYTES_LOWER_NO_PREFIX_RE);
expect(keyPair.privateKey).toMatch(HEX_32_BYTES_LOWER_NO_PREFIX_RE);
expect_1.default(keyPair.publicKey).toMatch(HEX_32_BYTES_LOWER_NO_PREFIX_RE);
expect_1.default(keyPair.privateKey).toMatch(HEX_32_BYTES_LOWER_NO_PREFIX_RE);
});
it('generates different key pairs', () => {
expect(keys_1.generateKeyPairUnsafe()).not.toEqual(keys_1.generateKeyPairUnsafe());
expect_1.default(keys_1.generateKeyPairUnsafe()).not.toEqual(keys_1.generateKeyPairUnsafe());
});

@@ -26,8 +30,8 @@ });

const entropy = util_1.randomBuffer(32);
expect(keys_1.keyPairFromData(entropy)).toEqual(keys_1.keyPairFromData(entropy));
expect_1.default(keys_1.keyPairFromData(entropy)).toEqual(keys_1.keyPairFromData(entropy));
});
it('generates different key pairs from short data', () => {
expect(keys_1.keyPairFromData(Buffer.from([0]))).not.toEqual(keys_1.keyPairFromData(Buffer.from([1])));
expect(keys_1.keyPairFromData(Buffer.from([0]))).not.toEqual(keys_1.keyPairFromData(Buffer.from([2])));
expect(keys_1.keyPairFromData(Buffer.from([0]))).not.toEqual(keys_1.keyPairFromData(Buffer.from([3])));
expect_1.default(keys_1.keyPairFromData(Buffer.from([0]))).not.toEqual(keys_1.keyPairFromData(Buffer.from([1])));
expect_1.default(keys_1.keyPairFromData(Buffer.from([0]))).not.toEqual(keys_1.keyPairFromData(Buffer.from([2])));
expect_1.default(keys_1.keyPairFromData(Buffer.from([0]))).not.toEqual(keys_1.keyPairFromData(Buffer.from([3])));
});

@@ -38,19 +42,19 @@ it('generates different key pairs from long data', () => {

entropy2[31] = (entropy[31] + 1) % 0x100;
expect(keys_1.keyPairFromData(entropy)).toEqual(keys_1.keyPairFromData(entropy));
expect(keys_1.keyPairFromData(entropy)).not.toEqual(keys_1.keyPairFromData(entropy2));
expect_1.default(keys_1.keyPairFromData(entropy)).toEqual(keys_1.keyPairFromData(entropy));
expect_1.default(keys_1.keyPairFromData(entropy)).not.toEqual(keys_1.keyPairFromData(entropy2));
});
it('throws if provided an empty buffer', () => {
expect(() => keys_1.keyPairFromData(Buffer.from([]))).toThrow('Empty buffer');
expect_1.default(() => keys_1.keyPairFromData(Buffer.from([]))).toThrow('Empty buffer');
});
it('generates the expected key pairs', () => {
// Make sure that the mapping from buffer to key pair doesn't change unexpectedly.
expect(keys_1.keyPairFromData(Buffer.from('0'))).toEqual({
expect_1.default(keys_1.keyPairFromData(Buffer.from('0'))).toEqual({
publicKey: '069a33d37101d7089b606f92e4b41553c237a474ad9d6f62eeb6708415f98f4d',
privateKey: '002242959533856f2a03f3c7d9431e28ef4fe5cb2a15038c37f1d76d35dc508b',
});
expect(keys_1.keyPairFromData(Buffer.from('a'))).toEqual({
expect_1.default(keys_1.keyPairFromData(Buffer.from('a'))).toEqual({
publicKey: '01b831960e94e1825a1f88a02906662d84696fed516304bd1523ae8ba354affb',
privateKey: '01d61128b46faa109512e0e00fe9adf5ff52047ed61718eeeb7c0525dfcd2f8e',
});
expect(keys_1.keyPairFromData(Buffer.from('really long input data for key generation with the keyPairFromData() function'))).toEqual({
expect_1.default(keys_1.keyPairFromData(Buffer.from('really long input data for key generation with the keyPairFromData() function'))).toEqual({
publicKey: '0179decc2752db9934392f19d74a13e3068f285caf55e9563c8ee881f022aaa2',

@@ -62,2 +66,2 @@ privateKey: '007c4946831bde597b73f1d5721af9c67731eafeb75c1b8e92ac457a61819a29',

});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5cy50ZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vX190ZXN0c19fL2tleXMudGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7O0dBRUc7O0FBS0gsMENBQStDO0FBRS9DLHFCQUFxQjtBQUNyQixzQ0FHcUI7QUFFckIsTUFBTSwrQkFBK0IsR0FBRyxnQkFBZ0IsQ0FBQztBQUV6RCxRQUFRLENBQUMsMEJBQTBCLEVBQUUsR0FBRyxFQUFFO0lBRXhDLFFBQVEsQ0FBQyxtQkFBbUIsRUFBRSxHQUFHLEVBQUU7UUFFakMsRUFBRSxDQUFDLHNCQUFzQixFQUFFLEdBQUcsRUFBRTtZQUM5QixNQUFNLE9BQU8sR0FBWSw0QkFBcUIsRUFBRSxDQUFDO1lBQ2pELE1BQU0sQ0FBQyxPQUFPLENBQUMsU0FBUyxDQUFDLENBQUMsT0FBTyxDQUFDLCtCQUErQixDQUFDLENBQUM7WUFDbkUsTUFBTSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQyxPQUFPLENBQUMsK0JBQStCLENBQUMsQ0FBQztRQUN0RSxDQUFDLENBQUMsQ0FBQztRQUVILEVBQUUsQ0FBQywrQkFBK0IsRUFBRSxHQUFHLEVBQUU7WUFDdkMsTUFBTSxDQUNKLDRCQUFxQixFQUFFLENBQ3hCLENBQUMsR0FBRy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Q0FBQyxDQUFDLENBQUM7QUFDTCxDQUFDLENBQUMsQ0FBQyJ9

@@ -5,3 +5,7 @@ "use strict";

*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const expect_1 = __importDefault(require("expect"));
const types_1 = require("../../src/types");

@@ -28,3 +32,3 @@ const keys_1 = require("../../src/keys");

const signature = signable.sign(mockKeyPair.privateKey);
expect(signature).toBe(mockSignature);
expect_1.default(signature).toBe(mockSignature);
});

@@ -34,3 +38,3 @@ it('verifies a signature', () => {

const isValid = signable.verifySignature(mockSignature, mockKeyPair.publicKey);
expect(isValid).toBe(true);
expect_1.default(isValid).toBe(true);
});

@@ -42,5 +46,5 @@ it('signs and fails verification with the wrong public key', () => {

const isValid = signable.verifySignature(signature, keys_1.generateKeyPairUnsafe().publicKey);
expect(isValid).toBe(false);
expect_1.default(isValid).toBe(false);
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXBpLXJlcXVlc3QudGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL19fdGVzdHNfXy9zaWduYWJsZS9hcGktcmVxdWVzdC50ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7R0FFRzs7QUFFSCwyQ0FJeUI7QUFDekIseUNBQXVEO0FBRXZELHFCQUFxQjtBQUNyQixnRUFBb0U7QUFFcEUsZUFBZTtBQUNmLE1BQU0sV0FBVyxHQUFZO0lBQzNCLFNBQVMsRUFBRSxpRUFBaUU7SUFDNUUsVUFBVSxFQUFFLGlFQUFpRTtDQUM5RSxDQUFDO0FBQ0YsTUFBTSxjQUFjLEdBQXFCO0lBQ3ZDLFlBQVksRUFBRSwwQkFBMEI7SUFDeEMsTUFBTSxFQUFFLGlCQUFTLENBQUMsR0FBRztJQUNyQixXQUFXLEVBQUUsV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FLLENBQUMsQ0FBQztJQUM5QixDQUFDLENBQUMsQ0FBQztBQUNMLENBQUMsQ0FBQyxDQUFDIn0=

@@ -5,3 +5,7 @@ "use strict";

*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const expect_1 = __importDefault(require("expect"));
const keys_1 = require("../../src/keys");

@@ -31,3 +35,3 @@ const util_1 = require("./util");

.verifySignature(mockSignature, mockKeyPair.publicKey);
expect(result).toBe(true);
expect_1.default(result).toBe(true);
});

@@ -41,3 +45,3 @@ it('returns false for an invalid signature', () => {

.verifySignature(badSignature, mockKeyPair.publicKey);
expect(result).toBe(false);
expect_1.default(result).toBe(false);
}

@@ -50,3 +54,3 @@ // Mutate a single character in s.

.verifySignature(badSignature, mockKeyPair.publicKey);
expect(result).toBe(false);
expect_1.default(result).toBe(false);
}

@@ -60,3 +64,3 @@ });

.sign(mockKeyPair.privateKey);
expect(signature).toEqual(mockSignature);
expect_1.default(signature).toEqual(mockSignature);
});

@@ -71,3 +75,3 @@ it('signs an oracle price with asset ID instead of asset name and oracle name', () => {

.sign(mockKeyPair.privateKey);
expect(signature).toEqual(mockSignature);
expect_1.default(signature).toEqual(mockSignature);
});

@@ -82,3 +86,3 @@ it('generates a different signature when the asset ID is different', () => {

.sign(mockKeyPair.privateKey);
expect(signature).not.toEqual(mockSignature);
expect_1.default(signature).not.toEqual(mockSignature);
});

@@ -93,3 +97,3 @@ it('generates a different signature when the timestamp is different', () => {

.sign(mockKeyPair.privateKey);
expect(signature).not.toEqual(mockSignature);
expect_1.default(signature).not.toEqual(mockSignature);
});

@@ -104,8 +108,8 @@ });

// Expect to be valid when verifying with the right public key.
expect(signableOraclePrice.verifySignature(signature, keyPair.publicKey)).toBe(true);
expect_1.default(signableOraclePrice.verifySignature(signature, keyPair.publicKey)).toBe(true);
// Expect to be invalid when verifying with a different public key.
expect(signableOraclePrice.verifySignature(signature, mockKeyPair.publicKey)).toBe(false);
expect_1.default(signableOraclePrice.verifySignature(signature, mockKeyPair.publicKey)).toBe(false);
}
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JhY2xlLXByaWNlLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9fX3Rlc3RzX18vc2lnbmFibGUvb3JhY2xlLXByaWNlLnRlc3QudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IjtBQUFBOztHQUVHOztBQU9ILHlDQUF1RDtBQUN2RCxpQ0FBMkM7QUFFM0MscUJBQXFCO0FBQ3JCLGtFQUFzRTtBQUV0RSxlQUFlO0FBQ2YsTUFBTSxXQUFXLEdBQVk7SUFDM0IsU0FBUyxFQUFFLGlFQUFpRTtJQUM1RSxVQUFVLEVBQUUsaUVBQWlFO0NBQzlFLENBQUM7QUFDRixNQUFNLGVBQWUsR0FBNkI7SUFDaEQsU0FBUyxFQUFFLFFBQVE7SUFDbkIsVUFBVSxFQUFFLE9BQU87SUFDbkIsWUFBWSxFQUFFLDBCQUEwQjtJQUN4QyxLQUFLLEVBQUUseUJBQXlCO0NBQ2pDLENBQUM7QUFDRixNQUFNLGlCQUFpQixHQUFHLDRDQUE0QyxDQUFDO0FBQ3ZFLE1BQU0sYUFBYSxHQUFHLENBQ3BCLGtFQUFrRTtJQUNsRSxrRUFBa0UsQ0FDbkUsQ0FBQztBQUVGLFFBQVEsQ0FBQyxxQkFBcUIsRUFBRSxHQUFHLEVBQUU7SUFFbkMsUUFBUSxDQUFDLG1CQUFtQixFQUFFLEdBQUcsRUFBRTtRQUVqQyxFQUFFLENBQUMsb0NBQW9DLEVBQUUsR0FBRyxFQUFFO1lBQzVDLE1BQU0sTUFBTSxHQUFHLGtDQUFtQjtpQkFDL0IsU0FBUyxDQUFDLGVBQWUsQ0FBQztpQkFDMUIsZUFBZSxDQUFDLGFBQWEsRUFBRSxXQUFXLENBQUMsU0FB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0sT0FBTyxHQUFZLDRCQUFxQixFQUFFLENBQUM7WUFDakQsTUFBTSxtQkFBbUIsR0FBRyxrQ0FBbUIsQ0FBQyxTQUFTLENBQUMsZUFBZSxDQUFDLENBQUM7WUFDM0UsTUFBTSxTQUFTLEdBQUcsbUJBQW1CLENBQUMsSUFBSSxDQUFDLE9BQU8sQ0FBQyxVQUFVLENBQUMsQ0FBQztZQUUvRCwrREFBK0Q7WUFDL0QsZ0JBQU0sQ0FDSixtQkFBbUIsQ0FBQyxlQUFlLENBQUMsU0FBUyxFQUFFLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FDbEUsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7WUFFYixtRUFBbUU7WUFDbkUsZ0JBQU0sQ0FDSixtQkFBbUIsQ0FBQyxlQUFlLENBQUMsU0FBUyxFQUFFLFdBQVcsQ0FBQyxTQUFTLENBQUMsQ0FDdEUsQ0FBQyxJQUFJLENBQUMsS0FBSyxDQUFDLENBQUM7U0FDZjtJQUNILENBQUMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyxDQUFDLENBQUMifQ==

@@ -10,2 +10,3 @@ "use strict";

const big_js_1 = __importDefault(require("big.js"));
const expect_1 = __importDefault(require("expect"));
const types_1 = require("../../src/types");

@@ -46,3 +47,3 @@ const keys_1 = require("../../src/keys");

.verifySignature(mockSignature, mockKeyPair.publicKey);
expect(result).toBe(true);
expect_1.default(result).toBe(true);
});

@@ -53,3 +54,3 @@ it('returns true for a valid signature (even y)', () => {

.verifySignature(mockSignatureEvenY, mockKeyPairEvenY.publicKey);
expect(result).toBe(true);
expect_1.default(result).toBe(true);
});

@@ -63,3 +64,3 @@ it('returns false for an invalid signature', () => {

.verifySignature(badSignature, mockKeyPair.publicKey);
expect(result).toBe(false);
expect_1.default(result).toBe(false);
}

@@ -72,3 +73,3 @@ // Mutate a single character in s.

.verifySignature(badSignature, mockKeyPair.publicKey);
expect(result).toBe(false);
expect_1.default(result).toBe(false);
}

@@ -82,3 +83,3 @@ });

.sign(mockKeyPair.privateKey);
expect(signature).toEqual(mockSignature);
expect_1.default(signature).toEqual(mockSignature);
});

@@ -89,3 +90,3 @@ it('signs an order (even y)', () => {

.sign(mockKeyPairEvenY.privateKey);
expect(signature).toEqual(mockSignatureEvenY);
expect_1.default(signature).toEqual(mockSignatureEvenY);
});

@@ -105,3 +106,3 @@ it('signs an order with quoteAmount instead of price', () => {

.sign(mockKeyPair.privateKey);
expect(signature).toEqual(mockSignature);
expect_1.default(signature).toEqual(mockSignature);
});

@@ -117,3 +118,3 @@ it('signs an order with nonce instead of clientId', () => {

.sign(mockKeyPair.privateKey);
expect(signature).toEqual(mockSignature);
expect_1.default(signature).toEqual(mockSignature);
});

@@ -128,3 +129,3 @@ it('generates a different signature when the client ID is different', () => {

.sign(mockKeyPair.privateKey);
expect(signature).not.toEqual(mockSignature);
expect_1.default(signature).not.toEqual(mockSignature);
});

@@ -139,3 +140,3 @@ it('generates a different signature for a SELL order', () => {

.sign(mockKeyPair.privateKey);
expect(signature).not.toEqual(mockSignature);
expect_1.default(signature).not.toEqual(mockSignature);
});

@@ -150,3 +151,3 @@ it('generates a different signature when the position ID is different', () => {

.sign(mockKeyPair.privateKey);
expect(signature).not.toEqual(mockSignature);
expect_1.default(signature).not.toEqual(mockSignature);
});

@@ -159,5 +160,5 @@ });

.toStarkware();
expect(starkwareOrder.quantumsAmountSynthetic).toEqual('14500050000');
expect(starkwareOrder.quantumsAmountCollateral).toEqual('50750272151');
expect(starkwareOrder.quantumsAmountFee).toEqual('32985');
expect_1.default(starkwareOrder.quantumsAmountSynthetic).toEqual('14500050000');
expect_1.default(starkwareOrder.quantumsAmountCollateral).toEqual('50750272151');
expect_1.default(starkwareOrder.quantumsAmountFee).toEqual('32985');
});

@@ -169,3 +170,3 @@ it('throws if the market is unknown', () => {

};
expect(() => order_1.SignableOrder.fromOrder(order).toStarkware()).toThrow('Unknown market');
expect_1.default(() => order_1.SignableOrder.fromOrder(order).toStarkware()).toThrow('Unknown market');
});

@@ -175,3 +176,3 @@ });

// Repeat some number of times.
for (let i = 0; i < 1; i++) {
for (let i = 0; i < 3; i++) {
const keyPair = keys_1.generateKeyPairUnsafe();

@@ -181,8 +182,8 @@ const signableOrder = order_1.SignableOrder.fromOrder(mockOrder);

// Expect to be valid when verifying with the right public key.
expect(signableOrder.verifySignature(signature, keyPair.publicKey)).toBe(true);
expect_1.default(signableOrder.verifySignature(signature, keyPair.publicKey)).toBe(true);
// Expect to be invalid when verifying with a different public key.
expect(signableOrder.verifySignature(signature, mockKeyPair.publicKey)).toBe(false);
expect_1.default(signableOrder.verifySignature(signature, mockKeyPair.publicKey)).toBe(false);
}
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JkZXIudGVzdC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL19fdGVzdHNfXy9zaWduYWJsZS9vcmRlci50ZXN0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7R0FFRzs7Ozs7QUFFSCxvREFBMkM7QUFFM0MsMkNBUXlCO0FBQ3pCLHlDQUF1RDtBQUN2RCwrQ0FBc0Q7QUFDdEQsaUNBQTJDO0FBRTNDLHFCQUFxQjtBQUNyQixvREFBeUQ7QUFFekQsZUFBZTtBQUNmLE1BQU0sV0FBVyxHQUFZO0lBQzNCLFNBQVMsRUFBRSxpRUFBaUU7SUFDNUUsVUFBVSxFQUFFLGlFQUFpRTtDQUM5RSxDQUFDO0FBQ0YsTUFBTSxnQkFBZ0IsR0FBWTtJQUNoQyxTQUFTLEVBQUUsaUVBQWlFO0lBQzVFLFVBQVUsRUFBRSxpRUFBaUU7Q0FDOUUsQ0FBQztBQUNGLE1BQU0sU0FBUyxHQUFzQjtJQUNuQyxVQUFVLEVBQUUsT0FBTztJQUNuQixTQUFTLEVBQUUsVUFBVTtJQUNyQixhQUFhLEVBQUUsVUFBV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xDQUFDO1lBRXpELCtEQUErRDtZQUMvRCxnQkFBTSxDQUNKLGFBQWEsQ0FBQyxlQUFlLENBQUMsU0FBUyxFQUFFLE9BQU8sQ0FBQyxTQUFTLENBQUMsQ0FDNUQsQ0FBQyxJQUFJLENBQUMsSUFBSSxDQUFDLENBQUM7WUFFYixtRUFBbUU7WUFDbkUsZ0JBQU0sQ0FDSixhQUFhLENBQUMsZUFBZSxDQUFDLFNBQVMsRUFBRSxXQUFXLENBQUMsU0FBUyxDQUFDLENBQ2hFLENBQUMsSUFBSSxDQUFDLEtBQUssQ0FBQyxDQUFDO1NBQ2Y7SUFDSCxDQUFDLENBQUMsQ0FBQztBQUNMLENBQUMsQ0FBQyxDQUFDIn0=
/**
* Unit tests for signable/withdrawals.ts.
* Unit tests for signable/withdrawal.ts.
*/
export {};
"use strict";
/**
* Unit tests for signable/withdrawals.ts.
* Unit tests for signable/withdrawal.ts.
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const expect_1 = __importDefault(require("expect"));
const keys_1 = require("../../src/keys");

@@ -30,3 +34,3 @@ const helpers_1 = require("../../src/helpers");

.verifySignature(mockSignature, mockKeyPair.publicKey);
expect(result).toBe(true);
expect_1.default(result).toBe(true);
});

@@ -40,3 +44,3 @@ it('returns false for an invalid signature', () => {

.verifySignature(badSignature, mockKeyPair.publicKey);
expect(result).toBe(false);
expect_1.default(result).toBe(false);
}

@@ -49,3 +53,3 @@ // Mutate a single character in s.

.verifySignature(badSignature, mockKeyPair.publicKey);
expect(result).toBe(false);
expect_1.default(result).toBe(false);
}

@@ -59,3 +63,3 @@ });

.sign(mockKeyPair.privateKey);
expect(signature).toEqual(mockSignature);
expect_1.default(signature).toEqual(mockSignature);
});

@@ -71,3 +75,3 @@ it('signs a withdrawal with nonce instead of clientId', () => {

.sign(mockKeyPair.privateKey);
expect(signature).toEqual(mockSignature);
expect_1.default(signature).toEqual(mockSignature);
});

@@ -82,3 +86,3 @@ it('generates a different signature when the client ID is different', () => {

.sign(mockKeyPair.privateKey);
expect(signature).not.toEqual(mockSignature);
expect_1.default(signature).not.toEqual(mockSignature);
});

@@ -93,3 +97,3 @@ it('generates a different signature when the position ID is different', () => {

.sign(mockKeyPair.privateKey);
expect(signature).not.toEqual(mockSignature);
expect_1.default(signature).not.toEqual(mockSignature);
});

@@ -102,3 +106,3 @@ });

.toStarkware();
expect(starkwareWithdrawal.quantumsAmount).toEqual('49478023');
expect_1.default(starkwareWithdrawal.quantumsAmount).toEqual('49478023');
});

@@ -108,3 +112,3 @@ });

// Repeat some number of times.
for (let i = 0; i < 1; i++) {
for (let i = 0; i < 3; i++) {
const keyPair = keys_1.generateKeyPairUnsafe();

@@ -114,8 +118,8 @@ const signableWithdrawal = withdrawal_1.SignableWithdrawal.fromWithdrawal(mockWithdrawal);

// Expect to be valid when verifying with the right public key.
expect(signableWithdrawal.verifySignature(signature, keyPair.publicKey)).toBe(true);
expect_1.default(signableWithdrawal.verifySignature(signature, keyPair.publicKey)).toBe(true);
// Expect to be invalid when verifying with a different public key.
expect(signableWithdrawal.verifySignature(signature, mockKeyPair.publicKey)).toBe(false);
expect_1.default(signableWithdrawal.verifySignature(signature, mockKeyPair.publicKey)).toBe(false);
}
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2l0aGRyYXdhbC50ZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vX190ZXN0c19fL3NpZ25hYmxlL3dpdGhkcmF3YWwudGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7O0dBRUc7O0FBUUgseUNBQXVEO0FBQ3ZELCtDQUFzRDtBQUN0RCxpQ0FBMkM7QUFFM0MscUJBQXFCO0FBQ3JCLDhEQUFtRTtBQUVuRSxlQUFlO0FBQ2YsTUFBTSxXQUFXLEdBQVk7SUF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0wsQ0FBQyxDQUFDLENBQUMifQ==

@@ -5,3 +5,7 @@ "use strict";

*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const expect_1 = __importDefault(require("expect"));
// Module under test.

@@ -13,12 +17,12 @@ const util_1 = require("../src/lib/util");

it('returns a 64-character hex string without 0x prefix', () => {
expect(util_1.normalizeHex32('0x00').match(HEX_32_BYTES_LOWER_NO_PREFIX_RE)).not.toBeFalsy();
expect_1.default(util_1.normalizeHex32('0x00').match(HEX_32_BYTES_LOWER_NO_PREFIX_RE)).not.toBeFalsy();
});
it('pads a string to 32 bytes', () => {
expect(util_1.normalizeHex32('00')).toEqual(`${'0'.repeat(64)}`);
expect_1.default(util_1.normalizeHex32('00')).toEqual(`${'0'.repeat(64)}`);
});
it('throws if the hex string is longer than 32 bytes', () => {
expect(() => util_1.normalizeHex32(`0x${'0'.repeat(65)}`)).toThrow('Input does not fit in 32 bytes');
expect_1.default(() => util_1.normalizeHex32(`0x${'0'.repeat(65)}`)).toThrow('Input does not fit in 32 bytes');
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC50ZXN0LmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vX190ZXN0c19fL3V0aWwudGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7O0dBRUc7O0FBRUgscUJBQXFCO0FBQ3JCLDBDQUV5QjtBQUV6QixNQUFNLCtCQUErQixHQUFHLGdCQUFnQixDQUFDO0FBRXpELFFBQVEsQ0FBQyxNQUFNLEVBQUUsR0FBRyxFQUFFO0lBRXBCLFFBQVEsQ0FBQyxrQkFBa0IsRUFBRSxHQUFHLEVBQUU7UUFFaEMsRUFBRSxDQUFDLHFEQUFxRCxFQUFFLEdBQUcsRUFBRTtZQUM3RCxNQUFNLENBQUMscUJBQW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UFFO1FBRWhDLEVBQUUsQ0FBQyxxREFBcUQsRUFBRSxHQUFHLEVBQUU7WUFDN0QsZ0JBQU0sQ0FBQyxxQkFBYyxDQUFDLE1BQU0sQ0FBQyxDQUFDLEtBQUssQ0FBQywrQkFBK0IsQ0FBQyxDQUFDLENBQUMsR0FBRyxDQUFDLFNBQVMsRUFBRSxDQUFDO1FBQ3hGLENBQUMsQ0FBQyxDQUFDO1FBRUgsRUFBRSxDQUFDLDJCQUEyQixFQUFFLEdBQUcsRUFBRTtZQUNuQyxnQkFBTSxDQUFDLHFCQUFjLENBQUMsSUFBSSxDQUFDLENBQUMsQ0FBQyxPQUFPLENBQUMsR0FBRyxHQUFHLENBQUMsTUFBTSxDQUFDLEVBQUUsQ0FBQyxFQUFFLENBQUMsQ0FBQztRQUM1RCxDQUFDLENBQUMsQ0FBQztRQUVILEVBQUUsQ0FBQyxrREFBa0QsRUFBRSxHQUFHLEVBQUU7WUFDMUQsZ0JBQU0sQ0FDSixHQUFHLEVBQUUsQ0FBQyxxQkFBYyxDQUFDLEtBQUssR0FBRyxDQUFDLE1BQU0sQ0FBQyxFQUFFLENBQUMsRUFBRSxDQUFDLENBQzVDLENBQUMsT0FBTyxDQUFDLGdDQUFnQyxDQUFDLENBQUM7UUFDOUMsQ0FBQyxDQUFDLENBQUM7SUFDTCxDQUFDLENBQUMsQ0FBQztBQUNMLENBQUMsQ0FBQyxDQUFDIn0=

@@ -16,2 +16,6 @@ /// <reference types="node" />

/**
* Convert a node Buffer to a BN.
*/
export declare function bufferToBn(buffer: Buffer): BN;
/**
* Convert a hex string with optional 0x prefix to a BN.

@@ -18,0 +22,0 @@ */

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.utf8ToBn = exports.decToBn = exports.hexToBn = exports.randomBuffer = exports.normalizeHex32 = exports.bnToHex32 = void 0;
exports.utf8ToBn = exports.decToBn = exports.hexToBn = exports.bufferToBn = exports.randomBuffer = exports.normalizeHex32 = exports.bnToHex32 = void 0;
const bn_js_1 = __importDefault(require("bn.js"));

@@ -48,2 +48,9 @@ /**

/**
* Convert a node Buffer to a BN.
*/
function bufferToBn(buffer) {
return new bn_js_1.default(buffer.toString('hex'), 16);
}
exports.bufferToBn = bufferToBn;
/**
* Convert a hex string with optional 0x prefix to a BN.

@@ -87,2 +94,2 @@ */

exports.utf8ToBn = utf8ToBn;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidXRpbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9saWIvdXRpbC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7QUFBQSxrREFBdUI7QUFFdkI7O0dBRUc7QUFDSCxNQUFNLE1BQU0sR0FBRyxnQkFBZ0IsQ0FBQztBQUVoQzs7R0FFRztBQUNILE1BQU0sTUFBTSxHQUFHLFVBQVUsQ0FBQztBQUUxQjs7R0FFRztBQUNILFNBQWdCLFNBQVMsQ0FBQyxFQUFNO0lBQzlCLE9BQU8sY0FBYyxDQUFDLEVBQUUsQ0FBQyxRQUFRLENBQUMsRUFBRSxDQUFDLENBQUMsQ0FBQztBQUN6QyxDQUFDO0FBRkQsOEJBRUM7QUFFRDs7R0FFRztBQUNILFNBQWdCLGNBQWMsQ0FBQyxHQUFXO0lBQ3hDLE1BQU0sU0FBUyxHQUFHLEdBQUcsQ0FBQyxPQUFPLENBQUMsS0FBSyxFQUFFLEVBQUUsQ0FBQyxDQUFDLFdBQVcsRUFBRSxDQUFDLFFBQVEsQ0FBQyxFQUFFLEVBQUUsR0FBRyxDQUFDLENBQUM7SUFDekUsSUFBSSxTQUFTLENBQUMsTUFBTSxLQUFLLEVBQUUsRUFBRTtRQUMzQixNQUFNLElBQUksS0FBSyxDQUFDLGdEQUFnRCxDQUFDLENBQUM7S0FDbkU7SUFDRCxPQUFPLFNBQVMsQ0FBQztBQUNuQixDQUFDO0FBT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xRQUFRLENBQUMsS0FBSyxDQUFDLENBQUM7SUFDbkMsTUFBTSxTQUFTLEdBQUcsR0FBRyxDQUFDLE1BQU0sQ0FBQyxPQUFPLEdBQUcsQ0FBQyxFQUFFLEdBQUcsQ0FBQyxDQUFDO0lBQy9DLElBQUksU0FBUyxDQUFDLE1BQU0sS0FBSyxPQUFPLEdBQUcsQ0FBQyxFQUFFO1FBQ3BDLE1BQU0sSUFBSSxLQUFLLENBQUMsMkNBQTJDLE9BQU8sT0FBTyxDQUFDLENBQUM7S0FDNUU7SUFDRCxPQUFPLElBQUksZUFBRSxDQUFDLFNBQVMsRUFBRSxFQUFFLENBQUMsQ0FBQztBQUMvQixDQUFDO0FBZEQsNEJBY0MifQ==

@@ -17,2 +17,11 @@ export declare const ORDER_FIELD_BIT_LENGTHS: {

};
export declare const CONDITIONAL_TRANSFER_FIELD_BIT_LENGTHS: {
assetId: number;
receiverPublicKey: number;
positionId: number;
nonce: number;
quantumsAmount: number;
expirationEpochSeconds: number;
condition: number;
};
export declare const ORACLE_PRICE_FIELD_BIT_LENGTHS: {

@@ -19,0 +28,0 @@ assetName: number;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ORACLE_PRICE_FIELD_BIT_LENGTHS = exports.WITHDRAWAL_FIELD_BIT_LENGTHS = exports.ORDER_FIELD_BIT_LENGTHS = void 0;
exports.ORACLE_PRICE_FIELD_BIT_LENGTHS = exports.CONDITIONAL_TRANSFER_FIELD_BIT_LENGTHS = exports.WITHDRAWAL_FIELD_BIT_LENGTHS = exports.ORDER_FIELD_BIT_LENGTHS = void 0;
exports.ORDER_FIELD_BIT_LENGTHS = {

@@ -20,2 +20,11 @@ assetIdSynthetic: 128,

};
exports.CONDITIONAL_TRANSFER_FIELD_BIT_LENGTHS = {
assetId: 250,
receiverPublicKey: 251,
positionId: 64,
nonce: 32,
quantumsAmount: 64,
expirationEpochSeconds: 32,
condition: 251,
};
exports.ORACLE_PRICE_FIELD_BIT_LENGTHS = {

@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FDckIsaUJBQWlCLEVBQUUsR0FBRztJQUN0QixVQUFVLEVBQUUsR0FBRztJQUNmLGNBQWMsRUFBRSxFQUFFO0lBQ2xCLEtBQUssRUFBRSxFQUFFO0lBQ1QsVUFBVSxFQUFFLEVBQUU7SUFDZCxzQkFBc0IsRUFBRSxFQUFFO0NBQzNCLENBQUM7QUFFVyxRQUFBLDRCQUE0QixHQUFHO0lBQzFDLE9BQU8sRUFBRSxHQUFHO0lBQ1osVUFBVSxFQUFFLEVBQUU7SUFDZCxLQUFLLEVBQUUsRUFBRTtJQUNULGNBQWMsRUFBRSxFQUFFO0lBQ2xCLHNCQUFzQixFQUFFLEVBQUU7Q0FDM0IsQ0FBQztBQUVXLFFBQUEsc0NBQXNDLEdBQUc7SUFDcEQsT0FBTyxFQUFFLEdBQUc7SUFDWixpQkFBaUIsRUFBRSxHQUFHO0lBQ3RCLFVBQVUsRUFBRSxFQUFFO0lBQ2QsS0FBSyxFQUFFLEVBQUU7SUFDVCxjQUFjLEVBQUUsRUFBRTtJQUNsQixzQkFBc0IsRUFBRSxFQUFFO0lBQzFCLFNBQVMsRUFBRSxHQUFHO0NBQ2YsQ0FBQztBQUVXLFFBQUEsOEJBQThCLEdBQUc7SUFDNUMsU0FBUyxFQUFFLEdBQUc7SUFDZCxVQUFVLEVBQUUsRUFBRTtJQUNkLEtBQUssRUFBRSxHQUFHO0lBQ1YscUJBQXFCLEVBQUUsRUFBRTtDQUMxQixDQUFDIn0=

@@ -50,12 +50,12 @@ "use strict";

if (positionIdBn.bitLength() > constants_2.WITHDRAWAL_FIELD_BIT_LENGTHS.positionId) {
throw new Error('SignableOraclePrice: price exceeds max value');
throw new Error('SignableOraclePrice: positionId exceeds max value');
}
if (nonceBn.bitLength() > constants_2.WITHDRAWAL_FIELD_BIT_LENGTHS.nonce) {
throw new Error('SignableOraclePrice: price exceeds max value');
throw new Error('SignableOraclePrice: nonce exceeds max value');
}
if (quantumsAmountBn.bitLength() > constants_2.WITHDRAWAL_FIELD_BIT_LENGTHS.quantumsAmount) {
throw new Error('SignableOraclePrice: price exceeds max value');
throw new Error('SignableOraclePrice: quantumsAmount exceeds max value');
}
if (expirationEpochSecondsBn.bitLength() > constants_2.WITHDRAWAL_FIELD_BIT_LENGTHS.expirationEpochSeconds) {
throw new Error('SignableOraclePrice: price exceeds max value');
throw new Error('SignableOraclePrice: expirationEpochSeconds exceeds max value');
}

@@ -76,2 +76,2 @@ const packedWithdrawalBn = new bn_js_1.default(WITHDRAWAL_PREFIX)

SignableWithdrawal.fromWithdrawal = SignableWithdrawal.fromWithdrawalWithClientId; // Alias.
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoid2l0aGRyYXdhbC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uLy4uLy4uL3NyYy9zaWduYWJsZS93aXRoZHJhd2FsLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7Ozs7OztBQUFBLGtEQUF1QjtBQUV2Qiw0Q0FHc0I7QUFDdEIsd0NBSW9CO0FBQ3BCLGdFQUFvRDtBQUNwRCxzQ0FBK0M7QUFNL0MsMkNBQTJEO0FBQzNELHFEQUFpRDtBQUVqRCxNQUFNLHNCQUFzQixHQUFHLGNBQU8sQ0FBQywrQkFBbUIsQ0FBQyxDQUFDO0FBQzVELE1BQU0saUJBQWlCLEdBQUcsQ0FBQyxDQUFDO0FBQzVCLE1BQU0sdUJBQXVCLEdBQUcsRUFBRSxDQUFDO0FBRW5DOztHQUVHO0FBQ0gsTUFBYSxrQkFBbUIsU0FBUSw4QkFBa0M7SUFJeEUsTUFBTSxDQUFDLDBCQUEwQixDQUMvQixVQUFrQztRQUVsQyxvREFBb0Q7UUFDcEQsTUFBTSxLQUFLLEdBQUcsMkJBQWlCLENBQUMsVUFBVSxDQUFDLFFBQVEsQ0FBQyxDQUFDO1FBQ3JELE9BQU8sa0JBQWtCLENBQUMsdUJBQXVCLENBQUM7WUFDaEQ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DER_WITH_FEES = "LIMIT_ORDER_WITH_FEES"

}
export interface ConditionalTransferParams {
senderPositionId: string;
receiverPositionId: string;
receiverPublicKey: string;
condition: Buffer;
humanAmount: string;
clientId: string;
expirationIsoTimestamp: string;
}
export interface StarkwareConditionalTransfer {
senderPositionId: string;
receiverPositionId: string;
receiverPublicKey: string;
condition: Buffer;
quantumsAmount: string;
nonce: string;
expirationEpochSeconds: string;
}
interface OrderParamsBase {

@@ -50,0 +69,0 @@ positionId: string;

@@ -35,2 +35,2 @@ "use strict";

})(ApiMethod = exports.ApiMethod || (exports.ApiMethod = {}));
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvdHlwZXMudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsSUFBWSxrQkFFWDtBQUZELFdBQVksa0JBQWtCO0lBQzVCLHFFQUErQyxDQUFBO0FBQ2pELENBQUMsRUFGVyxrQkFBa0IsR0FBbEIsMEJBQWtCLEtBQWxCLDBCQUFrQixRQUU3QjtBQUVELElBQVksa0JBR1g7QUFIRCxXQUFZLGtCQUFrQjtJQUM1QixpQ0FBVyxDQUFBO0lBQ1gsbUNBQWEsQ0FBQTtBQUNmLENBQUMsRUFIVyxrQkFBa0IsR0FBbEIsMEJBQWtCLEtBQWxCLDBCQUFrQixRQUc3QjtBQUVELHVDQUF1QztBQUN2QyxJQUFZLFVBSVg7QUFKRCxXQUFZLFVBQVU7SUFDcEIsaUNBQW1CLENBQUE7SUFDbkIsaUNBQW1CLENBQUE7SUFDbkIsbUNBQXFCLENBQUE7QUFDdkIsQ0FBQyxFQUpXLFVBQVUsR0FBVixrQkFBVSxLQUFWLGtCQUFVLFFBSXJCO0FBRUQsSUFBWSxTQUtYO0FBTEQsV0FBWSxTQUFTO0lBQ25CLDBCQUFhLENBQUE7SUFDYix3QkFBVyxDQU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QkFBVyxDQUFBO0lBQ1gsd0JBQVcsQ0FBQTtJQUNYLDBCQUFhLENBQUE7QUFDZixDQUFDLEVBTFcsU0FBUyxHQUFULGlCQUFTLEtBQVQsaUJBQVMsUUFLcEI7QUF3R0QsbURBQW1EO0FBRW5ELElBQVksU0FLWDtBQUxELFdBQVksU0FBUztJQUNuQiwwQkFBYSxDQUFBO0lBQ2Isd0JBQVcsQ0FBQTtJQUNYLHdCQUFXLENBQUE7SUFDWCw4QkFBaUIsQ0FBQTtBQUNuQixDQUFDLEVBTFcsU0FBUyxHQUFULGlCQUFTLEtBQVQsaUJBQVMsUUFLcEIifQ==
{
"name": "@dydxprotocol/starkex-lib",
"version": "0.6.0",
"version": "0.6.1",
"description": "Cryptographic functions for use with StarkEx",

@@ -10,3 +10,3 @@ "main": "build/src/index.js",

"compile": "tsc",
"coverage": "npm run test -- --coverage",
"coverage": "NODE_ENV=test nyc --reporter=lcovonly mocha build/__tests__/**/*.test.js",
"fix": "npm run lint -- --fix",

@@ -16,3 +16,3 @@ "lint": "eslint --ext .ts,.js .",

"test:watch": "npm test -- --watch",
"test": "NODE_ENV=test jest"
"test": "NODE_ENV=test mocha build/__tests__/**/*.test.js"
},

@@ -38,4 +38,7 @@ "repository": {

"devDependencies": {
"@dydxprotocol/node-service-base-dev": "0.0.11"
"@dydxprotocol/node-service-base-dev": "0.0.11",
"expect": "^26.6.2",
"mocha": "^8.2.1",
"nyc": "^15.1.0"
}
}

@@ -45,2 +45,9 @@ import BN from 'bn.js';

/**
* Convert a node Buffer to a BN.
*/
export function bufferToBn(buffer: Buffer): BN {
return new BN(buffer.toString('hex'), 16);
}
/**
* Convert a hex string with optional 0x prefix to a BN.

@@ -47,0 +54,0 @@ */

@@ -19,2 +19,12 @@ export const ORDER_FIELD_BIT_LENGTHS = {

export const CONDITIONAL_TRANSFER_FIELD_BIT_LENGTHS = {
assetId: 250,
receiverPublicKey: 251,
positionId: 64,
nonce: 32,
quantumsAmount: 64,
expirationEpochSeconds: 32,
condition: 251,
};
export const ORACLE_PRICE_FIELD_BIT_LENGTHS = {

@@ -21,0 +31,0 @@ assetName: 128,

@@ -72,9 +72,9 @@ import BN from 'bn.js';

if (positionIdBn.bitLength() > WITHDRAWAL_FIELD_BIT_LENGTHS.positionId) {
throw new Error('SignableOraclePrice: price exceeds max value');
throw new Error('SignableOraclePrice: positionId exceeds max value');
}
if (nonceBn.bitLength() > WITHDRAWAL_FIELD_BIT_LENGTHS.nonce) {
throw new Error('SignableOraclePrice: price exceeds max value');
throw new Error('SignableOraclePrice: nonce exceeds max value');
}
if (quantumsAmountBn.bitLength() > WITHDRAWAL_FIELD_BIT_LENGTHS.quantumsAmount) {
throw new Error('SignableOraclePrice: price exceeds max value');
throw new Error('SignableOraclePrice: quantumsAmount exceeds max value');
}

@@ -84,3 +84,3 @@ if (

) {
throw new Error('SignableOraclePrice: price exceeds max value');
throw new Error('SignableOraclePrice: expirationEpochSeconds exceeds max value');
}

@@ -87,0 +87,0 @@

@@ -61,2 +61,24 @@ export enum StarkwareOrderType {

// ============ Conditional Transfer Parameters ============
export interface ConditionalTransferParams {
senderPositionId: string;
receiverPositionId: string;
receiverPublicKey: string;
condition: Buffer;
humanAmount: string;
clientId: string;
expirationIsoTimestamp: string;
}
export interface StarkwareConditionalTransfer {
senderPositionId: string;
receiverPositionId: string;
receiverPublicKey: string;
condition: Buffer;
quantumsAmount: string;
nonce: string; // For signature. A base-10 integer.
expirationEpochSeconds: string;
}
// ============ Order Parameters ============

@@ -63,0 +85,0 @@

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