@kimafinance/kima-transaction-api 1.0.26-beta.1 → 1.0.27-beta.1

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.
@@ -1,36 +1,41 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- exports.TxClient = exports.registry = void 0;
7
- const stargate_1 = require("@cosmjs/stargate");
8
- const dotenv_1 = __importDefault(require("dotenv"));
9
- const proto_signing_1 = require("@cosmjs/proto-signing");
10
- const tx_1 = require("./tx");
11
- dotenv_1.default.config();
12
- const defaultFee = {
13
- amount: [],
14
- gas: "4000000",
15
- };
16
- const types = [
17
- ["/kimablockchain.transaction.MsgRequestTransaction", tx_1.MsgRequestTransaction],
18
- ["/kimablockchain.transaction.MsgSetTxHash", tx_1.MsgSetTxHash],
19
- ];
20
- exports.registry = new proto_signing_1.Registry(types);
21
- const TxClient = async (wallet) => {
22
- const client = await stargate_1.SigningStargateClient.connectWithSigner(process.env.KIMA_BACKEND_NODE_PROVIDER, wallet, { registry: exports.registry });
23
- const { address } = (await wallet.getAccounts())[0];
24
- return {
25
- signAndBroadcast: (msgs, { fee, memo } = { fee: defaultFee, memo: "" }) => client.signAndBroadcast(address, msgs, fee, memo),
26
- msgRequestTransaction: (data) => ({
27
- typeUrl: "/kimablockchain.transaction.MsgRequestTransaction",
28
- value: tx_1.MsgRequestTransaction.fromPartial(data),
29
- }),
30
- msgSetTxHash: (data) => ({
31
- typeUrl: "/kimablockchain.transaction.MsgSetTxHash",
32
- value: tx_1.MsgSetTxHash.fromPartial(data),
33
- }),
34
- };
35
- };
36
- exports.TxClient = TxClient;
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.TxClient = exports.registry = void 0;
7
+ const stargate_1 = require("@cosmjs/stargate");
8
+ const dotenv_1 = __importDefault(require("dotenv"));
9
+ const proto_signing_1 = require("@cosmjs/proto-signing");
10
+ const tx_1 = require("./tx");
11
+ dotenv_1.default.config();
12
+ const defaultFee = {
13
+ amount: [],
14
+ gas: "4000000",
15
+ };
16
+ const types = [
17
+ ["/kimablockchain.transaction.MsgRequestTransaction", tx_1.MsgRequestTransaction],
18
+ ["/kimablockchain.transaction.MsgRequestHtlcLock", tx_1.MsgRequestHtlcLock],
19
+ ["/kimablockchain.transaction.MsgSetTxHash", tx_1.MsgSetTxHash],
20
+ ];
21
+ exports.registry = new proto_signing_1.Registry(types);
22
+ const TxClient = async (wallet) => {
23
+ const client = await stargate_1.SigningStargateClient.connectWithSigner(process.env.KIMA_BACKEND_NODE_PROVIDER, wallet, { registry: exports.registry });
24
+ const { address } = (await wallet.getAccounts())[0];
25
+ return {
26
+ signAndBroadcast: (msgs, { fee, memo } = { fee: defaultFee, memo: "" }) => client.signAndBroadcast(address, msgs, fee, memo),
27
+ msgRequestTransaction: (data) => ({
28
+ typeUrl: "/kimablockchain.transaction.MsgRequestTransaction",
29
+ value: tx_1.MsgRequestTransaction.fromPartial(data),
30
+ }),
31
+ msgRequestHtlcLock: (data) => ({
32
+ typeUrl: "/kimablockchain.transaction.MsgRequestHtlcLock",
33
+ value: tx_1.MsgRequestHtlcLock.fromPartial(data),
34
+ }),
35
+ msgSetTxHash: (data) => ({
36
+ typeUrl: "/kimablockchain.transaction.MsgSetTxHash",
37
+ value: tx_1.MsgSetTxHash.fromPartial(data),
38
+ }),
39
+ };
40
+ };
41
+ exports.TxClient = TxClient;