@wildcatfi/wildcat-sdk 2.0.2 → 2.0.4
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/dist/account.d.ts +12 -2
- package/dist/account.d.ts.map +1 -1
- package/dist/account.js +54 -3
- package/dist/account.js.map +1 -1
- package/dist/constants.d.ts +3 -0
- package/dist/constants.d.ts.map +1 -1
- package/dist/constants.js +7 -1
- package/dist/constants.js.map +1 -1
- package/dist/controller.d.ts.map +1 -1
- package/dist/controller.js +4 -4
- package/dist/controller.js.map +1 -1
- package/dist/gql/graphql.d.ts +7871 -0
- package/dist/gql/graphql.d.ts.map +1 -0
- package/dist/gql/graphql.js +2403 -0
- package/dist/gql/graphql.js.map +1 -0
- package/dist/hooks/index.d.ts +7 -0
- package/dist/hooks/index.d.ts.map +1 -0
- package/dist/hooks/index.js +23 -0
- package/dist/hooks/index.js.map +1 -0
- package/dist/hooks/types.d.ts +14 -0
- package/dist/hooks/types.d.ts.map +1 -0
- package/dist/hooks/types.js +3 -0
- package/dist/hooks/types.js.map +1 -0
- package/dist/hooks/useAccountsWhereLenderAuthorizedOrActive.d.ts +14 -0
- package/dist/hooks/useAccountsWhereLenderAuthorizedOrActive.d.ts.map +1 -0
- package/dist/hooks/useAccountsWhereLenderAuthorizedOrActive.js +72 -0
- package/dist/hooks/useAccountsWhereLenderAuthorizedOrActive.js.map +1 -0
- package/dist/hooks/useAllPendingWithdrawalBatchesForMarket.d.ts +7 -0
- package/dist/hooks/useAllPendingWithdrawalBatchesForMarket.d.ts.map +1 -0
- package/dist/hooks/useAllPendingWithdrawalBatchesForMarket.js +68 -0
- package/dist/hooks/useAllPendingWithdrawalBatchesForMarket.js.map +1 -0
- package/dist/hooks/useLenderWithdrawalsForMarket.d.ts +13 -0
- package/dist/hooks/useLenderWithdrawalsForMarket.d.ts.map +1 -0
- package/dist/hooks/useLenderWithdrawalsForMarket.js +84 -0
- package/dist/hooks/useLenderWithdrawalsForMarket.js.map +1 -0
- package/dist/hooks/useMarket.d.ts +10 -0
- package/dist/hooks/useMarket.d.ts.map +1 -0
- package/dist/hooks/useMarket.js +17 -0
- package/dist/hooks/useMarket.js.map +1 -0
- package/dist/hooks/useMarketsForBorrower.d.ts +10 -0
- package/dist/hooks/useMarketsForBorrower.d.ts.map +1 -0
- package/dist/hooks/useMarketsForBorrower.js +60 -0
- package/dist/hooks/useMarketsForBorrower.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/dist/market.d.ts +26 -4
- package/dist/market.d.ts.map +1 -1
- package/dist/market.js +42 -9
- package/dist/market.js.map +1 -1
- package/dist/token.d.ts +3 -0
- package/dist/token.d.ts.map +1 -1
- package/dist/token.js +6 -0
- package/dist/token.js.map +1 -1
- package/dist/typechain/WildcatMarketController.d.ts +97 -19
- package/dist/typechain/WildcatMarketController.d.ts.map +1 -1
- package/dist/typechain/WildcatMarketControllerFactory.d.ts +11 -15
- package/dist/typechain/WildcatMarketControllerFactory.d.ts.map +1 -1
- package/dist/typechain/factories/WildcatMarketControllerFactory__factory.d.ts +6 -16
- package/dist/typechain/factories/WildcatMarketControllerFactory__factory.d.ts.map +1 -1
- package/dist/typechain/factories/WildcatMarketControllerFactory__factory.js +6 -18
- package/dist/typechain/factories/WildcatMarketControllerFactory__factory.js.map +1 -1
- package/dist/typechain/factories/WildcatMarketController__factory.d.ts +108 -6
- package/dist/typechain/factories/WildcatMarketController__factory.d.ts.map +1 -1
- package/dist/typechain/factories/WildcatMarketController__factory.js +132 -6
- package/dist/typechain/factories/WildcatMarketController__factory.js.map +1 -1
- package/dist/utils/logger.d.ts +10 -0
- package/dist/utils/logger.d.ts.map +1 -0
- package/dist/utils/logger.js +34 -0
- package/dist/utils/logger.js.map +1 -0
- package/dist/utils/math.d.ts +1 -0
- package/dist/utils/math.d.ts.map +1 -1
- package/dist/utils/math.js +10 -1
- package/dist/utils/math.js.map +1 -1
- package/dist/withdrawal-batch.d.ts +14 -2
- package/dist/withdrawal-batch.d.ts.map +1 -1
- package/dist/withdrawal-batch.js +72 -3
- package/dist/withdrawal-batch.js.map +1 -1
- package/dist/withdrawal-status.d.ts +9 -32
- package/dist/withdrawal-status.d.ts.map +1 -1
- package/dist/withdrawal-status.js +11 -139
- package/dist/withdrawal-status.js.map +1 -1
- package/package.json +26 -7
|
@@ -1,27 +1,25 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.LenderWithdrawalStatus = void 0;
|
|
4
|
+
const ethers_1 = require("ethers");
|
|
4
5
|
const constants_1 = require("./constants");
|
|
5
6
|
const utils_1 = require("./utils");
|
|
6
7
|
const withdrawal_batch_1 = require("./withdrawal-batch");
|
|
7
8
|
class LenderWithdrawalStatus {
|
|
8
|
-
constructor(batch, lender, scaledAmount, normalizedAmountWithdrawn, normalizedAmountOwed, availableWithdrawalAmount,
|
|
9
|
+
constructor(batch, lender, scaledAmount, normalizedAmountWithdrawn, normalizedAmountOwed, availableWithdrawalAmount, requests = [], executions = []) {
|
|
9
10
|
this.batch = batch;
|
|
10
11
|
this.lender = lender;
|
|
11
12
|
this.scaledAmount = scaledAmount;
|
|
12
13
|
this.normalizedAmountWithdrawn = normalizedAmountWithdrawn;
|
|
13
14
|
this.normalizedAmountOwed = normalizedAmountOwed;
|
|
14
15
|
this.availableWithdrawalAmount = availableWithdrawalAmount;
|
|
15
|
-
this.
|
|
16
|
-
this.
|
|
16
|
+
this.requests = requests;
|
|
17
|
+
this.executions = executions;
|
|
17
18
|
}
|
|
18
19
|
async execute() {
|
|
19
20
|
(0, utils_1.assert)(this.availableWithdrawalAmount.gt(0), "No funds available to withdraw");
|
|
20
21
|
return this.market.contract.executeWithdrawal(this.lender, this.expiry);
|
|
21
22
|
}
|
|
22
|
-
get originalAmount() {
|
|
23
|
-
return this.queueTransactions.reduce((prev, next) => prev.add(next.originalAmount), this.batch.market.underlyingToken.getAmount(0));
|
|
24
|
-
}
|
|
25
23
|
get expiry() {
|
|
26
24
|
return this.batch.expiry;
|
|
27
25
|
}
|
|
@@ -37,89 +35,12 @@ class LenderWithdrawalStatus {
|
|
|
37
35
|
this.normalizedAmountOwed = this.market.underlyingToken.getAmount(data.normalizedAmountOwed);
|
|
38
36
|
this.availableWithdrawalAmount = this.market.underlyingToken.getAmount(data.availableWithdrawalAmount);
|
|
39
37
|
}
|
|
40
|
-
static
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
const
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
}
|
|
47
|
-
const { queueTransactions, executionTransactions } = await getAllWithdrawalTransactions(market, (0, utils_1.unique)(withdrawals.map((w) => w.expiry)), (0, utils_1.unique)(withdrawals.map((w) => w.lender)));
|
|
48
|
-
for (const withdrawal of withdrawals) {
|
|
49
|
-
withdrawal.queueTransactions = queueTransactions.filter((l) => l.expiry == withdrawal.expiry && l.lender === withdrawal.lender);
|
|
50
|
-
withdrawal.executionTransactions = executionTransactions.filter((l) => l.expiry == withdrawal.expiry && l.lender === withdrawal.lender);
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
static async getAllWithdrawalsInBatch(market, expiry) {
|
|
54
|
-
const { queueTransactions, executionTransactions } = await getAllWithdrawalTransactions(market, expiry, null);
|
|
55
|
-
const uniqueLenderWithdrawalStatuses = {};
|
|
56
|
-
queueTransactions.forEach((l) => {
|
|
57
|
-
if (!uniqueLenderWithdrawalStatuses[l.lender]) {
|
|
58
|
-
uniqueLenderWithdrawalStatuses[l.lender] = {
|
|
59
|
-
queueTransactions: [],
|
|
60
|
-
executionTransactions: []
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
uniqueLenderWithdrawalStatuses[l.lender].queueTransactions.push(l);
|
|
64
|
-
});
|
|
65
|
-
executionTransactions.forEach((l) => {
|
|
66
|
-
if (!uniqueLenderWithdrawalStatuses[l.lender]) {
|
|
67
|
-
uniqueLenderWithdrawalStatuses[l.lender] = {
|
|
68
|
-
queueTransactions: [],
|
|
69
|
-
executionTransactions: []
|
|
70
|
-
};
|
|
71
|
-
}
|
|
72
|
-
uniqueLenderWithdrawalStatuses[l.lender].executionTransactions.push(l);
|
|
73
|
-
});
|
|
74
|
-
const lenders = Object.keys(uniqueLenderWithdrawalStatuses);
|
|
75
|
-
const lens = (0, constants_1.getLensContract)(market.provider);
|
|
76
|
-
const batchData = await lens.getWithdrawalBatchDataWithLendersStatus(market.address, expiry, lenders);
|
|
77
|
-
const batch = withdrawal_batch_1.WithdrawalBatch.fromWithdrawalBatchData(market, batchData.batch);
|
|
78
|
-
return batchData.statuses.map((status) => {
|
|
79
|
-
const { queueTransactions, executionTransactions } = uniqueLenderWithdrawalStatuses[status.lender];
|
|
80
|
-
const withdrawalStatus = LenderWithdrawalStatus.fromWithdrawalBatchLenderStatus(market, batch, status);
|
|
81
|
-
withdrawalStatus.queueTransactions = queueTransactions;
|
|
82
|
-
withdrawalStatus.executionTransactions = executionTransactions;
|
|
83
|
-
return withdrawalStatus;
|
|
84
|
-
});
|
|
85
|
-
}
|
|
86
|
-
static async getAllWithdrawalsForLender(market, lender) {
|
|
87
|
-
const { queueTransactions, executionTransactions } = await getAllWithdrawalTransactions(market, null, lender);
|
|
88
|
-
const logsByExpiry = {};
|
|
89
|
-
for (const log of queueTransactions) {
|
|
90
|
-
if (!logsByExpiry[log.expiry]) {
|
|
91
|
-
logsByExpiry[log.expiry] = {
|
|
92
|
-
queueTransactions: [],
|
|
93
|
-
executionTransactions: []
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
logsByExpiry[log.expiry].queueTransactions.push(log);
|
|
97
|
-
}
|
|
98
|
-
for (const log of executionTransactions) {
|
|
99
|
-
if (!logsByExpiry[log.expiry]) {
|
|
100
|
-
logsByExpiry[log.expiry] = {
|
|
101
|
-
queueTransactions: [],
|
|
102
|
-
executionTransactions: []
|
|
103
|
-
};
|
|
104
|
-
}
|
|
105
|
-
logsByExpiry[log.expiry].executionTransactions.push(log);
|
|
106
|
-
}
|
|
107
|
-
const expiries = (0, utils_1.unique)([
|
|
108
|
-
...queueTransactions.map((l) => l.expiry),
|
|
109
|
-
...executionTransactions.map((l) => l.expiry)
|
|
110
|
-
]);
|
|
111
|
-
const lens = (0, constants_1.getLensContract)(market.provider);
|
|
112
|
-
const batchData = await lens.getWithdrawalBatchesDataWithLenderStatus(market.address, expiries, lender);
|
|
113
|
-
return batchData.map((d) => {
|
|
114
|
-
const batch = LenderWithdrawalStatus.fromWithdrawalBatchDataWithLenderStatus(market, d);
|
|
115
|
-
const { queueTransactions, executionTransactions } = logsByExpiry[d.batch.expiry];
|
|
116
|
-
if (!queueTransactions) {
|
|
117
|
-
throw new Error(`Could not find queueTransactions for batch ${batch.expiry}`);
|
|
118
|
-
}
|
|
119
|
-
batch.queueTransactions = queueTransactions;
|
|
120
|
-
batch.executionTransactions = executionTransactions;
|
|
121
|
-
return batch;
|
|
122
|
-
});
|
|
38
|
+
static fromSubgraphLenderWithdrawalStatus(market, batch, status, address) {
|
|
39
|
+
const scaledAmount = ethers_1.BigNumber.from(status.scaledAmount);
|
|
40
|
+
const normalizedAmountWithdrawn = market.underlyingToken.getAmount(status.normalizedAmountWithdrawn);
|
|
41
|
+
const normalizedAmountOwed = market.underlyingToken.getAmount((0, utils_1.mulDiv)(batch.normalizedTotalAmount.raw, scaledAmount, batch.scaledTotalAmount).sub(normalizedAmountWithdrawn.raw));
|
|
42
|
+
const availableWithdrawalAmount = market.underlyingToken.getAmount((0, utils_1.mulDiv)(batch.normalizedAmountPaid.raw, scaledAmount, batch.scaledTotalAmount).sub(normalizedAmountWithdrawn.raw));
|
|
43
|
+
return new LenderWithdrawalStatus(batch, address ?? status.account.address, scaledAmount, normalizedAmountWithdrawn, normalizedAmountOwed, availableWithdrawalAmount, status.requests || undefined, status.executions || undefined);
|
|
123
44
|
}
|
|
124
45
|
static async getWithdrawalForLender(market, expiry, lender) {
|
|
125
46
|
const lens = (0, constants_1.getLensContract)(market.provider);
|
|
@@ -135,53 +56,4 @@ class LenderWithdrawalStatus {
|
|
|
135
56
|
}
|
|
136
57
|
}
|
|
137
58
|
exports.LenderWithdrawalStatus = LenderWithdrawalStatus;
|
|
138
|
-
async function getAllWithdrawalTransactions(market, _expiries, lenders) {
|
|
139
|
-
const queuedTopic = market.contract.interface.getEventTopic("WithdrawalQueued");
|
|
140
|
-
const executedTopic = market.contract.interface.getEventTopic("WithdrawalExecuted");
|
|
141
|
-
const topic0 = [queuedTopic, executedTopic];
|
|
142
|
-
const expiries = Array.isArray(_expiries) ? _expiries.map(utils_1.encodeUint) : _expiries;
|
|
143
|
-
lenders = Array.isArray(lenders) ? lenders.map(utils_1.encodeAddress) : lenders;
|
|
144
|
-
const topics = [topic0, expiries, lenders];
|
|
145
|
-
const logs = await market.contract.queryFilter({
|
|
146
|
-
address: market.address,
|
|
147
|
-
topics: topics
|
|
148
|
-
}, constants_1.DeploymentBlockNumber);
|
|
149
|
-
return logs.reduce((prev, log) => {
|
|
150
|
-
const tx = {
|
|
151
|
-
transactionHash: log.transactionHash,
|
|
152
|
-
blockNumber: log.blockNumber,
|
|
153
|
-
expiry: log.args.expiry.toNumber(),
|
|
154
|
-
lender: log.args.account,
|
|
155
|
-
market: log.address
|
|
156
|
-
};
|
|
157
|
-
if (log.topics[0] === queuedTopic) {
|
|
158
|
-
prev.queueTransactions.push({
|
|
159
|
-
...tx,
|
|
160
|
-
scaledAmount: log.args.scaledAmount,
|
|
161
|
-
originalAmount: market.underlyingToken.getAmount(log.args.normalizedAmount)
|
|
162
|
-
});
|
|
163
|
-
}
|
|
164
|
-
else {
|
|
165
|
-
prev.executionTransactions.push({
|
|
166
|
-
...tx,
|
|
167
|
-
normalizedAmountWithdrawn: market.underlyingToken.getAmount(log.args.normalizedAmount)
|
|
168
|
-
});
|
|
169
|
-
}
|
|
170
|
-
return prev;
|
|
171
|
-
}, {
|
|
172
|
-
queueTransactions: [],
|
|
173
|
-
executionTransactions: []
|
|
174
|
-
});
|
|
175
|
-
}
|
|
176
|
-
exports.getAllWithdrawalTransactions = getAllWithdrawalTransactions;
|
|
177
|
-
const toQueueWithdrawalTransaction = (underlyingToken, log) => ({
|
|
178
|
-
transactionHash: log.transactionHash,
|
|
179
|
-
blockNumber: log.blockNumber,
|
|
180
|
-
expiry: log.args.expiry.toNumber(),
|
|
181
|
-
lender: log.args.account,
|
|
182
|
-
market: log.address,
|
|
183
|
-
scaledAmount: log.args.scaledAmount,
|
|
184
|
-
originalAmount: underlyingToken.getAmount(log.args.normalizedAmount)
|
|
185
|
-
});
|
|
186
|
-
exports.toQueueWithdrawalTransaction = toQueueWithdrawalTransaction;
|
|
187
59
|
//# sourceMappingURL=withdrawal-status.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"withdrawal-status.js","sourceRoot":"","sources":["../src/withdrawal-status.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"withdrawal-status.js","sourceRoot":"","sources":["../src/withdrawal-status.ts"],"names":[],"mappings":";;;AAAA,mCAAwD;AAOxD,2CAA8C;AAC9C,mCAAyC;AACzC,yDAAkE;AASlE,MAAa,sBAAsB;IACjC,YACS,KAAsB,EACtB,MAAc,EACd,YAAuB,EACvB,yBAAsC,EACtC,oBAAiC,EACjC,yBAAsC,EACtC,WAAwC,EAAE,EAC1C,aAA4C,EAAE;QAP9C,UAAK,GAAL,KAAK,CAAiB;QACtB,WAAM,GAAN,MAAM,CAAQ;QACd,iBAAY,GAAZ,YAAY,CAAW;QACvB,8BAAyB,GAAzB,yBAAyB,CAAa;QACtC,yBAAoB,GAApB,oBAAoB,CAAa;QACjC,8BAAyB,GAAzB,yBAAyB,CAAa;QACtC,aAAQ,GAAR,QAAQ,CAAkC;QAC1C,eAAU,GAAV,UAAU,CAAoC;IACpD,CAAC;IAEJ,KAAK,CAAC,OAAO;QACX,IAAA,cAAM,EAAC,IAAI,CAAC,yBA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C,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,oBAAoB,CAAC,EAC3D,MAAM,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,CAAC,yBAAyB,CAAC,CACjE,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,uCAAuC,CAC5C,MAAc,EACd,IAAqD;QAErD,OAAO,sBAAsB,CAAC,+BAA+B,CAC3D,MAAM,EACN,kCAAe,CAAC,uBAAuB,CAAC,MAAM,EAAE,IAAI,CAAC,KAAK,CAAC,EAC3D,IAAI,CAAC,YAAY,CAClB,CAAC;IACJ,CAAC;CACF;AAxHD,wDAwHC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wildcatfi/wildcat-sdk",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.4",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist"
|
|
@@ -8,13 +8,23 @@
|
|
|
8
8
|
"main": "dist/index.js",
|
|
9
9
|
"types": "dist/index.d.ts",
|
|
10
10
|
"devDependencies": {
|
|
11
|
+
"@graphql-codegen/cli": "^5.0.0",
|
|
12
|
+
"@graphql-codegen/typescript": "^4.0.1",
|
|
13
|
+
"@graphql-codegen/typescript-operations": "^4.0.1",
|
|
14
|
+
"@graphql-codegen/typescript-react-apollo": "^4.1.0",
|
|
11
15
|
"@nomicfoundation/hardhat-chai-matchers": "^1.0.5",
|
|
12
16
|
"@nomiclabs/hardhat-ethers": "^2.2.3",
|
|
17
|
+
"@testing-library/jest-dom": "^5.17.0",
|
|
18
|
+
"@testing-library/react": "^13.4.0",
|
|
19
|
+
"@testing-library/user-event": "^13.5.0",
|
|
13
20
|
"@typechain/ethers-v5": "^10.2.1",
|
|
14
21
|
"@typechain/hardhat": "^9.1.0",
|
|
15
22
|
"@types/chai": "^4.3.5",
|
|
16
23
|
"@types/dotenv": "^8.2.0",
|
|
17
|
-
"@types/mocha": "^10.0.
|
|
24
|
+
"@types/mocha": "^10.0.4",
|
|
25
|
+
"@types/node": "^16.18.59",
|
|
26
|
+
"@types/react": "^18.2.33",
|
|
27
|
+
"@types/react-dom": "^18.2.14",
|
|
18
28
|
"@typescript-eslint/eslint-plugin": "^5.59.11",
|
|
19
29
|
"@typescript-eslint/parser": "^5.59.11",
|
|
20
30
|
"chai": "^4.3.7",
|
|
@@ -23,21 +33,30 @@
|
|
|
23
33
|
"eslint-config-prettier": "^8.8.0",
|
|
24
34
|
"eslint-plugin-prettier": "^4.2.1",
|
|
25
35
|
"hardhat": "^2.13.0",
|
|
26
|
-
"mocha": "^10.2.0",
|
|
27
36
|
"prettier": "^2.8.8",
|
|
37
|
+
"ts-morph": "^20.0.0",
|
|
28
38
|
"ts-node": "^10.9.1",
|
|
29
39
|
"typechain": "^8.1.1",
|
|
30
40
|
"typescript": "^5.0.4"
|
|
31
41
|
},
|
|
32
42
|
"dependencies": {
|
|
33
|
-
"
|
|
43
|
+
"@apollo/client": "^3.8.6",
|
|
44
|
+
"@tanstack/react-query": "^5.8.1",
|
|
45
|
+
"@types/jest": "^29.5.8",
|
|
46
|
+
"ethers": "^5.5.3",
|
|
47
|
+
"graphql": "^16.8.1",
|
|
48
|
+
"react": "^18.2.0",
|
|
49
|
+
"react-dom": "^18.2.0",
|
|
50
|
+
"react-scripts": "5.0.1"
|
|
34
51
|
},
|
|
35
52
|
"scripts": {
|
|
36
|
-
"typechain": "rm -rf typechain cache src/typechain; hardhat compile; cp -r typechain src/typechain; node ./typechain-imports.js",
|
|
37
|
-
"clean": "rm -rf dist",
|
|
38
53
|
"build": "npm run clean && tsc -p ./tsconfig.prod.json",
|
|
54
|
+
"clean": "rm -rf dist",
|
|
55
|
+
"codegen": "graphql-codegen && node ./scripts/type-cleanup.js && eslint src/gql/ --ext=ts --fix",
|
|
39
56
|
"lint": "eslint src/ test/ --ext=ts",
|
|
40
57
|
"lint:fix": "eslint src/ test/ --ext=ts --fix",
|
|
41
|
-
"prepublishOnly": "yarn build"
|
|
58
|
+
"prepublishOnly": "yarn build",
|
|
59
|
+
"test": "react-scripts test",
|
|
60
|
+
"typechain": "rm -rf typechain cache src/typechain; hardhat compile; cp -r typechain src/typechain; node ./typechain-imports.js"
|
|
42
61
|
}
|
|
43
62
|
}
|