UNPKG

11.5 kBSource Map (JSON)View Raw
1{"version":3,"file":"Config.js","sourceRoot":"","sources":["Config.ts"],"names":[],"mappings":";;AASA,MAAa,MAAM;CAyQlB;AAzQD,wBAyQC","sourcesContent":["/**\n * This file was automatically generated by json-schema-to-typescript.\n * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file,\n * and run json-schema-to-typescript to regenerate this file.\n */\n\n/**\n * Connector configuration schema.\n */\nexport class Config {\n /**\n * Determines what type of network the connector is a part of. Can be: 'production', 'test'. Default: 'test'\n */\n env?: \"production\" | \"test\";\n /**\n * ILP address of the connector. This property can be omitted if an account with `relation=parent` is configured under `accounts`.\n */\n ilpAddress?: string;\n /**\n * If there are multiple parents, and `ilpAddress` is not set explicit, specify the account ID of the parent that we should load our address from. Defaults to the first parent in the `accounts` map.\n */\n ilpAddressInheritFrom?: string;\n /**\n * Description of connector account plugins.\n */\n accounts!: {\n /**\n * Description of individual account.\n */\n [k: string]: {\n /**\n * Relationship between the connector and the counterparty that the account is with.\n */\n relation: \"parent\" | \"peer\" | \"child\";\n /**\n * Name or instance of the ILP plugin that should be used for this account. A plugin instance can only be passed when instantiating the connector from JavaScript.\n */\n plugin:\n | string\n | {\n [k: string]: any;\n };\n /**\n * Currency code or other asset identifier that will be passed to the backend to select the correct rate for this account.\n */\n assetCode: string;\n /**\n * Interledger amounts are integers, but most currencies are typically represented as fractional units, e.g. cents. This property defines how many Interledger units make up one regular units. For dollars, this would usually be set to 9, so that Interledger amounts are expressed in nanodollars.\n */\n assetScale: number;\n /**\n * Defines whether the connector should maintain and enforce a balance for this account. The balance is always from the connector's perspective. Therefore, a negative balance implies the connector owes money to the counterparty and a positive balance implies the counterparty owes money to the connector. This setting is enforced by the built-in `balance` middleware.\n */\n balance?: {\n /**\n * Minimum balance (in this account's indivisible base units) the connector must maintain. The connector will reject outgoing packets if they would put it below this balance. The format is a string containing an integer (which may be prefixed with `-` to indicate a negative value), `\"-Infinity\"` or `\"Infinity\"`.\n */\n minimum?: string;\n /**\n * Maximum balance (in this account's indivisible base units) the connector will allow. The connector will reject incoming packets if they would put it above this balance. The format is a string containing an integer (which may be prefixed with `-` to indicate a negative value), `\"-Infinity\"` or `\"Infinity\"`.\n */\n maximum: string;\n /**\n * Balance (in this account's indivisible base units) numerically below which the connector will automatically initiate a settlement. The format is a string containing an integer (which may be prefixed with `-` to indicate a negative value) or `\"-Infinity\"`.\n */\n settleThreshold?: string;\n /**\n * Balance (in this account's indivisible base units) the connector will attempt to reach when settling. The format is an integer (which may be prefixed with `-` to indicate a negative value) as a string.\n */\n settleTo?: string;\n };\n /**\n * Maximum amount per packet for incoming prepare packets. Connector will reject any incoming prepare packets from this account with a higher amount. Amount should be provided as an integer in a string (in atomic units). This setting is enforced by the built-in `maxPacketAmount` middleware.\n */\n maxPacketAmount?: string;\n /**\n * Configuration to limit the total amount sent via Interledger per unit of time. This setting is enforced by the built-in `throughput` middleware.\n */\n throughput?: {\n /**\n * Length of time (in milliseconds) during which the token balance increases by `incomingAmount`/`outgoingAmount` tokens. Defaults to one second.\n */\n refillPeriod?: number;\n /**\n * Maximum incoming throughput amount (in atomic units; per second) for incoming packets. If this setting is not set, the incoming throughput limit is disabled.\n */\n incomingAmount?: string;\n /**\n * Maximum throughput amount (in atomic units; per second) for outgoing packets. If this setting is not set, the outgoing throughput limit is disabled.\n */\n outgoingAmount?: string;\n };\n /**\n * Maximum rate of incoming packets. Limit is implemented as a token bucket with a constant refill rate. When the token bucket is empty, all requests are immediately rejected. This setting is enforced by the built-in `rateLimit` middleware.\n */\n rateLimit?: {\n /**\n * Length of time (in milliseconds) during which the token balance increases by `refillCount` tokens. Defaults to one second.\n */\n refillPeriod?: number;\n /**\n * How many tokens are refilled per period. The default refill period is one second, so this would be the average number of requests per second.\n */\n refillCount?: number;\n /**\n * Maximum number of tokens in the bucket.\n */\n capacity?: number;\n };\n /**\n * Prevents sending duplicate packets.\n */\n deduplicate?: {\n /**\n * Frequency at which the connector removes old deduplicate records. (in milliseconds, default: 30000)\n */\n cleanupInterval?: number;\n /**\n * Lifetime of a cache record. (in milliseconds, default: 30000)\n */\n packetLifetime?: number;\n };\n /**\n * Whether we should broadcast routes to this peer. Defaults to `false` for `relation=child` and `true` otherwise.\n */\n sendRoutes?: boolean;\n /**\n * Whether we should receive and process route broadcasts from this peer. Defaults to `false` for `relation=child` and `true` otherwise.\n */\n receiveRoutes?: boolean;\n /**\n * Options that will be passed to the plugin constructor.\n */\n options?: {\n [k: string]: any;\n };\n /**\n * What segment will be appended to the connector's ILP address to form this account's ILP address. Only applicable to accounts with `relation=child`. Defaults to the id of the account, i.e. the key used in the `accounts` config object.\n */\n ilpAddressSegment?: string;\n };\n };\n /**\n * Which account should be used as the default route for all other traffic. Can be set to empty string to disable the default route or 'auto' to automatically use the first parent in the `accounts` map. Default: 'auto'\n */\n defaultRoute?: string;\n /**\n * Additional routes to add to the connector's routing table.\n */\n routes?: {\n /**\n * ILP address prefix that this route applies to. Configured routes take precedence over the same or shorter prefixes that are local or published by peers. More specific prefixes will still take precedence. Prefixes should NOT include a trailing period.\n */\n targetPrefix: string;\n /**\n * ID of the account that destinations matching `targetPrefix` should be forwarded to. Must be one of the accounts in `accounts`.\n */\n peerId: string;\n }[];\n /**\n * How much of a spread to add on top of the reference exchange rate. Determines the connector's margin.\n */\n spread?: number;\n /**\n * Minimum time the connector wants to budget for getting a message to the accounts its trading on. In milliseconds.\n */\n minMessageWindow?: number;\n /**\n * Maximum duration (in milliseconds) the connector is willing to place funds on hold while waiting for the outcome of a transaction.\n */\n maxHoldTime?: number;\n /**\n * Whether to broadcast known routes.\n */\n routeBroadcastEnabled?: boolean;\n /**\n * Frequency at which the connector broadcasts its routes to adjacent connectors. (in milliseconds)\n */\n routeBroadcastInterval?: number;\n /**\n * The frequency at which the connector checks for expired routes. (in milliseconds)\n */\n routeCleanupInterval?: number;\n /**\n * The maximum age of a route provided by this connector. (in milliseconds)\n */\n routeExpiry?: number;\n /**\n * Seed used for generating routing table auth values.\n */\n routingSecret?: string;\n /**\n * Name of the backend (can be built-in or a require-able module name). Built-in modules are: ecb, ecb-plus-xrp, ecb-plus-coinmarketcap, one-to-one\n */\n backend?: string;\n /**\n * Additional configuration for the backend.\n */\n backendConfig?: {\n [k: string]: any;\n };\n /**\n * Name of the store (can be built-in or a require-able module name). Built-in modules are: memory\n */\n store?: string;\n /**\n * Shorthand for `config.storeConfig.path`.\n */\n storePath?: string;\n /**\n * Additional options to be passed to the `store`'s constructor.\n */\n storeConfig?: {\n [k: string]: any;\n };\n /**\n * Additional middleware that should be added to the middleware stack.\n */\n middlewares?: {\n /**\n * Object describing middleware instance.\n */\n [k: string]: {\n /**\n * NPM module that should be `require`d to load the middleware constructor.\n */\n type: string;\n /**\n * Options that will be passed to the middleware constructor.\n */\n options?: {\n [k: string]: any;\n };\n [k: string]: any;\n };\n };\n /**\n * List of built-in middlewares that should be disabled. Can be used to replace built-in middleware with your own custom version.\n */\n disableMiddleware?: (\n | \"errorHandler\"\n | \"rateLimit\"\n | \"balance\"\n | \"maxPacketAmount\"\n | \"throughput\"\n | \"deduplicate\"\n | \"validateFulfillment\"\n | \"expire\"\n | \"stats\"\n | \"alert\")[];\n /**\n * Whether to allow routing payments back to the account that sent them.\n */\n reflectPayments?: boolean;\n /**\n * How long the connector should wait for account plugins to connect before launching other subsystems. (in milliseconds)\n */\n initialConnectTimeout?: number;\n /**\n * Whether the admin API is enabled or not. Default: false (disabled)\n */\n adminApi?: boolean;\n /**\n * Which port the admin API should listen on. Default: 7780\n */\n adminApiPort?: number;\n /**\n * Host to bind to. Warning: The admin API interface should never be made public! Default: '127.0.0.1'\n */\n adminApiHost?: string;\n /**\n * Whether the Prometheus exporter should include system metrics or not. Default: false (no)\n */\n collectDefaultMetrics?: boolean;\n}\n"]}
\No newline at end of file