@midnight-ntwrk/wallet-sdk-dust-wallet 1.0.0-beta.11 → 1.0.0-beta.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/CoinsAndBalances.js +1 -1
- package/dist/DustCoreWallet.d.ts +1 -1
- package/dist/DustCoreWallet.js +1 -1
- package/dist/DustWallet.d.ts +1 -1
- package/dist/DustWallet.js +1 -1
- package/dist/Keys.d.ts +1 -1
- package/dist/RunningV1Variant.d.ts +1 -1
- package/dist/RunningV1Variant.js +1 -1
- package/dist/Serialization.js +1 -1
- package/dist/Simulator.d.ts +1 -1
- package/dist/Simulator.js +4 -2
- package/dist/Submission.d.ts +1 -1
- package/dist/Sync.d.ts +1 -1
- package/dist/Sync.js +5 -3
- package/dist/Transacting.d.ts +1 -1
- package/dist/Transacting.js +1 -1
- package/dist/V1Builder.d.ts +1 -1
- package/dist/types/Dust.d.ts +1 -1
- package/dist/types/ledger.d.ts +1 -1
- package/package.json +14 -13
package/dist/CoinsAndBalances.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { Array, pipe } from 'effect';
|
|
14
|
-
import { updatedValue } from '@midnight-ntwrk/ledger-
|
|
14
|
+
import { updatedValue } from '@midnight-ntwrk/ledger-v7';
|
|
15
15
|
import { DateOps } from '@midnight-ntwrk/wallet-sdk-utilities';
|
|
16
16
|
export const chooseCoin = (coins, amountNeeded) => {
|
|
17
17
|
let sum = 0n;
|
package/dist/DustCoreWallet.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Bindingish, DustLocalState, DustNullifier, DustParameters, DustPublicKey, DustSecretKey, Proofish, Signaturish, Transaction, Event } from '@midnight-ntwrk/ledger-
|
|
1
|
+
import { Bindingish, DustLocalState, DustNullifier, DustParameters, DustPublicKey, DustSecretKey, Proofish, Signaturish, Transaction, Event } from '@midnight-ntwrk/ledger-v7';
|
|
2
2
|
import { ProtocolVersion } from '@midnight-ntwrk/wallet-sdk-abstractions';
|
|
3
3
|
import { SyncProgress } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
|
4
4
|
import { DustToken, DustTokenWithNullifier } from './types/Dust.js';
|
package/dist/DustCoreWallet.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { DustLocalState, } from '@midnight-ntwrk/ledger-
|
|
13
|
+
import { DustLocalState, } from '@midnight-ntwrk/ledger-v7';
|
|
14
14
|
import { ProtocolVersion } from '@midnight-ntwrk/wallet-sdk-abstractions';
|
|
15
15
|
import { SyncProgress } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
|
16
16
|
import { DateOps } from '@midnight-ntwrk/wallet-sdk-utilities';
|
package/dist/DustWallet.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DustParameters, DustPublicKey, DustSecretKey, FinalizedTransaction, Signature, SignatureVerifyingKey, UnprovenTransaction } from '@midnight-ntwrk/ledger-
|
|
1
|
+
import { DustParameters, DustPublicKey, DustSecretKey, FinalizedTransaction, Signature, SignatureVerifyingKey, UnprovenTransaction } from '@midnight-ntwrk/ledger-v7';
|
|
2
2
|
import { ProtocolState, ProtocolVersion } from '@midnight-ntwrk/wallet-sdk-abstractions';
|
|
3
3
|
import { Variant, WalletLike } from '@midnight-ntwrk/wallet-sdk-runtime/abstractions';
|
|
4
4
|
import { ProvingRecipe, TransactionHistory } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
package/dist/DustWallet.js
CHANGED
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { DustSecretKey, } from '@midnight-ntwrk/ledger-
|
|
13
|
+
import { DustSecretKey, } from '@midnight-ntwrk/ledger-v7';
|
|
14
14
|
import { ProtocolVersion } from '@midnight-ntwrk/wallet-sdk-abstractions';
|
|
15
15
|
import { DustAddress } from '@midnight-ntwrk/wallet-sdk-address-format';
|
|
16
16
|
import { WalletBuilder } from '@midnight-ntwrk/wallet-sdk-runtime';
|
package/dist/Keys.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DustPublicKey } from '@midnight-ntwrk/ledger-
|
|
1
|
+
import { DustPublicKey } from '@midnight-ntwrk/ledger-v7';
|
|
2
2
|
import { DustAddress } from '@midnight-ntwrk/wallet-sdk-address-format';
|
|
3
3
|
import { DustCoreWallet } from './DustCoreWallet.js';
|
|
4
4
|
export type KeysCapability<TState> = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Stream, Scope } from 'effect';
|
|
2
|
-
import { DustSecretKey, Signature, SignatureVerifyingKey, FinalizedTransaction, UnprovenTransaction } from '@midnight-ntwrk/ledger-
|
|
2
|
+
import { DustSecretKey, Signature, SignatureVerifyingKey, FinalizedTransaction, UnprovenTransaction } from '@midnight-ntwrk/ledger-v7';
|
|
3
3
|
import { Proving, ProvingRecipe, WalletError } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
|
4
4
|
import { WalletRuntimeError, Variant, StateChange } from '@midnight-ntwrk/wallet-sdk-runtime/abstractions';
|
|
5
5
|
import { DustToken, UtxoWithMeta } from './types/Dust.js';
|
package/dist/RunningV1Variant.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { Effect, SubscriptionRef, Stream, pipe, Scope, Sink, Console, Duration, Schedule } from 'effect';
|
|
14
|
-
import { nativeToken, updatedValue, } from '@midnight-ntwrk/ledger-
|
|
14
|
+
import { nativeToken, updatedValue, } from '@midnight-ntwrk/ledger-v7';
|
|
15
15
|
import { ProtocolVersion } from '@midnight-ntwrk/wallet-sdk-abstractions';
|
|
16
16
|
import { WalletError } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
|
17
17
|
import { EitherOps, LedgerOps } from '@midnight-ntwrk/wallet-sdk-utilities';
|
package/dist/Serialization.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { Effect, ParseResult, Either, pipe, Schema } from 'effect';
|
|
14
|
-
import * as ledger from '@midnight-ntwrk/ledger-
|
|
14
|
+
import * as ledger from '@midnight-ntwrk/ledger-v7';
|
|
15
15
|
import { WalletError } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
|
16
16
|
import { DustCoreWallet } from './DustCoreWallet.js';
|
|
17
17
|
const StateSchema = Schema.declare((input) => input instanceof ledger.DustLocalState).annotations({
|
package/dist/Simulator.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Either, Scope, Stream, SubscriptionRef } from 'effect';
|
|
2
|
-
import { LedgerState, BlockContext, UserAddress, SignatureVerifyingKey, WellFormedStrictness, TransactionResult, ProofErasedTransaction, SyntheticCost } from '@midnight-ntwrk/ledger-
|
|
2
|
+
import { LedgerState, BlockContext, UserAddress, SignatureVerifyingKey, WellFormedStrictness, TransactionResult, ProofErasedTransaction, SyntheticCost } from '@midnight-ntwrk/ledger-v7';
|
|
3
3
|
import { LedgerOps } from '@midnight-ntwrk/wallet-sdk-utilities';
|
|
4
4
|
import { NetworkId } from './types/ledger.js';
|
|
5
5
|
export type SimulatorState = Readonly<{
|
package/dist/Simulator.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { Effect, Encoding, pipe, Stream, SubscriptionRef } from 'effect';
|
|
14
|
-
import { LedgerState, ClaimRewardsTransaction, SignatureErased, Transaction, WellFormedStrictness, TransactionContext, } from '@midnight-ntwrk/ledger-
|
|
14
|
+
import { LedgerState, ClaimRewardsTransaction, SignatureErased, Transaction, WellFormedStrictness, TransactionContext, } from '@midnight-ntwrk/ledger-v7';
|
|
15
15
|
import { DateOps, EitherOps, LedgerOps } from '@midnight-ntwrk/wallet-sdk-utilities';
|
|
16
16
|
import * as crypto from 'crypto';
|
|
17
17
|
const simpleHash = (input) => {
|
|
@@ -45,6 +45,8 @@ export class Simulator {
|
|
|
45
45
|
static apply(simulatorState, tx, strictness, blockContext, blockFullness) {
|
|
46
46
|
return LedgerOps.ledgerTry(() => {
|
|
47
47
|
blockFullness = blockFullness ?? tx.cost(simulatorState.ledger.parameters);
|
|
48
|
+
const detailedBlockFullness = simulatorState.ledger.parameters.normalizeFullness(blockFullness);
|
|
49
|
+
const computedBlockFullness = Math.max(detailedBlockFullness.readTime, detailedBlockFullness.computeTime, detailedBlockFullness.blockUsage, detailedBlockFullness.bytesWritten, detailedBlockFullness.bytesChurned);
|
|
48
50
|
const blockNumber = blockContext.secondsSinceEpoch;
|
|
49
51
|
const blockTime = DateOps.secondsToDate(blockNumber);
|
|
50
52
|
const verifiedTransaction = tx.wellFormed(simulatorState.ledger, strictness, blockTime);
|
|
@@ -52,7 +54,7 @@ export class Simulator {
|
|
|
52
54
|
const [newLedgerState, txResult] = simulatorState.ledger.apply(verifiedTransaction, transactionContext);
|
|
53
55
|
const newSimulatorState = {
|
|
54
56
|
...simulatorState,
|
|
55
|
-
ledger: newLedgerState.postBlockUpdate(blockTime,
|
|
57
|
+
ledger: newLedgerState.postBlockUpdate(blockTime, detailedBlockFullness, computedBlockFullness),
|
|
56
58
|
lastTx: tx,
|
|
57
59
|
lastTxResult: txResult,
|
|
58
60
|
lastTxNumber: blockNumber,
|
package/dist/Submission.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Effect } from 'effect';
|
|
2
2
|
import { SubmissionEvent as SubmissionEventImported } from '@midnight-ntwrk/wallet-sdk-node-client/effect';
|
|
3
|
-
import { FinalizedTransaction, ProofErasedTransaction } from '@midnight-ntwrk/ledger-
|
|
3
|
+
import { FinalizedTransaction, ProofErasedTransaction } from '@midnight-ntwrk/ledger-v7';
|
|
4
4
|
import { WalletError } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
|
5
5
|
import { Simulator } from './Simulator.js';
|
|
6
6
|
import { NetworkId } from './types/ledger.js';
|
package/dist/Sync.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Effect, Layer, Schema, Scope, Stream } from 'effect';
|
|
2
|
-
import { DustSecretKey, Event as LedgerEvent, LedgerParameters } from '@midnight-ntwrk/ledger-
|
|
2
|
+
import { DustSecretKey, Event as LedgerEvent, LedgerParameters } from '@midnight-ntwrk/ledger-v7';
|
|
3
3
|
import { SubscriptionClient, QueryClient } from '@midnight-ntwrk/wallet-sdk-indexer-client/effect';
|
|
4
4
|
import { WalletError } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
|
5
5
|
import { Simulator, SimulatorState } from './Simulator.js';
|
package/dist/Sync.js
CHANGED
|
@@ -10,8 +10,8 @@
|
|
|
10
10
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
|
-
import { Effect, Either, Layer, ParseResult, pipe, Schema, Stream } from 'effect';
|
|
14
|
-
import { Event as LedgerEvent, LedgerParameters } from '@midnight-ntwrk/ledger-
|
|
13
|
+
import { Effect, Either, Layer, ParseResult, pipe, Schema, Stream, Duration } from 'effect';
|
|
14
|
+
import { Event as LedgerEvent, LedgerParameters } from '@midnight-ntwrk/ledger-v7';
|
|
15
15
|
import { BlockHash, DustLedgerEvents } from '@midnight-ntwrk/wallet-sdk-indexer-client';
|
|
16
16
|
import { WsSubscriptionClient, HttpQueryClient, ConnectionHelper, } from '@midnight-ntwrk/wallet-sdk-indexer-client/effect';
|
|
17
17
|
import { DateOps, EitherOps, LedgerOps } from '@midnight-ntwrk/wallet-sdk-utilities';
|
|
@@ -69,7 +69,9 @@ export const makeDefaultSyncService = (config) => {
|
|
|
69
69
|
const indexerSyncService = makeIndexerSyncService(config);
|
|
70
70
|
return {
|
|
71
71
|
updates: (state, secretKey) => {
|
|
72
|
-
|
|
72
|
+
const batchSize = 50;
|
|
73
|
+
const batchTimeout = Duration.seconds(10);
|
|
74
|
+
return pipe(indexerSyncService.subscribeWallet(state), Stream.map((data) => WalletSyncUpdate.create(data, secretKey)), Stream.groupedWithin(batchSize, batchTimeout), Stream.flatMap((chunk) => Stream.fromIterable(chunk)), Stream.provideSomeLayer(indexerSyncService.connectionLayer()));
|
|
73
75
|
},
|
|
74
76
|
blockData: () => {
|
|
75
77
|
return Effect.gen(function* () {
|
package/dist/Transacting.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Either } from 'effect';
|
|
2
|
-
import { DustSecretKey, Signature, SignatureVerifyingKey, Utxo, FinalizedTransaction, ProofErasedTransaction, UnprovenTransaction, LedgerParameters } from '@midnight-ntwrk/ledger-
|
|
2
|
+
import { DustSecretKey, Signature, SignatureVerifyingKey, Utxo, FinalizedTransaction, ProofErasedTransaction, UnprovenTransaction, LedgerParameters } from '@midnight-ntwrk/ledger-v7';
|
|
3
3
|
import { ProvingRecipe, WalletError } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
|
4
4
|
import { DustCoreWallet } from './DustCoreWallet.js';
|
|
5
5
|
import { AnyTransaction, DustToken, NetworkId, TotalCostParameters } from './types/index.js';
|
package/dist/Transacting.js
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
// See the License for the specific language governing permissions and
|
|
12
12
|
// limitations under the License.
|
|
13
13
|
import { Either } from 'effect';
|
|
14
|
-
import { DustActions, DustRegistration, Intent, SignatureEnabled, Transaction, UnshieldedOffer, addressFromKey, } from '@midnight-ntwrk/ledger-
|
|
14
|
+
import { DustActions, DustRegistration, Intent, SignatureEnabled, Transaction, UnshieldedOffer, addressFromKey, } from '@midnight-ntwrk/ledger-v7';
|
|
15
15
|
import { MidnightBech32m, DustAddress } from '@midnight-ntwrk/wallet-sdk-address-format';
|
|
16
16
|
import { ProvingRecipe, WalletError } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
|
17
17
|
import { LedgerOps } from '@midnight-ntwrk/wallet-sdk-utilities';
|
package/dist/V1Builder.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Types, Either } from 'effect';
|
|
2
|
-
import { DustSecretKey, FinalizedTransaction } from '@midnight-ntwrk/ledger-
|
|
2
|
+
import { DustSecretKey, FinalizedTransaction } from '@midnight-ntwrk/ledger-v7';
|
|
3
3
|
import { VariantBuilder, Variant } from '@midnight-ntwrk/wallet-sdk-runtime/abstractions';
|
|
4
4
|
import { Proving, WalletError } from '@midnight-ntwrk/wallet-sdk-shielded/v1';
|
|
5
5
|
import { SyncService, SyncCapability, DefaultSyncConfiguration, WalletSyncUpdate } from './Sync.js';
|
package/dist/types/Dust.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { DustInitialNonce, DustNullifier, DustNonce, DustPublicKey, Utxo } from '@midnight-ntwrk/ledger-
|
|
1
|
+
import { DustInitialNonce, DustNullifier, DustNonce, DustPublicKey, Utxo } from '@midnight-ntwrk/ledger-v7';
|
|
2
2
|
export type DustToken = {
|
|
3
3
|
initialValue: bigint;
|
|
4
4
|
owner: DustPublicKey;
|
package/dist/types/ledger.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as ledger from '@midnight-ntwrk/ledger-
|
|
1
|
+
import * as ledger from '@midnight-ntwrk/ledger-v7';
|
|
2
2
|
export type AnyTransaction = ledger.UnprovenTransaction | ledger.FinalizedTransaction | ledger.ProofErasedTransaction;
|
|
3
3
|
export type UnprovenDustSpend = ledger.DustSpend<ledger.PreProof>;
|
|
4
4
|
export type NetworkId = string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@midnight-ntwrk/wallet-sdk-dust-wallet",
|
|
3
|
-
"version": "1.0.0-beta.
|
|
3
|
+
"version": "1.0.0-beta.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -23,16 +23,16 @@
|
|
|
23
23
|
}
|
|
24
24
|
},
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@midnight-ntwrk/ledger-
|
|
27
|
-
"@midnight-ntwrk/wallet-sdk-abstractions": "1.0.0-beta.
|
|
28
|
-
"@midnight-ntwrk/wallet-sdk-address-format": "3.0.0-beta.
|
|
29
|
-
"@midnight-ntwrk/wallet-sdk-capabilities": "3.0.0-beta.
|
|
30
|
-
"@midnight-ntwrk/wallet-sdk-hd": "3.0.0-beta.
|
|
31
|
-
"@midnight-ntwrk/wallet-sdk-indexer-client": "1.0.0-beta.
|
|
32
|
-
"@midnight-ntwrk/wallet-sdk-node-client": "1.0.0-beta.
|
|
33
|
-
"@midnight-ntwrk/wallet-sdk-prover-client": "1.0.0-beta.
|
|
34
|
-
"@midnight-ntwrk/wallet-sdk-shielded": "1.0.0-beta.
|
|
35
|
-
"@midnight-ntwrk/wallet-sdk-utilities": "1.0.0-beta.
|
|
26
|
+
"@midnight-ntwrk/ledger-v7": "7.0.0-alpha.1",
|
|
27
|
+
"@midnight-ntwrk/wallet-sdk-abstractions": "1.0.0-beta.10",
|
|
28
|
+
"@midnight-ntwrk/wallet-sdk-address-format": "3.0.0-beta.10",
|
|
29
|
+
"@midnight-ntwrk/wallet-sdk-capabilities": "3.0.0-beta.10",
|
|
30
|
+
"@midnight-ntwrk/wallet-sdk-hd": "3.0.0-beta.8",
|
|
31
|
+
"@midnight-ntwrk/wallet-sdk-indexer-client": "1.0.0-beta.15",
|
|
32
|
+
"@midnight-ntwrk/wallet-sdk-node-client": "1.0.0-beta.11",
|
|
33
|
+
"@midnight-ntwrk/wallet-sdk-prover-client": "1.0.0-beta.12",
|
|
34
|
+
"@midnight-ntwrk/wallet-sdk-shielded": "1.0.0-beta.14",
|
|
35
|
+
"@midnight-ntwrk/wallet-sdk-utilities": "1.0.0-beta.9",
|
|
36
36
|
"effect": "^3.17.3",
|
|
37
37
|
"rxjs": "^7.5"
|
|
38
38
|
},
|
|
@@ -50,10 +50,11 @@
|
|
|
50
50
|
"devDependencies": {
|
|
51
51
|
"@types/node": "22.17.0",
|
|
52
52
|
"eslint": "^9.37.0",
|
|
53
|
+
"prettier": "^3.7.0",
|
|
53
54
|
"publint": "~0.3.14",
|
|
54
55
|
"rimraf": "^6.0.1",
|
|
55
|
-
"testcontainers": "^11.
|
|
56
|
+
"testcontainers": "^11.10.0",
|
|
56
57
|
"typescript": "^5.9.3",
|
|
57
|
-
"vitest": "^
|
|
58
|
+
"vitest": "^4.0.16"
|
|
58
59
|
}
|
|
59
60
|
}
|