@kimafinance/kima-transaction-api 1.0.28-beta.1 → 1.0.30-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.
package/build/index.d.ts CHANGED
@@ -34,7 +34,8 @@ interface RequestTxProps {
34
34
  originAddress: string;
35
35
  targetChain: SupportedNetworks;
36
36
  targetAddress: string;
37
- symbol: CurrencyOptions;
37
+ originSymbol: CurrencyOptions;
38
+ targetSymbol: CurrencyOptions;
38
39
  amount: number;
39
40
  fee: number;
40
41
  htlcCreationHash: string;
@@ -43,5 +44,5 @@ interface RequestTxProps {
43
44
  htlcVersion: string;
44
45
  senderPubKey: Uint8Array;
45
46
  }
46
- export declare function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, symbol, amount, fee, htlcCreationHash, htlcCreationVout, htlcExpirationTimestamp, htlcVersion, senderPubKey, }: RequestTxProps): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
47
+ export declare function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, originSymbol, targetSymbol, amount, fee, htlcCreationHash, htlcCreationVout, htlcExpirationTimestamp, htlcVersion, senderPubKey, }: RequestTxProps): Promise<import("@cosmjs/stargate").DeliverTxResponse>;
47
48
  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, symbol, amount, fee, htlcCreationHash, htlcCreationVout, htlcExpirationTimestamp, htlcVersion, senderPubKey, }) {
60
+ async function submitKimaTransaction({ originChain, originAddress, targetChain, targetAddress, originSymbol, targetSymbol, amount, fee, htlcCreationHash, htlcCreationVout, htlcExpirationTimestamp, htlcVersion, senderPubKey, }) {
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();
@@ -67,7 +67,8 @@ async function submitKimaTransaction({ originChain, originAddress, targetChain,
67
67
  originAddress,
68
68
  targetChain,
69
69
  targetAddress,
70
- symbol,
70
+ originSymbol,
71
+ targetSymbol,
71
72
  amount: amount.toString(),
72
73
  fee: fee.toString(),
73
74
  htlcCreationHash,
@@ -75,6 +76,7 @@ async function submitKimaTransaction({ originChain, originAddress, targetChain,
75
76
  htlcExpirationTimestamp,
76
77
  htlcVersion,
77
78
  senderPubKey,
79
+ options: "",
78
80
  };
79
81
  let msg = await client.msgRequestTransaction(params);
80
82
  const result = await client.signAndBroadcast([msg]);
@@ -11,7 +11,7 @@ const tx_1 = require("./tx");
11
11
  dotenv_1.default.config();
12
12
  const defaultFee = {
13
13
  amount: [],
14
- gas: "4000000",
14
+ gas: "10000000",
15
15
  };
16
16
  const types = [
17
17
  ["/kimablockchain.transaction.MsgRequestTransaction", tx_1.MsgRequestTransaction],
@@ -6,7 +6,8 @@ export interface MsgRequestTransaction {
6
6
  originAddress: string;
7
7
  targetChain: string;
8
8
  targetAddress: string;
9
- symbol: string;
9
+ originSymbol: string;
10
+ targetSymbol: string;
10
11
  amount: string;
11
12
  fee: string;
12
13
  /** the timestamp when the HTLC contract expires and the user can reclaim the funds locked there */
@@ -19,6 +20,8 @@ export interface MsgRequestTransaction {
19
20
  htlcVersion: string;
20
21
  /** for bitcoin transaction this is the public key of the sender */
21
22
  senderPubKey: Uint8Array;
23
+ /** additional data JSON object */
24
+ options: string;
22
25
  }
23
26
  export interface MsgRequestTransactionResponse {
24
27
  code: string;
@@ -96,7 +99,7 @@ export interface MsgSetTxProcess {
96
99
  txId: number;
97
100
  timestamp: number;
98
101
  msgId: string;
99
- /** request_transaction, request_provision_transaction, request_drain_transaction */
102
+ /** request_transaction, request_provision_transaction, request_drain_transaction, withdraw_pool */
100
103
  txType: string;
101
104
  }
102
105
  export interface MsgSetTxProcessResponse {
@@ -144,6 +147,32 @@ export interface MsgHtlcReclaim {
144
147
  }
145
148
  export interface MsgHtlcReclaimResponse {
146
149
  }
150
+ export interface MsgUpdateLiquidityProvisionParams {
151
+ authority: string;
152
+ maxBTC: string;
153
+ maxUSDT: string;
154
+ }
155
+ export interface MsgUpdateLiquidityProvisionParamsResponse {
156
+ }
157
+ export interface MsgUpdateTransferLimitParams {
158
+ authority: string;
159
+ maxBTC: string;
160
+ maxUSDT: string;
161
+ }
162
+ export interface MsgUpdateTransferLimitParamsResponse {
163
+ }
164
+ export interface MsgFinalizeWithdrawTransaction {
165
+ creator: string;
166
+ txId: number;
167
+ txHash: string;
168
+ success: boolean;
169
+ signedKey: string;
170
+ errReason: string;
171
+ }
172
+ export interface MsgFinalizeWithdrawTransactionResponse {
173
+ code: string;
174
+ msg: string;
175
+ }
147
176
  export declare const MsgRequestTransaction: {
148
177
  encode(message: MsgRequestTransaction, writer?: _m0.Writer): _m0.Writer;
149
178
  decode(input: _m0.Reader | Uint8Array, length?: number): MsgRequestTransaction;
@@ -155,7 +184,8 @@ export declare const MsgRequestTransaction: {
155
184
  originAddress?: string | undefined;
156
185
  targetChain?: string | undefined;
157
186
  targetAddress?: string | undefined;
158
- symbol?: string | undefined;
187
+ originSymbol?: string | undefined;
188
+ targetSymbol?: string | undefined;
159
189
  amount?: string | undefined;
160
190
  fee?: string | undefined;
161
191
  htlcExpirationTimestamp?: string | undefined;
@@ -163,13 +193,15 @@ export declare const MsgRequestTransaction: {
163
193
  htlcCreationVout?: number | undefined;
164
194
  htlcVersion?: string | undefined;
165
195
  senderPubKey?: Uint8Array | undefined;
196
+ options?: string | undefined;
166
197
  } & {
167
198
  creator?: string | undefined;
168
199
  originChain?: string | undefined;
169
200
  originAddress?: string | undefined;
170
201
  targetChain?: string | undefined;
171
202
  targetAddress?: string | undefined;
172
- symbol?: string | undefined;
203
+ originSymbol?: string | undefined;
204
+ targetSymbol?: string | undefined;
173
205
  amount?: string | undefined;
174
206
  fee?: string | undefined;
175
207
  htlcExpirationTimestamp?: string | undefined;
@@ -177,6 +209,7 @@ export declare const MsgRequestTransaction: {
177
209
  htlcCreationVout?: number | undefined;
178
210
  htlcVersion?: string | undefined;
179
211
  senderPubKey?: Uint8Array | undefined;
212
+ options?: string | undefined;
180
213
  } & { [K in Exclude<keyof I, keyof MsgRequestTransaction>]: never; }>(object: I): MsgRequestTransaction;
181
214
  };
182
215
  export declare const MsgRequestTransactionResponse: {
@@ -512,6 +545,84 @@ export declare const MsgHtlcReclaimResponse: {
512
545
  toJSON(_: MsgHtlcReclaimResponse): unknown;
513
546
  fromPartial<I extends {} & {} & { [K in Exclude<keyof I, never>]: never; }>(_: I): MsgHtlcReclaimResponse;
514
547
  };
548
+ export declare const MsgUpdateLiquidityProvisionParams: {
549
+ encode(message: MsgUpdateLiquidityProvisionParams, writer?: _m0.Writer): _m0.Writer;
550
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateLiquidityProvisionParams;
551
+ fromJSON(object: any): MsgUpdateLiquidityProvisionParams;
552
+ toJSON(message: MsgUpdateLiquidityProvisionParams): unknown;
553
+ fromPartial<I extends {
554
+ authority?: string | undefined;
555
+ maxBTC?: string | undefined;
556
+ maxUSDT?: string | undefined;
557
+ } & {
558
+ authority?: string | undefined;
559
+ maxBTC?: string | undefined;
560
+ maxUSDT?: string | undefined;
561
+ } & { [K in Exclude<keyof I, keyof MsgUpdateLiquidityProvisionParams>]: never; }>(object: I): MsgUpdateLiquidityProvisionParams;
562
+ };
563
+ export declare const MsgUpdateLiquidityProvisionParamsResponse: {
564
+ encode(_: MsgUpdateLiquidityProvisionParamsResponse, writer?: _m0.Writer): _m0.Writer;
565
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateLiquidityProvisionParamsResponse;
566
+ fromJSON(_: any): MsgUpdateLiquidityProvisionParamsResponse;
567
+ toJSON(_: MsgUpdateLiquidityProvisionParamsResponse): unknown;
568
+ fromPartial<I extends {} & {} & { [K in Exclude<keyof I, never>]: never; }>(_: I): MsgUpdateLiquidityProvisionParamsResponse;
569
+ };
570
+ export declare const MsgUpdateTransferLimitParams: {
571
+ encode(message: MsgUpdateTransferLimitParams, writer?: _m0.Writer): _m0.Writer;
572
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateTransferLimitParams;
573
+ fromJSON(object: any): MsgUpdateTransferLimitParams;
574
+ toJSON(message: MsgUpdateTransferLimitParams): unknown;
575
+ fromPartial<I extends {
576
+ authority?: string | undefined;
577
+ maxBTC?: string | undefined;
578
+ maxUSDT?: string | undefined;
579
+ } & {
580
+ authority?: string | undefined;
581
+ maxBTC?: string | undefined;
582
+ maxUSDT?: string | undefined;
583
+ } & { [K in Exclude<keyof I, keyof MsgUpdateTransferLimitParams>]: never; }>(object: I): MsgUpdateTransferLimitParams;
584
+ };
585
+ export declare const MsgUpdateTransferLimitParamsResponse: {
586
+ encode(_: MsgUpdateTransferLimitParamsResponse, writer?: _m0.Writer): _m0.Writer;
587
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgUpdateTransferLimitParamsResponse;
588
+ fromJSON(_: any): MsgUpdateTransferLimitParamsResponse;
589
+ toJSON(_: MsgUpdateTransferLimitParamsResponse): unknown;
590
+ fromPartial<I extends {} & {} & { [K in Exclude<keyof I, never>]: never; }>(_: I): MsgUpdateTransferLimitParamsResponse;
591
+ };
592
+ export declare const MsgFinalizeWithdrawTransaction: {
593
+ encode(message: MsgFinalizeWithdrawTransaction, writer?: _m0.Writer): _m0.Writer;
594
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeWithdrawTransaction;
595
+ fromJSON(object: any): MsgFinalizeWithdrawTransaction;
596
+ toJSON(message: MsgFinalizeWithdrawTransaction): unknown;
597
+ fromPartial<I extends {
598
+ creator?: string | undefined;
599
+ txId?: number | undefined;
600
+ txHash?: string | undefined;
601
+ success?: boolean | undefined;
602
+ signedKey?: string | undefined;
603
+ errReason?: string | undefined;
604
+ } & {
605
+ creator?: string | undefined;
606
+ txId?: number | undefined;
607
+ txHash?: string | undefined;
608
+ success?: boolean | undefined;
609
+ signedKey?: string | undefined;
610
+ errReason?: string | undefined;
611
+ } & { [K in Exclude<keyof I, keyof MsgFinalizeWithdrawTransaction>]: never; }>(object: I): MsgFinalizeWithdrawTransaction;
612
+ };
613
+ export declare const MsgFinalizeWithdrawTransactionResponse: {
614
+ encode(message: MsgFinalizeWithdrawTransactionResponse, writer?: _m0.Writer): _m0.Writer;
615
+ decode(input: _m0.Reader | Uint8Array, length?: number): MsgFinalizeWithdrawTransactionResponse;
616
+ fromJSON(object: any): MsgFinalizeWithdrawTransactionResponse;
617
+ toJSON(message: MsgFinalizeWithdrawTransactionResponse): unknown;
618
+ fromPartial<I extends {
619
+ code?: string | undefined;
620
+ msg?: string | undefined;
621
+ } & {
622
+ code?: string | undefined;
623
+ msg?: string | undefined;
624
+ } & { [K in Exclude<keyof I, keyof MsgFinalizeWithdrawTransactionResponse>]: never; }>(object: I): MsgFinalizeWithdrawTransactionResponse;
625
+ };
515
626
  /** Msg defines the Msg service. */
516
627
  export interface Msg {
517
628
  RequestTransaction(request: MsgRequestTransaction): Promise<MsgRequestTransactionResponse>;
@@ -525,6 +636,9 @@ export interface Msg {
525
636
  FinalizeDrainTransaction(request: MsgFinalizeDrainTransaction): Promise<MsgFinalizeDrainTransactionResponse>;
526
637
  RequestHtlcLock(request: MsgRequestHtlcLock): Promise<MsgRequestHtlcLockResponse>;
527
638
  HtlcReclaim(request: MsgHtlcReclaim): Promise<MsgHtlcReclaimResponse>;
639
+ UpdateLiquidityProvisionParams(request: MsgUpdateLiquidityProvisionParams): Promise<MsgUpdateLiquidityProvisionParamsResponse>;
640
+ UpdateTransferLimitParams(request: MsgUpdateTransferLimitParams): Promise<MsgUpdateTransferLimitParamsResponse>;
641
+ FinalizeWithdrawTransaction(request: MsgFinalizeWithdrawTransaction): Promise<MsgFinalizeWithdrawTransactionResponse>;
528
642
  }
529
643
  export declare class MsgClientImpl implements Msg {
530
644
  private readonly rpc;
@@ -540,6 +654,9 @@ export declare class MsgClientImpl implements Msg {
540
654
  FinalizeDrainTransaction(request: MsgFinalizeDrainTransaction): Promise<MsgFinalizeDrainTransactionResponse>;
541
655
  RequestHtlcLock(request: MsgRequestHtlcLock): Promise<MsgRequestHtlcLockResponse>;
542
656
  HtlcReclaim(request: MsgHtlcReclaim): Promise<MsgHtlcReclaimResponse>;
657
+ UpdateLiquidityProvisionParams(request: MsgUpdateLiquidityProvisionParams): Promise<MsgUpdateLiquidityProvisionParamsResponse>;
658
+ UpdateTransferLimitParams(request: MsgUpdateTransferLimitParams): Promise<MsgUpdateTransferLimitParamsResponse>;
659
+ FinalizeWithdrawTransaction(request: MsgFinalizeWithdrawTransaction): Promise<MsgFinalizeWithdrawTransactionResponse>;
543
660
  }
544
661
  interface Rpc {
545
662
  request(service: string, method: string, data: Uint8Array): Promise<Uint8Array>;