@1inch/fusion-sdk 0.1.13 → 0.1.14-rc0
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/api/orders/types.d.ts +1 -0
- package/api/orders/types.js.map +1 -1
- package/connector/blockchain/web3-provider-connector.js +1 -10
- package/connector/blockchain/web3-provider-connector.js.map +1 -1
- package/nonce-manager/utils.js +2 -3
- package/nonce-manager/utils.js.map +1 -1
- package/package.json +8 -7
- package/settlement/encoders/settlement.encoder.js +2 -2
- package/settlement/encoders/settlement.encoder.js.map +1 -1
- package/ws-api/types.d.ts +1 -0
package/api/orders/types.d.ts
CHANGED
package/api/orders/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/orders/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../src/api/orders/types.ts"],"names":[],"mappings":";;;AA+BA,IAAY,WAUX;AAVD,WAAY,WAAW;IACnB,kCAAmB,CAAA;IACnB,gCAAiB,CAAA;IACjB,iDAAkC,CAAA;IAClC,8EAA+D,CAAA;IAC/D,kCAAmB,CAAA;IACnB,mDAAoC,CAAA;IACpC,2CAA4B,CAAA;IAC5B,sCAAuB,CAAA;IACvB,qDAAsC,CAAA;AAC1C,CAAC,EAVW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAUtB"}
|
|
@@ -6,16 +6,7 @@ class Web3ProviderConnector {
|
|
|
6
6
|
this.web3Provider = web3Provider;
|
|
7
7
|
}
|
|
8
8
|
signTypedData(walletAddress, typedData) {
|
|
9
|
-
|
|
10
|
-
methods: [
|
|
11
|
-
{
|
|
12
|
-
name: 'signTypedDataV4',
|
|
13
|
-
call: 'eth_signTypedData_v4',
|
|
14
|
-
params: 2
|
|
15
|
-
}
|
|
16
|
-
]
|
|
17
|
-
});
|
|
18
|
-
return extendedWeb3.signTypedDataV4(walletAddress, JSON.stringify(typedData));
|
|
9
|
+
return this.web3Provider.eth.signTypedData(walletAddress, typedData);
|
|
19
10
|
}
|
|
20
11
|
ethCall(contractAddress, callData) {
|
|
21
12
|
return this.web3Provider.eth.call({
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"web3-provider-connector.js","sourceRoot":"","sources":["../../../src/connector/blockchain/web3-provider-connector.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"web3-provider-connector.js","sourceRoot":"","sources":["../../../src/connector/blockchain/web3-provider-connector.ts"],"names":[],"mappings":";;;AAKA,MAAa,qBAAqB;IAC9B,YAA+B,YAAkB;QAAlB,iBAAY,GAAZ,YAAY,CAAM;IAAG,CAAC;IAErD,aAAa,CACT,aAAqB,EACrB,SAA0B;QAE1B,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,aAAa,CACtC,aAAa,EACb,SAA4B,CAC/B,CAAA;IACL,CAAC;IAED,OAAO,CAAC,eAAuB,EAAE,QAAgB;QAC7C,OAAO,IAAI,CAAC,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC;YAC9B,EAAE,EAAE,eAAe;YACnB,IAAI,EAAE,QAAQ;SACjB,CAAC,CAAA;IACN,CAAC;CACJ;AAnBD,sDAmBC"}
|
package/nonce-manager/utils.js
CHANGED
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.decodeNonce = exports.encodeNonce = void 0;
|
|
4
|
-
const
|
|
5
|
-
const web3_eth_abi_1 = tslib_1.__importDefault(require("web3-eth-abi"));
|
|
4
|
+
const web3_eth_abi_1 = require("web3-eth-abi");
|
|
6
5
|
const constants_1 = require("./constants");
|
|
7
6
|
const utils_1 = require("../utils");
|
|
8
7
|
function encodeNonce(address) {
|
|
@@ -10,7 +9,7 @@ function encodeNonce(address) {
|
|
|
10
9
|
}
|
|
11
10
|
exports.encodeNonce = encodeNonce;
|
|
12
11
|
function decodeNonce(nonceHex) {
|
|
13
|
-
return web3_eth_abi_1.
|
|
12
|
+
return (0, web3_eth_abi_1.decodeParameter)('uint256', nonceHex).toString();
|
|
14
13
|
}
|
|
15
14
|
exports.decodeNonce = decodeNonce;
|
|
16
15
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/nonce-manager/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/nonce-manager/utils.ts"],"names":[],"mappings":";;;AAAA,+CAA4C;AAC5C,2CAA0C;AAC1C,oCAA8B;AAE9B,SAAgB,WAAW,CAAC,OAAe;IACvC,OAAO,IAAA,aAAK,EAAC,GAAG,0BAAc,GAAG,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,EAAE,CAAC,CAAA;AAC9E,CAAC;AAFD,kCAEC;AACD,SAAgB,WAAW,CAAC,QAAgB;IACxC,OAAQ,IAAA,8BAAe,EAAC,SAAS,EAAE,QAAQ,CAAY,CAAC,QAAQ,EAAE,CAAA;AACtE,CAAC;AAFD,kCAEC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@1inch/fusion-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.14-rc0",
|
|
4
4
|
"description": "1inch Fusion Mode SDK",
|
|
5
5
|
"private": false,
|
|
6
6
|
"main": "index.js",
|
|
@@ -26,20 +26,21 @@
|
|
|
26
26
|
"@ethersproject/bignumber": "^5.1.1",
|
|
27
27
|
"@metamask/eth-sig-util": "^5.0.2",
|
|
28
28
|
"bn.js": "^5.2.1",
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
29
|
+
"tslib": "^2.2.0",
|
|
30
|
+
"web3": "^4.10.0",
|
|
31
|
+
"ws": "^8.12.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
34
|
"@babel/core": "^7.13.16",
|
|
35
35
|
"@babel/preset-env": "^7.13.15",
|
|
36
36
|
"@babel/preset-typescript": "^7.13.0",
|
|
37
|
-
"@types/
|
|
37
|
+
"@types/bn.js": "5.1.5",
|
|
38
|
+
"@types/jest": "29.5.12",
|
|
38
39
|
"@types/prompts": "^2.0.12",
|
|
39
40
|
"@types/ws": "^8.5.4",
|
|
40
41
|
"@typescript-eslint/eslint-plugin": "4",
|
|
41
42
|
"axios": "^1.2.3",
|
|
42
|
-
"babel-jest": "
|
|
43
|
+
"babel-jest": "29.7.0",
|
|
43
44
|
"eslint": "7",
|
|
44
45
|
"eslint-config-prettier": "^8.2.0",
|
|
45
46
|
"eslint-config-standard-with-typescript": "^20.0.0",
|
|
@@ -49,7 +50,7 @@
|
|
|
49
50
|
"eslint-plugin-promise": "4",
|
|
50
51
|
"eslint-plugin-unused-imports": "^1.1.1",
|
|
51
52
|
"husky": "^6.0.0",
|
|
52
|
-
"jest": "
|
|
53
|
+
"jest": "29.7.0",
|
|
53
54
|
"lint-staged": "^10.5.4",
|
|
54
55
|
"prettier": "^2.2.1",
|
|
55
56
|
"ts-loader": "^9.0.2",
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.buildRecursiveFillInteraction = exports.buildResolveOrdersBytes = exports.encodeSettleOrdersParam = exports.encodeSettleOrders = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const
|
|
5
|
+
const abiCoder = tslib_1.__importStar(require("web3-eth-abi"));
|
|
6
6
|
const constants_1 = require("./constants");
|
|
7
7
|
const utils_1 = require("../../utils");
|
|
8
8
|
const fill_order_encoder_1 = require("./fill-order.encoder");
|
|
@@ -24,7 +24,7 @@ function encodeSettleOrdersParam(params) {
|
|
|
24
24
|
const encodedOrder = (0, fill_order_encoder_1.encodeFillOrder)(params).substring(10);
|
|
25
25
|
const offsetLen = 64;
|
|
26
26
|
const bytesLenLen = 64;
|
|
27
|
-
const dataParam = (0, utils_1.trim0x)(
|
|
27
|
+
const dataParam = (0, utils_1.trim0x)(abiCoder.encodeParameters(['bytes'], [(0, utils_1.add0x)(encodedOrder)]));
|
|
28
28
|
const bytesLen = parseInt(dataParam.substring(offsetLen, offsetLen + bytesLenLen), 16);
|
|
29
29
|
return ('0x' +
|
|
30
30
|
dataParam.substring(offsetLen + bytesLenLen, offsetLen + bytesLenLen + bytesLen * 2));
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"settlement.encoder.js","sourceRoot":"","sources":["../../../src/settlement/encoders/settlement.encoder.ts"],"names":[],"mappings":";;;;AAAA
|
|
1
|
+
{"version":3,"file":"settlement.encoder.js","sourceRoot":"","sources":["../../../src/settlement/encoders/settlement.encoder.ts"],"names":[],"mappings":";;;;AAAA,+DAAwC;AAExC,2CAAkD;AAClD,uCAAyC;AACzC,6DAAoD;AAEpD,SAAgB,kBAAkB,CAAC,IAAY;IAC3C,IAAI,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,CAAA;IAExB,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAA;IACvB,MAAM,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;IACrC,MAAM,WAAW,GAAG,CAAC,GAAG,GAAG,CAAC,CAAC,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,EAAE,EAAE,GAAG,CAAC,CAAA;IAE5D,IAAI,GAAG,GAAG,EAAE,KAAK,CAAC,EAAE;QAChB,OAAO,kCAAsB,GAAG,MAAM,GAAG,WAAW,GAAG,IAAI,CAAA;KAC9D;IAED,OAAO,CACH,kCAAsB;QACtB,MAAM;QACN,WAAW;QACX,IAAI,CAAC,MAAM,CAAC,GAAG,GAAG,CAAC,EAAE,GAAG,CAAC,GAA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rderCreatedEvent | OrderInvalidEvent | OrderBalanceOrAllowanceChangeEvent | OrderFilledEvent | OrderFilledPartiallyEvent | OrderCancelledEvent;
|
|
11
11
|
export declare type OrderCreatedEvent = Event<'order_created', {
|
|
12
|
+
quoteId: string;
|
|
12
13
|
orderHash: string;
|
|
13
14
|
signature: string;
|
|
14
15
|
order: LimitOrderV3Struct;
|