@kimafinance/kima-transaction-api 1.3.1 → 1.3.3
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 +3 -2
- package/build/index.js +7 -1
- package/package.json +1 -1
- package/src/index.ts +11 -2
package/build/index.d.ts
CHANGED
|
@@ -36,8 +36,8 @@ interface RequestTxProps {
|
|
|
36
36
|
targetAddress: string;
|
|
37
37
|
originSymbol: CurrencyOptions;
|
|
38
38
|
targetSymbol: CurrencyOptions;
|
|
39
|
-
amount:
|
|
40
|
-
fee:
|
|
39
|
+
amount: string;
|
|
40
|
+
fee: string;
|
|
41
41
|
htlcCreationHash: string;
|
|
42
42
|
htlcCreationVout: number;
|
|
43
43
|
htlcExpirationTimestamp: string;
|
|
@@ -45,5 +45,6 @@ interface RequestTxProps {
|
|
|
45
45
|
senderPubKey: Uint8Array;
|
|
46
46
|
options: string;
|
|
47
47
|
}
|
|
48
|
+
export declare function getCreatorAddress(): Promise<import("@cosmjs/proto-signing").AccountData>;
|
|
48
49
|
export declare function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, originSymbol, targetSymbol, amount, fee, htlcCreationHash, htlcCreationVout, htlcExpirationTimestamp, htlcVersion, senderPubKey, options, }: RequestTxProps): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
|
|
49
50
|
export {};
|
package/build/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.submitKimaTransaction = exports.submitHtlcLock = exports.HtlcReclaim = exports.CurrencyOptions = exports.SupportedNetworks = void 0;
|
|
3
|
+
exports.submitKimaTransaction = exports.getCreatorAddress = exports.submitHtlcLock = exports.HtlcReclaim = exports.CurrencyOptions = exports.SupportedNetworks = void 0;
|
|
4
4
|
const proto_signing_1 = require("@cosmjs/proto-signing");
|
|
5
5
|
const common_1 = require("./kima/common");
|
|
6
6
|
var SupportedNetworks;
|
|
@@ -57,6 +57,12 @@ exports.submitHtlcLock = submitHtlcLock;
|
|
|
57
57
|
function sleep(ms) {
|
|
58
58
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
59
59
|
}
|
|
60
|
+
async function getCreatorAddress() {
|
|
61
|
+
const wallet = await proto_signing_1.DirectSecp256k1HdWallet.fromMnemonic(process.env.KIMA_BACKEND_MNEMONIC, { prefix: "kima" });
|
|
62
|
+
const [firstAccount] = await wallet.getAccounts();
|
|
63
|
+
return firstAccount;
|
|
64
|
+
}
|
|
65
|
+
exports.getCreatorAddress = getCreatorAddress;
|
|
60
66
|
async function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, originSymbol, targetSymbol, amount, fee, htlcCreationHash, htlcCreationVout, htlcExpirationTimestamp, htlcVersion, senderPubKey, options, }) {
|
|
61
67
|
const wallet = await proto_signing_1.DirectSecp256k1HdWallet.fromMnemonic(process.env.KIMA_BACKEND_MNEMONIC, { prefix: "kima" });
|
|
62
68
|
const client = await (0, common_1.TxClient)(wallet);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@kimafinance/kima-transaction-api",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
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
|
@@ -98,8 +98,8 @@ interface RequestTxProps {
|
|
|
98
98
|
targetAddress: string;
|
|
99
99
|
originSymbol: CurrencyOptions;
|
|
100
100
|
targetSymbol: CurrencyOptions;
|
|
101
|
-
amount: number
|
|
102
|
-
fee: number
|
|
101
|
+
amount: string; // number in whole units i.e. "12.34"
|
|
102
|
+
fee: string; // number in whole units i.e "0.061234"
|
|
103
103
|
htlcCreationHash: string;
|
|
104
104
|
htlcCreationVout: number;
|
|
105
105
|
htlcExpirationTimestamp: string;
|
|
@@ -112,6 +112,15 @@ function sleep(ms: number) {
|
|
|
112
112
|
return new Promise((resolve) => setTimeout(resolve, ms));
|
|
113
113
|
}
|
|
114
114
|
|
|
115
|
+
export async function getCreatorAddress() {
|
|
116
|
+
const wallet = await DirectSecp256k1HdWallet.fromMnemonic(
|
|
117
|
+
process.env.KIMA_BACKEND_MNEMONIC as string,
|
|
118
|
+
{ prefix: "kima" }
|
|
119
|
+
);
|
|
120
|
+
const [firstAccount] = await wallet.getAccounts();
|
|
121
|
+
return firstAccount
|
|
122
|
+
}
|
|
123
|
+
|
|
115
124
|
export async function submitKimaTransaction({
|
|
116
125
|
originChain,
|
|
117
126
|
originAddress,
|