UNPKG

@lumina-dex/contracts

Version:
1,606 lines (1,602 loc) 92.1 kB
export * from 'mina-fungible-token'; import * as o1js from 'o1js'; import { UInt64, Bool, Field, UInt32, PublicKey, MerkleMapWitness, Signature, State, Int64, TokenContract, VerificationKey, AccountUpdateForest, Types, DeployArgs, SmartContract } from 'o1js'; import * as o1js_dist_node_lib_provable_field_js from 'o1js/dist/node/lib/provable/field.js'; import * as o1js_dist_node_lib_provable_types_provable_intf_js from 'o1js/dist/node/lib/provable/types/provable-intf.js'; import * as o1js_dist_node_lib_provable_field from 'o1js/dist/node/lib/provable/field'; import * as o1js_dist_node_lib_provable_types_provable_intf from 'o1js/dist/node/lib/provable/types/provable-intf'; import * as o1js_dist_node_lib_provable_bool from 'o1js/dist/node/lib/provable/bool'; import * as o1js_dist_node_lib_provable_merkle_tree from 'o1js/dist/node/lib/provable/merkle-tree'; /** * Function to multiply one Uint64 by another and divide the result, * We check for overflow on the final result to avoid a premature overflow error. * @param a The multiplicand * @param b The multiplier * @param denominator The divisor * @returns the quotient and the remainder */ declare function mulDivMod(a: UInt64, b: UInt64, denominator: UInt64): { quotient: UInt64; rest: UInt64; }; /** * Function to multiply one Uint64 by another and divide the result, * We check for overflow on the final result to avoid a premature overflow error. * @param a The multiplicand * @param b The multiplier * @param denominator The divisor * @returns The 64-bit result */ declare function mulDiv(a: UInt64, b: UInt64, denominator: UInt64): UInt64; declare const SignatureRight_base: (new (value: { deployPool: o1js_dist_node_lib_provable_bool.Bool; uppdatePool: o1js_dist_node_lib_provable_bool.Bool; updateSigner: o1js_dist_node_lib_provable_bool.Bool; updateProtocol: o1js_dist_node_lib_provable_bool.Bool; updateDelegator: o1js_dist_node_lib_provable_bool.Bool; updateFactory: o1js_dist_node_lib_provable_bool.Bool; }) => { deployPool: o1js_dist_node_lib_provable_bool.Bool; uppdatePool: o1js_dist_node_lib_provable_bool.Bool; updateSigner: o1js_dist_node_lib_provable_bool.Bool; updateProtocol: o1js_dist_node_lib_provable_bool.Bool; updateDelegator: o1js_dist_node_lib_provable_bool.Bool; updateFactory: o1js_dist_node_lib_provable_bool.Bool; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf.Provable<{ deployPool: o1js_dist_node_lib_provable_bool.Bool; uppdatePool: o1js_dist_node_lib_provable_bool.Bool; updateSigner: o1js_dist_node_lib_provable_bool.Bool; updateProtocol: o1js_dist_node_lib_provable_bool.Bool; updateDelegator: o1js_dist_node_lib_provable_bool.Bool; updateFactory: o1js_dist_node_lib_provable_bool.Bool; }, { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field.Field[]) => { deployPool: o1js_dist_node_lib_provable_bool.Bool; uppdatePool: o1js_dist_node_lib_provable_bool.Bool; updateSigner: o1js_dist_node_lib_provable_bool.Bool; updateProtocol: o1js_dist_node_lib_provable_bool.Bool; updateDelegator: o1js_dist_node_lib_provable_bool.Bool; updateFactory: o1js_dist_node_lib_provable_bool.Bool; }; } & { fromValue: (value: { deployPool: boolean | o1js_dist_node_lib_provable_bool.Bool; uppdatePool: boolean | o1js_dist_node_lib_provable_bool.Bool; updateSigner: boolean | o1js_dist_node_lib_provable_bool.Bool; updateProtocol: boolean | o1js_dist_node_lib_provable_bool.Bool; updateDelegator: boolean | o1js_dist_node_lib_provable_bool.Bool; updateFactory: boolean | o1js_dist_node_lib_provable_bool.Bool; }) => { deployPool: o1js_dist_node_lib_provable_bool.Bool; uppdatePool: o1js_dist_node_lib_provable_bool.Bool; updateSigner: o1js_dist_node_lib_provable_bool.Bool; updateProtocol: o1js_dist_node_lib_provable_bool.Bool; updateDelegator: o1js_dist_node_lib_provable_bool.Bool; updateFactory: o1js_dist_node_lib_provable_bool.Bool; }; toInput: (x: { deployPool: o1js_dist_node_lib_provable_bool.Bool; uppdatePool: o1js_dist_node_lib_provable_bool.Bool; updateSigner: o1js_dist_node_lib_provable_bool.Bool; updateProtocol: o1js_dist_node_lib_provable_bool.Bool; updateDelegator: o1js_dist_node_lib_provable_bool.Bool; updateFactory: o1js_dist_node_lib_provable_bool.Bool; }) => { fields?: Field[] | undefined; packed?: [Field, number][] | undefined; }; toJSON: (x: { deployPool: o1js_dist_node_lib_provable_bool.Bool; uppdatePool: o1js_dist_node_lib_provable_bool.Bool; updateSigner: o1js_dist_node_lib_provable_bool.Bool; updateProtocol: o1js_dist_node_lib_provable_bool.Bool; updateDelegator: o1js_dist_node_lib_provable_bool.Bool; updateFactory: o1js_dist_node_lib_provable_bool.Bool; }) => { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; fromJSON: (x: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }) => { deployPool: o1js_dist_node_lib_provable_bool.Bool; uppdatePool: o1js_dist_node_lib_provable_bool.Bool; updateSigner: o1js_dist_node_lib_provable_bool.Bool; updateProtocol: o1js_dist_node_lib_provable_bool.Bool; updateDelegator: o1js_dist_node_lib_provable_bool.Bool; updateFactory: o1js_dist_node_lib_provable_bool.Bool; }; empty: () => { deployPool: o1js_dist_node_lib_provable_bool.Bool; uppdatePool: o1js_dist_node_lib_provable_bool.Bool; updateSigner: o1js_dist_node_lib_provable_bool.Bool; updateProtocol: o1js_dist_node_lib_provable_bool.Bool; updateDelegator: o1js_dist_node_lib_provable_bool.Bool; updateFactory: o1js_dist_node_lib_provable_bool.Bool; }; }; /** * Signature right to update pool information */ declare class SignatureRight extends SignatureRight_base { constructor(deployPool: Bool, uppdatePool: Bool, updateSigner: Bool, updateProtocol: Bool, updateDelegator: Bool, updateFactory: Bool); toFields(): Field[]; static canUpdatePool(): SignatureRight; static canUpdateDelegator(): SignatureRight; static canUpdateProtocol(): SignatureRight; static canUpdateSigner(): SignatureRight; static canUpdateFactory(): SignatureRight; static canDeployPool(): SignatureRight; /** * Check if the user right match the necessary right * @param right user right */ hasRight(right: SignatureRight): o1js_dist_node_lib_provable_bool.Bool; /** * hash store in the signer merkle map */ hash(): Field; } declare const UpdateFactoryInfo_base: (new (value: { newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf.Provable<{ newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }, { newVkHash: bigint; deadlineSlot: bigint; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field.Field[]) => { newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; } & { fromValue: (value: { newVkHash: string | number | bigint | o1js_dist_node_lib_provable_field.Field; deadlineSlot: number | bigint | UInt32; }) => { newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; toInput: (x: { newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { fields?: Field[] | undefined; packed?: [Field, number][] | undefined; }; toJSON: (x: { newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { newVkHash: string; deadlineSlot: string; }; fromJSON: (x: { newVkHash: string; deadlineSlot: string; }) => { newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; empty: () => { newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; }; /** * Information needed to update the factory verification key */ declare class UpdateFactoryInfo extends UpdateFactoryInfo_base { constructor(value: { newVkHash: Field; deadlineSlot: UInt32; }); /** * Data use to create the signature * @returns array of field of all parameters */ toFields(): Field[]; hash(): Field; } declare const UpgradeInfo_base: (new (value: { contractAddress: PublicKey; tokenId: o1js_dist_node_lib_provable_field.Field; newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { contractAddress: PublicKey; tokenId: o1js_dist_node_lib_provable_field.Field; newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf.Provable<{ contractAddress: PublicKey; tokenId: o1js_dist_node_lib_provable_field.Field; newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }, { contractAddress: { x: bigint; isOdd: boolean; }; tokenId: bigint; newVkHash: bigint; deadlineSlot: bigint; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field.Field[]) => { contractAddress: PublicKey; tokenId: o1js_dist_node_lib_provable_field.Field; newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; } & { fromValue: (value: { contractAddress: PublicKey | { x: Field | bigint; isOdd: Bool | boolean; }; tokenId: string | number | bigint | o1js_dist_node_lib_provable_field.Field; newVkHash: string | number | bigint | o1js_dist_node_lib_provable_field.Field; deadlineSlot: number | bigint | UInt32; }) => { contractAddress: PublicKey; tokenId: o1js_dist_node_lib_provable_field.Field; newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; toInput: (x: { contractAddress: PublicKey; tokenId: o1js_dist_node_lib_provable_field.Field; newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { fields?: Field[] | undefined; packed?: [Field, number][] | undefined; }; toJSON: (x: { contractAddress: PublicKey; tokenId: o1js_dist_node_lib_provable_field.Field; newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { contractAddress: string; tokenId: string; newVkHash: string; deadlineSlot: string; }; fromJSON: (x: { contractAddress: string; tokenId: string; newVkHash: string; deadlineSlot: string; }) => { contractAddress: PublicKey; tokenId: o1js_dist_node_lib_provable_field.Field; newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; empty: () => { contractAddress: PublicKey; tokenId: o1js_dist_node_lib_provable_field.Field; newVkHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; }; /** * Information needed to update the pool verification key */ declare class UpgradeInfo extends UpgradeInfo_base { constructor(value: { contractAddress: PublicKey; tokenId: Field; newVkHash: Field; deadlineSlot: UInt32; }); /** * Data use to create the signature * @returns array of field of all parameters */ toFields(): Field[]; hash(): Field; } declare const UpdateAccountInfo_base: (new (value: { oldUser: PublicKey; newUser: PublicKey; deadlineSlot: UInt32; }) => { oldUser: PublicKey; newUser: PublicKey; deadlineSlot: UInt32; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf.Provable<{ oldUser: PublicKey; newUser: PublicKey; deadlineSlot: UInt32; }, { oldUser: { x: bigint; isOdd: boolean; }; newUser: { x: bigint; isOdd: boolean; }; deadlineSlot: bigint; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field.Field[]) => { oldUser: PublicKey; newUser: PublicKey; deadlineSlot: UInt32; }; } & { fromValue: (value: { oldUser: PublicKey | { x: Field | bigint; isOdd: Bool | boolean; }; newUser: PublicKey | { x: Field | bigint; isOdd: Bool | boolean; }; deadlineSlot: number | bigint | UInt32; }) => { oldUser: PublicKey; newUser: PublicKey; deadlineSlot: UInt32; }; toInput: (x: { oldUser: PublicKey; newUser: PublicKey; deadlineSlot: UInt32; }) => { fields?: Field[] | undefined; packed?: [Field, number][] | undefined; }; toJSON: (x: { oldUser: PublicKey; newUser: PublicKey; deadlineSlot: UInt32; }) => { oldUser: string; newUser: string; deadlineSlot: string; }; fromJSON: (x: { oldUser: string; newUser: string; deadlineSlot: string; }) => { oldUser: PublicKey; newUser: PublicKey; deadlineSlot: UInt32; }; empty: () => { oldUser: PublicKey; newUser: PublicKey; deadlineSlot: UInt32; }; }; /** * Information needed to update the delegator/protocol */ declare class UpdateAccountInfo extends UpdateAccountInfo_base { constructor(value: { oldUser: PublicKey; newUser: PublicKey; deadlineSlot: UInt32; }); /** * Data use to create the signature * @returns array of field of all parameters */ toFields(): Field[]; hash(): Field; } declare const UpdateSignerData_base: (new (value: { oldRoot: o1js_dist_node_lib_provable_field.Field; newRoot: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { oldRoot: o1js_dist_node_lib_provable_field.Field; newRoot: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf.Provable<{ oldRoot: o1js_dist_node_lib_provable_field.Field; newRoot: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }, { oldRoot: bigint; newRoot: bigint; deadlineSlot: bigint; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field.Field[]) => { oldRoot: o1js_dist_node_lib_provable_field.Field; newRoot: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; } & { fromValue: (value: { oldRoot: string | number | bigint | o1js_dist_node_lib_provable_field.Field; newRoot: string | number | bigint | o1js_dist_node_lib_provable_field.Field; deadlineSlot: number | bigint | UInt32; }) => { oldRoot: o1js_dist_node_lib_provable_field.Field; newRoot: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; toInput: (x: { oldRoot: o1js_dist_node_lib_provable_field.Field; newRoot: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { fields?: Field[] | undefined; packed?: [Field, number][] | undefined; }; toJSON: (x: { oldRoot: o1js_dist_node_lib_provable_field.Field; newRoot: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { oldRoot: string; newRoot: string; deadlineSlot: string; }; fromJSON: (x: { oldRoot: string; newRoot: string; deadlineSlot: string; }) => { oldRoot: o1js_dist_node_lib_provable_field.Field; newRoot: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; empty: () => { oldRoot: o1js_dist_node_lib_provable_field.Field; newRoot: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; }; /** * Information needed to update the approved signer */ declare class UpdateSignerData extends UpdateSignerData_base { constructor(value: { oldRoot: Field; newRoot: Field; deadlineSlot: UInt32; }); /** * Data use to create the signature * @returns array of field of all parameters */ toFields(): Field[]; hash(): Field; } declare const MultisigInfo_base: (new (value: { approvedUpgrader: o1js_dist_node_lib_provable_field.Field; messageHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { approvedUpgrader: o1js_dist_node_lib_provable_field.Field; messageHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf.Provable<{ approvedUpgrader: o1js_dist_node_lib_provable_field.Field; messageHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }, { approvedUpgrader: bigint; messageHash: bigint; deadlineSlot: bigint; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field.Field[]) => { approvedUpgrader: o1js_dist_node_lib_provable_field.Field; messageHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; } & { fromValue: (value: { approvedUpgrader: string | number | bigint | o1js_dist_node_lib_provable_field.Field; messageHash: string | number | bigint | o1js_dist_node_lib_provable_field.Field; deadlineSlot: number | bigint | UInt32; }) => { approvedUpgrader: o1js_dist_node_lib_provable_field.Field; messageHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; toInput: (x: { approvedUpgrader: o1js_dist_node_lib_provable_field.Field; messageHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { fields?: Field[] | undefined; packed?: [Field, number][] | undefined; }; toJSON: (x: { approvedUpgrader: o1js_dist_node_lib_provable_field.Field; messageHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }) => { approvedUpgrader: string; messageHash: string; deadlineSlot: string; }; fromJSON: (x: { approvedUpgrader: string; messageHash: string; deadlineSlot: string; }) => { approvedUpgrader: o1js_dist_node_lib_provable_field.Field; messageHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; empty: () => { approvedUpgrader: o1js_dist_node_lib_provable_field.Field; messageHash: o1js_dist_node_lib_provable_field.Field; deadlineSlot: UInt32; }; }; declare class MultisigInfo extends MultisigInfo_base { constructor(value: { approvedUpgrader: Field; messageHash: Field; deadlineSlot: UInt32; }); /** * Data use to create the signature * @returns array of field of all parameters */ toFields(): Field[]; } declare const SignatureInfo_base: (new (value: { user: PublicKey; witness: MerkleMapWitness; signature: Signature; right: SignatureRight; }) => { user: PublicKey; witness: MerkleMapWitness; signature: Signature; right: SignatureRight; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf.Provable<{ user: PublicKey; witness: MerkleMapWitness; signature: Signature; right: SignatureRight; }, { user: { x: bigint; isOdd: boolean; }; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field.Field[]) => { user: PublicKey; witness: MerkleMapWitness; signature: Signature; right: SignatureRight; }; } & { fromValue: (value: { user: PublicKey | { x: Field | bigint; isOdd: Bool | boolean; }; witness: any; signature: Signature | { r: Field | bigint; s: o1js.Scalar | bigint; }; right: SignatureRight | { deployPool: boolean | o1js_dist_node_lib_provable_bool.Bool; uppdatePool: boolean | o1js_dist_node_lib_provable_bool.Bool; updateSigner: boolean | o1js_dist_node_lib_provable_bool.Bool; updateProtocol: boolean | o1js_dist_node_lib_provable_bool.Bool; updateDelegator: boolean | o1js_dist_node_lib_provable_bool.Bool; updateFactory: boolean | o1js_dist_node_lib_provable_bool.Bool; }; }) => { user: PublicKey; witness: MerkleMapWitness; signature: Signature; right: SignatureRight; }; toInput: (x: { user: PublicKey; witness: MerkleMapWitness; signature: Signature; right: SignatureRight; }) => { fields?: Field[] | undefined; packed?: [Field, number][] | undefined; }; toJSON: (x: { user: PublicKey; witness: MerkleMapWitness; signature: Signature; right: SignatureRight; }) => { user: string; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }; fromJSON: (x: { user: string; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }) => { user: PublicKey; witness: MerkleMapWitness; signature: Signature; right: SignatureRight; }; empty: () => { user: PublicKey; witness: MerkleMapWitness; signature: Signature; right: SignatureRight; }; }; /** * Information needed to verify signature in the proof */ declare class SignatureInfo extends SignatureInfo_base { constructor(value: { user: PublicKey; witness: MerkleMapWitness; signature: Signature; right: SignatureRight; }); /** * Check if the signature match the current user and data subnit * @param merkle list of approved signer * @param data data use for the signature * @returns true if the signature is valid */ validate(merkle: Field, data: Field[]): Bool; } declare const Multisig_base: (new (value: { info: MultisigInfo; signatures: SignatureInfo[]; }) => { info: MultisigInfo; signatures: SignatureInfo[]; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf.Provable<{ info: MultisigInfo; signatures: SignatureInfo[]; }, { info: { approvedUpgrader: bigint; messageHash: bigint; deadlineSlot: bigint; }; signatures: { user: { x: bigint; isOdd: boolean; }; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field.Field[]) => { info: MultisigInfo; signatures: SignatureInfo[]; }; } & { fromValue: (value: { info: MultisigInfo | { approvedUpgrader: string | number | bigint | o1js_dist_node_lib_provable_field.Field; messageHash: string | number | bigint | o1js_dist_node_lib_provable_field.Field; deadlineSlot: number | bigint | UInt32; }; signatures: SignatureInfo[] | { user: { x: bigint; isOdd: boolean; }; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; }) => { info: MultisigInfo; signatures: SignatureInfo[]; }; toInput: (x: { info: MultisigInfo; signatures: SignatureInfo[]; }) => { fields?: Field[] | undefined; packed?: [Field, number][] | undefined; }; toJSON: (x: { info: MultisigInfo; signatures: SignatureInfo[]; }) => { info: { approvedUpgrader: string; messageHash: string; deadlineSlot: string; }; signatures: { user: string; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; }; fromJSON: (x: { info: { approvedUpgrader: string; messageHash: string; deadlineSlot: string; }; signatures: { user: string; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; }) => { info: MultisigInfo; signatures: SignatureInfo[]; }; empty: () => { info: MultisigInfo; signatures: SignatureInfo[]; }; }; /** * Information needed to verify the signatures is correct */ declare class Multisig extends Multisig_base { constructor(value: { info: MultisigInfo; signatures: SignatureInfo[]; }); /** * Check if the signature match the current user and data subbit * @param data needed to verify the signature */ verifyUpdateFactory(updateInfo: UpdateFactoryInfo): void; /** * Check if the signature match the current user and data subbit * @param data needed to verify the signature */ verifyUpdatePool(upgradeInfo: UpgradeInfo): void; /** * Check if the signature match the current user and data subbit * @param data needed to verify the signature */ verifyUpdateDelegator(updateInfo: UpdateAccountInfo): void; /** * Check if the signature match the current user and data subbit * @param data needed to verify the signature */ verifyUpdateProtocol(updateInfo: UpdateAccountInfo): void; } declare const MultisigSigner_base: (new (value: { info: MultisigInfo; signatures: SignatureInfo[]; newSignatures: SignatureInfo[]; }) => { info: MultisigInfo; signatures: SignatureInfo[]; newSignatures: SignatureInfo[]; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf.Provable<{ info: MultisigInfo; signatures: SignatureInfo[]; newSignatures: SignatureInfo[]; }, { info: { approvedUpgrader: bigint; messageHash: bigint; deadlineSlot: bigint; }; signatures: { user: { x: bigint; isOdd: boolean; }; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; newSignatures: { user: { x: bigint; isOdd: boolean; }; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field.Field[]) => { info: MultisigInfo; signatures: SignatureInfo[]; newSignatures: SignatureInfo[]; }; } & { fromValue: (value: { info: MultisigInfo | { approvedUpgrader: string | number | bigint | o1js_dist_node_lib_provable_field.Field; messageHash: string | number | bigint | o1js_dist_node_lib_provable_field.Field; deadlineSlot: number | bigint | UInt32; }; signatures: SignatureInfo[] | { user: { x: bigint; isOdd: boolean; }; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; newSignatures: SignatureInfo[] | { user: { x: bigint; isOdd: boolean; }; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; }) => { info: MultisigInfo; signatures: SignatureInfo[]; newSignatures: SignatureInfo[]; }; toInput: (x: { info: MultisigInfo; signatures: SignatureInfo[]; newSignatures: SignatureInfo[]; }) => { fields?: Field[] | undefined; packed?: [Field, number][] | undefined; }; toJSON: (x: { info: MultisigInfo; signatures: SignatureInfo[]; newSignatures: SignatureInfo[]; }) => { info: { approvedUpgrader: string; messageHash: string; deadlineSlot: string; }; signatures: { user: string; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; newSignatures: { user: string; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; }; fromJSON: (x: { info: { approvedUpgrader: string; messageHash: string; deadlineSlot: string; }; signatures: { user: string; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; newSignatures: { user: string; witness: any; signature: any; right: { deployPool: boolean; uppdatePool: boolean; updateSigner: boolean; updateProtocol: boolean; updateDelegator: boolean; updateFactory: boolean; }; }[]; }) => { info: MultisigInfo; signatures: SignatureInfo[]; newSignatures: SignatureInfo[]; }; empty: () => { info: MultisigInfo; signatures: SignatureInfo[]; newSignatures: SignatureInfo[]; }; }; /** * Information needed to verify the multisig is correct to update the signer list */ declare class MultisigSigner extends MultisigSigner_base { constructor(value: { info: MultisigInfo; signatures: SignatureInfo[]; newSignatures: SignatureInfo[]; }); /** * Check if the signature match the current user and data subbit * @param data needed to verify the signature */ verifyUpdateSigner(upgradeInfo: UpdateSignerData): void; } /** * Check if the 3 signatures are valid */ declare function verifySignature(signatures: SignatureInfo[], deadlineSlot: UInt32, info: MultisigInfo, root: Field, data: Field[], right: SignatureRight): void; /** * Data needed by pool and pool token */ interface IPool { token0: State<PublicKey>; token1: State<PublicKey>; poolFactory: State<PublicKey>; } declare const SwapEvent_base: (new (value: { sender: PublicKey; amountIn: Types.UInt64; amountOut: Types.UInt64; }) => { sender: PublicKey; amountIn: Types.UInt64; amountOut: Types.UInt64; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf_js.Provable<{ sender: PublicKey; amountIn: Types.UInt64; amountOut: Types.UInt64; }, { sender: { x: bigint; isOdd: boolean; }; amountIn: bigint; amountOut: bigint; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field_js.Field[]) => { sender: PublicKey; amountIn: Types.UInt64; amountOut: Types.UInt64; }; } & { fromValue: (value: { sender: PublicKey | { x: Types.Field | bigint; isOdd: Bool | boolean; }; amountIn: number | bigint | Types.UInt64; amountOut: number | bigint | Types.UInt64; }) => { sender: PublicKey; amountIn: Types.UInt64; amountOut: Types.UInt64; }; toInput: (x: { sender: PublicKey; amountIn: Types.UInt64; amountOut: Types.UInt64; }) => { fields?: Types.Field[] | undefined; packed?: [Types.Field, number][] | undefined; }; toJSON: (x: { sender: PublicKey; amountIn: Types.UInt64; amountOut: Types.UInt64; }) => { sender: string; amountIn: string; amountOut: string; }; fromJSON: (x: { sender: string; amountIn: string; amountOut: string; }) => { sender: PublicKey; amountIn: Types.UInt64; amountOut: Types.UInt64; }; empty: () => { sender: PublicKey; amountIn: Types.UInt64; amountOut: Types.UInt64; }; }; /** * Event emitted when a swap is validated */ declare class SwapEvent extends SwapEvent_base { constructor(value: { sender: PublicKey; amountIn: UInt64; amountOut: UInt64; }); } declare const ReceiveMinaEvent_base: (new (value: { sender: PublicKey; amountMinaIn: Types.UInt64; }) => { sender: PublicKey; amountMinaIn: Types.UInt64; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf_js.Provable<{ sender: PublicKey; amountMinaIn: Types.UInt64; }, { sender: { x: bigint; isOdd: boolean; }; amountMinaIn: bigint; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field_js.Field[]) => { sender: PublicKey; amountMinaIn: Types.UInt64; }; } & { fromValue: (value: { sender: PublicKey | { x: Types.Field | bigint; isOdd: Bool | boolean; }; amountMinaIn: number | bigint | Types.UInt64; }) => { sender: PublicKey; amountMinaIn: Types.UInt64; }; toInput: (x: { sender: PublicKey; amountMinaIn: Types.UInt64; }) => { fields?: Types.Field[] | undefined; packed?: [Types.Field, number][] | undefined; }; toJSON: (x: { sender: PublicKey; amountMinaIn: Types.UInt64; }) => { sender: string; amountMinaIn: string; }; fromJSON: (x: { sender: string; amountMinaIn: string; }) => { sender: PublicKey; amountMinaIn: Types.UInt64; }; empty: () => { sender: PublicKey; amountMinaIn: Types.UInt64; }; }; /** * Event emitted when the contract receive mina in case of swap */ declare class ReceiveMinaEvent extends ReceiveMinaEvent_base { constructor(value: { sender: PublicKey; amountMinaIn: UInt64; }); } declare const AddLiquidityEvent_base: (new (value: { sender: PublicKey; amountToken0In: Types.UInt64; amountToken1In: Types.UInt64; amountLiquidityOut: Types.UInt64; }) => { sender: PublicKey; amountToken0In: Types.UInt64; amountToken1In: Types.UInt64; amountLiquidityOut: Types.UInt64; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf_js.Provable<{ sender: PublicKey; amountToken0In: Types.UInt64; amountToken1In: Types.UInt64; amountLiquidityOut: Types.UInt64; }, { sender: { x: bigint; isOdd: boolean; }; amountToken0In: bigint; amountToken1In: bigint; amountLiquidityOut: bigint; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field_js.Field[]) => { sender: PublicKey; amountToken0In: Types.UInt64; amountToken1In: Types.UInt64; amountLiquidityOut: Types.UInt64; }; } & { fromValue: (value: { sender: PublicKey | { x: Types.Field | bigint; isOdd: Bool | boolean; }; amountToken0In: number | bigint | Types.UInt64; amountToken1In: number | bigint | Types.UInt64; amountLiquidityOut: number | bigint | Types.UInt64; }) => { sender: PublicKey; amountToken0In: Types.UInt64; amountToken1In: Types.UInt64; amountLiquidityOut: Types.UInt64; }; toInput: (x: { sender: PublicKey; amountToken0In: Types.UInt64; amountToken1In: Types.UInt64; amountLiquidityOut: Types.UInt64; }) => { fields?: Types.Field[] | undefined; packed?: [Types.Field, number][] | undefined; }; toJSON: (x: { sender: PublicKey; amountToken0In: Types.UInt64; amountToken1In: Types.UInt64; amountLiquidityOut: Types.UInt64; }) => { sender: string; amountToken0In: string; amountToken1In: string; amountLiquidityOut: string; }; fromJSON: (x: { sender: string; amountToken0In: string; amountToken1In: string; amountLiquidityOut: string; }) => { sender: PublicKey; amountToken0In: Types.UInt64; amountToken1In: Types.UInt64; amountLiquidityOut: Types.UInt64; }; empty: () => { sender: PublicKey; amountToken0In: Types.UInt64; amountToken1In: Types.UInt64; amountLiquidityOut: Types.UInt64; }; }; /** * Event emitted when an user add liquidity */ declare class AddLiquidityEvent extends AddLiquidityEvent_base { constructor(value: { sender: PublicKey; amountToken0In: UInt64; amountToken1In: UInt64; amountLiquidityOut: UInt64; }); } declare const BalanceEvent_base: (new (value: { address: PublicKey; amount: Int64; }) => { address: PublicKey; amount: Int64; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf_js.Provable<{ address: PublicKey; amount: Int64; }, { address: { x: bigint; isOdd: boolean; }; amount: any; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field_js.Field[]) => { address: PublicKey; amount: Int64; }; } & { fromValue: (value: { address: PublicKey | { x: Types.Field | bigint; isOdd: Bool | boolean; }; amount: any; }) => { address: PublicKey; amount: Int64; }; toInput: (x: { address: PublicKey; amount: Int64; }) => { fields?: Types.Field[] | undefined; packed?: [Types.Field, number][] | undefined; }; toJSON: (x: { address: PublicKey; amount: Int64; }) => { address: string; amount: any; }; fromJSON: (x: { address: string; amount: any; }) => { address: PublicKey; amount: Int64; }; empty: () => { address: PublicKey; amount: Int64; }; }; /** * Event emitted when liquidity balance changed */ declare class BalanceEvent extends BalanceEvent_base { constructor(value: { address: PublicKey; amount: Int64; }); } declare const BurnLiqudityEvent_base: (new (value: { sender: PublicKey; amountMinaOut: Types.UInt64; amountLiquidity: Types.UInt64; }) => { sender: PublicKey; amountMinaOut: Types.UInt64; amountLiquidity: Types.UInt64; }) & { _isStruct: true; } & Omit<o1js_dist_node_lib_provable_types_provable_intf_js.Provable<{ sender: PublicKey; amountMinaOut: Types.UInt64; amountLiquidity: Types.UInt64; }, { sender: { x: bigint; isOdd: boolean; }; amountMinaOut: bigint; amountLiquidity: bigint; }>, "fromFields"> & { fromFields: (fields: o1js_dist_node_lib_provable_field_js.Field[]) => { sender: PublicKey; amountMinaOut: Types.UInt64; amountLiquidity: Types.UInt64; }; } & { fromValue: (value: { sender: PublicKey | { x: Types.Field | bigint; isOdd: Bool | boolean; }; amountMinaOut: number | bigint | Types.UInt64; amountLiquidity: number | bigint | Types.UInt64; }) => { sender: PublicKey; amountMinaOut: Types.UInt64; amountLiquidity: Types.UInt64; }; toInput: (x: { sender: PublicKey; amountMinaOut: Types.UInt64; amountLiquidity: Types.UInt64; }) => { fields?: Types.Field[] | undefined; packed?: [Types.Field, number][] | undefined; }; toJSON: (x: { sender: PublicKey; amountMinaOut: Types.UInt64; amountLiquidity: Types.UInt64; }) => { sender: string; amountMinaOut: string; amountLiquidity: string; }; fromJSON: (x: { sender: string; amountMinaOut: string; amountLiquidity: string; }) => { sender: PublicKey; amountMinaOut: Types.UInt64; amountLiquidity: Types.UInt64; }; empty: () => { sender: PublicKey; amountMinaOut: Types.UInt64; amountLiquidity: Types.UInt64; }; }; /** * Event emitted when liquidity was burned */ declare class BurnLiqudityEvent extends BurnLiqudityEvent_base { constructor(value: { sender: PublicKey; amountMinaOut: UInt64; amountLiquidity: UInt64; }); } /** * Main Pool contract for Lumina dex */ declare class Pool extends TokenContract implements IPool { /** * Address of first token in the pool (ordered by address) * PublicKey.empty() in case of native mina */ token0: State<PublicKey>; /** * Address of second token in the pool * Can't be empty */ token1: State<PublicKey>; /** * Pool factory contract address */ poolFactory: State<PublicKey>; /** * Protocol address stored in the pool to not exceed account update limit on swap */ protocol: State<PublicKey>; /** * Frontend max fee, 0.10% */ static maxFee: UInt64; /** * Minimun liquidity in the pool, 1000 */ static minimumLiquidity: UInt64; /** * List of pool events */ events: { swap: typeof SwapEvent; addLiquidity: typeof AddLiquidityEvent; balanceChange: typeof BalanceEvent; updateDelegator: typeof UpdateUserEvent; updateProtocol: typeof UpdateUserEvent; upgrade: typeof UpdateVerificationKeyEvent; burnLiquidity: typeof BurnLiqudityEvent; receiveMina: typeof ReceiveMinaEvent; }; /** * This method can't be called directly, deploy new pool from pool factory instead */ deploy(): Promise<void>; /** * Upgrade to a new version, necessary due to o1js breaking verification key compatibility between versions * @param multisig multisig data * @param vk new verification key */ updateVerificationKey(multisig: Multisig, vk: VerificationKey): Promise<void>; /** * Update the delegator account address from pool factory */ setDelegator(): Promise<void>; /** * Update the protocol account address from pool factory */ setProtocol(): Promise<void>; /** Approve `AccountUpdate`s that have been created outside of the token contract. * * @argument {AccountUpdateForest} updates - The `AccountUpdate`s to approve. Note that the forest size is limited by the base token contract, @see TokenContract.MAX_ACCOUNT_UPDATES The current limit is 9. */ approveBase(updates: AccountUpdateForest): Promise<void>; private checkPermissionsUpdate; /** * Transfer liquidity from an account to another * @param from account from * @param to account to * @param amount amount to tranfer */ transfer(from: PublicKey, to: PublicKey, amount: UInt64): Promise<void>; /** * Call it on the first time liquidity is supplied to the mina/token pool * @param amountMina mina to add to the pool * @param amountToken token to add to the pool * @returns liquity amount minted */ supplyFirstLiquidities(amountMina: UInt64, amountToken: UInt64): Promise<Types.UInt64>; /** * Supply liquidity to the mina/token pool if it's not the first time * The reserves max and supply min permit concurrent call, use slippage mechanism to calculate it * @param amountMina mina to add to the pool * @param amountToken token to add to the pool * @param reserveMinaMax reserve max of mina in the pool * @param reserveTokenMax reserve max of token in the pool * @param supplyMin minimun liquidity in the pool * @returns liquity amount minted */ supplyLiquidity(amountMina: UInt64, amountToken: UInt64, reserveMinaMax: UInt64, reserveTokenMax: UInt64, supplyMin: UInt64): Promise<Types.UInt64>; /** * Method to call on the first time liquidity is supplied to the token pool * @param amountToken0 amount of token 0 to add to the pool * @param amountToken1 amount of token 1 to add to the pool * @returns liquity amount minted */ supplyFirstLiquiditiesToken(amountToken0: UInt64, amountToken1: UInt64): Promise<Types.UInt64>; /** * Supply liquidity to the token/token pool if it's not the first time * The reserves max and supply min permit concurrent call, use slippage mechanism to calculate it * @param amountToken0 amount of token 0 to add to the pool * @param amountToken1 amount of token 1 to add to the pool * @param reserveMinaMax reserve max of mina in the pool * @param reserveTokenMax reserve max of token in the pool * @param supplyMin minimun liquidity in the pool * @returns liquity amount minted */ supplyLiquidityToken(amountToken0: UInt64, amountToken1: UInt64, reserveToken0Max: UInt64, reserveToken1Max: UInt64, supplyMin: UInt64): Promise<Types.UInt64>; /** * Swap token to mina * @param frontend address who collect the frontend fees * @param taxFeeFrontend fees applied by the frontend * @param amountTokenIn amount of token to swap * @param amountMinaOutMin minimum mina to received * @param balanceInMax minimum balance of token in the pool * @param balanceOutMin maximum balance of mina in the pool */ swapFromTokenToMina(frontend: PublicKey, taxFeeFrontend: UInt64, amountTokenIn: UInt64, amountMinaOutMin: UInt64, balanceInMax: UInt64, balanceOutMin: UInt64): Promise<void>; /** * Don't call this method directly, use pool token holder or