Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2,072 changes: 1,194 additions & 878 deletions Cargo.lock

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
[package]
edition = "2021"
name = "lightningrodlabs_we-rust-utils"
version = "0.500.0-rc.3"
version = "0.501.0"

[lib]
crate-type = ["cdylib"]

[dependencies]
# Default enable napi4 feature, see https://nodejs.org/api/n-api.html#node-api-version-matrix
napi = { version = "2.12.2", default-features = false, features = [
napi = { version = "3.2.2", default-features = false, features = [
"napi4",
"tokio_rt",
"async",
"serde-json",
] }
napi-derive = "2.12.2"
napi-derive = "3.2.2"

holochain_types = "0.5.2"
lair_keystore_api = "0.6.1"
Expand Down
44 changes: 19 additions & 25 deletions index.d.ts
Original file line number Diff line number Diff line change
@@ -1,42 +1,36 @@
/* tslint:disable */
/* eslint-disable */

/* auto-generated by NAPI-RS */
/* eslint-disable */
export declare class WeRustHandler {
/** Connect to lair keystore */
static connect(keystoreUrl: string, passphrase: string): Promise<WeRustHandler>
/** Sign a zome call */
signZomeCall(payload: Array<number>, pubKey: Array<number>): Promise<Array<number>>
}

export function overwriteConfig(adminPort: number, configPath: string, keystoreConnectionUrl: string, bootstrapServerUrl: string, signalingServerUrl: string, allowedOrigin: string, signalAllowPlainText: boolean, iceServerUrls?: Array<string> | undefined | null, keystoreInProcEnvironmentDir?: string | undefined | null): string
export function defaultConductorConfig(adminPort: number, conductorEnvironmentPath: string, keystoreConnectionUrl: string, bootstrapServerUrl: string, signalingServerUrl: string, allowedOrigin: string, signalAllowPlainText: boolean, iceServerUrls?: Array<string> | undefined | null, keystoreInProcEnvironmentDir?: string | undefined | null): string
export interface HappAndUiHashes {
happSha256: string
webhappSha256?: string
uiSha256?: string
}

export declare function happBytesWithCustomProperties(happPath: string, properties: Record<string, string | undefined | null>): Promise<Array<number>>

/**
* Saves a happ or a webhapp file. If a uis_dir is specified and it is a webhapp,
* then the UI will be stored in [uis_dir]/[sha 256 of UI]/assets. If no uis_dir
* is specified, only the happ file will be stored.
*/
export declare function saveHappOrWebhapp(happOrWebHappPath: string, happsDir: string, uisDir?: string | undefined | null): Promise<StoredHappPathAndHashes>

export interface StoredHappPathAndHashes {
happPath: string
happSha256: string
webhappSha256?: string
uiSha256?: string
}
export function happBytesWithCustomProperties(happPath: string, properties: Record<string, string | undefined | null>): Promise<Array<number>>
/**
* Saves a happ or a webhapp file. If a uis_dir is specified and it is a webhapp,
* then the UI will be stored in [uis_dir]/[sha 256 of UI]/assets. If no uis_dir
* is specified, only the happ file will be stored.
*/
export function saveHappOrWebhapp(happOrWebHappPath: string, happsDir: string, uisDir?: string | undefined | null): Promise<StoredHappPathAndHashes>

/**
* Checks that the happ or webhapp is of the correct format
* WARNING: The decoding and encoding of the happ bytes seems to affect happ's sha256 hash.
*/
export function validateHappOrWebhapp(happOrWebhappBytes: Array<number>): Promise<HappAndUiHashes>
export type JsWeRustHandler = WeRustHandler
export class WeRustHandler {
constructor()
static connect(keystoreUrl: string, passphrase: string): Promise<WeRustHandler>
signZomeCall(payload: Array<number>, pubKey: Array<number>): Promise<Array<number>>
}
export type JsZomeCallSigner = ZomeCallSigner
export class ZomeCallSigner {
constructor()
static connect(connectionUrl: string, passphrase: string): Promise<ZomeCallSigner>
signZomeCall(payload: Array<number>, pubKey: Array<number>): Promise<Array<number>>
}
export declare function validateHappOrWebhapp(happOrWebhappBytes: Array<number>): Promise<HappAndUiHashes>
Loading
Loading