@taquito/sapling 24.2.0 → 24.3.0-beta.0
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/lib/errors.js +10 -10
- package/dist/lib/sapling-forger/sapling-forger.js +3 -3
- package/dist/lib/sapling-keys/helpers.js +3 -3
- package/dist/lib/sapling-keys/in-memory-proving-key.js +16 -30
- package/dist/lib/sapling-keys/in-memory-spending-key.js +48 -68
- package/dist/lib/sapling-keys/in-memory-viewing-key.js +20 -37
- package/dist/lib/sapling-module-wrapper.js +33 -57
- package/dist/lib/sapling-state/sapling-state.js +83 -106
- package/dist/lib/sapling-state/utils.js +7 -18
- package/dist/lib/sapling-tx-builder/sapling-transactions-builder.js +194 -216
- package/dist/lib/sapling-tx-viewer/sapling-transaction-viewer.js +98 -135
- package/dist/lib/taquito-sapling.js +84 -119
- package/dist/lib/version.js +2 -2
- package/dist/taquito-sapling.es6.js +605 -727
- package/dist/taquito-sapling.es6.js.map +1 -1
- package/dist/taquito-sapling.umd.js +604 -726
- package/dist/taquito-sapling.umd.js.map +1 -1
- package/dist/types/constants.d.ts +1 -1
- package/dist/types/errors.d.ts +11 -8
- package/dist/types/sapling-forger/sapling-forger.d.ts +5 -5
- package/dist/types/sapling-keys/helpers.d.ts +1 -1
- package/dist/types/sapling-keys/in-memory-proving-key.d.ts +3 -4
- package/dist/types/sapling-keys/in-memory-spending-key.d.ts +4 -5
- package/dist/types/sapling-keys/in-memory-viewing-key.d.ts +9 -9
- package/dist/types/sapling-module-wrapper.d.ts +11 -11
- package/dist/types/sapling-state/sapling-state.d.ts +1 -1
- package/dist/types/sapling-state/utils.d.ts +1 -1
- package/dist/types/sapling-tx-builder/sapling-transactions-builder.d.ts +3 -3
- package/dist/types/sapling-tx-viewer/helpers.d.ts +1 -1
- package/dist/types/sapling-tx-viewer/sapling-transaction-viewer.d.ts +4 -4
- package/dist/types/taquito-sapling.d.ts +5 -5
- package/package.json +26 -13
- package/LICENSE +0 -202
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"taquito-sapling.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"taquito-sapling.umd.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const KDF_KEY = "KDFSaplingForTezosV1";
|
|
2
2
|
export declare const OCK_KEY = "OCK_keystringderivation_TEZOS";
|
|
3
3
|
export declare const DEFAULT_MEMO = "";
|
|
4
|
-
export declare const DEFAULT_BOUND_DATA: Buffer
|
|
4
|
+
export declare const DEFAULT_BOUND_DATA: Buffer<ArrayBuffer>;
|
package/dist/types/errors.d.ts
CHANGED
|
@@ -1,16 +1,19 @@
|
|
|
1
1
|
import { ParameterValidationError, TaquitoError } from '@taquito/core';
|
|
2
2
|
/**
|
|
3
3
|
* @category Error
|
|
4
|
-
*
|
|
4
|
+
* Error indicates the spending key is invalid
|
|
5
5
|
*/
|
|
6
6
|
export declare class InvalidSpendingKey extends ParameterValidationError {
|
|
7
|
-
|
|
7
|
+
/**
|
|
8
|
+
* @deprecated Use `new InvalidSpendingKey(errorDetail)` instead. The spending key argument is ignored for security reasons.
|
|
9
|
+
*/
|
|
10
|
+
constructor(_sk: string, errorDetail: string);
|
|
11
|
+
constructor(errorDetail: string);
|
|
8
12
|
readonly errorDetail: string;
|
|
9
|
-
constructor(sk: string, errorDetail: string);
|
|
10
13
|
}
|
|
11
14
|
/**
|
|
12
15
|
* @category Error
|
|
13
|
-
*
|
|
16
|
+
* Error indicates an invalid Merkle tree being passed
|
|
14
17
|
*/
|
|
15
18
|
export declare class InvalidMerkleTreeError extends ParameterValidationError {
|
|
16
19
|
readonly root: string;
|
|
@@ -18,7 +21,7 @@ export declare class InvalidMerkleTreeError extends ParameterValidationError {
|
|
|
18
21
|
}
|
|
19
22
|
/**
|
|
20
23
|
* @category Error
|
|
21
|
-
*
|
|
24
|
+
* Error indicates a failure when trying to construct the Merkle tree
|
|
22
25
|
*/
|
|
23
26
|
export declare class TreeConstructionFailure extends TaquitoError {
|
|
24
27
|
readonly message: string;
|
|
@@ -26,7 +29,7 @@ export declare class TreeConstructionFailure extends TaquitoError {
|
|
|
26
29
|
}
|
|
27
30
|
/**
|
|
28
31
|
* @category Error
|
|
29
|
-
*
|
|
32
|
+
* Error indicates the memo is invalid
|
|
30
33
|
*/
|
|
31
34
|
export declare class InvalidMemo extends ParameterValidationError {
|
|
32
35
|
readonly memo: string;
|
|
@@ -35,7 +38,7 @@ export declare class InvalidMemo extends ParameterValidationError {
|
|
|
35
38
|
}
|
|
36
39
|
/**
|
|
37
40
|
* @category Error
|
|
38
|
-
*
|
|
41
|
+
* Error indicates not enough balance to prepare the sapling transaction
|
|
39
42
|
*/
|
|
40
43
|
export declare class InsufficientBalance extends TaquitoError {
|
|
41
44
|
readonly realBalance: string;
|
|
@@ -44,7 +47,7 @@ export declare class InsufficientBalance extends TaquitoError {
|
|
|
44
47
|
}
|
|
45
48
|
/**
|
|
46
49
|
* @category Error
|
|
47
|
-
*
|
|
50
|
+
* Error indicates SaplingTransactionViewer failure
|
|
48
51
|
*/
|
|
49
52
|
export declare class SaplingTransactionViewerError extends TaquitoError {
|
|
50
53
|
readonly message: string;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { SaplingTransactionInput, SaplingTransaction, SaplingTransactionOutput, SaplingTransactionPlaintext } from '../types';
|
|
2
2
|
export declare class SaplingForger {
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* Forge sapling transactions
|
|
5
5
|
* @param spendDescriptions the list of spend descriptions
|
|
6
6
|
* @param outputDescriptions the list of output descriptions
|
|
7
7
|
* @param signature signature hash
|
|
@@ -11,19 +11,19 @@ export declare class SaplingForger {
|
|
|
11
11
|
*/
|
|
12
12
|
forgeSaplingTransaction(tx: SaplingTransaction): Buffer;
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* Forge list of spend descriptions
|
|
15
15
|
* @param spendDescriptions list of spend descriptions
|
|
16
16
|
* @returns concatenated forged bytes of type Buffer
|
|
17
17
|
*/
|
|
18
18
|
forgeSpendDescriptions(spendDescriptions: SaplingTransactionInput[]): Buffer;
|
|
19
19
|
forgeSpendDescription(desc: SaplingTransactionInput): Buffer;
|
|
20
20
|
/**
|
|
21
|
-
*
|
|
21
|
+
* Forge list of output descriptions
|
|
22
22
|
* @param outputDescriptions list of output descriptions
|
|
23
23
|
* @returns concatenated forged bytes of type Buffer
|
|
24
24
|
*/
|
|
25
25
|
forgeOutputDescriptions(outputDescriptions: SaplingTransactionOutput[]): Buffer;
|
|
26
26
|
forgeOutputDescription(desc: SaplingTransactionOutput): Buffer;
|
|
27
|
-
forgeUnsignedTxInput(unsignedSpendDescription: Omit<SaplingTransactionInput, 'signature'>): Buffer
|
|
28
|
-
forgeTransactionPlaintext(txPlainText: SaplingTransactionPlaintext): Buffer
|
|
27
|
+
forgeUnsignedTxInput(unsignedSpendDescription: Omit<SaplingTransactionInput, 'signature'>): Buffer<ArrayBuffer>;
|
|
28
|
+
forgeTransactionPlaintext(txPlainText: SaplingTransactionPlaintext): Buffer<ArrayBuffer>;
|
|
29
29
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare function decryptKey(spendingKey: string, password?: string): Buffer
|
|
1
|
+
export declare function decryptKey(spendingKey: string, password?: string): Buffer<ArrayBufferLike>;
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ParametersSpendProof, SaplingSpendDescription } from '../types';
|
|
2
2
|
/**
|
|
3
|
-
*
|
|
3
|
+
* holds the proving key, create proof for spend descriptions
|
|
4
4
|
* The class can be instantiated from a proving key or a spending key
|
|
5
5
|
*/
|
|
6
6
|
export declare class InMemoryProvingKey {
|
|
7
7
|
#private;
|
|
8
8
|
constructor(provingKey: string);
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* Allows to instantiate the InMemoryProvingKey from an encrypted/unencrypted spending key
|
|
11
11
|
*
|
|
12
12
|
* @param spendingKey Base58Check-encoded spending key
|
|
13
13
|
* @param password Optional password to decrypt the spending key
|
|
@@ -19,7 +19,7 @@ export declare class InMemoryProvingKey {
|
|
|
19
19
|
*/
|
|
20
20
|
static fromSpendingKey(spendingKey: string, password?: string): Promise<InMemoryProvingKey>;
|
|
21
21
|
/**
|
|
22
|
-
*
|
|
22
|
+
* Prepare an unsigned sapling spend description using the proving key
|
|
23
23
|
*
|
|
24
24
|
* @param parametersSpendProof.saplingContext The sapling proving context
|
|
25
25
|
* @param parametersSpendProof.address The address of the input
|
|
@@ -28,7 +28,6 @@ export declare class InMemoryProvingKey {
|
|
|
28
28
|
* @param parametersSpendProof.amount The value of the input
|
|
29
29
|
* @param parametersSpendProof.root The root of the merkle tree
|
|
30
30
|
* @param parametersSpendProof.witness The path of the commitment in the tree
|
|
31
|
-
* @param derivationPath tezos current standard 'm/'
|
|
32
31
|
* @returns The unsinged spend description
|
|
33
32
|
*/
|
|
34
33
|
prepareSpendDescription(parametersSpendProof: Omit<ParametersSpendProof, 'spendingKey'>): Promise<Omit<SaplingSpendDescription, 'signature'>>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InMemoryViewingKey } from './in-memory-viewing-key';
|
|
2
2
|
import { ParametersSpendProof, ParametersSpendSig, SaplingSpendDescription, SaplingTransactionInput } from '../types';
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* holds the spending key, create proof and signature for spend descriptions
|
|
5
5
|
* can instantiate from mnemonic word list or decrypt a encrypted spending key
|
|
6
6
|
* with access to instantiate a InMemoryViewingKey
|
|
7
7
|
*/
|
|
@@ -26,7 +26,7 @@ export declare class InMemorySpendingKey {
|
|
|
26
26
|
*/
|
|
27
27
|
getSaplingViewingKeyProvider(): Promise<InMemoryViewingKey>;
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
29
|
+
* Prepare an unsigned sapling spend description using the spending key
|
|
30
30
|
* @param parametersSpendProof.saplingContext The sapling proving context
|
|
31
31
|
* @param parametersSpendProof.address The address of the input
|
|
32
32
|
* @param parametersSpendProof.randomCommitmentTrapdoor The randomness of the commitment
|
|
@@ -34,12 +34,11 @@ export declare class InMemorySpendingKey {
|
|
|
34
34
|
* @param parametersSpendProof.amount The value of the input
|
|
35
35
|
* @param parametersSpendProof.root The root of the merkle tree
|
|
36
36
|
* @param parametersSpendProof.witness The path of the commitment in the tree
|
|
37
|
-
* @param derivationPath tezos current standard 'm/'
|
|
38
37
|
* @returns The unsigned spend description
|
|
39
38
|
*/
|
|
40
39
|
prepareSpendDescription(parametersSpendProof: ParametersSpendProof): Promise<Omit<SaplingSpendDescription, 'signature'>>;
|
|
41
40
|
/**
|
|
42
|
-
*
|
|
41
|
+
* Sign a sapling spend description
|
|
43
42
|
* @param parametersSpendSig.publicKeyReRandomization The re-randomization of the public key
|
|
44
43
|
* @param parametersSpendSig.unsignedSpendDescription The unsigned Spend description
|
|
45
44
|
* @param parametersSpendSig.hash The data to be signed
|
|
@@ -47,7 +46,7 @@ export declare class InMemorySpendingKey {
|
|
|
47
46
|
*/
|
|
48
47
|
signSpendDescription(parametersSpendSig: ParametersSpendSig): Promise<SaplingTransactionInput>;
|
|
49
48
|
/**
|
|
50
|
-
*
|
|
49
|
+
* Return a proof authorizing key from the configured spending key
|
|
51
50
|
*/
|
|
52
51
|
getProvingKey(): Promise<string>;
|
|
53
52
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* Holds the viewing key
|
|
3
3
|
*/
|
|
4
4
|
export declare class InMemoryViewingKey {
|
|
5
5
|
#private;
|
|
6
6
|
constructor(fullViewingKey: string);
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Allows to instantiate the InMemoryViewingKey from an encrypted/unencrypted spending key
|
|
9
9
|
*
|
|
10
10
|
* @param spendingKey Base58Check-encoded spending key
|
|
11
11
|
* @param password Optional password to decrypt the spending key
|
|
@@ -17,25 +17,25 @@ export declare class InMemoryViewingKey {
|
|
|
17
17
|
*/
|
|
18
18
|
static fromSpendingKey(spendingKey: string, password?: string): Promise<InMemoryViewingKey>;
|
|
19
19
|
/**
|
|
20
|
-
*
|
|
20
|
+
* Retrieve the full viewing key
|
|
21
21
|
* @returns Buffer representing the full viewing key
|
|
22
22
|
*
|
|
23
23
|
*/
|
|
24
|
-
getFullViewingKey(): Buffer
|
|
24
|
+
getFullViewingKey(): Buffer<ArrayBufferLike>;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
26
|
+
* Retrieve the outgoing viewing key
|
|
27
27
|
* @returns Buffer representing the outgoing viewing key
|
|
28
28
|
*
|
|
29
29
|
*/
|
|
30
|
-
getOutgoingViewingKey(): Promise<Buffer
|
|
30
|
+
getOutgoingViewingKey(): Promise<Buffer<ArrayBufferLike>>;
|
|
31
31
|
/**
|
|
32
|
-
*
|
|
32
|
+
* Retrieve the incoming viewing key
|
|
33
33
|
* @returns Buffer representing the incoming viewing key
|
|
34
34
|
*
|
|
35
35
|
*/
|
|
36
|
-
getIncomingViewingKey(): Promise<Buffer
|
|
36
|
+
getIncomingViewingKey(): Promise<Buffer<ArrayBufferLike>>;
|
|
37
37
|
/**
|
|
38
|
-
*
|
|
38
|
+
* Retrieve a payment address
|
|
39
39
|
* @param addressIndex used to determine which diversifier should be used to derive the address, default is 0
|
|
40
40
|
* @returns Base58Check-encoded address and its index
|
|
41
41
|
*
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
import { ParametersOutputProof } from './types';
|
|
2
2
|
export declare class SaplingWrapper {
|
|
3
3
|
withProvingContext<T>(action: (context: number) => Promise<T>): Promise<T>;
|
|
4
|
-
getRandomBytes(length: number): Uint8Array
|
|
5
|
-
randR(): Promise<Buffer
|
|
6
|
-
getOutgoingViewingKey(vk: Buffer): Promise<Buffer
|
|
4
|
+
getRandomBytes(length: number): Uint8Array<ArrayBufferLike>;
|
|
5
|
+
randR(): Promise<Buffer<ArrayBufferLike>>;
|
|
6
|
+
getOutgoingViewingKey(vk: Buffer): Promise<Buffer<ArrayBufferLike>>;
|
|
7
7
|
preparePartialOutputDescription(parametersOutputProof: ParametersOutputProof): Promise<{
|
|
8
|
-
commitmentValue: Buffer
|
|
9
|
-
commitment: Buffer
|
|
10
|
-
proof: Buffer
|
|
8
|
+
commitmentValue: Buffer<ArrayBufferLike>;
|
|
9
|
+
commitment: Buffer<ArrayBufferLike>;
|
|
10
|
+
proof: Buffer<ArrayBufferLike>;
|
|
11
11
|
}>;
|
|
12
|
-
getDiversifiedFromRawPaymentAddress(decodedDestination: Uint8Array): Promise<Buffer
|
|
13
|
-
deriveEphemeralPublicKey(diversifier: Buffer, esk: Buffer): Promise<Buffer
|
|
14
|
-
getPkdFromRawPaymentAddress(destination: Uint8Array): Promise<Buffer
|
|
15
|
-
keyAgreement(p: Buffer, sk: Buffer): Promise<Buffer
|
|
16
|
-
createBindingSignature(saplingContext: number, balance: string, transactionSigHash: Uint8Array): Promise<Buffer
|
|
12
|
+
getDiversifiedFromRawPaymentAddress(decodedDestination: Uint8Array): Promise<Buffer<ArrayBufferLike>>;
|
|
13
|
+
deriveEphemeralPublicKey(diversifier: Buffer, esk: Buffer): Promise<Buffer<ArrayBufferLike>>;
|
|
14
|
+
getPkdFromRawPaymentAddress(destination: Uint8Array): Promise<Buffer<ArrayBufferLike>>;
|
|
15
|
+
keyAgreement(p: Buffer, sk: Buffer): Promise<Buffer<ArrayBufferLike>>;
|
|
16
|
+
createBindingSignature(saplingContext: number, balance: string, transactionSigHash: Uint8Array): Promise<Buffer<ArrayBufferLike>>;
|
|
17
17
|
initSaplingParameters(): Promise<void>;
|
|
18
18
|
}
|
|
@@ -7,7 +7,7 @@ import { SaplingDiffResponse } from '@taquito/rpc';
|
|
|
7
7
|
import BigNumber from 'bignumber.js';
|
|
8
8
|
import { SaplingStateTree } from '../types';
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* The SaplingState class's main purpose is to provide a Merkle path for the forger and the transaction builder, so that it may verify that the Sapling transaction is valid
|
|
11
11
|
*
|
|
12
12
|
*/
|
|
13
13
|
export declare class SaplingState {
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
*/
|
|
6
6
|
export declare function pairNodes<T>(leaves: T[]): (T | undefined)[][];
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* helper function to assist in Lazy initializing an object
|
|
9
9
|
*/
|
|
10
10
|
export declare class Lazy<T> {
|
|
11
11
|
private readonly init;
|
|
@@ -15,7 +15,7 @@ export declare class SaplingTransactionBuilder {
|
|
|
15
15
|
createSaplingTx(saplingTransactionParams: SaplingTransactionParams[], txTotalAmount: BigNumber, boundData: Buffer, chosenInputs: ChosenSpendableInputs): Promise<{
|
|
16
16
|
inputs: SaplingTransactionInput[];
|
|
17
17
|
outputs: SaplingTransactionOutput[];
|
|
18
|
-
signature: Buffer
|
|
18
|
+
signature: Buffer<ArrayBufferLike>;
|
|
19
19
|
balance: BigNumber;
|
|
20
20
|
}>;
|
|
21
21
|
calculateTransactionBalance(inputTotal: string, outputTotal: string): BigNumber;
|
|
@@ -26,6 +26,6 @@ export declare class SaplingTransactionBuilder {
|
|
|
26
26
|
payBackOutput: SaplingTransactionOutput;
|
|
27
27
|
payBackAmount: string;
|
|
28
28
|
}>;
|
|
29
|
-
createBindingSignature(parametersBindingSig: ParametersBindingSig): Promise<Buffer
|
|
30
|
-
getAntiReplay(): Promise<Buffer
|
|
29
|
+
createBindingSignature(parametersBindingSig: ParametersBindingSig): Promise<Buffer<ArrayBufferLike>>;
|
|
30
|
+
getAntiReplay(): Promise<Buffer<ArrayBuffer>>;
|
|
31
31
|
}
|
|
@@ -7,4 +7,4 @@ export declare function readableFormat(saplingTransactionProperties: Omit<Input,
|
|
|
7
7
|
paymentAddress: string;
|
|
8
8
|
};
|
|
9
9
|
export declare function convertValueToBigNumber(value: Uint8Array): BigNumber;
|
|
10
|
-
export declare function bufToUint8Array(buffer: Buffer): Uint8Array
|
|
10
|
+
export declare function bufToUint8Array(buffer: Buffer): Uint8Array<ArrayBufferLike>;
|
|
@@ -3,7 +3,7 @@ import { InMemoryViewingKey } from '../sapling-keys/in-memory-viewing-key';
|
|
|
3
3
|
import { Input, SaplingContractId, SaplingIncomingAndOutgoingTransaction } from '../types';
|
|
4
4
|
import { TzReadProvider } from '@taquito/taquito';
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* Allows to retrieve and decrypt sapling transactions using on a viewing key
|
|
7
7
|
*
|
|
8
8
|
* @param inMemoryViewingKey Holds the sapling viewing key
|
|
9
9
|
* @param saplingContractId Address of the sapling contract or sapling id if the smart contract contains multiple sapling states
|
|
@@ -13,14 +13,14 @@ export declare class SaplingTransactionViewer {
|
|
|
13
13
|
#private;
|
|
14
14
|
constructor(inMemoryViewingKey: InMemoryViewingKey, saplingContractId: SaplingContractId, readProvider: TzReadProvider);
|
|
15
15
|
/**
|
|
16
|
-
*
|
|
16
|
+
* Retrieve the unspent balance associated with the configured viewing key and sapling state
|
|
17
17
|
*
|
|
18
18
|
* @returns the balance in mutez represented as a BigNumber
|
|
19
19
|
*
|
|
20
20
|
*/
|
|
21
21
|
getBalance(): Promise<BigNumber>;
|
|
22
22
|
/**
|
|
23
|
-
*
|
|
23
|
+
* Retrieve all the incoming and outgoing transactions associated with the configured viewing key.
|
|
24
24
|
* The response properties are in Uint8Array format; use the getIncomingAndOutgoingTransactions method for readable properties
|
|
25
25
|
*
|
|
26
26
|
*/
|
|
@@ -36,7 +36,7 @@ export declare class SaplingTransactionViewer {
|
|
|
36
36
|
outgoing: Omit<Input, "position">[];
|
|
37
37
|
}>;
|
|
38
38
|
/**
|
|
39
|
-
*
|
|
39
|
+
* Retrieve all the incoming and outgoing decoded transactions associated with the configured viewing key
|
|
40
40
|
*
|
|
41
41
|
*/
|
|
42
42
|
getIncomingAndOutgoingTransactions(): Promise<SaplingIncomingAndOutgoingTransaction>;
|
|
@@ -14,7 +14,7 @@ export { InMemoryViewingKey } from './sapling-keys/in-memory-viewing-key';
|
|
|
14
14
|
export { InMemorySpendingKey } from './sapling-keys/in-memory-spending-key';
|
|
15
15
|
export { InMemoryProvingKey } from './sapling-keys/in-memory-proving-key';
|
|
16
16
|
/**
|
|
17
|
-
*
|
|
17
|
+
* Class that surfaces all of the sapling capability allowing to read from a sapling state and prepare transactions
|
|
18
18
|
*
|
|
19
19
|
* @param keys.saplingSigner Holds the sapling spending key
|
|
20
20
|
* @param keys.saplingProver (Optional) Allows to generate the proofs with the proving key rather than the spending key
|
|
@@ -42,11 +42,11 @@ export declare class SaplingToolkit {
|
|
|
42
42
|
saplingProver?: InMemoryProvingKey;
|
|
43
43
|
}, saplingContractDetails: SaplingContractDetails, readProvider: TzReadProvider, packer?: MichelCodecPacker, saplingForger?: SaplingForger, saplingTxBuilder?: SaplingTransactionBuilder);
|
|
44
44
|
/**
|
|
45
|
-
*
|
|
45
|
+
* Get an instance of `SaplingTransactionViewer` which allows to retrieve and decrypt sapling transactions and calculate the unspent balance.
|
|
46
46
|
*/
|
|
47
47
|
getSaplingTransactionViewer(): Promise<SaplingTransactionViewer>;
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* Prepare a shielded transaction
|
|
50
50
|
* @param shieldedTxParams `to` is the payment address that will receive the shielded tokens (zet).
|
|
51
51
|
* `amount` is the amount of shielded tokens in tez by default.
|
|
52
52
|
* `mutez` needs to be set to true if the amount of shielded tokens is in mutez.
|
|
@@ -55,7 +55,7 @@ export declare class SaplingToolkit {
|
|
|
55
55
|
*/
|
|
56
56
|
prepareShieldedTransaction(shieldedTxParams: ParametersSaplingTransaction[]): Promise<string>;
|
|
57
57
|
/**
|
|
58
|
-
*
|
|
58
|
+
* Prepare an unshielded transaction
|
|
59
59
|
* @param unshieldedTxParams `to` is the Tezos address that will receive the unshielded tokens (tz1, tz2 or tz3).
|
|
60
60
|
* `amount` is the amount of unshielded tokens in tez by default.
|
|
61
61
|
* `mutez` needs to be set to true if the amount of unshielded tokens is in mutez.
|
|
@@ -63,7 +63,7 @@ export declare class SaplingToolkit {
|
|
|
63
63
|
*/
|
|
64
64
|
prepareUnshieldedTransaction(unshieldedTxParams: ParametersUnshieldedTransaction): Promise<string>;
|
|
65
65
|
/**
|
|
66
|
-
*
|
|
66
|
+
* Prepare a sapling transaction (zet to zet)
|
|
67
67
|
* @param saplingTxParams `to` is the payment address that will receive the shielded tokens (zet).
|
|
68
68
|
* `amount` is the amount of unshielded tokens in tez by default.
|
|
69
69
|
* `mutez` needs to be set to true if the amount of unshielded tokens is in mutez.
|
package/package.json
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@taquito/sapling",
|
|
3
|
-
"version": "24.
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "24.3.0-beta.0",
|
|
4
|
+
"description": "Sapling transaction building and viewing support for Taquito.",
|
|
5
5
|
"keywords": [
|
|
6
|
+
"taquito",
|
|
6
7
|
"tezos",
|
|
7
|
-
"
|
|
8
|
+
"typescript",
|
|
9
|
+
"sapling",
|
|
10
|
+
"privacy",
|
|
11
|
+
"shielded"
|
|
8
12
|
],
|
|
9
13
|
"main": "dist/taquito-sapling.umd.js",
|
|
10
14
|
"module": "dist/taquito-sapling.es6.js",
|
|
@@ -17,14 +21,24 @@
|
|
|
17
21
|
"publishConfig": {
|
|
18
22
|
"access": "public"
|
|
19
23
|
},
|
|
20
|
-
"author": "
|
|
24
|
+
"author": "ECAD Labs Inc <info@ecadlabs.com>",
|
|
25
|
+
"contributors": [
|
|
26
|
+
"Davis Sawali <davis.sawali@ecadlabs.com>",
|
|
27
|
+
"hui-an.yang <hui-an.yang@ecadlabs.com>",
|
|
28
|
+
"Roxane Letourneau <roxane@ecadlabs.com>",
|
|
29
|
+
"Jev Björsell (jevonearth)"
|
|
30
|
+
],
|
|
31
|
+
"homepage": "https://taquito.io/",
|
|
21
32
|
"repository": {
|
|
22
33
|
"type": "git",
|
|
23
|
-
"url": ""
|
|
34
|
+
"url": "git+https://github.com/ecadlabs/taquito.git"
|
|
35
|
+
},
|
|
36
|
+
"bugs": {
|
|
37
|
+
"url": "https://github.com/ecadlabs/taquito/issues"
|
|
24
38
|
},
|
|
25
39
|
"license": "Apache-2.0",
|
|
26
40
|
"engines": {
|
|
27
|
-
"node": ">=
|
|
41
|
+
"node": ">=22"
|
|
28
42
|
},
|
|
29
43
|
"scripts": {
|
|
30
44
|
"test": "jest --coverage",
|
|
@@ -68,10 +82,10 @@
|
|
|
68
82
|
"@airgap/sapling-wasm": "0.0.9",
|
|
69
83
|
"@stablelib/nacl": "^1.0.4",
|
|
70
84
|
"@stablelib/random": "^1.0.2",
|
|
71
|
-
"@taquito/core": "^24.
|
|
72
|
-
"@taquito/rpc": "^24.
|
|
73
|
-
"@taquito/taquito": "^24.
|
|
74
|
-
"@taquito/utils": "^24.
|
|
85
|
+
"@taquito/core": "^24.3.0-beta.0",
|
|
86
|
+
"@taquito/rpc": "^24.3.0-beta.0",
|
|
87
|
+
"@taquito/taquito": "^24.3.0-beta.0",
|
|
88
|
+
"@taquito/utils": "^24.3.0-beta.0",
|
|
75
89
|
"bignumber.js": "^9.1.2",
|
|
76
90
|
"bip39": "3.1.0",
|
|
77
91
|
"blakejs": "^1.2.1",
|
|
@@ -103,7 +117,6 @@
|
|
|
103
117
|
"shelljs": "^0.8.5",
|
|
104
118
|
"ts-jest": "^29.2.3",
|
|
105
119
|
"ts-node": "^10.9.2",
|
|
106
|
-
"typescript": "
|
|
107
|
-
}
|
|
108
|
-
"gitHead": "689f242c1780c9fe98c050819c55986912db3934"
|
|
120
|
+
"typescript": "^5.9.3"
|
|
121
|
+
}
|
|
109
122
|
}
|