@keplr-wallet/hooks 0.12.0-alpha.0 → 0.12.0-alpha.2
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/LICENSE +8 -2
- package/build/ibc/amount.d.ts +4 -5
- package/build/ibc/amount.js +8 -10
- package/build/ibc/amount.js.map +1 -1
- package/build/ibc/channel.js +2 -2
- package/build/ibc/channel.js.map +1 -1
- package/build/ibc/index.d.ts +0 -1
- package/build/ibc/index.js +5 -2
- package/build/ibc/index.js.map +1 -1
- package/build/ibc/reciepient.d.ts +8 -2
- package/build/ibc/reciepient.js +5 -4
- package/build/ibc/reciepient.js.map +1 -1
- package/build/ibc/send-ibc-transfer.d.ts +12 -11
- package/build/ibc/send-ibc-transfer.js +11 -12
- package/build/ibc/send-ibc-transfer.js.map +1 -1
- package/build/index.d.ts +0 -3
- package/build/index.js +5 -4
- package/build/index.js.map +1 -1
- package/build/sign-doc/amount.d.ts +13 -36
- package/build/sign-doc/amount.js +59 -122
- package/build/sign-doc/amount.js.map +1 -1
- package/build/sign-doc/helper.d.ts +12 -0
- package/build/sign-doc/helper.js +111 -0
- package/build/sign-doc/helper.js.map +1 -0
- package/build/sign-doc/index.d.ts +1 -12
- package/build/sign-doc/index.js +6 -91
- package/build/sign-doc/index.js.map +1 -1
- package/build/tx/amount.d.ts +21 -24
- package/build/tx/amount.js +126 -127
- package/build/tx/amount.js.map +1 -1
- package/build/tx/chain.d.ts +2 -7
- package/build/tx/chain.js +1 -1
- package/build/tx/chain.js.map +1 -1
- package/build/tx/errors.d.ts +5 -5
- package/build/tx/errors.js +15 -15
- package/build/tx/errors.js.map +1 -1
- package/build/tx/fee.d.ts +32 -28
- package/build/tx/fee.js +288 -208
- package/build/tx/fee.js.map +1 -1
- package/build/tx/gas-simulator.d.ts +16 -8
- package/build/tx/gas-simulator.js +128 -48
- package/build/tx/gas-simulator.js.map +1 -1
- package/build/tx/gas.d.ts +7 -7
- package/build/tx/gas.js +45 -49
- package/build/tx/gas.js.map +1 -1
- package/build/tx/index.d.ts +2 -4
- package/build/tx/index.js +7 -5
- package/build/tx/index.js.map +1 -1
- package/build/tx/internal.d.ts +4 -1
- package/build/tx/memo.d.ts +5 -4
- package/build/tx/memo.js +2088 -10
- package/build/tx/memo.js.map +1 -1
- package/build/tx/recipient.d.ts +35 -12
- package/build/tx/recipient.js +179 -74
- package/build/tx/recipient.js.map +1 -1
- package/build/tx/send-tx.d.ts +10 -3
- package/build/tx/send-tx.js +8 -9
- package/build/tx/send-tx.js.map +1 -1
- package/build/tx/send-types.d.ts +1 -1
- package/build/tx/sender.d.ts +12 -0
- package/build/tx/sender.js +47 -0
- package/build/tx/sender.js.map +1 -0
- package/build/tx/types.d.ts +52 -52
- package/build/tx/types.js.map +1 -1
- package/build/tx/validate.d.ts +12 -0
- package/build/tx/validate.js +33 -0
- package/build/tx/validate.js.map +1 -0
- package/package.json +18 -22
- package/src/ibc/amount.ts +8 -11
- package/src/ibc/index.ts +0 -1
- package/src/ibc/reciepient.ts +11 -4
- package/src/ibc/send-ibc-transfer.ts +24 -23
- package/src/index.ts +0 -3
- package/src/sign-doc/amount.ts +93 -167
- package/src/sign-doc/helper.ts +131 -0
- package/src/sign-doc/index.ts +1 -110
- package/src/tx/amount.ts +141 -133
- package/src/tx/chain.ts +2 -7
- package/src/tx/errors.ts +12 -12
- package/src/tx/fee.ts +378 -260
- package/src/tx/gas-simulator.ts +128 -41
- package/src/tx/gas.ts +42 -46
- package/src/tx/index.ts +2 -4
- package/src/tx/internal.ts +6 -0
- package/src/tx/memo.ts +2089 -8
- package/src/tx/recipient.ts +217 -89
- package/src/tx/send-tx.ts +26 -17
- package/src/tx/sender.ts +53 -0
- package/src/tx/types.ts +76 -54
- package/src/tx/validate.ts +52 -0
- package/build/address-book/index.d.ts +0 -40
- package/build/address-book/index.js +0 -141
- package/build/address-book/index.js.map +0 -1
- package/build/ibc/gas.d.ts +0 -26
- package/build/ibc/gas.js +0 -38
- package/build/ibc/gas.js.map +0 -1
- package/build/interaction/index.d.ts +0 -6
- package/build/interaction/index.js +0 -63
- package/build/interaction/index.js.map +0 -1
- package/build/register/index.d.ts +0 -49
- package/build/register/index.js +0 -201
- package/build/register/index.js.map +0 -1
- package/build/tx/delegate-tx.d.ts +0 -45
- package/build/tx/delegate-tx.js +0 -70
- package/build/tx/delegate-tx.js.map +0 -1
- package/build/tx/redelegate-tx.d.ts +0 -42
- package/build/tx/redelegate-tx.js +0 -57
- package/build/tx/redelegate-tx.js.map +0 -1
- package/build/tx/send-gas.d.ts +0 -12
- package/build/tx/send-gas.js +0 -81
- package/build/tx/send-gas.js.map +0 -1
- package/build/tx/staked-amount.d.ts +0 -30
- package/build/tx/staked-amount.js +0 -205
- package/build/tx/staked-amount.js.map +0 -1
- package/build/tx/undelegate-tx.d.ts +0 -40
- package/build/tx/undelegate-tx.js +0 -55
- package/build/tx/undelegate-tx.js.map +0 -1
- package/src/address-book/index.ts +0 -163
- package/src/ibc/gas.ts +0 -52
- package/src/interaction/index.ts +0 -61
- package/src/register/index.tsx +0 -230
- package/src/tx/delegate-tx.ts +0 -137
- package/src/tx/redelegate-tx.ts +0 -109
- package/src/tx/send-gas.ts +0 -92
- package/src/tx/staked-amount.ts +0 -231
- package/src/tx/undelegate-tx.ts +0 -107
package/LICENSE
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
License: Apache2.0
|
|
1
|
+
License: Apache2.0 (Extension) / All rights reserved (Mobile)
|
|
2
|
+
|
|
3
|
+
## Keplr Extension License:
|
|
2
4
|
|
|
3
5
|
Apache License
|
|
4
6
|
Version 2.0, January 2004
|
|
@@ -200,4 +202,8 @@ License: Apache2.0
|
|
|
200
202
|
distributed under the License is distributed on an "AS IS" BASIS,
|
|
201
203
|
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
202
204
|
See the License for the specific language governing permissions and
|
|
203
|
-
limitations under the License.
|
|
205
|
+
limitations under the License.
|
|
206
|
+
|
|
207
|
+
## Keplr Mobile License
|
|
208
|
+
|
|
209
|
+
Copyright (c) 2021 Chainapsis Inc. All rights reserved.
|
package/build/ibc/amount.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { AmountConfig,
|
|
1
|
+
import { AmountConfig, ISenderConfig } from "../tx";
|
|
2
2
|
import { ChainGetter, IQueriesStore } from "@keplr-wallet/stores";
|
|
3
3
|
import { AppCurrency } from "@keplr-wallet/types";
|
|
4
4
|
export declare class IBCAmountConfig extends AmountConfig {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
get sendableCurrencies(): AppCurrency[];
|
|
5
|
+
constructor(chainGetter: ChainGetter, queriesStore: IQueriesStore, initialChainId: string, senderConfig: ISenderConfig);
|
|
6
|
+
get selectableCurrencies(): AppCurrency[];
|
|
8
7
|
}
|
|
9
|
-
export declare const useIBCAmountConfig: (chainGetter: ChainGetter, queriesStore: IQueriesStore, chainId: string,
|
|
8
|
+
export declare const useIBCAmountConfig: (chainGetter: ChainGetter, queriesStore: IQueriesStore, chainId: string, senderConfig: ISenderConfig) => IBCAmountConfig;
|
package/build/ibc/amount.js
CHANGED
|
@@ -12,24 +12,22 @@ const mobx_1 = require("mobx");
|
|
|
12
12
|
const common_1 = require("@keplr-wallet/common");
|
|
13
13
|
const react_1 = require("react");
|
|
14
14
|
class IBCAmountConfig extends tx_1.AmountConfig {
|
|
15
|
-
constructor(chainGetter, queriesStore, initialChainId,
|
|
16
|
-
super(chainGetter, queriesStore, initialChainId,
|
|
17
|
-
this
|
|
18
|
-
mobx_1.makeObservable(this);
|
|
15
|
+
constructor(chainGetter, queriesStore, initialChainId, senderConfig) {
|
|
16
|
+
super(chainGetter, queriesStore, initialChainId, senderConfig);
|
|
17
|
+
(0, mobx_1.makeObservable)(this);
|
|
19
18
|
}
|
|
20
|
-
get
|
|
19
|
+
get selectableCurrencies() {
|
|
21
20
|
// Only native currencies can be sent by IBC transfer.
|
|
22
|
-
return super.
|
|
21
|
+
return super.selectableCurrencies.filter((cur) => new common_1.DenomHelper(cur.coinMinimalDenom).type === "native");
|
|
23
22
|
}
|
|
24
23
|
}
|
|
25
24
|
__decorate([
|
|
26
25
|
mobx_1.computed
|
|
27
|
-
], IBCAmountConfig.prototype, "
|
|
26
|
+
], IBCAmountConfig.prototype, "selectableCurrencies", null);
|
|
28
27
|
exports.IBCAmountConfig = IBCAmountConfig;
|
|
29
|
-
const useIBCAmountConfig = (chainGetter, queriesStore, chainId,
|
|
30
|
-
const [txConfig] = react_1.useState(() => new IBCAmountConfig(chainGetter, queriesStore, chainId,
|
|
28
|
+
const useIBCAmountConfig = (chainGetter, queriesStore, chainId, senderConfig) => {
|
|
29
|
+
const [txConfig] = (0, react_1.useState)(() => new IBCAmountConfig(chainGetter, queriesStore, chainId, senderConfig));
|
|
31
30
|
txConfig.setChain(chainId);
|
|
32
|
-
txConfig.setSender(sender);
|
|
33
31
|
return txConfig;
|
|
34
32
|
};
|
|
35
33
|
exports.useIBCAmountConfig = useIBCAmountConfig;
|
package/build/ibc/amount.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"amount.js","sourceRoot":"","sources":["../../src/ibc/amount.ts"],"names":[],"mappings":";;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"amount.js","sourceRoot":"","sources":["../../src/ibc/amount.ts"],"names":[],"mappings":";;;;;;;;;AAAA,8BAAoD;AAGpD,+BAAgD;AAChD,iDAAmD;AACnD,iCAAiC;AAEjC,MAAa,eAAgB,SAAQ,iBAAY;IAC/C,YACE,WAAwB,EACxB,YAA2B,EAC3B,cAAsB,EACtB,YAA2B;QAE3B,KAAK,CAAC,WAAW,EAAE,YAAY,EAAE,cAAc,EAAE,YAAY,CAAC,CAAC;QAE/D,IAAA,qBAAc,EAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAGD,IAAa,oBAAoB;QAC/B,sDAAsD;QACtD,OAAO,KAAK,CAAC,oBAAoB,CAAC,MAAM,CACtC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,oBAAW,CAAC,GAAG,CAAC,gBAAgB,CAAC,CAAC,IAAI,KAAK,QAAQ,CACjE,CAAC;IACJ,CAAC;CACF;AANC;IADC,eAAQ;2DAMR;AAlBH,0CAmBC;AAEM,MAAM,kBAAkB,GAAG,CAChC,WAAwB,EACxB,YAA2B,EAC3B,OAAe,EACf,YAA2B,EAC3B,EAAE;IACF,MAAM,CAAC,QAAQ,CAAC,GAAG,IAAA,gBAAQ,EACzB,GAAG,EAAE,CAAC,IAAI,eAAe,CAAC,WAAW,EAAE,YAAY,EAAE,OAAO,EAAE,YAAY,CAAC,CAC5E,CAAC;IACF,QAAQ,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAE3B,OAAO,QAAQ,CAAC;AAClB,CAAC,CAAC;AAZW,QAAA,kBAAkB,sBAY7B"}
|
package/build/ibc/channel.js
CHANGED
|
@@ -13,7 +13,7 @@ const react_1 = require("react");
|
|
|
13
13
|
class IBCChannelConfig {
|
|
14
14
|
constructor() {
|
|
15
15
|
this._channel = undefined;
|
|
16
|
-
mobx_1.makeObservable(this);
|
|
16
|
+
(0, mobx_1.makeObservable)(this);
|
|
17
17
|
}
|
|
18
18
|
get channel() {
|
|
19
19
|
return this._channel;
|
|
@@ -39,7 +39,7 @@ __decorate([
|
|
|
39
39
|
], IBCChannelConfig.prototype, "setChannel", null);
|
|
40
40
|
exports.IBCChannelConfig = IBCChannelConfig;
|
|
41
41
|
const useIBCChannelConfig = () => {
|
|
42
|
-
const [config] = react_1.useState(() => {
|
|
42
|
+
const [config] = (0, react_1.useState)(() => {
|
|
43
43
|
return new IBCChannelConfig();
|
|
44
44
|
});
|
|
45
45
|
return config;
|
package/build/ibc/channel.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../../src/ibc/channel.ts"],"names":[],"mappings":";;;;;;;;;AACA,+BAAoE;AACpE,qCAA8C;AAC9C,iCAAiC;AAEjC,MAAa,gBAAgB;IAI3B;QAFU,aAAQ,GAAwB,SAAS,CAAC;QAGlD,qBAAc,
|
|
1
|
+
{"version":3,"file":"channel.js","sourceRoot":"","sources":["../../src/ibc/channel.ts"],"names":[],"mappings":";;;;;;;;;AACA,+BAAoE;AACpE,qCAA8C;AAC9C,iCAAiC;AAEjC,MAAa,gBAAgB;IAI3B;QAFU,aAAQ,GAAwB,SAAS,CAAC;QAGlD,IAAA,qBAAc,EAAC,IAAI,CAAC,CAAC;IACvB,CAAC;IAED,IAAI,OAAO;QACT,OAAO,IAAI,CAAC,QAAQ,CAAC;IACvB,CAAC;IAGD,IAAI,KAAK;QACP,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;YAClB,OAAO,IAAI,2BAAkB,CAAC,iBAAiB,CAAC,CAAC;SAClD;QACD,OAAO,SAAS,CAAC;IACnB,CAAC;IAGD,UAAU,CAAC,OAA4B;QACrC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC;IAC1B,CAAC;CACF;AAtBC;IADC,iBAAU,CAAC,GAAG;kDACqC;AAWpD;IADC,eAAQ;6CAMR;AAGD;IADC,aAAM;kDAGN;AAvBH,4CAwBC;AAEM,MAAM,mBAAmB,GAAG,GAAG,EAAE;IACtC,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,gBAAQ,EAAC,GAAG,EAAE;QAC7B,OAAO,IAAI,gBAAgB,EAAE,CAAC;IAChC,CAAC,CAAC,CAAC;IAEH,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AANW,QAAA,mBAAmB,uBAM9B"}
|
package/build/ibc/index.d.ts
CHANGED
package/build/ibc/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -13,7 +17,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
13
17
|
__exportStar(require("./amount"), exports);
|
|
14
18
|
__exportStar(require("./channel"), exports);
|
|
15
19
|
__exportStar(require("./errors"), exports);
|
|
16
|
-
__exportStar(require("./gas"), exports);
|
|
17
20
|
__exportStar(require("./send-ibc-transfer"), exports);
|
|
18
21
|
__exportStar(require("./types"), exports);
|
|
19
22
|
//# sourceMappingURL=index.js.map
|
package/build/ibc/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ibc/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/ibc/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,4CAA0B;AAC1B,2CAAyB;AACzB,sDAAoC;AACpC,0CAAwB"}
|
|
@@ -5,11 +5,17 @@ import { IIBCChannelConfig } from "./types";
|
|
|
5
5
|
* IBCRecipientConfig returns the recipient config for IBC transfer.
|
|
6
6
|
* The recipient config's chain id should be the destination chain id for IBC.
|
|
7
7
|
* But, actually, the recipient config's chain id would be set as the sending chain id if the channel not set.
|
|
8
|
-
* So, you should remember that the recipient config's chain id is
|
|
8
|
+
* So, you should remember that the recipient config's chain id is equal to the sending chain id, if channel not set.
|
|
9
9
|
*/
|
|
10
10
|
export declare class IBCRecipientConfig extends RecipientConfig {
|
|
11
11
|
protected readonly channelConfig: IIBCChannelConfig;
|
|
12
12
|
constructor(chainGetter: ChainGetter, initialChainId: string, channelConfig: IIBCChannelConfig);
|
|
13
13
|
get chainId(): string;
|
|
14
14
|
}
|
|
15
|
-
export declare const useIBCRecipientConfig: (chainGetter: ChainGetter, chainId: string, channelConfig: IIBCChannelConfig,
|
|
15
|
+
export declare const useIBCRecipientConfig: (chainGetter: ChainGetter, chainId: string, channelConfig: IIBCChannelConfig, options?: {
|
|
16
|
+
allowHexAddressOnEthermint?: boolean | undefined;
|
|
17
|
+
icns?: {
|
|
18
|
+
chainId: string;
|
|
19
|
+
resolverContractAddress: string;
|
|
20
|
+
} | undefined;
|
|
21
|
+
}) => IBCRecipientConfig;
|
package/build/ibc/reciepient.js
CHANGED
|
@@ -7,7 +7,7 @@ const react_1 = require("react");
|
|
|
7
7
|
* IBCRecipientConfig returns the recipient config for IBC transfer.
|
|
8
8
|
* The recipient config's chain id should be the destination chain id for IBC.
|
|
9
9
|
* But, actually, the recipient config's chain id would be set as the sending chain id if the channel not set.
|
|
10
|
-
* So, you should remember that the recipient config's chain id is
|
|
10
|
+
* So, you should remember that the recipient config's chain id is equal to the sending chain id, if channel not set.
|
|
11
11
|
*/
|
|
12
12
|
class IBCRecipientConfig extends tx_1.RecipientConfig {
|
|
13
13
|
constructor(chainGetter, initialChainId, channelConfig) {
|
|
@@ -21,10 +21,11 @@ class IBCRecipientConfig extends tx_1.RecipientConfig {
|
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
23
|
exports.IBCRecipientConfig = IBCRecipientConfig;
|
|
24
|
-
const useIBCRecipientConfig = (chainGetter, chainId, channelConfig,
|
|
25
|
-
const [config] = react_1.useState(() => new IBCRecipientConfig(chainGetter, chainId, channelConfig));
|
|
24
|
+
const useIBCRecipientConfig = (chainGetter, chainId, channelConfig, options = {}) => {
|
|
25
|
+
const [config] = (0, react_1.useState)(() => new IBCRecipientConfig(chainGetter, chainId, channelConfig));
|
|
26
26
|
config.setChain(chainId);
|
|
27
|
-
config.
|
|
27
|
+
config.setAllowHexAddressOnEthermint(options.allowHexAddressOnEthermint);
|
|
28
|
+
config.setICNS(options.icns);
|
|
28
29
|
return config;
|
|
29
30
|
};
|
|
30
31
|
exports.useIBCRecipientConfig = useIBCRecipientConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"reciepient.js","sourceRoot":"","sources":["../../src/ibc/reciepient.ts"],"names":[],"mappings":";;;AAAA,8BAAwC;AAGxC,iCAAiC;AAEjC;;;;;GAKG;AACH,MAAa,kBAAmB,SAAQ,oBAAe;IACrD,YACE,WAAwB,EACxB,cAAsB,EACH,aAAgC;QAEnD,KAAK,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAFhB,kBAAa,GAAb,aAAa,CAAmB;IAGrD,CAAC;IAED,
|
|
1
|
+
{"version":3,"file":"reciepient.js","sourceRoot":"","sources":["../../src/ibc/reciepient.ts"],"names":[],"mappings":";;;AAAA,8BAAwC;AAGxC,iCAAiC;AAEjC;;;;;GAKG;AACH,MAAa,kBAAmB,SAAQ,oBAAe;IACrD,YACE,WAAwB,EACxB,cAAsB,EACH,aAAgC;QAEnD,KAAK,CAAC,WAAW,EAAE,cAAc,CAAC,CAAC;QAFhB,kBAAa,GAAb,aAAa,CAAmB;IAGrD,CAAC;IAED,IAAa,OAAO;QAClB,OAAO,IAAI,CAAC,aAAa,CAAC,OAAO;YAC/B,CAAC,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,mBAAmB;YAChD,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC;IACpB,CAAC;CACF;AAdD,gDAcC;AAEM,MAAM,qBAAqB,GAAG,CACnC,WAAwB,EACxB,OAAe,EACf,aAAgC,EAChC,UAMI,EAAE,EACN,EAAE;IACF,MAAM,CAAC,MAAM,CAAC,GAAG,IAAA,gBAAQ,EACvB,GAAG,EAAE,CAAC,IAAI,kBAAkB,CAAC,WAAW,EAAE,OAAO,EAAE,aAAa,CAAC,CAClE,CAAC;IACF,MAAM,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IACzB,MAAM,CAAC,6BAA6B,CAAC,OAAO,CAAC,0BAA0B,CAAC,CAAC;IACzE,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC;IAE7B,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AApBW,QAAA,qBAAqB,yBAoBhC"}
|
|
@@ -1,27 +1,28 @@
|
|
|
1
|
-
import { ChainGetter,
|
|
1
|
+
import { ChainGetter, IQueriesStore } from "@keplr-wallet/stores";
|
|
2
2
|
/**
|
|
3
3
|
* useIBCTransferConfig returns the configs for IBC transfer.
|
|
4
4
|
* The recipient config's chain id should be the destination chain id for IBC.
|
|
5
5
|
* But, actually, the recipient config's chain id would be set as the sending chain id if the channel not set.
|
|
6
|
-
* So, you should remember that the recipient config's chain id is
|
|
6
|
+
* So, you should remember that the recipient config's chain id is equal to the sending chain id, if channel not set.
|
|
7
7
|
* @param chainGetter
|
|
8
8
|
* @param queriesStore
|
|
9
9
|
* @param accountStore
|
|
10
10
|
* @param chainId
|
|
11
11
|
* @param sender
|
|
12
|
-
* @param
|
|
12
|
+
* @param options
|
|
13
13
|
*/
|
|
14
|
-
export declare const useIBCTransferConfig: (chainGetter: ChainGetter, queriesStore: IQueriesStore,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
};
|
|
20
|
-
}
|
|
14
|
+
export declare const useIBCTransferConfig: (chainGetter: ChainGetter, queriesStore: IQueriesStore, chainId: string, sender: string, initialGas: number, options?: {
|
|
15
|
+
allowHexAddressOnEthermint?: boolean | undefined;
|
|
16
|
+
icns?: {
|
|
17
|
+
chainId: string;
|
|
18
|
+
resolverContractAddress: string;
|
|
19
|
+
} | undefined;
|
|
20
|
+
}) => {
|
|
21
21
|
amountConfig: import("./amount").IBCAmountConfig;
|
|
22
22
|
memoConfig: import("../tx").MemoConfig;
|
|
23
|
-
gasConfig: import("
|
|
23
|
+
gasConfig: import("../tx").GasConfig;
|
|
24
24
|
feeConfig: import("../tx").FeeConfig;
|
|
25
25
|
recipientConfig: import("./reciepient").IBCRecipientConfig;
|
|
26
26
|
channelConfig: import("./channel").IBCChannelConfig;
|
|
27
|
+
senderConfig: import("../tx").SenderConfig;
|
|
27
28
|
};
|
|
@@ -3,31 +3,29 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.useIBCTransferConfig = void 0;
|
|
4
4
|
const tx_1 = require("../tx");
|
|
5
5
|
const amount_1 = require("./amount");
|
|
6
|
-
const gas_1 = require("./gas");
|
|
7
6
|
const channel_1 = require("./channel");
|
|
8
7
|
const reciepient_1 = require("./reciepient");
|
|
9
8
|
/**
|
|
10
9
|
* useIBCTransferConfig returns the configs for IBC transfer.
|
|
11
10
|
* The recipient config's chain id should be the destination chain id for IBC.
|
|
12
11
|
* But, actually, the recipient config's chain id would be set as the sending chain id if the channel not set.
|
|
13
|
-
* So, you should remember that the recipient config's chain id is
|
|
12
|
+
* So, you should remember that the recipient config's chain id is equal to the sending chain id, if channel not set.
|
|
14
13
|
* @param chainGetter
|
|
15
14
|
* @param queriesStore
|
|
16
15
|
* @param accountStore
|
|
17
16
|
* @param chainId
|
|
18
17
|
* @param sender
|
|
19
|
-
* @param
|
|
18
|
+
* @param options
|
|
20
19
|
*/
|
|
21
|
-
const useIBCTransferConfig = (chainGetter, queriesStore,
|
|
22
|
-
const
|
|
23
|
-
const
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
|
|
27
|
-
// set the fee config of the amount config after initing the gas/fee configs.
|
|
20
|
+
const useIBCTransferConfig = (chainGetter, queriesStore, chainId, sender, initialGas, options = {}) => {
|
|
21
|
+
const senderConfig = (0, tx_1.useSenderConfig)(chainGetter, chainId, sender);
|
|
22
|
+
const amountConfig = (0, amount_1.useIBCAmountConfig)(chainGetter, queriesStore, chainId, senderConfig);
|
|
23
|
+
const memoConfig = (0, tx_1.useMemoConfig)(chainGetter, chainId);
|
|
24
|
+
const gasConfig = (0, tx_1.useGasConfig)(chainGetter, chainId, initialGas);
|
|
25
|
+
const feeConfig = (0, tx_1.useFeeConfig)(chainGetter, queriesStore, chainId, senderConfig, amountConfig, gasConfig);
|
|
28
26
|
amountConfig.setFeeConfig(feeConfig);
|
|
29
|
-
const channelConfig = channel_1.useIBCChannelConfig();
|
|
30
|
-
const recipientConfig = reciepient_1.useIBCRecipientConfig(chainGetter, chainId, channelConfig,
|
|
27
|
+
const channelConfig = (0, channel_1.useIBCChannelConfig)();
|
|
28
|
+
const recipientConfig = (0, reciepient_1.useIBCRecipientConfig)(chainGetter, chainId, channelConfig, options);
|
|
31
29
|
return {
|
|
32
30
|
amountConfig,
|
|
33
31
|
memoConfig,
|
|
@@ -35,6 +33,7 @@ const useIBCTransferConfig = (chainGetter, queriesStore, accountStore, chainId,
|
|
|
35
33
|
feeConfig,
|
|
36
34
|
recipientConfig,
|
|
37
35
|
channelConfig,
|
|
36
|
+
senderConfig,
|
|
38
37
|
};
|
|
39
38
|
};
|
|
40
39
|
exports.useIBCTransferConfig = useIBCTransferConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send-ibc-transfer.js","sourceRoot":"","sources":["../../src/ibc/send-ibc-transfer.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"send-ibc-transfer.js","sourceRoot":"","sources":["../../src/ibc/send-ibc-transfer.ts"],"names":[],"mappings":";;;AACA,8BAKe;AACf,qCAA8C;AAC9C,uCAAgD;AAChD,6CAAqD;AAErD;;;;;;;;;;;GAWG;AACI,MAAM,oBAAoB,GAAG,CAClC,WAAwB,EACxB,YAA2B,EAC3B,OAAe,EACf,MAAc,EACd,UAAkB,EAClB,UAMI,EAAE,EACN,EAAE;IACF,MAAM,YAAY,GAAG,IAAA,oBAAe,EAAC,WAAW,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAEnE,MAAM,YAAY,GAAG,IAAA,2BAAkB,EACrC,WAAW,EACX,YAAY,EACZ,OAAO,EACP,YAAY,CACb,CAAC;IAEF,MAAM,UAAU,GAAG,IAAA,kBAAa,EAAC,WAAW,EAAE,OAAO,CAAC,CAAC;IACvD,MAAM,SAAS,GAAG,IAAA,iBAAY,EAAC,WAAW,EAAE,OAAO,EAAE,UAAU,CAAC,CAAC;IACjE,MAAM,SAAS,GAAG,IAAA,iBAAY,EAC5B,WAAW,EACX,YAAY,EACZ,OAAO,EACP,YAAY,EACZ,YAAY,EACZ,SAAS,CACV,CAAC;IAEF,YAAY,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAErC,MAAM,aAAa,GAAG,IAAA,6BAAmB,GAAE,CAAC;IAE5C,MAAM,eAAe,GAAG,IAAA,kCAAqB,EAC3C,WAAW,EACX,OAAO,EACP,aAAa,EACb,OAAO,CACR,CAAC;IAEF,OAAO;QACL,YAAY;QACZ,UAAU;QACV,SAAS;QACT,SAAS;QACT,eAAe;QACf,aAAa;QACb,YAAY;KACb,CAAC;AACJ,CAAC,CAAC;AAtDW,QAAA,oBAAoB,wBAsD/B"}
|
package/build/index.d.ts
CHANGED
package/build/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -10,10 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
__exportStar(require("./interaction"), exports);
|
|
14
17
|
__exportStar(require("./tx"), exports);
|
|
15
|
-
__exportStar(require("./register"), exports);
|
|
16
|
-
__exportStar(require("./address-book"), exports);
|
|
17
18
|
__exportStar(require("./sign-doc"), exports);
|
|
18
19
|
__exportStar(require("./ibc"), exports);
|
|
19
20
|
//# sourceMappingURL=index.js.map
|
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,uCAAqB;AACrB,6CAA2B;AAC3B,wCAAsB"}
|
|
@@ -1,44 +1,21 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { ChainGetter
|
|
3
|
-
import {
|
|
1
|
+
import { IBaseAmountConfig, ISenderConfig, TxChainSetter, UIProperties } from "../tx";
|
|
2
|
+
import { ChainGetter } from "@keplr-wallet/stores";
|
|
3
|
+
import { CoinPretty } from "@keplr-wallet/unit";
|
|
4
4
|
import { SignDocHelper } from "./index";
|
|
5
|
-
import { Msg } from "@
|
|
5
|
+
import { Msg } from "@keplr-wallet/types";
|
|
6
6
|
import { AnyWithUnpacked } from "@keplr-wallet/cosmos";
|
|
7
|
-
export declare
|
|
8
|
-
|
|
9
|
-
readonly msgOpts: CosmosMsgOpts;
|
|
10
|
-
};
|
|
11
|
-
}>;
|
|
12
|
-
export declare class SignDocAmountConfig extends TxChainSetter implements IAmountConfig {
|
|
13
|
-
protected readonly accountStore: AccountStore;
|
|
7
|
+
export declare class SignDocAmountConfig extends TxChainSetter implements IBaseAmountConfig {
|
|
8
|
+
protected readonly senderConfig: ISenderConfig;
|
|
14
9
|
protected signDocHelper?: SignDocHelper;
|
|
15
|
-
protected _sender: string;
|
|
16
10
|
protected _disableBalanceCheck: boolean;
|
|
17
|
-
constructor(chainGetter: ChainGetter,
|
|
11
|
+
constructor(chainGetter: ChainGetter, initialChainId: string, senderConfig: ISenderConfig);
|
|
18
12
|
setSignDocHelper(signDocHelper: SignDocHelper): void;
|
|
19
|
-
get amount():
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
get
|
|
24
|
-
getAmountPrimitive: () => CoinPrimitive;
|
|
25
|
-
protected computeAmountInAminoMsgs(msgs: readonly Msg[]): {
|
|
26
|
-
amount: string;
|
|
27
|
-
denom: string;
|
|
28
|
-
};
|
|
29
|
-
protected computeAmountInProtoMsgs(msgs: AnyWithUnpacked[]): {
|
|
30
|
-
amount: string;
|
|
31
|
-
denom: string;
|
|
32
|
-
};
|
|
33
|
-
get error(): Error | undefined;
|
|
34
|
-
setIsMax(_: boolean): void;
|
|
35
|
-
toggleIsMax(): void;
|
|
36
|
-
get isMax(): boolean;
|
|
37
|
-
get fraction(): number | undefined;
|
|
38
|
-
setFraction(_: number | undefined): void;
|
|
39
|
-
setAmount(): void;
|
|
40
|
-
setSendCurrency(): void;
|
|
13
|
+
get amount(): CoinPretty[];
|
|
14
|
+
protected computeAmountInAminoMsgs(msgs: readonly Msg[]): CoinPretty[];
|
|
15
|
+
protected computeAmountInProtoMsgs(msgs: AnyWithUnpacked[]): CoinPretty[];
|
|
16
|
+
protected mergeDuplicatedAmount(amount: CoinPretty[]): CoinPretty[];
|
|
17
|
+
get uiProperties(): UIProperties;
|
|
41
18
|
setDisableBalanceCheck(bool: boolean): void;
|
|
42
19
|
get disableBalanceCheck(): boolean;
|
|
43
20
|
}
|
|
44
|
-
export declare const useSignDocAmountConfig: (chainGetter: ChainGetter,
|
|
21
|
+
export declare const useSignDocAmountConfig: (chainGetter: ChainGetter, chainId: string, senderConfig: ISenderConfig) => SignDocAmountConfig;
|