@test-org122/test-merchant-connector
Version:
An example dispute mediator for testing, which always resolve's in the sender's favor.
910 lines (893 loc) • 12.7 MB
JavaScript
/******/ (() => { // webpackBootstrap
/******/ var __webpack_modules__ = ({
/***/ "./node_modules/@connext/vector-types/dist/index.esm.js":
/*!**************************************************************!*\
!*** ./node_modules/@connext/vector-types/dist/index.esm.js ***!
\**************************************************************/
/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
"use strict";
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "ARBITRUM_TESTNET_1_CHAIN_ID": () => (/* binding */ ARBITRUM_TESTNET_1_CHAIN_ID),
/* harmony export */ "AUTODEPLOY_CHAIN_IDS": () => (/* binding */ AUTODEPLOY_CHAIN_IDS),
/* harmony export */ "AllowedSwapSchema": () => (/* binding */ AllowedSwapSchema),
/* harmony export */ "BalanceEncoding": () => (/* binding */ BalanceEncoding),
/* harmony export */ "CONDITIONAL_TRANSFER_CREATED_EVENT": () => (/* binding */ CONDITIONAL_TRANSFER_CREATED_EVENT),
/* harmony export */ "CONDITIONAL_TRANSFER_RESOLVED_EVENT": () => (/* binding */ CONDITIONAL_TRANSFER_RESOLVED_EVENT),
/* harmony export */ "ChainError": () => (/* binding */ ChainError),
/* harmony export */ "ChannelCommitmentTypes": () => (/* binding */ ChannelCommitmentTypes),
/* harmony export */ "ChannelRpcMethods": () => (/* binding */ ChannelRpcMethods),
/* harmony export */ "CoreChannelStateEncoding": () => (/* binding */ CoreChannelStateEncoding),
/* harmony export */ "CoreTransferStateEncoding": () => (/* binding */ CoreTransferStateEncoding),
/* harmony export */ "DEFAULT_CHANNEL_TIMEOUT": () => (/* binding */ DEFAULT_CHANNEL_TIMEOUT),
/* harmony export */ "DEFAULT_TRANSFER_TIMEOUT": () => (/* binding */ DEFAULT_TRANSFER_TIMEOUT),
/* harmony export */ "DEPOSIT_RECONCILED_EVENT": () => (/* binding */ DEPOSIT_RECONCILED_EVENT),
/* harmony export */ "ERC20Abi": () => (/* binding */ ERC20Abi),
/* harmony export */ "EngineError": () => (/* binding */ EngineError),
/* harmony export */ "EngineEvents": () => (/* binding */ EngineEvents),
/* harmony export */ "EngineParams": () => (/* binding */ EngineParams),
/* harmony export */ "GetTransfersFilterOptsSchema": () => (/* binding */ GetTransfersFilterOptsSchema),
/* harmony export */ "HashlockTransferName": () => (/* binding */ HashlockTransferName),
/* harmony export */ "HashlockTransferResolverEncoding": () => (/* binding */ HashlockTransferResolverEncoding),
/* harmony export */ "HashlockTransferStateEncoding": () => (/* binding */ HashlockTransferStateEncoding),
/* harmony export */ "IS_ALIVE_EVENT": () => (/* binding */ IS_ALIVE_EVENT),
/* harmony export */ "MAXIMUM_CHANNEL_TIMEOUT": () => (/* binding */ MAXIMUM_CHANNEL_TIMEOUT),
/* harmony export */ "MAXIMUM_TRANSFER_TIMEOUT": () => (/* binding */ MAXIMUM_TRANSFER_TIMEOUT),
/* harmony export */ "MINIMUM_CHANNEL_TIMEOUT": () => (/* binding */ MINIMUM_CHANNEL_TIMEOUT),
/* harmony export */ "MINIMUM_TRANSFER_TIMEOUT": () => (/* binding */ MINIMUM_TRANSFER_TIMEOUT),
/* harmony export */ "MessagingError": () => (/* binding */ MessagingError),
/* harmony export */ "NodeError": () => (/* binding */ NodeError),
/* harmony export */ "NodeParams": () => (/* binding */ NodeParams),
/* harmony export */ "NodeResponses": () => (/* binding */ NodeResponses),
/* harmony export */ "ProtocolError": () => (/* binding */ ProtocolError),
/* harmony export */ "ProtocolEventName": () => (/* binding */ ProtocolEventName),
/* harmony export */ "ProtocolParams": () => (/* binding */ ProtocolParams),
/* harmony export */ "REQUEST_COLLATERAL_EVENT": () => (/* binding */ REQUEST_COLLATERAL_EVENT),
/* harmony export */ "RESTORE_STATE_EVENT": () => (/* binding */ RESTORE_STATE_EVENT),
/* harmony export */ "Result": () => (/* binding */ Result),
/* harmony export */ "RouterError": () => (/* binding */ RouterError),
/* harmony export */ "RouterSchemas": () => (/* binding */ RouterSchemas),
/* harmony export */ "SETUP_EVENT": () => (/* binding */ SETUP_EVENT),
/* harmony export */ "StoredTransactionStatus": () => (/* binding */ StoredTransactionStatus),
/* harmony export */ "TAddress": () => (/* binding */ TAddress),
/* harmony export */ "TBalance": () => (/* binding */ TBalance),
/* harmony export */ "TBasicMeta": () => (/* binding */ TBasicMeta),
/* harmony export */ "TBytes": () => (/* binding */ TBytes),
/* harmony export */ "TBytes32": () => (/* binding */ TBytes32),
/* harmony export */ "TChainId": () => (/* binding */ TChainId),
/* harmony export */ "TChannelUpdate": () => (/* binding */ TChannelUpdate),
/* harmony export */ "TChannelUpdateDetails": () => (/* binding */ TChannelUpdateDetails),
/* harmony export */ "TChannelUpdateType": () => (/* binding */ TChannelUpdateType),
/* harmony export */ "TContractAddresses": () => (/* binding */ TContractAddresses),
/* harmony export */ "TCreateUpdateDetails": () => (/* binding */ TCreateUpdateDetails),
/* harmony export */ "TDecimalString": () => (/* binding */ TDecimalString),
/* harmony export */ "TDepositUpdateDetails": () => (/* binding */ TDepositUpdateDetails),
/* harmony export */ "TFullChannelState": () => (/* binding */ TFullChannelState),
/* harmony export */ "TFullTransferState": () => (/* binding */ TFullTransferState),
/* harmony export */ "TIntegerString": () => (/* binding */ TIntegerString),
/* harmony export */ "TNetworkContext": () => (/* binding */ TNetworkContext),
/* harmony export */ "TPublicIdentifier": () => (/* binding */ TPublicIdentifier),
/* harmony export */ "TRANSFER_DECREMENT": () => (/* binding */ TRANSFER_DECREMENT),
/* harmony export */ "TResolveUpdateDetails": () => (/* binding */ TResolveUpdateDetails),
/* harmony export */ "TSetupUpdateDetails": () => (/* binding */ TSetupUpdateDetails),
/* harmony export */ "TSignature": () => (/* binding */ TSignature),
/* harmony export */ "TTransferMeta": () => (/* binding */ TTransferMeta),
/* harmony export */ "TUrl": () => (/* binding */ TUrl),
/* harmony export */ "TransactionEvents": () => (/* binding */ TransactionEvents),
/* harmony export */ "TransactionReason": () => (/* binding */ TransactionReason),
/* harmony export */ "TransferEncodingSchema": () => (/* binding */ TransferEncodingSchema),
/* harmony export */ "TransferEncodingsMap": () => (/* binding */ TransferEncodingsMap),
/* harmony export */ "TransferNameSchema": () => (/* binding */ TransferNameSchema),
/* harmony export */ "TransferNames": () => (/* binding */ TransferNames),
/* harmony export */ "TransferResolverSchema": () => (/* binding */ TransferResolverSchema),
/* harmony export */ "TransferStateSchema": () => (/* binding */ TransferStateSchema),
/* harmony export */ "UINT_MAX": () => (/* binding */ UINT_MAX),
/* harmony export */ "UpdateType": () => (/* binding */ UpdateType),
/* harmony export */ "VectorError": () => (/* binding */ VectorError),
/* harmony export */ "VectorNodeConfigSchema": () => (/* binding */ VectorNodeConfigSchema),
/* harmony export */ "WITHDRAWAL_CREATED_EVENT": () => (/* binding */ WITHDRAWAL_CREATED_EVENT),
/* harmony export */ "WITHDRAWAL_RECONCILED_EVENT": () => (/* binding */ WITHDRAWAL_RECONCILED_EVENT),
/* harmony export */ "WITHDRAWAL_RESOLVED_EVENT": () => (/* binding */ WITHDRAWAL_RESOLVED_EVENT),
/* harmony export */ "WithdrawDataEncoding": () => (/* binding */ WithdrawDataEncoding),
/* harmony export */ "WithdrawName": () => (/* binding */ WithdrawName),
/* harmony export */ "WithdrawResolverEncoding": () => (/* binding */ WithdrawResolverEncoding),
/* harmony export */ "WithdrawStateEncoding": () => (/* binding */ WithdrawStateEncoding),
/* harmony export */ "enumify": () => (/* binding */ enumify),
/* harmony export */ "jsonifyError": () => (/* binding */ jsonifyError),
/* harmony export */ "tidy": () => (/* binding */ tidy)
/* harmony export */ });
/* harmony import */ var _ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ethersproject/bignumber */ "./node_modules/@connext/vector-types/node_modules/@ethersproject/bignumber/lib.esm/bignumber.js");
/* harmony import */ var _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @sinclair/typebox */ "./node_modules/@sinclair/typebox/typebox.js");
const jsonifyError = (error) => {
if (!!error.type) {
return error.toJson();
}
return {
message: error.message,
type: error.name,
context: {},
stack: error.stack,
};
};
class Result {
constructor(error, value) {
if (error) {
this.isError = true;
this.error = error;
}
else {
this.isError = false;
this.value = value;
}
}
getValue() {
if (this.isError) {
throw new Error(`Can't getValue() of error result: ${this.error}`);
}
return this.value;
}
getError() {
if (this.isError) {
return this.error;
}
return undefined;
}
toJson() {
if (!this.isError) {
return { isError: false, value: this.value };
}
return {
isError: true,
error: jsonifyError(this.error),
};
}
static fromJson(json) {
if (!json.isError) {
return Result.ok(json.value);
}
return json.error.type
? Result.fail(VectorError.fromJson(json.error))
: Result.fail(json.error);
}
static fail(error) {
return new Result(error);
}
static ok(result) {
return new Result(undefined, result);
}
}
class VectorError extends Error {
constructor(msg, context = {}, type = "VectorError") {
super(msg);
this.msg = msg;
this.context = context;
this.type = type;
}
toJson() {
return {
message: this.msg,
context: this.context,
type: this.type,
stack: this.stack,
};
}
static fromJson(json) {
var _a, _b, _c;
return new VectorError(json.message, (_a = json.context) !== null && _a !== void 0 ? _a : {}, (_c = (_b = json.type) !== null && _b !== void 0 ? _b : json.name) !== null && _c !== void 0 ? _c : "VectorError");
}
}
class MessagingError extends VectorError {
constructor(message, context = {}, type = "MessagingError") {
super(message, context, type);
this.message = message;
this.context = context;
this.type = type;
}
}
MessagingError.reasons = {
Timeout: "Request timed out",
Unknown: "Unknown messaging error",
};
class ProtocolError extends VectorError {
constructor(msg, state, update, params, context = {}, type = "ProtocolError") {
super(msg, Object.assign(Object.assign({}, context), { update, state, params }), type);
this.msg = msg;
this.type = type;
}
}
class EngineError extends VectorError {
constructor(msg, channelAddress, publicIdentifier, context = {}, type = "EngineError") {
super(msg, Object.assign(Object.assign({}, context), { channelAddress, publicIdentifier }), type);
this.msg = msg;
this.type = type;
}
}
class NodeError extends VectorError {
constructor(msg, context = {}, type = "NodeError") {
super(msg, Object.assign({}, context), type);
this.msg = msg;
this.type = type;
}
}
class RouterError extends VectorError {
constructor(msg, context = {}, type = "RouterError") {
super(msg, Object.assign({}, context), type);
this.msg = msg;
this.type = type;
}
}
const ERC20Abi = [
"function balanceOf(address owner) view returns (uint256)",
"function decimals() view returns (uint8)",
"function symbol() view returns (string)",
"function totalSupply() external view returns (uint256)",
"function allowance(address owner, address spender) external view returns (uint256)",
"function approve(address spender, uint256 amount) external returns (bool)",
"function transfer(address to, uint amount) returns (boolean)",
"function transferFrom(address sender, address recipient, uint256 amount) external returns (bool)",
"event Transfer(address indexed from, address indexed to, uint amount)",
"event Approval(address indexed owner, address indexed spender, uint256 value)",
];
class ChainError extends VectorError {
constructor(message, context = {}) {
super(message, context, ChainError.type);
this.message = message;
this.context = context;
this.canRetry = Object.values(ChainError.retryableTxErrors).includes(this.message);
}
}
ChainError.type = "ChainError";
ChainError.reasons = {
ProviderNotFound: "Provider not found for chainId",
SignerNotFound: "Signer not found for chainId",
SenderNotInChannel: "Sender is not a channel participant",
NegativeDepositAmount: "Cannot deposit a negative amount",
NotEnoughFunds: "Not enough funds in wallet",
FailedToDeploy: "Could not deploy vector channel",
FailedToSendTx: "Failed to send transaction to chain",
TransferNotRegistered: "Transfer not in registry",
MissingSigs: "Channel state is not double signed",
ResolverNeeded: "Transfer resolver must be provided in dispute",
NotInitialState: "Transfer must be disputed with initial state",
MultisigDeployed: "Multisig already deployed",
TransferNotFound: "Transfer is not included in active transfers",
TxReverted: "Transaction reverted on chain",
};
ChainError.retryableTxErrors = {
BadNonce: "the tx doesn't have the correct nonce",
InvalidNonce: "Invalid nonce",
MissingHash: "no transaction hash found in tx response",
UnderpricedReplancement: "replacement transaction underpriced",
};
const enumify = (x) => x;
const tidy = (str) => `${str.replace(/\n/g, "").replace(/ +/g, " ")}`;
const BalanceEncoding = tidy(`tuple(
uint256[2] amount,
address[2] to
)`);
const WithdrawDataEncoding = tidy(`tuple(
address channelAddress,
address assetId,
address recipient,
uint256 amount,
uint256 nonce,
address callTo,
bytes callData
)`);
const UpdateType = {
create: "create",
deposit: "deposit",
resolve: "resolve",
setup: "setup",
};
var ChannelCommitmentTypes;
(function (ChannelCommitmentTypes) {
ChannelCommitmentTypes[ChannelCommitmentTypes["ChannelState"] = 0] = "ChannelState";
ChannelCommitmentTypes[ChannelCommitmentTypes["WithdrawData"] = 1] = "WithdrawData";
})(ChannelCommitmentTypes || (ChannelCommitmentTypes = {}));
const CoreChannelStateEncoding = tidy(`tuple(
address channelAddress,
address alice,
address bob,
address[] assetIds,
${BalanceEncoding}[] balances,
uint256[] processedDepositsA,
uint256[] processedDepositsB,
uint256[] defundNonces,
uint256 timeout,
uint256 nonce,
bytes32 merkleRoot
)`);
const CoreTransferStateEncoding = tidy(`tuple(
address channelAddress,
bytes32 transferId,
address transferDefinition,
address initiator,
address responder,
address assetId,
${BalanceEncoding} balance,
uint256 transferTimeout,
bytes32 initialStateHash
)`);
const DEFAULT_TRANSFER_TIMEOUT = 60 * 60 * 24;
const MINIMUM_TRANSFER_TIMEOUT = DEFAULT_TRANSFER_TIMEOUT / 2;
const MAXIMUM_TRANSFER_TIMEOUT = DEFAULT_TRANSFER_TIMEOUT * 2;
const DEFAULT_CHANNEL_TIMEOUT = DEFAULT_TRANSFER_TIMEOUT * 2;
const MINIMUM_CHANNEL_TIMEOUT = DEFAULT_CHANNEL_TIMEOUT / 2;
const MAXIMUM_CHANNEL_TIMEOUT = DEFAULT_CHANNEL_TIMEOUT * 7;
const TRANSFER_DECREMENT = 60 * 72;
const UINT_MAX = _ethersproject_bignumber__WEBPACK_IMPORTED_MODULE_1__.BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").toString();
const ARBITRUM_TESTNET_1_CHAIN_ID = 152709604825713;
const AUTODEPLOY_CHAIN_IDS = [ARBITRUM_TESTNET_1_CHAIN_ID];
const ProtocolEventName = {
CHANNEL_UPDATE_EVENT: "CHANNEL_UPDATE_EVENT",
};
const TransactionEvents = {
TRANSACTION_SUBMITTED: "TRANSACTION_SUBMITTED",
TRANSACTION_MINED: "TRANSACTION_MINED",
TRANSACTION_FAILED: "TRANSACTION_FAILED",
};
const IS_ALIVE_EVENT = "IS_ALIVE";
const SETUP_EVENT = "SETUP";
const CONDITIONAL_TRANSFER_CREATED_EVENT = "CONDITIONAL_TRANSFER_CREATED";
const CONDITIONAL_TRANSFER_RESOLVED_EVENT = "CONDITIONAL_TRANSFER_RESOLVED";
const DEPOSIT_RECONCILED_EVENT = "DEPOSIT_RECONCILED";
const REQUEST_COLLATERAL_EVENT = "REQUEST_COLLATERAL";
const WITHDRAWAL_CREATED_EVENT = "WITHDRAWAL_CREATED";
const WITHDRAWAL_RESOLVED_EVENT = "WITHDRAWAL_RESOLVED";
const WITHDRAWAL_RECONCILED_EVENT = "WITHDRAWAL_RECONCILED";
const RESTORE_STATE_EVENT = "RESTORE_STATE_EVENT";
const EngineEvents = Object.assign({ [IS_ALIVE_EVENT]: IS_ALIVE_EVENT, [SETUP_EVENT]: SETUP_EVENT, [CONDITIONAL_TRANSFER_CREATED_EVENT]: CONDITIONAL_TRANSFER_CREATED_EVENT, [CONDITIONAL_TRANSFER_RESOLVED_EVENT]: CONDITIONAL_TRANSFER_RESOLVED_EVENT, [DEPOSIT_RECONCILED_EVENT]: DEPOSIT_RECONCILED_EVENT, [REQUEST_COLLATERAL_EVENT]: REQUEST_COLLATERAL_EVENT, [RESTORE_STATE_EVENT]: RESTORE_STATE_EVENT, [SETUP_EVENT]: SETUP_EVENT, [WITHDRAWAL_CREATED_EVENT]: WITHDRAWAL_CREATED_EVENT, [WITHDRAWAL_RESOLVED_EVENT]: WITHDRAWAL_RESOLVED_EVENT, [WITHDRAWAL_RECONCILED_EVENT]: WITHDRAWAL_RECONCILED_EVENT }, TransactionEvents);
const TAddress = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.RegEx(/^0x[a-fA-F0-9]{40}$/);
const TIntegerString = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.RegEx(/^([0-9])*$/);
const TDecimalString = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.RegEx(/^[0-9]*\.?[0-9]*$/);
const TPublicIdentifier = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.RegEx(/^vector([a-zA-Z0-9]{50})$/);
const TBytes32 = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.RegEx(/^0x([a-fA-F0-9]{64})$/);
const TBytes = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.RegEx(/^0x([a-fA-F0-9])$/);
const TSignature = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.RegEx(/^0x([a-fA-F0-9]{130})$/);
const TUrl = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String({ format: "uri" });
const TChainId = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Number({ minimum: 1 });
const TBalance = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
to: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TAddress),
amount: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TIntegerString),
});
const TBasicMeta = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Dict(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Any()));
const TTransferMeta = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
createdAt: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Number(),
resolvedAt: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Number()),
}),
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Dict(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Any()),
]);
const TContractAddresses = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelFactoryAddress: TAddress,
transferRegistryAddress: TAddress,
});
const TNetworkContext = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
TContractAddresses,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
chainId: TChainId,
providerUrl: TUrl,
}),
]);
const AllowedSwapSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
fromChainId: TChainId,
toChainId: TChainId,
fromAssetId: TAddress,
toAssetId: TAddress,
priceType: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union([_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal("hardcoded")]),
hardcodedRate: TDecimalString,
rebalancerUrl: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String({ format: "uri" })),
rebalanceThresholdPct: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Number({ minimum: 0, maximum: 100 })),
});
const TransferStateSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Dict(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Any());
const TransferResolverSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Any();
const TransferEncodingSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(), { maxItems: 2, minItems: 2 });
const TransferNameSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String();
const TFullTransferState = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
balance: TBalance,
assetId: TAddress,
channelAddress: TAddress,
inDispute: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Boolean(),
transferId: TBytes32,
transferDefinition: TAddress,
transferTimeout: TIntegerString,
initialStateHash: TBytes32,
initiator: TAddress,
responder: TAddress,
channelFactoryAddress: TAddress,
chainId: TChainId,
transferEncodings: TransferEncodingSchema,
transferState: TransferStateSchema,
transferResolver: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TransferResolverSchema),
meta: TTransferMeta,
channelNonce: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Integer({ minimum: 1 }),
initiatorIdentifier: TPublicIdentifier,
responderIdentifier: TPublicIdentifier,
});
const TSetupUpdateDetails = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
timeout: TIntegerString,
networkContext: TNetworkContext,
meta: TBasicMeta,
});
const TDepositUpdateDetails = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
totalDepositsAlice: TIntegerString,
totalDepositsBob: TIntegerString,
meta: TBasicMeta,
});
const TCreateUpdateDetails = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
transferId: TBytes32,
balance: TBalance,
transferDefinition: TAddress,
transferTimeout: TIntegerString,
transferInitialState: TransferStateSchema,
transferEncodings: TransferEncodingSchema,
merkleProofData: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String()),
merkleRoot: TBytes32,
meta: TBasicMeta,
});
const TResolveUpdateDetails = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
transferId: TBytes32,
transferDefinition: TAddress,
transferResolver: TransferResolverSchema,
merkleRoot: TBytes32,
meta: TBasicMeta,
});
const TChannelUpdateDetails = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union([
TSetupUpdateDetails,
TDepositUpdateDetails,
TCreateUpdateDetails,
TResolveUpdateDetails,
]);
const TChannelUpdateType = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union(Object.values(UpdateType).map((update) => _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal(update)));
const TChannelUpdate = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
fromIdentifier: TPublicIdentifier,
toIdentifier: TPublicIdentifier,
type: TChannelUpdateType,
nonce: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Number(),
balance: TBalance,
assetId: TAddress,
details: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Dict(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Any()),
aliceSignature: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union([TSignature, _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Null()])),
bobSignature: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union([TSignature, _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Null()])),
});
const TFullChannelState = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
assetIds: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TAddress, { minItems: 1 }),
balances: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TBalance, { minItems: 1 }),
channelAddress: TAddress,
alice: TAddress,
bob: TAddress,
merkleRoot: TBytes,
nonce: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Number(),
processedDepositsA: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TIntegerString),
processedDepositsB: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TIntegerString),
timeout: TIntegerString,
aliceIdentifier: TPublicIdentifier,
bobIdentifier: TPublicIdentifier,
latestUpdate: TChannelUpdate,
networkContext: TNetworkContext,
defundNonces: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TIntegerString),
inDispute: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Boolean(),
});
const VectorNodeConfigSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
adminToken: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
authUrl: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String({ format: "uri" })),
chainAddresses: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Dict(TContractAddresses),
chainProviders: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Dict(TUrl),
dbUrl: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TUrl),
logLevel: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union([
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal("fatal"),
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal("error"),
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal("warn"),
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal("info"),
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal("debug"),
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal("trace"),
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal("silent"),
])),
messagingUrl: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TUrl),
mnemonic: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String()),
natsUrl: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TUrl),
skipCheckIn: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Boolean()),
});
const ChannelRpcMethods = {
chan_signUtilityMessage: "chan_signUtilityMessage",
chan_getConfig: "chan_getConfig",
chan_getRouterConfig: "chan_getRouterConfig",
chan_getStatus: "chan_getStatus",
chan_getChannelState: "chan_getChannelState",
chan_getChannelStateByParticipants: "chan_getChannelStateByParticipants",
chan_getChannelStates: "chan_getChannelStates",
chan_getTransferStateByRoutingId: "chan_getTransferStateByRoutingId",
chan_getTransferStatesByRoutingId: "chan_getTransferStatesByRoutingId",
chan_getActiveTransfers: "chan_getActiveTransfers",
chan_getRegisteredTransfers: "chan_getRegisteredTransfers",
chan_getTransferState: "chan_getTransferState",
chan_getTransfers: "chan_getTransfers",
chan_setup: "chan_setup",
chan_sendIsAlive: "chan_sendIsAlive",
chan_requestSetup: "chan_requestSetup",
chan_deposit: "chan_deposit",
chan_requestCollateral: "chan_requestCollateral",
chan_createTransfer: "chan_createTransfer",
chan_resolveTransfer: "chan_resolveTransfer",
chan_restoreState: "chan_restoreState",
chan_withdraw: "chan_withdraw",
chan_subscribe: "chan_subscribe",
chan_unsubscribeAll: "chan_unsubscribeAll",
connext_authenticate: "connext_authenticate",
chan_dispute: "chan_dispute",
chan_defund: "chan_defund",
chan_disputeTransfer: "chan_disputeTransfer",
chan_defundTransfer: "chan_defundTransfer",
chan_decrypt: "chan_decrypt",
chan_subscription: "chan_subscription",
};
const GetRouterConfigParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
routerIdentifier: TPublicIdentifier,
});
const GetTransferStateByRoutingIdParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
routingId: TBytes32,
});
const GetTransferStatesByRoutingIdParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
routingId: TBytes32,
});
const GetChannelStateParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ channelAddress: TAddress });
const GetChannelStatesParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({});
const GetChannelStateByParticipantsParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
alice: TPublicIdentifier,
bob: TPublicIdentifier,
chainId: TChainId,
});
const GetActiveTransfersParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
});
const GetTransferStateParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
transferId: TBytes32,
});
const GetTransfersFilterOptsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TAddress),
startDate: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Any()),
endDate: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Any()),
active: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Boolean()),
routingId: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TBytes32),
transferDefinition: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TAddress),
});
const GetTransfersParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
filterOpts: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(GetTransfersFilterOptsSchema),
});
const GetRegisteredTransfersParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
chainId: TChainId,
});
const SetupEngineParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
counterpartyIdentifier: TPublicIdentifier,
chainId: TChainId,
timeout: TIntegerString,
meta: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TBasicMeta),
});
const DepositEngineParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
assetId: TAddress,
meta: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TBasicMeta),
});
const RequestCollateralEngineParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
assetId: TAddress,
amount: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TIntegerString),
});
const CreateConditionalTransferParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
amount: TIntegerString,
assetId: TAddress,
recipient: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TPublicIdentifier),
recipientChainId: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TChainId),
recipientAssetId: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TAddress),
timeout: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TIntegerString),
meta: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TBasicMeta),
type: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
details: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Dict(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Any()),
});
const ResolveTransferParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
transferId: TBytes32,
meta: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TBasicMeta),
transferResolver: TransferResolverSchema,
});
const WithdrawParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
amount: TIntegerString,
assetId: TAddress,
recipient: TAddress,
fee: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TIntegerString),
callTo: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TAddress),
callData: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String()),
meta: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TBasicMeta),
});
const DisputeChannelParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
});
const DefundChannelParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
});
const DisputeTransferParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
transferId: TBytes32,
});
const DefundTransferParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
transferId: TBytes32,
});
const SignUtilityMessageParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
message: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
});
const SendIsAliveParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ channelAddress: TAddress, skipCheckIn: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Boolean() });
const RestoreStateParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
counterpartyIdentifier: TPublicIdentifier,
chainId: TChainId,
});
const RpcRequestEngineParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
id: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Number({ minimum: 1 }),
jsonrpc: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal("2.0"),
method: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union(Object.values(ChannelRpcMethods).map((methodName) => _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal(methodName))),
params: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Any()),
});
var EngineParams;
(function (EngineParams) {
EngineParams.RpcRequestSchema = RpcRequestEngineParamsSchema;
EngineParams.GetRouterConfigSchema = GetRouterConfigParamsSchema;
EngineParams.SignUtilityMessageSchema = SignUtilityMessageParamsSchema;
EngineParams.SendIsAliveSchema = SendIsAliveParamsSchema;
EngineParams.GetTransferStateByRoutingIdSchema = GetTransferStateByRoutingIdParamsSchema;
EngineParams.GetTransferStatesByRoutingIdSchema = GetTransferStatesByRoutingIdParamsSchema;
EngineParams.GetChannelStatesSchema = GetChannelStatesParamsSchema;
EngineParams.GetChannelStateSchema = GetChannelStateParamsSchema;
EngineParams.GetChannelStateByParticipantsSchema = GetChannelStateByParticipantsParamsSchema;
EngineParams.GetActiveTransfersSchema = GetActiveTransfersParamsSchema;
EngineParams.GetTransferStateSchema = GetTransferStateParamsSchema;
EngineParams.GetTransfersSchema = GetTransfersParamsSchema;
EngineParams.GetRegisteredTransfersSchema = GetRegisteredTransfersParamsSchema;
EngineParams.SetupSchema = SetupEngineParamsSchema;
EngineParams.RestoreStateSchema = RestoreStateParamsSchema;
EngineParams.DepositSchema = DepositEngineParamsSchema;
EngineParams.RequestCollateralSchema = RequestCollateralEngineParamsSchema;
EngineParams.ConditionalTransferSchema = CreateConditionalTransferParamsSchema;
EngineParams.ResolveTransferSchema = ResolveTransferParamsSchema;
EngineParams.WithdrawSchema = WithdrawParamsSchema;
EngineParams.DisputeChannelSchema = DisputeChannelParamsSchema;
EngineParams.DefundChannelSchema = DefundChannelParamsSchema;
EngineParams.DisputeTransferSchema = DisputeTransferParamsSchema;
EngineParams.DefundTransferSchema = DefundTransferParamsSchema;
})(EngineParams || (EngineParams = {}));
const BasicChannelServerResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
}),
};
const BasicTransferServerResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
transferId: TBytes32,
routingId: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TBytes32),
}),
};
const GetRouterConfigParamsSchema$1 = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.GetRouterConfigSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
publicIdentifier: TPublicIdentifier,
}),
]);
const GetRouterConfigResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
supportedChains: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TChainId),
allowedSwaps: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(AllowedSwapSchema),
}),
};
const GetTransferStateByRoutingIdParamsSchema$1 = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.GetTransferStateByRoutingIdSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
publicIdentifier: TPublicIdentifier,
}),
]);
const GetTransferStateByRoutingIdResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union([_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Undefined(), TFullTransferState]),
};
const GetTransferStatesByRoutingIdParamsSchema$1 = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.GetTransferStatesByRoutingIdSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
publicIdentifier: TPublicIdentifier,
}),
]);
const GetTransferStatesByRoutingIdResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TFullTransferState),
};
const GetActiveTransfersByChannelAddressParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.GetActiveTransfersSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const GetActiveTransfersByChannelAddressResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TFullTransferState),
};
const GetTransferStateParamsSchema$1 = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.GetTransferStateSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const GetTransferStateResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union([_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Undefined(), TFullTransferState]),
};
const GetTransfersParamsSchema$1 = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier });
const GetTransfersResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TFullTransferState),
};
const GetChannelStateParamsSchema$1 = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.GetChannelStateSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const GetChannelStateResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union([_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Undefined(), TFullChannelState]),
};
const GetChannelStatesParamsSchema$1 = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.GetChannelStatesSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const GetChannelStatesResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(TAddress),
};
const GetChannelStateByParticipantsParamsSchema$1 = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
publicIdentifier: TPublicIdentifier,
counterparty: TPublicIdentifier,
chainId: TChainId,
});
const GetChannelStateByParticipantsResponseSchema = GetChannelStateResponseSchema;
const GetConfigResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
publicIdentifier: TPublicIdentifier,
signerAddress: TAddress,
index: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Integer(),
})),
};
const GetStatusResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
publicIdentifier: TPublicIdentifier,
signerAddress: TAddress,
providerSyncing: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Dict(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union([
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Boolean(),
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
startingBlock: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
currentBlock: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
highestBlock: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
}),
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Undefined(),
])),
version: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
}),
};
const GetListenerParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
eventName: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Union(Object.values(EngineEvents).map((e) => _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Literal(e))),
publicIdentifier: TPublicIdentifier,
});
const GetListenerResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ url: TUrl }),
};
const GetListenersParamsSchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier });
const GetListenersResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Dict(TUrl),
};
const GetRegisteredTransfersParamsSchema$1 = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.GetRegisteredTransfersSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const GetRegisteredTransfersResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Array(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
name: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
stateEncoding: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
resolverEncoding: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
definition: TAddress,
encodedCancel: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
})),
};
const PostRegisterListenerBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
publicIdentifier: TPublicIdentifier,
events: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Dict(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String()),
});
const PostRegisterListenerResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
message: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
}),
};
const PostSetupBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.SetupSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const PostSetupResponseSchema = BasicChannelServerResponseSchema;
const PostRequestSetupBodySchema = PostSetupBodySchema;
const PostRequestSetupResponseSchema = BasicChannelServerResponseSchema;
const PostDepositBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.DepositSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const PostDepositResponseSchema = BasicChannelServerResponseSchema;
const PostRequestCollateralBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.RequestCollateralSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const PostRequestCollateralResponseSchema = BasicChannelServerResponseSchema;
const PostSendDepositTxBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
amount: TIntegerString,
assetId: TAddress,
chainId: TChainId,
publicIdentifier: TPublicIdentifier,
});
const PostSendDepositTxResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
txHash: TBytes32,
}),
};
const PostConditionalTransferBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.ConditionalTransferSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const PostConditionalTransferResponseSchema = BasicTransferServerResponseSchema;
const PostResolveTransferBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.ResolveTransferSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const PostResolveTransferResponseSchema = BasicTransferServerResponseSchema;
const PostWithdrawTransferBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.WithdrawSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const PostWithdrawTransferResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
transferId: TBytes32,
transactionHash: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(TBytes32),
}),
};
const PostSignUtilityMessageBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.SignUtilityMessageSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const PostSignUtilityMessageResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
signedMessage: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
}),
};
const PostRestoreStateBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Intersect([
EngineParams.RestoreStateSchema,
_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({ publicIdentifier: TPublicIdentifier }),
]);
const PostRestoreStateResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
channelAddress: TAddress,
}),
};
const PostCreateNodeBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
index: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Integer({ minimum: 0, maximum: 2147483647 }),
mnemonic: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String()),
skipCheckIn: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Optional(_sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Boolean()),
});
const PostCreateNodeResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
publicIdentifier: TPublicIdentifier,
signerAddress: TAddress,
index: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Integer(),
}),
};
const PostAdminBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
adminToken: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String({
example: "cxt1234",
description: "Admin token",
}),
});
const PostAdminResponseSchema = {
200: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
message: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
}),
};
const PostAdminRetryWithdrawTransactionBodySchema = _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.Object({
adminToken: _sinclair_typebox__WEBPACK_IMPORTED_MODULE_0__.Type.String(),
transferId: TBytes32,
});
const PostAdminRetryWithdrawTransactionResponseSchema = {
2