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.3 to 0.7.0

13

__tests__/helpers/assets.test.ts

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

getStarkwareAmounts,
getStarkwareLimitFeeAmount,
toQuantumsExact,

@@ -147,2 +148,14 @@ toQuantumsRoundDown,

});
describe('getStarkwareLimitFeeAmount()', () => {
it('converts the order limit fee as expected (edge case)', () => {
expect(
getStarkwareLimitFeeAmount(
'0.000001999999999999999999999999999999999999999999',
'50750272151',
),
).toBe('50751');
});
});
});

12

__tests__/signable/order.test.ts

@@ -36,3 +36,3 @@ /**

humanSize: '145.0005',
humanLimitFee: '0.032985',
limitFee: '0.125',
market: DydxMarket.ETH_USD,

@@ -45,8 +45,8 @@ side: StarkwareOrderSide.BUY,

const mockSignature = (
'01ac25fb542c7f58953cbbaec0bd774e480d6e22d7c7145f531986c32ce28e09' +
'0038738abd1a7a960a45376c926fc7e41889d0f365c8749a80306e355dcf78ec'
'059487ea7c537f34516f4dc7c54ad30ab0096823269ba18aea0e64e13fb03462' +
'03be73ed4dafbf99baeeaee6dce315cd834b5e3257d4e74371d14cf8f2189a59'
);
const mockSignatureEvenY = (
'05de75d37686126262e31560aca7e3e3782210d1ed5395b8c8704b1a51831a7a' +
'01427d9b50773cd537e357c969aeb8dc24e23365418b641a11b5902d1140b8de'
'030644ef5b2de9e93f13df5a4cf8284e7256223366b5da29bf2002ed40825171' +
'03961ec47c34c49e97095c546895cc22afa6e563474615729720fd8b768c5b87'
);

@@ -179,3 +179,3 @@

expect(starkwareOrder.quantumsAmountCollateral).toEqual('50750272151');
expect(starkwareOrder.quantumsAmountFee).toEqual('32985');
expect(starkwareOrder.quantumsAmountFee).toEqual('6343784019');
});

@@ -182,0 +182,0 @@

@@ -101,3 +101,8 @@ "use strict";

});
describe('getStarkwareLimitFeeAmount()', () => {
it('converts the order limit fee as expected (edge case)', () => {
expect_1.default(assets_1.getStarkwareLimitFeeAmount('0.000001999999999999999999999999999999999999999999', '50750272151')).toBe('50751');
});
});
});
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXRzLnRlc3QuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9fX3Rlc3RzX18vaGVscGVycy9hc3NldHMudGVzdC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiO0FBQUE7O0dBRUc7Ozs7O0FBRUgsb0RBQTRCO0FBRTVCLG1EQUc2QjtBQUM3QiwyQ0FJeUI7QUFFekIscUJBQXFCO0FBQ3JCLHFEQU1rQztBQUVsQyxRQUFRLENBQUMsZ0JBQWdCLEVBQUUsR0FBRyxFQUFFO0lBRTlCLFFBQVEsQ0FBQyxnQkFBZ0IsRUFBRSxHQUFHLEVBQUU7UUFFOUIsRUFBRSxDQUFDLDBEQUEwRCxFQUFFLEdBQUcsRUFBRTtZQUNsRSxnQkFBTSxDQUNKLHFCQUFZLENBQUMsTUFBTSxFQUFFLGlCQUFTLENBQUMsR0FBRyxDQUFDLENBQ3BDLENBQUMsSUFBSSxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQ3BCLENBQUMsQ0FBQyxDQUFDO1FBRUgsRUFBRSxDQUFDLGdDQUFnQyxFQUFFLEdBQUcsRUFBRTtZQUN4QyxnQkFBTSxDQUFDLEdBQUcsRUFBRTtnQkFDVixxQkFBWSxDQUFDLE1BQU0sRUFBRSxTQUFzQixDQUFDLENBQUM7WUFDL0MsQ0FBQyxDQUFDLENBQUMsT0FBTyxDQUFDLGVBQWUsQ0FBQyxDQUFDO1FBQzlCLENBQUMsQ0FBQyxDQUFDO0lBQ0wsQ0FBQyxDQUFDLENBQUM7SUFFSCxRQUFRLENB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FLENBQUMsbUVBQW1FLEVBQUUsR0FBRyxFQUFFO1lBQzNFLGdCQUFNLENBQ0osMEJBQWlCLENBQUMsWUFBWSxFQUFFLGlCQUFTLENBQUMsSUFBSSxDQUFDLENBQ2hELENBQUMsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFDO1FBQ3RCLENBQUMsQ0FBQyxDQUFDO1FBRUgsRUFBRSxDQUFDLG9FQUFvRSxFQUFFLEdBQUcsRUFBRTtZQUM1RSxnQkFBTSxDQUNKLDBCQUFpQixDQUFDLGFBQWEsRUFBRSxpQkFBUyxDQUFDLElBQUksQ0FBQyxDQUNqRCxDQUFDLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQztRQUN0QixDQUFDLENBQUMsQ0FBQztJQUNMLENBQUMsQ0FBQyxDQUFDO0lBRUgsUUFBUSxDQUFDLDhCQUE4QixFQUFFLEdBQUcsRUFBRTtRQUU1QyxFQUFFLENBQUMsc0RBQXNELEVBQUUsR0FBRyxFQUFFO1lBQzlELGdCQUFNLENBQ0osbUNBQTBCLENBQ3hCLG9EQUFvRCxFQUNwRCxhQUFhLENBQ2QsQ0FDRixDQUFDLElBQUksQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUNsQixDQUFDLENBQUMsQ0FBQztJQUNMLENBQUMsQ0FBQyxDQUFDO0FBQ0wsQ0FBQyxDQUFDLENBQUMifQ==

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

humanSize: '145.0005',
humanLimitFee: '0.032985',
limitFee: '0.125',
market: types_1.DydxMarket.ETH_USD,

@@ -37,6 +37,6 @@ side: types_1.StarkwareOrderSide.BUY,

};
const mockSignature = ('01ac25fb542c7f58953cbbaec0bd774e480d6e22d7c7145f531986c32ce28e09' +
'0038738abd1a7a960a45376c926fc7e41889d0f365c8749a80306e355dcf78ec');
const mockSignatureEvenY = ('05de75d37686126262e31560aca7e3e3782210d1ed5395b8c8704b1a51831a7a' +
'01427d9b50773cd537e357c969aeb8dc24e23365418b641a11b5902d1140b8de');
const mockSignature = ('059487ea7c537f34516f4dc7c54ad30ab0096823269ba18aea0e64e13fb03462' +
'03be73ed4dafbf99baeeaee6dce315cd834b5e3257d4e74371d14cf8f2189a59');
const mockSignatureEvenY = ('030644ef5b2de9e93f13df5a4cf8284e7256223366b5da29bf2002ed40825171' +
'03961ec47c34c49e97095c546895cc22afa6e563474615729720fd8b768c5b87');
describe('SignableOrder', () => {

@@ -152,3 +152,3 @@ describe('verifySignature()', () => {

expect_1.default(starkwareOrder.quantumsAmountCollateral).toEqual('50750272151');
expect_1.default(starkwareOrder.quantumsAmountFee).toEqual('32985');
expect_1.default(starkwareOrder.quantumsAmountFee).toEqual('6343784019');
});

@@ -176,2 +176,2 @@ it('throws if the market is unknown', () => {

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

@@ -9,5 +9,3 @@ import { DydxAsset, DydxMarket } from './types';

* The smallest unit of the asset in the Starkware system, represented in canonical (human) units.
*
* TODO: Update these after hearing back from Starkware.
*/
export declare const ASSET_QUANTUM_SIZE: Record<DydxAsset, string>;

