Skip to content

Commit c3aee15

Browse files
authored
0.1.30
* Updated new method to allow instantiating the peer as a peer simulator apart from mainet and testnet Signed-off-by: Robert Gogete <[email protected]> * Increased package version to 0.1.30 Signed-off-by: Robert Gogete <[email protected]> * ran cargo fmt Signed-off-by: Robert Gogete <[email protected]> --------- Signed-off-by: Robert Gogete <[email protected]>
1 parent 111977a commit c3aee15

File tree

11 files changed

+154
-28
lines changed

11 files changed

+154
-28
lines changed

Cargo.lock

Lines changed: 95 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ chia-puzzles = "0.20.1"
2020
thiserror = "1.0.61"
2121
clvmr = "0.13.1"
2222
tokio = "1.39.3"
23-
chia-wallet-sdk = { version = "0.24.0", features = ["chip-0035", "native-tls"] }
23+
chia-wallet-sdk = { version = "0.24.0", features = ["chip-0035", "native-tls", "peer-simulator"] }
2424
hex-literal = "0.4.1"
2525
num-bigint = "0.4.6"
2626
hex = "0.4.3"

index.d.ts

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,11 @@ export interface PossibleLaunchersResponse {
190190
lastHeight: number
191191
lastHeaderHash: Buffer
192192
}
193+
export const enum PeerType {
194+
Mainnet = 0,
195+
Testnet11 = 1,
196+
Simulator = 2
197+
}
193198
/**
194199
* Selects coins using the knapsack algorithm.
195200
*
@@ -441,11 +446,11 @@ export declare class Peer {
441446
* Creates a new Peer instance.
442447
*
443448
* @param {String} nodeUri - URI of the node (e.g., '127.0.0.1:58444').
444-
* @param {bool} testnet - True for connecting to testnet11, false for mainnet.
449+
* @param {PeerType} peerType - Network type: 'mainnet', 'testnet11', or 'simulator'.
445450
* @param {Tls} tls - TLS connector.
446451
* @returns {Promise<Peer>} A new Peer instance.
447452
*/
448-
static new(nodeUri: string, testnet: boolean, tls: Tls): Promise<Peer>
453+
static new(nodeUri: string, peerType: PeerType, tls: Tls): Promise<Peer>
449454
/**
450455
* Retrieves all coins that are unspent on the chain. Note that coins part of spend bundles that are pending in the mempool will also be included.
451456
*

index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -310,12 +310,13 @@ if (!nativeBinding) {
310310
throw new Error(`Failed to load native binding`)
311311
}
312312

313-
const { newLineageProof, newEveProof, Tls, Peer, selectCoins, sendXch, morphLauncherId, createServerCoin, mintStore, oracleSpend, addFee, masterPublicKeyToWalletSyntheticKey, masterPublicKeyToFirstPuzzleHash, masterSecretKeyToWalletSyntheticSecretKey, secretKeyToPublicKey, puzzleHashToAddress, addressToPuzzleHash, adminDelegatedPuzzleFromKey, writerDelegatedPuzzleFromKey, oracleDelegatedPuzzle, signCoinSpends, getCoinId, updateStoreMetadata, updateStoreOwnership, meltStore, signMessage, verifySignedMessage, syntheticKeyToPuzzleHash, getCost, getMainnetGenesisChallenge, getTestnet11GenesisChallenge } = nativeBinding
313+
const { newLineageProof, newEveProof, Tls, Peer, PeerType, selectCoins, sendXch, morphLauncherId, createServerCoin, mintStore, oracleSpend, addFee, masterPublicKeyToWalletSyntheticKey, masterPublicKeyToFirstPuzzleHash, masterSecretKeyToWalletSyntheticSecretKey, secretKeyToPublicKey, puzzleHashToAddress, addressToPuzzleHash, adminDelegatedPuzzleFromKey, writerDelegatedPuzzleFromKey, oracleDelegatedPuzzle, signCoinSpends, getCoinId, updateStoreMetadata, updateStoreOwnership, meltStore, signMessage, verifySignedMessage, syntheticKeyToPuzzleHash, getCost, getMainnetGenesisChallenge, getTestnet11GenesisChallenge } = nativeBinding
314314

315315
module.exports.newLineageProof = newLineageProof
316316
module.exports.newEveProof = newEveProof
317317
module.exports.Tls = Tls
318318
module.exports.Peer = Peer
319+
module.exports.PeerType = PeerType
319320
module.exports.selectCoins = selectCoins
320321
module.exports.sendXch = sendXch
321322
module.exports.morphLauncherId = morphLauncherId

npm/darwin-arm64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dignetwork/datalayer-driver-darwin-arm64",
3-
"version": "0.1.29",
3+
"version": "0.1.30",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/DIG-Network/DataLayer-Driver"

npm/darwin-x64/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dignetwork/datalayer-driver-darwin-x64",
3-
"version": "0.1.29",
3+
"version": "0.1.30",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/DIG-Network/DataLayer-Driver"

npm/linux-arm64-gnu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dignetwork/datalayer-driver-linux-arm64-gnu",
3-
"version": "0.1.29",
3+
"version": "0.1.30",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/DIG-Network/DataLayer-Driver"

npm/linux-x64-gnu/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dignetwork/datalayer-driver-linux-x64-gnu",
3-
"version": "0.1.29",
3+
"version": "0.1.30",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/DIG-Network/DataLayer-Driver"

npm/win32-x64-msvc/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dignetwork/datalayer-driver-win32-x64-msvc",
3-
"version": "0.1.29",
3+
"version": "0.1.30",
44
"repository": {
55
"type": "git",
66
"url": "https://github.com/DIG-Network/DataLayer-Driver"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dignetwork/datalayer-driver",
3-
"version": "0.1.29",
3+
"version": "0.1.30",
44
"main": "index.js",
55
"types": "index.d.ts",
66
"repository": {

0 commit comments

Comments
 (0)