@huma-finance/widgets 0.0.47-beta.181 → 0.0.47-beta.185
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/cjs/index.cjs +45 -83
- package/dist/cjs/index.cjs.map +1 -1
- package/dist/index.js +46 -84
- package/dist/index.js.map +1 -1
- package/package.json +4 -4
- package/src/components/StreamFactoring/borrow/1-Evaluation.tsx +4 -3
- package/src/components/StreamFactoring/borrow/2-ChooseAmount.tsx +14 -6
- package/src/components/StreamFactoring/borrow/3-ConfirmTransfer.tsx +3 -8
- package/src/components/StreamFactoring/borrow/5-Permit.tsx +2 -35
- package/src/components/StreamFactoring/borrow/index.tsx +2 -3
- package/src/components/SuperfluidFactoring/SuperfluidFactoredList.tsx +2 -2
- package/src/components/SuperfluidFactoring/SuperfluidUpcomingList.tsx +3 -1
- package/src/index.tsx +1 -1
package/dist/cjs/index.cjs
CHANGED
|
@@ -6,8 +6,8 @@ var providers = require('@ethersproject/providers');
|
|
|
6
6
|
var shared = require('@huma-finance/shared');
|
|
7
7
|
var material = require('@mui/material');
|
|
8
8
|
var jotai = require('jotai');
|
|
9
|
-
var React = require('react');
|
|
10
9
|
var reactRedux = require('react-redux');
|
|
10
|
+
var React = require('react');
|
|
11
11
|
var core = require('@web3-react/core');
|
|
12
12
|
var ErrorOutlineIcon = require('@mui/icons-material/ErrorOutline');
|
|
13
13
|
var utils = require('jotai/utils');
|
|
@@ -30,6 +30,7 @@ var TableCell = require('@mui/material/TableCell');
|
|
|
30
30
|
var TableContainer = require('@mui/material/TableContainer');
|
|
31
31
|
var TableHead = require('@mui/material/TableHead');
|
|
32
32
|
var TableRow = require('@mui/material/TableRow');
|
|
33
|
+
var address = require('@ethersproject/address');
|
|
33
34
|
|
|
34
35
|
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
35
36
|
|
|
@@ -5242,7 +5243,7 @@ function Evaluation(_ref) {
|
|
|
5242
5243
|
receivable: {
|
|
5243
5244
|
address: poolInfo.assetAddress
|
|
5244
5245
|
},
|
|
5245
|
-
payerWalletAddress: payerAddress,
|
|
5246
|
+
payerWalletAddress: address.getAddress(payerAddress),
|
|
5246
5247
|
superToken: superToken
|
|
5247
5248
|
}
|
|
5248
5249
|
}, WIDGET_STEP.ChooseAmount);
|
|
@@ -5258,6 +5259,7 @@ function Evaluation(_ref) {
|
|
|
5258
5259
|
}
|
|
5259
5260
|
|
|
5260
5261
|
function ChooseAmount(_ref) {
|
|
5262
|
+
var _poolInfo$extra, _poolInfo$extra$super;
|
|
5261
5263
|
var poolInfo = _ref.poolInfo,
|
|
5262
5264
|
currentFlowRate = _ref.currentFlowRate;
|
|
5263
5265
|
var dispatch = useAppDispatch();
|
|
@@ -5274,9 +5276,11 @@ function ChooseAmount(_ref) {
|
|
|
5274
5276
|
currentAmount = _useState4[0],
|
|
5275
5277
|
setCurrentAmount = _useState4[1];
|
|
5276
5278
|
var borrowPeriodInSeconds = approval.terms.intervalInDays * 24 * 60 * 60;
|
|
5279
|
+
var superTokenDecimals = (_poolInfo$extra = poolInfo.extra) === null || _poolInfo$extra === void 0 ? void 0 : (_poolInfo$extra$super = _poolInfo$extra.superToken) === null || _poolInfo$extra$super === void 0 ? void 0 : _poolInfo$extra$super.decimals;
|
|
5280
|
+
var underlyingTokenDecimals = poolInfo.poolUnderlyingToken.decimals;
|
|
5277
5281
|
var getBorrowFlowrateAndAmount = React.useCallback(function (borrowAmount) {
|
|
5278
5282
|
var currentFlowRateBN = shared.toBigNumber(currentFlowRate);
|
|
5279
|
-
var borrowAmountBN = shared.toBigNumber(shared.upScale(borrowAmount,
|
|
5283
|
+
var borrowAmountBN = shared.toBigNumber(shared.upScale(borrowAmount, superTokenDecimals));
|
|
5280
5284
|
var totalAmountInBorrowPeriod = currentFlowRateBN.mul(borrowPeriodInSeconds);
|
|
5281
5285
|
var borrowFlowrate = borrowAmountBN.mul(currentFlowRateBN).div(totalAmountInBorrowPeriod)
|
|
5282
5286
|
// To ensure enough flowRate due to round down when convert to string
|
|
@@ -5292,13 +5296,14 @@ function ChooseAmount(_ref) {
|
|
|
5292
5296
|
|
|
5293
5297
|
// As borrowFlowrate adds 1, need to calculate the new accurate borrow amount
|
|
5294
5298
|
var newBorrowAmountBN = borrowFlowrate.mul(totalAmountInBorrowPeriod).div(currentFlowRateBN);
|
|
5295
|
-
var newBorrowAmount = shared.downScale(newBorrowAmountBN,
|
|
5299
|
+
var newBorrowAmount = shared.downScale(newBorrowAmountBN, superTokenDecimals);
|
|
5300
|
+
var newBorrowAmountUnderlyingTokenBN = shared.toBigNumber(shared.upScale(newBorrowAmount, underlyingTokenDecimals));
|
|
5296
5301
|
return {
|
|
5297
5302
|
borrowFlowrate: borrowFlowrate.toString(),
|
|
5298
5303
|
borrowAmount: Number(newBorrowAmount),
|
|
5299
|
-
borrowAmountBN:
|
|
5304
|
+
borrowAmountBN: newBorrowAmountUnderlyingTokenBN
|
|
5300
5305
|
};
|
|
5301
|
-
}, [approval, borrowPeriodInSeconds, currentFlowRate]);
|
|
5306
|
+
}, [approval, borrowPeriodInSeconds, currentFlowRate, superTokenDecimals, underlyingTokenDecimals]);
|
|
5302
5307
|
var handleChangeAmount = React.useCallback(function (newAmount) {
|
|
5303
5308
|
if (approval) {
|
|
5304
5309
|
setCurrentAmount(newAmount);
|
|
@@ -5340,15 +5345,12 @@ function ChooseAmount(_ref) {
|
|
|
5340
5345
|
|
|
5341
5346
|
function ConfirmTransfer() {
|
|
5342
5347
|
var dispatch = useAppDispatch();
|
|
5343
|
-
var _useWeb3React = core.useWeb3React(),
|
|
5344
|
-
chainId = _useWeb3React.chainId;
|
|
5345
5348
|
var _useAppSelector = useAppSelector(selectWidgetState),
|
|
5346
5349
|
borrowAmount = _useAppSelector.borrowAmount,
|
|
5347
5350
|
approval = _useAppSelector.approval;
|
|
5348
5351
|
var handleAction = React.useCallback(function () {
|
|
5349
|
-
|
|
5350
|
-
|
|
5351
|
-
}, [chainId, dispatch]);
|
|
5352
|
+
dispatch(setStep(WIDGET_STEP.ApproveAllowance));
|
|
5353
|
+
}, [dispatch]);
|
|
5352
5354
|
if (shared.isEmpty(borrowAmount) || shared.isEmpty(approval)) {
|
|
5353
5355
|
return null;
|
|
5354
5356
|
}
|
|
@@ -5387,86 +5389,50 @@ function ApproveAllowance(_ref) {
|
|
|
5387
5389
|
function Permit(_ref) {
|
|
5388
5390
|
var poolInfo = _ref.poolInfo,
|
|
5389
5391
|
payerAddress = _ref.payerAddress,
|
|
5390
|
-
chainId = _ref.chainId,
|
|
5391
5392
|
borrower = _ref.borrower,
|
|
5392
5393
|
superToken = _ref.superToken;
|
|
5393
5394
|
var dispatch = reactRedux.useDispatch();
|
|
5394
|
-
var tokenAddress = poolInfo.poolUnderlyingToken.address;
|
|
5395
5395
|
var _useAppSelector = useAppSelector(selectWidgetState),
|
|
5396
5396
|
borrowAmountBNJson = _useAppSelector.borrowAmountBN,
|
|
5397
5397
|
stream = _useAppSelector.stream;
|
|
5398
5398
|
var _useERC2612Permit = shared.useERC2612Permit(),
|
|
5399
|
-
getERC2612PermitMessage = _useERC2612Permit.getERC2612PermitMessage,
|
|
5400
5399
|
getTradableStreamPermitMessage = _useERC2612Permit.getTradableStreamPermitMessage;
|
|
5401
5400
|
var borrowAmountBN = ethers.BigNumber.from(borrowAmountBNJson);
|
|
5402
|
-
var
|
|
5401
|
+
var getDrawdownCallData = /*#__PURE__*/function () {
|
|
5403
5402
|
var _ref2 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee() {
|
|
5404
|
-
var
|
|
5403
|
+
var NFTPermitResult, drawdownEncodedData, poolProcessorContract;
|
|
5405
5404
|
return regenerator.wrap(function _callee$(_context) {
|
|
5406
5405
|
while (1) switch (_context.prev = _context.next) {
|
|
5407
5406
|
case 0:
|
|
5408
5407
|
_context.next = 2;
|
|
5409
|
-
return getERC2612PermitMessage(tokenAddress, poolInfo.poolProcessor, borrowAmountBN.toString());
|
|
5410
|
-
case 2:
|
|
5411
|
-
erc2612PermitResult = _context.sent;
|
|
5412
|
-
tokenContract = new ethers.Contract(tokenAddress, shared.ERC2612_ABI);
|
|
5413
|
-
return _context.abrupt("return", tokenContract.interface.encodeFunctionData('permit', [poolInfo.poolProcessor, borrowAmountBN.toString(), erc2612PermitResult.nonce, erc2612PermitResult.deadline, erc2612PermitResult.v, erc2612PermitResult.r, erc2612PermitResult.s]));
|
|
5414
|
-
case 5:
|
|
5415
|
-
case "end":
|
|
5416
|
-
return _context.stop();
|
|
5417
|
-
}
|
|
5418
|
-
}, _callee);
|
|
5419
|
-
}));
|
|
5420
|
-
return function getApproveAllowanceCallData() {
|
|
5421
|
-
return _ref2.apply(this, arguments);
|
|
5422
|
-
};
|
|
5423
|
-
}();
|
|
5424
|
-
var getDrawdownCallData = /*#__PURE__*/function () {
|
|
5425
|
-
var _ref3 = _asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
5426
|
-
var NFTPermitResult, drawdownEncodedData, poolProcessorContract;
|
|
5427
|
-
return regenerator.wrap(function _callee2$(_context2) {
|
|
5428
|
-
while (1) switch (_context2.prev = _context2.next) {
|
|
5429
|
-
case 0:
|
|
5430
|
-
_context2.next = 2;
|
|
5431
5408
|
return getTradableStreamPermitMessage(poolInfo.assetAddress, borrower, superToken, payerAddress, poolInfo.poolProcessor, stream.borrowFlowrate, stream.durationInSeconds);
|
|
5432
5409
|
case 2:
|
|
5433
|
-
NFTPermitResult =
|
|
5410
|
+
NFTPermitResult = _context.sent;
|
|
5434
5411
|
drawdownEncodedData = ethers.ethers.utils.defaultAbiCoder.encode(['address', 'address', 'address', 'int96', 'uint256', 'uint256', 'uint8', 'bytes32', 'bytes32'], [borrower, superToken, payerAddress, stream === null || stream === void 0 ? void 0 : stream.borrowFlowrate, stream === null || stream === void 0 ? void 0 : stream.durationInSeconds, NFTPermitResult.expiry, NFTPermitResult.v, NFTPermitResult.r, NFTPermitResult.s]);
|
|
5435
5412
|
poolProcessorContract = new ethers.Contract(poolInfo.poolProcessor, shared.SuperfluidPoolProcessor_ABI);
|
|
5436
|
-
return
|
|
5413
|
+
return _context.abrupt("return", poolProcessorContract.interface.encodeFunctionData('mintAndDrawdown', [borrower, borrowAmountBN, poolInfo.assetAddress, drawdownEncodedData]));
|
|
5437
5414
|
case 6:
|
|
5438
5415
|
case "end":
|
|
5439
|
-
return
|
|
5416
|
+
return _context.stop();
|
|
5440
5417
|
}
|
|
5441
|
-
},
|
|
5418
|
+
}, _callee);
|
|
5442
5419
|
}));
|
|
5443
5420
|
return function getDrawdownCallData() {
|
|
5444
|
-
return
|
|
5421
|
+
return _ref2.apply(this, arguments);
|
|
5445
5422
|
};
|
|
5446
5423
|
}();
|
|
5447
|
-
shared.useMount( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator.mark(function
|
|
5448
|
-
var callData, addresses,
|
|
5449
|
-
return regenerator.wrap(function
|
|
5450
|
-
while (1) switch (
|
|
5424
|
+
shared.useMount( /*#__PURE__*/_asyncToGenerator( /*#__PURE__*/regenerator.mark(function _callee2() {
|
|
5425
|
+
var callData, addresses, drawdownCalldata, errorMessage;
|
|
5426
|
+
return regenerator.wrap(function _callee2$(_context2) {
|
|
5427
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
5451
5428
|
case 0:
|
|
5452
|
-
|
|
5429
|
+
_context2.prev = 0;
|
|
5453
5430
|
callData = [];
|
|
5454
|
-
addresses = [];
|
|
5455
|
-
|
|
5456
|
-
_context3.next = 9;
|
|
5457
|
-
break;
|
|
5458
|
-
}
|
|
5459
|
-
_context3.next = 6;
|
|
5460
|
-
return getApproveAllowanceCallData();
|
|
5461
|
-
case 6:
|
|
5462
|
-
approveAllowanceCallData = _context3.sent;
|
|
5463
|
-
addresses.push(tokenAddress);
|
|
5464
|
-
callData.push(approveAllowanceCallData);
|
|
5465
|
-
case 9:
|
|
5466
|
-
_context3.next = 11;
|
|
5431
|
+
addresses = [];
|
|
5432
|
+
_context2.next = 5;
|
|
5467
5433
|
return getDrawdownCallData();
|
|
5468
|
-
case
|
|
5469
|
-
drawdownCalldata =
|
|
5434
|
+
case 5:
|
|
5435
|
+
drawdownCalldata = _context2.sent;
|
|
5470
5436
|
addresses.push(poolInfo.poolProcessor);
|
|
5471
5437
|
callData.push(drawdownCalldata);
|
|
5472
5438
|
dispatch(setMultisend({
|
|
@@ -5475,24 +5441,24 @@ function Permit(_ref) {
|
|
|
5475
5441
|
}));
|
|
5476
5442
|
dispatch(setStep(WIDGET_STEP.Transfer));
|
|
5477
5443
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
5478
|
-
|
|
5444
|
+
_context2.next = 17;
|
|
5479
5445
|
break;
|
|
5480
|
-
case
|
|
5481
|
-
|
|
5482
|
-
|
|
5483
|
-
errorMessage =
|
|
5484
|
-
if (
|
|
5446
|
+
case 12:
|
|
5447
|
+
_context2.prev = 12;
|
|
5448
|
+
_context2.t0 = _context2["catch"](0);
|
|
5449
|
+
errorMessage = _context2.t0.reason || "Sign permit failed";
|
|
5450
|
+
if (_context2.t0.code === 4001 || _context2.t0.code === 'ACTION_REJECTED') {
|
|
5485
5451
|
errorMessage = 'User has rejected the permit sign';
|
|
5486
5452
|
}
|
|
5487
5453
|
dispatch(setError({
|
|
5488
5454
|
errorMessage: errorMessage,
|
|
5489
5455
|
errorReason: errorMessage
|
|
5490
5456
|
}));
|
|
5491
|
-
case
|
|
5457
|
+
case 17:
|
|
5492
5458
|
case "end":
|
|
5493
|
-
return
|
|
5459
|
+
return _context2.stop();
|
|
5494
5460
|
}
|
|
5495
|
-
},
|
|
5461
|
+
}, _callee2, null, [[0, 12]]);
|
|
5496
5462
|
})));
|
|
5497
5463
|
return jsxRuntime.jsx(LoadingModal, {
|
|
5498
5464
|
title: "Sign Token and NFT",
|
|
@@ -5545,8 +5511,7 @@ function StreamFactoringBorrow(_ref) {
|
|
|
5545
5511
|
handleSuccess = _ref.handleSuccess;
|
|
5546
5512
|
var dispatch = reactRedux.useDispatch();
|
|
5547
5513
|
var _useWeb3React = core.useWeb3React(),
|
|
5548
|
-
account = _useWeb3React.account
|
|
5549
|
-
chainId = _useWeb3React.chainId;
|
|
5514
|
+
account = _useWeb3React.account;
|
|
5550
5515
|
var poolInfo = shared.usePoolInfo(poolName, poolType);
|
|
5551
5516
|
var _useAppSelector = useAppSelector(selectWidgetState),
|
|
5552
5517
|
step = _useAppSelector.step,
|
|
@@ -5570,10 +5535,9 @@ function StreamFactoringBorrow(_ref) {
|
|
|
5570
5535
|
currentFlowRate: currentFlowRate
|
|
5571
5536
|
}), step === WIDGET_STEP.ConfirmTransfer && jsxRuntime.jsx(ConfirmTransfer, {}), step === WIDGET_STEP.ApproveAllowance && jsxRuntime.jsx(ApproveAllowance, {
|
|
5572
5537
|
poolInfo: poolInfo
|
|
5573
|
-
}), step === WIDGET_STEP.Permit && account &&
|
|
5538
|
+
}), step === WIDGET_STEP.Permit && account && jsxRuntime.jsx(Permit, {
|
|
5574
5539
|
poolInfo: poolInfo,
|
|
5575
5540
|
payerAddress: payerAddress,
|
|
5576
|
-
chainId: chainId,
|
|
5577
5541
|
borrower: account,
|
|
5578
5542
|
superToken: superToken
|
|
5579
5543
|
}), step === WIDGET_STEP.Transfer && jsxRuntime.jsx(Transfer, {
|
|
@@ -5798,9 +5762,9 @@ function SuperfluidFactoredList(_ref) {
|
|
|
5798
5762
|
var setItem = React.useCallback(function () {
|
|
5799
5763
|
var _poolInfo$extra$super, _poolInfo$extra, _poolInfo$extra$super2;
|
|
5800
5764
|
return Promise.resolve({
|
|
5801
|
-
name: (_poolInfo$extra$super = poolInfo === null || poolInfo === void 0 ? void 0 : (_poolInfo$extra = poolInfo.extra) === null || _poolInfo$extra === void 0 ? void 0 : (_poolInfo$extra$super2 = _poolInfo$extra.
|
|
5765
|
+
name: (_poolInfo$extra$super = poolInfo === null || poolInfo === void 0 ? void 0 : (_poolInfo$extra = poolInfo.extra) === null || _poolInfo$extra === void 0 ? void 0 : (_poolInfo$extra$super2 = _poolInfo$extra.superToken) === null || _poolInfo$extra$super2 === void 0 ? void 0 : _poolInfo$extra$super2.symbol) !== null && _poolInfo$extra$super !== void 0 ? _poolInfo$extra$super : ''
|
|
5802
5766
|
});
|
|
5803
|
-
}, [poolInfo === null || poolInfo === void 0 ? void 0 : (_poolInfo$extra2 = poolInfo.extra) === null || _poolInfo$extra2 === void 0 ? void 0 : _poolInfo$extra2.
|
|
5767
|
+
}, [poolInfo === null || poolInfo === void 0 ? void 0 : (_poolInfo$extra2 = poolInfo.extra) === null || _poolInfo$extra2 === void 0 ? void 0 : _poolInfo$extra2.superToken]);
|
|
5804
5768
|
return jsxRuntime.jsx(FactoredList, {
|
|
5805
5769
|
title: "Streams",
|
|
5806
5770
|
poolInfo: poolInfo,
|
|
@@ -5871,11 +5835,11 @@ var _ref2 = process.env.NODE_ENV === "production" ? {
|
|
|
5871
5835
|
} : {
|
|
5872
5836
|
name: "w5slvu-icon",
|
|
5873
5837
|
styles: "width:24px;label:icon;",
|
|
5874
|
-
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,
|
|
5838
|
+
map: "/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIlN1cGVyZmx1aWRVcGNvbWluZ0xpc3QudHN4Il0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQTZIK0IiLCJmaWxlIjoiU3VwZXJmbHVpZFVwY29taW5nTGlzdC50c3giLCJzb3VyY2VzQ29udGVudCI6WyJpbXBvcnQgeyBncWwsIHVzZVF1ZXJ5IH0gZnJvbSAnQGFwb2xsby9jbGllbnQnXG5pbXBvcnQgeyBFbW90aW9uSlNYIH0gZnJvbSAnQGVtb3Rpb24vcmVhY3QvdHlwZXMvanN4LW5hbWVzcGFjZSdcbmltcG9ydCB7XG4gIGRvd25TY2FsZSxcbiAgZ2V0V2FsbGV0QWRkcmVzc0FiYnIsXG4gIFBvb2xJbmZvVHlwZSxcbiAgdG9C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gICAgICAgICAgc3g9e3sgbWFyZ2luVG9wOiB0aGVtZS5zcGFjaW5nKDIpIH19XG4gICAgICAgICAgaHJlZj0naHR0cHM6Ly9hcHAuc3VwZXJmbHVpZC5maW5hbmNlLydcbiAgICAgICAgICB0YXJnZXQ9J19ibGFuaydcbiAgICAgICAgPlxuICAgICAgICAgIENSRUFURSBTVFJFQU1cbiAgICAgICAgPC9CdXR0b24+XG4gICAgICApfVxuICAgIDwvVXBjb21pbmdMaXN0PlxuICApXG59XG4iXX0= */",
|
|
5875
5839
|
toString: _EMOTION_STRINGIFIED_CSS_ERROR__$1
|
|
5876
5840
|
};
|
|
5877
5841
|
function SuperfluidUpcomingList(_ref) {
|
|
5878
|
-
var _poolInfo$extra
|
|
5842
|
+
var _poolInfo$extra;
|
|
5879
5843
|
var hasActiveLoan = _ref.hasActiveLoan,
|
|
5880
5844
|
poolInfo = _ref.poolInfo,
|
|
5881
5845
|
loading = _ref.loading,
|
|
@@ -5891,9 +5855,7 @@ function SuperfluidUpcomingList(_ref) {
|
|
|
5891
5855
|
var _useQuery = client.useQuery(GET_RECEIVED_STREAMS, {
|
|
5892
5856
|
variables: {
|
|
5893
5857
|
receiver: account ? account.toLowerCase() : undefined,
|
|
5894
|
-
tokenIds:
|
|
5895
|
-
return item.id;
|
|
5896
|
-
})) !== null && _poolInfo$extra$super !== void 0 ? _poolInfo$extra$super : []
|
|
5858
|
+
tokenIds: poolInfo !== null && poolInfo !== void 0 && (_poolInfo$extra = poolInfo.extra) !== null && _poolInfo$extra !== void 0 && _poolInfo$extra.superToken ? [poolInfo.extra.superToken.id] : []
|
|
5897
5859
|
}
|
|
5898
5860
|
}),
|
|
5899
5861
|
data = _useQuery.data;
|