@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,54 @@
|
|
|
1
|
+
import { NetworkEnum } from '../../constants';
|
|
2
|
+
export declare type QuoterRequestParams = {
|
|
3
|
+
fromTokenAddress: string;
|
|
4
|
+
toTokenAddress: string;
|
|
5
|
+
amount: string;
|
|
6
|
+
walletAddress: string;
|
|
7
|
+
enableEstimate?: boolean;
|
|
8
|
+
permit?: string;
|
|
9
|
+
};
|
|
10
|
+
export declare type QuoterApiConfig = {
|
|
11
|
+
network: NetworkEnum;
|
|
12
|
+
url: string;
|
|
13
|
+
};
|
|
14
|
+
export declare type QuoterResponse = {
|
|
15
|
+
fromTokenAmount: string;
|
|
16
|
+
feeToken: string;
|
|
17
|
+
presets: QuoterPresets;
|
|
18
|
+
toTokenAmount: string;
|
|
19
|
+
prices: Cost;
|
|
20
|
+
volume: Cost;
|
|
21
|
+
settlementAddress: string;
|
|
22
|
+
whitelist: string[];
|
|
23
|
+
quoteId: string | null;
|
|
24
|
+
};
|
|
25
|
+
export declare type QuoterPresets = {
|
|
26
|
+
fast: PresetData;
|
|
27
|
+
medium: PresetData;
|
|
28
|
+
slow: PresetData;
|
|
29
|
+
};
|
|
30
|
+
export declare type PresetData = {
|
|
31
|
+
auctionDuration: number;
|
|
32
|
+
startAuctionIn: number;
|
|
33
|
+
bankFee: string;
|
|
34
|
+
initialRateBump: number;
|
|
35
|
+
auctionStartAmount: string;
|
|
36
|
+
auctionEndAmount: string;
|
|
37
|
+
tokenFee: string;
|
|
38
|
+
points: AuctionPoint[];
|
|
39
|
+
};
|
|
40
|
+
export declare type AuctionPoint = {
|
|
41
|
+
delay: number;
|
|
42
|
+
coefficient: number;
|
|
43
|
+
};
|
|
44
|
+
export declare type Cost = {
|
|
45
|
+
usd: {
|
|
46
|
+
fromToken: string;
|
|
47
|
+
toToken: string;
|
|
48
|
+
};
|
|
49
|
+
};
|
|
50
|
+
export declare enum PresetEnum {
|
|
51
|
+
fast = "fast",
|
|
52
|
+
medium = "medium",
|
|
53
|
+
slow = "slow"
|
|
54
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PresetEnum = void 0;
|
|
4
|
+
var PresetEnum;
|
|
5
|
+
(function (PresetEnum) {
|
|
6
|
+
PresetEnum["fast"] = "fast";
|
|
7
|
+
PresetEnum["medium"] = "medium";
|
|
8
|
+
PresetEnum["slow"] = "slow";
|
|
9
|
+
})(PresetEnum = exports.PresetEnum || (exports.PresetEnum = {}));
|
|
10
|
+
//# sourceMappingURL=types.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/quoter/types.ts"],"names":[],"mappings":";;;AAyDA,IAAY,UAIX;AAJD,WAAY,UAAU;IAClB,2BAAa,CAAA;IACb,+BAAiB,CAAA;IACjB,2BAAa,CAAA;AACjB,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB"}
|
|
@@ -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("./relayer.request"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./relayer.api"), exports);
|
|
6
|
+
tslib_1.__exportStar(require("./types"), exports);
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/api/relayer/index.ts"],"names":[],"mappings":";;;AAAA,4DAAiC;AACjC,wDAA6B;AAC7B,kDAAuB"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AxiosProviderConnector, HttpProviderConnector } from '../../connector';
|
|
2
|
+
import { RelayerRequest } from './relayer.request';
|
|
3
|
+
import { RelayerApiConfig } from './types';
|
|
4
|
+
export declare class RelayerApi {
|
|
5
|
+
private readonly config;
|
|
6
|
+
private readonly httpClient;
|
|
7
|
+
constructor(config: RelayerApiConfig, httpClient: HttpProviderConnector);
|
|
8
|
+
static new(config: RelayerApiConfig, httpClient?: AxiosProviderConnector): RelayerApi;
|
|
9
|
+
submit(params: RelayerRequest): Promise<void>;
|
|
10
|
+
submitBatch(params: RelayerRequest[]): Promise<void>;
|
|
11
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelayerApi = void 0;
|
|
4
|
+
const connector_1 = require("../../connector");
|
|
5
|
+
class RelayerApi {
|
|
6
|
+
constructor(config, httpClient) {
|
|
7
|
+
this.config = config;
|
|
8
|
+
this.httpClient = httpClient;
|
|
9
|
+
}
|
|
10
|
+
static new(config, httpClient = new connector_1.AxiosProviderConnector()) {
|
|
11
|
+
return new RelayerApi(config, httpClient);
|
|
12
|
+
}
|
|
13
|
+
submit(params) {
|
|
14
|
+
const url = `${this.config.url}/v1.0/${this.config.network}/order/submit`;
|
|
15
|
+
return this.httpClient.post(url, params);
|
|
16
|
+
}
|
|
17
|
+
submitBatch(params) {
|
|
18
|
+
const url = `${this.config.url}/v1.0/${this.config.network}/order/submit/many`;
|
|
19
|
+
return this.httpClient.post(url, params);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.RelayerApi = RelayerApi;
|
|
23
|
+
//# sourceMappingURL=relayer.api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relayer.api.js","sourceRoot":"","sources":["../../../src/api/relayer/relayer.api.ts"],"names":[],"mappings":";;;AAAA,+CAA6E;AAI7E,MAAa,UAAU;IACnB,YACqB,MAAwB,EACxB,UAAiC;QADjC,WAAM,GAAN,MAAM,CAAkB;QACxB,eAAU,GAAV,UAAU,CAAuB;IACnD,CAAC;IAEJ,MAAM,CAAC,GAAG,CACN,MAAwB,EACxB,UAAU,GAAG,IAAI,kCAAsB,EAAE;QAEzC,OAAO,IAAI,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,CAAA;IAC7C,CAAC;IAED,MAAM,CAAC,MAAsB;QACzB,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,SAAS,IAAI,CAAC,MAAM,CAAC,OAAO,eAAe,CAAA;QAEzE,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAC5C,CAAC;IAED,WAAW,CAAC,MAAwB;QAChC,MAAM,GAAG,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,GAAG,SAAS,IAAI,CAAC,MAAM,CAAC,OAAO,oBAAoB,CAAA;QAE9E,OAAO,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,CAAC,CAAA;IAC5C,CAAC;CACJ;AAxBD,gCAwBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const relayer_api_1 = require("./relayer.api");
|
|
5
|
+
const relayer_request_1 = require("./relayer.request");
|
|
6
|
+
describe('Relayer API', () => {
|
|
7
|
+
const httpProvider = {
|
|
8
|
+
get: jest.fn().mockImplementationOnce(() => {
|
|
9
|
+
return Promise.resolve();
|
|
10
|
+
}),
|
|
11
|
+
post: jest.fn().mockImplementation(() => {
|
|
12
|
+
return Promise.resolve();
|
|
13
|
+
})
|
|
14
|
+
};
|
|
15
|
+
it('should submit one order', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
const quoter = relayer_api_1.RelayerApi.new({
|
|
17
|
+
url: 'https://test.com/relayer',
|
|
18
|
+
network: 1
|
|
19
|
+
}, httpProvider);
|
|
20
|
+
const orderData = {
|
|
21
|
+
order: {
|
|
22
|
+
allowedSender: '0x0000000000000000000000000000000000000000',
|
|
23
|
+
interactions: '0x000c004e200000000000000000219ab540356cbb839cbe05303d7705faf486570009',
|
|
24
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
25
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
26
|
+
makingAmount: '1000000000000000000',
|
|
27
|
+
offsets: '0',
|
|
28
|
+
receiver: '0x0000000000000000000000000000000000000000',
|
|
29
|
+
salt: '45118768841948961586167738353692277076075522015101619148498725069326976558864',
|
|
30
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
31
|
+
takingAmount: '1420000000'
|
|
32
|
+
},
|
|
33
|
+
signature: '0x123signature-here789',
|
|
34
|
+
quoteId: '9a43c86d-f3d7-45b9-8cb6-803d2bdfa08b'
|
|
35
|
+
};
|
|
36
|
+
const params = relayer_request_1.RelayerRequest.new(orderData);
|
|
37
|
+
yield quoter.submit(params);
|
|
38
|
+
expect(httpProvider.post).toHaveBeenCalledWith('https://test.com/relayer/v1.0/1/order/submit', orderData);
|
|
39
|
+
}));
|
|
40
|
+
it('should submit two orders order', () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
41
|
+
const quoter = relayer_api_1.RelayerApi.new({
|
|
42
|
+
url: 'https://test.com/relayer',
|
|
43
|
+
network: 1
|
|
44
|
+
}, httpProvider);
|
|
45
|
+
const orderData1 = {
|
|
46
|
+
order: {
|
|
47
|
+
allowedSender: '0x0000000000000000000000000000000000000000',
|
|
48
|
+
interactions: '0x000c004e200000000000000000219ab540356cbb839cbe05303d7705faf486570009',
|
|
49
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
50
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
51
|
+
makingAmount: '1000000000000000000',
|
|
52
|
+
offsets: '0',
|
|
53
|
+
receiver: '0x0000000000000000000000000000000000000000',
|
|
54
|
+
salt: '45118768841948961586167738353692277076075522015101619148498725069326976558864',
|
|
55
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
56
|
+
takingAmount: '1420000000'
|
|
57
|
+
},
|
|
58
|
+
signature: '0x123signature-here789',
|
|
59
|
+
quoteId: '9a43c86d-f3d7-45b9-8cb6-803d2bdfa08b'
|
|
60
|
+
};
|
|
61
|
+
const orderData2 = {
|
|
62
|
+
order: {
|
|
63
|
+
allowedSender: '0x0000000000000000000000000000000000000000',
|
|
64
|
+
interactions: '0x000c004e200000000000000000219ab540356cbb839cbe05303d7705faf486570009',
|
|
65
|
+
maker: '0x12345678219ab540356cbb839cbe05303d771111',
|
|
66
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
67
|
+
makingAmount: '1000000000000000000',
|
|
68
|
+
offsets: '0',
|
|
69
|
+
receiver: '0x0000000000000000000000000000000000000000',
|
|
70
|
+
salt: '45118768841948961586167738353692277076075522015101619148498725069326976558864',
|
|
71
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
72
|
+
takingAmount: '1420000000'
|
|
73
|
+
},
|
|
74
|
+
signature: '0x123signature-2-here789',
|
|
75
|
+
quoteId: '1a36c861-ffd7-45b9-1cb6-403d3bdfa084'
|
|
76
|
+
};
|
|
77
|
+
const params = [
|
|
78
|
+
relayer_request_1.RelayerRequest.new(orderData1),
|
|
79
|
+
relayer_request_1.RelayerRequest.new(orderData2)
|
|
80
|
+
];
|
|
81
|
+
yield quoter.submitBatch(params);
|
|
82
|
+
expect(httpProvider.post).toHaveBeenCalledWith('https://test.com/relayer/v1.0/1/order/submit/many', params);
|
|
83
|
+
}));
|
|
84
|
+
});
|
|
85
|
+
//# sourceMappingURL=relayer.api.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relayer.api.spec.js","sourceRoot":"","sources":["../../../src/api/relayer/relayer.api.spec.ts"],"names":[],"mappings":";;;AAAA,+CAAwC;AACxC,uDAAgD;AAIhD,QAAQ,CAAC,aAAa,EAAE,GAAG,EAAE;IACzB,MAAM,YAAY,GAA0B;QACxC,GAAG,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,sBAAsB,CAAC,GAAG,EAAE;YACvC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;QAC5B,CAAC,CAAC;QACF,IAAI,EAAE,IAAI,CAAC,EAAE,EAAE,CAAC,kBAAkB,CAAC,GAAG,EAAE;YACpC,OAAO,OAAO,CAAC,OAAO,EAAE,CAAA;QAC5B,CAAC,CAAC;KACL,CAAA;IAED,EAAE,CAAC,yBAAyB,EAAE,GAAS,EAAE;QACrC,MAAM,MAAM,GAAG,wBAAU,CAAC,GAAG,CACzB;YACI,GAAG,EAAE,0BAA0B;YAC/B,OAAO,EAAE,CAAC;SACb,EACD,YAAY,CACf,CAAA;QAED,MAAM,SAAS,GAAyB;YACpC,KAAK,EAAE;gBACH,aAAa,EAAE,4CAA4C;gBAC3D,YAAY,EACR,wEAAwE;gBAC5E,KAAK,EAAE,4CAA4C;gBACnD,UAAU,EAAE,4CAA4C;gBACxD,YAAY,EAAE,qBAAqB;gBACnC,OAAO,EAAE,GAAG;gBACZ,QAAQ,EAAE,4CAA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UAAU,EAAE,4CAA4C;gBACxD,YAAY,EAAE,YAAY;aAC7B;YACD,SAAS,EAAE,0BAA0B;YACrC,OAAO,EAAE,sCAAsC;SAClD,CAAA;QAED,MAAM,MAAM,GAAG;YACX,gCAAc,CAAC,GAAG,CAAC,UAAU,CAAC;YAC9B,gCAAc,CAAC,GAAG,CAAC,UAAU,CAAC;SACjC,CAAA;QAED,MAAM,MAAM,CAAC,WAAW,CAAC,MAAM,CAAC,CAAA;QAEhC,MAAM,CAAC,YAAY,CAAC,IAAI,CAAC,CAAC,oBAAoB,CAC1C,mDAAmD,EACnD,MAAM,CACT,CAAA;IACL,CAAC,CAAA,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { RelayerRequestParams } from './types';
|
|
2
|
+
import { LimitOrderV3Struct } from '../../limit-order';
|
|
3
|
+
export declare class RelayerRequest {
|
|
4
|
+
readonly order: LimitOrderV3Struct;
|
|
5
|
+
readonly signature: string;
|
|
6
|
+
readonly quoteId: string;
|
|
7
|
+
constructor(params: RelayerRequestParams);
|
|
8
|
+
static new(params: RelayerRequestParams): RelayerRequest;
|
|
9
|
+
build(): RelayerRequestParams;
|
|
10
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RelayerRequest = void 0;
|
|
4
|
+
class RelayerRequest {
|
|
5
|
+
constructor(params) {
|
|
6
|
+
this.order = params.order;
|
|
7
|
+
this.signature = params.signature;
|
|
8
|
+
this.quoteId = params.quoteId;
|
|
9
|
+
}
|
|
10
|
+
static new(params) {
|
|
11
|
+
return new RelayerRequest(params);
|
|
12
|
+
}
|
|
13
|
+
build() {
|
|
14
|
+
return {
|
|
15
|
+
order: this.order,
|
|
16
|
+
signature: this.signature,
|
|
17
|
+
quoteId: this.quoteId
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.RelayerRequest = RelayerRequest;
|
|
22
|
+
//# sourceMappingURL=relayer.request.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"relayer.request.js","sourceRoot":"","sources":["../../../src/api/relayer/relayer.request.ts"],"names":[],"mappings":";;;AAGA,MAAa,cAAc;IAOvB,YAAY,MAA4B;QACpC,IAAI,CAAC,KAAK,GAAG,MAAM,CAAC,KAAK,CAAA;QACzB,IAAI,CAAC,SAAS,GAAG,MAAM,CAAC,SAAS,CAAA;QACjC,IAAI,CAAC,OAAO,GAAG,MAAM,CAAC,OAAO,CAAA;IACjC,CAAC;IAED,MAAM,CAAC,GAAG,CAAC,MAA4B;QACnC,OAAO,IAAI,cAAc,CAAC,MAAM,CAAC,CAAA;IACrC,CAAC;IAED,KAAK;QACD,OAAO;YACH,KAAK,EAAE,IAAI,CAAC,KAAK;YACjB,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;SACxB,CAAA;IACL,CAAC;CACJ;AAxBD,wCAwBC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { NetworkEnum } from '../../constants';
|
|
2
|
+
import { LimitOrderV3Struct } from '../../limit-order';
|
|
3
|
+
export declare type RelayerRequestParams = {
|
|
4
|
+
order: LimitOrderV3Struct;
|
|
5
|
+
signature: string;
|
|
6
|
+
quoteId: string;
|
|
7
|
+
};
|
|
8
|
+
export declare type RelayerApiConfig = {
|
|
9
|
+
network: NetworkEnum;
|
|
10
|
+
url: string;
|
|
11
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/relayer/types.ts"],"names":[],"mappings":""}
|
package/api/types.d.ts
ADDED
package/api/types.js
ADDED
package/api/types.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/api/types.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AuctionPoint, AuctionSuffix } from '../auction-suffix';
|
|
2
|
+
import { LimitOrderV3Struct } from '../limit-order';
|
|
3
|
+
import { AuctionSalt } from '../auction-salt';
|
|
4
|
+
export declare class AuctionCalculator {
|
|
5
|
+
private readonly startTime;
|
|
6
|
+
private readonly duration;
|
|
7
|
+
private readonly initialRateBump;
|
|
8
|
+
private readonly points;
|
|
9
|
+
private readonly takerFeeRatio;
|
|
10
|
+
constructor(startTime: number, duration: number, initialRateBump: number, points: AuctionPoint[], takerFeeRatio: string);
|
|
11
|
+
static fromLimitOrderV3Struct(order: LimitOrderV3Struct): AuctionCalculator;
|
|
12
|
+
static fromAuctionData(suffix: AuctionSuffix, salt: AuctionSalt): AuctionCalculator;
|
|
13
|
+
calcAuctionTakingAmount(takingAmount: string, rate: number): string;
|
|
14
|
+
/**
|
|
15
|
+
* @see https://github.com/1inch/limit-order-settlement/blob/3c7cf9eacbaf7a60624d7a6f069c59d809f2204a/contracts/libraries/OrderSuffix.sol#L75
|
|
16
|
+
* @param time auction timestamp in seconds
|
|
17
|
+
*/
|
|
18
|
+
calcRateBump(time: number): number;
|
|
19
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuctionCalculator = void 0;
|
|
4
|
+
const auction_suffix_1 = require("../auction-suffix");
|
|
5
|
+
const auction_salt_1 = require("../auction-salt");
|
|
6
|
+
const bignumber_1 = require("@ethersproject/bignumber");
|
|
7
|
+
const calc_1 = require("./calc");
|
|
8
|
+
const constants_1 = require("./constants");
|
|
9
|
+
class AuctionCalculator {
|
|
10
|
+
constructor(startTime, duration, initialRateBump, points, takerFeeRatio) {
|
|
11
|
+
this.startTime = startTime;
|
|
12
|
+
this.duration = duration;
|
|
13
|
+
this.initialRateBump = initialRateBump;
|
|
14
|
+
this.points = points;
|
|
15
|
+
this.takerFeeRatio = takerFeeRatio;
|
|
16
|
+
}
|
|
17
|
+
static fromLimitOrderV3Struct(order) {
|
|
18
|
+
const suffix = auction_suffix_1.AuctionSuffix.decode(order.interactions);
|
|
19
|
+
const salt = auction_salt_1.AuctionSalt.decode(order.salt);
|
|
20
|
+
return AuctionCalculator.fromAuctionData(suffix, salt);
|
|
21
|
+
}
|
|
22
|
+
static fromAuctionData(suffix, salt) {
|
|
23
|
+
return new AuctionCalculator(salt.auctionStartTime, salt.duration, salt.initialRateBump, suffix.points, suffix.takerFeeRatio);
|
|
24
|
+
}
|
|
25
|
+
calcAuctionTakingAmount(takingAmount, rate) {
|
|
26
|
+
const auctionTakingAmount = bignumber_1.BigNumber.from(takingAmount)
|
|
27
|
+
.mul(bignumber_1.BigNumber.from(rate).add(constants_1.RATE_BUMP_DENOMINATOR))
|
|
28
|
+
.div(constants_1.RATE_BUMP_DENOMINATOR);
|
|
29
|
+
if (this.takerFeeRatio === '0') {
|
|
30
|
+
return auctionTakingAmount.toString();
|
|
31
|
+
}
|
|
32
|
+
return auctionTakingAmount
|
|
33
|
+
.add(auctionTakingAmount
|
|
34
|
+
.mul(this.takerFeeRatio)
|
|
35
|
+
.div(auction_suffix_1.CONTRACT_TAKER_FEE_PRECISION))
|
|
36
|
+
.toString();
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @see https://github.com/1inch/limit-order-settlement/blob/3c7cf9eacbaf7a60624d7a6f069c59d809f2204a/contracts/libraries/OrderSuffix.sol#L75
|
|
40
|
+
* @param time auction timestamp in seconds
|
|
41
|
+
*/
|
|
42
|
+
calcRateBump(time) {
|
|
43
|
+
let cumulativeTime = bignumber_1.BigNumber.from(this.startTime);
|
|
44
|
+
const lastTime = bignumber_1.BigNumber.from(this.duration).add(cumulativeTime);
|
|
45
|
+
const startBump = bignumber_1.BigNumber.from(this.initialRateBump);
|
|
46
|
+
const currentTime = bignumber_1.BigNumber.from(time);
|
|
47
|
+
if (currentTime.lte(cumulativeTime)) {
|
|
48
|
+
return this.initialRateBump;
|
|
49
|
+
}
|
|
50
|
+
else if (currentTime.gte(lastTime)) {
|
|
51
|
+
return 0;
|
|
52
|
+
}
|
|
53
|
+
let prevCoefficient = startBump;
|
|
54
|
+
let prevCumulativeTime = cumulativeTime;
|
|
55
|
+
for (let i = this.points.length - 1; i >= 0; i--) {
|
|
56
|
+
const { coefficient, delay } = this.points[i];
|
|
57
|
+
cumulativeTime = cumulativeTime.add(delay);
|
|
58
|
+
const coefficientBN = bignumber_1.BigNumber.from(coefficient);
|
|
59
|
+
if (cumulativeTime.gt(currentTime)) {
|
|
60
|
+
const rate = (0, calc_1.linearInterpolation)(prevCumulativeTime, cumulativeTime, prevCoefficient, coefficientBN, currentTime);
|
|
61
|
+
return rate.toNumber();
|
|
62
|
+
}
|
|
63
|
+
prevCumulativeTime = cumulativeTime;
|
|
64
|
+
prevCoefficient = coefficientBN;
|
|
65
|
+
}
|
|
66
|
+
const rate = (0, calc_1.linearInterpolation)(prevCumulativeTime, lastTime, prevCoefficient, bignumber_1.BigNumber.from(0), currentTime);
|
|
67
|
+
return rate.toNumber();
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
exports.AuctionCalculator = AuctionCalculator;
|
|
71
|
+
//# sourceMappingURL=auction-calculator.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auction-calculator.js","sourceRoot":"","sources":["../../src/auction-calculator/auction-calculator.ts"],"names":[],"mappings":";;;AAAA,sDAI0B;AAE1B,kDAA2C;AAC3C,wDAAkD;AAClD,iCAA0C;AAC1C,2CAAiD;AAEjD,MAAa,iBAAiB;IAC1B,YACqB,SAAiB,EACjB,QAAgB,EAChB,eAAuB,EACvB,MAAsB,EACtB,aAAqB;QAJrB,cAAS,GAAT,SAAS,CAAQ;QACjB,aAAQ,GAAR,QAAQ,CAAQ;QAChB,oBAAe,GAAf,eAAe,CAAQ;QACvB,WAAM,GAAN,MAAM,CAAgB;QACtB,kBAA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,EAAE,CAAA;IAC1B,CAAC;CACJ;AArGD,8CAqGC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const auction_calculator_1 = require("./auction-calculator");
|
|
4
|
+
describe('Auction Calculator', () => {
|
|
5
|
+
it('should calculate auction rate and taking amount', () => {
|
|
6
|
+
const calculator = auction_calculator_1.AuctionCalculator.fromLimitOrderV3Struct({
|
|
7
|
+
allowedSender: '0x0000000000000000000000000000000000000000',
|
|
8
|
+
interactions: '0x000c004e200000000000000000219ab540356cbb839cbe05303d7705faf486570009',
|
|
9
|
+
maker: '0x00000000219ab540356cbb839cbe05303d7705fa',
|
|
10
|
+
makerAsset: '0xc02aaa39b223fe8d0a0e5c4f27ead9083c756cc2',
|
|
11
|
+
makingAmount: '1000000000000000000',
|
|
12
|
+
offsets: '0',
|
|
13
|
+
receiver: '0x0000000000000000000000000000000000000000',
|
|
14
|
+
salt: '45118768841948961586167738353692277076075522015101619148498725069326976558864',
|
|
15
|
+
takerAsset: '0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48',
|
|
16
|
+
takingAmount: '1420000000'
|
|
17
|
+
});
|
|
18
|
+
const rate = calculator.calcRateBump(1673548209);
|
|
19
|
+
const auctionTakingAmount = calculator.calcAuctionTakingAmount('1420000000', rate);
|
|
20
|
+
expect(rate).toBe(14285);
|
|
21
|
+
expect(auctionTakingAmount).toBe('1422028470');
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
//# sourceMappingURL=auction-calculator.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auction-calculator.spec.js","sourceRoot":"","sources":["../../src/auction-calculator/auction-calculator.spec.ts"],"names":[],"mappings":";;AAAA,6DAAsD;AAEtD,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAChC,EAAE,CAAC,iDAAiD,EAAE,GAAG,EAAE;QACvD,MAAM,UAAU,GAAG,sCAAiB,CAAC,sBAAsB,CAAC;YACxD,aAAa,EAAE,4CAA4C;YAC3D,YAAY,EACR,wEAAwE;YAC5E,KAAK,EAAE,4CAA4C;YACnD,UAAU,EAAE,4CAA4C;YACxD,YAAY,EAAE,qBAAqB;YACnC,OAAO,EAAE,GAAG;YACZ,QAAQ,EAAE,4CAA4C;YACtD,IAAI,EAAE,+EAA+E;YACrF,UAAU,EAAE,4CAA4C;YACxD,YAAY,EAAE,YAAY;SAC7B,CAAC,CAAA;QAEF,MAAM,IAAI,GAAG,UAAU,CAAC,YAAY,CAAC,UAAU,CAAC,CAAA;QAEhD,MAAM,mBAAmB,GAAG,UAAU,CAAC,uBAAuB,CAC1D,YAAY,EACZ,IAAI,CACP,CAAA;QAED,MAAM,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;QACxB,MAAM,CAAC,mBAAmB,CAAC,CAAC,IAAI,CAAC,YAAY,CAAC,CAAA;IAClD,CAAC,CAAC,CAAA;AACN,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { BigNumber } from '@ethersproject/bignumber';
|
|
2
|
+
/**
|
|
3
|
+
*
|
|
4
|
+
* v2(t-t1) + v1(t2-t)
|
|
5
|
+
* v = ---------------------
|
|
6
|
+
* t2-t1
|
|
7
|
+
*
|
|
8
|
+
* @see https://github.com/1inch/limit-order-settlement/blob/3c7cf9eacbaf7a60624d7a6f069c59d809f2204a/contracts/libraries/OrderSuffix.sol#L94
|
|
9
|
+
*/
|
|
10
|
+
export declare function linearInterpolation(t1: BigNumber, t2: BigNumber, v1: BigNumber, v2: BigNumber, t: BigNumber): BigNumber;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.linearInterpolation = void 0;
|
|
4
|
+
/**
|
|
5
|
+
*
|
|
6
|
+
* v2(t-t1) + v1(t2-t)
|
|
7
|
+
* v = ---------------------
|
|
8
|
+
* t2-t1
|
|
9
|
+
*
|
|
10
|
+
* @see https://github.com/1inch/limit-order-settlement/blob/3c7cf9eacbaf7a60624d7a6f069c59d809f2204a/contracts/libraries/OrderSuffix.sol#L94
|
|
11
|
+
*/
|
|
12
|
+
function linearInterpolation(t1, t2, v1, v2, t) {
|
|
13
|
+
const timePassedFromNow = t.sub(t1);
|
|
14
|
+
const timeLeft = t2.sub(t);
|
|
15
|
+
const partialCoefficient = v2.mul(timePassedFromNow);
|
|
16
|
+
const partialPrevCoefficient = v1.mul(timeLeft);
|
|
17
|
+
const coefficient = partialCoefficient.add(partialPrevCoefficient);
|
|
18
|
+
const pointsTimeDiff = t2.sub(t1);
|
|
19
|
+
return coefficient.div(pointsTimeDiff);
|
|
20
|
+
}
|
|
21
|
+
exports.linearInterpolation = linearInterpolation;
|
|
22
|
+
//# sourceMappingURL=calc.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"calc.js","sourceRoot":"","sources":["../../src/auction-calculator/calc.ts"],"names":[],"mappings":";;;AAEA;;;;;;;GAOG;AACH,SAAgB,mBAAmB,CAC/B,EAAa,EACb,EAAa,EACb,EAAa,EACb,EAAa,EACb,CAAY;IAEZ,MAAM,iBAAiB,GAAG,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IACnC,MAAM,QAAQ,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;IAE1B,MAAM,kBAAkB,GAAG,EAAE,CAAC,GAAG,CAAC,iBAAiB,CAAC,CAAA;IACpD,MAAM,sBAAsB,GAAG,EAAE,CAAC,GAAG,CAAC,QAAQ,CAAC,CAAA;IAE/C,MAAM,WAAW,GAAG,kBAAkB,CAAC,GAAG,CAAC,sBAAsB,CAAC,CAAA;IAElE,MAAM,cAAc,GAAG,EAAE,CAAC,GAAG,CAAC,EAAE,CAAC,CAAA;IAEjC,OAAO,WAAW,CAAC,GAAG,CAAC,cAAc,CAAC,CAAA;AAC1C,CAAC;AAlBD,kDAkBC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const RATE_BUMP_DENOMINATOR = 10000000;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.js","sourceRoot":"","sources":["../../src/auction-calculator/constants.ts"],"names":[],"mappings":";;;AAAa,QAAA,qBAAqB,GAAG,QAAU,CAAA,CAAC,OAAO"}
|
|
@@ -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("./auction-calculator"), exports);
|
|
5
|
+
tslib_1.__exportStar(require("./calc"), 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/auction-calculator/index.ts"],"names":[],"mappings":";;;AAAA,+DAAoC;AACpC,iDAAsB;AACtB,sDAA2B"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { AuctionSaltData } from './types';
|
|
2
|
+
export declare class AuctionSalt {
|
|
3
|
+
readonly auctionStartTime: number;
|
|
4
|
+
readonly initialRateBump: number;
|
|
5
|
+
readonly duration: number;
|
|
6
|
+
readonly bankFee: string;
|
|
7
|
+
readonly salt: string;
|
|
8
|
+
constructor(auction: AuctionSaltData);
|
|
9
|
+
static decode(salt: string): AuctionSalt;
|
|
10
|
+
build(): string;
|
|
11
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuctionSalt = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const assert_1 = tslib_1.__importDefault(require("assert"));
|
|
6
|
+
const utils_1 = require("../utils");
|
|
7
|
+
const crypto_1 = require("crypto");
|
|
8
|
+
const parser_1 = require("./parser");
|
|
9
|
+
class AuctionSalt {
|
|
10
|
+
constructor(auction) {
|
|
11
|
+
if (auction.salt && parser_1.SALT_MASK.lt((0, utils_1.toBN)(auction.salt))) {
|
|
12
|
+
throw new Error('salt should be less 18 bytes');
|
|
13
|
+
}
|
|
14
|
+
this.salt = auction.salt || (0, crypto_1.randomInt)(10000).toString();
|
|
15
|
+
this.auctionStartTime = auction.auctionStartTime;
|
|
16
|
+
this.initialRateBump = auction.initialRateBump;
|
|
17
|
+
this.duration = auction.duration;
|
|
18
|
+
this.bankFee = auction.bankFee;
|
|
19
|
+
}
|
|
20
|
+
static decode(salt) {
|
|
21
|
+
return new AuctionSalt({
|
|
22
|
+
salt: (0, parser_1.getSalt)(salt).toString(),
|
|
23
|
+
auctionStartTime: (0, parser_1.getStartTime)(salt).toNumber(),
|
|
24
|
+
duration: (0, parser_1.getDuration)(salt).toNumber(),
|
|
25
|
+
bankFee: (0, parser_1.getFee)(salt).toString(),
|
|
26
|
+
initialRateBump: (0, parser_1.getInitialRateBump)(salt).toNumber()
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
build() {
|
|
30
|
+
const res = (0, utils_1.toBN)(this.auctionStartTime).toString('hex').padStart(8, '0') +
|
|
31
|
+
(0, utils_1.toBN)(this.duration).toString('hex').padStart(6, '0') +
|
|
32
|
+
(0, utils_1.toBN)(this.initialRateBump).toString('hex').padStart(6, '0') +
|
|
33
|
+
(0, utils_1.toBN)(this.bankFee).toString('hex').padStart(8, '0') +
|
|
34
|
+
(0, utils_1.toBN)(this.salt).toString('hex').padStart(36, '0');
|
|
35
|
+
(0, assert_1.default)(res.length === 64, 'Some inputs were out of allowed ranges');
|
|
36
|
+
return (0, utils_1.toBN)('0x' + res).toString();
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.AuctionSalt =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K;QACD,MAAM,GAAG,GACL,IAAA,YAAI,EAAC,IAAI,CAAC,gBAAgB,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;YAC5D,IAAA,YAAI,EAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;YACpD,IAAA,YAAI,EAAC,IAAI,CAAC,eAAe,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;YAC3D,IAAA,YAAI,EAAC,IAAI,CAAC,OAAO,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC;YACnD,IAAA,YAAI,EAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;QAErD,IAAA,gBAAM,EAAC,GAAG,CAAC,MAAM,KAAK,EAAE,EAAE,wCAAwC,CAAC,CAAA;QAEnE,OAAO,IAAA,YAAI,EAAC,IAAI,GAAG,GAAG,CAAC,CAAC,QAAQ,EAAE,CAAA;IACtC,CAAC;CACJ;AA7CD,kCA6CC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
const tslib_1 = require("tslib");
|
|
4
|
+
const auction_salt_1 = require("./auction-salt");
|
|
5
|
+
const crypto_1 = tslib_1.__importDefault(require("crypto"));
|
|
6
|
+
describe('Auction Salt', () => {
|
|
7
|
+
jest.spyOn(crypto_1.default, 'randomInt').mockImplementation(() => 1000);
|
|
8
|
+
it('should create salt', () => {
|
|
9
|
+
const salt = new auction_salt_1.AuctionSalt({
|
|
10
|
+
duration: 180,
|
|
11
|
+
auctionStartTime: 1673548149,
|
|
12
|
+
initialRateBump: 50000,
|
|
13
|
+
bankFee: '0'
|
|
14
|
+
});
|
|
15
|
+
expect(salt.build()).toBe('45118768841948961586167738353692277076075522015101619148498725069326976549864');
|
|
16
|
+
});
|
|
17
|
+
it('should create salt with non zero bank fee', () => {
|
|
18
|
+
const salt = new auction_salt_1.AuctionSalt({
|
|
19
|
+
duration: 180,
|
|
20
|
+
auctionStartTime: 1673548149,
|
|
21
|
+
initialRateBump: 50000,
|
|
22
|
+
bankFee: '123123123'
|
|
23
|
+
});
|
|
24
|
+
expect(salt.build()).toBe('45118768841948961586167741099429671146420854337050268925130474518618971309032');
|
|
25
|
+
});
|
|
26
|
+
it('should fail to create salt due to wrong auction start time', () => {
|
|
27
|
+
const salt = new auction_salt_1.AuctionSalt({
|
|
28
|
+
duration: 180,
|
|
29
|
+
auctionStartTime: 1673548149 * 1000,
|
|
30
|
+
initialRateBump: 50000,
|
|
31
|
+
bankFee: '123123123'
|
|
32
|
+
});
|
|
33
|
+
expect(() => salt.build()).toThrow('Some inputs were out of allowed ranges');
|
|
34
|
+
});
|
|
35
|
+
it('should fail to create salt due to initial rate bump out of range', () => {
|
|
36
|
+
const salt = new auction_salt_1.AuctionSalt({
|
|
37
|
+
duration: 180,
|
|
38
|
+
auctionStartTime: 1673548149,
|
|
39
|
+
initialRateBump: 16777215 + 1,
|
|
40
|
+
bankFee: '123123123'
|
|
41
|
+
});
|
|
42
|
+
expect(() => salt.build()).toThrow('Some inputs were out of allowed ranges');
|
|
43
|
+
});
|
|
44
|
+
it('should fail to create salt due to wrong duration', () => {
|
|
45
|
+
const salt = new auction_salt_1.AuctionSalt({
|
|
46
|
+
duration: 16777215 + 1,
|
|
47
|
+
auctionStartTime: 1673548149,
|
|
48
|
+
initialRateBump: 50000,
|
|
49
|
+
bankFee: '123123123'
|
|
50
|
+
});
|
|
51
|
+
expect(() => salt.build()).toThrow('Some inputs were out of allowed ranges');
|
|
52
|
+
});
|
|
53
|
+
it('should decode salt', () => {
|
|
54
|
+
const encodedSalt = '45118768841948961586167741099429671146420854337050268925130474518618971309032';
|
|
55
|
+
const salt = auction_salt_1.AuctionSalt.decode(encodedSalt);
|
|
56
|
+
expect(salt.build()).toBe(encodedSalt);
|
|
57
|
+
});
|
|
58
|
+
});
|
|
59
|
+
//# sourceMappingURL=auction.salt.spec.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"auction.salt.spec.js","sourceRoot":"","sources":["../../src/auction-salt/auction.salt.spec.ts"],"names":[],"mappings":";;;AAAA,iDAA0C;AAC1C,4DAA2B;AAE3B,QAAQ,CAAC,cAAc,EAAE,GAAG,EAAE;IAC1B,IAAI,CAAC,KAAK,CAAC,gBAAM,EAAE,WAAW,CAAC,CAAC,kBAAkB,CAAC,GAAG,EAAE,CAAC,IAAI,CAAC,CAAA;IAE9D,EAAE,CAAC,oBAAoB,EAAE,GAAG,EAAE;QAC1B,MAAM,IAAI,GAAG,IAAI,0BAAW,CAAC;YACzB,QAAQ,EAAE,GAAG;YACb,gBAAgB,EAAE,UAAU;YAC5B,eAAe,EAAE,KAAK;YACtB,OAAO,EAAE,GAAG;SACf,CAAC,CAAA;QAEF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CACrB,+EAA+E,CAClF,CAAA;IACL,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,2CAA2C,EAAE,GAAG,EAAE;QACjD,MAAM,IAAI,GAAG,IAAI,0BAAW,CAAC;YACzB,QAAQ,EAAE,GAAG;YACb,gBAAgB,EAAE,UAAU;YAC5B,eAAe,EAAE,KAAK;YACtB,OAAO,EAAE,WAAW;SACvB,CAAC,CAAA;QAEF,MAAM,CAAC,IAAI,CAAC,KAAK,EAAE,CAAC,CAAC,IAAI,CACrB,+EAA+E,CAClF,CAAA;IACL,CAAC,CAAC,CAAA;IAEF,EAAE,CAAC,4DAA4D,EAAE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