@taquito/sapling 19.0.2 → 19.1.0-RC.2

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/README.md CHANGED
@@ -78,7 +78,7 @@ const shieldedTx = await saplingToolkit.prepareShieldedTransaction([{
78
78
 
79
79
  // Inject the sapling transaction using the ContractAbstraction
80
80
  // The amount MUST be specified in the send method to transfer the 3 tez to the shielded pool
81
- const op = await saplingContract.methods.default([shieldedTx]).send({ amount: 3 });
81
+ const op = await saplingContract.methodsObject.default([shieldedTx]).send({ amount: 3 });
82
82
  await op.confirmation();
83
83
  ```
84
84
 
@@ -87,7 +87,7 @@ class SaplingForger {
87
87
  ]);
88
88
  }
89
89
  forgeTransactionPlaintext(txPlainText) {
90
- const encodedMemo = Buffer.from((0, utils_1.char2Bytes)(txPlainText.memo).padEnd(txPlainText.memoSize, '0'), 'hex');
90
+ const encodedMemo = Buffer.from((0, utils_1.stringToBytes)(txPlainText.memo).padEnd(txPlainText.memoSize, '0'), 'hex');
91
91
  return Buffer.concat([
92
92
  txPlainText.diversifier,
93
93
  (0, utils_1.toHexBuf)(new bignumber_js_1.default(txPlainText.amount), 64),
@@ -5,7 +5,7 @@ const utils_1 = require("@taquito/utils");
5
5
  const bignumber_js_1 = require("bignumber.js");
6
6
  function memoHexToUtf8(memo) {
7
7
  const memoNoPadding = removeZeroPaddedBytesRight(memo);
8
- return memoNoPadding === '' ? memoNoPadding : (0, utils_1.bytes2Char)(memoNoPadding);
8
+ return memoNoPadding === '' ? memoNoPadding : (0, utils_1.bytesToString)(memoNoPadding);
9
9
  }
10
10
  exports.memoHexToUtf8 = memoHexToUtf8;
11
11
  function removeZeroPaddedBytesRight(memo) {
@@ -3,6 +3,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
4
  // IMPORTANT: THIS FILE IS AUTO GENERATED! DO NOT MANUALLY EDIT OR CHECKIN!
5
5
  exports.VERSION = {
6
- "commitHash": "13a12ab7cf442043526745db2bbf4ef3b089c34a",
7
- "version": "19.0.2"
6
+ "commitHash": "1aa9945ea2318318f16f494216a1c09801fa4bf8",
7
+ "version": "19.1.0-RC.2"
8
8
  };
@@ -1,6 +1,6 @@
1
1
  import BigNumber from 'bignumber.js';
2
2
  import { MichelCodecPacker } from '@taquito/taquito';
3
- import { b58cencode, prefix, Prefix, bytes2Char, toHexBuf, char2Bytes, hex2buf, mergebuf, hex2Bytes, num2PaddedHex, b58cdecode, format, validateKeyHash, ValidationResult, invalidDetail } from '@taquito/utils';
3
+ import { b58cencode, prefix, Prefix, bytesToString, toHexBuf, stringToBytes, hex2buf, mergebuf, hex2Bytes, num2PaddedHex, b58cdecode, format, validateKeyHash, ValidationResult, invalidDetail } from '@taquito/utils';
4
4
  import { ParameterValidationError, TaquitoError, InvalidKeyHashError, InvalidAddressError } from '@taquito/core';
5
5
  import * as sapling from '@airgap/sapling-wasm';
6
6
  import { merkleHash } from '@airgap/sapling-wasm';
@@ -144,7 +144,7 @@ class SaplingTransactionViewerError extends TaquitoError {
144
144
 
145
145
  function memoHexToUtf8(memo) {
146
146
  const memoNoPadding = removeZeroPaddedBytesRight(memo);
147
- return memoNoPadding === '' ? memoNoPadding : bytes2Char(memoNoPadding);
147
+ return memoNoPadding === '' ? memoNoPadding : bytesToString(memoNoPadding);
148
148
  }
149
149
  function removeZeroPaddedBytesRight(memo) {
150
150
  const matchZeroRight = memo.match(/^(.*?)(00)+$/);
@@ -248,7 +248,7 @@ class SaplingForger {
248
248
  ]);
249
249
  }
250
250
  forgeTransactionPlaintext(txPlainText) {
251
- const encodedMemo = Buffer.from(char2Bytes(txPlainText.memo).padEnd(txPlainText.memoSize, '0'), 'hex');
251
+ const encodedMemo = Buffer.from(stringToBytes(txPlainText.memo).padEnd(txPlainText.memoSize, '0'), 'hex');
252
252
  return Buffer.concat([
253
253
  txPlainText.diversifier,
254
254
  toHexBuf(new BigNumber(txPlainText.amount), 64),
@@ -157,7 +157,7 @@
157
157
 
158
158
  function memoHexToUtf8(memo) {
159
159
  const memoNoPadding = removeZeroPaddedBytesRight(memo);
160
- return memoNoPadding === '' ? memoNoPadding : utils.bytes2Char(memoNoPadding);
160
+ return memoNoPadding === '' ? memoNoPadding : utils.bytesToString(memoNoPadding);
161
161
  }
162
162
  function removeZeroPaddedBytesRight(memo) {
163
163
  const matchZeroRight = memo.match(/^(.*?)(00)+$/);
@@ -261,7 +261,7 @@
261
261
  ]);
262
262
  }
263
263
  forgeTransactionPlaintext(txPlainText) {
264
- const encodedMemo = Buffer.from(utils.char2Bytes(txPlainText.memo).padEnd(txPlainText.memoSize, '0'), 'hex');
264
+ const encodedMemo = Buffer.from(utils.stringToBytes(txPlainText.memo).padEnd(txPlainText.memoSize, '0'), 'hex');
265
265
  return Buffer.concat([
266
266
  txPlainText.diversifier,
267
267
  utils.toHexBuf(new BigNumber(txPlainText.amount), 64),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@taquito/sapling",
3
- "version": "19.0.2",
3
+ "version": "19.1.0-RC.2",
4
4
  "description": "Allows reading and preparing sapling transactions",
5
5
  "keywords": [
6
6
  "tezos",
@@ -68,10 +68,10 @@
68
68
  "@airgap/sapling-wasm": "0.0.9",
69
69
  "@stablelib/nacl": "^1.0.4",
70
70
  "@stablelib/random": "^1.0.2",
71
- "@taquito/core": "^19.0.2",
72
- "@taquito/rpc": "^19.0.2",
73
- "@taquito/taquito": "^19.0.2",
74
- "@taquito/utils": "^19.0.2",
71
+ "@taquito/core": "^19.1.0-RC.2",
72
+ "@taquito/rpc": "^19.1.0-RC.2",
73
+ "@taquito/taquito": "^19.1.0-RC.2",
74
+ "@taquito/utils": "^19.1.0-RC.2",
75
75
  "bignumber.js": "^9.1.2",
76
76
  "bip39": "3.1.0",
77
77
  "blakejs": "^1.2.1",
@@ -106,5 +106,5 @@
106
106
  "ts-node": "^10.9.1",
107
107
  "typescript": "~5.2.2"
108
108
  },
109
- "gitHead": "ede4790173abf0f153b87fec23a36e1b2b8114e2"
109
+ "gitHead": "72feb924392ac02aa06f08a9c4f535a876ac57d8"
110
110
  }