@orbinum/sdk 0.25.0 → 0.25.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/dist/index.d.mts +34 -14
- package/dist/index.d.ts +34 -14
- package/dist/index.js +17 -6
- package/dist/index.mjs +16 -6
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -4,7 +4,7 @@ export { PolkadotSigner, getSs58AddressInfo } from 'polkadot-api';
|
|
|
4
4
|
import { getDynamicBuilder } from '@polkadot-api/metadata-builders';
|
|
5
5
|
import { getExtrinsicDecoder } from '@polkadot-api/tx-utils';
|
|
6
6
|
import { CircuitType, ArtifactProvider, ProofResult } from '@orbinum/proof-generator';
|
|
7
|
-
export { ArtifactProvider, CircuitType, ProofResult, WebArtifactProvider } from '@orbinum/proof-generator';
|
|
7
|
+
export { ArtifactProvider, CircuitType, ProofResult, WebArtifactProvider, shouldProveSingleThreaded } from '@orbinum/proof-generator';
|
|
8
8
|
export { AccountId, Blake2256, Keccak256, Storage, u128, u64 } from '@polkadot-api/substrate-bindings';
|
|
9
9
|
export { base58 } from '@scure/base';
|
|
10
10
|
export { getPolkadotSigner } from 'polkadot-api/signer';
|
|
@@ -1897,6 +1897,35 @@ declare function createNoteDisclosureKey(note: ZkNote): string;
|
|
|
1897
1897
|
*/
|
|
1898
1898
|
declare function decodeNoteDisclosureKey(key: string): NoteDisclosure | null;
|
|
1899
1899
|
|
|
1900
|
+
/**
|
|
1901
|
+
* The options every proof entry point accepts.
|
|
1902
|
+
*
|
|
1903
|
+
* One declaration instead of the same inline object repeated per circuit: the
|
|
1904
|
+
* three generators differ in their INPUTS, never in how a caller configures
|
|
1905
|
+
* proving, and a shape written three times drifts on the fourth.
|
|
1906
|
+
*/
|
|
1907
|
+
|
|
1908
|
+
interface ProofOptions {
|
|
1909
|
+
/** Where circuit artifacts come from. Defaults to the web provider. */
|
|
1910
|
+
provider?: ArtifactProvider;
|
|
1911
|
+
verbose?: boolean;
|
|
1912
|
+
/**
|
|
1913
|
+
* Prove on ONE thread instead of a Web Worker per logical core.
|
|
1914
|
+
*
|
|
1915
|
+
* Omit this. Left absent, `@orbinum/proof-generator` decides from the
|
|
1916
|
+
* device — and getting it wrong on a phone is not a slow proof but no proof
|
|
1917
|
+
* at all: `ffjavascript` spawns one worker per core, each with its own
|
|
1918
|
+
* `WebAssembly.Memory`, and a mobile browser's per-tab budget cannot hold
|
|
1919
|
+
* them. The transfer of the WASM buffer then fails with
|
|
1920
|
+
* `Data cannot be cloned, out of memory`.
|
|
1921
|
+
*
|
|
1922
|
+
* Pass it only when the host knows better than the heuristic — a desktop
|
|
1923
|
+
* app certain of its environment, or a benchmark pinning one mode. The
|
|
1924
|
+
* proof is byte-identical either way; only the wall-clock changes.
|
|
1925
|
+
*/
|
|
1926
|
+
singleThread?: boolean;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1900
1929
|
/** A single input note for a private transfer. */
|
|
1901
1930
|
interface TransferInputNote {
|
|
1902
1931
|
nullifier: bigint;
|
|
@@ -1934,10 +1963,7 @@ interface PrivateTransferProofInputs {
|
|
|
1934
1963
|
/**
|
|
1935
1964
|
* Generate a Groth16 proof for a PrivateTransfer operation.
|
|
1936
1965
|
*/
|
|
1937
|
-
declare function generateTransferProof(params: PrivateTransferProofInputs, options?:
|
|
1938
|
-
provider?: ArtifactProvider;
|
|
1939
|
-
verbose?: boolean;
|
|
1940
|
-
}): Promise<ProofResult>;
|
|
1966
|
+
declare function generateTransferProof(params: PrivateTransferProofInputs, options?: ProofOptions): Promise<ProofResult>;
|
|
1941
1967
|
|
|
1942
1968
|
/**
|
|
1943
1969
|
* Forest tree a note belongs to.
|
|
@@ -2590,10 +2616,7 @@ interface UnshieldProofResult extends ProofResult {
|
|
|
2590
2616
|
* @param options.provider - Override the artifact provider (default: CDN).
|
|
2591
2617
|
* @param options.verbose - Log proof generation steps to console.
|
|
2592
2618
|
*/
|
|
2593
|
-
declare function generateUnshieldProof(inputs: UnshieldProofInputs, options?:
|
|
2594
|
-
provider?: ArtifactProvider;
|
|
2595
|
-
verbose?: boolean;
|
|
2596
|
-
}): Promise<UnshieldProofResult>;
|
|
2619
|
+
declare function generateUnshieldProof(inputs: UnshieldProofInputs, options?: ProofOptions): Promise<UnshieldProofResult>;
|
|
2597
2620
|
|
|
2598
2621
|
/**
|
|
2599
2622
|
* Inputs required to generate a fee-claim proof.
|
|
@@ -2643,10 +2666,7 @@ interface FeeClaimProofOutput {
|
|
|
2643
2666
|
* @param options.provider - Override the artifact provider (default: CDN).
|
|
2644
2667
|
* @param options.verbose - Log proof generation steps to console.
|
|
2645
2668
|
*/
|
|
2646
|
-
declare function generateFeeClaimProof(inputs: FeeClaimProofInputs, options?:
|
|
2647
|
-
provider?: ArtifactProvider;
|
|
2648
|
-
verbose?: boolean;
|
|
2649
|
-
}): Promise<FeeClaimProofOutput>;
|
|
2669
|
+
declare function generateFeeClaimProof(inputs: FeeClaimProofInputs, options?: ProofOptions): Promise<FeeClaimProofOutput>;
|
|
2650
2670
|
|
|
2651
2671
|
/**
|
|
2652
2672
|
* Contract addresses and function selectors for all Orbinum EVM precompiles.
|
|
@@ -3604,4 +3624,4 @@ interface ExtrinsicFailedData {
|
|
|
3604
3624
|
dispatch_info: DispatchInfo;
|
|
3605
3625
|
}
|
|
3606
3626
|
|
|
3607
|
-
export { type ActiveVersionSetEvent, type AssetRegisteredEvent, type AssetUnverifiedEvent, type AssetVerifiedEvent, BABYJUB_SUBORDER, BN254_R, type BatchRegisterVerificationKeysArgs, type BatchVerificationKeysRegisteredEvent, type BlockInfo, type Bytes32, CURRENT_CIRCUIT_VERSION, type ChainInfo, CircuitId, CircuitId as CircuitIdType, CircuitVersionResolver, type ClaimShieldedFeesParams, type ClientProviderConfig, type CommitmentsInsertedEvent, type CommitmentsInsertedEventData, type ConnectionStatus, CryptoPrecompiles, type DecodedBatchArgs, type DecodedEthereumTransactArgs, type DecodedEvmCallArgs, type DecodedPrecompile, type DecodedPrivateTransferArgs, type DecodedRemarkArgs, type DecodedShieldArgs, type DecodedShieldBatchArgs, type DecodedShieldBatchOperation, type DecodedSudoArgs, type DecodedTransferAllArgs, type DecodedTransferArgs, type DecodedTransferKeepAliveArgs, type DecodedUnshieldArgs, type DecryptedMemo, type DispatchError, type DispatchInfo, type DynamicBuilder, ENCRYPTED_MEMO_SIZE, EncryptedMemo, type EncryptedNoteRecord, type EndowedEventData, type EthereumExecutedData, type EventData, type EventPhase, type EventRecord, type EvmAddressInfo, type EvmBlock, EvmClient, type EvmExecutedData, type EvmExitReason, EvmExplorer, type EvmLog, type EvmSigner, type EvmTransaction, type EvmTxRequest, type EvmTxSummary, type ExtrinsicDecoder, type ExtrinsicFailedData, type ExtrinsicSuccessData, type FeeClaimProofInputs, type FormatOptions, KNOWN_PRECOMPILES, type KnownPrecompileInfo, MIN_SIGNATURE_BYTES, type MerkleRootUpdatedData, type MerkleRootUpdatedEvent, type MerkleTreeInfo, NoteBuilder, type NoteDisclosure, type NoteInput, type NoteStatusUpdate, type NullifiersSpentEvent, type NullifiersSpentEventData, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, PRECOMPILE_ADDR, type PairwiseEphWindowEntry, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateTransferArgs, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PrivateTransferProofInputs, type ProofVerificationFailedEvent, type ProofVerifiedEvent, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type RegisterAssetArgs, type RegisterVerificationKeyArgs, type RelayerInfo, RelayerStatusModule, type RemoveVerificationKeyArgs, type ReservedEventData, type ResolvedSpendVersion, type RpcV2MerkleProof, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, SPENDING_KEY_VERIFYING_CONTRACT, SPENDING_KEY_WARNING, type ScanCommitment, type SelfEphWindowEntry, type SetActiveVersionArgs, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldedEvent, type ShieldedEventData, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, type SpendingKeyTypedData, type StatusChangeEvent, type StatusListener, SubstrateClient, type SystemHealth, type TokenInfo, type TokenTransfer, type TransferEventData, type TransferInputNote, type TransferOutputNote, type TryDecryptOptions, type TxResult, type UnsafeTxOptions, type UnshieldArgs, type UnshieldParams, type UnshieldProofInputs, type UnshieldedEvent, type UnshieldedEventData, type UnverifyAssetArgs, VaultLockedError, type VerificationKeyRegisteredEvent, type VerificationKeyRemovedEvent, type VerifyAssetArgs, type VerifyProofArgs, type VkEntry, type ZkNote, type ZkVerifierCall, type ZkVerifierCircuitVersionInfo, type ZkVerifierEvent, type ZkVerifierHistoricalVersion, ZkVerifierModule, type ZkVerifierVersionStats, type ZkVerifierVkHash, accountIdHexToSs58, addressToAccountIdHex, applyNoteStatus, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, blindTag, buildDummyTransferInput, bytesToBigintLE, canonicalAccountId, computeNoteCommitment, computeNullifier, computePathIndices, createNoteDisclosureKey, decodeNoteDisclosureKey, decodePrecompileCalldata, decryptJson, decryptNoteRecord, deriveMasterKeyBytes, deriveOwnerPk, derivePairwiseEphSk, derivePairwiseSharedSecret, deriveSelfEphSk, deriveSpendingKeyFromSignature, deriveSpendingKeyMessageV2, deriveSpendingKeyTypedData, deriveStealthOwnerPk, deriveStealthSk, deriveVaultBlindKey, deriveVaultKey, deriveViewTag, deriveViewingPublicKey, deriveViewingSecretKey, encryptJson, encryptNote, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, formatBalance, formatORB, fromBase64, fromHex, generateFeeClaimProof, generateTransferProof, generateUnshieldProof, getPrecompileLabel, hexToBigint, hexToNumber, implicitSubstrateToEvm, isEvmAddress, isImplicitEvmAccount, isSs58, isSubstrateAddress, isUnifiedAddress, leHexToBigint, mapExtrinsicArgs, mapZkEventData, normalizeEvmAddress, noteBlindTag, pairwiseEphWindow, randomBlinding, recoverOwnerPkPoint, selectNotes, selfEphWindow, shortHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, treeIdOf, truncateMiddle, tryDecryptNote, tryDecryptNoteVerbose, vaultReplacer, vaultReviver };
|
|
3627
|
+
export { type ActiveVersionSetEvent, type AssetRegisteredEvent, type AssetUnverifiedEvent, type AssetVerifiedEvent, BABYJUB_SUBORDER, BN254_R, type BatchRegisterVerificationKeysArgs, type BatchVerificationKeysRegisteredEvent, type BlockInfo, type Bytes32, CURRENT_CIRCUIT_VERSION, type ChainInfo, CircuitId, CircuitId as CircuitIdType, CircuitVersionResolver, type ClaimShieldedFeesParams, type ClientProviderConfig, type CommitmentsInsertedEvent, type CommitmentsInsertedEventData, type ConnectionStatus, CryptoPrecompiles, type DecodedBatchArgs, type DecodedEthereumTransactArgs, type DecodedEvmCallArgs, type DecodedPrecompile, type DecodedPrivateTransferArgs, type DecodedRemarkArgs, type DecodedShieldArgs, type DecodedShieldBatchArgs, type DecodedShieldBatchOperation, type DecodedSudoArgs, type DecodedTransferAllArgs, type DecodedTransferArgs, type DecodedTransferKeepAliveArgs, type DecodedUnshieldArgs, type DecryptedMemo, type DispatchError, type DispatchInfo, type DynamicBuilder, ENCRYPTED_MEMO_SIZE, EncryptedMemo, type EncryptedNoteRecord, type EndowedEventData, type EthereumExecutedData, type EventData, type EventPhase, type EventRecord, type EvmAddressInfo, type EvmBlock, EvmClient, type EvmExecutedData, type EvmExitReason, EvmExplorer, type EvmLog, type EvmSigner, type EvmTransaction, type EvmTxRequest, type EvmTxSummary, type ExtrinsicDecoder, type ExtrinsicFailedData, type ExtrinsicSuccessData, type FeeClaimProofInputs, type FormatOptions, KNOWN_PRECOMPILES, type KnownPrecompileInfo, MIN_SIGNATURE_BYTES, type MerkleRootUpdatedData, type MerkleRootUpdatedEvent, type MerkleTreeInfo, NoteBuilder, type NoteDisclosure, type NoteInput, type NoteStatusUpdate, type NullifiersSpentEvent, type NullifiersSpentEventData, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, PRECOMPILE_ADDR, type PairwiseEphWindowEntry, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateTransferArgs, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PrivateTransferProofInputs, type ProofOptions, type ProofVerificationFailedEvent, type ProofVerifiedEvent, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type RegisterAssetArgs, type RegisterVerificationKeyArgs, type RelayerInfo, RelayerStatusModule, type RemoveVerificationKeyArgs, type ReservedEventData, type ResolvedSpendVersion, type RpcV2MerkleProof, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, SPENDING_KEY_VERIFYING_CONTRACT, SPENDING_KEY_WARNING, type ScanCommitment, type SelfEphWindowEntry, type SetActiveVersionArgs, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldedEvent, type ShieldedEventData, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, type SpendingKeyTypedData, type StatusChangeEvent, type StatusListener, SubstrateClient, type SystemHealth, type TokenInfo, type TokenTransfer, type TransferEventData, type TransferInputNote, type TransferOutputNote, type TryDecryptOptions, type TxResult, type UnsafeTxOptions, type UnshieldArgs, type UnshieldParams, type UnshieldProofInputs, type UnshieldedEvent, type UnshieldedEventData, type UnverifyAssetArgs, VaultLockedError, type VerificationKeyRegisteredEvent, type VerificationKeyRemovedEvent, type VerifyAssetArgs, type VerifyProofArgs, type VkEntry, type ZkNote, type ZkVerifierCall, type ZkVerifierCircuitVersionInfo, type ZkVerifierEvent, type ZkVerifierHistoricalVersion, ZkVerifierModule, type ZkVerifierVersionStats, type ZkVerifierVkHash, accountIdHexToSs58, addressToAccountIdHex, applyNoteStatus, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, blindTag, buildDummyTransferInput, bytesToBigintLE, canonicalAccountId, computeNoteCommitment, computeNullifier, computePathIndices, createNoteDisclosureKey, decodeNoteDisclosureKey, decodePrecompileCalldata, decryptJson, decryptNoteRecord, deriveMasterKeyBytes, deriveOwnerPk, derivePairwiseEphSk, derivePairwiseSharedSecret, deriveSelfEphSk, deriveSpendingKeyFromSignature, deriveSpendingKeyMessageV2, deriveSpendingKeyTypedData, deriveStealthOwnerPk, deriveStealthSk, deriveVaultBlindKey, deriveVaultKey, deriveViewTag, deriveViewingPublicKey, deriveViewingSecretKey, encryptJson, encryptNote, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, formatBalance, formatORB, fromBase64, fromHex, generateFeeClaimProof, generateTransferProof, generateUnshieldProof, getPrecompileLabel, hexToBigint, hexToNumber, implicitSubstrateToEvm, isEvmAddress, isImplicitEvmAccount, isSs58, isSubstrateAddress, isUnifiedAddress, leHexToBigint, mapExtrinsicArgs, mapZkEventData, normalizeEvmAddress, noteBlindTag, pairwiseEphWindow, randomBlinding, recoverOwnerPkPoint, selectNotes, selfEphWindow, shortHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, treeIdOf, truncateMiddle, tryDecryptNote, tryDecryptNoteVerbose, vaultReplacer, vaultReviver };
|
package/dist/index.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { PolkadotSigner, getSs58AddressInfo } from 'polkadot-api';
|
|
|
4
4
|
import { getDynamicBuilder } from '@polkadot-api/metadata-builders';
|
|
5
5
|
import { getExtrinsicDecoder } from '@polkadot-api/tx-utils';
|
|
6
6
|
import { CircuitType, ArtifactProvider, ProofResult } from '@orbinum/proof-generator';
|
|
7
|
-
export { ArtifactProvider, CircuitType, ProofResult, WebArtifactProvider } from '@orbinum/proof-generator';
|
|
7
|
+
export { ArtifactProvider, CircuitType, ProofResult, WebArtifactProvider, shouldProveSingleThreaded } from '@orbinum/proof-generator';
|
|
8
8
|
export { AccountId, Blake2256, Keccak256, Storage, u128, u64 } from '@polkadot-api/substrate-bindings';
|
|
9
9
|
export { base58 } from '@scure/base';
|
|
10
10
|
export { getPolkadotSigner } from 'polkadot-api/signer';
|
|
@@ -1897,6 +1897,35 @@ declare function createNoteDisclosureKey(note: ZkNote): string;
|
|
|
1897
1897
|
*/
|
|
1898
1898
|
declare function decodeNoteDisclosureKey(key: string): NoteDisclosure | null;
|
|
1899
1899
|
|
|
1900
|
+
/**
|
|
1901
|
+
* The options every proof entry point accepts.
|
|
1902
|
+
*
|
|
1903
|
+
* One declaration instead of the same inline object repeated per circuit: the
|
|
1904
|
+
* three generators differ in their INPUTS, never in how a caller configures
|
|
1905
|
+
* proving, and a shape written three times drifts on the fourth.
|
|
1906
|
+
*/
|
|
1907
|
+
|
|
1908
|
+
interface ProofOptions {
|
|
1909
|
+
/** Where circuit artifacts come from. Defaults to the web provider. */
|
|
1910
|
+
provider?: ArtifactProvider;
|
|
1911
|
+
verbose?: boolean;
|
|
1912
|
+
/**
|
|
1913
|
+
* Prove on ONE thread instead of a Web Worker per logical core.
|
|
1914
|
+
*
|
|
1915
|
+
* Omit this. Left absent, `@orbinum/proof-generator` decides from the
|
|
1916
|
+
* device — and getting it wrong on a phone is not a slow proof but no proof
|
|
1917
|
+
* at all: `ffjavascript` spawns one worker per core, each with its own
|
|
1918
|
+
* `WebAssembly.Memory`, and a mobile browser's per-tab budget cannot hold
|
|
1919
|
+
* them. The transfer of the WASM buffer then fails with
|
|
1920
|
+
* `Data cannot be cloned, out of memory`.
|
|
1921
|
+
*
|
|
1922
|
+
* Pass it only when the host knows better than the heuristic — a desktop
|
|
1923
|
+
* app certain of its environment, or a benchmark pinning one mode. The
|
|
1924
|
+
* proof is byte-identical either way; only the wall-clock changes.
|
|
1925
|
+
*/
|
|
1926
|
+
singleThread?: boolean;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1900
1929
|
/** A single input note for a private transfer. */
|
|
1901
1930
|
interface TransferInputNote {
|
|
1902
1931
|
nullifier: bigint;
|
|
@@ -1934,10 +1963,7 @@ interface PrivateTransferProofInputs {
|
|
|
1934
1963
|
/**
|
|
1935
1964
|
* Generate a Groth16 proof for a PrivateTransfer operation.
|
|
1936
1965
|
*/
|
|
1937
|
-
declare function generateTransferProof(params: PrivateTransferProofInputs, options?:
|
|
1938
|
-
provider?: ArtifactProvider;
|
|
1939
|
-
verbose?: boolean;
|
|
1940
|
-
}): Promise<ProofResult>;
|
|
1966
|
+
declare function generateTransferProof(params: PrivateTransferProofInputs, options?: ProofOptions): Promise<ProofResult>;
|
|
1941
1967
|
|
|
1942
1968
|
/**
|
|
1943
1969
|
* Forest tree a note belongs to.
|
|
@@ -2590,10 +2616,7 @@ interface UnshieldProofResult extends ProofResult {
|
|
|
2590
2616
|
* @param options.provider - Override the artifact provider (default: CDN).
|
|
2591
2617
|
* @param options.verbose - Log proof generation steps to console.
|
|
2592
2618
|
*/
|
|
2593
|
-
declare function generateUnshieldProof(inputs: UnshieldProofInputs, options?:
|
|
2594
|
-
provider?: ArtifactProvider;
|
|
2595
|
-
verbose?: boolean;
|
|
2596
|
-
}): Promise<UnshieldProofResult>;
|
|
2619
|
+
declare function generateUnshieldProof(inputs: UnshieldProofInputs, options?: ProofOptions): Promise<UnshieldProofResult>;
|
|
2597
2620
|
|
|
2598
2621
|
/**
|
|
2599
2622
|
* Inputs required to generate a fee-claim proof.
|
|
@@ -2643,10 +2666,7 @@ interface FeeClaimProofOutput {
|
|
|
2643
2666
|
* @param options.provider - Override the artifact provider (default: CDN).
|
|
2644
2667
|
* @param options.verbose - Log proof generation steps to console.
|
|
2645
2668
|
*/
|
|
2646
|
-
declare function generateFeeClaimProof(inputs: FeeClaimProofInputs, options?:
|
|
2647
|
-
provider?: ArtifactProvider;
|
|
2648
|
-
verbose?: boolean;
|
|
2649
|
-
}): Promise<FeeClaimProofOutput>;
|
|
2669
|
+
declare function generateFeeClaimProof(inputs: FeeClaimProofInputs, options?: ProofOptions): Promise<FeeClaimProofOutput>;
|
|
2650
2670
|
|
|
2651
2671
|
/**
|
|
2652
2672
|
* Contract addresses and function selectors for all Orbinum EVM precompiles.
|
|
@@ -3604,4 +3624,4 @@ interface ExtrinsicFailedData {
|
|
|
3604
3624
|
dispatch_info: DispatchInfo;
|
|
3605
3625
|
}
|
|
3606
3626
|
|
|
3607
|
-
export { type ActiveVersionSetEvent, type AssetRegisteredEvent, type AssetUnverifiedEvent, type AssetVerifiedEvent, BABYJUB_SUBORDER, BN254_R, type BatchRegisterVerificationKeysArgs, type BatchVerificationKeysRegisteredEvent, type BlockInfo, type Bytes32, CURRENT_CIRCUIT_VERSION, type ChainInfo, CircuitId, CircuitId as CircuitIdType, CircuitVersionResolver, type ClaimShieldedFeesParams, type ClientProviderConfig, type CommitmentsInsertedEvent, type CommitmentsInsertedEventData, type ConnectionStatus, CryptoPrecompiles, type DecodedBatchArgs, type DecodedEthereumTransactArgs, type DecodedEvmCallArgs, type DecodedPrecompile, type DecodedPrivateTransferArgs, type DecodedRemarkArgs, type DecodedShieldArgs, type DecodedShieldBatchArgs, type DecodedShieldBatchOperation, type DecodedSudoArgs, type DecodedTransferAllArgs, type DecodedTransferArgs, type DecodedTransferKeepAliveArgs, type DecodedUnshieldArgs, type DecryptedMemo, type DispatchError, type DispatchInfo, type DynamicBuilder, ENCRYPTED_MEMO_SIZE, EncryptedMemo, type EncryptedNoteRecord, type EndowedEventData, type EthereumExecutedData, type EventData, type EventPhase, type EventRecord, type EvmAddressInfo, type EvmBlock, EvmClient, type EvmExecutedData, type EvmExitReason, EvmExplorer, type EvmLog, type EvmSigner, type EvmTransaction, type EvmTxRequest, type EvmTxSummary, type ExtrinsicDecoder, type ExtrinsicFailedData, type ExtrinsicSuccessData, type FeeClaimProofInputs, type FormatOptions, KNOWN_PRECOMPILES, type KnownPrecompileInfo, MIN_SIGNATURE_BYTES, type MerkleRootUpdatedData, type MerkleRootUpdatedEvent, type MerkleTreeInfo, NoteBuilder, type NoteDisclosure, type NoteInput, type NoteStatusUpdate, type NullifiersSpentEvent, type NullifiersSpentEventData, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, PRECOMPILE_ADDR, type PairwiseEphWindowEntry, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateTransferArgs, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PrivateTransferProofInputs, type ProofVerificationFailedEvent, type ProofVerifiedEvent, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type RegisterAssetArgs, type RegisterVerificationKeyArgs, type RelayerInfo, RelayerStatusModule, type RemoveVerificationKeyArgs, type ReservedEventData, type ResolvedSpendVersion, type RpcV2MerkleProof, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, SPENDING_KEY_VERIFYING_CONTRACT, SPENDING_KEY_WARNING, type ScanCommitment, type SelfEphWindowEntry, type SetActiveVersionArgs, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldedEvent, type ShieldedEventData, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, type SpendingKeyTypedData, type StatusChangeEvent, type StatusListener, SubstrateClient, type SystemHealth, type TokenInfo, type TokenTransfer, type TransferEventData, type TransferInputNote, type TransferOutputNote, type TryDecryptOptions, type TxResult, type UnsafeTxOptions, type UnshieldArgs, type UnshieldParams, type UnshieldProofInputs, type UnshieldedEvent, type UnshieldedEventData, type UnverifyAssetArgs, VaultLockedError, type VerificationKeyRegisteredEvent, type VerificationKeyRemovedEvent, type VerifyAssetArgs, type VerifyProofArgs, type VkEntry, type ZkNote, type ZkVerifierCall, type ZkVerifierCircuitVersionInfo, type ZkVerifierEvent, type ZkVerifierHistoricalVersion, ZkVerifierModule, type ZkVerifierVersionStats, type ZkVerifierVkHash, accountIdHexToSs58, addressToAccountIdHex, applyNoteStatus, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, blindTag, buildDummyTransferInput, bytesToBigintLE, canonicalAccountId, computeNoteCommitment, computeNullifier, computePathIndices, createNoteDisclosureKey, decodeNoteDisclosureKey, decodePrecompileCalldata, decryptJson, decryptNoteRecord, deriveMasterKeyBytes, deriveOwnerPk, derivePairwiseEphSk, derivePairwiseSharedSecret, deriveSelfEphSk, deriveSpendingKeyFromSignature, deriveSpendingKeyMessageV2, deriveSpendingKeyTypedData, deriveStealthOwnerPk, deriveStealthSk, deriveVaultBlindKey, deriveVaultKey, deriveViewTag, deriveViewingPublicKey, deriveViewingSecretKey, encryptJson, encryptNote, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, formatBalance, formatORB, fromBase64, fromHex, generateFeeClaimProof, generateTransferProof, generateUnshieldProof, getPrecompileLabel, hexToBigint, hexToNumber, implicitSubstrateToEvm, isEvmAddress, isImplicitEvmAccount, isSs58, isSubstrateAddress, isUnifiedAddress, leHexToBigint, mapExtrinsicArgs, mapZkEventData, normalizeEvmAddress, noteBlindTag, pairwiseEphWindow, randomBlinding, recoverOwnerPkPoint, selectNotes, selfEphWindow, shortHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, treeIdOf, truncateMiddle, tryDecryptNote, tryDecryptNoteVerbose, vaultReplacer, vaultReviver };
|
|
3627
|
+
export { type ActiveVersionSetEvent, type AssetRegisteredEvent, type AssetUnverifiedEvent, type AssetVerifiedEvent, BABYJUB_SUBORDER, BN254_R, type BatchRegisterVerificationKeysArgs, type BatchVerificationKeysRegisteredEvent, type BlockInfo, type Bytes32, CURRENT_CIRCUIT_VERSION, type ChainInfo, CircuitId, CircuitId as CircuitIdType, CircuitVersionResolver, type ClaimShieldedFeesParams, type ClientProviderConfig, type CommitmentsInsertedEvent, type CommitmentsInsertedEventData, type ConnectionStatus, CryptoPrecompiles, type DecodedBatchArgs, type DecodedEthereumTransactArgs, type DecodedEvmCallArgs, type DecodedPrecompile, type DecodedPrivateTransferArgs, type DecodedRemarkArgs, type DecodedShieldArgs, type DecodedShieldBatchArgs, type DecodedShieldBatchOperation, type DecodedSudoArgs, type DecodedTransferAllArgs, type DecodedTransferArgs, type DecodedTransferKeepAliveArgs, type DecodedUnshieldArgs, type DecryptedMemo, type DispatchError, type DispatchInfo, type DynamicBuilder, ENCRYPTED_MEMO_SIZE, EncryptedMemo, type EncryptedNoteRecord, type EndowedEventData, type EthereumExecutedData, type EventData, type EventPhase, type EventRecord, type EvmAddressInfo, type EvmBlock, EvmClient, type EvmExecutedData, type EvmExitReason, EvmExplorer, type EvmLog, type EvmSigner, type EvmTransaction, type EvmTxRequest, type EvmTxSummary, type ExtrinsicDecoder, type ExtrinsicFailedData, type ExtrinsicSuccessData, type FeeClaimProofInputs, type FormatOptions, KNOWN_PRECOMPILES, type KnownPrecompileInfo, MIN_SIGNATURE_BYTES, type MerkleRootUpdatedData, type MerkleRootUpdatedEvent, type MerkleTreeInfo, NoteBuilder, type NoteDisclosure, type NoteInput, type NoteStatusUpdate, type NullifiersSpentEvent, type NullifiersSpentEventData, OrbinumClient, type OrbinumClientConfig, OrbinumClientProvider, PRECOMPILE_ADDR, type PairwiseEphWindowEntry, PrivacyKeyManager, type PrivacyMerkleProof, PrivacyModule, type PrivateTransferArgs, type PrivateTransferInput, type PrivateTransferOutput, type PrivateTransferParams, type PrivateTransferProofInputs, type ProofOptions, type ProofVerificationFailedEvent, type ProofVerifiedEvent, type RawBlock, type RawBlockHeader, type RawTransferInput, type RawTransferOutput, type RegisterAssetArgs, type RegisterVerificationKeyArgs, type RelayerInfo, RelayerStatusModule, type RemoveVerificationKeyArgs, type ReservedEventData, type ResolvedSpendVersion, type RpcV2MerkleProof, type RpcV2NullifierStatus, type RpcV2PoolAssetBalance, type RpcV2PoolStats, SPENDING_KEY_VERIFYING_CONTRACT, SPENDING_KEY_WARNING, type ScanCommitment, type SelfEphWindowEntry, type SetActiveVersionArgs, type ShieldArgs, type ShieldBatchArgs, type ShieldBatchItem, type ShieldBatchParams, type ShieldOperation, type ShieldParams, type ShieldedEvent, type ShieldedEventData, type ShieldedPoolCall, type ShieldedPoolEvent, ShieldedPoolModule, ShieldedPoolPrecompile, type SpendingKeyTypedData, type StatusChangeEvent, type StatusListener, SubstrateClient, type SystemHealth, type TokenInfo, type TokenTransfer, type TransferEventData, type TransferInputNote, type TransferOutputNote, type TryDecryptOptions, type TxResult, type UnsafeTxOptions, type UnshieldArgs, type UnshieldParams, type UnshieldProofInputs, type UnshieldedEvent, type UnshieldedEventData, type UnverifyAssetArgs, VaultLockedError, type VerificationKeyRegisteredEvent, type VerificationKeyRemovedEvent, type VerifyAssetArgs, type VerifyProofArgs, type VkEntry, type ZkNote, type ZkVerifierCall, type ZkVerifierCircuitVersionInfo, type ZkVerifierEvent, type ZkVerifierHistoricalVersion, ZkVerifierModule, type ZkVerifierVersionStats, type ZkVerifierVkHash, accountIdHexToSs58, addressToAccountIdHex, applyNoteStatus, bigintTo32Be, bigintTo32Le, bigintTo32LeArr, blindTag, buildDummyTransferInput, bytesToBigintLE, canonicalAccountId, computeNoteCommitment, computeNullifier, computePathIndices, createNoteDisclosureKey, decodeNoteDisclosureKey, decodePrecompileCalldata, decryptJson, decryptNoteRecord, deriveMasterKeyBytes, deriveOwnerPk, derivePairwiseEphSk, derivePairwiseSharedSecret, deriveSelfEphSk, deriveSpendingKeyFromSignature, deriveSpendingKeyMessageV2, deriveSpendingKeyTypedData, deriveStealthOwnerPk, deriveStealthSk, deriveVaultBlindKey, deriveVaultKey, deriveViewTag, deriveViewingPublicKey, deriveViewingSecretKey, encryptJson, encryptNote, ensureHexPrefix, evmAddressToAccountId, evmToImplicitSubstrate, evmToMappedAccountHex, evmToSubstrate, formatBalance, formatORB, fromBase64, fromHex, generateFeeClaimProof, generateTransferProof, generateUnshieldProof, getPrecompileLabel, hexToBigint, hexToNumber, implicitSubstrateToEvm, isEvmAddress, isImplicitEvmAccount, isSs58, isSubstrateAddress, isUnifiedAddress, leHexToBigint, mapExtrinsicArgs, mapZkEventData, normalizeEvmAddress, noteBlindTag, pairwiseEphWindow, randomBlinding, recoverOwnerPkPoint, selectNotes, selfEphWindow, shortHash, substrateSs58ToAccountIdHex, substrateToEvm, toBase64, toHex, toTxResult, treeIdOf, truncateMiddle, tryDecryptNote, tryDecryptNoteVerbose, vaultReplacer, vaultReviver };
|
package/dist/index.js
CHANGED
|
@@ -125,6 +125,7 @@ __export(index_exports, {
|
|
|
125
125
|
selectNotes: () => selectNotes,
|
|
126
126
|
selfEphWindow: () => selfEphWindow,
|
|
127
127
|
shortHash: () => shortHash,
|
|
128
|
+
shouldProveSingleThreaded: () => import_proof_generator5.shouldProveSingleThreaded,
|
|
128
129
|
substrateSs58ToAccountIdHex: () => substrateSs58ToAccountIdHex,
|
|
129
130
|
substrateToEvm: () => substrateToEvm,
|
|
130
131
|
toBase64: () => toBase64,
|
|
@@ -3935,6 +3936,15 @@ function merkleProofToCircuit(siblings, leafIndex) {
|
|
|
3935
3936
|
return { elements, indices };
|
|
3936
3937
|
}
|
|
3937
3938
|
|
|
3939
|
+
// src/proof-generator/options.ts
|
|
3940
|
+
function toGenerateOptions(provider, options) {
|
|
3941
|
+
return {
|
|
3942
|
+
provider,
|
|
3943
|
+
...options.verbose !== void 0 ? { verbose: options.verbose } : {},
|
|
3944
|
+
...options.singleThread !== void 0 ? { singleThread: options.singleThread } : {}
|
|
3945
|
+
};
|
|
3946
|
+
}
|
|
3947
|
+
|
|
3938
3948
|
// src/proof-generator/unshield.ts
|
|
3939
3949
|
async function generateUnshieldProof(inputs, options = {}) {
|
|
3940
3950
|
const { elements, indices } = merkleProofToCircuit(inputs.pathSiblings, inputs.leafIndex);
|
|
@@ -3969,8 +3979,7 @@ async function generateUnshieldProof(inputs, options = {}) {
|
|
|
3969
3979
|
change_owner_pubkey: changeOwnerPubkey.toString()
|
|
3970
3980
|
};
|
|
3971
3981
|
const provider = options.provider ?? new import_proof_generator2.WebArtifactProvider();
|
|
3972
|
-
const opts =
|
|
3973
|
-
if (options.verbose !== void 0) opts.verbose = options.verbose;
|
|
3982
|
+
const opts = toGenerateOptions(provider, options);
|
|
3974
3983
|
const proofResult = await (0, import_proof_generator2.generateProof)(import_proof_generator2.CircuitType.Unshield, circuitInputs, opts);
|
|
3975
3984
|
return { ...proofResult, changeCommitment, changeValue, changeBlinding, changeOwnerPubkey };
|
|
3976
3985
|
}
|
|
@@ -4002,8 +4011,7 @@ async function generateTransferProof(params, options = {}) {
|
|
|
4002
4011
|
output_blindings: [o0.blinding.toString(), o1.blinding.toString()]
|
|
4003
4012
|
};
|
|
4004
4013
|
const provider = options.provider ?? new import_proof_generator3.WebArtifactProvider();
|
|
4005
|
-
const opts =
|
|
4006
|
-
if (options.verbose !== void 0) opts.verbose = options.verbose;
|
|
4014
|
+
const opts = toGenerateOptions(provider, options);
|
|
4007
4015
|
return (0, import_proof_generator3.generateProof)(import_proof_generator3.CircuitType.Transfer, circuitInputs, opts);
|
|
4008
4016
|
}
|
|
4009
4017
|
|
|
@@ -4021,8 +4029,7 @@ async function generateFeeClaimProof(inputs, options = {}) {
|
|
|
4021
4029
|
blinding: inputs.blinding.toString()
|
|
4022
4030
|
};
|
|
4023
4031
|
const provider = options.provider ?? new import_proof_generator4.WebArtifactProvider();
|
|
4024
|
-
const opts =
|
|
4025
|
-
if (options.verbose !== void 0) opts.verbose = options.verbose;
|
|
4032
|
+
const opts = toGenerateOptions(provider, options);
|
|
4026
4033
|
const proofResult = await (0, import_proof_generator4.generateProof)(import_proof_generator4.CircuitType.ValueProof, circuitInputs, opts);
|
|
4027
4034
|
const [sigCommitment, sigValue, sigAssetId, sigOwnerHash] = proofResult.publicSignals.map(BigInt);
|
|
4028
4035
|
const buf = new Uint8Array(76);
|
|
@@ -4036,6 +4043,9 @@ async function generateFeeClaimProof(inputs, options = {}) {
|
|
|
4036
4043
|
};
|
|
4037
4044
|
}
|
|
4038
4045
|
|
|
4046
|
+
// src/proof-generator/index.ts
|
|
4047
|
+
var import_proof_generator5 = require("@orbinum/proof-generator");
|
|
4048
|
+
|
|
4039
4049
|
// src/precompiles/decode.ts
|
|
4040
4050
|
function decodePrecompileCalldata(address, input) {
|
|
4041
4051
|
const info = KNOWN_PRECOMPILES[address.toLowerCase()];
|
|
@@ -4709,6 +4719,7 @@ var import_polkadot_api4 = require("polkadot-api");
|
|
|
4709
4719
|
selectNotes,
|
|
4710
4720
|
selfEphWindow,
|
|
4711
4721
|
shortHash,
|
|
4722
|
+
shouldProveSingleThreaded,
|
|
4712
4723
|
substrateSs58ToAccountIdHex,
|
|
4713
4724
|
substrateToEvm,
|
|
4714
4725
|
toBase64,
|
package/dist/index.mjs
CHANGED
|
@@ -3802,6 +3802,15 @@ function merkleProofToCircuit(siblings, leafIndex) {
|
|
|
3802
3802
|
return { elements, indices };
|
|
3803
3803
|
}
|
|
3804
3804
|
|
|
3805
|
+
// src/proof-generator/options.ts
|
|
3806
|
+
function toGenerateOptions(provider, options) {
|
|
3807
|
+
return {
|
|
3808
|
+
provider,
|
|
3809
|
+
...options.verbose !== void 0 ? { verbose: options.verbose } : {},
|
|
3810
|
+
...options.singleThread !== void 0 ? { singleThread: options.singleThread } : {}
|
|
3811
|
+
};
|
|
3812
|
+
}
|
|
3813
|
+
|
|
3805
3814
|
// src/proof-generator/unshield.ts
|
|
3806
3815
|
async function generateUnshieldProof(inputs, options = {}) {
|
|
3807
3816
|
const { elements, indices } = merkleProofToCircuit(inputs.pathSiblings, inputs.leafIndex);
|
|
@@ -3836,8 +3845,7 @@ async function generateUnshieldProof(inputs, options = {}) {
|
|
|
3836
3845
|
change_owner_pubkey: changeOwnerPubkey.toString()
|
|
3837
3846
|
};
|
|
3838
3847
|
const provider = options.provider ?? new WebArtifactProvider2();
|
|
3839
|
-
const opts =
|
|
3840
|
-
if (options.verbose !== void 0) opts.verbose = options.verbose;
|
|
3848
|
+
const opts = toGenerateOptions(provider, options);
|
|
3841
3849
|
const proofResult = await generateProof(CircuitType2.Unshield, circuitInputs, opts);
|
|
3842
3850
|
return { ...proofResult, changeCommitment, changeValue, changeBlinding, changeOwnerPubkey };
|
|
3843
3851
|
}
|
|
@@ -3873,8 +3881,7 @@ async function generateTransferProof(params, options = {}) {
|
|
|
3873
3881
|
output_blindings: [o0.blinding.toString(), o1.blinding.toString()]
|
|
3874
3882
|
};
|
|
3875
3883
|
const provider = options.provider ?? new WebArtifactProvider3();
|
|
3876
|
-
const opts =
|
|
3877
|
-
if (options.verbose !== void 0) opts.verbose = options.verbose;
|
|
3884
|
+
const opts = toGenerateOptions(provider, options);
|
|
3878
3885
|
return generateProof2(CircuitType3.Transfer, circuitInputs, opts);
|
|
3879
3886
|
}
|
|
3880
3887
|
|
|
@@ -3896,8 +3903,7 @@ async function generateFeeClaimProof(inputs, options = {}) {
|
|
|
3896
3903
|
blinding: inputs.blinding.toString()
|
|
3897
3904
|
};
|
|
3898
3905
|
const provider = options.provider ?? new WebArtifactProvider4();
|
|
3899
|
-
const opts =
|
|
3900
|
-
if (options.verbose !== void 0) opts.verbose = options.verbose;
|
|
3906
|
+
const opts = toGenerateOptions(provider, options);
|
|
3901
3907
|
const proofResult = await generateProof3(CircuitType4.ValueProof, circuitInputs, opts);
|
|
3902
3908
|
const [sigCommitment, sigValue, sigAssetId, sigOwnerHash] = proofResult.publicSignals.map(BigInt);
|
|
3903
3909
|
const buf = new Uint8Array(76);
|
|
@@ -3911,6 +3917,9 @@ async function generateFeeClaimProof(inputs, options = {}) {
|
|
|
3911
3917
|
};
|
|
3912
3918
|
}
|
|
3913
3919
|
|
|
3920
|
+
// src/proof-generator/index.ts
|
|
3921
|
+
import { shouldProveSingleThreaded } from "@orbinum/proof-generator";
|
|
3922
|
+
|
|
3914
3923
|
// src/precompiles/decode.ts
|
|
3915
3924
|
function decodePrecompileCalldata(address, input) {
|
|
3916
3925
|
const info = KNOWN_PRECOMPILES[address.toLowerCase()];
|
|
@@ -4594,6 +4603,7 @@ export {
|
|
|
4594
4603
|
selectNotes,
|
|
4595
4604
|
selfEphWindow,
|
|
4596
4605
|
shortHash,
|
|
4606
|
+
shouldProveSingleThreaded,
|
|
4597
4607
|
substrateSs58ToAccountIdHex,
|
|
4598
4608
|
substrateToEvm,
|
|
4599
4609
|
toBase64,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@orbinum/sdk",
|
|
3
|
-
"version": "0.25.
|
|
3
|
+
"version": "0.25.1",
|
|
4
4
|
"description": "Official TypeScript SDK for Orbinum.",
|
|
5
5
|
"author": "Orbinum",
|
|
6
6
|
"license": "MIT",
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"@noble/ciphers": "2.2.0",
|
|
49
49
|
"@noble/curves": "^2.2.0",
|
|
50
50
|
"@noble/hashes": "2.2.0",
|
|
51
|
-
"@orbinum/proof-generator": "5.
|
|
51
|
+
"@orbinum/proof-generator": "5.1.0",
|
|
52
52
|
"@polkadot-api/metadata-builders": "0.14.2",
|
|
53
53
|
"@polkadot-api/substrate-bindings": "0.20.2",
|
|
54
54
|
"@polkadot-api/tx-utils": "0.3.2",
|