@1inch/fusion-sdk 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +28 -0
- package/api/fusion-api.d.ts +13 -0
- package/api/fusion-api.js +36 -0
- package/api/fusion-api.js.map +1 -0
- package/api/index.d.ts +4 -0
- package/api/index.js +8 -0
- package/api/index.js.map +1 -0
- package/api/params.d.ts +1 -0
- package/api/params.js +27 -0
- package/api/params.js.map +1 -0
- package/api/quoter/index.d.ts +5 -0
- package/api/quoter/index.js +9 -0
- package/api/quoter/index.js.map +1 -0
- package/api/quoter/preset.d.ts +15 -0
- package/api/quoter/preset.js +31 -0
- package/api/quoter/preset.js.map +1 -0
- package/api/quoter/quote/index.d.ts +3 -0
- package/api/quoter/quote/index.js +7 -0
- package/api/quoter/quote/index.js.map +1 -0
- package/api/quoter/quote/order-params.d.ts +8 -0
- package/api/quoter/quote/order-params.js +22 -0
- package/api/quoter/quote/order-params.js.map +1 -0
- package/api/quoter/quote/quote.d.ts +23 -0
- package/api/quoter/quote/quote.js +78 -0
- package/api/quoter/quote/quote.js.map +1 -0
- package/api/quoter/quote/types.d.ts +5 -0
- package/api/quoter/quote/types.js +3 -0
- package/api/quoter/quote/types.js.map +1 -0
- package/api/quoter/quoter.api.d.ts +11 -0
- package/api/quoter/quoter.api.js +30 -0
- package/api/quoter/quoter.api.js.map +1 -0
- package/api/quoter/quoter.api.spec.d.ts +1 -0
- package/api/quoter/quoter.api.spec.js +102 -0
- package/api/quoter/quoter.api.spec.js.map +1 -0
- package/api/quoter/quoter.request.d.ts +13 -0
- package/api/quoter/quoter.request.js +56 -0
- package/api/quoter/quoter.request.js.map +1 -0
- package/api/quoter/types.d.ts +54 -0
- package/api/quoter/types.js +10 -0
- package/api/quoter/types.js.map +1 -0
- package/api/relayer/index.d.ts +3 -0
- package/api/relayer/index.js +7 -0
- package/api/relayer/index.js.map +1 -0
- package/api/relayer/relayer.api.d.ts +11 -0
- package/api/relayer/relayer.api.js +23 -0
- package/api/relayer/relayer.api.js.map +1 -0
- package/api/relayer/relayer.api.spec.d.ts +1 -0
- package/api/relayer/relayer.api.spec.js +85 -0
- package/api/relayer/relayer.api.spec.js.map +1 -0
- package/api/relayer/relayer.request.d.ts +10 -0
- package/api/relayer/relayer.request.js +22 -0
- package/api/relayer/relayer.request.js.map +1 -0
- package/api/relayer/types.d.ts +11 -0
- package/api/relayer/types.js +3 -0
- package/api/relayer/types.js.map +1 -0
- package/api/types.d.ts +7 -0
- package/api/types.js +3 -0
- package/api/types.js.map +1 -0
- package/auction-calculator/auction-calculator.d.ts +19 -0
- package/auction-calculator/auction-calculator.js +71 -0
- package/auction-calculator/auction-calculator.js.map +1 -0
- package/auction-calculator/auction-calculator.spec.d.ts +1 -0
- package/auction-calculator/auction-calculator.spec.js +24 -0
- package/auction-calculator/auction-calculator.spec.js.map +1 -0
- package/auction-calculator/calc.d.ts +10 -0
- package/auction-calculator/calc.js +22 -0
- package/auction-calculator/calc.js.map +1 -0
- package/auction-calculator/constants.d.ts +1 -0
- package/auction-calculator/constants.js +5 -0
- package/auction-calculator/constants.js.map +1 -0
- package/auction-calculator/index.d.ts +3 -0
- package/auction-calculator/index.js +7 -0
- package/auction-calculator/index.js.map +1 -0
- package/auction-salt/auction-salt.d.ts +11 -0
- package/auction-salt/auction-salt.js +40 -0
- package/auction-salt/auction-salt.js.map +1 -0
- package/auction-salt/auction.salt.spec.d.ts +1 -0
- package/auction-salt/auction.salt.spec.js +59 -0
- package/auction-salt/auction.salt.spec.js.map +1 -0
- package/auction-salt/index.d.ts +3 -0
- package/auction-salt/index.js +7 -0
- package/auction-salt/index.js.map +1 -0
- package/auction-salt/parser/constants.d.ts +10 -0
- package/auction-salt/parser/constants.js +14 -0
- package/auction-salt/parser/constants.js.map +1 -0
- package/auction-salt/parser/index.d.ts +2 -0
- package/auction-salt/parser/index.js +6 -0
- package/auction-salt/parser/index.js.map +1 -0
- package/auction-salt/parser/parser.d.ts +6 -0
- package/auction-salt/parser/parser.js +34 -0
- package/auction-salt/parser/parser.js.map +1 -0
- package/auction-salt/types.d.ts +7 -0
- package/auction-salt/types.js +3 -0
- package/auction-salt/types.js.map +1 -0
- package/auction-suffix/auction-suffix.d.ts +11 -0
- package/auction-suffix/auction-suffix.js +38 -0
- package/auction-suffix/auction-suffix.js.map +1 -0
- package/auction-suffix/auction-suffix.spec.d.ts +1 -0
- package/auction-suffix/auction-suffix.spec.js +46 -0
- package/auction-suffix/auction-suffix.spec.js.map +1 -0
- package/auction-suffix/constants.d.ts +1 -0
- package/auction-suffix/constants.js +5 -0
- package/auction-suffix/constants.js.map +1 -0
- package/auction-suffix/encoder.d.ts +6 -0
- package/auction-suffix/encoder.js +45 -0
- package/auction-suffix/encoder.js.map +1 -0
- package/auction-suffix/index.d.ts +5 -0
- package/auction-suffix/index.js +9 -0
- package/auction-suffix/index.js.map +1 -0
- package/auction-suffix/parser/constants.d.ts +13 -0
- package/auction-suffix/parser/constants.js +17 -0
- package/auction-suffix/parser/constants.js.map +1 -0
- package/auction-suffix/parser/errors.d.ts +2 -0
- package/auction-suffix/parser/errors.js +7 -0
- package/auction-suffix/parser/errors.js.map +1 -0
- package/auction-suffix/parser/index.d.ts +4 -0
- package/auction-suffix/parser/index.js +8 -0
- package/auction-suffix/parser/index.js.map +1 -0
- package/auction-suffix/parser/parser.d.ts +17 -0
- package/auction-suffix/parser/parser.js +170 -0
- package/auction-suffix/parser/parser.js.map +1 -0
- package/auction-suffix/parser/types.d.ts +29 -0
- package/auction-suffix/parser/types.js +3 -0
- package/auction-suffix/parser/types.js.map +1 -0
- package/auction-suffix/types.d.ts +15 -0
- package/auction-suffix/types.js +3 -0
- package/auction-suffix/types.js.map +1 -0
- package/connector/blockchain/blockchain-provider.connector.d.ts +5 -0
- package/connector/blockchain/blockchain-provider.connector.js +3 -0
- package/connector/blockchain/blockchain-provider.connector.js.map +1 -0
- package/connector/blockchain/index.d.ts +3 -0
- package/connector/blockchain/index.js +7 -0
- package/connector/blockchain/index.js.map +1 -0
- package/connector/blockchain/private-key-provider.connector.d.ts +11 -0
- package/connector/blockchain/private-key-provider.connector.js +29 -0
- package/connector/blockchain/private-key-provider.connector.js.map +1 -0
- package/connector/blockchain/private-key-provider.connector.spec.d.ts +1 -0
- package/connector/blockchain/private-key-provider.connector.spec.js +48 -0
- package/connector/blockchain/private-key-provider.connector.spec.js.map +1 -0
- package/connector/blockchain/web3-provider-connector.d.ts +9 -0
- package/connector/blockchain/web3-provider-connector.js +28 -0
- package/connector/blockchain/web3-provider-connector.js.map +1 -0
- package/connector/blockchain/web3-provider.connector.spec.d.ts +1 -0
- package/connector/blockchain/web3-provider.connector.spec.js +51 -0
- package/connector/blockchain/web3-provider.connector.spec.js.map +1 -0
- package/connector/http/axios-provider.connector.d.ts +5 -0
- package/connector/http/axios-provider.connector.js +21 -0
- package/connector/http/axios-provider.connector.js.map +1 -0
- package/connector/http/axios-provider.connector.spec.d.ts +1 -0
- package/connector/http/axios-provider.connector.spec.js +33 -0
- package/connector/http/axios-provider.connector.spec.js.map +1 -0
- package/connector/http/http-provider.connector.d.ts +4 -0
- package/connector/http/http-provider.connector.js +3 -0
- package/connector/http/http-provider.connector.js.map +1 -0
- package/connector/http/index.d.ts +2 -0
- package/connector/http/index.js +6 -0
- package/connector/http/index.js.map +1 -0
- package/connector/index.d.ts +2 -0
- package/connector/index.js +6 -0
- package/connector/index.js.map +1 -0
- package/constants.d.ts +10 -0
- package/constants.js +23 -0
- package/constants.js.map +1 -0
- package/fusion-order/fusion-order.d.ts +9 -0
- package/fusion-order/fusion-order.js +18 -0
- package/fusion-order/fusion-order.js.map +1 -0
- package/fusion-order/fusion-order.spec.d.ts +1 -0
- package/fusion-order/fusion-order.spec.js +52 -0
- package/fusion-order/fusion-order.spec.js.map +1 -0
- package/fusion-order/index.d.ts +1 -0
- package/fusion-order/index.js +5 -0
- package/fusion-order/index.js.map +1 -0
- package/index.d.ts +10 -0
- package/index.js +14 -0
- package/index.js.map +1 -0
- package/limit-order/eip712/domain.d.ts +11 -0
- package/limit-order/eip712/domain.js +25 -0
- package/limit-order/eip712/domain.js.map +1 -0
- package/limit-order/eip712/eip712.types.d.ts +24 -0
- package/limit-order/eip712/eip712.types.js +3 -0
- package/limit-order/eip712/eip712.types.js.map +1 -0
- package/limit-order/eip712/index.d.ts +3 -0
- package/limit-order/eip712/index.js +7 -0
- package/limit-order/eip712/index.js.map +1 -0
- package/limit-order/eip712/order-typed-data-builder.d.ts +6 -0
- package/limit-order/eip712/order-typed-data-builder.js +36 -0
- package/limit-order/eip712/order-typed-data-builder.js.map +1 -0
- package/limit-order/index.d.ts +4 -0
- package/limit-order/index.js +8 -0
- package/limit-order/index.js.map +1 -0
- package/limit-order/interactions-factory.d.ts +3 -0
- package/limit-order/interactions-factory.js +10 -0
- package/limit-order/interactions-factory.js.map +1 -0
- package/limit-order/limit-order.d.ts +27 -0
- package/limit-order/limit-order.js +89 -0
- package/limit-order/limit-order.js.map +1 -0
- package/limit-order/limit-order.spec.d.ts +1 -0
- package/limit-order/limit-order.spec.js +196 -0
- package/limit-order/limit-order.spec.js.map +1 -0
- package/limit-order/parser/constants.d.ts +10 -0
- package/limit-order/parser/constants.js +14 -0
- package/limit-order/parser/constants.js.map +1 -0
- package/limit-order/parser/index.d.ts +3 -0
- package/limit-order/parser/index.js +7 -0
- package/limit-order/parser/index.js.map +1 -0
- package/limit-order/parser/parser.d.ts +2 -0
- package/limit-order/parser/parser.js +29 -0
- package/limit-order/parser/parser.js.map +1 -0
- package/limit-order/parser/types.d.ts +3 -0
- package/limit-order/parser/types.js +3 -0
- package/limit-order/parser/types.js.map +1 -0
- package/limit-order/predicate-factory.d.ts +25 -0
- package/limit-order/predicate-factory.js +60 -0
- package/limit-order/predicate-factory.js.map +1 -0
- package/limit-order/predicate-factory.spec.d.ts +1 -0
- package/limit-order/predicate-factory.spec.js +35 -0
- package/limit-order/predicate-factory.spec.js.map +1 -0
- package/limit-order/types.d.ts +32 -0
- package/limit-order/types.js +3 -0
- package/limit-order/types.js.map +1 -0
- package/limit-order/utils.d.ts +1 -0
- package/limit-order/utils.js +8 -0
- package/limit-order/utils.js.map +1 -0
- package/package.json +80 -0
- package/sdk/index.d.ts +2 -0
- package/sdk/index.js +6 -0
- package/sdk/index.js.map +1 -0
- package/sdk/sdk.d.ts +9 -0
- package/sdk/sdk.js +70 -0
- package/sdk/sdk.js.map +1 -0
- package/sdk/types.d.ts +31 -0
- package/sdk/types.js +3 -0
- package/sdk/types.js.map +1 -0
- package/utils.d.ts +6 -0
- package/utils.js +41 -0
- package/utils.js.map +1 -0
- package/validations.d.ts +2 -0
- package/validations.js +21 -0
- package/validations.js.map +1 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const EIP712Domain: {
|
|
2
|
+
name: string;
|
|
3
|
+
type: string;
|
|
4
|
+
}[];
|
|
5
|
+
export declare const Order: {
|
|
6
|
+
name: string;
|
|
7
|
+
type: string;
|
|
8
|
+
}[];
|
|
9
|
+
export declare const LimitOrderV3TypeDataName = "1inch Aggregation Router";
|
|
10
|
+
export declare const LimitOrderV3TypeDataVersion = "5";
|
|
11
|
+
export declare const VerifyingContract = "0x1111111254eeb25477b68fb85ed929f73a960582";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.VerifyingContract = exports.LimitOrderV3TypeDataVersion = exports.LimitOrderV3TypeDataName = exports.Order = exports.EIP712Domain = void 0;
|
|
4
|
+
exports.EIP712Domain = [
|
|
5
|
+
{ name: 'name', type: 'string' },
|
|
6
|
+
{ name: 'version', type: 'string' },
|
|
7
|
+
{ name: 'chainId', type: 'uint256' },
|
|
8
|
+
{ name: 'verifyingContract', type: 'address' }
|
|
9
|
+
];
|
|
10
|
+
exports.Order = [
|
|
11
|
+
{ name: 'salt', type: 'uint256' },
|
|
12
|
+
{ name: 'makerAsset', type: 'address' },
|
|
13
|
+
{ name: 'takerAsset', type: 'address' },
|
|
14
|
+
{ name: 'maker', type: 'address' },
|
|
15
|
+
{ name: 'receiver', type: 'address' },
|
|
16
|
+
{ name: 'allowedSender', type: 'address' },
|
|
17
|
+
{ name: 'makingAmount', type: 'uint256' },
|
|
18
|
+
{ name: 'takingAmount', type: 'uint256' },
|
|
19
|
+
{ name: 'offsets', type: 'uint256' },
|
|
20
|
+
{ name: 'interactions', type: 'bytes' }
|
|
21
|
+
];
|
|
22
|
+
exports.LimitOrderV3TypeDataName = '1inch Aggregation Router';
|
|
23
|
+
exports.LimitOrderV3TypeDataVersion = '5';
|
|
24
|
+
exports.VerifyingContract = '0x1111111254eeb25477b68fb85ed929f73a960582';
|
|
25
|
+
//# sourceMappingURL=domain.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"domain.js","sourceRoot":"","sources":["../../../src/limit-order/eip712/domain.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IACxB,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAC;IAC9B,EAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAC;IACjC,EAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;IAClC,EAAC,IAAI,EAAE,mBAAmB,EAAE,IAAI,EAAE,SAAS,EAAC;CAC/C,CAAA;AAEY,QAAA,KAAK,GAAG;IACjB,EAAC,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,SAAS,EAAC;IAC/B,EAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAC;IACrC,EAAC,IAAI,EAAE,YAAY,EAAE,IAAI,EAAE,SAAS,EAAC;IACrC,EAAC,IAAI,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAC;IAChC,EAAC,IAAI,EAAE,UAAU,EAAE,IAAI,EAAE,SAAS,EAAC;IACnC,EAAC,IAAI,EAAE,eAAe,EAAE,IAAI,EAAE,SAAS,EAAC;IACxC,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAC;IACvC,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,SAAS,EAAC;IACvC,EAAC,IAAI,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAC;IAClC,EAAC,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE,OAAO,EAAC;CACxC,CAAA;AAEY,QAAA,wBAAwB,GAAG,0BAA0B,CAAA;AACrD,QAAA,2BAA2B,GAAG,GAAG,CAAA;AACjC,QAAA,iBAAiB,GAAG,4CAA4C,CAAA"}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
|
+
export interface EIP712TypedData {
|
|
3
|
+
types: EIP712Types;
|
|
4
|
+
domain: EIP712Object;
|
|
5
|
+
message: EIP712Object;
|
|
6
|
+
primaryType: string;
|
|
7
|
+
}
|
|
8
|
+
export interface EIP712Types {
|
|
9
|
+
[key: string]: EIP712Parameter[];
|
|
10
|
+
}
|
|
11
|
+
export interface EIP712Parameter {
|
|
12
|
+
name: string;
|
|
13
|
+
type: string;
|
|
14
|
+
}
|
|
15
|
+
export declare type EIP712ObjectValue = BigNumber | string | number | EIP712Object;
|
|
16
|
+
export interface EIP712Object {
|
|
17
|
+
[key: string]: EIP712ObjectValue;
|
|
18
|
+
}
|
|
19
|
+
export declare type EIP712DomainType = {
|
|
20
|
+
name: string;
|
|
21
|
+
version: string;
|
|
22
|
+
chainId: number;
|
|
23
|
+
verifyingContract: string;
|
|
24
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"eip712.types.js","sourceRoot":"","sources":["../../../src/limit-order/eip712/eip712.types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./domain"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./eip712.types"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./order-typed-data-builder"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/limit-order/eip712/index.ts"],"names":[],"mappings":";;;AAAA,mDAAwB;AACxB,yDAA8B;AAC9B,qEAA0C"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import { EIP712DomainType, EIP712TypedData } from './eip712.types';
|
|
2
|
+
import { LimitOrderV3Struct } from '../types';
|
|
3
|
+
export declare function getOrderHash(data: EIP712TypedData): string;
|
|
4
|
+
export declare function buildOrderData(chainId: number, verifyingContract: string, name: string, version: string, order: LimitOrderV3Struct): EIP712TypedData;
|
|
5
|
+
export declare function domainSeparator(name: string, version: string, chainId: number, verifyingContract: string): string;
|
|
6
|
+
export declare function getLimitOrderV3Domain(chainId: number): EIP712DomainType;
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getLimitOrderV3Domain = exports.domainSeparator = exports.buildOrderData = exports.getOrderHash = void 0;
|
|
4
|
+
const eth_sig_util_1 = require("@metamask/eth-sig-util");
|
|
5
|
+
const domain_1 = require("./domain");
|
|
6
|
+
function getOrderHash(data) {
|
|
7
|
+
return ('0x' +
|
|
8
|
+
eth_sig_util_1.TypedDataUtils.eip712Hash(
|
|
9
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
10
|
+
data, eth_sig_util_1.SignTypedDataVersion.V4).toString('hex'));
|
|
11
|
+
}
|
|
12
|
+
exports.getOrderHash = getOrderHash;
|
|
13
|
+
function buildOrderData(chainId, verifyingContract, name, version, order) {
|
|
14
|
+
return {
|
|
15
|
+
primaryType: 'Order',
|
|
16
|
+
types: { EIP712Domain: domain_1.EIP712Domain, Order: domain_1.Order },
|
|
17
|
+
domain: { name, version, chainId, verifyingContract },
|
|
18
|
+
message: order
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
exports.buildOrderData = buildOrderData;
|
|
22
|
+
function domainSeparator(name, version, chainId, verifyingContract) {
|
|
23
|
+
return ('0x' +
|
|
24
|
+
eth_sig_util_1.TypedDataUtils.hashStruct('EIP712Domain', { name, version, chainId, verifyingContract }, { EIP712Domain: domain_1.EIP712Domain }, eth_sig_util_1.SignTypedDataVersion.V4).toString('hex'));
|
|
25
|
+
}
|
|
26
|
+
exports.domainSeparator = domainSeparator;
|
|
27
|
+
function getLimitOrderV3Domain(chainId) {
|
|
28
|
+
return {
|
|
29
|
+
name: domain_1.LimitOrderV3TypeDataName,
|
|
30
|
+
version: domain_1.LimitOrderV3TypeDataVersion,
|
|
31
|
+
chainId,
|
|
32
|
+
verifyingContract: domain_1.VerifyingContract
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
exports.getLimitOrderV3Domain = getLimitOrderV3Domain;
|
|
36
|
+
//# sourceMappingURL=order-typed-data-builder.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"order-typed-data-builder.js","sourceRoot":"","sources":["../../../src/limit-order/eip712/order-typed-data-builder.ts"],"names":[],"mappings":";;;AAAA,yDAA2E;AAC3E,qCAMiB;AAIjB,SAAgB,YAAY,CAAC,IAAqB;IAC9C,OAAO,CACH,IAAI;QACJ,6BAAc,CAAC,UAAU;QACrB,8DAA8D;QAC9D,IAAW,EACX,mCAAoB,CAAC,EAAE,CAC1B,CAAC,QAAQ,CAAC,KAAK,CAAC,CACpB,CAAA;AACL,CAAC;AATD,oCASC;AAED,SAAgB,cAAc,CAC1B,OAAe,EACf,iBAAyB,EACzB,IAAY,EACZ,OAAe,EACf,KAAyB;IAEzB,OAAO;QACH,WAAW,EAAE,OAAO;QACpB,KAAK,EAAE,EAAC,YAAY,EAAZ,qBAAY,EAAE,KAAK,EAAL,cAAK,EAAC;QAC5B,MAAM,EAAE,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAC;QACnD,OAAO,EAAE,KAAK;KACjB,CAAA;AACL,CAAC;AAbD,wCAaC;AAED,SAAgB,eAAe,CAC3B,IAAY,EACZ,OAAe,EACf,OAAe,EACf,iBAAyB;IAEzB,OAAO,CACH,IAAI;QACJ,6BAAc,CAAC,UAAU,CACrB,cAAc,EACd,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAC,EAC3C,EAAC,YAAY,EAAZ,qBAAY,EAAC,EACd,mCAAoB,CAAC,EAAE,CAC1B,CAAC,QAAQ,CAAC,KAAK,CAAC,CACpB,CAAA;AACL,CAAC;AAfD,0CAeC;AAED,SAAgB,qBAAqB,CAAC,OAAe;IACjD,OAAO;QACH,IAAI,EAAE,iCAAwB;QAC9B,OAAO,EAAE,oCAA2B;QACpC,OAAO;QACP,iBAAiB,EAAE,0BAAiB;KACvC,CAAA;AACL,CAAC;AAPD,sDAOC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./eip712/index"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./limit-order"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
7
|
+
tslib_1.__exportStar(require("./parser/index"), exports);
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/limit-order/index.ts"],"names":[],"mappings":";;;AAAA,yDAA8B;AAC9B,wDAA6B;AAC7B,kDAAuB;AACvB,yDAA8B"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.InteractionsFactory = void 0;
|
|
4
|
+
class InteractionsFactory {
|
|
5
|
+
static unwrap(wethUnwrapper, receiverAddress) {
|
|
6
|
+
return wethUnwrapper + receiverAddress.substring(2);
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
exports.InteractionsFactory = InteractionsFactory;
|
|
10
|
+
//# sourceMappingURL=interactions-factory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"interactions-factory.js","sourceRoot":"","sources":["../../src/limit-order/interactions-factory.ts"],"names":[],"mappings":";;;AAAA,MAAa,mBAAmB;IAC5B,MAAM,CAAC,MAAM,CAAC,aAAqB,EAAE,eAAuB;QACxD,OAAO,aAAa,GAAG,eAAe,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;IACvD,CAAC;CACJ;AAJD,kDAIC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { EIP712TypedData } from './eip712';
|
|
2
|
+
import { InteractionsData, LimitOrderV3Struct, OrderInfoData } from './types';
|
|
3
|
+
export declare class LimitOrder {
|
|
4
|
+
readonly makerAsset: string;
|
|
5
|
+
readonly takerAsset: string;
|
|
6
|
+
readonly makingAmount: string;
|
|
7
|
+
readonly takingAmount: string;
|
|
8
|
+
readonly from: string;
|
|
9
|
+
readonly allowedSender: string;
|
|
10
|
+
readonly receiver: string;
|
|
11
|
+
readonly makerAssetData: string;
|
|
12
|
+
readonly takerAssetData: string;
|
|
13
|
+
readonly getMakingAmount: string;
|
|
14
|
+
readonly getTakingAmount: string;
|
|
15
|
+
readonly predicate: string;
|
|
16
|
+
readonly permit: string;
|
|
17
|
+
readonly preInteraction: string;
|
|
18
|
+
readonly postInteraction: string;
|
|
19
|
+
protected salt: string;
|
|
20
|
+
constructor(orderInfo: OrderInfoData, interactions?: InteractionsData);
|
|
21
|
+
static getOrderHash(order: LimitOrderV3Struct, domain?: import("./eip712").EIP712DomainType): string;
|
|
22
|
+
static getTypedData(order: LimitOrderV3Struct, domain?: import("./eip712").EIP712DomainType): EIP712TypedData;
|
|
23
|
+
static decode(struct: LimitOrderV3Struct): LimitOrder;
|
|
24
|
+
build(): LimitOrderV3Struct;
|
|
25
|
+
getTypedData(domain?: import("./eip712").EIP712DomainType): EIP712TypedData;
|
|
26
|
+
getOrderHash(domain?: import("./eip712").EIP712DomainType): string;
|
|
27
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LimitOrder = void 0;
|
|
4
|
+
const utils_1 = require("../utils");
|
|
5
|
+
const eip712_1 = require("./eip712");
|
|
6
|
+
const constants_1 = require("../constants");
|
|
7
|
+
const utils_2 = require("./utils");
|
|
8
|
+
const parser_1 = require("./parser/parser");
|
|
9
|
+
class LimitOrder {
|
|
10
|
+
constructor(orderInfo, interactions) {
|
|
11
|
+
this.makerAsset = orderInfo.makerAsset;
|
|
12
|
+
this.takerAsset = orderInfo.takerAsset;
|
|
13
|
+
this.makingAmount = orderInfo.makingAmount;
|
|
14
|
+
this.takingAmount = orderInfo.takingAmount;
|
|
15
|
+
this.salt = orderInfo.salt || (0, utils_2.buildSalt)();
|
|
16
|
+
this.from = orderInfo.maker;
|
|
17
|
+
this.allowedSender = orderInfo.allowedSender || constants_1.ZERO_ADDRESS;
|
|
18
|
+
this.receiver = orderInfo.receiver || constants_1.ZERO_ADDRESS;
|
|
19
|
+
this.makerAssetData = (interactions === null || interactions === void 0 ? void 0 : interactions.makerAssetData) || constants_1.ZX;
|
|
20
|
+
this.takerAssetData = (interactions === null || interactions === void 0 ? void 0 : interactions.takerAssetData) || constants_1.ZX;
|
|
21
|
+
this.getMakingAmount = (interactions === null || interactions === void 0 ? void 0 : interactions.getMakingAmount) || constants_1.ZX;
|
|
22
|
+
this.getTakingAmount = (interactions === null || interactions === void 0 ? void 0 : interactions.getTakingAmount) || constants_1.ZX;
|
|
23
|
+
this.predicate = (interactions === null || interactions === void 0 ? void 0 : interactions.predicate) || constants_1.ZX;
|
|
24
|
+
this.permit = (interactions === null || interactions === void 0 ? void 0 : interactions.permit) || constants_1.ZX;
|
|
25
|
+
this.preInteraction = (interactions === null || interactions === void 0 ? void 0 : interactions.preInteraction) || constants_1.ZX;
|
|
26
|
+
this.postInteraction = (interactions === null || interactions === void 0 ? void 0 : interactions.postInteraction) || constants_1.ZX;
|
|
27
|
+
}
|
|
28
|
+
static getOrderHash(order, domain = (0, eip712_1.getLimitOrderV3Domain)(1)) {
|
|
29
|
+
return (0, eip712_1.getOrderHash)(LimitOrder.getTypedData(order, domain));
|
|
30
|
+
}
|
|
31
|
+
static getTypedData(order, domain = (0, eip712_1.getLimitOrderV3Domain)(1)) {
|
|
32
|
+
return (0, eip712_1.buildOrderData)(domain.chainId, domain.verifyingContract, domain.name, domain.version, order);
|
|
33
|
+
}
|
|
34
|
+
static decode(struct) {
|
|
35
|
+
const interactions = (0, parser_1.parseInteractions)(struct.offsets, struct.interactions);
|
|
36
|
+
return new LimitOrder({
|
|
37
|
+
makerAsset: struct.makerAsset,
|
|
38
|
+
takerAsset: struct.takerAsset,
|
|
39
|
+
maker: struct.maker,
|
|
40
|
+
takingAmount: struct.takingAmount,
|
|
41
|
+
makingAmount: struct.makingAmount,
|
|
42
|
+
allowedSender: struct.allowedSender,
|
|
43
|
+
receiver: struct.receiver,
|
|
44
|
+
salt: struct.salt
|
|
45
|
+
}, interactions);
|
|
46
|
+
}
|
|
47
|
+
build() {
|
|
48
|
+
const allInteractions = [
|
|
49
|
+
this.makerAssetData,
|
|
50
|
+
this.takerAssetData,
|
|
51
|
+
this.getMakingAmount,
|
|
52
|
+
this.getTakingAmount,
|
|
53
|
+
this.predicate,
|
|
54
|
+
this.permit,
|
|
55
|
+
this.preInteraction,
|
|
56
|
+
this.postInteraction
|
|
57
|
+
];
|
|
58
|
+
// https://stackoverflow.com/a/55261098/440168
|
|
59
|
+
const cumulativeSum = ((sum) => (value) => {
|
|
60
|
+
sum += value;
|
|
61
|
+
return sum;
|
|
62
|
+
})(0);
|
|
63
|
+
const offsets = allInteractions
|
|
64
|
+
.map((a) => a.length / 2 - 1)
|
|
65
|
+
.map(cumulativeSum)
|
|
66
|
+
.reduce((acc, a, i) => acc.add((0, utils_1.toBN)(a).shln(32 * i)), (0, utils_1.toBN)(0));
|
|
67
|
+
const interactions = '0x' + allInteractions.map(utils_1.trim0x).join('');
|
|
68
|
+
return {
|
|
69
|
+
salt: this.salt,
|
|
70
|
+
makerAsset: this.makerAsset,
|
|
71
|
+
takerAsset: this.takerAsset,
|
|
72
|
+
maker: this.from,
|
|
73
|
+
receiver: this.receiver,
|
|
74
|
+
allowedSender: this.allowedSender,
|
|
75
|
+
makingAmount: this.makingAmount,
|
|
76
|
+
takingAmount: this.takingAmount,
|
|
77
|
+
offsets: offsets.toString(),
|
|
78
|
+
interactions
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
getTypedData(domain = (0, eip712_1.getLimitOrderV3Domain)(1)) {
|
|
82
|
+
return (0, eip712_1.buildOrderData)(domain.chainId, domain.verifyingContract, domain.name, domain.version, this.build());
|
|
83
|
+
}
|
|
84
|
+
getOrderHash(domain = (0, eip712_1.getLimitOrderV3Domain)(1)) {
|
|
85
|
+
return (0, eip712_1.getOrderHash)(this.getTypedData(domain));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.LimitOrder = LimitOrder;
|
|
89
|
+
//# sourceMappingURL=limit-order.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit-order.js","sourceRoot":"","sources":["../../src/limit-order/limit-order.ts"],"names":[],"mappings":";;;AAAA,oCAAqC;AACrC,qCAKiB;AACjB,4CAA6C;AAC7C,mCAAiC;AAEjC,4CAAiD;AAEjD,MAAa,UAAU;IAiCnB,YAAY,SAAwB,EAAE,YAA+B;QACjE,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,UAAU,CAAA;QACtC,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AA;IACL,CAAC;IAED,YAAY,CAAC,MAAM,GAAG,IAAA,8BAAqB,EAAC,CAAC,CAAC;QAC1C,OAAO,IAAA,qBAAY,EAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAA;IAClD,CAAC;CACJ;AA3JD,gCA2JC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const limit_order_1 = require("./limit-order");
|
|
4
|
+
const predicate_factory_1 = require("./predicate-factory");
|
|
5
|
+
const interactions_factory_1 = require("./interactions-factory");
|
|
6
|
+
describe('Limit Order', () => {
|
|
7
|
+
jest.spyOn(Math, 'random').mockReturnValue(1);
|
|
8
|
+
jest.spyOn(Date, 'now').mockReturnValue(1673549418040);
|
|
9
|
+
it('should create limit order', () => {
|
|
10
|
+
const order = new limit_order_1.LimitOrder({
|
|
11
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
12
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
13
|
+
makingAmount: '1000000000000000000',
|
|
14
|
+
takingAmount: '1420000000',
|
|
15
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa'
|
|
16
|
+
});
|
|
17
|
+
expect(order.build()).toStrictEqual({
|
|
18
|
+
allowedSender: '0x0000000000000000000000000000000000000000',
|
|
19
|
+
interactions: '0x',
|
|
20
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
21
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
22
|
+
makingAmount: '1000000000000000000',
|
|
23
|
+
offsets: '0',
|
|
24
|
+
receiver: '0x0000000000000000000000000000000000000000',
|
|
25
|
+
salt: '1673549418040',
|
|
26
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
27
|
+
takingAmount: '1420000000'
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
it('should create limit order with timestampBelow predicate', () => {
|
|
31
|
+
const order = new limit_order_1.LimitOrder({
|
|
32
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
33
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
34
|
+
makingAmount: '1000000000000000000',
|
|
35
|
+
takingAmount: '1420000000',
|
|
36
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa'
|
|
37
|
+
}, {
|
|
38
|
+
predicate: predicate_factory_1.PredicateFactory.timestampBelow(1673549418)
|
|
39
|
+
});
|
|
40
|
+
expect(order.build()).toStrictEqual({
|
|
41
|
+
allowedSender: '0x0000000000000000000000000000000000000000',
|
|
42
|
+
interactions: '0x63592c2b0000000000000000000000000000000000000000000000000000000063c0566a',
|
|
43
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
44
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
45
|
+
makingAmount: '1000000000000000000',
|
|
46
|
+
offsets: '970558080243398695134547109586957793750899628853613079895592438595584',
|
|
47
|
+
receiver: '0x0000000000000000000000000000000000000000',
|
|
48
|
+
salt: '1673549418040',
|
|
49
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
50
|
+
takingAmount: '1420000000'
|
|
51
|
+
});
|
|
52
|
+
});
|
|
53
|
+
it('should create limit order with timestampBelow predicate that will unwrap maker weth to eth', () => {
|
|
54
|
+
const order = new limit_order_1.LimitOrder({
|
|
55
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
56
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
57
|
+
makingAmount: '1000000000000000000',
|
|
58
|
+
takingAmount: '1420000000',
|
|
59
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa'
|
|
60
|
+
}, {
|
|
61
|
+
predicate: predicate_factory_1.PredicateFactory.timestampBelow(1673549418),
|
|
62
|
+
postInteraction: interactions_factory_1.InteractionsFactory.unwrap('0x08b067ad41e45babe5bbb52fc2fe7f692f628b06', '0x00000000219ab540356cbb839cbe05303d7705fa')
|
|
63
|
+
});
|
|
64
|
+
expect(order.build()).toStrictEqual({
|
|
65
|
+
allowedSender: '0x0000000000000000000000000000000000000000',
|
|
66
|
+
interactions: '0x63592c2b0000000000000000000000000000000000000000000000000000000063c0566a08b067ad41e45babe5bbb52fc2fe7f692f628b0600000000219ab540356cbb839cbe05303d7705fa',
|
|
67
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
68
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
69
|
+
makingAmount: '1000000000000000000',
|
|
70
|
+
offsets: '2048955946929424286921227713067743020696385405755235979139736848564224',
|
|
71
|
+
receiver: '0x0000000000000000000000000000000000000000',
|
|
72
|
+
salt: '1673549418040',
|
|
73
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
74
|
+
takingAmount: '1420000000'
|
|
75
|
+
});
|
|
76
|
+
});
|
|
77
|
+
it('should decode limit order struct', () => {
|
|
78
|
+
const orderStruct = {
|
|
79
|
+
allowedSender: '0x0000000000000000000000000000000000000000',
|
|
80
|
+
interactions: '0x63592c2b0000000000000000000000000000000000000000000000000000000063c0566a08b067ad41e45babe5bbb52fc2fe7f692f628b0600000000219ab540356cbb839cbe05303d7705fa',
|
|
81
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
82
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
83
|
+
makingAmount: '1000000000000000000',
|
|
84
|
+
offsets: '2048955946929424286921227713067743020696385405755235979139736848564224',
|
|
85
|
+
receiver: '0x0000000000000000000000000000000000000000',
|
|
86
|
+
salt: '1673549418040',
|
|
87
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
88
|
+
takingAmount: '1420000000'
|
|
89
|
+
};
|
|
90
|
+
const order = limit_order_1.LimitOrder.decode(orderStruct);
|
|
91
|
+
expect(order.build()).toStrictEqual(orderStruct);
|
|
92
|
+
});
|
|
93
|
+
it('should get limit order typed data', () => {
|
|
94
|
+
const order = new limit_order_1.LimitOrder({
|
|
95
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
96
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
97
|
+
makingAmount: '1000000000000000000',
|
|
98
|
+
takingAmount: '1420000000',
|
|
99
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa'
|
|
100
|
+
});
|
|
101
|
+
expect(order.getTypedData()).toStrictEqual({
|
|
102
|
+
domain: {
|
|
103
|
+
chainId: 1,
|
|
104
|
+
name: '1inch Aggregation Router',
|
|
105
|
+
verifyingContract: '0x1111111254eeb25477b68fb85ed929f73a960582',
|
|
106
|
+
version: '5'
|
|
107
|
+
},
|
|
108
|
+
message: {
|
|
109
|
+
allowedSender: '0x0000000000000000000000000000000000000000',
|
|
110
|
+
interactions: '0x',
|
|
111
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
112
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
113
|
+
makingAmount: '1000000000000000000',
|
|
114
|
+
offsets: '0',
|
|
115
|
+
receiver: '0x0000000000000000000000000000000000000000',
|
|
116
|
+
salt: '1673549418040',
|
|
117
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
118
|
+
takingAmount: '1420000000'
|
|
119
|
+
},
|
|
120
|
+
primaryType: 'Order',
|
|
121
|
+
types: {
|
|
122
|
+
EIP712Domain: [
|
|
123
|
+
{
|
|
124
|
+
name: 'name',
|
|
125
|
+
type: 'string'
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
name: 'version',
|
|
129
|
+
type: 'string'
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
name: 'chainId',
|
|
133
|
+
type: 'uint256'
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: 'verifyingContract',
|
|
137
|
+
type: 'address'
|
|
138
|
+
}
|
|
139
|
+
],
|
|
140
|
+
Order: [
|
|
141
|
+
{
|
|
142
|
+
name: 'salt',
|
|
143
|
+
type: 'uint256'
|
|
144
|
+
},
|
|
145
|
+
{
|
|
146
|
+
name: 'makerAsset',
|
|
147
|
+
type: 'address'
|
|
148
|
+
},
|
|
149
|
+
{
|
|
150
|
+
name: 'takerAsset',
|
|
151
|
+
type: 'address'
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
name: 'maker',
|
|
155
|
+
type: 'address'
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
name: 'receiver',
|
|
159
|
+
type: 'address'
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
name: 'allowedSender',
|
|
163
|
+
type: 'address'
|
|
164
|
+
},
|
|
165
|
+
{
|
|
166
|
+
name: 'makingAmount',
|
|
167
|
+
type: 'uint256'
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
name: 'takingAmount',
|
|
171
|
+
type: 'uint256'
|
|
172
|
+
},
|
|
173
|
+
{
|
|
174
|
+
name: 'offsets',
|
|
175
|
+
type: 'uint256'
|
|
176
|
+
},
|
|
177
|
+
{
|
|
178
|
+
name: 'interactions',
|
|
179
|
+
type: 'bytes'
|
|
180
|
+
}
|
|
181
|
+
]
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
});
|
|
185
|
+
it('should get limit order hash', () => {
|
|
186
|
+
const order = new limit_order_1.LimitOrder({
|
|
187
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
188
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
189
|
+
makingAmount: '1000000000000000000',
|
|
190
|
+
takingAmount: '1420000000',
|
|
191
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa'
|
|
192
|
+
});
|
|
193
|
+
expect(order.getOrderHash()).toBe('0x4bdb758d3d4b265367c461cdb12b2fbe92fd8f2bcc9423393e9da4490d6157c4');
|
|
194
|
+
});
|
|
195
|
+
});
|
|
196
|
+
//# sourceMappingURL=limit-order.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"limit-order.spec.js","sourceRoot":"","sources":["../../src/limit-order/limit-order.spec.ts"],"names":[],"mappings":";;AAAA,+CAAwC;AACxC,2DAAoD;AACpD,iEAA0D;AAG1D,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IACzB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,CAAA;IAC7C,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,KAAK,CAAC,CAAC,eAAe,CAAC,aAAa,CAAC,CAAA;IAEtD,EAAE,CAAC,2BAA2B,EAAE,GAAG,EAAE;QACjC,MAAM,KAAK,GAAG,IAAI,wBAAU,CAAC;YACzB,UAAU,EAAE,4CAA4C;YACxD,UAAU,EAAE,4CAA4C;YACxD,YAAY,EAAE,qBAAqB;YACnC,YAAY,EAAE,YAAY;YAC1B,KAAK,EAAE,4CAA4C;SACtD,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,CAAC,KAAK,EAAE,CAAC,CAAC,aAAa,CAAC;YAChC,aAAa,EAAE,4CAA4C;YAC3D,YAAY,EAAE,IAAI;YAClB,KAAK,EAAE,4CAA4C;YACnD,UAAU,EAAE,4CAA4C;YACxD,YAAY,EAAE,qBAAqB;YACnC,OAAO,EAAE,GAAG;YACZ,QAAQ,EAAE,4CAA4C;YACt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E,cAAc;wBACpB,IAAI,EAAE,OAAO;qBAChB;iBACJ;aACJ;SACJ,CAAC,CAAA;IACN,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,6BAA6B,EAAE,GAAG,EAAE;QACnC,MAAM,KAAK,GAAG,IAAI,wBAAU,CAAC;YACzB,UAAU,EAAE,4CAA4C;YACxD,UAAU,EAAE,4CAA4C;YACxD,YAAY,EAAE,qBAAqB;YACnC,YAAY,EAAE,YAAY;YAC1B,KAAK,EAAE,4CAA4C;SACtD,CAAC,CAAA;QAEF,MAAM,CAAC,KAAK,CAAC,YAAY,EAAE,CAAC,CAAC,IAAI,CAC7B,oEAAoE,CACvE,CAAA;IACL,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const DynamicField: {
|
|
2
|
+
readonly makerAssetData: 0;
|
|
3
|
+
readonly takerAssetData: 1;
|
|
4
|
+
readonly getMakingAmount: 2;
|
|
5
|
+
readonly getTakingAmount: 3;
|
|
6
|
+
readonly predicate: 4;
|
|
7
|
+
readonly permit: 5;
|
|
8
|
+
readonly preInteraction: 6;
|
|
9
|
+
readonly postInteraction: 7;
|
|
10
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DynamicField = void 0;
|
|
4
|
+
exports.DynamicField = {
|
|
5
|
+
makerAssetData: 0,
|
|
6
|
+
takerAssetData: 1,
|
|
7
|
+
getMakingAmount: 2,
|
|
8
|
+
getTakingAmount: 3,
|
|
9
|
+
predicate: 4,
|
|
10
|
+
permit: 5,
|
|
11
|
+
preInteraction: 6,
|
|
12
|
+
postInteraction: 7
|
|
13
|
+
};
|
|
14
|
+
//# sourceMappingURL=constants.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../../src/limit-order/parser/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IACxB,cAAc,EAAE,CAAC;IACjB,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,CAAC;IAClB,eAAe,EAAE,CAAC;IAClB,SAAS,EAAE,CAAC;IACZ,MAAM,EAAE,CAAC;IACT,cAAc,EAAE,CAAC;IACjB,eAAe,EAAE,CAAC;CACZ,CAAA"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
tslib_1.__exportStar(require("./parser"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./constants"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/limit-order/parser/index.ts"],"names":[],"mappings":";;;AAAA,mDAAwB;AACxB,kDAAuB;AACvB,sDAA2B"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.parseInteractions = void 0;
|
|
4
|
+
const utils_1 = require("../../utils");
|
|
5
|
+
const constants_1 = require("./constants");
|
|
6
|
+
function parseInteractions(offsets, interactions) {
|
|
7
|
+
const offsetsBN = (0, utils_1.toBN)(offsets);
|
|
8
|
+
const parsedInteractions = {};
|
|
9
|
+
interactions = (0, utils_1.trim0x)(interactions);
|
|
10
|
+
for (const interactionName in constants_1.DynamicField) {
|
|
11
|
+
const field = interactionName;
|
|
12
|
+
parsedInteractions[field] = parseInteractionForField(offsetsBN, interactions, constants_1.DynamicField[field]);
|
|
13
|
+
}
|
|
14
|
+
return parsedInteractions;
|
|
15
|
+
}
|
|
16
|
+
exports.parseInteractions = parseInteractions;
|
|
17
|
+
function parseInteractionForField(offsets, interactions, field) {
|
|
18
|
+
const { fromByte, toByte } = getOffsetForInteraction(offsets, field);
|
|
19
|
+
return '0x' + interactions.slice(fromByte * 2, toByte * 2);
|
|
20
|
+
}
|
|
21
|
+
function getOffsetForInteraction(offsets, field) {
|
|
22
|
+
const fromByteBN = field === 0 ? '0' : offsets.shrn((field - 1) * 32).maskn(32);
|
|
23
|
+
const toByteBN = offsets.shrn(field * 32).maskn(32);
|
|
24
|
+
return {
|
|
25
|
+
fromByte: parseInt(fromByteBN.toString()),
|
|
26
|
+
toByte: parseInt(toByteBN.toString())
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=parser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../src/limit-order/parser/parser.ts"],"names":[],"mappings":";;;AAAA,uCAAwC;AACxC,2CAAwC;AAIxC,SAAgB,iBAAiB,CAC7B,OAAe,EACf,YAAoB;IAEpB,MAAM,SAAS,GAAG,IAAA,YAAI,EAAC,OAAO,CAAC,CAAA;IAE/B,MAAM,kBAAkB,GAAG,EAAwB,CAAA;IAEnD,YAAY,GAAG,IAAA,cAAM,EAAC,YAAY,CAAC,CAAA;IAEnC,KAAK,MAAM,eAAe,IAAI,wBAAY,EAAE;QACxC,MAAM,KAAK,GAAG,eAAmC,CAAA;QACjD,kBAAkB,CAAC,KAAK,CAAC,GAAG,wBAAwB,CAChD,SAAS,EACT,YAAY,EACZ,wBAAY,CAAC,KAAK,CAAC,CACtB,CAAA;KACJ;IAED,OAAO,kBAAkB,CAAA;AAC7B,CAAC;AApBD,8CAoBC;AAED,SAAS,wBAAwB,CAC7B,OAAW,EACX,YAAoB,EACpB,KAAa;IAEb,MAAM,EAAC,QAAQ,EAAE,MAAM,EAAC,GAAG,uBAAuB,CAAC,OAAO,EAAE,KAAK,CAAC,CAAA;IAElE,OAAO,IAAI,GAAG,YAAY,CAAC,KAAK,CAAC,QAAQ,GAAG,CAAC,EAAE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