mmn-client-js 1.0.11 → 1.0.13

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.js CHANGED
@@ -7680,7 +7680,7 @@ const PRNG_CONSTANTS = {
7680
7680
  };
7681
7681
  const TX_TYPE = {
7682
7682
  TRANSFER: 0,
7683
- FAUCET: 1,
7683
+ PRIVATE_KEY: 1,
7684
7684
  };
7685
7685
  const DECIMALS = 6;
7686
7686
  class MmnClient {
@@ -7948,8 +7948,8 @@ class MmnClient {
7948
7948
  text_data: params.textData || '',
7949
7949
  nonce: params.nonce,
7950
7950
  extra_info: JSON.stringify(params.extraInfo) || '',
7951
- zk_proof: params.zkProof,
7952
- zk_pub: params.zkPub,
7951
+ zk_proof: params.zkProof || '',
7952
+ zk_pub: params.zkPub || '',
7953
7953
  };
7954
7954
  const signature = this.signTransaction(txMsg, params.privateKey);
7955
7955
  return {
@@ -7999,7 +7999,7 @@ class MmnClient {
7999
7999
  seed.fill(0);
8000
8000
  keyPair.secretKey.fill(0);
8001
8001
  // Return signature based on transaction type
8002
- if (tx.type === TX_TYPE.FAUCET) {
8002
+ if (tx.type === TX_TYPE.PRIVATE_KEY) {
8003
8003
  return bs58.encode(BufferCompat.from(signature));
8004
8004
  }
8005
8005
  // For regular transactions, wrap signature with public key
@@ -8047,6 +8047,13 @@ class MmnClient {
8047
8047
  });
8048
8048
  return this.addTx(signedTx);
8049
8049
  }
8050
+ async sendTransactionByPrivateKey(params) {
8051
+ const signedTx = this.createAndSignTx({
8052
+ ...params,
8053
+ type: TX_TYPE.PRIVATE_KEY,
8054
+ });
8055
+ return this.addTx(signedTx);
8056
+ }
8050
8057
  /**
8051
8058
  * Get current nonce for an account
8052
8059
  */