Skip to content

Commit

Permalink
moving TrustedDealerKeyPackages to keypackages new file
Browse files Browse the repository at this point in the history
  • Loading branch information
patnir committed Jan 9, 2024
1 parent 8f2e27e commit a47092e
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 22 deletions.
20 changes: 10 additions & 10 deletions ironfish-rust-nodejs/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,16 @@ export const TRANSACTION_EXPIRATION_LENGTH: number
export const TRANSACTION_FEE_LENGTH: number
export const LATEST_TRANSACTION_VERSION: number
export function verifyTransactions(serializedTransactions: Array<Buffer>): boolean
export interface TrustedDealerKeyPackages {
verifyingKey: string
proofGenerationKey: string
viewKey: string
incomingViewKey: string
outgoingViewKey: string
publicAddress: string
keyPackages: Record<string, string>
publicKeyPackage: string
}
export const enum LanguageCode {
English = 0,
ChineseSimplified = 1,
Expand All @@ -72,16 +82,6 @@ export function wordsToSpendingKey(words: string, languageCode: LanguageCode): s
export function generateKeyFromPrivateKey(privateKey: string): Key
export function initializeSapling(): void
export function isValidPublicAddress(hexAddress: string): boolean
export interface TrustedDealerKeyPackages {
verifyingKey: string
proofGenerationKey: string
viewKey: string
incomingViewKey: string
outgoingViewKey: string
publicAddress: string
keyPackages: Record<string, string>
publicKeyPackage: string
}
export class BoxKeyPair {
constructor()
static fromHex(secretHex: string): BoxKeyPair
Expand Down
12 changes: 0 additions & 12 deletions ironfish-rust-nodejs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
* License, v. 2.0. If a copy of the MPL was not distributed with this
* file, You can obtain one at https://mozilla.org/MPL/2.0/. */

use std::collections::HashMap;
use std::fmt::Display;

use ironfish::keys::Language;
Expand Down Expand Up @@ -169,14 +168,3 @@ pub fn is_valid_public_address(hex_address: String) -> bool {
PublicAddress::from_hex(&hex_address).is_ok()
}

#[napi(object)]
pub struct TrustedDealerKeyPackages {
pub verifying_key: String,
pub proof_generation_key: String,
pub view_key: String,
pub incoming_view_key: String,
pub outgoing_view_key: String,
pub public_address: String,
pub key_packages: HashMap<String, String>,
pub public_key_package: String,
}
15 changes: 15 additions & 0 deletions ironfish-rust-nodejs/src/structs/key_packages.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
use std::collections::HashMap;
use napi_derive::napi;

#[napi(object)]

pub struct TrustedDealerKeyPackages {
pub verifying_key: String,
pub proof_generation_key: String,
pub view_key: String,
pub incoming_view_key: String,
pub outgoing_view_key: String,
pub public_address: String,
pub key_packages: HashMap<String, String>,
pub public_key_package: String,
}
3 changes: 3 additions & 0 deletions ironfish-rust-nodejs/src/structs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,6 @@ pub use transaction::*;

mod witness;
pub use witness::*;

mod key_packages;
pub use key_packages::*;

0 comments on commit a47092e

Please sign in to comment.