mmn-client-js 1.0.12 → 1.0.13-node14

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/dist/index.d.ts CHANGED
@@ -29,8 +29,8 @@ interface ExtraInfo {
29
29
  ItemId?: string;
30
30
  ItemType?: string;
31
31
  ClanId?: string;
32
- UserSenderId: string;
33
- UserSenderUsername: string;
32
+ UserSenderId?: string;
33
+ UserSenderUsername?: string;
34
34
  UserReceiverId?: string;
35
35
  ChannelId?: string;
36
36
  MessageRefId?: string;
@@ -53,18 +53,20 @@ interface SignedTx {
53
53
  tx_msg: TxMsg;
54
54
  signature: string;
55
55
  }
56
- interface SendTransactionRequest {
56
+ interface SendTransactionBase {
57
57
  sender: string;
58
58
  recipient: string;
59
59
  amount: string;
60
60
  nonce: number;
61
61
  timestamp?: number;
62
62
  textData?: string;
63
- extraInfo?: ExtraInfo;
64
- publicKey: string;
65
63
  privateKey: string;
64
+ extraInfo?: ExtraInfo;
65
+ }
66
+ interface SendTransactionRequest extends SendTransactionBase {
66
67
  zkProof: string;
67
68
  zkPub: string;
69
+ publicKey: string;
68
70
  }
69
71
  interface AddTxResponse {
70
72
  ok: boolean;
@@ -259,7 +261,7 @@ declare class MmnClient {
259
261
  */
260
262
  sendTransaction(params: SendTransactionRequest): Promise<AddTxResponse>;
261
263
  sendTransactionByAddress(params: SendTransactionRequest): Promise<AddTxResponse>;
262
- sendTransactionByPrivateKey(params: SendTransactionRequest): Promise<AddTxResponse>;
264
+ sendTransactionByPrivateKey(params: SendTransactionBase): Promise<AddTxResponse>;
263
265
  /**
264
266
  * Get current nonce for an account
265
267
  */
@@ -281,4 +283,4 @@ declare class ZkClient {
281
283
  }
282
284
 
283
285
  export { ETransferType, EZkClientType, IndexerClient, MmnClient, ZkClient, createMmnClient };
284
- export type { AddTxResponse, ExtraInfo, GetAccountByAddressResponse, GetCurrentNonceResponse, GetZkProofRequest, IEphemeralKeyPair, IZkProof, IndexerClientConfig, JsonRpcError, JsonRpcRequest, JsonRpcResponse, ListTransactionResponse, Meta, MmnClientConfig, SendTransactionRequest, SignedTx, Transaction, TransactionDetailResponse, TxMsg, WalletDetail, WalletDetailResponse, ZkClientConfig };
286
+ export type { AddTxResponse, ExtraInfo, GetAccountByAddressResponse, GetCurrentNonceResponse, GetZkProofRequest, IEphemeralKeyPair, IZkProof, IndexerClientConfig, JsonRpcError, JsonRpcRequest, JsonRpcResponse, ListTransactionResponse, Meta, MmnClientConfig, SendTransactionBase, SendTransactionRequest, SignedTx, Transaction, TransactionDetailResponse, TxMsg, WalletDetail, WalletDetailResponse, ZkClientConfig };
package/dist/index.esm.js CHANGED
@@ -7946,8 +7946,8 @@ class MmnClient {
7946
7946
  text_data: params.textData || '',
7947
7947
  nonce: params.nonce,
7948
7948
  extra_info: JSON.stringify(params.extraInfo) || '',
7949
- zk_proof: params.zkProof,
7950
- zk_pub: params.zkPub,
7949
+ zk_proof: params.zkProof || '',
7950
+ zk_pub: params.zkPub || '',
7951
7951
  };
7952
7952
  const signature = this.signTransaction(txMsg, params.privateKey);
7953
7953
  return {