/** The main Configuration */ interface Config { /** * sets the transport-function. * * @param fn the function to fetch the response for the given url */ transport?: (url: string, payload: string, timeout: number, method: string, headers: { [key: string]: string; }) => Promise; /** the names of configs to be stored */ allowed_confs?: string[]; /** configuration for a Multisig Layer2 Wallet with approver service */ zk_wallet?: ZkWallet; /** the notification config */ notifications?: Notifications; /** the chain-config name to use */ custodyLibBlockchainProfile?: CustodyLibBlockchainProfile; /** the chainId or the name of a known chain. It defines the nodelist to connect to. * (default: `"mainnet"`) * * Possible Values are: * * - `mainnet` : Mainnet Chain * - `goerli` : Goerli Testnet * - `ewc` : Energy WebFoundation * - `btc` : Bitcoin * - `ipfs` : ipfs * - `local` : local-chain * * * Example: `goerli` */ chainId?: string; /** the number in percent needed in order reach finality (% of signature of the validators). * * Example: `50` */ finality?: number; /** if true, the request should include the codes of all accounts. otherwise only the the codeHash is returned. In this case the client may ask by calling eth_getCode() afterwards. * * Example: `true` */ includeCode?: boolean; /** if true, debug messages will be written to stderr. * * Example: `true` */ debug?: boolean; /** max number of attempts in case a response is rejected. * (default: `7`) * * Example: `1` */ maxAttempts?: number; /** if true, requests sent to the input sream of the comandline util will be send theor responses in the same form as the server did. * * Example: `true` */ keepIn3?: boolean; /** if true, requests sent will be used for stats. * (default: `true`) */ stats?: boolean; /** if true the client will use binary format. This will reduce the payload of the responses by about 60% but should only be used for embedded systems or when using the API, since this format does not include the propertynames anymore. * * Example: `true` */ useBinary?: boolean; /** if true the client allows to use use experimental features, otherwise a exception is thrown if those would be used. * * Example: `true` */ experimental?: boolean; /** specifies the number of milliseconds before the request times out. increasing may be helpful if the device uses a slow connection. * (default: `20000`) * * Example: `100000` */ timeout?: number; /** if true the nodes should send a proof of the response. If set to none, verification is turned off completly. * (default: `"standard"`) * * Possible Values are: * * - `none` : no proof will be generated or verfiied. This also works with standard rpc-endpoints. * - `standard` : Stanbdard Proof means all important properties are verfiied * - `full` : In addition to standard, also some rarly needed properties are verfied, like uncles. But this causes a bigger payload. * * * Example: `none` */ proof?: string; /** if specified, the blocknumber *latest* will be replaced by blockNumber- specified value. * * Example: `6` */ replaceLatestBlock?: number; /** if true the nodelist will be automaticly updated if the lastBlock is newer. * (default: `true`) */ autoUpdateList?: boolean; /** number of signatures requested in order to verify the blockhash. * (default: `1`) * * Example: `2` */ signatureCount?: number; /** if true, the first request (updating the nodelist) will also fetch the current health status and use it for blacklisting unhealthy nodes. This is used only if no nodelist is availabkle from cache. * (default: `true`) * * Example: `true` */ bootWeights?: boolean; /** if true the client will try to use http instead of https. * * Example: `true` */ useHttp?: boolean; /** min stake of the server. Only nodes owning at least this amount will be chosen. * * Example: `10000000` */ minDeposit?: bigint; /** used to identify the capabilities of the node. * * Example: `"0xffff"` */ nodeProps?: string; /** the number of request send in parallel when getting an answer. More request will make it more expensive, but increase the chances to get a faster answer, since the client will continue once the first verifiable response was received. * (default: `2`) * * Example: `3` */ requestCount?: number; /** url of one or more direct rpc-endpoints to use. (list can be comma seperated). If this is used, proof will automaticly be turned off. * * Example: `http://loalhost:8545` */ rpc?: string; /** defining the nodelist. collection of JSON objects with chain Id (hex string) as key. * * Example: `contract: "0xac1b824795e1eb1f6e609fe0da9b9af8beaab60f" * nodeList: * - address: "0x45d45e6ff99e6c34a235d263965910298985fcfe" * url: https://in3-v2.slock.it/mainnet/nd-1 * props: "0xFFFF"` */ nodes?: Nodes; /** configuration for zksync-api ( only available if build with `-DZKSYNC=true`, which is on per default). * * Example: * ``` * account: "0x995628aa92d6a016da55e7de8b1727e1eb97d337" * sync_key: "0x9ad89ac0643ffdc32b2dab859ad0f9f7e4057ec23c2b17699c9b27eff331d816" * signer_type: contract * account: "0x995628aa92d6a016da55e7de8b1727e1eb97d337" * sync_key: "0x9ad89ac0643ffdc32b2dab859ad0f9f7e4057ec23c2b17699c9b27eff331d816" * signer_type: create2 * create2: * creator: "0x6487c3ae644703c1f07527c18fe5569592654bcb" * saltarg: "0xb90306e2391fefe48aa89a8e91acbca502a94b2d734acc3335bb2ff5c266eb12" * codehash: "0xd6af3ee91c96e29ddab0d4cb9b5dd3025caf84baad13bef7f2b87038d38251e5" * account: "0x995628aa92d6a016da55e7de8b1727e1eb97d337" * signer_type: pk * musig_pub_keys: 0x9ad89ac0643ffdc32b2dab859ad0f9f7e4057ec23c2b17699c9b27eff331d8160x9ad89ac0643ffdc32b2dab859ad0f9f7e4057ec23c2b17699c9b27eff331d816 * sync_key: "0xe8f2ee64be83c0ab9466b0490e4888dbf5a070fd1d82b567e33ebc90457a5734" * musig_urls: * - null * - https://approver.service.com * ``` */ zksync?: Zksync; /** the client key to sign requests. (only availble if build with `-DPK_SIGNER=true` , which is on per default) * * Example: `"0xc9564409cbfca3f486a07996e8015124f30ff8331fc6dcbd610a050f1f983afe"` */ key?: string; /** registers raw private keys as signers for transactions. (only availble if build with `-DPK_SIGNER=true` , which is on per default) * * Example: * ``` * "0xc9564409cbfca3f486a07996e8015124f30ff8331fc6dcbd610a050f1f983afe" * ``` */ pk?: string; /** configure the Bitcoin verification * * Example: `maxDAP: 30 * maxDiff: 5` */ btc?: Btc; } /** configuration for a Multisig Layer2 Wallet with approver service */ export interface ZkWallet { /** the url of the approving service. This service will run SDK as well using zksync_sign with proof to cosign. */ cosign_rpc?: string; /** The address of the master copy for the multisig. */ master_copy?: string; /** The address of the factory creating the multisig. */ creator?: string; } /** the notification config */ export interface Notifications { /** the notification server url * * Example: `http://localhost:8080` */ url: string; } /** the chain-config name to use */ export interface CustodyLibBlockchainProfile { /** the blockchain-profile to use * * Example: `localDevChain` */ name: string; } /** defining the nodelist. collection of JSON objects with chain Id (hex string) as key. */ export interface Nodes { /** address of the registry contract. (This is the data-contract!) */ contract?: string; /** address of the whiteList contract. This cannot be combined with whiteList! */ whiteListContract?: string; /** manual whitelist. */ whiteList?: string[]; /** identifier of the registry. */ registryId?: string; /** if set, the nodeList will be updated before next request. */ needsUpdate?: boolean; /** average block time (seconds) for this chain. */ avgBlockTime?: number; /** if the client sends an array of blockhashes the server will not deliver any signatures or blockheaders for these blocks, but only return a string with a number. This is automaticly updated by the cache, but can be overriden per request. */ verifiedHashes?: VerifiedHashes[]; /** manual nodeList. As Value a array of Node-Definitions is expected. */ nodeList?: NodeList[]; } /** if the client sends an array of blockhashes the server will not deliver any signatures or blockheaders for these blocks, but only return a string with a number. This is automaticly updated by the cache, but can be overriden per request. */ export interface VerifiedHashes { /** block number */ block: number; /** verified hash corresponding to block number. */ hash: string; } /** manual nodeList. As Value a array of Node-Definitions is expected. */ export interface NodeList { /** URL of the node. */ url: string; /** address of the node */ address: string; /** used to identify the capabilities of the node (defaults to 0xFFFF). */ props: string; } /** configuration for zksync-api ( only available if build with `-DZKSYNC=true`, which is on per default). */ export interface Zksync { /** url of the zksync-server (if not defined it will be choosen depending on the chain) * (default: `"https://api.zksync.io/jsrpc"`) */ provider_url?: string; /** the account to be used. if not specified, the first signer will be used. */ account?: string; /** the seed used to generate the sync_key. This way you can explicitly set the pk instead of derriving it from a signer. */ sync_key?: string; /** address of the main contract- If not specified it will be taken from the server. */ main_contract?: string; /** type of the account. Must be either `pk`(default), `contract` (using contract signatures) or `create2` using the create2-section. * (default: `"pk"`) * * Possible Values are: * * - `pk` : Private matching the account is used ( for EOA) * - `contract` : Contract Signature based EIP 1271 * - `create2` : create2 optionas are used * */ signer_type?: string; /** concatenated packed public keys (32byte) of the musig signers. if set the pubkey and pubkeyhash will based on the aggregated pubkey. Also the signing will use multiple keys. */ musig_pub_keys?: string; /** a array of strings with urls based on the `musig_pub_keys`. It is used so generate the combined signature by exchaing signature data (commitment and signatureshares) if the local client does not hold this key. */ musig_urls?: string[]; /** create2-arguments for sign_type `create2`. This will allow to sign for contracts which are not deployed yet. */ create2?: Create2; /** rpc-method, which will be used to verify the incomming proof before cosigning. */ verify_proof_method: string; /** rpc-method, which will be used to create the proof needed for cosigning. */ create_proof_method: string; } /** create2-arguments for sign_type `create2`. This will allow to sign for contracts which are not deployed yet. */ export interface Create2 { /** The address of contract or EOA deploying the contract ( for example the GnosisSafeFactory ) */ creator: string; /** a salt-argument, which will be added to the pubkeyhash and create the create2-salt. */ saltarg: string; /** the hash of the actual deploy-tx including the constructor-arguments. */ codehash: string; } /** configure the Bitcoin verification */ export interface Btc { /** max number of DAPs (Difficulty Adjustment Periods) allowed when accepting new targets. * (default: `20`) * * Example: `10` */ maxDAP?: number; /** max increase (in percent) of the difference between targets when accepting new targets. * (default: `10`) * * Example: `5` */ maxDiff?: number; } export default Config;