@@ -26,4 +26,2 @@ "use strict";

* The smallest unit of the asset in the Starkware system, represented in canonical (human) units.
*
* TODO: Update these after hearing back from Starkware.
*/

@@ -36,2 +34,2 @@ exports.ASSET_QUANTUM_SIZE = {

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

@@ -41,1 +41,5 @@ /**

} & (WithPrice | WithQuoteAmount)): StarkwareAmounts;
/**
* Convert a limit fee fraction for an order into a collateral quantums amount.
*/
export declare function getStarkwareLimitFeeAmount(limitFee: string, quantumsAmountCollateral: string): string;

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

Object.defineProperty(exports, "__esModule", { value: true });
exports.getStarkwareAmounts = exports.fromQuantums = exports.toQuantumsRoundUp = exports.toQuantumsRoundDown = exports.toQuantumsExact = void 0;
exports.getStarkwareLimitFeeAmount = exports.getStarkwareAmounts = exports.fromQuantums = exports.toQuantumsRoundUp = exports.toQuantumsRoundDown = exports.toQuantumsExact = void 0;
const big_js_1 = __importDefault(require("big.js"));

@@ -103,2 +103,14 @@ const constants_1 = require("../constants");

exports.getStarkwareAmounts = getStarkwareAmounts;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXNzZXRzLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vLi4vLi4vc3JjL2hlbHBlcnMvYXNzZXRzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQTs7R0FFRzs7Ozs7O0FBRUgsb0RBQTJDO0FBRTNDLDRDQU1zQjtBQUN0QixvQ0FPa0I7QUFFbEI7Ozs7R0FJRztBQUNILFN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kFBdUIsR0FBRyxlQUFlLENBQUMsU0FBUyxFQUFFLGNBQWMsQ0FBQyxDQUFDO0lBRTNFLDBFQUEwRTtJQUMxRSxNQUFNLHFCQUFxQixHQUFHLE9BQU8sZ0JBQWdCLEtBQUssUUFBUTtRQUNoRSxDQUFDLENBQUMsZ0JBQWdCO1FBQ2xCLENBQUMsQ0FBQyxJQUFJLGdCQUFHLENBQUMsU0FBUyxDQUFDLENBQUMsS0FBSyxDQUFDLFVBQVcsQ0FBQyxDQUFDLE9BQU8sRUFBRSxDQUFDLENBQUMsMENBQTBDO0lBRS9GLHNEQUFzRDtJQUN0RCw0REFBNEQ7SUFDNUQsSUFBSSxtQkFBbUIsR0FBRyxlQUFlLENBQUM7SUFDMUMsSUFBSSxPQUFPLGdCQUFnQixLQUFLLFFBQVEsRUFBRTtRQUN4QyxtQkFBbUIsR0FBRyxpQkFBaUI7WUFDckMsQ0FBQyxDQUFDLGlCQUFpQjtZQUNuQixDQUFDLENBQUMsbUJBQW1CLENBQUM7S0FDekI7SUFDRCxNQUFNLHdCQUF3QixHQUFHLG1CQUFtQixDQUFDLHFCQUFxQixFQUFFLDRCQUFnQixDQUFDLENBQUM7SUFFOUYsT0FBTztRQUNMLHVCQUF1QjtRQUN2Qix3QkFBd0I7UUFDeEIsZ0JBQWdCO1FBQ2hCLGlCQUFpQixFQUFFLCtCQUFtQjtRQUN0QyxpQkFBaUI7S0FDbEIsQ0FBQztBQUNKLENBQUM7QUE1Q0Qsa0RBNENDIn0=
/**
* Convert a limit fee fraction for an order into a collateral quantums amount.
*/
function getStarkwareLimitFeeAmount(limitFee, quantumsAmountCollateral) {
// Constrain the limit fee to six decimals of precision. The final fee amount must be rounded up.
return new big_js_1.default(limitFee)
.round(6, 0 /* RoundDown */)
.times(quantumsAmountCollateral)
.round(0, 3 /* RoundUp */)
.toFixed(0);
}
exports.getStarkwareLimitFeeAmount = getStarkwareLimitFeeAmount;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9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QUFDSCxTQUFnQiwwQkFBMEIsQ0FDeEMsUUFBZ0IsRUFDaEIsd0JBQWdDO0lBRWhDLGlHQUFpRztJQUNqRyxPQUFPLElBQUksZ0JBQUcsQ0FBQyxRQUFRLENBQUM7U0FDckIsS0FBSyxDQUFDLENBQUMsb0JBQXlCO1NBQ2hDLEtBQUssQ0FBQyx3QkFBd0IsQ0FBQztTQUMvQixLQUFLLENBQUMsQ0FBQyxrQkFBdUI7U0FDOUIsT0FBTyxDQUFDLENBQUMsQ0FBQyxDQUFDO0FBQ2hCLENBQUM7QUFWRCxnRUFVQyJ9

@@ -38,4 +38,4 @@ "use strict";

const { quantumsAmountSynthetic, quantumsAmountCollateral, assetIdSynthetic, assetIdCollateral, isBuyingSynthetic, } = helpers_1.getStarkwareAmounts(order);
// The fee is an amount, not a percentage, and is always denominated in the collateral asset.
const quantumsAmountFee = helpers_1.toQuantumsExact(order.humanLimitFee, constants_1.COLLATERAL_ASSET);
// The limitFee is a fraction, e.g. 0.01 is a 1% fee. It is always paid in the collateral asset.
const quantumsAmountFee = helpers_1.getStarkwareLimitFeeAmount(order.limitFee, quantumsAmountCollateral);
const assetIdFee = constants_1.ASSET_ID_MAP[constants_1.COLLATERAL_ASSET];

@@ -120,2 +120,2 @@ // Convert to a Unix timestamp (in seconds).

SignableOrder.fromOrder = SignableOrder.fromOrderWithClientId; // Alias.
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoib3JkZXIuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvc2lnbmFibGUvb3JkZXIudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7Ozs7O0FBQUEsa0RBQXVCO0FBRXZCLDRDQUdzQjtBQUN0Qix3Q0FLb0I7QUFDcEIsZ0VBQW9EO0FBQ3BELHNDQUErQztBQUMvQyxvQ0FPa0I7QUFDbEIsMkNBRXFCO0FBQ3JCLHFEQUFpRDtBQUV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RUFBRSxVQUFVLENBQUMsQ0FBQztJQUM5RCxDQUFDO0lBRUQsV0FBVztRQUNULE9BQU8sSUFBSSxDQUFDLE9BQU8sQ0FBQztJQUN0QixDQUFDOztBQXpISCxzQ0EwSEM7QUF4SFEsdUJBQVMsR0FBRyxhQUFhLENBQUMscUJBQXFCLENBQUMsQ0FBQyxTQUFTIn0=

@@ -70,3 +70,3 @@ /// <reference types="node" />

humanSize: string;
humanLimitFee: string;
limitFee: string;
market: DydxMarket;

@@ -73,0 +73,0 @@ side: StarkwareOrderSide;

{
"name": "@dydxprotocol/starkex-lib",
"version": "0.6.3",
"version": "0.7.0",
"description": "Cryptographic functions for use with StarkEx",

@@ -5,0 +5,0 @@ "main": "build/src/index.js",

@@ -31,4 +31,2 @@ import {

* The smallest unit of the asset in the Starkware system, represented in canonical (human) units.
*
* TODO: Update these after hearing back from Starkware.
*/

@@ -35,0 +33,0 @@ export const ASSET_QUANTUM_SIZE: Record<DydxAsset, string> = {

@@ -144,1 +144,16 @@ /**

}
/**
* Convert a limit fee fraction for an order into a collateral quantums amount.
*/
export function getStarkwareLimitFeeAmount(
limitFee: string,
quantumsAmountCollateral: string,
): string {
// Constrain the limit fee to six decimals of precision. The final fee amount must be rounded up.
return new Big(limitFee)
.round(6, RoundingMode.RoundDown)
.times(quantumsAmountCollateral)
.round(0, RoundingMode.RoundUp)
.toFixed(0);
}

@@ -11,3 +11,3 @@ import BN from 'bn.js';

nonceFromClientId,
toQuantumsExact,
getStarkwareLimitFeeAmount,
} from '../helpers';

@@ -70,4 +70,4 @@ import { pedersen } from '../lib/starkex-resources';

// The fee is an amount, not a percentage, and is always denominated in the collateral asset.
const quantumsAmountFee = toQuantumsExact(order.humanLimitFee, COLLATERAL_ASSET);
// The limitFee is a fraction, e.g. 0.01 is a 1% fee. It is always paid in the collateral asset.
const quantumsAmountFee = getStarkwareLimitFeeAmount(order.limitFee, quantumsAmountCollateral);
const assetIdFee = ASSET_ID_MAP[COLLATERAL_ASSET];

@@ -74,0 +74,0 @@

@@ -89,3 +89,3 @@ export enum StarkwareOrderType {

humanSize: string;
humanLimitFee: string;
limitFee: string; // Max fee fraction, e.g. 0.01 is a max 1% fee.
market: DydxMarket;

@@ -92,0 +92,0 @@ side: StarkwareOrderSide;

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