From d63cb8c6d34417ac6f272077e68182e9d63c19d9 Mon Sep 17 00:00:00 2001 From: Arthur Abeilice Date: Mon, 4 May 2026 20:04:19 -0300 Subject: [PATCH] refactor: clean up code formatting and improve readability across multiple components - Standardized the use of quotes and spacing in various files. - Removed unnecessary line breaks and trailing spaces in components. - Improved the structure of computed properties and methods for better clarity. - Enhanced the consistency of prop definitions and emit events in Vue components. - Updated the GraphQL composable to streamline error handling and data processing. - Refactored network configuration files for better organization and readability. - Cleaned up model files by removing redundant lines and ensuring consistent formatting. - Adjusted router configuration for improved readability. - Enhanced utility functions for better maintainability and clarity. --- src/blockchain/abi.ts | 2292 ++++++++--------- src/blockchain/buyerMethods.ts | 18 +- src/blockchain/events.ts | 18 +- src/blockchain/provider.ts | 17 +- src/blockchain/sellerMethods.ts | 7 +- src/blockchain/wallet.ts | 24 +- .../BuyerSteps/BuyConfirmedComponent.vue | 9 +- .../BuyerSteps/BuyerSearchComponent.vue | 50 +- src/components/BuyerSteps/QrCodeComponent.vue | 10 +- src/components/Explorer/AnalyticsCard.vue | 12 +- src/components/Explorer/TransactionTable.vue | 102 +- .../ListingComponent/BalanceCard.vue | 6 +- .../ListingComponent/ListingComponent.vue | 2 +- .../ListingComponent/TransactionCard.vue | 10 +- .../SellerSteps/SellerComponent.vue | 2 +- src/components/TopBar/TopBar.vue | 73 +- src/components/ui/AmountInput.vue | 40 +- src/components/ui/BankSelector.vue | 7 +- src/components/ui/CustomButton.vue | 2 +- src/components/ui/Dropdown.vue | 20 +- src/components/ui/ErrorMessage.vue | 3 +- src/components/ui/FormCard.vue | 3 +- src/components/ui/IconButton.vue | 3 +- src/components/ui/InfoTooltip.vue | 10 +- src/components/ui/LoadingState.vue | 10 +- src/components/ui/NetworkBadges.vue | 3 +- src/components/ui/NetworkSelector.vue | 5 +- src/components/ui/PageHeader.vue | 7 +- src/components/ui/StatusBadge.vue | 1 - src/components/ui/ToasterComponent.vue | 6 +- src/components/ui/TokenSelector.vue | 3 +- src/components/ui/WalletConnectButton.vue | 17 +- src/composables/useGraphQL.ts | 149 +- src/composables/useUser.ts | 10 +- src/config/networks.ts | 70 +- src/model/AppVersion.ts | 2 - src/model/LockStatus.ts | 9 +- src/model/NetworkEnum.ts | 6 +- src/model/Pix.ts | 18 +- src/model/WalletTransaction.ts | 4 +- src/router/index.ts | 13 +- src/utils/bbPay.ts | 6 +- src/utils/imagesPath.ts | 10 +- src/utils/networkLiquidity.ts | 10 +- src/utils/versions.ts | 6 +- src/views/ExploreView.vue | 69 +- src/views/FaqView.vue | 8 +- src/views/HomeView.vue | 15 +- src/views/ManageBidsView.vue | 9 +- src/views/VersionsView.vue | 25 +- vite.config.ts | 7 +- wagmi.config.ts | 13 +- 52 files changed, 1645 insertions(+), 1606 deletions(-) diff --git a/src/blockchain/abi.ts b/src/blockchain/abi.ts index d7af05e..c4a4f08 100644 --- a/src/blockchain/abi.ts +++ b/src/blockchain/abi.ts @@ -3,451 +3,451 @@ ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const baseUtilsAbi = [ - { type: 'error', inputs: [], name: 'AddressDenied' }, - { type: 'error', inputs: [], name: 'AlreadyReleased' }, - { type: 'error', inputs: [], name: 'AmountNotAllowed' }, - { type: 'error', inputs: [], name: 'DecOverflow' }, - { type: 'error', inputs: [], name: 'EmptyPixTarget' }, - { type: 'error', inputs: [], name: 'InvalidDeposit' }, - { type: 'error', inputs: [], name: 'InvalidSigner' }, - { type: 'error', inputs: [], name: 'LengthMismatch' }, - { type: 'error', inputs: [], name: 'LockExpired' }, - { type: 'error', inputs: [], name: 'LoopOverflow' }, - { type: 'error', inputs: [], name: 'MaxBalExceeded' }, - { type: 'error', inputs: [], name: 'NoTokens' }, - { type: 'error', inputs: [], name: 'NotEnoughTokens' }, - { type: 'error', inputs: [], name: 'NotExpired' }, - { type: 'error', inputs: [], name: 'NotInitialized' }, - { type: 'error', inputs: [], name: 'OnlySeller' }, - { type: 'error', inputs: [], name: 'Reentrancy' }, - { type: 'error', inputs: [], name: 'StaticCallFailed' }, - { type: 'error', inputs: [], name: 'TokenDenied' }, - { type: 'error', inputs: [], name: 'TxAlreadyUsed' }, - { type: 'error', inputs: [], name: 'Unauthorized' }, + { type: "error", inputs: [], name: "AddressDenied" }, + { type: "error", inputs: [], name: "AlreadyReleased" }, + { type: "error", inputs: [], name: "AmountNotAllowed" }, + { type: "error", inputs: [], name: "DecOverflow" }, + { type: "error", inputs: [], name: "EmptyPixTarget" }, + { type: "error", inputs: [], name: "InvalidDeposit" }, + { type: "error", inputs: [], name: "InvalidSigner" }, + { type: "error", inputs: [], name: "LengthMismatch" }, + { type: "error", inputs: [], name: "LockExpired" }, + { type: "error", inputs: [], name: "LoopOverflow" }, + { type: "error", inputs: [], name: "MaxBalExceeded" }, + { type: "error", inputs: [], name: "NoTokens" }, + { type: "error", inputs: [], name: "NotEnoughTokens" }, + { type: "error", inputs: [], name: "NotExpired" }, + { type: "error", inputs: [], name: "NotInitialized" }, + { type: "error", inputs: [], name: "OnlySeller" }, + { type: "error", inputs: [], name: "Reentrancy" }, + { type: "error", inputs: [], name: "StaticCallFailed" }, + { type: "error", inputs: [], name: "TokenDenied" }, + { type: "error", inputs: [], name: "TxAlreadyUsed" }, + { type: "error", inputs: [], name: "Unauthorized" }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'token', - internalType: 'address', - type: 'address', + name: "token", + internalType: "address", + type: "address", indexed: true, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, + { name: "state", internalType: "bool", type: "bool", indexed: true }, ], - name: 'AllowedERC20Updated', + name: "AllowedERC20Updated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'DepositAdded', + name: "DepositAdded", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'DepositWithdrawn', + name: "DepositWithdrawn", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'owner', - internalType: 'address', - type: 'address', + name: "owner", + internalType: "address", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'FundsWithdrawn', + name: "FundsWithdrawn", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockID', - internalType: 'uint256', - type: 'uint256', + name: "lockID", + internalType: "uint256", + type: "uint256", indexed: true, }, { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockAdded', + name: "LockAdded", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'blocks', - internalType: 'uint256', - type: 'uint256', + name: "blocks", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockBlocksUpdated', + name: "LockBlocksUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', + name: "lockId", + internalType: "uint256", + type: "uint256", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockReleased', + name: "LockReleased", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', + name: "lockId", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockReturned', + name: "LockReturned", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, + { name: "user", internalType: "address", type: "address", indexed: true }, { - name: 'newOwner', - internalType: 'address', - type: 'address', + name: "newOwner", + internalType: "address", + type: "address", indexed: true, }, ], - name: 'OwnerUpdated', + name: "OwnerUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'reputation', - internalType: 'address', - type: 'address', + name: "reputation", + internalType: "address", + type: "address", indexed: false, }, ], - name: 'ReputationUpdated', + name: "ReputationUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'merkleRoot', - internalType: 'bytes32', - type: 'bytes32', + name: "merkleRoot", + internalType: "bytes32", + type: "bytes32", indexed: true, }, ], - name: 'RootUpdated', + name: "RootUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'forwarder', - internalType: 'address', - type: 'address', + name: "forwarder", + internalType: "address", + type: "address", indexed: true, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, + { name: "state", internalType: "bool", type: "bool", indexed: true }, ], - name: 'TrustedForwarderUpdated', + name: "TrustedForwarderUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: false }, + { name: "state", internalType: "bool", type: "bool", indexed: false }, ], - name: 'ValidSet', + name: "ValidSet", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'signers', - internalType: 'address[]', - type: 'address[]', + name: "signers", + internalType: "address[]", + type: "address[]", indexed: false, }, ], - name: 'ValidSignersUpdated', + name: "ValidSignersUpdated", }, { - type: 'function', - inputs: [{ name: '_addr', internalType: 'address', type: 'address' }], - name: '_castAddrToKey', - outputs: [{ name: '_key', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'pure', + type: "function", + inputs: [{ name: "_addr", internalType: "address", type: "address" }], + name: "_castAddrToKey", + outputs: [{ name: "_key", internalType: "uint256", type: "uint256" }], + stateMutability: "pure", }, { - type: 'function', - inputs: [{ name: '_key', internalType: 'uint256', type: 'uint256' }], - name: '_castKeyToAddr', - outputs: [{ name: '_addr', internalType: 'address', type: 'address' }], - stateMutability: 'pure', + type: "function", + inputs: [{ name: "_key", internalType: "uint256", type: "uint256" }], + name: "_castKeyToAddr", + outputs: [{ name: "_addr", internalType: "address", type: "address" }], + stateMutability: "pure", }, { - type: 'function', + type: "function", inputs: [ - { name: 'erc20', internalType: 'contract ERC20', type: 'address' }, + { name: "erc20", internalType: "contract ERC20", type: "address" }, ], - name: 'allowedERC20s', - outputs: [{ name: 'state', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + name: "allowedERC20s", + outputs: [{ name: "state", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'defaultLockBlocks', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "defaultLockBlocks", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'str', internalType: 'string', type: 'string' }], - name: 'getStr', - outputs: [{ name: 'strEnc', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'pure', + type: "function", + inputs: [{ name: "str", internalType: "string", type: "string" }], + name: "getStr", + outputs: [{ name: "strEnc", internalType: "bytes32", type: "bytes32" }], + stateMutability: "pure", }, { - type: 'function', - inputs: [{ name: 'forwarder', internalType: 'address', type: 'address' }], - name: 'isTrustedForwarder', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "forwarder", internalType: "address", type: "address" }], + name: "isTrustedForwarder", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', + name: "owner", + outputs: [{ name: "", internalType: "address", type: "address" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'reputation', + name: "reputation", outputs: [ - { name: '', internalType: 'contract IReputation', type: 'address' }, + { name: "", internalType: "contract IReputation", type: "address" }, ], - stateMutability: 'view', + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'sellerKey', internalType: 'address', type: 'address' }], - name: 'sellerAllowList', - outputs: [{ name: 'root', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "sellerKey", internalType: "address", type: "address" }], + name: "sellerAllowList", + outputs: [{ name: "root", internalType: "bytes32", type: "bytes32" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: '_blocks', internalType: 'uint256', type: 'uint256' }], - name: 'setDefaultLockBlocks', + type: "function", + inputs: [{ name: "_blocks", internalType: "uint256", type: "uint256" }], + name: "setDefaultLockBlocks", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', + type: "function", + inputs: [{ name: "newOwner", internalType: "address", type: "address" }], + name: "setOwner", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ { - name: '_reputation', - internalType: 'contract IReputation', - type: 'address', + name: "_reputation", + internalType: "contract IReputation", + type: "address", }, ], - name: 'setReputation', + name: "setReputation", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: 'forwarders', internalType: 'address[]', type: 'address[]' }, - { name: 'states', internalType: 'bool[]', type: 'bool[]' }, + { name: "forwarders", internalType: "address[]", type: "address[]" }, + { name: "states", internalType: "bool[]", type: "bool[]" }, ], - name: 'setTrustedFowarders', + name: "setTrustedFowarders", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: '_validSigners', internalType: 'address[]', type: 'address[]' }, + { name: "_validSigners", internalType: "address[]", type: "address[]" }, ], - name: 'setValidSigners', + name: "setValidSigners", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: '_tokens', internalType: 'contract ERC20[]', type: 'address[]' }, - { name: '_states', internalType: 'bool[]', type: 'bool[]' }, + { name: "_tokens", internalType: "contract ERC20[]", type: "address[]" }, + { name: "_states", internalType: "bool[]", type: "bool[]" }, ], - name: 'tokenSettings', + name: "tokenSettings", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'trustedForwarders', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "", internalType: "address", type: "address" }], + name: "trustedForwarders", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'message', internalType: 'bytes32', type: 'bytes32' }], - name: 'usedTransactions', - outputs: [{ name: 'used', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "message", internalType: "bytes32", type: "bytes32" }], + name: "usedTransactions", + outputs: [{ name: "used", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'signer', internalType: 'uint256', type: 'uint256' }], - name: 'validBacenSigners', - outputs: [{ name: 'valid', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "signer", internalType: "uint256", type: "uint256" }], + name: "validBacenSigners", + outputs: [{ name: "valid", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'withdrawBalance', + name: "withdrawBalance", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, -] as const +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ECDSA ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const ecdsaAbi = [ - { type: 'error', inputs: [], name: 'InvalidSignature' }, -] as const + { type: "error", inputs: [], name: "InvalidSignature" }, +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ERC20 @@ -455,151 +455,151 @@ export const ecdsaAbi = [ export const erc20Abi = [ { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'owner', - internalType: 'address', - type: 'address', + name: "owner", + internalType: "address", + type: "address", indexed: true, }, { - name: 'spender', - internalType: 'address', - type: 'address', + name: "spender", + internalType: "address", + type: "address", indexed: true, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'Approval', + name: "Approval", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ - { name: 'from', internalType: 'address', type: 'address', indexed: true }, - { name: 'to', internalType: 'address', type: 'address', indexed: true }, + { name: "from", internalType: "address", type: "address", indexed: true }, + { name: "to", internalType: "address", type: "address", indexed: true }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'Transfer', + name: "Transfer", }, { - type: 'function', + type: "function", inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', + name: "DOMAIN_SEPARATOR", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'address', type: 'address' }, + { name: "", internalType: "address", type: "address" }, + { name: "", internalType: "address", type: "address" }, ], - name: 'allowance', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "allowance", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'spender', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, + { name: "spender", internalType: "address", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, ], - name: 'approve', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', + name: "approve", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "nonpayable", }, { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "", internalType: "address", type: "address" }], + name: "balanceOf", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'decimals', - outputs: [{ name: '', internalType: 'uint8', type: 'uint8' }], - stateMutability: 'view', + name: "decimals", + outputs: [{ name: "", internalType: "uint8", type: "uint8" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'name', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', + name: "name", + outputs: [{ name: "", internalType: "string", type: "string" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'nonces', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "", internalType: "address", type: "address" }], + name: "nonces", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'owner', internalType: 'address', type: 'address' }, - { name: 'spender', internalType: 'address', type: 'address' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'deadline', internalType: 'uint256', type: 'uint256' }, - { name: 'v', internalType: 'uint8', type: 'uint8' }, - { name: 'r', internalType: 'bytes32', type: 'bytes32' }, - { name: 's', internalType: 'bytes32', type: 'bytes32' }, + { name: "owner", internalType: "address", type: "address" }, + { name: "spender", internalType: "address", type: "address" }, + { name: "value", internalType: "uint256", type: "uint256" }, + { name: "deadline", internalType: "uint256", type: "uint256" }, + { name: "v", internalType: "uint8", type: "uint8" }, + { name: "r", internalType: "bytes32", type: "bytes32" }, + { name: "s", internalType: "bytes32", type: "bytes32" }, ], - name: 'permit', + name: "permit", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [], - name: 'symbol', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', + name: "symbol", + outputs: [{ name: "", internalType: "string", type: "string" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'totalSupply', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "totalSupply", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, + { name: "to", internalType: "address", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, ], - name: 'transfer', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', + name: "transfer", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, + { name: "from", internalType: "address", type: "address" }, + { name: "to", internalType: "address", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, ], - name: 'transferFrom', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', + name: "transferFrom", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "nonpayable", }, -] as const +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ERC2771Context @@ -607,296 +607,296 @@ export const erc20Abi = [ export const erc2771ContextAbi = [ { - type: 'function', - inputs: [{ name: 'forwarder', internalType: 'address', type: 'address' }], - name: 'isTrustedForwarder', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "forwarder", internalType: "address", type: "address" }], + name: "isTrustedForwarder", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'trustedForwarders', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "", internalType: "address", type: "address" }], + name: "trustedForwarders", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "view", }, -] as const +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // EventAndErrors ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const eventAndErrorsAbi = [ - { type: 'error', inputs: [], name: 'AddressDenied' }, - { type: 'error', inputs: [], name: 'AlreadyReleased' }, - { type: 'error', inputs: [], name: 'AmountNotAllowed' }, - { type: 'error', inputs: [], name: 'DecOverflow' }, - { type: 'error', inputs: [], name: 'EmptyPixTarget' }, - { type: 'error', inputs: [], name: 'InvalidDeposit' }, - { type: 'error', inputs: [], name: 'InvalidSigner' }, - { type: 'error', inputs: [], name: 'LengthMismatch' }, - { type: 'error', inputs: [], name: 'LockExpired' }, - { type: 'error', inputs: [], name: 'LoopOverflow' }, - { type: 'error', inputs: [], name: 'MaxBalExceeded' }, - { type: 'error', inputs: [], name: 'NoTokens' }, - { type: 'error', inputs: [], name: 'NotEnoughTokens' }, - { type: 'error', inputs: [], name: 'NotExpired' }, - { type: 'error', inputs: [], name: 'NotInitialized' }, - { type: 'error', inputs: [], name: 'OnlySeller' }, - { type: 'error', inputs: [], name: 'StaticCallFailed' }, - { type: 'error', inputs: [], name: 'TokenDenied' }, - { type: 'error', inputs: [], name: 'TxAlreadyUsed' }, + { type: "error", inputs: [], name: "AddressDenied" }, + { type: "error", inputs: [], name: "AlreadyReleased" }, + { type: "error", inputs: [], name: "AmountNotAllowed" }, + { type: "error", inputs: [], name: "DecOverflow" }, + { type: "error", inputs: [], name: "EmptyPixTarget" }, + { type: "error", inputs: [], name: "InvalidDeposit" }, + { type: "error", inputs: [], name: "InvalidSigner" }, + { type: "error", inputs: [], name: "LengthMismatch" }, + { type: "error", inputs: [], name: "LockExpired" }, + { type: "error", inputs: [], name: "LoopOverflow" }, + { type: "error", inputs: [], name: "MaxBalExceeded" }, + { type: "error", inputs: [], name: "NoTokens" }, + { type: "error", inputs: [], name: "NotEnoughTokens" }, + { type: "error", inputs: [], name: "NotExpired" }, + { type: "error", inputs: [], name: "NotInitialized" }, + { type: "error", inputs: [], name: "OnlySeller" }, + { type: "error", inputs: [], name: "StaticCallFailed" }, + { type: "error", inputs: [], name: "TokenDenied" }, + { type: "error", inputs: [], name: "TxAlreadyUsed" }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'token', - internalType: 'address', - type: 'address', + name: "token", + internalType: "address", + type: "address", indexed: true, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, + { name: "state", internalType: "bool", type: "bool", indexed: true }, ], - name: 'AllowedERC20Updated', + name: "AllowedERC20Updated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'DepositAdded', + name: "DepositAdded", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'DepositWithdrawn', + name: "DepositWithdrawn", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'owner', - internalType: 'address', - type: 'address', + name: "owner", + internalType: "address", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'FundsWithdrawn', + name: "FundsWithdrawn", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockID', - internalType: 'uint256', - type: 'uint256', + name: "lockID", + internalType: "uint256", + type: "uint256", indexed: true, }, { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockAdded', + name: "LockAdded", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'blocks', - internalType: 'uint256', - type: 'uint256', + name: "blocks", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockBlocksUpdated', + name: "LockBlocksUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', + name: "lockId", + internalType: "uint256", + type: "uint256", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockReleased', + name: "LockReleased", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', + name: "lockId", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockReturned', + name: "LockReturned", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'reputation', - internalType: 'address', - type: 'address', + name: "reputation", + internalType: "address", + type: "address", indexed: false, }, ], - name: 'ReputationUpdated', + name: "ReputationUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'merkleRoot', - internalType: 'bytes32', - type: 'bytes32', + name: "merkleRoot", + internalType: "bytes32", + type: "bytes32", indexed: true, }, ], - name: 'RootUpdated', + name: "RootUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'forwarder', - internalType: 'address', - type: 'address', + name: "forwarder", + internalType: "address", + type: "address", indexed: true, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, + { name: "state", internalType: "bool", type: "bool", indexed: true }, ], - name: 'TrustedForwarderUpdated', + name: "TrustedForwarderUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: false }, + { name: "state", internalType: "bool", type: "bool", indexed: false }, ], - name: 'ValidSet', + name: "ValidSet", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'signers', - internalType: 'address[]', - type: 'address[]', + name: "signers", + internalType: "address[]", + type: "address[]", indexed: false, }, ], - name: 'ValidSignersUpdated', + name: "ValidSignersUpdated", }, -] as const +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // IReputation @@ -904,15 +904,15 @@ export const eventAndErrorsAbi = [ export const iReputationAbi = [ { - type: 'function', - inputs: [{ name: '_userCredit', internalType: 'uint256', type: 'uint256' }], - name: 'limiter', + type: "function", + inputs: [{ name: "_userCredit", internalType: "uint256", type: "uint256" }], + name: "limiter", outputs: [ - { name: '_spendLimit', internalType: 'uint256', type: 'uint256' }, + { name: "_spendLimit", internalType: "uint256", type: "uint256" }, ], - stateMutability: 'pure', + stateMutability: "pure", }, -] as const +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // MockToken @@ -920,678 +920,678 @@ export const iReputationAbi = [ export const mockTokenAbi = [ { - type: 'constructor', - inputs: [{ name: 'supply', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'nonpayable', + type: "constructor", + inputs: [{ name: "supply", internalType: "uint256", type: "uint256" }], + stateMutability: "nonpayable", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'owner', - internalType: 'address', - type: 'address', + name: "owner", + internalType: "address", + type: "address", indexed: true, }, { - name: 'spender', - internalType: 'address', - type: 'address', + name: "spender", + internalType: "address", + type: "address", indexed: true, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'Approval', + name: "Approval", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ - { name: 'from', internalType: 'address', type: 'address', indexed: true }, - { name: 'to', internalType: 'address', type: 'address', indexed: true }, + { name: "from", internalType: "address", type: "address", indexed: true }, + { name: "to", internalType: "address", type: "address", indexed: true }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'Transfer', + name: "Transfer", }, { - type: 'function', + type: "function", inputs: [], - name: 'DOMAIN_SEPARATOR', - outputs: [{ name: '', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', + name: "DOMAIN_SEPARATOR", + outputs: [{ name: "", internalType: "bytes32", type: "bytes32" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: '', internalType: 'address', type: 'address' }, - { name: '', internalType: 'address', type: 'address' }, + { name: "", internalType: "address", type: "address" }, + { name: "", internalType: "address", type: "address" }, ], - name: 'allowance', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "allowance", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'spender', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, + { name: "spender", internalType: "address", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, ], - name: 'approve', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', + name: "approve", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "nonpayable", }, { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'balanceOf', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "", internalType: "address", type: "address" }], + name: "balanceOf", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'decimals', - outputs: [{ name: '', internalType: 'uint8', type: 'uint8' }], - stateMutability: 'view', + name: "decimals", + outputs: [{ name: "", internalType: "uint8", type: "uint8" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'to', internalType: 'address[]', type: 'address[]' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, + { name: "to", internalType: "address[]", type: "address[]" }, + { name: "value", internalType: "uint256", type: "uint256" }, ], - name: 'mint', + name: "mint", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [], - name: 'name', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', + name: "name", + outputs: [{ name: "", internalType: "string", type: "string" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'nonces', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "", internalType: "address", type: "address" }], + name: "nonces", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'owner', internalType: 'address', type: 'address' }, - { name: 'spender', internalType: 'address', type: 'address' }, - { name: 'value', internalType: 'uint256', type: 'uint256' }, - { name: 'deadline', internalType: 'uint256', type: 'uint256' }, - { name: 'v', internalType: 'uint8', type: 'uint8' }, - { name: 'r', internalType: 'bytes32', type: 'bytes32' }, - { name: 's', internalType: 'bytes32', type: 'bytes32' }, + { name: "owner", internalType: "address", type: "address" }, + { name: "spender", internalType: "address", type: "address" }, + { name: "value", internalType: "uint256", type: "uint256" }, + { name: "deadline", internalType: "uint256", type: "uint256" }, + { name: "v", internalType: "uint8", type: "uint8" }, + { name: "r", internalType: "bytes32", type: "bytes32" }, + { name: "s", internalType: "bytes32", type: "bytes32" }, ], - name: 'permit', + name: "permit", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [], - name: 'symbol', - outputs: [{ name: '', internalType: 'string', type: 'string' }], - stateMutability: 'view', + name: "symbol", + outputs: [{ name: "", internalType: "string", type: "string" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'totalSupply', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "totalSupply", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, + { name: "to", internalType: "address", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, ], - name: 'transfer', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', + name: "transfer", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: 'from', internalType: 'address', type: 'address' }, - { name: 'to', internalType: 'address', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, + { name: "from", internalType: "address", type: "address" }, + { name: "to", internalType: "address", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, ], - name: 'transferFrom', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'nonpayable', + name: "transferFrom", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "nonpayable", }, -] as const +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Multicall ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const multicallAbi = [ - { type: 'constructor', inputs: [], stateMutability: 'payable' }, + { type: "constructor", inputs: [], stateMutability: "payable" }, { - type: 'error', - inputs: [{ name: 'reason', internalType: 'string', type: 'string' }], - name: 'CallFailed', + type: "error", + inputs: [{ name: "reason", internalType: "string", type: "string" }], + name: "CallFailed", }, { - type: 'function', + type: "function", inputs: [ { - name: 'calls', - internalType: 'struct Multicall.Call[]', - type: 'tuple[]', + name: "calls", + internalType: "struct Multicall.Call[]", + type: "tuple[]", components: [ - { name: 'target', internalType: 'address', type: 'address' }, - { name: 'callData', internalType: 'bytes', type: 'bytes' }, + { name: "target", internalType: "address", type: "address" }, + { name: "callData", internalType: "bytes", type: "bytes" }, ], }, ], - name: 'mtc1', + name: "mtc1", outputs: [ - { name: '', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'bytes[]', type: 'bytes[]' }, + { name: "", internalType: "uint256", type: "uint256" }, + { name: "", internalType: "bytes[]", type: "bytes[]" }, ], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ { - name: 'calls', - internalType: 'struct Multicall.Call[]', - type: 'tuple[]', + name: "calls", + internalType: "struct Multicall.Call[]", + type: "tuple[]", components: [ - { name: 'target', internalType: 'address', type: 'address' }, - { name: 'callData', internalType: 'bytes', type: 'bytes' }, + { name: "target", internalType: "address", type: "address" }, + { name: "callData", internalType: "bytes", type: "bytes" }, ], }, ], - name: 'mtc2', + name: "mtc2", outputs: [ - { name: '', internalType: 'uint256', type: 'uint256' }, - { name: '', internalType: 'bytes32', type: 'bytes32' }, + { name: "", internalType: "uint256", type: "uint256" }, + { name: "", internalType: "bytes32", type: "bytes32" }, { - name: '', - internalType: 'struct Multicall.Result[]', - type: 'tuple[]', + name: "", + internalType: "struct Multicall.Result[]", + type: "tuple[]", components: [ - { name: 'success', internalType: 'bool', type: 'bool' }, - { name: 'returnData', internalType: 'bytes', type: 'bytes' }, + { name: "success", internalType: "bool", type: "bool" }, + { name: "returnData", internalType: "bytes", type: "bytes" }, ], }, ], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, -] as const +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Owned ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const ownedAbi = [ - { type: 'error', inputs: [], name: 'Unauthorized' }, + { type: "error", inputs: [], name: "Unauthorized" }, { - type: 'event', + type: "event", anonymous: false, inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, + { name: "user", internalType: "address", type: "address", indexed: true }, { - name: 'newOwner', - internalType: 'address', - type: 'address', + name: "newOwner", + internalType: "address", + type: "address", indexed: true, }, ], - name: 'OwnerUpdated', + name: "OwnerUpdated", }, { - type: 'function', + type: "function", inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', + name: "owner", + outputs: [{ name: "", internalType: "address", type: "address" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', + type: "function", + inputs: [{ name: "newOwner", internalType: "address", type: "address" }], + name: "setOwner", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, -] as const +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // OwnerSettings ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const ownerSettingsAbi = [ - { type: 'error', inputs: [], name: 'AddressDenied' }, - { type: 'error', inputs: [], name: 'AlreadyReleased' }, - { type: 'error', inputs: [], name: 'AmountNotAllowed' }, - { type: 'error', inputs: [], name: 'DecOverflow' }, - { type: 'error', inputs: [], name: 'EmptyPixTarget' }, - { type: 'error', inputs: [], name: 'InvalidDeposit' }, - { type: 'error', inputs: [], name: 'InvalidSigner' }, - { type: 'error', inputs: [], name: 'LengthMismatch' }, - { type: 'error', inputs: [], name: 'LockExpired' }, - { type: 'error', inputs: [], name: 'LoopOverflow' }, - { type: 'error', inputs: [], name: 'MaxBalExceeded' }, - { type: 'error', inputs: [], name: 'NoTokens' }, - { type: 'error', inputs: [], name: 'NotEnoughTokens' }, - { type: 'error', inputs: [], name: 'NotExpired' }, - { type: 'error', inputs: [], name: 'NotInitialized' }, - { type: 'error', inputs: [], name: 'OnlySeller' }, - { type: 'error', inputs: [], name: 'StaticCallFailed' }, - { type: 'error', inputs: [], name: 'TokenDenied' }, - { type: 'error', inputs: [], name: 'TxAlreadyUsed' }, - { type: 'error', inputs: [], name: 'Unauthorized' }, + { type: "error", inputs: [], name: "AddressDenied" }, + { type: "error", inputs: [], name: "AlreadyReleased" }, + { type: "error", inputs: [], name: "AmountNotAllowed" }, + { type: "error", inputs: [], name: "DecOverflow" }, + { type: "error", inputs: [], name: "EmptyPixTarget" }, + { type: "error", inputs: [], name: "InvalidDeposit" }, + { type: "error", inputs: [], name: "InvalidSigner" }, + { type: "error", inputs: [], name: "LengthMismatch" }, + { type: "error", inputs: [], name: "LockExpired" }, + { type: "error", inputs: [], name: "LoopOverflow" }, + { type: "error", inputs: [], name: "MaxBalExceeded" }, + { type: "error", inputs: [], name: "NoTokens" }, + { type: "error", inputs: [], name: "NotEnoughTokens" }, + { type: "error", inputs: [], name: "NotExpired" }, + { type: "error", inputs: [], name: "NotInitialized" }, + { type: "error", inputs: [], name: "OnlySeller" }, + { type: "error", inputs: [], name: "StaticCallFailed" }, + { type: "error", inputs: [], name: "TokenDenied" }, + { type: "error", inputs: [], name: "TxAlreadyUsed" }, + { type: "error", inputs: [], name: "Unauthorized" }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'token', - internalType: 'address', - type: 'address', + name: "token", + internalType: "address", + type: "address", indexed: true, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, + { name: "state", internalType: "bool", type: "bool", indexed: true }, ], - name: 'AllowedERC20Updated', + name: "AllowedERC20Updated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'DepositAdded', + name: "DepositAdded", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'DepositWithdrawn', + name: "DepositWithdrawn", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'owner', - internalType: 'address', - type: 'address', + name: "owner", + internalType: "address", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'FundsWithdrawn', + name: "FundsWithdrawn", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockID', - internalType: 'uint256', - type: 'uint256', + name: "lockID", + internalType: "uint256", + type: "uint256", indexed: true, }, { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockAdded', + name: "LockAdded", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'blocks', - internalType: 'uint256', - type: 'uint256', + name: "blocks", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockBlocksUpdated', + name: "LockBlocksUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', + name: "lockId", + internalType: "uint256", + type: "uint256", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockReleased', + name: "LockReleased", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', + name: "lockId", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockReturned', + name: "LockReturned", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, + { name: "user", internalType: "address", type: "address", indexed: true }, { - name: 'newOwner', - internalType: 'address', - type: 'address', + name: "newOwner", + internalType: "address", + type: "address", indexed: true, }, ], - name: 'OwnerUpdated', + name: "OwnerUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'reputation', - internalType: 'address', - type: 'address', + name: "reputation", + internalType: "address", + type: "address", indexed: false, }, ], - name: 'ReputationUpdated', + name: "ReputationUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'merkleRoot', - internalType: 'bytes32', - type: 'bytes32', + name: "merkleRoot", + internalType: "bytes32", + type: "bytes32", indexed: true, }, ], - name: 'RootUpdated', + name: "RootUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'forwarder', - internalType: 'address', - type: 'address', + name: "forwarder", + internalType: "address", + type: "address", indexed: true, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, + { name: "state", internalType: "bool", type: "bool", indexed: true }, ], - name: 'TrustedForwarderUpdated', + name: "TrustedForwarderUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: false }, + { name: "state", internalType: "bool", type: "bool", indexed: false }, ], - name: 'ValidSet', + name: "ValidSet", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'signers', - internalType: 'address[]', - type: 'address[]', + name: "signers", + internalType: "address[]", + type: "address[]", indexed: false, }, ], - name: 'ValidSignersUpdated', + name: "ValidSignersUpdated", }, { - type: 'function', + type: "function", inputs: [ - { name: 'erc20', internalType: 'contract ERC20', type: 'address' }, + { name: "erc20", internalType: "contract ERC20", type: "address" }, ], - name: 'allowedERC20s', - outputs: [{ name: 'state', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + name: "allowedERC20s", + outputs: [{ name: "state", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'defaultLockBlocks', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "defaultLockBlocks", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'forwarder', internalType: 'address', type: 'address' }], - name: 'isTrustedForwarder', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "forwarder", internalType: "address", type: "address" }], + name: "isTrustedForwarder", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', + name: "owner", + outputs: [{ name: "", internalType: "address", type: "address" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'reputation', + name: "reputation", outputs: [ - { name: '', internalType: 'contract IReputation', type: 'address' }, + { name: "", internalType: "contract IReputation", type: "address" }, ], - stateMutability: 'view', + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'sellerKey', internalType: 'address', type: 'address' }], - name: 'sellerAllowList', - outputs: [{ name: 'root', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "sellerKey", internalType: "address", type: "address" }], + name: "sellerAllowList", + outputs: [{ name: "root", internalType: "bytes32", type: "bytes32" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: '_blocks', internalType: 'uint256', type: 'uint256' }], - name: 'setDefaultLockBlocks', + type: "function", + inputs: [{ name: "_blocks", internalType: "uint256", type: "uint256" }], + name: "setDefaultLockBlocks", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', + type: "function", + inputs: [{ name: "newOwner", internalType: "address", type: "address" }], + name: "setOwner", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ { - name: '_reputation', - internalType: 'contract IReputation', - type: 'address', + name: "_reputation", + internalType: "contract IReputation", + type: "address", }, ], - name: 'setReputation', + name: "setReputation", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: 'forwarders', internalType: 'address[]', type: 'address[]' }, - { name: 'states', internalType: 'bool[]', type: 'bool[]' }, + { name: "forwarders", internalType: "address[]", type: "address[]" }, + { name: "states", internalType: "bool[]", type: "bool[]" }, ], - name: 'setTrustedFowarders', + name: "setTrustedFowarders", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: '_validSigners', internalType: 'address[]', type: 'address[]' }, + { name: "_validSigners", internalType: "address[]", type: "address[]" }, ], - name: 'setValidSigners', + name: "setValidSigners", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: '_tokens', internalType: 'contract ERC20[]', type: 'address[]' }, - { name: '_states', internalType: 'bool[]', type: 'bool[]' }, + { name: "_tokens", internalType: "contract ERC20[]", type: "address[]" }, + { name: "_states", internalType: "bool[]", type: "bool[]" }, ], - name: 'tokenSettings', + name: "tokenSettings", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'trustedForwarders', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "", internalType: "address", type: "address" }], + name: "trustedForwarders", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'signer', internalType: 'uint256', type: 'uint256' }], - name: 'validBacenSigners', - outputs: [{ name: 'valid', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "signer", internalType: "uint256", type: "uint256" }], + name: "validBacenSigners", + outputs: [{ name: "valid", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'withdrawBalance', + name: "withdrawBalance", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, -] as const +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // P2PIX @@ -1599,668 +1599,668 @@ export const ownerSettingsAbi = [ export const p2PixAbi = [ { - type: 'constructor', + type: "constructor", inputs: [ - { name: 'defaultBlocks', internalType: 'uint256', type: 'uint256' }, - { name: 'validSigners', internalType: 'address[]', type: 'address[]' }, - { name: '_reputation', internalType: 'address', type: 'address' }, - { name: 'tokens', internalType: 'contract ERC20[]', type: 'address[]' }, - { name: 'tokenStates', internalType: 'bool[]', type: 'bool[]' }, + { name: "defaultBlocks", internalType: "uint256", type: "uint256" }, + { name: "validSigners", internalType: "address[]", type: "address[]" }, + { name: "_reputation", internalType: "address", type: "address" }, + { name: "tokens", internalType: "contract ERC20[]", type: "address[]" }, + { name: "tokenStates", internalType: "bool[]", type: "bool[]" }, ], - stateMutability: 'payable', + stateMutability: "payable", }, - { type: 'error', inputs: [], name: 'AddressDenied' }, - { type: 'error', inputs: [], name: 'AlreadyReleased' }, - { type: 'error', inputs: [], name: 'AmountNotAllowed' }, - { type: 'error', inputs: [], name: 'DecOverflow' }, - { type: 'error', inputs: [], name: 'EmptyPixTarget' }, - { type: 'error', inputs: [], name: 'InvalidDeposit' }, - { type: 'error', inputs: [], name: 'InvalidSigner' }, - { type: 'error', inputs: [], name: 'LengthMismatch' }, - { type: 'error', inputs: [], name: 'LockExpired' }, - { type: 'error', inputs: [], name: 'LoopOverflow' }, - { type: 'error', inputs: [], name: 'MaxBalExceeded' }, - { type: 'error', inputs: [], name: 'NoTokens' }, - { type: 'error', inputs: [], name: 'NotEnoughTokens' }, - { type: 'error', inputs: [], name: 'NotExpired' }, - { type: 'error', inputs: [], name: 'NotInitialized' }, - { type: 'error', inputs: [], name: 'OnlySeller' }, - { type: 'error', inputs: [], name: 'Reentrancy' }, - { type: 'error', inputs: [], name: 'StaticCallFailed' }, - { type: 'error', inputs: [], name: 'TokenDenied' }, - { type: 'error', inputs: [], name: 'TxAlreadyUsed' }, - { type: 'error', inputs: [], name: 'Unauthorized' }, + { type: "error", inputs: [], name: "AddressDenied" }, + { type: "error", inputs: [], name: "AlreadyReleased" }, + { type: "error", inputs: [], name: "AmountNotAllowed" }, + { type: "error", inputs: [], name: "DecOverflow" }, + { type: "error", inputs: [], name: "EmptyPixTarget" }, + { type: "error", inputs: [], name: "InvalidDeposit" }, + { type: "error", inputs: [], name: "InvalidSigner" }, + { type: "error", inputs: [], name: "LengthMismatch" }, + { type: "error", inputs: [], name: "LockExpired" }, + { type: "error", inputs: [], name: "LoopOverflow" }, + { type: "error", inputs: [], name: "MaxBalExceeded" }, + { type: "error", inputs: [], name: "NoTokens" }, + { type: "error", inputs: [], name: "NotEnoughTokens" }, + { type: "error", inputs: [], name: "NotExpired" }, + { type: "error", inputs: [], name: "NotInitialized" }, + { type: "error", inputs: [], name: "OnlySeller" }, + { type: "error", inputs: [], name: "Reentrancy" }, + { type: "error", inputs: [], name: "StaticCallFailed" }, + { type: "error", inputs: [], name: "TokenDenied" }, + { type: "error", inputs: [], name: "TxAlreadyUsed" }, + { type: "error", inputs: [], name: "Unauthorized" }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'token', - internalType: 'address', - type: 'address', + name: "token", + internalType: "address", + type: "address", indexed: true, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, + { name: "state", internalType: "bool", type: "bool", indexed: true }, ], - name: 'AllowedERC20Updated', + name: "AllowedERC20Updated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'DepositAdded', + name: "DepositAdded", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'DepositWithdrawn', + name: "DepositWithdrawn", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'owner', - internalType: 'address', - type: 'address', + name: "owner", + internalType: "address", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'FundsWithdrawn', + name: "FundsWithdrawn", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockID', - internalType: 'uint256', - type: 'uint256', + name: "lockID", + internalType: "uint256", + type: "uint256", indexed: true, }, { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockAdded', + name: "LockAdded", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'blocks', - internalType: 'uint256', - type: 'uint256', + name: "blocks", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockBlocksUpdated', + name: "LockBlocksUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', + name: "lockId", + internalType: "uint256", + type: "uint256", indexed: false, }, { - name: 'amount', - internalType: 'uint256', - type: 'uint256', + name: "amount", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockReleased', + name: "LockReleased", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'buyer', - internalType: 'address', - type: 'address', + name: "buyer", + internalType: "address", + type: "address", indexed: true, }, { - name: 'lockId', - internalType: 'uint256', - type: 'uint256', + name: "lockId", + internalType: "uint256", + type: "uint256", indexed: false, }, ], - name: 'LockReturned', + name: "LockReturned", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ - { name: 'user', internalType: 'address', type: 'address', indexed: true }, + { name: "user", internalType: "address", type: "address", indexed: true }, { - name: 'newOwner', - internalType: 'address', - type: 'address', + name: "newOwner", + internalType: "address", + type: "address", indexed: true, }, ], - name: 'OwnerUpdated', + name: "OwnerUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'reputation', - internalType: 'address', - type: 'address', + name: "reputation", + internalType: "address", + type: "address", indexed: false, }, ], - name: 'ReputationUpdated', + name: "ReputationUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'merkleRoot', - internalType: 'bytes32', - type: 'bytes32', + name: "merkleRoot", + internalType: "bytes32", + type: "bytes32", indexed: true, }, ], - name: 'RootUpdated', + name: "RootUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'forwarder', - internalType: 'address', - type: 'address', + name: "forwarder", + internalType: "address", + type: "address", indexed: true, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: true }, + { name: "state", internalType: "bool", type: "bool", indexed: true }, ], - name: 'TrustedForwarderUpdated', + name: "TrustedForwarderUpdated", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'seller', - internalType: 'address', - type: 'address', + name: "seller", + internalType: "address", + type: "address", indexed: true, }, { - name: 'token', - internalType: 'contract ERC20', - type: 'address', + name: "token", + internalType: "contract ERC20", + type: "address", indexed: false, }, - { name: 'state', internalType: 'bool', type: 'bool', indexed: false }, + { name: "state", internalType: "bool", type: "bool", indexed: false }, ], - name: 'ValidSet', + name: "ValidSet", }, { - type: 'event', + type: "event", anonymous: false, inputs: [ { - name: 'signers', - internalType: 'address[]', - type: 'address[]', + name: "signers", + internalType: "address[]", + type: "address[]", indexed: false, }, ], - name: 'ValidSignersUpdated', + name: "ValidSignersUpdated", }, { - type: 'function', - inputs: [{ name: '_addr', internalType: 'address', type: 'address' }], - name: '_castAddrToKey', - outputs: [{ name: '_key', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'pure', + type: "function", + inputs: [{ name: "_addr", internalType: "address", type: "address" }], + name: "_castAddrToKey", + outputs: [{ name: "_key", internalType: "uint256", type: "uint256" }], + stateMutability: "pure", }, { - type: 'function', - inputs: [{ name: '_key', internalType: 'uint256', type: 'uint256' }], - name: '_castKeyToAddr', - outputs: [{ name: '_addr', internalType: 'address', type: 'address' }], - stateMutability: 'pure', + type: "function", + inputs: [{ name: "_key", internalType: "uint256", type: "uint256" }], + name: "_castKeyToAddr", + outputs: [{ name: "_addr", internalType: "address", type: "address" }], + stateMutability: "pure", }, { - type: 'function', + type: "function", inputs: [ - { name: 'erc20', internalType: 'contract ERC20', type: 'address' }, + { name: "erc20", internalType: "contract ERC20", type: "address" }, ], - name: 'allowedERC20s', - outputs: [{ name: 'state', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + name: "allowedERC20s", + outputs: [{ name: "state", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'defaultLockBlocks', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "defaultLockBlocks", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'pixTarget', internalType: 'string', type: 'string' }, - { name: 'allowlistRoot', internalType: 'bytes32', type: 'bytes32' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - { name: 'amount', internalType: 'uint96', type: 'uint96' }, - { name: 'valid', internalType: 'bool', type: 'bool' }, + { name: "pixTarget", internalType: "string", type: "string" }, + { name: "allowlistRoot", internalType: "bytes32", type: "bytes32" }, + { name: "token", internalType: "contract ERC20", type: "address" }, + { name: "amount", internalType: "uint96", type: "uint96" }, + { name: "valid", internalType: "bool", type: "bool" }, ], - name: 'deposit', + name: "deposit", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: 'seller', internalType: 'address', type: 'address' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, + { name: "seller", internalType: "address", type: "address" }, + { name: "token", internalType: "contract ERC20", type: "address" }, ], - name: 'getBalance', - outputs: [{ name: 'bal', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "getBalance", + outputs: [{ name: "bal", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'sellers', internalType: 'address[]', type: 'address[]' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, + { name: "sellers", internalType: "address[]", type: "address[]" }, + { name: "token", internalType: "contract ERC20", type: "address" }, ], - name: 'getBalances', - outputs: [{ name: '', internalType: 'uint256[]', type: 'uint256[]' }], - stateMutability: 'view', + name: "getBalances", + outputs: [{ name: "", internalType: "uint256[]", type: "uint256[]" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'ids', internalType: 'uint256[]', type: 'uint256[]' }], - name: 'getLocksStatus', + type: "function", + inputs: [{ name: "ids", internalType: "uint256[]", type: "uint256[]" }], + name: "getLocksStatus", outputs: [ - { name: '', internalType: 'uint256[]', type: 'uint256[]' }, + { name: "", internalType: "uint256[]", type: "uint256[]" }, { - name: '', - internalType: 'enum DataTypes.LockStatus[]', - type: 'uint8[]', + name: "", + internalType: "enum DataTypes.LockStatus[]", + type: "uint8[]", }, ], - stateMutability: 'view', + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'seller', internalType: 'address', type: 'address' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, + { name: "seller", internalType: "address", type: "address" }, + { name: "token", internalType: "contract ERC20", type: "address" }, ], - name: 'getPixTarget', - outputs: [{ name: 'pixTarget', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', + name: "getPixTarget", + outputs: [{ name: "pixTarget", internalType: "bytes32", type: "bytes32" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'seller', internalType: 'address', type: 'address' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, + { name: "seller", internalType: "address", type: "address" }, + { name: "token", internalType: "contract ERC20", type: "address" }, ], - name: 'getPixTargetString', - outputs: [{ name: 'pixTarget', internalType: 'string', type: 'string' }], - stateMutability: 'view', + name: "getPixTargetString", + outputs: [{ name: "pixTarget", internalType: "string", type: "string" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'str', internalType: 'string', type: 'string' }], - name: 'getStr', - outputs: [{ name: 'strEnc', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'pure', + type: "function", + inputs: [{ name: "str", internalType: "string", type: "string" }], + name: "getStr", + outputs: [{ name: "strEnc", internalType: "bytes32", type: "bytes32" }], + stateMutability: "pure", }, { - type: 'function', + type: "function", inputs: [ - { name: 'seller', internalType: 'address', type: 'address' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, + { name: "seller", internalType: "address", type: "address" }, + { name: "token", internalType: "contract ERC20", type: "address" }, ], - name: 'getValid', - outputs: [{ name: 'valid', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + name: "getValid", + outputs: [{ name: "valid", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'forwarder', internalType: 'address', type: 'address' }], - name: 'isTrustedForwarder', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "forwarder", internalType: "address", type: "address" }], + name: "isTrustedForwarder", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'seller', internalType: 'address', type: 'address' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - { name: 'amount', internalType: 'uint80', type: 'uint80' }, - { name: 'merkleProof', internalType: 'bytes32[]', type: 'bytes32[]' }, - { name: 'expiredLocks', internalType: 'uint256[]', type: 'uint256[]' }, + { name: "seller", internalType: "address", type: "address" }, + { name: "token", internalType: "contract ERC20", type: "address" }, + { name: "amount", internalType: "uint80", type: "uint80" }, + { name: "merkleProof", internalType: "bytes32[]", type: "bytes32[]" }, + { name: "expiredLocks", internalType: "uint256[]", type: "uint256[]" }, ], - name: 'lock', - outputs: [{ name: 'lockID', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'nonpayable', + name: "lock", + outputs: [{ name: "lockID", internalType: "uint256", type: "uint256" }], + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [], - name: 'lockCounter', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "lockCounter", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'mapLocks', + type: "function", + inputs: [{ name: "", internalType: "uint256", type: "uint256" }], + name: "mapLocks", outputs: [ - { name: 'counter', internalType: 'uint256', type: 'uint256' }, - { name: 'expirationBlock', internalType: 'uint256', type: 'uint256' }, - { name: 'pixTarget', internalType: 'bytes32', type: 'bytes32' }, - { name: 'amount', internalType: 'uint80', type: 'uint80' }, - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - { name: 'buyerAddress', internalType: 'address', type: 'address' }, - { name: 'seller', internalType: 'address', type: 'address' }, + { name: "counter", internalType: "uint256", type: "uint256" }, + { name: "expirationBlock", internalType: "uint256", type: "uint256" }, + { name: "pixTarget", internalType: "bytes32", type: "bytes32" }, + { name: "amount", internalType: "uint80", type: "uint80" }, + { name: "token", internalType: "contract ERC20", type: "address" }, + { name: "buyerAddress", internalType: "address", type: "address" }, + { name: "seller", internalType: "address", type: "address" }, ], - stateMutability: 'view', + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'owner', - outputs: [{ name: '', internalType: 'address', type: 'address' }], - stateMutability: 'view', + name: "owner", + outputs: [{ name: "", internalType: "address", type: "address" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'lockID', internalType: 'uint256', type: 'uint256' }, - { name: 'pixTimestamp', internalType: 'bytes32', type: 'bytes32' }, - { name: 'signature', internalType: 'bytes', type: 'bytes' }, + { name: "lockID", internalType: "uint256", type: "uint256" }, + { name: "pixTimestamp", internalType: "bytes32", type: "bytes32" }, + { name: "signature", internalType: "bytes", type: "bytes" }, ], - name: 'release', + name: "release", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [], - name: 'reputation', + name: "reputation", outputs: [ - { name: '', internalType: 'contract IReputation', type: 'address' }, + { name: "", internalType: "contract IReputation", type: "address" }, ], - stateMutability: 'view', + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'sellerKey', internalType: 'address', type: 'address' }], - name: 'sellerAllowList', - outputs: [{ name: 'root', internalType: 'bytes32', type: 'bytes32' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "sellerKey", internalType: "address", type: "address" }], + name: "sellerAllowList", + outputs: [{ name: "root", internalType: "bytes32", type: "bytes32" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: '_blocks', internalType: 'uint256', type: 'uint256' }], - name: 'setDefaultLockBlocks', + type: "function", + inputs: [{ name: "_blocks", internalType: "uint256", type: "uint256" }], + name: "setDefaultLockBlocks", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', - inputs: [{ name: 'newOwner', internalType: 'address', type: 'address' }], - name: 'setOwner', + type: "function", + inputs: [{ name: "newOwner", internalType: "address", type: "address" }], + name: "setOwner", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ { - name: '_reputation', - internalType: 'contract IReputation', - type: 'address', + name: "_reputation", + internalType: "contract IReputation", + type: "address", }, ], - name: 'setReputation', + name: "setReputation", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: 'addr', internalType: 'address', type: 'address' }, - { name: 'merkleroot', internalType: 'bytes32', type: 'bytes32' }, + { name: "addr", internalType: "address", type: "address" }, + { name: "merkleroot", internalType: "bytes32", type: "bytes32" }, ], - name: 'setRoot', + name: "setRoot", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: 'forwarders', internalType: 'address[]', type: 'address[]' }, - { name: 'states', internalType: 'bool[]', type: 'bool[]' }, + { name: "forwarders", internalType: "address[]", type: "address[]" }, + { name: "states", internalType: "bool[]", type: "bool[]" }, ], - name: 'setTrustedFowarders', + name: "setTrustedFowarders", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: '_validSigners', internalType: 'address[]', type: 'address[]' }, + { name: "_validSigners", internalType: "address[]", type: "address[]" }, ], - name: 'setValidSigners', + name: "setValidSigners", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - { name: 'state', internalType: 'bool', type: 'bool' }, + { name: "token", internalType: "contract ERC20", type: "address" }, + { name: "state", internalType: "bool", type: "bool" }, ], - name: 'setValidState', + name: "setValidState", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [ - { name: '_tokens', internalType: 'contract ERC20[]', type: 'address[]' }, - { name: '_states', internalType: 'bool[]', type: 'bool[]' }, + { name: "_tokens", internalType: "contract ERC20[]", type: "address[]" }, + { name: "_states", internalType: "bool[]", type: "bool[]" }, ], - name: 'tokenSettings', + name: "tokenSettings", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', - inputs: [{ name: '', internalType: 'address', type: 'address' }], - name: 'trustedForwarders', - outputs: [{ name: '', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "", internalType: "address", type: "address" }], + name: "trustedForwarders", + outputs: [{ name: "", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'lockIDs', internalType: 'uint256[]', type: 'uint256[]' }], - name: 'unlockExpired', + type: "function", + inputs: [{ name: "lockIDs", internalType: "uint256[]", type: "uint256[]" }], + name: "unlockExpired", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', - inputs: [{ name: 'message', internalType: 'bytes32', type: 'bytes32' }], - name: 'usedTransactions', - outputs: [{ name: 'used', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "message", internalType: "bytes32", type: "bytes32" }], + name: "usedTransactions", + outputs: [{ name: "used", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - name: 'userRecord', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "", internalType: "uint256", type: "uint256" }], + name: "userRecord", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', - inputs: [{ name: 'signer', internalType: 'uint256', type: 'uint256' }], - name: 'validBacenSigners', - outputs: [{ name: 'valid', internalType: 'bool', type: 'bool' }], - stateMutability: 'view', + type: "function", + inputs: [{ name: "signer", internalType: "uint256", type: "uint256" }], + name: "validBacenSigners", + outputs: [{ name: "valid", internalType: "bool", type: "bool" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [ - { name: 'token', internalType: 'contract ERC20', type: 'address' }, - { name: 'amount', internalType: 'uint256', type: 'uint256' }, - { name: 'expiredLocks', internalType: 'uint256[]', type: 'uint256[]' }, + { name: "token", internalType: "contract ERC20", type: "address" }, + { name: "amount", internalType: "uint256", type: "uint256" }, + { name: "expiredLocks", internalType: "uint256[]", type: "uint256[]" }, ], - name: 'withdraw', + name: "withdraw", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, { - type: 'function', + type: "function", inputs: [], - name: 'withdrawBalance', + name: "withdrawBalance", outputs: [], - stateMutability: 'nonpayable', + stateMutability: "nonpayable", }, - { type: 'receive', stateMutability: 'payable' }, -] as const + { type: "receive", stateMutability: "payable" }, +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // ReentrancyGuard ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const reentrancyGuardAbi = [ - { type: 'error', inputs: [], name: 'Reentrancy' }, -] as const + { type: "error", inputs: [], name: "Reentrancy" }, +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Reputation ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const reputationAbi = [ - { type: 'constructor', inputs: [], stateMutability: 'payable' }, + { type: "constructor", inputs: [], stateMutability: "payable" }, { - type: 'function', - inputs: [{ name: '_userCredit', internalType: 'uint256', type: 'uint256' }], - name: 'limiter', + type: "function", + inputs: [{ name: "_userCredit", internalType: "uint256", type: "uint256" }], + name: "limiter", outputs: [ - { name: '_spendLimit', internalType: 'uint256', type: 'uint256' }, + { name: "_spendLimit", internalType: "uint256", type: "uint256" }, ], - stateMutability: 'pure', + stateMutability: "pure", }, { - type: 'function', + type: "function", inputs: [], - name: 'magicValue', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "magicValue", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, { - type: 'function', + type: "function", inputs: [], - name: 'maxLimit', - outputs: [{ name: '', internalType: 'uint256', type: 'uint256' }], - stateMutability: 'view', + name: "maxLimit", + outputs: [{ name: "", internalType: "uint256", type: "uint256" }], + stateMutability: "view", }, -] as const +] as const; ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // SafeTransferLib ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// export const safeTransferLibAbi = [ - { type: 'error', inputs: [], name: 'ETHTransferFailed' }, - { type: 'error', inputs: [], name: 'TransferFailed' }, - { type: 'error', inputs: [], name: 'TransferFromFailed' }, -] as const + { type: "error", inputs: [], name: "ETHTransferFailed" }, + { type: "error", inputs: [], name: "TransferFailed" }, + { type: "error", inputs: [], name: "TransferFromFailed" }, +] as const; diff --git a/src/blockchain/buyerMethods.ts b/src/blockchain/buyerMethods.ts index abe93bc..de7ec92 100644 --- a/src/blockchain/buyerMethods.ts +++ b/src/blockchain/buyerMethods.ts @@ -1,15 +1,11 @@ import { getContract } from "./provider"; import { ChainContract } from "viem"; -import { - parseEther, - type Address, - type TransactionReceipt, -} from "viem"; +import { parseEther, type Address, type TransactionReceipt } from "viem"; export const addLock = async ( sellerAddress: Address, tokenAddress: Address, - amount: number + amount: number, ): Promise => { const { address, abi, wallet, client, account } = await getContract(); const parsedAmount = parseEther(amount.toString()); @@ -36,7 +32,7 @@ export const addLock = async ( export const withdrawDeposit = async ( amount: string, - token: Address + token: Address, ): Promise => { const { address, abi, wallet, client, account } = await getContract(); @@ -49,7 +45,7 @@ export const withdrawDeposit = async ( abi, functionName: "withdraw", args: [token, parseEther(amount), []], - account + account, }); const hash = await wallet.writeContract(request); @@ -60,8 +56,8 @@ export const withdrawDeposit = async ( export const releaseLock = async ( lockID: bigint, - pixTimestamp: `0x${string}`&{lenght:34}, - signature: `0x${string}` + pixTimestamp: `0x${string}` & { lenght: 34 }, + signature: `0x${string}`, ): Promise => { const { address, abi, wallet, client, account } = await getContract(); @@ -74,7 +70,7 @@ export const releaseLock = async ( abi, functionName: "release", args: [BigInt(lockID), pixTimestamp, signature], - account + account, }); const hash = await wallet.writeContract(request); diff --git a/src/blockchain/events.ts b/src/blockchain/events.ts index 1886533..ba4f2bb 100644 --- a/src/blockchain/events.ts +++ b/src/blockchain/events.ts @@ -3,7 +3,7 @@ import { formatEther, toHex, stringToHex } from "viem"; import type { PublicClient, Address } from "viem"; import { Networks } from "@/config/networks"; import { getContract } from "./provider"; -import { p2PixAbi } from "./abi" +import { p2PixAbi } from "./abi"; import type { ValidDeposit } from "@/model/ValidDeposit"; import type { NetworkConfig } from "@/model/NetworkEnum"; import type { UnreleasedLock } from "@/model/UnreleasedLock"; @@ -18,7 +18,7 @@ const getNetworksLiquidity = async (): Promise => { for (const network of Object.values(Networks)) { const deposits = await getValidDeposits( user.network.value.tokens[user.selectedToken.value].address, - network + network, ); if (deposits) depositLists.push(deposits); } @@ -30,7 +30,7 @@ const getNetworksLiquidity = async (): Promise => { const getParticipantID = async ( seller: Address, - token: Address + token: Address, ): Promise => { const { address, abi, client } = await getContract(); @@ -51,7 +51,7 @@ const getParticipantID = async ( hexString .slice(2) .match(/.{1,2}/g)! - .map((byte: string) => parseInt(byte, 16)) + .map((byte: string) => parseInt(byte, 16)), ); // Remove null bytes from the end of the string return new TextDecoder().decode(bytes).replace(/\0/g, ""); @@ -60,7 +60,7 @@ const getParticipantID = async ( const getValidDeposits = async ( token: Address, network: NetworkConfig, - contractInfo?: { client: PublicClient; address: Address } + contractInfo?: { client: PublicClient; address: Address }, ): Promise => { let client: PublicClient, abi; @@ -84,7 +84,7 @@ const getValidDeposits = async ( `, }; - const depositLogs = await fetch( network.subgraphUrls[0], { + const depositLogs = await fetch(network.subgraphUrls[0], { method: "POST", headers: { "Content-Type": "application/json", @@ -104,7 +104,7 @@ const getValidDeposits = async ( acc[deposit.seller] = true; return acc; }, - {} as Record + {} as Record, ); if (!contractInfo) { @@ -147,11 +147,11 @@ const getValidDeposits = async ( }; const getUnreleasedLockById = async ( - lockID: bigint + lockID: bigint, ): Promise => { const { address, abi, client } = await getContract(); - const [ , , , amount, token, seller ] = await client.readContract({ + const [, , , amount, token, seller] = await client.readContract({ address, abi, functionName: "mapLocks", diff --git a/src/blockchain/provider.ts b/src/blockchain/provider.ts index 51b9439..494c959 100644 --- a/src/blockchain/provider.ts +++ b/src/blockchain/provider.ts @@ -15,14 +15,14 @@ import type { ChainContract } from "viem"; let walletClient: WalletClient | null = null; const getPublicClient = (): PublicClient => { - const user = useUser(); - const rpcUrl = (user.network.value as NetworkConfig).rpcUrls.default.http[0]; - const chain = user.network.value; + const user = useUser(); + const rpcUrl = (user.network.value as NetworkConfig).rpcUrls.default.http[0]; + const chain = user.network.value; - return createPublicClient({ - chain, - transport: http(rpcUrl), - }); + return createPublicClient({ + chain, + transport: http(rpcUrl), + }); }; const getWalletClient = (): WalletClient | null => { @@ -32,7 +32,8 @@ const getWalletClient = (): WalletClient | null => { const getContract = async (onlyRpcProvider = false) => { const client = getPublicClient(); const user = useUser(); - const address = (user.network.value.contracts?.p2pix as ChainContract).address; + const address = (user.network.value.contracts?.p2pix as ChainContract) + .address; const abi = p2PixAbi; const wallet = onlyRpcProvider ? null : getWalletClient(); diff --git a/src/blockchain/sellerMethods.ts b/src/blockchain/sellerMethods.ts index f5657f4..72b85a5 100644 --- a/src/blockchain/sellerMethods.ts +++ b/src/blockchain/sellerMethods.ts @@ -7,7 +7,7 @@ import type { Participant } from "@/utils/bbPay"; import type { Address } from "viem"; const getP2PixAddress = (): Address => { - const user = useUser(); + const user = useUser(); return (user.network.value.contracts?.p2pix as ChainContract).address; }; @@ -24,7 +24,8 @@ const approveTokens = async (participant: Participant): Promise => { const [account] = await walletClient.getAddresses(); // Get token address - const tokenAddress = user.network.value.tokens[user.selectedToken.value].address; + const tokenAddress = + user.network.value.tokens[user.selectedToken.value].address; // Check if the token is already approved const allowance = await publicClient.readContract({ @@ -34,7 +35,7 @@ const approveTokens = async (participant: Participant): Promise => { args: [account, getP2PixAddress()], }); - if ( allowance < parseEther(participant.offer.toString()) ) { + if (allowance < parseEther(participant.offer.toString())) { // Approve tokens const chain = user.network.value; const hash = await walletClient.writeContract({ diff --git a/src/blockchain/wallet.ts b/src/blockchain/wallet.ts index 24773f5..89cc2bf 100644 --- a/src/blockchain/wallet.ts +++ b/src/blockchain/wallet.ts @@ -30,12 +30,12 @@ export const updateWalletStatus = async (): Promise => { }; export const listValidDepositTransactionsByWalletAddress = async ( - walletAddress: Address + walletAddress: Address, ): Promise => { const user = useUser(); const walletDeposits = await getValidDeposits( user.network.value.tokens[user.selectedToken.value].address, - user.network.value + user.network.value, ); if (walletDeposits) { return walletDeposits @@ -50,7 +50,7 @@ export const listValidDepositTransactionsByWalletAddress = async ( const getLockStatus = async (id: bigint): Promise => { const { address, abi, client } = await getContract(); - const [ sortedIDs , status ] = await client.readContract({ + const [sortedIDs, status] = await client.readContract({ address, abi, functionName: "getLocksStatus", @@ -60,7 +60,7 @@ const getLockStatus = async (id: bigint): Promise => { }; export const listAllTransactionByWalletAddress = async ( - walletAddress: Address + walletAddress: Address, ): Promise => { const user = useUser(); @@ -199,7 +199,7 @@ export const listAllTransactionByWalletAddress = async ( // get wallet's release transactions export const listReleaseTransactionByWalletAddress = async ( - walletAddress: Address + walletAddress: Address, ) => { const user = useUser(); const network = user.network.value; @@ -403,7 +403,7 @@ const listLockTransactionBySellerAddress = async (sellerAddress: Address) => { }; export const checkUnreleasedLock = async ( - walletAddress: Address + walletAddress: Address, ): Promise => { const { address, abi, client } = await getContract(); const addedLocks = await listLockTransactionByWalletAddress(walletAddress); @@ -412,7 +412,7 @@ export const checkUnreleasedLock = async ( const lockIds = addedLocks.map((lock: any) => lock.args.lockID); - const [ sortedIDs, status ] = await client.readContract({ + const [sortedIDs, status] = await client.readContract({ address, abi, functionName: "getLocksStatus", @@ -420,15 +420,15 @@ export const checkUnreleasedLock = async ( }); const unreleasedLockId = status.findIndex( - (status: LockStatus) => status == LockStatus.Active + (status: LockStatus) => status == LockStatus.Active, ); - + if (unreleasedLockId !== -1) return getUnreleasedLockById(sortedIDs[unreleasedLockId]); }; export const getActiveLockAmount = async ( - walletAddress: Address + walletAddress: Address, ): Promise => { const { address, abi, client } = await getContract(true); const lockSeller = await listLockTransactionBySellerAddress(walletAddress); @@ -437,7 +437,7 @@ export const getActiveLockAmount = async ( const lockIds = lockSeller.map((lock: any) => lock.args.lockID); - const [ sortedIDs, status ] = await client.readContract({ + const [sortedIDs, status] = await client.readContract({ address, abi, functionName: "getLocksStatus", @@ -450,7 +450,7 @@ export const getActiveLockAmount = async ( abi, functionName: "mapLocks", args: [BigInt(id)], - }) + }), ); const mapLocksResults = await client.multicall({ diff --git a/src/components/BuyerSteps/BuyConfirmedComponent.vue b/src/components/BuyerSteps/BuyConfirmedComponent.vue index 5828020..2153b02 100644 --- a/src/components/BuyerSteps/BuyConfirmedComponent.vue +++ b/src/components/BuyerSteps/BuyConfirmedComponent.vue @@ -31,11 +31,11 @@ const getWalletTransactions = async () => { user.setLoadingWalletTransactions(true); if (walletAddress.value) { const walletDeposits = await listValidDepositTransactionsByWalletAddress( - walletAddress.value + walletAddress.value, ); const allUserTransactions = await listAllTransactionByWalletAddress( - walletAddress.value + walletAddress.value, ); activeLockAmount.value = await getActiveLockAmount(walletAddress.value); @@ -53,7 +53,10 @@ const getWalletTransactions = async () => { const callWithdraw = async (amount: string) => { if (amount) { user.setLoadingWalletTransactions(true); - const withdraw = await withdrawDeposit(amount, user.network.value.tokens[user.selectedToken.value].address); + const withdraw = await withdrawDeposit( + amount, + user.network.value.tokens[user.selectedToken.value].address, + ); if (withdraw) { console.log("Saque realizado!"); await getWalletTransactions(); diff --git a/src/components/BuyerSteps/BuyerSearchComponent.vue b/src/components/BuyerSteps/BuyerSearchComponent.vue index 06d86bc..6f0c368 100644 --- a/src/components/BuyerSteps/BuyerSearchComponent.vue +++ b/src/components/BuyerSteps/BuyerSearchComponent.vue @@ -55,14 +55,14 @@ const getUserCredit = async (userAddress: Address): Promise => { try { const { address, abi, client } = await getContract(true); const userKey = castAddrToKey(userAddress); - + const userCredit = await client.readContract({ address, abi, functionName: "userRecord", args: [userKey], }); - + return userCredit as bigint; } catch (error) { console.error("Error fetching user credit:", error); @@ -73,13 +73,13 @@ const getUserCredit = async (userAddress: Address): Promise => { const getReputationAddress = async (): Promise
=> { try { const { address, abi, client } = await getContract(true); - + const reputationAddr = await client.readContract({ address, abi, functionName: "reputation", }); - + return reputationAddr as Address; } catch (error) { console.error("Error fetching reputation address:", error); @@ -91,16 +91,16 @@ const getSpendLimit = async (userCredit: bigint): Promise => { try { const reputationAddr = await getReputationAddress(); if (!reputationAddr) return BigInt(0); - + const { client } = await getContract(true); - + const spendLimit = await client.readContract({ address: reputationAddr, abi: reputationAbi, functionName: "limiter", args: [userCredit], }); - + return spendLimit as bigint; } catch (error) { console.error("Error fetching spend limit:", error); @@ -110,26 +110,25 @@ const getSpendLimit = async (userCredit: bigint): Promise => { const checkReputationLimit = async (inputValue: number): Promise => { exceedsReputationLimit.value = false; - + if (!walletAddress.value) { reputationLimit.value = null; return; } - + if (inputValue === 0) { return; } - + try { const userCredit = await getUserCredit(walletAddress.value); const spendLimitRaw = await getSpendLimit(userCredit); - + const spendLimitNumber = Number(spendLimitRaw); reputationLimit.value = spendLimitNumber; - + exceedsReputationLimit.value = spendLimitNumber < inputValue; enableConfirmButton.value = !exceedsReputationLimit.value; - } catch (error) { console.error("Error checking reputation limit:", error); reputationLimit.value = null; @@ -145,7 +144,7 @@ const connectAccount = async (): Promise => { const emitConfirmButton = async (): Promise => { const deposit = selectedDeposits.value?.find( - (d) => d.network === network.value + (d) => d.network === network.value, ); if (!deposit) return; deposit.participantID = await getParticipantID(deposit.seller, deposit.token); @@ -185,17 +184,14 @@ const handleSelectedToken = (token: TokenEnum): void => { // Verify if there is a valid deposit to buy const verifyLiquidity = (): void => { enableConfirmButton.value = false; - if (!walletAddress.value) - return; + if (!walletAddress.value) return; const selDeposits = verifyNetworkLiquidity( tokenValue.value, walletAddress.value, - depositsValidList.value + depositsValidList.value, ); selectedDeposits.value = selDeposits; - hasLiquidity.value = !!selDeposits.find( - (d) => d.network === network.value - ); + hasLiquidity.value = !!selDeposits.find((d) => d.network === network.value); enableOrDisableConfirmButton(); }; @@ -225,7 +221,7 @@ watch(walletAddress, (): void => { const availableNetworks = computed(() => { if (!selectedDeposits.value) return []; return Object.values(Networks).filter((network) => - selectedDeposits.value?.some((d) => d.network.id === network.id) + selectedDeposits.value?.some((d) => d.network.id === network.id), ); }); @@ -364,7 +360,10 @@ const handleSubmit = async (e: Event): Promise => {
=> {
O valor excede o limite permitido pela sua reputação. Limite máximo: {{ reputationLimit }} {{ selectedToken }}O valor excede o limite permitido pela sua reputação. Limite + máximo: {{ reputationLimit }} {{ selectedToken }}
diff --git a/src/components/BuyerSteps/QrCodeComponent.vue b/src/components/BuyerSteps/QrCodeComponent.vue index 44c6b01..47592f0 100644 --- a/src/components/BuyerSteps/QrCodeComponent.vue +++ b/src/components/BuyerSteps/QrCodeComponent.vue @@ -54,7 +54,7 @@ const checkSolicitationStatus = async () => { try { const response = await getSolicitation( - solicitationData.value.numeroSolicitacao + solicitationData.value.numeroSolicitacao, ); if (response.signature) { @@ -82,7 +82,6 @@ const startPolling = () => { pollingInterval.value = setInterval(checkSolicitationStatus, 10000); }; - const copyToClipboard = async () => { if (!qrCode.value) { return; @@ -108,13 +107,10 @@ const copyToClipboard = async () => { onMounted(async () => { try { const { tokenAddress, sellerAddress, amount } = await getUnreleasedLockById( - BigInt(props.lockID) + BigInt(props.lockID), ); - const participantId = await getParticipantID( - sellerAddress, - tokenAddress - ); + const participantId = await getParticipantID(sellerAddress, tokenAddress); const offer: Offer = { amount, diff --git a/src/components/Explorer/AnalyticsCard.vue b/src/components/Explorer/AnalyticsCard.vue index 038990e..77ebf8e 100644 --- a/src/components/Explorer/AnalyticsCard.vue +++ b/src/components/Explorer/AnalyticsCard.vue @@ -3,14 +3,14 @@ interface Props { title: string; value: string; change?: string; - changeType?: 'positive' | 'negative' | 'neutral'; + changeType?: "positive" | "negative" | "neutral"; icon?: string; loading?: boolean; } const props = withDefaults(defineProps(), { - changeType: 'neutral', - loading: false + changeType: "neutral", + loading: false, }); @@ -22,7 +22,11 @@ const props = withDefaults(defineProps(), {
{{ value }}
{{ title }}
-
+
{{ change }}
diff --git a/src/components/Explorer/TransactionTable.vue b/src/components/Explorer/TransactionTable.vue index e4c38e9..9594b2f 100644 --- a/src/components/Explorer/TransactionTable.vue +++ b/src/components/Explorer/TransactionTable.vue @@ -1,9 +1,9 @@ @@ -85,25 +90,31 @@ const copyToClipboard = async (address: string, key: string) => { - + - + -
Horário + Horário + TipoParticipantes + Participantes + Valor Bloco Ações
-
{{ transaction.timestamp }}
+
+ {{ transaction.timestamp }} +
- @@ -115,9 +126,14 @@ const copyToClipboard = async (address: string, key: string) => {
Vendedor:
- {{ formatAddress(transaction.seller) }} @@ -135,9 +151,14 @@ const copyToClipboard = async (address: string, key: string) => {
Comprador:
- {{ formatAddress(transaction.buyer) }} @@ -181,13 +202,13 @@ const copyToClipboard = async (address: string, key: string) => {
-
- @@ -195,14 +216,19 @@ const copyToClipboard = async (address: string, key: string) => {
{{ transaction.timestamp }}
- +
Vendedor:
- {{ formatAddress(transaction.seller) }} @@ -220,9 +246,11 @@ const copyToClipboard = async (address: string, key: string) => {
Comprador:
- {{ formatAddress(transaction.buyer) }} @@ -239,14 +267,18 @@ const copyToClipboard = async (address: string, key: string) => {
Valor: - {{ formatAmount(transaction.amount, 18) }} BRZ -
+ {{ formatAmount(transaction.amount, 18) }} BRZ +
Bloco: - #{{ transaction.blockNumber }} + #{{ transaction.blockNumber }}
- + {

-
+

- diff --git a/src/components/ListingComponent/ListingComponent.vue b/src/components/ListingComponent/ListingComponent.vue index a350054..9f537e1 100644 --- a/src/components/ListingComponent/ListingComponent.vue +++ b/src/components/ListingComponent/ListingComponent.vue @@ -39,7 +39,7 @@ const openEtherscanUrl = (transactionHash: string): void => { const loadMore = (): void => { const itemsShowing = itemsToShow.value.length; itemsToShow.value?.push( - ...props.walletTransactions.slice(itemsShowing, itemsShowing + 3) + ...props.walletTransactions.slice(itemsShowing, itemsShowing + 3), ); }; diff --git a/src/components/ListingComponent/TransactionCard.vue b/src/components/ListingComponent/TransactionCard.vue index dfea123..44d1aa9 100644 --- a/src/components/ListingComponent/TransactionCard.vue +++ b/src/components/ListingComponent/TransactionCard.vue @@ -29,7 +29,8 @@ const eventName = computed(() => { }); const explorerName = computed(() => { - return Networks[(props.networkName as string).toLowerCase()].blockExplorers?.default.name; + return Networks[(props.networkName as string).toLowerCase()].blockExplorers + ?.default.name; }); const statusType = computed((): StatusType => { @@ -58,16 +59,16 @@ const showContinueButton = computed(() => { const formattedDate = computed(() => { if (!props.transaction.blockTimestamp) return ""; - + const timestamp = props.transaction.blockTimestamp; const date = new Date(timestamp * 1000); - + const day = String(date.getDate()).padStart(2, "0"); const month = String(date.getMonth() + 1).padStart(2, "0"); const year = date.getFullYear(); const hours = String(date.getHours()).padStart(2, "0"); const minutes = String(date.getMinutes()).padStart(2, "0"); - + return `${day}/${month}/${year} ${hours}:${minutes}`; }); @@ -142,4 +143,3 @@ const handleExplorerClick = () => { @apply rounded-lg border-amber-300 border-2 px-3 py-2 text-gray-900 font-semibold sm:text-base text-xs hover:bg-transparent w-full text-center; } - diff --git a/src/components/SellerSteps/SellerComponent.vue b/src/components/SellerSteps/SellerComponent.vue index f720e9e..dcd4d54 100644 --- a/src/components/SellerSteps/SellerComponent.vue +++ b/src/components/SellerSteps/SellerComponent.vue @@ -44,7 +44,7 @@ const filteredBanks = computed(() => { if (!bankSearchQuery.value) return []; return bankList .filter((bank) => - bank.longName.toLowerCase().includes(bankSearchQuery.value.toLowerCase()) + bank.longName.toLowerCase().includes(bankSearchQuery.value.toLowerCase()), ) .slice(0, 5); }); diff --git a/src/components/TopBar/TopBar.vue b/src/components/TopBar/TopBar.vue index c203379..2fde529 100644 --- a/src/components/TopBar/TopBar.vue +++ b/src/components/TopBar/TopBar.vue @@ -55,12 +55,10 @@ watch(connectedChain, (newVal: any) => { // Check if connected chain is valid, otherwise default to Sepolia if ( !newVal || - !Object.values(Networks).some( - (network) => network.id === Number(newVal.id) - ) + !Object.values(Networks).some((network) => network.id === Number(newVal.id)) ) { console.log( - "Invalid or unsupported network detected, defaulting to Sepolia" + "Invalid or unsupported network detected, defaulting to Sepolia", ); user.setNetwork(DEFAULT_NETWORK); return; @@ -69,13 +67,12 @@ watch(connectedChain, (newVal: any) => { }); const formatWalletAddress = (): string => { - if (!walletAddress.value) - throw new Error("Wallet not connected"); + if (!walletAddress.value) throw new Error("Wallet not connected"); const walletAddressLength = walletAddress.value.length; const initialText = walletAddress.value.substring(0, 5); const finalText = walletAddress.value.substring( walletAddressLength - 4, - walletAddressLength + walletAddressLength, ); return `${initialText}...${finalText}`; }; @@ -92,10 +89,10 @@ const closeMenu = (): void => { const networkChange = async (network: NetworkConfig): Promise => { currencyMenuOpenToggle.value = false; - + // If wallet is connected, try to change chain in wallet if (connectedWallet.value) { - const chainId = network.id.toString(16) + const chainId = network.id.toString(16); try { await setChain({ chainId: `0x${chainId}`, @@ -195,7 +192,10 @@ const handleMenuOptionClick = (option: MenuOption): void => {