@huma-finance/shared 0.0.35 → 0.0.37
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/abis/BaseCreditPool.json +1179 -1179
- package/dist/abis/BaseFeeManager.json +480 -480
- package/dist/abis/BasePoolConfig.json +1364 -1364
- package/dist/abis/ERC20TransferableReceivable.json +648 -648
- package/dist/abis/HDT.json +512 -512
- package/dist/abis/IConstantFlowAgreementV1.json +890 -890
- package/dist/abis/ISuperfluid.json +1122 -1122
- package/dist/abis/InvoiceNFT.json +625 -625
- package/dist/abis/Multisend.json +26 -26
- package/dist/abis/RealWorldReceivable.json +823 -823
- package/dist/abis/ReceivableFactoringPool.json +1529 -1529
- package/dist/abis/StreamFactoringPool.json +1523 -1523
- package/dist/abis/StreamFeeManager.json +522 -522
- package/dist/abis/SuperfluidPoolProcessor.json +692 -692
- package/dist/abis/TestERC20.json +358 -358
- package/dist/abis/TradableStream.json +850 -850
- package/dist/abis/Transfer.json +24 -24
- package/dist/abis/TransferNFT.json +27 -27
- package/dist/abis/erc20.json +127 -117
- package/dist/abis/erc2612.json +132 -132
- package/dist/abis/erc721.json +673 -673
- package/dist/abis/index.js +3 -3
- package/dist/abis/types/BaseCreditPool.js +1 -1
- package/dist/abis/types/BaseFeeManager.js +1 -1
- package/dist/abis/types/BasePoolConfig.js +1 -1
- package/dist/abis/types/ERC20TransferableReceivable.js +1 -1
- package/dist/abis/types/Erc20.d.ts +184 -168
- package/dist/abis/types/Erc20.js +1 -1
- package/dist/abis/types/Erc2612.js +1 -1
- package/dist/abis/types/Erc721.js +1 -1
- package/dist/abis/types/HDT.js +1 -1
- package/dist/abis/types/IConstantFlowAgreementV1.js +1 -1
- package/dist/abis/types/ISuperfluid.js +1 -1
- package/dist/abis/types/InvoiceNFT.js +1 -1
- package/dist/abis/types/Multisend.js +1 -1
- package/dist/abis/types/RealWorldReceivable.js +1 -1
- package/dist/abis/types/ReceivableFactoringPool.js +1 -1
- package/dist/abis/types/StreamFactoringPool.js +1 -1
- package/dist/abis/types/StreamFeeManager.js +1 -1
- package/dist/abis/types/SuperfluidPoolProcessor.js +1 -1
- package/dist/abis/types/TestERC20.js +1 -1
- package/dist/abis/types/TradableStream.js +1 -1
- package/dist/abis/types/Transfer.js +1 -1
- package/dist/abis/types/TransferNFT.js +1 -1
- package/dist/abis/types/common.js +1 -1
- package/dist/abis/types/factories/BaseCreditPool__factory.js +1192 -1193
- package/dist/abis/types/factories/BaseCreditPool__factory.js.map +1 -1
- package/dist/abis/types/factories/BaseFeeManager__factory.js +493 -494
- package/dist/abis/types/factories/BaseFeeManager__factory.js.map +1 -1
- package/dist/abis/types/factories/BasePoolConfig__factory.js +1377 -1378
- package/dist/abis/types/factories/BasePoolConfig__factory.js.map +1 -1
- package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js +661 -662
- package/dist/abis/types/factories/ERC20TransferableReceivable__factory.js.map +1 -1
- package/dist/abis/types/factories/Erc20__factory.d.ts +193 -175
- package/dist/abis/types/factories/Erc20__factory.js +259 -236
- package/dist/abis/types/factories/Erc20__factory.js.map +1 -1
- package/dist/abis/types/factories/Erc2612__factory.js +278 -279
- package/dist/abis/types/factories/Erc2612__factory.js.map +1 -1
- package/dist/abis/types/factories/Erc721__factory.js +686 -687
- package/dist/abis/types/factories/Erc721__factory.js.map +1 -1
- package/dist/abis/types/factories/HDT__factory.js +525 -526
- package/dist/abis/types/factories/HDT__factory.js.map +1 -1
- package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js +903 -904
- package/dist/abis/types/factories/IConstantFlowAgreementV1__factory.js.map +1 -1
- package/dist/abis/types/factories/ISuperfluid__factory.js +1135 -1136
- package/dist/abis/types/factories/ISuperfluid__factory.js.map +1 -1
- package/dist/abis/types/factories/InvoiceNFT__factory.js +638 -639
- package/dist/abis/types/factories/InvoiceNFT__factory.js.map +1 -1
- package/dist/abis/types/factories/Multisend__factory.js +39 -40
- package/dist/abis/types/factories/Multisend__factory.js.map +1 -1
- package/dist/abis/types/factories/RealWorldReceivable__factory.js +836 -837
- package/dist/abis/types/factories/RealWorldReceivable__factory.js.map +1 -1
- package/dist/abis/types/factories/ReceivableFactoringPool__factory.js +1542 -1543
- package/dist/abis/types/factories/ReceivableFactoringPool__factory.js.map +1 -1
- package/dist/abis/types/factories/StreamFactoringPool__factory.js +1536 -1537
- package/dist/abis/types/factories/StreamFactoringPool__factory.js.map +1 -1
- package/dist/abis/types/factories/StreamFeeManager__factory.js +535 -536
- package/dist/abis/types/factories/StreamFeeManager__factory.js.map +1 -1
- package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js +705 -706
- package/dist/abis/types/factories/SuperfluidPoolProcessor__factory.js.map +1 -1
- package/dist/abis/types/factories/TestERC20__factory.js +371 -372
- package/dist/abis/types/factories/TestERC20__factory.js.map +1 -1
- package/dist/abis/types/factories/TradableStream__factory.js +863 -864
- package/dist/abis/types/factories/TradableStream__factory.js.map +1 -1
- package/dist/abis/types/factories/TransferNFT__factory.js +40 -41
- package/dist/abis/types/factories/TransferNFT__factory.js.map +1 -1
- package/dist/abis/types/factories/Transfer__factory.js +37 -38
- package/dist/abis/types/factories/Transfer__factory.js.map +1 -1
- package/dist/abis/types/factories/index.js +24 -24
- package/dist/abis/types/index.js +22 -22
- package/dist/cjs/abis/erc20.json +10 -0
- package/dist/cjs/abis/types/Erc20.d.ts +17 -1
- package/dist/cjs/abis/types/factories/Erc20__factory.d.ts +18 -0
- package/dist/cjs/abis/types/factories/Erc20__factory.js +24 -0
- package/dist/cjs/abis/types/factories/Erc20__factory.js.map +1 -1
- package/dist/cjs/hooks/useCLPoolContract.d.ts +1 -0
- package/dist/cjs/hooks/usePoolContract.d.ts +1 -0
- package/dist/cjs/hooks/usePoolContract.js +3 -2
- package/dist/cjs/hooks/usePoolContract.js.map +1 -1
- package/dist/cjs/hooks/useRFPoolContract.d.ts +1 -0
- package/dist/cjs/hooks/web3/index.d.ts +1 -5
- package/dist/cjs/hooks/web3/index.js +61 -62
- package/dist/cjs/hooks/web3/index.js.map +1 -1
- package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.js +2 -0
- package/dist/cjs/hooks/web3/useJsonRpcUrlsMap.js.map +1 -1
- package/dist/cjs/utils/chain.d.ts +4 -1
- package/dist/cjs/utils/chain.js +11 -1
- package/dist/cjs/utils/chain.js.map +1 -1
- package/dist/cjs/utils/credit.js +2 -0
- package/dist/cjs/utils/credit.js.map +1 -1
- package/dist/cjs/utils/jsonRpcEndpoints.js +5 -12
- package/dist/cjs/utils/jsonRpcEndpoints.js.map +1 -1
- package/dist/cjs/utils/notifi.d.ts +1 -0
- package/dist/cjs/utils/notifi.js +6 -3
- package/dist/cjs/utils/notifi.js.map +1 -1
- package/dist/cjs/utils/number.d.ts +1 -0
- package/dist/cjs/utils/number.js +16 -3
- package/dist/cjs/utils/number.js.map +1 -1
- package/dist/cjs/utils/pool.d.ts +3 -2
- package/dist/cjs/utils/pool.js +33 -75
- package/dist/cjs/utils/pool.js.map +1 -1
- package/dist/cjs/utils/realWorldReceivable.d.ts +2 -2
- package/dist/hooks/index.js +18 -18
- package/dist/hooks/useActiveRoute.js +7 -7
- package/dist/hooks/useAsyncError.js +22 -22
- package/dist/hooks/useCLPoolContract.d.ts +28 -27
- package/dist/hooks/useContractFunction.js +54 -54
- package/dist/hooks/useERC2612Permit/ethPermit/index.js +139 -139
- package/dist/hooks/useERC2612Permit/ethPermit/lib.js +21 -21
- package/dist/hooks/useERC2612Permit/ethPermit/rpc.js +96 -96
- package/dist/hooks/useERC2612Permit/index.js +31 -31
- package/dist/hooks/useForceRefresh.js +8 -8
- package/dist/hooks/useGetSizes.js +19 -19
- package/dist/hooks/useMQ.js +14 -14
- package/dist/hooks/useMount.js +8 -8
- package/dist/hooks/useParamsSearch.js +6 -6
- package/dist/hooks/usePoolContract.d.ts +74 -73
- package/dist/hooks/usePoolContract.js +3 -2
- package/dist/hooks/usePoolContract.js.map +1 -1
- package/dist/hooks/useRFPoolContract.d.ts +23 -22
- package/dist/hooks/useRefresh.js +47 -47
- package/dist/hooks/web3/index.d.ts +11 -15
- package/dist/hooks/web3/index.js +60 -61
- package/dist/hooks/web3/index.js.map +1 -1
- package/dist/hooks/web3/useConnectors.js +24 -24
- package/dist/hooks/web3/useJsonRpcUrlsMap.js +2 -0
- package/dist/hooks/web3/useJsonRpcUrlsMap.js.map +1 -1
- package/dist/tsconfig.cjs.tsbuildinfo +1 -1
- package/dist/utils/JsonRpcConnector.js +38 -38
- package/dist/utils/WalletConnect.js +49 -50
- package/dist/utils/WalletConnect.js.map +1 -1
- package/dist/utils/chain.d.ts +4 -1
- package/dist/utils/chain.js +9 -0
- package/dist/utils/chain.js.map +1 -1
- package/dist/utils/common.js +10 -10
- package/dist/utils/const.js +2 -2
- package/dist/utils/contractError.json +73 -73
- package/dist/utils/credit.js +37 -35
- package/dist/utils/credit.js.map +1 -1
- package/dist/utils/errors.js +39 -39
- package/dist/utils/jsonRpcEndpoints.js +5 -12
- package/dist/utils/jsonRpcEndpoints.js.map +1 -1
- package/dist/utils/notifi.d.ts +1 -0
- package/dist/utils/notifi.js +4 -2
- package/dist/utils/notifi.js.map +1 -1
- package/dist/utils/number.d.ts +6 -5
- package/dist/utils/number.js +14 -2
- package/dist/utils/number.js.map +1 -1
- package/dist/utils/pool.d.ts +3 -2
- package/dist/utils/pool.js +33 -75
- package/dist/utils/pool.js.map +1 -1
- package/dist/utils/realWorldReceivable.d.ts +2 -2
- package/dist/utils/request.js +38 -38
- package/dist/utils/scientificToDecimal.js +57 -57
- package/dist/utils/string.js +1 -1
- package/dist/utils/style.js +12 -12
- package/dist/utils/time.js +50 -50
- package/dist/utils/transaction.js +87 -87
- package/dist/utils/web3.js +34 -34
- package/package.json +5 -4
|
@@ -1,39 +1,39 @@
|
|
|
1
|
-
import { Connector, } from '@web3-react/types';
|
|
2
|
-
function parseChainId(chainId) {
|
|
3
|
-
return Number.parseInt(chainId, 16);
|
|
4
|
-
}
|
|
5
|
-
export class JsonRpcConnector extends Connector {
|
|
6
|
-
constructor({ actions, provider, onError, }) {
|
|
7
|
-
super(actions, onError);
|
|
8
|
-
this.customProvider = provider
|
|
9
|
-
.on('connect', ({ chainId }) => {
|
|
10
|
-
this.actions.update({ chainId: parseChainId(chainId) });
|
|
11
|
-
})
|
|
12
|
-
.on('disconnect', (error) => {
|
|
13
|
-
var _a;
|
|
14
|
-
(_a = this.onError) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
15
|
-
this.actions.resetState();
|
|
16
|
-
})
|
|
17
|
-
.on('chainChanged', (chainId) => {
|
|
18
|
-
this.actions.update({ chainId: parseChainId(chainId) });
|
|
19
|
-
})
|
|
20
|
-
.on('accountsChanged', (accounts) => {
|
|
21
|
-
this.actions.update({ accounts });
|
|
22
|
-
});
|
|
23
|
-
}
|
|
24
|
-
async activate() {
|
|
25
|
-
this.actions.startActivation();
|
|
26
|
-
try {
|
|
27
|
-
const [{ chainId }, accounts] = await Promise.all([
|
|
28
|
-
this.customProvider.getNetwork(),
|
|
29
|
-
this.customProvider.listAccounts(),
|
|
30
|
-
]);
|
|
31
|
-
this.actions.update({ chainId, accounts });
|
|
32
|
-
}
|
|
33
|
-
catch (e) {
|
|
34
|
-
this.actions.resetState();
|
|
35
|
-
throw e;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
}
|
|
1
|
+
import { Connector, } from '@web3-react/types';
|
|
2
|
+
function parseChainId(chainId) {
|
|
3
|
+
return Number.parseInt(chainId, 16);
|
|
4
|
+
}
|
|
5
|
+
export class JsonRpcConnector extends Connector {
|
|
6
|
+
constructor({ actions, provider, onError, }) {
|
|
7
|
+
super(actions, onError);
|
|
8
|
+
this.customProvider = provider
|
|
9
|
+
.on('connect', ({ chainId }) => {
|
|
10
|
+
this.actions.update({ chainId: parseChainId(chainId) });
|
|
11
|
+
})
|
|
12
|
+
.on('disconnect', (error) => {
|
|
13
|
+
var _a;
|
|
14
|
+
(_a = this.onError) === null || _a === void 0 ? void 0 : _a.call(this, error);
|
|
15
|
+
this.actions.resetState();
|
|
16
|
+
})
|
|
17
|
+
.on('chainChanged', (chainId) => {
|
|
18
|
+
this.actions.update({ chainId: parseChainId(chainId) });
|
|
19
|
+
})
|
|
20
|
+
.on('accountsChanged', (accounts) => {
|
|
21
|
+
this.actions.update({ accounts });
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
async activate() {
|
|
25
|
+
this.actions.startActivation();
|
|
26
|
+
try {
|
|
27
|
+
const [{ chainId }, accounts] = await Promise.all([
|
|
28
|
+
this.customProvider.getNetwork(),
|
|
29
|
+
this.customProvider.listAccounts(),
|
|
30
|
+
]);
|
|
31
|
+
this.actions.update({ chainId, accounts });
|
|
32
|
+
}
|
|
33
|
+
catch (e) {
|
|
34
|
+
this.actions.resetState();
|
|
35
|
+
throw e;
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
39
|
//# sourceMappingURL=JsonRpcConnector.js.map
|
|
@@ -1,51 +1,50 @@
|
|
|
1
|
-
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import { URI_AVAILABLE, WalletConnect, } from '@web3-react/walletconnect';
|
|
3
|
-
import QRCode from 'qrcode';
|
|
4
|
-
export class WalletConnectPopup extends WalletConnect {
|
|
5
|
-
constructor({ actions, options, defaultChainId, timeout, onError, }) {
|
|
6
|
-
super({
|
|
7
|
-
actions,
|
|
8
|
-
options: Object.assign(Object.assign({}, options), { qrcode: true }),
|
|
9
|
-
defaultChainId,
|
|
10
|
-
timeout,
|
|
11
|
-
onError,
|
|
12
|
-
});
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
class WalletConnectQR extends WalletConnect {
|
|
16
|
-
constructor({ actions, options, defaultChainId, timeout, onError, }) {
|
|
17
|
-
super({
|
|
18
|
-
actions,
|
|
19
|
-
options: Object.assign(Object.assign({}, options), { qrcode: false }),
|
|
20
|
-
defaultChainId,
|
|
21
|
-
timeout,
|
|
22
|
-
onError,
|
|
23
|
-
});
|
|
24
|
-
this.events.once(URI_AVAILABLE, () => {
|
|
25
|
-
var _a;
|
|
26
|
-
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.connector.on('disconnect', () => {
|
|
27
|
-
this.deactivate();
|
|
28
|
-
});
|
|
29
|
-
});
|
|
30
|
-
this.events.on(URI_AVAILABLE, async (uri) => {
|
|
31
|
-
this.svg = undefined;
|
|
32
|
-
if (!uri)
|
|
33
|
-
return;
|
|
34
|
-
this.svg = await QRCode.toString(uri, {
|
|
35
|
-
// Leave a margin to increase contrast in dark mode.
|
|
36
|
-
margin: 1,
|
|
37
|
-
// Use 55*2=110 for the width to prevent distortion. The generated viewbox is "0 0 55 55".
|
|
38
|
-
width: 110,
|
|
39
|
-
type: 'svg',
|
|
40
|
-
});
|
|
41
|
-
this.events.emit(WalletConnectQR.SVG_AVAILABLE, this.svg);
|
|
42
|
-
});
|
|
43
|
-
}
|
|
44
|
-
deactivate() {
|
|
45
|
-
this.events.emit(URI_AVAILABLE);
|
|
46
|
-
return super.deactivate();
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
WalletConnectQR.SVG_AVAILABLE = 'svg_available';
|
|
50
|
-
export { WalletConnectQR };
|
|
1
|
+
/* eslint-disable max-classes-per-file */
|
|
2
|
+
import { URI_AVAILABLE, WalletConnect, } from '@web3-react/walletconnect';
|
|
3
|
+
import QRCode from 'qrcode';
|
|
4
|
+
export class WalletConnectPopup extends WalletConnect {
|
|
5
|
+
constructor({ actions, options, defaultChainId, timeout, onError, }) {
|
|
6
|
+
super({
|
|
7
|
+
actions,
|
|
8
|
+
options: Object.assign(Object.assign({}, options), { qrcode: true }),
|
|
9
|
+
defaultChainId,
|
|
10
|
+
timeout,
|
|
11
|
+
onError,
|
|
12
|
+
});
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
export class WalletConnectQR extends WalletConnect {
|
|
16
|
+
constructor({ actions, options, defaultChainId, timeout, onError, }) {
|
|
17
|
+
super({
|
|
18
|
+
actions,
|
|
19
|
+
options: Object.assign(Object.assign({}, options), { qrcode: false }),
|
|
20
|
+
defaultChainId,
|
|
21
|
+
timeout,
|
|
22
|
+
onError,
|
|
23
|
+
});
|
|
24
|
+
this.events.once(URI_AVAILABLE, () => {
|
|
25
|
+
var _a;
|
|
26
|
+
(_a = this.provider) === null || _a === void 0 ? void 0 : _a.connector.on('disconnect', () => {
|
|
27
|
+
this.deactivate();
|
|
28
|
+
});
|
|
29
|
+
});
|
|
30
|
+
this.events.on(URI_AVAILABLE, async (uri) => {
|
|
31
|
+
this.svg = undefined;
|
|
32
|
+
if (!uri)
|
|
33
|
+
return;
|
|
34
|
+
this.svg = await QRCode.toString(uri, {
|
|
35
|
+
// Leave a margin to increase contrast in dark mode.
|
|
36
|
+
margin: 1,
|
|
37
|
+
// Use 55*2=110 for the width to prevent distortion. The generated viewbox is "0 0 55 55".
|
|
38
|
+
width: 110,
|
|
39
|
+
type: 'svg',
|
|
40
|
+
});
|
|
41
|
+
this.events.emit(WalletConnectQR.SVG_AVAILABLE, this.svg);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
deactivate() {
|
|
45
|
+
this.events.emit(URI_AVAILABLE);
|
|
46
|
+
return super.deactivate();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
WalletConnectQR.SVG_AVAILABLE = 'svg_available';
|
|
51
50
|
//# sourceMappingURL=WalletConnect.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"WalletConnect.js","sourceRoot":"","sources":["../../src/utils/WalletConnect.ts"],"names":[],"mappings":"AAAA,yCAAyC;AAEzC,OAAO,EACL,aAAa,EACb,aAAa,GAEd,MAAM,2BAA2B,CAAA;AAClC,OAAO,MAAM,MAAM,QAAQ,CAAA;AAE3B,MAAM,OAAO,kBAAmB,SAAQ,aAAa;IACnD,YAAY,EACV,OAAO,EACP,OAAO,EACP,cAAc,EACd,OAAO,EACP,OAAO,GACsB;QAC7B,KAAK,CAAC;YACJ,O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AG;gBAAE,OAAM;YAEhB,IAAI,CAAC,GAAG,GAAG,MAAM,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE;gBACpC,oDAAoD;gBACpD,MAAM,EAAE,CAAC;gBACT,0FAA0F;gBAC1F,KAAK,EAAE,GAAG;gBACV,IAAI,EAAE,KAAK;aACZ,CAAC,CAAA;YACF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,aAAa,EAAE,IAAI,CAAC,GAAG,CAAC,CAAA;QAC3D,CAAC,CAAC,CAAA;IACJ,CAAC;IAED,UAAU;QACR,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;QAC/B,OAAO,KAAK,CAAC,UAAU,EAAE,CAAA;IAC3B,CAAC;;AA3CM,6BAAa,GAAG,eAAe,CAAA"}
|
package/dist/utils/chain.d.ts
CHANGED
|
@@ -16,7 +16,9 @@ interface ExtendedChainInformation extends BasicChainInformation {
|
|
|
16
16
|
export declare enum ChainEnum {
|
|
17
17
|
Polygon = 137,
|
|
18
18
|
Goerli = 5,
|
|
19
|
-
Mumbai = 80001
|
|
19
|
+
Mumbai = 80001,
|
|
20
|
+
Celo = 42220,
|
|
21
|
+
Alfajores = 44787
|
|
20
22
|
}
|
|
21
23
|
export declare const SupportedChainIds: ChainEnum[];
|
|
22
24
|
export declare const CHAINS: {
|
|
@@ -33,4 +35,5 @@ export declare const getWalletAddressAbbr: (address: string) => string;
|
|
|
33
35
|
*/
|
|
34
36
|
export declare function supportedChainId(chainId: number | undefined): ChainEnum | undefined;
|
|
35
37
|
export declare function findChainIdByName(chainName: string): number | undefined;
|
|
38
|
+
export declare function getExplorerUrl(chainId: number | undefined, hash: string, type: 'tx' | 'address'): string | null;
|
|
36
39
|
export {};
|
package/dist/utils/chain.js
CHANGED
|
@@ -14,6 +14,8 @@ export var ChainEnum;
|
|
|
14
14
|
ChainEnum[ChainEnum["Polygon"] = 137] = "Polygon";
|
|
15
15
|
ChainEnum[ChainEnum["Goerli"] = 5] = "Goerli";
|
|
16
16
|
ChainEnum[ChainEnum["Mumbai"] = 80001] = "Mumbai";
|
|
17
|
+
ChainEnum[ChainEnum["Celo"] = 42220] = "Celo";
|
|
18
|
+
ChainEnum[ChainEnum["Alfajores"] = 44787] = "Alfajores";
|
|
17
19
|
})(ChainEnum || (ChainEnum = {}));
|
|
18
20
|
export const SupportedChainIds = [
|
|
19
21
|
ChainEnum.Polygon,
|
|
@@ -107,4 +109,11 @@ export function findChainIdByName(chainName) {
|
|
|
107
109
|
const chainId = Object.keys(CHAINS).find((key) => CHAINS[Number(key)].name === chainName);
|
|
108
110
|
return chainId ? Number(chainId) : undefined;
|
|
109
111
|
}
|
|
112
|
+
export function getExplorerUrl(chainId, hash, type) {
|
|
113
|
+
const chain = chainId ? CHAINS[chainId] : null;
|
|
114
|
+
if (!chain) {
|
|
115
|
+
return null;
|
|
116
|
+
}
|
|
117
|
+
return `${chain.explorer}/${type}/${hash}`;
|
|
118
|
+
}
|
|
110
119
|
//# sourceMappingURL=chain.js.map
|
package/dist/utils/chain.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/utils/chain.ts"],"names":[],"mappings":"AAEA,MAAM,GAAG,GAAgD;IACvD,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,EAAE;CACb,CAAA;AAED,MAAM,KAAK,GAAgD;IACzD,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,OAAO;IACf,QAAQ,EAAE,EAAE;CACb,CAAA;AAkBD,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"chain.js","sourceRoot":"","sources":["../../src/utils/chain.ts"],"names":[],"mappings":"AAEA,MAAM,GAAG,GAAgD;IACvD,IAAI,EAAE,OAAO;IACb,MAAM,EAAE,KAAK;IACb,QAAQ,EAAE,EAAE;CACb,CAAA;AAED,MAAM,KAAK,GAAgD;IACzD,IAAI,EAAE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AAM,CAAC,EAAE,CAAA;AACxE,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,UAAU,gBAAgB,CAC9B,OAA2B;IAE3B,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,OAAO,IAAI,SAAS,EAAE;QACvD,OAAO,OAAO,CAAA;KACf;IACD,IAAI,OAAO,OAAO,KAAK,QAAQ,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,SAAS,EAAE;QAC/D,OAAO,MAAM,CAAC,OAAO,CAAC,CAAA;KACvB;IACD,OAAO,SAAS,CAAA;AAClB,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,SAAiB;IACjD,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CACtC,CAAC,GAAG,EAAE,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAChD,CAAA;IACD,OAAO,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,SAAS,CAAA;AAC9C,CAAC;AAED,MAAM,UAAU,cAAc,CAC5B,OAA2B,EAC3B,IAAY,EACZ,IAAsB;IAEtB,MAAM,KAAK,GAAG,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IAE9C,IAAI,CAAC,KAAK,EAAE;QACV,OAAO,IAAI,CAAA;KACZ;IAED,OAAO,GAAG,KAAK,CAAC,QAAQ,IAAI,IAAI,IAAI,IAAI,EAAE,CAAA;AAC5C,CAAC"}
|
package/dist/utils/common.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
-
export const isEmpty = (value) => value === undefined || value === null;
|
|
3
|
-
export const openInNewTab = (url) => {
|
|
4
|
-
// @ts-ignore
|
|
5
|
-
window.open(url, '_blank').focus();
|
|
6
|
-
};
|
|
7
|
-
export const sleep = (ms) =>
|
|
8
|
-
// eslint-disable-next-line no-promise-executor-return
|
|
9
|
-
new Promise((resolve) => setTimeout(resolve, ms));
|
|
10
|
-
export const isIframe = () => window !== window.parent;
|
|
1
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
2
|
+
export const isEmpty = (value) => value === undefined || value === null;
|
|
3
|
+
export const openInNewTab = (url) => {
|
|
4
|
+
// @ts-ignore
|
|
5
|
+
window.open(url, '_blank').focus();
|
|
6
|
+
};
|
|
7
|
+
export const sleep = (ms) =>
|
|
8
|
+
// eslint-disable-next-line no-promise-executor-return
|
|
9
|
+
new Promise((resolve) => setTimeout(resolve, ms));
|
|
10
|
+
export const isIframe = () => window !== window.parent;
|
|
11
11
|
//# sourceMappingURL=common.js.map
|
package/dist/utils/const.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export const EARejectReason = 'Your wallet does not meet qualifications';
|
|
2
|
-
export const EARejectMessage = 'Based on your wallet transaction history your application was not approved.';
|
|
1
|
+
export const EARejectReason = 'Your wallet does not meet qualifications';
|
|
2
|
+
export const EARejectMessage = 'Based on your wallet transaction history your application was not approved.';
|
|
3
3
|
//# sourceMappingURL=const.js.map
|
|
@@ -1,73 +1,73 @@
|
|
|
1
|
-
{
|
|
2
|
-
"sameValue()": "0x0811ff09",
|
|
3
|
-
"zeroAddressProvided()": "0x5ff75ab0",
|
|
4
|
-
"zeroAmountProvided()": "0x71799f2a",
|
|
5
|
-
"amountTooLow()": "0x5b05bfbf",
|
|
6
|
-
"invalidBasisPointHigherThan10000()": "0x07982d85",
|
|
7
|
-
"withdrawnAmountHigherThanBalance()": "0x477c0ab2",
|
|
8
|
-
"permissionDeniedNotAdmin()": "0xf2c5b6a7",
|
|
9
|
-
"permissionDeniedNotLender()": "0x68299b20",
|
|
10
|
-
"evaluationAgentServiceAccountRequired()": "0x9b3b1ed6",
|
|
11
|
-
"paymentDetectionServiceAccountRequired()": "0x731b978f",
|
|
12
|
-
"notPoolOwner()": "0xd39208c9",
|
|
13
|
-
"notProtocolOwner()": "0x97924c20",
|
|
14
|
-
"notEvaluationAgent()": "0x66f7b8b7",
|
|
15
|
-
"notPauser()": "0xdcdea7c8",
|
|
16
|
-
"notPool()": "0x26d29bbf",
|
|
17
|
-
"defaultGracePeriodLessThanMinAllowed()": "0xa733ff9c",
|
|
18
|
-
"treasuryFeeHighThanUpperLimit()": "0x39cda0d1",
|
|
19
|
-
"alreadyAPauser()": "0x9f694c22",
|
|
20
|
-
"alreadyPoolAdmin()": "0x7bb356e2",
|
|
21
|
-
"minPrincipalPaymentRateSettingTooHigh()": "0xc11fc042",
|
|
22
|
-
"proposedEADoesNotOwnProvidedEANFT()": "0x75b0da3b",
|
|
23
|
-
"underlyingTokenNotApprovedForHumaProtocol()": "0xce179d6d",
|
|
24
|
-
"poolOwnerNotEnoughLiquidity()": "0xe95282e2",
|
|
25
|
-
"evaluationAgentNotEnoughLiquidity()": "0x67e26217",
|
|
26
|
-
"protocolIsPaused()": "0x8f6fa2d4",
|
|
27
|
-
"poolIsNotOn()": "0x69b355df",
|
|
28
|
-
"creditExpiredDueToFirstDrawdownTooLate()": "0x9fac7390",
|
|
29
|
-
"creditExpiredDueToMaturity()": "0xa52f3c3f",
|
|
30
|
-
"creditLineNotInGoodStandingState()": "0x96e79474",
|
|
31
|
-
"creditLineNotInStateForMakingPayment()": "0xf023e48b",
|
|
32
|
-
"creditLineNotInStateForDrawdown()": "0x4ff95a6d",
|
|
33
|
-
"creditLineExceeded()": "0xef7d66ff",
|
|
34
|
-
"creditLineAlreadyExists()": "0x6c5805f2",
|
|
35
|
-
"creditLineGreatThanUpperLimit()": "0xd8c27d2f",
|
|
36
|
-
"greaterThanMaxCreditLine()": "0x8a754ae8",
|
|
37
|
-
"requestedCreditWithZeroDuration()": "0xb16dd34d",
|
|
38
|
-
"onlyBorrowerOrEACanReduceCreditLine()": "0xd61dbe31",
|
|
39
|
-
"exceededPoolLiquidityCap()": "0x5642ebd4",
|
|
40
|
-
"receivableAssetMismatch()": "0x41dbeec1",
|
|
41
|
-
"unsupportedReceivableAsset()": "0xe60c383e",
|
|
42
|
-
"receivableAssetParamMismatch()": "0x1400a0b4",
|
|
43
|
-
"insufficientReceivableAmount()": "0xf7f34854",
|
|
44
|
-
"borrowingAmountLessThanPlatformFees()": "0x97fde118",
|
|
45
|
-
"withdrawTooSoon()": "0x67982472",
|
|
46
|
-
"paymentAlreadyProcessed()": "0xfd6754cf",
|
|
47
|
-
"defaultTriggeredTooEarly()": "0x7872424e",
|
|
48
|
-
"defaultHasAlreadyBeenTriggered()": "0xeb8d2ccc",
|
|
49
|
-
"notOperator()": "0xf67113fe",
|
|
50
|
-
"notPoolOwnerTreasury()": "0x325bf3c2",
|
|
51
|
-
"notPoolOwnerOrEA()": "0xd6ed9384",
|
|
52
|
-
"alreadyAnOperator()": "0x75cea0fc",
|
|
53
|
-
"poolOperatorRequired()": "0xdc2dc6d0",
|
|
54
|
-
"drawdownFunctionUsedInsteadOfDrawdownWithReceivable()": "0x7e737537",
|
|
55
|
-
"notNFTOwner()": "0x091a5762",
|
|
56
|
-
"creditLineNotInApprovedState()": "0xfc91a989",
|
|
57
|
-
"notPoolOwnerTreasuryOrEA()": "0xc74cb44c",
|
|
58
|
-
"paymentIdNotUnderReview()": "0xd1696aaa",
|
|
59
|
-
"creditLineTooHigh()": "0x552b8377",
|
|
60
|
-
"creditLineOutstanding()": "0xc64e338c",
|
|
61
|
-
"allowanceTooLow()": "0xcd8ef369",
|
|
62
|
-
"durationTooLong()": "0xf1dd53a8",
|
|
63
|
-
"invalidFlowrate()": "0xd06a9328",
|
|
64
|
-
"settlementTooSoon()": "0x0453e75e",
|
|
65
|
-
"onlySuperfluid()": "0x3f9cd1c2",
|
|
66
|
-
"borrowerMismatch()": "0x27d3e640",
|
|
67
|
-
"notProcessor()": "0x90409ca1",
|
|
68
|
-
"receivableIdMismatch()": "0x97be2b67",
|
|
69
|
-
"flowKeyMismatch()": "0x29d5a5f3",
|
|
70
|
-
"flowIsNotTerminated()": "0xe9c5922f",
|
|
71
|
-
"invalidSuperfluidCallback()": "0xd2747f83",
|
|
72
|
-
"invalidSuperfluidAction()": "0x2f2cd9e9"
|
|
73
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"sameValue()": "0x0811ff09",
|
|
3
|
+
"zeroAddressProvided()": "0x5ff75ab0",
|
|
4
|
+
"zeroAmountProvided()": "0x71799f2a",
|
|
5
|
+
"amountTooLow()": "0x5b05bfbf",
|
|
6
|
+
"invalidBasisPointHigherThan10000()": "0x07982d85",
|
|
7
|
+
"withdrawnAmountHigherThanBalance()": "0x477c0ab2",
|
|
8
|
+
"permissionDeniedNotAdmin()": "0xf2c5b6a7",
|
|
9
|
+
"permissionDeniedNotLender()": "0x68299b20",
|
|
10
|
+
"evaluationAgentServiceAccountRequired()": "0x9b3b1ed6",
|
|
11
|
+
"paymentDetectionServiceAccountRequired()": "0x731b978f",
|
|
12
|
+
"notPoolOwner()": "0xd39208c9",
|
|
13
|
+
"notProtocolOwner()": "0x97924c20",
|
|
14
|
+
"notEvaluationAgent()": "0x66f7b8b7",
|
|
15
|
+
"notPauser()": "0xdcdea7c8",
|
|
16
|
+
"notPool()": "0x26d29bbf",
|
|
17
|
+
"defaultGracePeriodLessThanMinAllowed()": "0xa733ff9c",
|
|
18
|
+
"treasuryFeeHighThanUpperLimit()": "0x39cda0d1",
|
|
19
|
+
"alreadyAPauser()": "0x9f694c22",
|
|
20
|
+
"alreadyPoolAdmin()": "0x7bb356e2",
|
|
21
|
+
"minPrincipalPaymentRateSettingTooHigh()": "0xc11fc042",
|
|
22
|
+
"proposedEADoesNotOwnProvidedEANFT()": "0x75b0da3b",
|
|
23
|
+
"underlyingTokenNotApprovedForHumaProtocol()": "0xce179d6d",
|
|
24
|
+
"poolOwnerNotEnoughLiquidity()": "0xe95282e2",
|
|
25
|
+
"evaluationAgentNotEnoughLiquidity()": "0x67e26217",
|
|
26
|
+
"protocolIsPaused()": "0x8f6fa2d4",
|
|
27
|
+
"poolIsNotOn()": "0x69b355df",
|
|
28
|
+
"creditExpiredDueToFirstDrawdownTooLate()": "0x9fac7390",
|
|
29
|
+
"creditExpiredDueToMaturity()": "0xa52f3c3f",
|
|
30
|
+
"creditLineNotInGoodStandingState()": "0x96e79474",
|
|
31
|
+
"creditLineNotInStateForMakingPayment()": "0xf023e48b",
|
|
32
|
+
"creditLineNotInStateForDrawdown()": "0x4ff95a6d",
|
|
33
|
+
"creditLineExceeded()": "0xef7d66ff",
|
|
34
|
+
"creditLineAlreadyExists()": "0x6c5805f2",
|
|
35
|
+
"creditLineGreatThanUpperLimit()": "0xd8c27d2f",
|
|
36
|
+
"greaterThanMaxCreditLine()": "0x8a754ae8",
|
|
37
|
+
"requestedCreditWithZeroDuration()": "0xb16dd34d",
|
|
38
|
+
"onlyBorrowerOrEACanReduceCreditLine()": "0xd61dbe31",
|
|
39
|
+
"exceededPoolLiquidityCap()": "0x5642ebd4",
|
|
40
|
+
"receivableAssetMismatch()": "0x41dbeec1",
|
|
41
|
+
"unsupportedReceivableAsset()": "0xe60c383e",
|
|
42
|
+
"receivableAssetParamMismatch()": "0x1400a0b4",
|
|
43
|
+
"insufficientReceivableAmount()": "0xf7f34854",
|
|
44
|
+
"borrowingAmountLessThanPlatformFees()": "0x97fde118",
|
|
45
|
+
"withdrawTooSoon()": "0x67982472",
|
|
46
|
+
"paymentAlreadyProcessed()": "0xfd6754cf",
|
|
47
|
+
"defaultTriggeredTooEarly()": "0x7872424e",
|
|
48
|
+
"defaultHasAlreadyBeenTriggered()": "0xeb8d2ccc",
|
|
49
|
+
"notOperator()": "0xf67113fe",
|
|
50
|
+
"notPoolOwnerTreasury()": "0x325bf3c2",
|
|
51
|
+
"notPoolOwnerOrEA()": "0xd6ed9384",
|
|
52
|
+
"alreadyAnOperator()": "0x75cea0fc",
|
|
53
|
+
"poolOperatorRequired()": "0xdc2dc6d0",
|
|
54
|
+
"drawdownFunctionUsedInsteadOfDrawdownWithReceivable()": "0x7e737537",
|
|
55
|
+
"notNFTOwner()": "0x091a5762",
|
|
56
|
+
"creditLineNotInApprovedState()": "0xfc91a989",
|
|
57
|
+
"notPoolOwnerTreasuryOrEA()": "0xc74cb44c",
|
|
58
|
+
"paymentIdNotUnderReview()": "0xd1696aaa",
|
|
59
|
+
"creditLineTooHigh()": "0x552b8377",
|
|
60
|
+
"creditLineOutstanding()": "0xc64e338c",
|
|
61
|
+
"allowanceTooLow()": "0xcd8ef369",
|
|
62
|
+
"durationTooLong()": "0xf1dd53a8",
|
|
63
|
+
"invalidFlowrate()": "0xd06a9328",
|
|
64
|
+
"settlementTooSoon()": "0x0453e75e",
|
|
65
|
+
"onlySuperfluid()": "0x3f9cd1c2",
|
|
66
|
+
"borrowerMismatch()": "0x27d3e640",
|
|
67
|
+
"notProcessor()": "0x90409ca1",
|
|
68
|
+
"receivableIdMismatch()": "0x97be2b67",
|
|
69
|
+
"flowKeyMismatch()": "0x29d5a5f3",
|
|
70
|
+
"flowIsNotTerminated()": "0xe9c5922f",
|
|
71
|
+
"invalidSuperfluidCallback()": "0xd2747f83",
|
|
72
|
+
"invalidSuperfluidAction()": "0x2f2cd9e9"
|
|
73
|
+
}
|
package/dist/utils/credit.js
CHANGED
|
@@ -1,36 +1,38 @@
|
|
|
1
|
-
export var CreditState;
|
|
2
|
-
(function (CreditState) {
|
|
3
|
-
CreditState[CreditState["Deleted"] = 0] = "Deleted";
|
|
4
|
-
CreditState[CreditState["Requested"] = 1] = "Requested";
|
|
5
|
-
CreditState[CreditState["Approved"] = 2] = "Approved";
|
|
6
|
-
CreditState[CreditState["GoodStanding"] = 3] = "GoodStanding";
|
|
7
|
-
CreditState[CreditState["Delayed"] = 4] = "Delayed";
|
|
8
|
-
CreditState[CreditState["Defaulted"] = 5] = "Defaulted";
|
|
9
|
-
})(CreditState || (CreditState = {}));
|
|
10
|
-
export const hasRFActiveLoan = (creditRecord, receivableInfo) => {
|
|
11
|
-
if (creditRecord === undefined || receivableInfo === undefined) {
|
|
12
|
-
return false;
|
|
13
|
-
}
|
|
14
|
-
let accountHasActiveLoan = creditRecord.state >= CreditState.GoodStanding &&
|
|
15
|
-
receivableInfo.receivableParam.gt(0);
|
|
16
|
-
if (accountHasActiveLoan && creditRecord.state === CreditState.Approved) {
|
|
17
|
-
accountHasActiveLoan = false;
|
|
18
|
-
}
|
|
19
|
-
return accountHasActiveLoan;
|
|
20
|
-
};
|
|
21
|
-
export var CreditEvent;
|
|
22
|
-
(function (CreditEvent) {
|
|
23
|
-
CreditEvent[CreditEvent["LiquidityDeposited"] = 0] = "LiquidityDeposited";
|
|
24
|
-
CreditEvent[CreditEvent["LiquidityWithdrawn"] = 1] = "LiquidityWithdrawn";
|
|
25
|
-
CreditEvent[CreditEvent["DrawdownMade"] = 2] = "DrawdownMade";
|
|
26
|
-
CreditEvent[CreditEvent["DrawdownMadeWithReceivable"] = 3] = "DrawdownMadeWithReceivable";
|
|
27
|
-
CreditEvent[CreditEvent["PaymentMade"] = 4] = "PaymentMade";
|
|
28
|
-
CreditEvent[CreditEvent["ReceivedPaymentProcessed"] = 5] = "ReceivedPaymentProcessed";
|
|
29
|
-
})(CreditEvent || (CreditEvent = {}));
|
|
30
|
-
export const CreditEventText = {
|
|
31
|
-
[String(CreditEvent.DrawdownMade)]: 'Borrow',
|
|
32
|
-
[String(CreditEvent.DrawdownMadeWithReceivable)]: 'Factoring',
|
|
33
|
-
[String(CreditEvent.PaymentMade)]: 'Pay',
|
|
34
|
-
[String(CreditEvent.ReceivedPaymentProcessed)]: 'Pay',
|
|
35
|
-
|
|
1
|
+
export var CreditState;
|
|
2
|
+
(function (CreditState) {
|
|
3
|
+
CreditState[CreditState["Deleted"] = 0] = "Deleted";
|
|
4
|
+
CreditState[CreditState["Requested"] = 1] = "Requested";
|
|
5
|
+
CreditState[CreditState["Approved"] = 2] = "Approved";
|
|
6
|
+
CreditState[CreditState["GoodStanding"] = 3] = "GoodStanding";
|
|
7
|
+
CreditState[CreditState["Delayed"] = 4] = "Delayed";
|
|
8
|
+
CreditState[CreditState["Defaulted"] = 5] = "Defaulted";
|
|
9
|
+
})(CreditState || (CreditState = {}));
|
|
10
|
+
export const hasRFActiveLoan = (creditRecord, receivableInfo) => {
|
|
11
|
+
if (creditRecord === undefined || receivableInfo === undefined) {
|
|
12
|
+
return false;
|
|
13
|
+
}
|
|
14
|
+
let accountHasActiveLoan = creditRecord.state >= CreditState.GoodStanding &&
|
|
15
|
+
receivableInfo.receivableParam.gt(0);
|
|
16
|
+
if (accountHasActiveLoan && creditRecord.state === CreditState.Approved) {
|
|
17
|
+
accountHasActiveLoan = false;
|
|
18
|
+
}
|
|
19
|
+
return accountHasActiveLoan;
|
|
20
|
+
};
|
|
21
|
+
export var CreditEvent;
|
|
22
|
+
(function (CreditEvent) {
|
|
23
|
+
CreditEvent[CreditEvent["LiquidityDeposited"] = 0] = "LiquidityDeposited";
|
|
24
|
+
CreditEvent[CreditEvent["LiquidityWithdrawn"] = 1] = "LiquidityWithdrawn";
|
|
25
|
+
CreditEvent[CreditEvent["DrawdownMade"] = 2] = "DrawdownMade";
|
|
26
|
+
CreditEvent[CreditEvent["DrawdownMadeWithReceivable"] = 3] = "DrawdownMadeWithReceivable";
|
|
27
|
+
CreditEvent[CreditEvent["PaymentMade"] = 4] = "PaymentMade";
|
|
28
|
+
CreditEvent[CreditEvent["ReceivedPaymentProcessed"] = 5] = "ReceivedPaymentProcessed";
|
|
29
|
+
})(CreditEvent || (CreditEvent = {}));
|
|
30
|
+
export const CreditEventText = {
|
|
31
|
+
[String(CreditEvent.DrawdownMade)]: 'Borrow',
|
|
32
|
+
[String(CreditEvent.DrawdownMadeWithReceivable)]: 'Factoring',
|
|
33
|
+
[String(CreditEvent.PaymentMade)]: 'Pay',
|
|
34
|
+
[String(CreditEvent.ReceivedPaymentProcessed)]: 'Pay',
|
|
35
|
+
[String(CreditEvent.LiquidityDeposited)]: 'Supply',
|
|
36
|
+
[String(CreditEvent.LiquidityWithdrawn)]: 'Withdraw',
|
|
37
|
+
};
|
|
36
38
|
//# sourceMappingURL=credit.js.map
|
package/dist/utils/credit.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credit.js","sourceRoot":"","sources":["../../src/utils/credit.ts"],"names":[],"mappings":"AAEA,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,mDAAW,CAAA;IACX,uDAAa,CAAA;IACb,qDAAY,CAAA;IACZ,6DAAgB,CAAA;IAChB,mDAAW,CAAA;IACX,uDAAa,CAAA;AACf,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAED,MAAM,CAAC,MAAM,eAAe,GAAG,CAC7B,YAA+B,EAC/B,cAAmC,EACnC,EAAE;IACF,IAAI,YAAY,KAAK,SAAS,IAAI,cAAc,KAAK,SAAS,EAAE;QAC9D,OAAO,KAAK,CAAA;KACb;IACD,IAAI,oBAAoB,GACtB,YAAY,CAAC,KAAK,IAAI,WAAW,CAAC,YAAY;QAC9C,cAAc,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC,CAAC,CAAA;IACtC,IAAI,oBAAoB,IAAI,YAAY,CAAC,KAAK,KAAK,WAAW,CAAC,QAAQ,EAAE;QACvE,oBAAoB,GAAG,KAAK,CAAA;KAC7B;IACD,OAAO,oBAAoB,CAAA;AAC7B,CAAC,CAAA;AAED,MAAM,CAAN,IAAY,WAOX;AAPD,WAAY,WAAW;IACrB,yEAAsB,CAAA;IACtB,yEAAsB,CAAA;IACtB,6DAAgB,CAAA;IAChB,yFAA8B,CAAA;IAC9B,2DAAe,CAAA;IACf,qFAA4B,CAAA;AAC9B,CAAC,EAPW,WAAW,KAAX,WAAW,QAOtB;AAED,MAAM,CAAC,MAAM,eAAe,GAAG;IAC7B,CAAC,MAAM,CAAC,WAAW,CAAC,YAAY,CAAC,CAAC,EAAE,QAAQ;IAC5C,CAAC,MAAM,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC,EAAE,WAAW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,CAAC,CAAC,EAAE,WAAW;IAC7D,CAAC,MAAM,CAAC,WAAW,CAAC,WAAW,CAAC,CAAC,EAAE,KAAK;IACxC,CAAC,MAAM,CAAC,WAAW,CAAC,wBAAwB,CAAC,CAAC,EAAE,KAAK;IACrD,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,EAAE,QAAQ;IAClD,CAAC,MAAM,CAAC,WAAW,CAAC,kBAAkB,CAAC,CAAC,EAAE,UAAU;CACrD,CAAA"}
|
package/dist/utils/errors.js
CHANGED
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
/* eslint-disable max-classes-per-file */
|
|
2
|
-
import { EARejectMessage } from './const';
|
|
3
|
-
export const DEFAULT_ERROR_HEADER = `Please refresh the page and try again.`;
|
|
4
|
-
export const DEFAULT_ERROR_ACTION = `Reload the page`;
|
|
5
|
-
export class WidgetError extends Error {
|
|
6
|
-
constructor(config) {
|
|
7
|
-
var _a, _b;
|
|
8
|
-
super(config.message);
|
|
9
|
-
this.dismissable = false;
|
|
10
|
-
this.header = (_a = config.header) !== null && _a !== void 0 ? _a : DEFAULT_ERROR_HEADER;
|
|
11
|
-
this.action = (_b = config.action) !== null && _b !== void 0 ? _b : DEFAULT_ERROR_ACTION;
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
export class IntegrationError extends WidgetError {
|
|
15
|
-
constructor(message) {
|
|
16
|
-
super({ message });
|
|
17
|
-
this.name = 'IntegrationError';
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
class ConnectionError extends WidgetError {
|
|
21
|
-
constructor(config) {
|
|
22
|
-
super(config);
|
|
23
|
-
this.name = 'ConnectionError';
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
export class MetaMaskConnectionError extends ConnectionError {
|
|
27
|
-
constructor() {
|
|
28
|
-
super({
|
|
29
|
-
header: `Wallet disconnected`,
|
|
30
|
-
action: `Reload`,
|
|
31
|
-
message: `'A Metamask error caused your wallet to disconnect. Reload the page to reconnect.'`,
|
|
32
|
-
});
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
export class EARejectionError extends Error {
|
|
36
|
-
constructor() {
|
|
37
|
-
super(EARejectMessage);
|
|
38
|
-
}
|
|
39
|
-
}
|
|
1
|
+
/* eslint-disable max-classes-per-file */
|
|
2
|
+
import { EARejectMessage } from './const';
|
|
3
|
+
export const DEFAULT_ERROR_HEADER = `Please refresh the page and try again.`;
|
|
4
|
+
export const DEFAULT_ERROR_ACTION = `Reload the page`;
|
|
5
|
+
export class WidgetError extends Error {
|
|
6
|
+
constructor(config) {
|
|
7
|
+
var _a, _b;
|
|
8
|
+
super(config.message);
|
|
9
|
+
this.dismissable = false;
|
|
10
|
+
this.header = (_a = config.header) !== null && _a !== void 0 ? _a : DEFAULT_ERROR_HEADER;
|
|
11
|
+
this.action = (_b = config.action) !== null && _b !== void 0 ? _b : DEFAULT_ERROR_ACTION;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
export class IntegrationError extends WidgetError {
|
|
15
|
+
constructor(message) {
|
|
16
|
+
super({ message });
|
|
17
|
+
this.name = 'IntegrationError';
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
class ConnectionError extends WidgetError {
|
|
21
|
+
constructor(config) {
|
|
22
|
+
super(config);
|
|
23
|
+
this.name = 'ConnectionError';
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
export class MetaMaskConnectionError extends ConnectionError {
|
|
27
|
+
constructor() {
|
|
28
|
+
super({
|
|
29
|
+
header: `Wallet disconnected`,
|
|
30
|
+
action: `Reload`,
|
|
31
|
+
message: `'A Metamask error caused your wallet to disconnect. Reload the page to reconnect.'`,
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
export class EARejectionError extends Error {
|
|
36
|
+
constructor() {
|
|
37
|
+
super(EARejectMessage);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
40
|
//# sourceMappingURL=errors.js.map
|
|
@@ -10,17 +10,10 @@ import { ChainEnum } from './chain';
|
|
|
10
10
|
* These "Safe" URLs are listed first, followed by other fallback URLs, which are taken from chainlist.org.
|
|
11
11
|
*/
|
|
12
12
|
export const JSON_RPC_FALLBACK_ENDPOINTS = {
|
|
13
|
-
[ChainEnum.Goerli]: [
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
],
|
|
17
|
-
[ChainEnum.
|
|
18
|
-
// "Safe" URLs
|
|
19
|
-
'https://rpc.ankr.com/polygon_mumbai',
|
|
20
|
-
],
|
|
21
|
-
[ChainEnum.Polygon]: [
|
|
22
|
-
// "Safe" URLs
|
|
23
|
-
'https://polygon-rpc.com/',
|
|
24
|
-
],
|
|
13
|
+
[ChainEnum.Goerli]: ['https://rpc.ankr.com/eth_goerli'],
|
|
14
|
+
[ChainEnum.Mumbai]: ['https://rpc.ankr.com/polygon_mumbai'],
|
|
15
|
+
[ChainEnum.Polygon]: ['https://polygon-rpc.com/'],
|
|
16
|
+
[ChainEnum.Alfajores]: ['https://alfajores-forno.celo-testnet.org'],
|
|
17
|
+
[ChainEnum.Celo]: ['https://rpc.ankr.com/celo'],
|
|
25
18
|
};
|
|
26
19
|
//# sourceMappingURL=jsonRpcEndpoints.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jsonRpcEndpoints.js","sourceRoot":"","sources":["../../src/utils/jsonRpcEndpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAgC;IACtE,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE
|
|
1
|
+
{"version":3,"file":"jsonRpcEndpoints.js","sourceRoot":"","sources":["../../src/utils/jsonRpcEndpoints.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAEnC;;;;;;;;;GASG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAAgC;IACtE,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,iCAAiC,CAAC;IACvD,CAAC,SAAS,CAAC,MAAM,CAAC,EAAE,CAAC,qCAAqC,CAAC;IAC3D,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE,CAAC,0BAA0B,CAAC;IACjD,CAAC,SAAS,CAAC,SAAS,CAAC,EAAE,CAAC,0CAA0C,CAAC;IACnE,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,2BAA2B,CAAC;CAChD,CAAA"}
|
package/dist/utils/notifi.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import { ChainEnum } from './chain';
|
|
2
|
+
export declare function getNotifiDappId(isDev: boolean): string;
|
|
2
3
|
export declare function getBlockchainConfigFromChain(chainEnum: ChainEnum): 'POLYGON' | 'ETHEREUM';
|
|
3
4
|
export declare function doesChainSupportNotifi(chainEnum: ChainEnum, isDev: boolean, account: string): boolean;
|