@keplr-wallet/hooks-evm 0.13.15-rc.0
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/.eslintrc.json +14 -0
- package/build/index.d.ts +1 -0
- package/build/index.js +18 -0
- package/build/index.js.map +1 -0
- package/build/tx/amount.d.ts +27 -0
- package/build/tx/amount.js +238 -0
- package/build/tx/amount.js.map +1 -0
- package/build/tx/chain.d.ts +10 -0
- package/build/tx/chain.js +37 -0
- package/build/tx/chain.js.map +1 -0
- package/build/tx/errors.d.ts +30 -0
- package/build/tx/errors.js +84 -0
- package/build/tx/errors.js.map +1 -0
- package/build/tx/evm-fee-utils.d.ts +28 -0
- package/build/tx/evm-fee-utils.js +133 -0
- package/build/tx/evm-fee-utils.js.map +1 -0
- package/build/tx/fee.d.ts +61 -0
- package/build/tx/fee.js +523 -0
- package/build/tx/fee.js.map +1 -0
- package/build/tx/gas-simulator.d.ts +89 -0
- package/build/tx/gas-simulator.js +465 -0
- package/build/tx/gas-simulator.js.map +1 -0
- package/build/tx/gas.d.ts +12 -0
- package/build/tx/gas.js +84 -0
- package/build/tx/gas.js.map +1 -0
- package/build/tx/index.d.ts +13 -0
- package/build/tx/index.js +30 -0
- package/build/tx/index.js.map +1 -0
- package/build/tx/internal.d.ts +3 -0
- package/build/tx/internal.js +3 -0
- package/build/tx/internal.js.map +1 -0
- package/build/tx/name-service-ens.d.ts +40 -0
- package/build/tx/name-service-ens.js +189 -0
- package/build/tx/name-service-ens.js.map +1 -0
- package/build/tx/name-service.d.ts +20 -0
- package/build/tx/name-service.js +20 -0
- package/build/tx/name-service.js.map +1 -0
- package/build/tx/recipient.d.ts +35 -0
- package/build/tx/recipient.js +131 -0
- package/build/tx/recipient.js.map +1 -0
- package/build/tx/send-tx.d.ts +13 -0
- package/build/tx/send-tx.js +24 -0
- package/build/tx/send-tx.js.map +1 -0
- package/build/tx/sender.d.ts +12 -0
- package/build/tx/sender.js +73 -0
- package/build/tx/sender.js.map +1 -0
- package/build/tx/types.d.ts +102 -0
- package/build/tx/types.js +3 -0
- package/build/tx/types.js.map +1 -0
- package/build/tx/validate.d.ts +11 -0
- package/build/tx/validate.js +37 -0
- package/build/tx/validate.js.map +1 -0
- package/package.json +40 -0
- package/src/index.ts +1 -0
- package/src/tx/amount.ts +273 -0
- package/src/tx/chain.ts +31 -0
- package/src/tx/errors.ts +79 -0
- package/src/tx/evm-fee-utils.ts +217 -0
- package/src/tx/fee.ts +622 -0
- package/src/tx/gas-simulator.ts +567 -0
- package/src/tx/gas.ts +93 -0
- package/src/tx/index.ts +13 -0
- package/src/tx/internal.ts +4 -0
- package/src/tx/name-service-ens.ts +207 -0
- package/src/tx/name-service.ts +39 -0
- package/src/tx/recipient.ts +166 -0
- package/src/tx/send-tx.ts +55 -0
- package/src/tx/sender.ts +82 -0
- package/src/tx/types.ts +153 -0
- package/src/tx/validate.ts +55 -0
- package/tsconfig.check.json +90 -0
- package/tsconfig.json +12 -0
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import {
|
|
2
|
+
IAmountConfig,
|
|
3
|
+
IFeeConfig,
|
|
4
|
+
IGasConfig,
|
|
5
|
+
IGasSimulator,
|
|
6
|
+
IRecipientConfig,
|
|
7
|
+
ISenderConfig,
|
|
8
|
+
} from "./types";
|
|
9
|
+
|
|
10
|
+
// CONTRACT: Use with `observer`
|
|
11
|
+
export const useTxConfigsValidate = (configs: {
|
|
12
|
+
amountConfig?: IAmountConfig;
|
|
13
|
+
senderConfig?: ISenderConfig;
|
|
14
|
+
recipientConfig?: IRecipientConfig;
|
|
15
|
+
gasConfig?: IGasConfig;
|
|
16
|
+
feeConfig?: IFeeConfig;
|
|
17
|
+
gasSimulator?: IGasSimulator;
|
|
18
|
+
}) => {
|
|
19
|
+
const interactionBlocked = (() => {
|
|
20
|
+
const amountConfigUIProperties = configs.amountConfig?.uiProperties;
|
|
21
|
+
const senderConfigUIProperties = configs.senderConfig?.uiProperties;
|
|
22
|
+
const recipientConfigUIProperties = configs.recipientConfig?.uiProperties;
|
|
23
|
+
const gasConfigUIProperties = configs.gasConfig?.uiProperties;
|
|
24
|
+
const feeConfigUIProperties = configs.feeConfig?.uiProperties;
|
|
25
|
+
const gasSimulatorUIProperties = configs.gasSimulator?.uiProperties;
|
|
26
|
+
|
|
27
|
+
if (
|
|
28
|
+
amountConfigUIProperties?.error ||
|
|
29
|
+
senderConfigUIProperties?.error ||
|
|
30
|
+
recipientConfigUIProperties?.error ||
|
|
31
|
+
gasConfigUIProperties?.error ||
|
|
32
|
+
feeConfigUIProperties?.error ||
|
|
33
|
+
gasSimulatorUIProperties?.error
|
|
34
|
+
) {
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
if (
|
|
39
|
+
amountConfigUIProperties?.loadingState === "loading-block" ||
|
|
40
|
+
senderConfigUIProperties?.loadingState === "loading-block" ||
|
|
41
|
+
recipientConfigUIProperties?.loadingState === "loading-block" ||
|
|
42
|
+
gasConfigUIProperties?.loadingState === "loading-block" ||
|
|
43
|
+
feeConfigUIProperties?.loadingState === "loading-block" ||
|
|
44
|
+
gasSimulatorUIProperties?.loadingState === "loading-block"
|
|
45
|
+
) {
|
|
46
|
+
return true;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
return false;
|
|
50
|
+
})();
|
|
51
|
+
|
|
52
|
+
return {
|
|
53
|
+
interactionBlocked,
|
|
54
|
+
};
|
|
55
|
+
};
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "./tsconfig.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"baseUrl": ".",
|
|
5
|
+
"rootDir": "../..",
|
|
6
|
+
"noEmit": true,
|
|
7
|
+
"skipLibCheck": true,
|
|
8
|
+
"paths": {
|
|
9
|
+
"@keplr-wallet/analytics": ["../analytics/src"],
|
|
10
|
+
"@keplr-wallet/analytics/build/*": ["../analytics/src/*"],
|
|
11
|
+
"@keplr-wallet/background": ["../background/src"],
|
|
12
|
+
"@keplr-wallet/background/build/*": ["../background/src/*"],
|
|
13
|
+
"@keplr-wallet/chain-validator": ["../chain-validator/src"],
|
|
14
|
+
"@keplr-wallet/chain-validator/build/*": ["../chain-validator/src/*"],
|
|
15
|
+
"@keplr-wallet/common": ["../common/src"],
|
|
16
|
+
"@keplr-wallet/common/build/*": ["../common/src/*"],
|
|
17
|
+
"@keplr-wallet/cosmos": ["../cosmos/src"],
|
|
18
|
+
"@keplr-wallet/cosmos/build/*": ["../cosmos/src/*"],
|
|
19
|
+
"@keplr-wallet/crypto": ["../crypto/src"],
|
|
20
|
+
"@keplr-wallet/crypto/build/*": ["../crypto/src/*"],
|
|
21
|
+
"@keplr-wallet/hooks": ["../hooks/src"],
|
|
22
|
+
"@keplr-wallet/hooks/build/*": ["../hooks/src/*"],
|
|
23
|
+
"@keplr-wallet/hooks-bitcoin": ["../hooks-bitcoin/src"],
|
|
24
|
+
"@keplr-wallet/hooks-bitcoin/build/*": ["../hooks-bitcoin/src/*"],
|
|
25
|
+
"@keplr-wallet/hooks-evm": ["src"],
|
|
26
|
+
"@keplr-wallet/hooks-evm/build/*": ["src/*"],
|
|
27
|
+
"@keplr-wallet/hooks-starknet": ["../hooks-starknet/src"],
|
|
28
|
+
"@keplr-wallet/hooks-starknet/build/*": ["../hooks-starknet/src/*"],
|
|
29
|
+
"@keplr-wallet/ledger-cosmos": ["../ledger-cosmos/src"],
|
|
30
|
+
"@keplr-wallet/ledger-cosmos/build/*": ["../ledger-cosmos/src/*"],
|
|
31
|
+
"@keplr-wallet/mobx-utils": ["../mobx-utils/src"],
|
|
32
|
+
"@keplr-wallet/mobx-utils/build/*": ["../mobx-utils/src/*"],
|
|
33
|
+
"@keplr-wallet/popup": ["../popup/src"],
|
|
34
|
+
"@keplr-wallet/popup/build/*": ["../popup/src/*"],
|
|
35
|
+
"@keplr-wallet/provider": ["../provider/src"],
|
|
36
|
+
"@keplr-wallet/provider/build/*": ["../provider/src/*"],
|
|
37
|
+
"@keplr-wallet/provider-extension": ["../provider-extension/src"],
|
|
38
|
+
"@keplr-wallet/provider-extension/build/*": [
|
|
39
|
+
"../provider-extension/src/*"
|
|
40
|
+
],
|
|
41
|
+
"@keplr-wallet/provider-mock": ["../provider-mock/src"],
|
|
42
|
+
"@keplr-wallet/provider-mock/build/*": ["../provider-mock/src/*"],
|
|
43
|
+
"@keplr-wallet/router": ["../router/src"],
|
|
44
|
+
"@keplr-wallet/router/build/*": ["../router/src/*"],
|
|
45
|
+
"@keplr-wallet/router-extension": ["../router-extension/src"],
|
|
46
|
+
"@keplr-wallet/router-extension/build/*": ["../router-extension/src/*"],
|
|
47
|
+
"@keplr-wallet/router-mock": ["../router-mock/src"],
|
|
48
|
+
"@keplr-wallet/router-mock/build/*": ["../router-mock/src/*"],
|
|
49
|
+
"@keplr-wallet/simple-fetch": ["../simple-fetch/src"],
|
|
50
|
+
"@keplr-wallet/simple-fetch/build/*": ["../simple-fetch/src/*"],
|
|
51
|
+
"@keplr-wallet/stores": ["../stores/src"],
|
|
52
|
+
"@keplr-wallet/stores/build/*": ["../stores/src/*"],
|
|
53
|
+
"@keplr-wallet/stores-bitcoin": ["../stores-bitcoin/src"],
|
|
54
|
+
"@keplr-wallet/stores-bitcoin/build/*": ["../stores-bitcoin/src/*"],
|
|
55
|
+
"@keplr-wallet/stores-core": ["../stores-core/src"],
|
|
56
|
+
"@keplr-wallet/stores-core/build/*": ["../stores-core/src/*"],
|
|
57
|
+
"@keplr-wallet/stores-etc": ["../stores-etc/src"],
|
|
58
|
+
"@keplr-wallet/stores-etc/build/*": ["../stores-etc/src/*"],
|
|
59
|
+
"@keplr-wallet/stores-eth": ["../stores-eth/src"],
|
|
60
|
+
"@keplr-wallet/stores-eth/build/*": ["../stores-eth/src/*"],
|
|
61
|
+
"@keplr-wallet/stores-ibc": ["../stores-ibc/src"],
|
|
62
|
+
"@keplr-wallet/stores-ibc/build/*": ["../stores-ibc/src/*"],
|
|
63
|
+
"@keplr-wallet/stores-starknet": ["../stores-starknet/src"],
|
|
64
|
+
"@keplr-wallet/stores-starknet/build/*": ["../stores-starknet/src/*"],
|
|
65
|
+
"@keplr-wallet/topup-client": ["../topup-client/src"],
|
|
66
|
+
"@keplr-wallet/topup-client/build/*": ["../topup-client/src/*"],
|
|
67
|
+
"@keplr-wallet/types": ["../types/src"],
|
|
68
|
+
"@keplr-wallet/types/build/*": ["../types/src/*"],
|
|
69
|
+
"@keplr-wallet/unit": ["../unit/src"],
|
|
70
|
+
"@keplr-wallet/unit/build/*": ["../unit/src/*"],
|
|
71
|
+
"@keplr-wallet/wc-client": ["../wc-client/src"],
|
|
72
|
+
"@keplr-wallet/wc-client/build/*": ["../wc-client/src/*"],
|
|
73
|
+
"@keplr-wallet/wc-client-example": ["../wc-client-example/src"],
|
|
74
|
+
"@keplr-wallet/wc-client-example/build/*": ["../wc-client-example/src/*"],
|
|
75
|
+
"@keplr-wallet/wc-qrcode-modal": ["../wc-qrcode-modal/src"],
|
|
76
|
+
"@keplr-wallet/wc-qrcode-modal/build/*": ["../wc-qrcode-modal/src/*"],
|
|
77
|
+
"@keplr-wallet/extension": ["../../apps/extension/src"],
|
|
78
|
+
"@keplr-wallet/extension/build/*": ["../../apps/extension/src/*"],
|
|
79
|
+
"@keplr-wallet/hooks-internal": ["../../apps/hooks-internal/src"],
|
|
80
|
+
"@keplr-wallet/hooks-internal/build/*": [
|
|
81
|
+
"../../apps/hooks-internal/src/*"
|
|
82
|
+
],
|
|
83
|
+
"@keplr-wallet/stores-internal": ["../../apps/stores-internal/src"],
|
|
84
|
+
"@keplr-wallet/stores-internal/build/*": [
|
|
85
|
+
"../../apps/stores-internal/src/*"
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
"include": ["src/**/*", "../../packages/*/src/**/*.d.ts"]
|
|
90
|
+
}
|