Files
smom-dbis-138/frontend-dapp/src/abis/PaymentChannelManager.ts
2026-03-02 12:14:09 -08:00

170 lines
7.3 KiB
TypeScript

export const PAYMENT_CHANNEL_MANAGER_ABI = [
{
inputs: [
{ name: '_admin', internalType: 'address', type: 'address' },
{ name: '_challengeWindowSeconds', internalType: 'uint256', type: 'uint256' },
],
stateMutability: 'nonpayable',
type: 'constructor',
},
{ inputs: [], name: 'admin', outputs: [{ name: '', internalType: 'address', type: 'address' }], stateMutability: 'view', type: 'function' },
{ inputs: [], name: 'paused', outputs: [{ name: '', internalType: 'bool', type: 'bool' }], stateMutability: 'view', type: 'function' },
{ inputs: [], name: 'challengeWindowSeconds', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', type: 'function' },
{
inputs: [{ name: 'participantB', internalType: 'address', type: 'address' }],
name: 'openChannel',
outputs: [{ name: 'channelId', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [{ name: 'channelId', internalType: 'uint256', type: 'uint256' }],
name: 'fundChannel',
outputs: [],
stateMutability: 'payable',
type: 'function',
},
{
inputs: [
{ name: 'channelId', internalType: 'uint256', type: 'uint256' },
{ name: 'nonce', internalType: 'uint256', type: 'uint256' },
{ name: 'balanceA', internalType: 'uint256', type: 'uint256' },
{ name: 'balanceB', internalType: 'uint256', type: 'uint256' },
{ name: 'vA', internalType: 'uint8', type: 'uint8' },
{ name: 'rA', internalType: 'bytes32', type: 'bytes32' },
{ name: 'sA', internalType: 'bytes32', type: 'bytes32' },
{ name: 'vB', internalType: 'uint8', type: 'uint8' },
{ name: 'rB', internalType: 'bytes32', type: 'bytes32' },
{ name: 'sB', internalType: 'bytes32', type: 'bytes32' },
],
name: 'closeChannelCooperative',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ name: 'channelId', internalType: 'uint256', type: 'uint256' },
{ name: 'nonce', internalType: 'uint256', type: 'uint256' },
{ name: 'balanceA', internalType: 'uint256', type: 'uint256' },
{ name: 'balanceB', internalType: 'uint256', type: 'uint256' },
{ name: 'vA', internalType: 'uint8', type: 'uint8' },
{ name: 'rA', internalType: 'bytes32', type: 'bytes32' },
{ name: 'sA', internalType: 'bytes32', type: 'bytes32' },
{ name: 'vB', internalType: 'uint8', type: 'uint8' },
{ name: 'rB', internalType: 'bytes32', type: 'bytes32' },
{ name: 'sB', internalType: 'bytes32', type: 'bytes32' },
],
name: 'submitClose',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [
{ name: 'channelId', internalType: 'uint256', type: 'uint256' },
{ name: 'nonce', internalType: 'uint256', type: 'uint256' },
{ name: 'balanceA', internalType: 'uint256', type: 'uint256' },
{ name: 'balanceB', internalType: 'uint256', type: 'uint256' },
{ name: 'vA', internalType: 'uint8', type: 'uint8' },
{ name: 'rA', internalType: 'bytes32', type: 'bytes32' },
{ name: 'sA', internalType: 'bytes32', type: 'bytes32' },
{ name: 'vB', internalType: 'uint8', type: 'uint8' },
{ name: 'rB', internalType: 'bytes32', type: 'bytes32' },
{ name: 'sB', internalType: 'bytes32', type: 'bytes32' },
],
name: 'challengeClose',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ name: 'channelId', internalType: 'uint256', type: 'uint256' }],
name: 'finalizeClose',
outputs: [],
stateMutability: 'nonpayable',
type: 'function',
},
{
inputs: [{ name: 'channelId', internalType: 'uint256', type: 'uint256' }],
name: 'getChannel',
outputs: [
{
components: [
{ name: 'participantA', internalType: 'address', type: 'address' },
{ name: 'participantB', internalType: 'address', type: 'address' },
{ name: 'depositA', internalType: 'uint256', type: 'uint256' },
{ name: 'depositB', internalType: 'uint256', type: 'uint256' },
{ name: 'status', internalType: 'uint8', type: 'uint8' },
{ name: 'disputeNonce', internalType: 'uint256', type: 'uint256' },
{ name: 'disputeBalanceA', internalType: 'uint256', type: 'uint256' },
{ name: 'disputeBalanceB', internalType: 'uint256', type: 'uint256' },
{ name: 'disputeDeadline', internalType: 'uint256', type: 'uint256' },
],
internalType: 'struct IPaymentChannelManager.Channel',
name: '',
type: 'tuple',
},
],
stateMutability: 'view',
type: 'function',
},
{ inputs: [], name: 'getChannelCount', outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], stateMutability: 'view', type: 'function' },
{
inputs: [
{ name: 'participantA', internalType: 'address', type: 'address' },
{ name: 'participantB', internalType: 'address', type: 'address' },
],
name: 'getChannelId',
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{
inputs: [{ name: 'index', internalType: 'uint256', type: 'uint256' }],
name: 'getChannelIdByIndex',
outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }],
stateMutability: 'view',
type: 'function',
},
{ inputs: [{ name: 'newAdmin', internalType: 'address', type: 'address' }], name: 'setAdmin', outputs: [], stateMutability: 'nonpayable', type: 'function' },
{ inputs: [{ name: 'newWindow', internalType: 'uint256', type: 'uint256' }], name: 'setChallengeWindow', outputs: [], stateMutability: 'nonpayable', type: 'function' },
{ inputs: [], name: 'pause', outputs: [], stateMutability: 'nonpayable', type: 'function' },
{ inputs: [], name: 'unpause', outputs: [], stateMutability: 'nonpayable', type: 'function' },
{
anonymous: false,
inputs: [
{ indexed: true, name: 'channelId', internalType: 'uint256', type: 'uint256' },
{ indexed: true, name: 'participantA', internalType: 'address', type: 'address' },
{ indexed: true, name: 'participantB', internalType: 'address', type: 'address' },
{ indexed: false, name: 'depositA', internalType: 'uint256', type: 'uint256' },
{ indexed: false, name: 'depositB', internalType: 'uint256', type: 'uint256' },
],
name: 'ChannelOpened',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, name: 'channelId', internalType: 'uint256', type: 'uint256' },
{ indexed: false, name: 'balanceA', internalType: 'uint256', type: 'uint256' },
{ indexed: false, name: 'balanceB', internalType: 'uint256', type: 'uint256' },
{ indexed: false, name: 'cooperative', internalType: 'bool', type: 'bool' },
],
name: 'ChannelClosed',
type: 'event',
},
{
anonymous: false,
inputs: [
{ indexed: true, name: 'channelId', internalType: 'uint256', type: 'uint256' },
{ indexed: false, name: 'nonce', internalType: 'uint256', type: 'uint256' },
{ indexed: false, name: 'balanceA', internalType: 'uint256', type: 'uint256' },
{ indexed: false, name: 'balanceB', internalType: 'uint256', type: 'uint256' },
{ indexed: false, name: 'newDeadline', internalType: 'uint256', type: 'uint256' },
],
name: 'ChallengeSubmitted',
type: 'event',
},
] as const