@kimafinance/kima-transaction-api 1.0.30-beta.1 → 1.3.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.
- package/build/index.d.ts +2 -1
- package/build/index.js +2 -2
- package/build/kima/common.js +2 -2
- package/package.json +1 -1
- package/src/index.ts +3 -1
- package/src/kima/common.ts +3 -3
package/build/index.d.ts
CHANGED
|
@@ -43,6 +43,7 @@ interface RequestTxProps {
|
|
|
43
43
|
htlcExpirationTimestamp: string;
|
|
44
44
|
htlcVersion: string;
|
|
45
45
|
senderPubKey: Uint8Array;
|
|
46
|
+
options: string;
|
|
46
47
|
}
|
|
47
|
-
export declare function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, originSymbol, targetSymbol, amount, fee, htlcCreationHash, htlcCreationVout, htlcExpirationTimestamp, htlcVersion, senderPubKey, }: RequestTxProps): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
48
|
+
export declare function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, originSymbol, targetSymbol, amount, fee, htlcCreationHash, htlcCreationVout, htlcExpirationTimestamp, htlcVersion, senderPubKey, options, }: RequestTxProps): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
48
49
|
export {};
|
package/build/index.js
CHANGED
|
@@ -57,7 +57,7 @@ exports.submitHtlcLock = submitHtlcLock;
|
|
|
57
57
|
function sleep(ms) {
|
|
58
58
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
59
59
|
}
|
|
60
|
-
async function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, originSymbol, targetSymbol, amount, fee, htlcCreationHash, htlcCreationVout, htlcExpirationTimestamp, htlcVersion, senderPubKey, }) {
|
|
60
|
+
async function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, originSymbol, targetSymbol, amount, fee, htlcCreationHash, htlcCreationVout, htlcExpirationTimestamp, htlcVersion, senderPubKey, options, }) {
|
|
61
61
|
const wallet = await proto_signing_1.DirectSecp256k1HdWallet.fromMnemonic(process.env.KIMA_BACKEND_MNEMONIC, { prefix: "kima" });
|
|
62
62
|
const client = await (0, common_1.TxClient)(wallet);
|
|
63
63
|
const [firstAccount] = await wallet.getAccounts();
|
|
@@ -76,7 +76,7 @@ async function submitKimaTransaction({ originChain, originAddress, targetChain,
|
|
|
76
76
|
htlcExpirationTimestamp,
|
|
77
77
|
htlcVersion,
|
|
78
78
|
senderPubKey,
|
|
79
|
-
options
|
|
79
|
+
options,
|
|
80
80
|
};
|
|
81
81
|
let msg = await client.msgRequestTransaction(params);
|
|
82
82
|
const result = await client.signAndBroadcast([msg]);
|
package/build/kima/common.js
CHANGED
|
@@ -10,8 +10,8 @@ const proto_signing_1 = require("@cosmjs/proto-signing");
|
|
|
10
10
|
const tx_1 = require("./tx");
|
|
11
11
|
dotenv_1.default.config();
|
|
12
12
|
const defaultFee = {
|
|
13
|
-
amount: [],
|
|
14
|
-
gas: "
|
|
13
|
+
amount: [(0, proto_signing_1.coin)(200, "uKIMA")],
|
|
14
|
+
gas: "200000", // Gas limit
|
|
15
15
|
};
|
|
16
16
|
const types = [
|
|
17
17
|
["/kimablockchain.transaction.MsgRequestTransaction", tx_1.MsgRequestTransaction],
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kimafinance/kima-transaction-api",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"description": "A wrapper around Kima's API, enabling sending and monitoring transactions (Beta version)",
|
|
5
5
|
"repository": "https://github.com/kima-finance/kima-transaction-api",
|
|
6
6
|
"author": "",
|
package/src/index.ts
CHANGED
|
@@ -105,6 +105,7 @@ interface RequestTxProps {
|
|
|
105
105
|
htlcExpirationTimestamp: string;
|
|
106
106
|
htlcVersion: string;
|
|
107
107
|
senderPubKey: Uint8Array;
|
|
108
|
+
options: string;
|
|
108
109
|
}
|
|
109
110
|
|
|
110
111
|
function sleep(ms: number) {
|
|
@@ -125,6 +126,7 @@ export async function submitKimaTransaction({
|
|
|
125
126
|
htlcExpirationTimestamp,
|
|
126
127
|
htlcVersion,
|
|
127
128
|
senderPubKey,
|
|
129
|
+
options,
|
|
128
130
|
}: RequestTxProps) {
|
|
129
131
|
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(
|
|
130
132
|
process.env.KIMA_BACKEND_MNEMONIC as string,
|
|
@@ -147,7 +149,7 @@ export async function submitKimaTransaction({
|
|
|
147
149
|
htlcExpirationTimestamp,
|
|
148
150
|
htlcVersion,
|
|
149
151
|
senderPubKey,
|
|
150
|
-
options
|
|
152
|
+
options,
|
|
151
153
|
};
|
|
152
154
|
|
|
153
155
|
let msg = await client.msgRequestTransaction(params);
|
package/src/kima/common.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SigningStargateClient, StdFee } from "@cosmjs/stargate";
|
|
2
2
|
import dotenv from "dotenv";
|
|
3
|
-
import { Registry, OfflineSigner, EncodeObject } from "@cosmjs/proto-signing";
|
|
3
|
+
import { Registry, OfflineSigner, EncodeObject, coin } from "@cosmjs/proto-signing";
|
|
4
4
|
import {
|
|
5
5
|
MsgRequestHtlcLock,
|
|
6
6
|
MsgRequestTransaction,
|
|
@@ -11,8 +11,8 @@ import {
|
|
|
11
11
|
dotenv.config();
|
|
12
12
|
|
|
13
13
|
const defaultFee = {
|
|
14
|
-
amount: [],
|
|
15
|
-
gas: "
|
|
14
|
+
amount: [coin(200, "uKIMA")],
|
|
15
|
+
gas: "200000", // Gas limit
|
|
16
16
|
};
|
|
17
17
|
|
|
18
18
|
interface SignAndBroadcastOptions {
|