UNPKG

@nori-zk/mina-token-bridge

Version:

A Mina zk-program contract allowing users to mint tokens on Nori Bridge.

61 lines (60 loc) 2.09 kB
import 'dotenv/config'; import { PrivateKey, PublicKey, NetworkId, UInt64, Field, VerificationKey } from 'o1js'; import { FungibleToken } from './TokenBase.js'; import { MintProofData, NoriTokenController } from './NoriTokenController.js'; export interface NoriTokenControllerConfig { senderPrivateKey: string; network: NetworkId; networkUrl: string; txFee?: number; noriTokenControllerAddress?: string; tokenBaseAddress?: string; noriTokenControllerPrivateKey?: string; tokenBasePrivateKey?: string; adminPublicKey?: string; ethProcessorAddress?: string; mock?: boolean; } export interface DeploymentResult { noriTokenControllerAddress: string; tokenBaseAddress: string; txHash: string; } export interface MintResult { txHash: string; mintedAmount: string; userBalance: string; } export declare class NoriTokenControllerSubmitter { #private; protected readonly minaRPCNetworkUrl: string; noriTokenControllerVerificationKey: VerificationKey; tokenBaseVerificationKey: VerificationKey; storageInterfaceVerificationKey: VerificationKey; constructor(config: NoriTokenControllerConfig); networkSetUp(): Promise<void>; compileContracts(): Promise<void>; deployContracts(options?: { symbol?: string; decimals?: number; allowUpdates?: boolean; startPaused?: boolean; }): Promise<DeploymentResult>; setupStorage(userPublicKey: PublicKey): Promise<{ txHash: string; }>; mint(userPublicKey: PublicKey, proofData: MintProofData, // MockMintProofData | userPrivateKey: PrivateKey, fundNewAccount?: boolean): Promise<MintResult>; getUserBalance(userPublicKey: PublicKey): Promise<UInt64>; getUserStorageInfo(userPublicKey: PublicKey): Promise<{ userKeyHash: Field; mintedSoFar: Field; }>; get noriTokenControllerAddress(): string; get tokenBaseAddress(): string; get contracts(): { noriTokenController: NoriTokenController; tokenBase: FungibleToken; }; private fetchAccounts; }