@coti-io/coti-wallet-plugin 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/README.md +76 -0
- package/dist/index.d.mts +4740 -0
- package/dist/index.d.ts +4740 -0
- package/dist/index.js +12720 -0
- package/dist/index.js.map +1 -0
- package/dist/index.mjs +12564 -0
- package/dist/index.mjs.map +1 -0
- package/docs/npm-publish-checklist.md +47 -0
- package/package.json +101 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,4740 @@
|
|
|
1
|
+
import { BigNumberish, ethers } from 'ethers';
|
|
2
|
+
import { PodFeeEstimate, PodSdkConfig } from '@coti-io/pod-sdk';
|
|
3
|
+
import react from 'react';
|
|
4
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
5
|
+
import * as viem from 'viem';
|
|
6
|
+
import { Chain } from 'viem';
|
|
7
|
+
import { Config } from 'wagmi';
|
|
8
|
+
import { Wallet } from '@rainbow-me/rainbowkit';
|
|
9
|
+
export { useConnectModal } from '@rainbow-me/rainbowkit';
|
|
10
|
+
|
|
11
|
+
type UnlockStrategy = "snap" | "manual-aes-key";
|
|
12
|
+
type PortalStrategy = "coti-bridge" | "pod-privacy-portal";
|
|
13
|
+
interface TokenConfig {
|
|
14
|
+
symbol: string;
|
|
15
|
+
name: string;
|
|
16
|
+
icon: string;
|
|
17
|
+
decimals: number;
|
|
18
|
+
isPrivate: boolean;
|
|
19
|
+
/** Wrapped ERC-20 used by the portal contract as underlying collateral. */
|
|
20
|
+
addressKey?: string;
|
|
21
|
+
bridgeAddressKey?: string;
|
|
22
|
+
/**
|
|
23
|
+
* When true, Portal In sends native coin (no ERC-20 approve) via `depositNative`.
|
|
24
|
+
* Balances use the chain native asset; `addressKey` still points at the wrapped token.
|
|
25
|
+
*/
|
|
26
|
+
isNative?: boolean;
|
|
27
|
+
timeout?: number;
|
|
28
|
+
supportedChainIds?: number[];
|
|
29
|
+
}
|
|
30
|
+
interface WalletNetworkConfig {
|
|
31
|
+
chainId: string;
|
|
32
|
+
chainName: string;
|
|
33
|
+
rpcUrls: string[];
|
|
34
|
+
nativeCurrency: {
|
|
35
|
+
name: string;
|
|
36
|
+
symbol: string;
|
|
37
|
+
decimals: number;
|
|
38
|
+
};
|
|
39
|
+
blockExplorerUrls: string[];
|
|
40
|
+
}
|
|
41
|
+
interface PodFeeEstimationLimits {
|
|
42
|
+
forwardGasLimit: bigint;
|
|
43
|
+
callBackGasLimit: bigint;
|
|
44
|
+
callBackDataSize?: bigint;
|
|
45
|
+
}
|
|
46
|
+
interface ChainIndexPageUi {
|
|
47
|
+
/** Extra section below token cards (e.g. PoD request tracker on Sepolia). */
|
|
48
|
+
showPodRequestTracker: boolean;
|
|
49
|
+
/** Label for the gas estimate row in the amount modal. */
|
|
50
|
+
amountModalGasLabel: string;
|
|
51
|
+
/** Symbol shown next to the gas estimate (chain native vs fixed COTI branding). */
|
|
52
|
+
amountModalGasSymbol: "native" | "COTI";
|
|
53
|
+
}
|
|
54
|
+
interface ChainConfig {
|
|
55
|
+
id: number;
|
|
56
|
+
hexId: string;
|
|
57
|
+
name: string;
|
|
58
|
+
rpcUrl: string;
|
|
59
|
+
/** Secondary RPC endpoints tried when the primary {@link rpcUrl} is unavailable. */
|
|
60
|
+
rpcFallbackUrls?: string[];
|
|
61
|
+
explorerBaseUrl: string;
|
|
62
|
+
/** PoDPriceOracle on this host chain (live USD prices; Band on Sepolia, Chainlink on Fuji). */
|
|
63
|
+
priceOracleAddress?: string;
|
|
64
|
+
addresses: Record<string, string>;
|
|
65
|
+
tokens: TokenConfig[];
|
|
66
|
+
unlockStrategy: UnlockStrategy;
|
|
67
|
+
portalStrategy: PortalStrategy;
|
|
68
|
+
walletNetwork: WalletNetworkConfig;
|
|
69
|
+
/** Inbox fee estimation gas limits for PoD portal deposit/withdraw. */
|
|
70
|
+
podFeeEstimation?: {
|
|
71
|
+
deposit: PodFeeEstimationLimits;
|
|
72
|
+
withdraw: PodFeeEstimationLimits;
|
|
73
|
+
};
|
|
74
|
+
/** Main Index page: which chrome and labels to show for this chain. */
|
|
75
|
+
indexPage: ChainIndexPageUi;
|
|
76
|
+
}
|
|
77
|
+
/** Index page UI with `amountModalGasSymbol` resolved to a display string (e.g. ETH vs COTI). */
|
|
78
|
+
interface ResolvedIndexPageUi {
|
|
79
|
+
showPodRequestTracker: boolean;
|
|
80
|
+
amountModalGasLabel: string;
|
|
81
|
+
amountModalGasSymbol: string;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
declare const COTI_TESTNET_CHAIN_ID$1 = 7082400;
|
|
85
|
+
declare const COTI_MAINNET_CHAIN_ID = 2632500;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* PoD inbox contract — same deployment on Sepolia, Avalanche Fuji, and COTI testnet.
|
|
89
|
+
* Single source of truth for {@link getPodSdkConfig}, {@link getPodInboxAddress}, and
|
|
90
|
+
* {@link PodContract} fee estimation via `@coti-io/pod-sdk`.
|
|
91
|
+
*/
|
|
92
|
+
declare const POD_INBOX_ADDRESS = "0xAb625bE229F603f6BBF964474AFf6d5487e364De";
|
|
93
|
+
/** @deprecated Use {@link POD_INBOX_ADDRESS}. */
|
|
94
|
+
declare const COTI_TESTNET_POD_INBOX = "0xAb625bE229F603f6BBF964474AFf6d5487e364De";
|
|
95
|
+
|
|
96
|
+
declare const SEPOLIA_CHAIN_ID$1 = 11155111;
|
|
97
|
+
|
|
98
|
+
/** viem chains for wagmi — derived from {@link CHAIN_CONFIGS}. */
|
|
99
|
+
declare const cotiMainnet: Chain;
|
|
100
|
+
declare const cotiTestnet: Chain;
|
|
101
|
+
declare const sepolia: Chain;
|
|
102
|
+
/** RPC URL constants derived from the registry (single source of truth). */
|
|
103
|
+
declare const COTI_MAINNET_RPC: string;
|
|
104
|
+
declare const COTI_TESTNET_RPC: string;
|
|
105
|
+
declare const SEPOLIA_RPC: string;
|
|
106
|
+
declare const SEPOLIA_RPC_FALLBACK: string;
|
|
107
|
+
/**
|
|
108
|
+
* Auxiliary Ethereum L1 chain — not in {@link CHAIN_CONFIGS}; legacy RPC helper only.
|
|
109
|
+
*/
|
|
110
|
+
declare const ETHEREUM_MAINNET_CHAIN_ID = 1;
|
|
111
|
+
declare const ETHEREUM_MAINNET_RPC = "https://eth.llamarpc.com";
|
|
112
|
+
declare const ethereumMainnet: {
|
|
113
|
+
blockExplorers: {
|
|
114
|
+
readonly default: {
|
|
115
|
+
readonly name: "Etherscan";
|
|
116
|
+
readonly url: "https://etherscan.io";
|
|
117
|
+
};
|
|
118
|
+
};
|
|
119
|
+
blockTime?: number | undefined | undefined;
|
|
120
|
+
contracts?: {
|
|
121
|
+
[x: string]: viem.ChainContract | {
|
|
122
|
+
[sourceId: number]: viem.ChainContract | undefined;
|
|
123
|
+
} | undefined;
|
|
124
|
+
ensRegistry?: viem.ChainContract | undefined;
|
|
125
|
+
ensUniversalResolver?: viem.ChainContract | undefined;
|
|
126
|
+
multicall3?: viem.ChainContract | undefined;
|
|
127
|
+
erc6492Verifier?: viem.ChainContract | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
ensTlds?: readonly string[] | undefined;
|
|
130
|
+
id: 1;
|
|
131
|
+
name: "Ethereum Mainnet";
|
|
132
|
+
nativeCurrency: {
|
|
133
|
+
readonly name: "Ether";
|
|
134
|
+
readonly symbol: "ETH";
|
|
135
|
+
readonly decimals: 18;
|
|
136
|
+
};
|
|
137
|
+
experimental_preconfirmationTime?: number | undefined | undefined;
|
|
138
|
+
rpcUrls: {
|
|
139
|
+
readonly default: {
|
|
140
|
+
readonly http: readonly ["https://eth.llamarpc.com"];
|
|
141
|
+
};
|
|
142
|
+
};
|
|
143
|
+
sourceId?: number | undefined | undefined;
|
|
144
|
+
testnet?: boolean | undefined | undefined;
|
|
145
|
+
custom?: Record<string, unknown> | undefined;
|
|
146
|
+
extendSchema?: Record<string, unknown> | undefined;
|
|
147
|
+
fees?: viem.ChainFees<undefined> | undefined;
|
|
148
|
+
formatters?: undefined;
|
|
149
|
+
prepareTransactionRequest?: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
150
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
151
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | [fn: ((args: viem.PrepareTransactionRequestParameters, options: {
|
|
152
|
+
phase: "beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters";
|
|
153
|
+
}) => Promise<viem.PrepareTransactionRequestParameters>) | undefined, options: {
|
|
154
|
+
runAt: readonly ("beforeFillTransaction" | "beforeFillParameters" | "afterFillParameters")[];
|
|
155
|
+
}] | undefined;
|
|
156
|
+
serializers?: viem.ChainSerializers<undefined, viem.TransactionSerializable> | undefined;
|
|
157
|
+
verifyHash?: ((client: viem.Client, parameters: viem.VerifyHashActionParameters) => Promise<viem.VerifyHashActionReturnType>) | undefined;
|
|
158
|
+
};
|
|
159
|
+
/**
|
|
160
|
+
* Resolves an RPC URL for ethers.js callers.
|
|
161
|
+
* Prefer {@link getRpcUrlForChain} for registry chains; handles auxiliary chain id 1.
|
|
162
|
+
*/
|
|
163
|
+
declare function getRpcUrlForChainId(chainId?: number): string;
|
|
164
|
+
|
|
165
|
+
declare const getRpcUrlsForChain: (chainId?: number | string | null) => string[];
|
|
166
|
+
|
|
167
|
+
declare const CHAIN_CONFIGS: Record<number, ChainConfig>;
|
|
168
|
+
declare const DEFAULT_CHAIN_ID = 7082400;
|
|
169
|
+
declare const getChainConfig: (chainId?: number | string | null) => ChainConfig | undefined;
|
|
170
|
+
declare const requireChainConfig: (chainId: number | string) => ChainConfig;
|
|
171
|
+
declare const getContractAddresses: (chainId?: number | string | null) => Record<string, string> | undefined;
|
|
172
|
+
declare const getTokensForChain: (chainId?: number | string | null) => TokenConfig[];
|
|
173
|
+
declare const getPublicTokensForChain: (chainId?: number | string | null) => TokenConfig[];
|
|
174
|
+
declare const getPrivateTokensForChain: (chainId?: number | string | null) => TokenConfig[];
|
|
175
|
+
declare const getExplorerBaseUrlForChain: (chainId?: number | string | null) => string;
|
|
176
|
+
declare const getRpcUrlForChain: (chainId?: number | string | null) => string;
|
|
177
|
+
declare const getNetworkNameForChain: (chainId?: number | string | null) => string;
|
|
178
|
+
declare const getUnlockStrategyForChain: (chainId?: number | string | null) => UnlockStrategy;
|
|
179
|
+
declare const getWalletNetworkConfigs: () => Record<string, WalletNetworkConfig>;
|
|
180
|
+
declare const getWalletNetworkOptions: () => {
|
|
181
|
+
id: string;
|
|
182
|
+
label: string;
|
|
183
|
+
}[];
|
|
184
|
+
declare const getChainIdConstants: () => {
|
|
185
|
+
COTI_MAINNET_ID: string;
|
|
186
|
+
COTI_TESTNET_ID: string;
|
|
187
|
+
SEPOLIA_ID: string;
|
|
188
|
+
};
|
|
189
|
+
declare const resolveIndexPageUi: (chainId: number) => ResolvedIndexPageUi;
|
|
190
|
+
|
|
191
|
+
type AesKeyChainId = typeof COTI_TESTNET_CHAIN_ID$1 | typeof COTI_MAINNET_CHAIN_ID;
|
|
192
|
+
interface EncryptedAesBackup {
|
|
193
|
+
version: 1;
|
|
194
|
+
address: string;
|
|
195
|
+
chainId: number;
|
|
196
|
+
signatureKind: 'eip712';
|
|
197
|
+
iv: string;
|
|
198
|
+
ciphertext: string;
|
|
199
|
+
createdAt: string;
|
|
200
|
+
}
|
|
201
|
+
interface GrantResult {
|
|
202
|
+
txHash?: string;
|
|
203
|
+
amountWei?: string;
|
|
204
|
+
status?: 'submitted' | 'funded' | 'skipped';
|
|
205
|
+
}
|
|
206
|
+
interface OnboardingServiceRequest {
|
|
207
|
+
address: string;
|
|
208
|
+
chainId: number;
|
|
209
|
+
}
|
|
210
|
+
interface SaveEncryptedAesBackupRequest extends OnboardingServiceRequest {
|
|
211
|
+
backup: EncryptedAesBackup;
|
|
212
|
+
}
|
|
213
|
+
interface OnboardingServices {
|
|
214
|
+
/**
|
|
215
|
+
* Disabled: no grant/backup features. Custom: use provided callbacks.
|
|
216
|
+
* Official is reserved for stable COTI-hosted APIs.
|
|
217
|
+
*/
|
|
218
|
+
mode?: 'disabled' | 'custom' | 'official';
|
|
219
|
+
grantNativeCoti?: (request: OnboardingServiceRequest) => Promise<GrantResult>;
|
|
220
|
+
fetchEncryptedAesBackup?: (request: OnboardingServiceRequest) => Promise<EncryptedAesBackup | null>;
|
|
221
|
+
saveEncryptedAesBackup?: (request: SaveEncryptedAesBackupRequest) => Promise<void>;
|
|
222
|
+
replaceEncryptedAesBackup?: (request: SaveEncryptedAesBackupRequest) => Promise<void>;
|
|
223
|
+
}
|
|
224
|
+
/**
|
|
225
|
+
* Plugin configuration — replaces Vite environment variables.
|
|
226
|
+
* Consumers can override these via `configureCotiPlugin()` before using hooks.
|
|
227
|
+
*/
|
|
228
|
+
interface CotiPluginConfig {
|
|
229
|
+
/** The Snap ID for the COTI MetaMask Snap. Default: 'npm:@coti-io/coti-snap' */
|
|
230
|
+
snapId: string;
|
|
231
|
+
/**
|
|
232
|
+
* Optional Snap version to request on install (`wallet_requestSnaps`).
|
|
233
|
+
* When unset, MetaMask installs the latest published version.
|
|
234
|
+
*/
|
|
235
|
+
snapVersion?: string;
|
|
236
|
+
/**
|
|
237
|
+
* When false, the plugin will not call `wallet_requestSnaps` to install or
|
|
238
|
+
* reconnect the Snap. An already-installed Snap can still be used for AES
|
|
239
|
+
* key retrieval. Default: true.
|
|
240
|
+
*/
|
|
241
|
+
snapInstallEnabled?: boolean;
|
|
242
|
+
/** If set, enforces a specific network chain ID (decimal string or hex). */
|
|
243
|
+
defaultNetworkId?: string;
|
|
244
|
+
/** Sepolia RPC URL for PoD portal operations. */
|
|
245
|
+
sepoliaRpcUrl?: string;
|
|
246
|
+
/** COTI testnet RPC URL for PoD SDK tracking. */
|
|
247
|
+
cotiTestnetRpcUrl?: string;
|
|
248
|
+
/** WalletConnect Cloud project ID for RainbowKit / WalletConnect wallets. */
|
|
249
|
+
walletConnectProjectId?: string;
|
|
250
|
+
/**
|
|
251
|
+
* Enables verbose internal logging via the plugin logger.
|
|
252
|
+
* Disabled by default — the library is silent unless a consumer opts in.
|
|
253
|
+
* Even when enabled, secret material (AES keys, ciphertext, signatures) is never logged.
|
|
254
|
+
*/
|
|
255
|
+
debug?: boolean;
|
|
256
|
+
/**
|
|
257
|
+
* When true, clears the in-memory session AES key (and Snap cache) on implicit
|
|
258
|
+
* wagmi/RainbowKit disconnect. Default false preserves the key so reconnecting
|
|
259
|
+
* the same wallet can skip Snap re-fetch; use true for stricter shared-browser security.
|
|
260
|
+
*/
|
|
261
|
+
clearSessionKeyOnWagmiDisconnect?: boolean;
|
|
262
|
+
/** Optional onboarding service hooks for grant and encrypted AES backup flows. */
|
|
263
|
+
onboardingServices?: OnboardingServices;
|
|
264
|
+
/**
|
|
265
|
+
* COTI chain that owns AES onboarding state for this app/session.
|
|
266
|
+
* Only COTI Testnet and COTI Mainnet can hold AES keys.
|
|
267
|
+
*/
|
|
268
|
+
aesKeyChainId?: AesKeyChainId;
|
|
269
|
+
/** Native COTI threshold required before contract onboarding. Defaults to 0. */
|
|
270
|
+
onboardingGrantMinBalanceWei?: BigNumberish;
|
|
271
|
+
/** Polling interval after grant callback. Defaults to 2000ms. */
|
|
272
|
+
onboardingGrantPollIntervalMs?: number;
|
|
273
|
+
/** Max time to wait after grant callback. Defaults to 60000ms. */
|
|
274
|
+
onboardingGrantTimeoutMs?: number;
|
|
275
|
+
/**
|
|
276
|
+
* Additional origins allowed to call wallet_invokeSnap set-aes-key.
|
|
277
|
+
* Use this to whitelist dApp domains that are not the published COTI portals.
|
|
278
|
+
* Each entry must be an exact origin string (e.g. 'https://portal.example.com').
|
|
279
|
+
* The Snap manifest's allowedOrigins must also include these domains — see PL-3.
|
|
280
|
+
*/
|
|
281
|
+
additionalSnapAesWriteOrigins?: string[];
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
284
|
+
* Configure the COTI Wallet Plugin at initialization time.
|
|
285
|
+
* Call this before rendering any hooks.
|
|
286
|
+
*/
|
|
287
|
+
declare function configureCotiPlugin(config: Partial<CotiPluginConfig>): void;
|
|
288
|
+
/**
|
|
289
|
+
* Returns the params object for `wallet_requestSnaps`.
|
|
290
|
+
* Omits version when unset so MetaMask installs the latest Snap.
|
|
291
|
+
*/
|
|
292
|
+
declare function getSnapRequestParams(snapId?: string, snapVersion?: string): Record<string, Record<string, never> | {
|
|
293
|
+
version: string;
|
|
294
|
+
}>;
|
|
295
|
+
/**
|
|
296
|
+
* Returns the current plugin configuration.
|
|
297
|
+
*/
|
|
298
|
+
declare function getPluginConfig(): Readonly<CotiPluginConfig>;
|
|
299
|
+
/** Whether `wallet_requestSnaps` install/connect is allowed for this app. */
|
|
300
|
+
declare function isSnapInstallEnabled(): boolean;
|
|
301
|
+
|
|
302
|
+
/**
|
|
303
|
+
* Internal logger for the COTI Wallet Plugin.
|
|
304
|
+
*
|
|
305
|
+
* As a library, this plugin must stay silent by default — it should never write
|
|
306
|
+
* to a consuming application's console unless explicitly opted in. All output is
|
|
307
|
+
* gated behind the `debug` flag in the plugin config (see `configureCotiPlugin`).
|
|
308
|
+
*
|
|
309
|
+
* SECURITY: Never pass secret material (AES keys, plaintext balances, ciphertext,
|
|
310
|
+
* or signatures) to this logger, even at debug level. Log opaque identifiers or
|
|
311
|
+
* lengths instead of raw values.
|
|
312
|
+
*/
|
|
313
|
+
type LogMethod = (...args: unknown[]) => void;
|
|
314
|
+
interface Logger {
|
|
315
|
+
log: LogMethod;
|
|
316
|
+
info: LogMethod;
|
|
317
|
+
warn: LogMethod;
|
|
318
|
+
error: LogMethod;
|
|
319
|
+
debug: LogMethod;
|
|
320
|
+
}
|
|
321
|
+
declare const logger: Logger;
|
|
322
|
+
/**
|
|
323
|
+
* Convenience toggle for the plugin's verbose logging.
|
|
324
|
+
* Equivalent to `configureCotiPlugin({ debug: enabled })`.
|
|
325
|
+
*/
|
|
326
|
+
declare function setDebugLogging(enabled: boolean): void;
|
|
327
|
+
|
|
328
|
+
/**
|
|
329
|
+
* Typed error classes for the COTI Wallet Plugin.
|
|
330
|
+
*
|
|
331
|
+
* Replaces string-based error matching (`error.message.includes('...')`) with
|
|
332
|
+
* structured error codes that can be checked via `instanceof` or `.code`.
|
|
333
|
+
*/
|
|
334
|
+
/**
|
|
335
|
+
* All known error codes emitted by the COTI Wallet Plugin.
|
|
336
|
+
*/
|
|
337
|
+
declare enum CotiErrorCode {
|
|
338
|
+
/** MetaMask (or any EIP-1193 provider) is not installed. */
|
|
339
|
+
METAMASK_NOT_INSTALLED = "METAMASK_NOT_INSTALLED",
|
|
340
|
+
/** No EIP-1193 provider found on `window.ethereum`. */
|
|
341
|
+
NO_PROVIDER = "NO_PROVIDER",
|
|
342
|
+
/** User rejected the wallet request (EIP-1193 code 4001). */
|
|
343
|
+
USER_REJECTED = "USER_REJECTED",
|
|
344
|
+
/** COTI Snap is not installed or connection attempt failed. */
|
|
345
|
+
SNAP_CONNECT_FAILED = "SNAP_CONNECT_FAILED",
|
|
346
|
+
/** User dismissed the Snap dialog (e.g., rejected key retrieval). */
|
|
347
|
+
SNAP_DIALOG_REJECTED = "SNAP_DIALOG_REJECTED",
|
|
348
|
+
/** Snap is required but not available for the current wallet type. */
|
|
349
|
+
SNAP_REQUIRED = "SNAP_REQUIRED",
|
|
350
|
+
/** Snap key existence check failed after retry. */
|
|
351
|
+
SNAP_KEY_CHECK_FAILED = "SNAP_KEY_CHECK_FAILED",
|
|
352
|
+
/** AES key does not match the on-chain account (decryption yields garbage). */
|
|
353
|
+
AES_KEY_MISMATCH = "AES_KEY_MISMATCH",
|
|
354
|
+
/** AES key is missing or was not provided. */
|
|
355
|
+
AES_KEY_MISSING = "AES_KEY_MISSING",
|
|
356
|
+
/** Account has never been onboarded to the COTI network. */
|
|
357
|
+
ACCOUNT_NOT_ONBOARDED = "ACCOUNT_NOT_ONBOARDED",
|
|
358
|
+
/** Onboarding process did not complete or key retrieval failed. */
|
|
359
|
+
ONBOARDING_INCOMPLETE = "ONBOARDING_INCOMPLETE",
|
|
360
|
+
/** Connected to an unsupported chain ID. */
|
|
361
|
+
UNSUPPORTED_NETWORK = "UNSUPPORTED_NETWORK",
|
|
362
|
+
/** WalletConnect Cloud project ID was not configured. */
|
|
363
|
+
WALLETCONNECT_PROJECT_ID_MISSING = "WALLETCONNECT_PROJECT_ID_MISSING",
|
|
364
|
+
/** Insufficient token balance for the requested operation. */
|
|
365
|
+
INSUFFICIENT_BALANCE = "INSUFFICIENT_BALANCE",
|
|
366
|
+
/** ERC20 allowance is too low for the requested bridge amount. */
|
|
367
|
+
INSUFFICIENT_ALLOWANCE = "INSUFFICIENT_ALLOWANCE",
|
|
368
|
+
/** Bridge or token contract address not found for the current chain. */
|
|
369
|
+
CONTRACT_NOT_FOUND = "CONTRACT_NOT_FOUND",
|
|
370
|
+
/** On-chain transaction reverted. */
|
|
371
|
+
TRANSACTION_REVERTED = "TRANSACTION_REVERTED",
|
|
372
|
+
/** Oracle timestamp mismatch (stale price data). */
|
|
373
|
+
ORACLE_TIMESTAMP_MISMATCH = "ORACLE_TIMESTAMP_MISMATCH",
|
|
374
|
+
/** External API (bridge tracker, cap meter) returned a non-success status. */
|
|
375
|
+
API_ERROR = "API_ERROR",
|
|
376
|
+
/** Input validation failed (e.g., invalid AES key format, invalid token amount). */
|
|
377
|
+
VALIDATION_ERROR = "VALIDATION_ERROR"
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Base error class for all COTI Wallet Plugin errors.
|
|
381
|
+
*
|
|
382
|
+
* Consumers can check errors via:
|
|
383
|
+
* - `error instanceof CotiPluginError` (type guard)
|
|
384
|
+
* - `error.code === CotiErrorCode.AES_KEY_MISMATCH` (code check)
|
|
385
|
+
*
|
|
386
|
+
* @example
|
|
387
|
+
* ```typescript
|
|
388
|
+
* try {
|
|
389
|
+
* await unlockPrivateBalances();
|
|
390
|
+
* } catch (error) {
|
|
391
|
+
* if (error instanceof CotiPluginError) {
|
|
392
|
+
* switch (error.code) {
|
|
393
|
+
* case CotiErrorCode.AES_KEY_MISMATCH:
|
|
394
|
+
* // show re-onboarding UI
|
|
395
|
+
* break;
|
|
396
|
+
* case CotiErrorCode.SNAP_CONNECT_FAILED:
|
|
397
|
+
* // show snap install modal
|
|
398
|
+
* break;
|
|
399
|
+
* case CotiErrorCode.USER_REJECTED:
|
|
400
|
+
* // user cancelled, do nothing
|
|
401
|
+
* break;
|
|
402
|
+
* }
|
|
403
|
+
* }
|
|
404
|
+
* }
|
|
405
|
+
* ```
|
|
406
|
+
*/
|
|
407
|
+
declare class CotiPluginError extends Error {
|
|
408
|
+
/** Structured error code for programmatic matching. */
|
|
409
|
+
readonly code: CotiErrorCode;
|
|
410
|
+
/** Optional additional context about the error. */
|
|
411
|
+
readonly detail?: string;
|
|
412
|
+
constructor(code: CotiErrorCode, message?: string, detail?: string);
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* Type guard to check if an unknown error is a CotiPluginError.
|
|
416
|
+
*/
|
|
417
|
+
declare function isCotiPluginError(error: unknown): error is CotiPluginError;
|
|
418
|
+
/**
|
|
419
|
+
* Type guard to check if an unknown error has a specific COTI error code.
|
|
420
|
+
*/
|
|
421
|
+
declare function hasCotiErrorCode(error: unknown, code: CotiErrorCode): boolean;
|
|
422
|
+
|
|
423
|
+
declare const SEPOLIA_CHAIN_ID = 11155111;
|
|
424
|
+
declare const COTI_TESTNET_CHAIN_ID = 7082400;
|
|
425
|
+
declare const DEFAULT_POD_EXPLORER_BASE_URL = "https://coti-pod-explorer.netlify.app";
|
|
426
|
+
declare const buildPodExplorerRequestUrl: (requestId: string, chainSlug?: string, baseUrl?: string) => string;
|
|
427
|
+
type PodBalanceTrustState = "ready" | "pending-request" | "callback-error" | "unknown";
|
|
428
|
+
interface PodBalanceState {
|
|
429
|
+
status: PodBalanceTrustState;
|
|
430
|
+
pending: boolean;
|
|
431
|
+
callbackErrored: boolean;
|
|
432
|
+
message?: string;
|
|
433
|
+
}
|
|
434
|
+
declare const DEFAULT_POD_BALANCE_STATE: PodBalanceState;
|
|
435
|
+
type PodPortalRequestStatus = "wallet-signing" | "source-submitted" | "source-mined" | "target-mined" | "callback-generated" | "pod-pending" | "callback-errored" | "succeeded" | "failed" | "burn-debt";
|
|
436
|
+
interface PodPortalRequest {
|
|
437
|
+
id: string;
|
|
438
|
+
kind: "deposit" | "withdraw";
|
|
439
|
+
chainId: number;
|
|
440
|
+
sourceTxHash: string;
|
|
441
|
+
requestId?: string;
|
|
442
|
+
withdrawalId?: string;
|
|
443
|
+
wallet: string;
|
|
444
|
+
token: string;
|
|
445
|
+
amount: string;
|
|
446
|
+
fromBlock?: number;
|
|
447
|
+
status: PodPortalRequestStatus;
|
|
448
|
+
balanceRefreshPending?: boolean;
|
|
449
|
+
message?: string;
|
|
450
|
+
createdAt: number;
|
|
451
|
+
updatedAt: number;
|
|
452
|
+
}
|
|
453
|
+
declare const PRIVACY_PORTAL_ABI: readonly ["function underlyingToken() view returns (address)", "function pToken() view returns (address)", "function decimals() view returns (uint8)", "function withdrawals(bytes32) view returns (address,address,uint256,uint256,uint256,bytes32,bytes32,uint8)", "function deposit(address recipient,uint256 amount,uint256 portalFee,uint256 mintCallbackFee) payable returns (bytes32)", "function depositNative(address recipient,uint256 amount,uint256 portalFee,uint256 mintCallbackFee) payable returns (bytes32)", "function nativeWrappedUnderlying() view returns (bool)", "function estimateDepositFees(uint256 amount) view returns (uint256 portalFee,bool usedDynamicPricing,uint256 mintTotalFee,uint256 mintCallbackFee)", "function estimateWithdrawFees(uint256 amount) view returns (uint256 portalFee,bool usedDynamicPricing,uint256 transferTotalFee,uint256 transferCallbackFee)", "function requestWithdrawWithPermit(address recipient,uint256 amount,uint256 portalFee,uint256 transferFee,uint256 transferCallbackFee,uint256 permitDeadline,uint8 v,bytes32 r,bytes32 s) payable returns (bytes32,bytes32)", "event DepositRequested(address indexed user,address indexed recipient,uint256 amount,bytes32 indexed mintRequestId)", "event WithdrawalRequested(bytes32 indexed withdrawalId,address indexed user,address indexed recipient,uint256 amount,bytes32 transferRequestId)", "event WithdrawalReleased(bytes32 indexed withdrawalId,address indexed recipient,uint256 amount)", "event BurnSubmitted(bytes32 indexed withdrawalId,uint256 amount,bytes32 burnRequestId)", "event BurnDebtRecorded(bytes32 indexed withdrawalId,uint256 amount,bytes reason)"];
|
|
454
|
+
/**
|
|
455
|
+
* Owner/admin surface of the PoD PrivacyPortal contracts (EIP-1167 proxies;
|
|
456
|
+
* all portals on a chain share one implementation). Recovered via bytecode
|
|
457
|
+
* selector analysis and live eth_calls — the portal source is not published
|
|
458
|
+
* and the contracts are unverified on explorers.
|
|
459
|
+
*
|
|
460
|
+
* Assumptions pending on-chain confirmation:
|
|
461
|
+
* - getFeeConfig(true) is the DEPOSIT config (both configs are currently
|
|
462
|
+
* identical on every deployed portal, so polarity is unverified);
|
|
463
|
+
* - fixedFee/maxFee are denominated in native wei (ETH on Sepolia, AVAX on
|
|
464
|
+
* Fuji); percentageBps shares COTI's FEE_DIVISOR = 1e6 scale.
|
|
465
|
+
* - maxFee == type(uint128).max is the deployed "no cap" sentinel.
|
|
466
|
+
*/
|
|
467
|
+
declare const POD_PORTAL_ADMIN_ABI: readonly ["function owner() view returns (address)", "function setDepositFee(uint256 fixedFee, uint256 percentageBps, uint256 maxFee)", "function setWithdrawFee(uint256 fixedFee, uint256 percentageBps, uint256 maxFee)", "function getFeeConfig(bool isDeposit) view returns (uint256 fixedFee, uint256 percentageBps, uint256 maxFee)", "function accumulatedPortalFees() view returns (uint256)", "function estimateDepositFees(uint256 amount) view returns (uint256 portalFee,bool usedDynamicPricing,uint256 mintTotalFee,uint256 mintCallbackFee)", "function estimateWithdrawFees(uint256 amount) view returns (uint256 portalFee,bool usedDynamicPricing,uint256 transferTotalFee,uint256 transferCallbackFee)"];
|
|
468
|
+
declare const POD_PTOKEN_ABI: readonly ["function name() view returns (string)", "function symbol() view returns (string)", "function decimals() view returns (uint8)", "function nonces(address owner) view returns (uint256)", "function failedRequests(bytes32 requestId) view returns (bytes)", "function balanceOf(address account) view returns (tuple(uint256 ciphertextHigh,uint256 ciphertextLow))", "function balanceWithState(address account) view returns (tuple(uint256 ciphertextHigh,uint256 ciphertextLow) balance,bool pending,bool callbackErrored)", "function balanceOfWithStatus(address account) view returns (tuple(uint256 ciphertextHigh,uint256 ciphertextLow),bool)", "error TransferAlreadyPending(address from, address to, bytes32 requestId)", "event TransferRequestSubmitted(address indexed from,address indexed to,bytes32 requestId)", "event Transfer(address indexed from,address indexed to,bytes senderValue,bytes receiverValue)", "event TransferFailed(address indexed from,address indexed to,bytes errorMsg)", "event RequestCallbackFailed(address indexed from,address indexed to,bytes32 requestId,bytes callbackData)"];
|
|
469
|
+
|
|
470
|
+
declare const podRequestsStorageKey: (wallet?: string) => string;
|
|
471
|
+
declare function loadPodRequests(wallet?: string): PodPortalRequest[];
|
|
472
|
+
declare function savePodRequests(wallet: string | undefined, requests: PodPortalRequest[]): void;
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Gas fee string for display on COTI bridge chains (not PoD portal).
|
|
476
|
+
* Mirrors the estimation path in usePrivacyBridge `updateGasFee`.
|
|
477
|
+
*/
|
|
478
|
+
declare function estimateCotiBridgeGasFeeDisplay(params: {
|
|
479
|
+
provider: ethers.BrowserProvider;
|
|
480
|
+
currentChainId: number;
|
|
481
|
+
bridgeAddress: string;
|
|
482
|
+
symbol: string;
|
|
483
|
+
direction: "to-private" | "to-public";
|
|
484
|
+
amountWei: bigint;
|
|
485
|
+
gasPrice: bigint;
|
|
486
|
+
isErc20Token: boolean;
|
|
487
|
+
/** When set, avoids provider.getSigner() (which may hit a hijacked window.ethereum). */
|
|
488
|
+
fromAddress?: string;
|
|
489
|
+
}): Promise<string>;
|
|
490
|
+
|
|
491
|
+
type CotiBridgeFeeQuote = {
|
|
492
|
+
portalFeeCoti: string | null;
|
|
493
|
+
estimatedGasFee: string | null;
|
|
494
|
+
feeDebugInfo: {
|
|
495
|
+
cotiLastUpdated: string;
|
|
496
|
+
tokenLastUpdated: string;
|
|
497
|
+
blockTimestamp: string;
|
|
498
|
+
} | null;
|
|
499
|
+
};
|
|
500
|
+
/** COTI bridge portal + gas fee quotes (isolated from PoD). */
|
|
501
|
+
declare const quoteCotiBridgeFees: (params: {
|
|
502
|
+
chainId: number;
|
|
503
|
+
symbol: string;
|
|
504
|
+
direction: "to-private" | "to-public";
|
|
505
|
+
amount: string;
|
|
506
|
+
walletAddress?: string;
|
|
507
|
+
}) => Promise<CotiBridgeFeeQuote>;
|
|
508
|
+
|
|
509
|
+
declare function resolvePodRequestStatus(request: PodPortalRequest): Promise<{
|
|
510
|
+
status: PodPortalRequest["status"];
|
|
511
|
+
message: string;
|
|
512
|
+
refreshPrivateBalances: boolean;
|
|
513
|
+
} | null>;
|
|
514
|
+
|
|
515
|
+
interface Token {
|
|
516
|
+
symbol: string;
|
|
517
|
+
name: string;
|
|
518
|
+
balance: string;
|
|
519
|
+
isPrivate: boolean;
|
|
520
|
+
icon?: string;
|
|
521
|
+
addressKey?: string;
|
|
522
|
+
bridgeAddressKey?: string;
|
|
523
|
+
decimals?: number;
|
|
524
|
+
isNative?: boolean;
|
|
525
|
+
supportedChainIds?: number[];
|
|
526
|
+
}
|
|
527
|
+
type SwapProgressStage = 'approve-start' | 'approve-complete' | 'transfer-start' | 'transfer-complete';
|
|
528
|
+
|
|
529
|
+
interface PodWithdrawPermit {
|
|
530
|
+
wallet: string;
|
|
531
|
+
pTokenAddress: string;
|
|
532
|
+
portalAddress: string;
|
|
533
|
+
amountWei: string;
|
|
534
|
+
deadline: string;
|
|
535
|
+
v: number;
|
|
536
|
+
r: string;
|
|
537
|
+
s: string;
|
|
538
|
+
}
|
|
539
|
+
type PortalFeeQuote = {
|
|
540
|
+
portalFee: bigint;
|
|
541
|
+
usedDynamicPricing: boolean;
|
|
542
|
+
gasPrice: bigint;
|
|
543
|
+
};
|
|
544
|
+
/** Spot chain gas price via `eth_gasPrice`. */
|
|
545
|
+
declare const getPodGasPrice: (provider: ethers.BrowserProvider | ethers.JsonRpcProvider | ethers.Provider) => Promise<bigint>;
|
|
546
|
+
/**
|
|
547
|
+
* Gas price for PoD inbox fee estimation and tx send.
|
|
548
|
+
* Uses `getFeeData().gasPrice` when available, with a 10% buffer so estimate
|
|
549
|
+
* and `tx.gasprice` stay aligned per pod-sdk inbox rules.
|
|
550
|
+
*/
|
|
551
|
+
declare const resolvePodTxGasPrice: (provider: ethers.BrowserProvider | ethers.JsonRpcProvider | ethers.Provider) => Promise<bigint>;
|
|
552
|
+
/** @deprecated Use {@link resolvePodTxGasPrice}. */
|
|
553
|
+
declare const getSepoliaGasPrice: (provider: ethers.BrowserProvider | ethers.JsonRpcProvider | ethers.Provider) => Promise<bigint>;
|
|
554
|
+
declare const quotePortalFeeOnly: (runner: ethers.ContractRunner, portalAddress: string, amount: bigint, direction: "to-private" | "to-public", gasPrice?: bigint) => Promise<PortalFeeQuote>;
|
|
555
|
+
declare const formatPortalFeeDisplay: (portalFee: bigint, _usedDynamicPricing?: boolean) => string;
|
|
556
|
+
declare const formatPodFeeDisplay: (totalFee: bigint) => string;
|
|
557
|
+
declare const estimatePodPortalFees: (params: {
|
|
558
|
+
runner: ethers.ContractRunner;
|
|
559
|
+
chainId: number;
|
|
560
|
+
portalAddress: string;
|
|
561
|
+
pubTok: TokenConfig | undefined;
|
|
562
|
+
amount: string;
|
|
563
|
+
direction: "to-private" | "to-public";
|
|
564
|
+
withdrawPermit?: PodWithdrawPermit;
|
|
565
|
+
}) => Promise<{
|
|
566
|
+
portalFeeDisplay: string;
|
|
567
|
+
podFeeDisplay: string;
|
|
568
|
+
podInboxFeeDisplay: string;
|
|
569
|
+
l1GasDisplay: string;
|
|
570
|
+
portalFeeWei: bigint;
|
|
571
|
+
podFeeEstimate: PodFeeEstimate;
|
|
572
|
+
gasPrice: bigint;
|
|
573
|
+
usedDynamicPricing: boolean;
|
|
574
|
+
}>;
|
|
575
|
+
|
|
576
|
+
/** Shared PoD inbox on every registered tracking chain. */
|
|
577
|
+
declare const getPodInboxAddress: (chainId: number) => string;
|
|
578
|
+
declare const getPodSdkConfig: () => PodSdkConfig;
|
|
579
|
+
|
|
580
|
+
type PodPortalFeeQuote = {
|
|
581
|
+
gasPrice: bigint;
|
|
582
|
+
portalFeeWei: bigint;
|
|
583
|
+
podInboxFeeWei: bigint;
|
|
584
|
+
podCallbackFeeWei: bigint;
|
|
585
|
+
l1ExecutionGasWei: bigint;
|
|
586
|
+
podFeeEstimate: PodFeeEstimate;
|
|
587
|
+
usedDynamicPricing: boolean;
|
|
588
|
+
display: {
|
|
589
|
+
portalFee: string;
|
|
590
|
+
podInboxFee: string;
|
|
591
|
+
l1Gas: string;
|
|
592
|
+
portalFeeSymbol: string;
|
|
593
|
+
};
|
|
594
|
+
};
|
|
595
|
+
/** Single source of truth for PoD portal fee quotes — one gasPrice, all components. */
|
|
596
|
+
declare const quotePodPortalTransactionFees: (params: {
|
|
597
|
+
runner: ethers.ContractRunner;
|
|
598
|
+
chainId: number;
|
|
599
|
+
portalAddress: string;
|
|
600
|
+
pubTok: TokenConfig | undefined;
|
|
601
|
+
amount: string;
|
|
602
|
+
direction: "to-private" | "to-public";
|
|
603
|
+
withdrawPermit?: PodWithdrawPermit;
|
|
604
|
+
gasPrice?: bigint;
|
|
605
|
+
}) => Promise<PodPortalFeeQuote>;
|
|
606
|
+
|
|
607
|
+
declare function signPodWithdrawPermit(params: {
|
|
608
|
+
signer: ethers.JsonRpcSigner;
|
|
609
|
+
pTokenAddress: string;
|
|
610
|
+
portalAddress: string;
|
|
611
|
+
amountWei: bigint;
|
|
612
|
+
deadline?: bigint;
|
|
613
|
+
chainId?: number;
|
|
614
|
+
tokenSymbol?: string;
|
|
615
|
+
}): Promise<PodWithdrawPermit>;
|
|
616
|
+
declare function executePodPortalTransaction(params: {
|
|
617
|
+
txAmount: string;
|
|
618
|
+
txDirection: "to-private" | "to-public";
|
|
619
|
+
signer: ethers.JsonRpcSigner;
|
|
620
|
+
provider: ethers.BrowserProvider;
|
|
621
|
+
portalAddress: string;
|
|
622
|
+
underlyingAddress: string;
|
|
623
|
+
pTokenAddress: string;
|
|
624
|
+
tokenSymbol: string;
|
|
625
|
+
decimals: number;
|
|
626
|
+
chainId?: number;
|
|
627
|
+
isNativeDeposit?: boolean;
|
|
628
|
+
withdrawPermit?: PodWithdrawPermit;
|
|
629
|
+
onProgress?: (stage: SwapProgressStage, txHash?: string) => void;
|
|
630
|
+
}): Promise<{
|
|
631
|
+
txHash: string;
|
|
632
|
+
request: PodPortalRequest;
|
|
633
|
+
receipt: ethers.TransactionReceipt;
|
|
634
|
+
}>;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* PoDPriceOracle deployed alongside the PoD privacy portals (Band adapter on
|
|
638
|
+
* Sepolia, Chainlink adapter on Fuji). Prices are 18-decimal USD per whole
|
|
639
|
+
* token; adapters return 0 (never revert) when a feed is unset or stale.
|
|
640
|
+
*/
|
|
641
|
+
declare const POD_PRICE_ORACLE_ABI: string[];
|
|
642
|
+
/**
|
|
643
|
+
* Fetches the live USD price for a token symbol from the chain's PoDPriceOracle.
|
|
644
|
+
*
|
|
645
|
+
* @param symbol - Token symbol from the chain config (e.g. "ETH", "USDC", "AVAX", "p.USDC")
|
|
646
|
+
* @param chainId - Host chain id (Sepolia 11155111 or Fuji 43113)
|
|
647
|
+
* @param provider - Optional ethers provider; defaults to the chain's configured RPCs
|
|
648
|
+
* @returns USD price as a number, or null when the chain has no oracle,
|
|
649
|
+
* the symbol is unknown, or the feed is unset/stale (oracle returns 0)
|
|
650
|
+
*/
|
|
651
|
+
declare function fetchPodOracleTokenUsdPrice(symbol: string, chainId: number, provider?: ethers.JsonRpcProvider | ethers.BrowserProvider): Promise<number | null>;
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Fetches the current USD price for a token symbol via the on-chain
|
|
655
|
+
* COTI price consumer (replaces the previous Band Protocol RPC call).
|
|
656
|
+
*
|
|
657
|
+
* The consumer returns a fixed-point uint256 with 18 decimals.
|
|
658
|
+
*
|
|
659
|
+
* @param symbol - Token symbol (e.g. "WETH", "WBTC", "USDT", "COTI")
|
|
660
|
+
* @param provider - Optional ethers provider; defaults to COTI testnet RPC
|
|
661
|
+
* @param chainId - Optional chain id; controls which oracle address is used
|
|
662
|
+
* @returns USD price as a number, or null if unavailable
|
|
663
|
+
*/
|
|
664
|
+
declare function fetchTokenUsdPrice(symbol: string, provider?: ethers.JsonRpcProvider | ethers.BrowserProvider, chainId?: number): Promise<number | null>;
|
|
665
|
+
interface BridgeFees {
|
|
666
|
+
depositFixedFee: string;
|
|
667
|
+
depositPercentageBps: string;
|
|
668
|
+
depositMaxFee: string;
|
|
669
|
+
withdrawFixedFee: string;
|
|
670
|
+
withdrawPercentageBps: string;
|
|
671
|
+
withdrawMaxFee: string;
|
|
672
|
+
}
|
|
673
|
+
/**
|
|
674
|
+
* Fetches the dynamic fee parameters (fixedFee, percentageBps, maxFee) for
|
|
675
|
+
* both deposit and withdraw from a bridge contract.
|
|
676
|
+
*
|
|
677
|
+
* @param bridgeAddress - On-chain address of the bridge contract
|
|
678
|
+
* @param isNativeBridge - true for the native COTI bridge, false for ERC-20 bridges
|
|
679
|
+
* @param provider - An ethers JsonRpcProvider (or compatible)
|
|
680
|
+
* @returns Formatted BridgeFees with COTI values in ether and bps as raw string
|
|
681
|
+
*/
|
|
682
|
+
declare function fetchBridgeFees(bridgeAddress: string, isNativeBridge: boolean, provider: ethers.JsonRpcProvider): Promise<BridgeFees>;
|
|
683
|
+
/**
|
|
684
|
+
* Compute the bridge fee for a native COTI deposit/withdraw.
|
|
685
|
+
* Mirrors the Solidity `_computeCotiFee` function.
|
|
686
|
+
*
|
|
687
|
+
* @param cotiAmount - Amount in COTI (human-readable, e.g. "10.5")
|
|
688
|
+
* @param fixedFee - Floor fee in COTI (human-readable)
|
|
689
|
+
* @param percentageBps - Basis points relative to FEE_DIVISOR (raw number string)
|
|
690
|
+
* @param maxFee - Cap fee in COTI (human-readable)
|
|
691
|
+
* @param cotiUsdPrice - Current COTI price in USD (from Band Protocol)
|
|
692
|
+
* @returns Fee in COTI as a human-readable string
|
|
693
|
+
*/
|
|
694
|
+
declare function computeCotiFee(cotiAmount: string, fixedFee: string, percentageBps: string, maxFee: string, cotiUsdPrice: number): string;
|
|
695
|
+
/**
|
|
696
|
+
* Compute the bridge fee for an ERC-20 token deposit/withdraw.
|
|
697
|
+
* Mirrors the Solidity `_computeErc20Fee` function.
|
|
698
|
+
* The fee is denominated in COTI.
|
|
699
|
+
*
|
|
700
|
+
* @param tokenAmount - Amount in token units (human-readable, e.g. "1.5")
|
|
701
|
+
* @param tokenDecimals - Decimals of the ERC-20 token (e.g. 18, 8, 6)
|
|
702
|
+
* @param fixedFee - Floor fee in COTI (human-readable)
|
|
703
|
+
* @param percentageBps - Basis points relative to FEE_DIVISOR (raw number string)
|
|
704
|
+
* @param maxFee - Cap fee in COTI (human-readable)
|
|
705
|
+
* @param tokenUsdPrice - Current token price in USD (from Band Protocol)
|
|
706
|
+
* @param cotiUsdPrice - Current COTI price in USD (from Band Protocol)
|
|
707
|
+
* @returns Fee in COTI as a human-readable string
|
|
708
|
+
*/
|
|
709
|
+
declare function computeErc20Fee(tokenAmount: string, tokenDecimals: number, fixedFee: string, percentageBps: string, maxFee: string, tokenUsdPrice: number, cotiUsdPrice: number): string;
|
|
710
|
+
interface SimulationResult {
|
|
711
|
+
fee: string;
|
|
712
|
+
explanation: string;
|
|
713
|
+
}
|
|
714
|
+
/**
|
|
715
|
+
* Call the on-chain fee simulation view function on a bridge contract.
|
|
716
|
+
* - Native COTI bridge: calls computeCotiFee(amount, fixedFee, percentageBps, maxFee)
|
|
717
|
+
* - ERC-20 bridges: calls computeErc20Fee(amount, fixedFee, percentageBps, maxFee, tokenSymbol, tokenDecimals)
|
|
718
|
+
*
|
|
719
|
+
* @param bridgeAddress - Address of the bridge contract
|
|
720
|
+
* @param amount - Token amount (human-readable, e.g. "1.5")
|
|
721
|
+
* @param fixedFee - Floor fee in COTI (human-readable, e.g. "10")
|
|
722
|
+
* @param percentageBps - Basis points relative to FEE_DIVISOR (raw number string, e.g. "500")
|
|
723
|
+
* @param maxFee - Cap fee in COTI (human-readable, e.g. "3000")
|
|
724
|
+
* @param oracleSymbol - Oracle symbol: "COTI" for native, "ETH"/"WBTC"/"USDT"/"USDC"/"ADA" for ERC-20
|
|
725
|
+
* @param tokenDecimals - Token decimals (18, 8, or 6)
|
|
726
|
+
* @param provider - An ethers provider
|
|
727
|
+
* @returns SimulationResult with fee in COTI and explanation
|
|
728
|
+
*/
|
|
729
|
+
declare function simulateFeeOnChain(bridgeAddress: string, amount: string, fixedFee: string, percentageBps: string, maxFee: string, oracleSymbol: string, tokenDecimals: number, provider: ethers.JsonRpcProvider | ethers.BrowserProvider): Promise<SimulationResult>;
|
|
730
|
+
/**
|
|
731
|
+
* Helper to get oracle symbol and decimals for a bridge token symbol.
|
|
732
|
+
*/
|
|
733
|
+
declare function getTokenSimulationMeta(tokenSymbol: string): {
|
|
734
|
+
oracleSymbol: string;
|
|
735
|
+
decimals: number;
|
|
736
|
+
};
|
|
737
|
+
|
|
738
|
+
interface BridgeData extends BridgeFees {
|
|
739
|
+
bridgeName: string;
|
|
740
|
+
bridgeAddress: string;
|
|
741
|
+
publicToken: string;
|
|
742
|
+
publicTokenIcon: string;
|
|
743
|
+
privateToken: string;
|
|
744
|
+
privateTokenIcon: string;
|
|
745
|
+
minDepositAmount: string;
|
|
746
|
+
maxDepositAmount: string;
|
|
747
|
+
minWithdrawAmount: string;
|
|
748
|
+
maxWithdrawAmount: string;
|
|
749
|
+
accumulatedFees: string;
|
|
750
|
+
accumulatedCotiFees: string;
|
|
751
|
+
nativeCotiFee: string;
|
|
752
|
+
bridgeBalance: string;
|
|
753
|
+
isPaused: boolean;
|
|
754
|
+
tokenDecimals: number;
|
|
755
|
+
/** Symbol the fee values are denominated in (native coin on PoD chains; COTI otherwise). */
|
|
756
|
+
feeTokenSymbol?: string;
|
|
757
|
+
isLoading: boolean;
|
|
758
|
+
error: string | null;
|
|
759
|
+
}
|
|
760
|
+
declare const useBridgeData: (chainId: number) => {
|
|
761
|
+
bridgesData: BridgeData[];
|
|
762
|
+
isLoading: boolean;
|
|
763
|
+
error: string | null;
|
|
764
|
+
refresh: () => void;
|
|
765
|
+
};
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Live backoffice reader for PoD privacy portals (Sepolia/Fuji).
|
|
769
|
+
* Reads the deposit/withdraw fee configs, accumulated portal fees and portal
|
|
770
|
+
* balance for every public token with a configured portal, shaped as
|
|
771
|
+
* {@link BridgeData} rows. Fee values are native-coin denominated; the row's
|
|
772
|
+
* `feeTokenSymbol` carries the display symbol (ETH/AVAX).
|
|
773
|
+
*/
|
|
774
|
+
declare function fetchPodBridgeData(chainId: number): Promise<BridgeData[]>;
|
|
775
|
+
/**
|
|
776
|
+
* Local mirror of the assumed PoD portal fee math for the backoffice
|
|
777
|
+
* simulate panel: max(fixedFee, valueInNative * bps / 1e6), capped at maxFee
|
|
778
|
+
* (0 = no cap). ERC-20 amounts are converted to native units via the chain's
|
|
779
|
+
* PoDPriceOracle live prices.
|
|
780
|
+
*
|
|
781
|
+
* @param chainId - PoD chain id (Sepolia 11155111 / Fuji 43113)
|
|
782
|
+
* @param tokenSymbol - Public token symbol from the chain config (e.g. "ETH", "USDC")
|
|
783
|
+
* @param amount - Token amount (human-readable)
|
|
784
|
+
* @param fixedFee - Floor fee in native coin (human-readable)
|
|
785
|
+
* @param percentageBps - Basis points relative to FEE_DIVISOR (raw number string)
|
|
786
|
+
* @param maxFee - Cap fee in native coin (human-readable, "0" = no cap)
|
|
787
|
+
*/
|
|
788
|
+
declare function simulatePodPortalFee(chainId: number, tokenSymbol: string, amount: string, fixedFee: string, percentageBps: string, maxFee: string): Promise<SimulationResult>;
|
|
789
|
+
|
|
790
|
+
declare const TOKEN_ABI: ({
|
|
791
|
+
inputs: never[];
|
|
792
|
+
stateMutability: string;
|
|
793
|
+
type: string;
|
|
794
|
+
name?: undefined;
|
|
795
|
+
anonymous?: undefined;
|
|
796
|
+
outputs?: undefined;
|
|
797
|
+
} | {
|
|
798
|
+
inputs: {
|
|
799
|
+
internalType: string;
|
|
800
|
+
name: string;
|
|
801
|
+
type: string;
|
|
802
|
+
}[];
|
|
803
|
+
name: string;
|
|
804
|
+
type: string;
|
|
805
|
+
stateMutability?: undefined;
|
|
806
|
+
anonymous?: undefined;
|
|
807
|
+
outputs?: undefined;
|
|
808
|
+
} | {
|
|
809
|
+
anonymous: boolean;
|
|
810
|
+
inputs: ({
|
|
811
|
+
indexed: boolean;
|
|
812
|
+
internalType: string;
|
|
813
|
+
name: string;
|
|
814
|
+
type: string;
|
|
815
|
+
components?: undefined;
|
|
816
|
+
} | {
|
|
817
|
+
components: {
|
|
818
|
+
internalType: string;
|
|
819
|
+
name: string;
|
|
820
|
+
type: string;
|
|
821
|
+
}[];
|
|
822
|
+
indexed: boolean;
|
|
823
|
+
internalType: string;
|
|
824
|
+
name: string;
|
|
825
|
+
type: string;
|
|
826
|
+
})[];
|
|
827
|
+
name: string;
|
|
828
|
+
type: string;
|
|
829
|
+
stateMutability?: undefined;
|
|
830
|
+
outputs?: undefined;
|
|
831
|
+
} | {
|
|
832
|
+
inputs: {
|
|
833
|
+
internalType: string;
|
|
834
|
+
name: string;
|
|
835
|
+
type: string;
|
|
836
|
+
}[];
|
|
837
|
+
name: string;
|
|
838
|
+
outputs: {
|
|
839
|
+
components: {
|
|
840
|
+
components: {
|
|
841
|
+
internalType: string;
|
|
842
|
+
name: string;
|
|
843
|
+
type: string;
|
|
844
|
+
}[];
|
|
845
|
+
internalType: string;
|
|
846
|
+
name: string;
|
|
847
|
+
type: string;
|
|
848
|
+
}[];
|
|
849
|
+
internalType: string;
|
|
850
|
+
name: string;
|
|
851
|
+
type: string;
|
|
852
|
+
}[];
|
|
853
|
+
stateMutability: string;
|
|
854
|
+
type: string;
|
|
855
|
+
anonymous?: undefined;
|
|
856
|
+
} | {
|
|
857
|
+
inputs: ({
|
|
858
|
+
internalType: string;
|
|
859
|
+
name: string;
|
|
860
|
+
type: string;
|
|
861
|
+
components?: undefined;
|
|
862
|
+
} | {
|
|
863
|
+
components: ({
|
|
864
|
+
components: {
|
|
865
|
+
internalType: string;
|
|
866
|
+
name: string;
|
|
867
|
+
type: string;
|
|
868
|
+
}[];
|
|
869
|
+
internalType: string;
|
|
870
|
+
name: string;
|
|
871
|
+
type: string;
|
|
872
|
+
} | {
|
|
873
|
+
internalType: string;
|
|
874
|
+
name: string;
|
|
875
|
+
type: string;
|
|
876
|
+
components?: undefined;
|
|
877
|
+
})[];
|
|
878
|
+
internalType: string;
|
|
879
|
+
name: string;
|
|
880
|
+
type: string;
|
|
881
|
+
})[];
|
|
882
|
+
name: string;
|
|
883
|
+
outputs: {
|
|
884
|
+
internalType: string;
|
|
885
|
+
name: string;
|
|
886
|
+
type: string;
|
|
887
|
+
}[];
|
|
888
|
+
stateMutability: string;
|
|
889
|
+
type: string;
|
|
890
|
+
anonymous?: undefined;
|
|
891
|
+
} | {
|
|
892
|
+
inputs: {
|
|
893
|
+
internalType: string;
|
|
894
|
+
name: string;
|
|
895
|
+
type: string;
|
|
896
|
+
}[];
|
|
897
|
+
name: string;
|
|
898
|
+
outputs: {
|
|
899
|
+
components: {
|
|
900
|
+
internalType: string;
|
|
901
|
+
name: string;
|
|
902
|
+
type: string;
|
|
903
|
+
}[];
|
|
904
|
+
internalType: string;
|
|
905
|
+
name: string;
|
|
906
|
+
type: string;
|
|
907
|
+
}[];
|
|
908
|
+
stateMutability: string;
|
|
909
|
+
type: string;
|
|
910
|
+
anonymous?: undefined;
|
|
911
|
+
})[];
|
|
912
|
+
declare const BRIDGE_ABI: readonly [{
|
|
913
|
+
readonly inputs: readonly [{
|
|
914
|
+
readonly internalType: "address";
|
|
915
|
+
readonly name: "_privateCoti";
|
|
916
|
+
readonly type: "address";
|
|
917
|
+
}, {
|
|
918
|
+
readonly internalType: "address";
|
|
919
|
+
readonly name: "_feeRecipient";
|
|
920
|
+
readonly type: "address";
|
|
921
|
+
}, {
|
|
922
|
+
readonly internalType: "address";
|
|
923
|
+
readonly name: "_rescueRecipient";
|
|
924
|
+
readonly type: "address";
|
|
925
|
+
}];
|
|
926
|
+
readonly stateMutability: "nonpayable";
|
|
927
|
+
readonly type: "constructor";
|
|
928
|
+
}, {
|
|
929
|
+
readonly inputs: readonly [{
|
|
930
|
+
readonly internalType: "address";
|
|
931
|
+
readonly name: "account";
|
|
932
|
+
readonly type: "address";
|
|
933
|
+
}];
|
|
934
|
+
readonly name: "AddressBlacklisted";
|
|
935
|
+
readonly type: "error";
|
|
936
|
+
}, {
|
|
937
|
+
readonly inputs: readonly [];
|
|
938
|
+
readonly name: "AmountZero";
|
|
939
|
+
readonly type: "error";
|
|
940
|
+
}, {
|
|
941
|
+
readonly inputs: readonly [];
|
|
942
|
+
readonly name: "BridgePaused";
|
|
943
|
+
readonly type: "error";
|
|
944
|
+
}, {
|
|
945
|
+
readonly inputs: readonly [];
|
|
946
|
+
readonly name: "DepositBelowMinimum";
|
|
947
|
+
readonly type: "error";
|
|
948
|
+
}, {
|
|
949
|
+
readonly inputs: readonly [];
|
|
950
|
+
readonly name: "DepositDisabled";
|
|
951
|
+
readonly type: "error";
|
|
952
|
+
}, {
|
|
953
|
+
readonly inputs: readonly [];
|
|
954
|
+
readonly name: "DepositExceedsMaximum";
|
|
955
|
+
readonly type: "error";
|
|
956
|
+
}, {
|
|
957
|
+
readonly inputs: readonly [];
|
|
958
|
+
readonly name: "EthTransferFailed";
|
|
959
|
+
readonly type: "error";
|
|
960
|
+
}, {
|
|
961
|
+
readonly inputs: readonly [];
|
|
962
|
+
readonly name: "ExceedsRescueableAmount";
|
|
963
|
+
readonly type: "error";
|
|
964
|
+
}, {
|
|
965
|
+
readonly inputs: readonly [];
|
|
966
|
+
readonly name: "FeeRecipientNotSet";
|
|
967
|
+
readonly type: "error";
|
|
968
|
+
}, {
|
|
969
|
+
readonly inputs: readonly [];
|
|
970
|
+
readonly name: "InsufficientAccumulatedFees";
|
|
971
|
+
readonly type: "error";
|
|
972
|
+
}, {
|
|
973
|
+
readonly inputs: readonly [];
|
|
974
|
+
readonly name: "InsufficientCotiFee";
|
|
975
|
+
readonly type: "error";
|
|
976
|
+
}, {
|
|
977
|
+
readonly inputs: readonly [];
|
|
978
|
+
readonly name: "InsufficientEthBalance";
|
|
979
|
+
readonly type: "error";
|
|
980
|
+
}, {
|
|
981
|
+
readonly inputs: readonly [];
|
|
982
|
+
readonly name: "InvalidAddress";
|
|
983
|
+
readonly type: "error";
|
|
984
|
+
}, {
|
|
985
|
+
readonly inputs: readonly [];
|
|
986
|
+
readonly name: "InvalidFee";
|
|
987
|
+
readonly type: "error";
|
|
988
|
+
}, {
|
|
989
|
+
readonly inputs: readonly [];
|
|
990
|
+
readonly name: "InvalidFeeConfiguration";
|
|
991
|
+
readonly type: "error";
|
|
992
|
+
}, {
|
|
993
|
+
readonly inputs: readonly [];
|
|
994
|
+
readonly name: "InvalidLimitConfiguration";
|
|
995
|
+
readonly type: "error";
|
|
996
|
+
}, {
|
|
997
|
+
readonly inputs: readonly [];
|
|
998
|
+
readonly name: "NativeCotiFeeNotApplicable";
|
|
999
|
+
readonly type: "error";
|
|
1000
|
+
}, {
|
|
1001
|
+
readonly inputs: readonly [{
|
|
1002
|
+
readonly internalType: "uint256";
|
|
1003
|
+
readonly name: "expected";
|
|
1004
|
+
readonly type: "uint256";
|
|
1005
|
+
}, {
|
|
1006
|
+
readonly internalType: "uint256";
|
|
1007
|
+
readonly name: "actual";
|
|
1008
|
+
readonly type: "uint256";
|
|
1009
|
+
}];
|
|
1010
|
+
readonly name: "OracleTimestampMismatch";
|
|
1011
|
+
readonly type: "error";
|
|
1012
|
+
}, {
|
|
1013
|
+
readonly inputs: readonly [];
|
|
1014
|
+
readonly name: "WithdrawBelowMinimum";
|
|
1015
|
+
readonly type: "error";
|
|
1016
|
+
}, {
|
|
1017
|
+
readonly inputs: readonly [];
|
|
1018
|
+
readonly name: "WithdrawExceedsMaximum";
|
|
1019
|
+
readonly type: "error";
|
|
1020
|
+
}, {
|
|
1021
|
+
readonly inputs: readonly [];
|
|
1022
|
+
readonly name: "WithdrawFeesMustBeOverridden";
|
|
1023
|
+
readonly type: "error";
|
|
1024
|
+
}, {
|
|
1025
|
+
readonly anonymous: false;
|
|
1026
|
+
readonly inputs: readonly [{
|
|
1027
|
+
readonly indexed: true;
|
|
1028
|
+
readonly internalType: "address";
|
|
1029
|
+
readonly name: "account";
|
|
1030
|
+
readonly type: "address";
|
|
1031
|
+
}, {
|
|
1032
|
+
readonly indexed: true;
|
|
1033
|
+
readonly internalType: "address";
|
|
1034
|
+
readonly name: "by";
|
|
1035
|
+
readonly type: "address";
|
|
1036
|
+
}];
|
|
1037
|
+
readonly name: "Blacklisted";
|
|
1038
|
+
readonly type: "event";
|
|
1039
|
+
}, {
|
|
1040
|
+
readonly anonymous: false;
|
|
1041
|
+
readonly inputs: readonly [{
|
|
1042
|
+
readonly indexed: true;
|
|
1043
|
+
readonly internalType: "address";
|
|
1044
|
+
readonly name: "to";
|
|
1045
|
+
readonly type: "address";
|
|
1046
|
+
}, {
|
|
1047
|
+
readonly indexed: false;
|
|
1048
|
+
readonly internalType: "uint256";
|
|
1049
|
+
readonly name: "amount";
|
|
1050
|
+
readonly type: "uint256";
|
|
1051
|
+
}];
|
|
1052
|
+
readonly name: "CotiFeesWithdrawn";
|
|
1053
|
+
readonly type: "event";
|
|
1054
|
+
}, {
|
|
1055
|
+
readonly anonymous: false;
|
|
1056
|
+
readonly inputs: readonly [{
|
|
1057
|
+
readonly indexed: true;
|
|
1058
|
+
readonly internalType: "address";
|
|
1059
|
+
readonly name: "user";
|
|
1060
|
+
readonly type: "address";
|
|
1061
|
+
}, {
|
|
1062
|
+
readonly indexed: false;
|
|
1063
|
+
readonly internalType: "uint256";
|
|
1064
|
+
readonly name: "grossAmount";
|
|
1065
|
+
readonly type: "uint256";
|
|
1066
|
+
}, {
|
|
1067
|
+
readonly indexed: false;
|
|
1068
|
+
readonly internalType: "uint256";
|
|
1069
|
+
readonly name: "netAmount";
|
|
1070
|
+
readonly type: "uint256";
|
|
1071
|
+
}];
|
|
1072
|
+
readonly name: "Deposit";
|
|
1073
|
+
readonly type: "event";
|
|
1074
|
+
}, {
|
|
1075
|
+
readonly anonymous: false;
|
|
1076
|
+
readonly inputs: readonly [{
|
|
1077
|
+
readonly indexed: false;
|
|
1078
|
+
readonly internalType: "bool";
|
|
1079
|
+
readonly name: "enabled";
|
|
1080
|
+
readonly type: "bool";
|
|
1081
|
+
}, {
|
|
1082
|
+
readonly indexed: true;
|
|
1083
|
+
readonly internalType: "address";
|
|
1084
|
+
readonly name: "by";
|
|
1085
|
+
readonly type: "address";
|
|
1086
|
+
}];
|
|
1087
|
+
readonly name: "DepositEnabledUpdated";
|
|
1088
|
+
readonly type: "event";
|
|
1089
|
+
}, {
|
|
1090
|
+
readonly anonymous: false;
|
|
1091
|
+
readonly inputs: readonly [{
|
|
1092
|
+
readonly indexed: false;
|
|
1093
|
+
readonly internalType: "string";
|
|
1094
|
+
readonly name: "feeType";
|
|
1095
|
+
readonly type: "string";
|
|
1096
|
+
}, {
|
|
1097
|
+
readonly indexed: false;
|
|
1098
|
+
readonly internalType: "uint256";
|
|
1099
|
+
readonly name: "fixedFee";
|
|
1100
|
+
readonly type: "uint256";
|
|
1101
|
+
}, {
|
|
1102
|
+
readonly indexed: false;
|
|
1103
|
+
readonly internalType: "uint256";
|
|
1104
|
+
readonly name: "percentageBps";
|
|
1105
|
+
readonly type: "uint256";
|
|
1106
|
+
}, {
|
|
1107
|
+
readonly indexed: false;
|
|
1108
|
+
readonly internalType: "uint256";
|
|
1109
|
+
readonly name: "maxFee";
|
|
1110
|
+
readonly type: "uint256";
|
|
1111
|
+
}];
|
|
1112
|
+
readonly name: "DynamicFeeUpdated";
|
|
1113
|
+
readonly type: "event";
|
|
1114
|
+
}, {
|
|
1115
|
+
readonly anonymous: false;
|
|
1116
|
+
readonly inputs: readonly [{
|
|
1117
|
+
readonly indexed: false;
|
|
1118
|
+
readonly internalType: "string";
|
|
1119
|
+
readonly name: "feeType";
|
|
1120
|
+
readonly type: "string";
|
|
1121
|
+
}, {
|
|
1122
|
+
readonly indexed: false;
|
|
1123
|
+
readonly internalType: "uint256";
|
|
1124
|
+
readonly name: "newFeeBasisPoints";
|
|
1125
|
+
readonly type: "uint256";
|
|
1126
|
+
}];
|
|
1127
|
+
readonly name: "FeeUpdated";
|
|
1128
|
+
readonly type: "event";
|
|
1129
|
+
}, {
|
|
1130
|
+
readonly anonymous: false;
|
|
1131
|
+
readonly inputs: readonly [{
|
|
1132
|
+
readonly indexed: true;
|
|
1133
|
+
readonly internalType: "address";
|
|
1134
|
+
readonly name: "to";
|
|
1135
|
+
readonly type: "address";
|
|
1136
|
+
}, {
|
|
1137
|
+
readonly indexed: false;
|
|
1138
|
+
readonly internalType: "uint256";
|
|
1139
|
+
readonly name: "amount";
|
|
1140
|
+
readonly type: "uint256";
|
|
1141
|
+
}];
|
|
1142
|
+
readonly name: "FeesWithdrawn";
|
|
1143
|
+
readonly type: "event";
|
|
1144
|
+
}, {
|
|
1145
|
+
readonly anonymous: false;
|
|
1146
|
+
readonly inputs: readonly [{
|
|
1147
|
+
readonly indexed: false;
|
|
1148
|
+
readonly internalType: "uint256";
|
|
1149
|
+
readonly name: "minDeposit";
|
|
1150
|
+
readonly type: "uint256";
|
|
1151
|
+
}, {
|
|
1152
|
+
readonly indexed: false;
|
|
1153
|
+
readonly internalType: "uint256";
|
|
1154
|
+
readonly name: "maxDeposit";
|
|
1155
|
+
readonly type: "uint256";
|
|
1156
|
+
}, {
|
|
1157
|
+
readonly indexed: false;
|
|
1158
|
+
readonly internalType: "uint256";
|
|
1159
|
+
readonly name: "minWithdraw";
|
|
1160
|
+
readonly type: "uint256";
|
|
1161
|
+
}, {
|
|
1162
|
+
readonly indexed: false;
|
|
1163
|
+
readonly internalType: "uint256";
|
|
1164
|
+
readonly name: "maxWithdraw";
|
|
1165
|
+
readonly type: "uint256";
|
|
1166
|
+
}];
|
|
1167
|
+
readonly name: "LimitsUpdated";
|
|
1168
|
+
readonly type: "event";
|
|
1169
|
+
}, {
|
|
1170
|
+
readonly anonymous: false;
|
|
1171
|
+
readonly inputs: readonly [{
|
|
1172
|
+
readonly indexed: false;
|
|
1173
|
+
readonly internalType: "uint256";
|
|
1174
|
+
readonly name: "fee";
|
|
1175
|
+
readonly type: "uint256";
|
|
1176
|
+
}, {
|
|
1177
|
+
readonly indexed: true;
|
|
1178
|
+
readonly internalType: "address";
|
|
1179
|
+
readonly name: "by";
|
|
1180
|
+
readonly type: "address";
|
|
1181
|
+
}];
|
|
1182
|
+
readonly name: "NativeCotiFeeUpdated";
|
|
1183
|
+
readonly type: "event";
|
|
1184
|
+
}, {
|
|
1185
|
+
readonly anonymous: false;
|
|
1186
|
+
readonly inputs: readonly [{
|
|
1187
|
+
readonly indexed: true;
|
|
1188
|
+
readonly internalType: "address";
|
|
1189
|
+
readonly name: "to";
|
|
1190
|
+
readonly type: "address";
|
|
1191
|
+
}, {
|
|
1192
|
+
readonly indexed: false;
|
|
1193
|
+
readonly internalType: "uint256";
|
|
1194
|
+
readonly name: "amount";
|
|
1195
|
+
readonly type: "uint256";
|
|
1196
|
+
}];
|
|
1197
|
+
readonly name: "NativeRescued";
|
|
1198
|
+
readonly type: "event";
|
|
1199
|
+
}, {
|
|
1200
|
+
readonly anonymous: false;
|
|
1201
|
+
readonly inputs: readonly [{
|
|
1202
|
+
readonly indexed: true;
|
|
1203
|
+
readonly internalType: "address";
|
|
1204
|
+
readonly name: "account";
|
|
1205
|
+
readonly type: "address";
|
|
1206
|
+
}, {
|
|
1207
|
+
readonly indexed: true;
|
|
1208
|
+
readonly internalType: "address";
|
|
1209
|
+
readonly name: "by";
|
|
1210
|
+
readonly type: "address";
|
|
1211
|
+
}];
|
|
1212
|
+
readonly name: "OperatorAdded";
|
|
1213
|
+
readonly type: "event";
|
|
1214
|
+
}, {
|
|
1215
|
+
readonly anonymous: false;
|
|
1216
|
+
readonly inputs: readonly [{
|
|
1217
|
+
readonly indexed: true;
|
|
1218
|
+
readonly internalType: "address";
|
|
1219
|
+
readonly name: "account";
|
|
1220
|
+
readonly type: "address";
|
|
1221
|
+
}, {
|
|
1222
|
+
readonly indexed: true;
|
|
1223
|
+
readonly internalType: "address";
|
|
1224
|
+
readonly name: "by";
|
|
1225
|
+
readonly type: "address";
|
|
1226
|
+
}];
|
|
1227
|
+
readonly name: "OperatorRemoved";
|
|
1228
|
+
readonly type: "event";
|
|
1229
|
+
}, {
|
|
1230
|
+
readonly anonymous: false;
|
|
1231
|
+
readonly inputs: readonly [{
|
|
1232
|
+
readonly indexed: true;
|
|
1233
|
+
readonly internalType: "address";
|
|
1234
|
+
readonly name: "previousOwner";
|
|
1235
|
+
readonly type: "address";
|
|
1236
|
+
}, {
|
|
1237
|
+
readonly indexed: true;
|
|
1238
|
+
readonly internalType: "address";
|
|
1239
|
+
readonly name: "newOwner";
|
|
1240
|
+
readonly type: "address";
|
|
1241
|
+
}];
|
|
1242
|
+
readonly name: "OwnershipTransferred";
|
|
1243
|
+
readonly type: "event";
|
|
1244
|
+
}, {
|
|
1245
|
+
readonly anonymous: false;
|
|
1246
|
+
readonly inputs: readonly [{
|
|
1247
|
+
readonly indexed: false;
|
|
1248
|
+
readonly internalType: "address";
|
|
1249
|
+
readonly name: "account";
|
|
1250
|
+
readonly type: "address";
|
|
1251
|
+
}];
|
|
1252
|
+
readonly name: "Paused";
|
|
1253
|
+
readonly type: "event";
|
|
1254
|
+
}, {
|
|
1255
|
+
readonly anonymous: false;
|
|
1256
|
+
readonly inputs: readonly [{
|
|
1257
|
+
readonly indexed: true;
|
|
1258
|
+
readonly internalType: "address";
|
|
1259
|
+
readonly name: "oldOracle";
|
|
1260
|
+
readonly type: "address";
|
|
1261
|
+
}, {
|
|
1262
|
+
readonly indexed: true;
|
|
1263
|
+
readonly internalType: "address";
|
|
1264
|
+
readonly name: "newOracle";
|
|
1265
|
+
readonly type: "address";
|
|
1266
|
+
}];
|
|
1267
|
+
readonly name: "PriceOracleUpdated";
|
|
1268
|
+
readonly type: "event";
|
|
1269
|
+
}, {
|
|
1270
|
+
readonly anonymous: false;
|
|
1271
|
+
readonly inputs: readonly [{
|
|
1272
|
+
readonly indexed: true;
|
|
1273
|
+
readonly internalType: "bytes32";
|
|
1274
|
+
readonly name: "role";
|
|
1275
|
+
readonly type: "bytes32";
|
|
1276
|
+
}, {
|
|
1277
|
+
readonly indexed: true;
|
|
1278
|
+
readonly internalType: "bytes32";
|
|
1279
|
+
readonly name: "previousAdminRole";
|
|
1280
|
+
readonly type: "bytes32";
|
|
1281
|
+
}, {
|
|
1282
|
+
readonly indexed: true;
|
|
1283
|
+
readonly internalType: "bytes32";
|
|
1284
|
+
readonly name: "newAdminRole";
|
|
1285
|
+
readonly type: "bytes32";
|
|
1286
|
+
}];
|
|
1287
|
+
readonly name: "RoleAdminChanged";
|
|
1288
|
+
readonly type: "event";
|
|
1289
|
+
}, {
|
|
1290
|
+
readonly anonymous: false;
|
|
1291
|
+
readonly inputs: readonly [{
|
|
1292
|
+
readonly indexed: true;
|
|
1293
|
+
readonly internalType: "bytes32";
|
|
1294
|
+
readonly name: "role";
|
|
1295
|
+
readonly type: "bytes32";
|
|
1296
|
+
}, {
|
|
1297
|
+
readonly indexed: true;
|
|
1298
|
+
readonly internalType: "address";
|
|
1299
|
+
readonly name: "account";
|
|
1300
|
+
readonly type: "address";
|
|
1301
|
+
}, {
|
|
1302
|
+
readonly indexed: true;
|
|
1303
|
+
readonly internalType: "address";
|
|
1304
|
+
readonly name: "sender";
|
|
1305
|
+
readonly type: "address";
|
|
1306
|
+
}];
|
|
1307
|
+
readonly name: "RoleGranted";
|
|
1308
|
+
readonly type: "event";
|
|
1309
|
+
}, {
|
|
1310
|
+
readonly anonymous: false;
|
|
1311
|
+
readonly inputs: readonly [{
|
|
1312
|
+
readonly indexed: true;
|
|
1313
|
+
readonly internalType: "bytes32";
|
|
1314
|
+
readonly name: "role";
|
|
1315
|
+
readonly type: "bytes32";
|
|
1316
|
+
}, {
|
|
1317
|
+
readonly indexed: true;
|
|
1318
|
+
readonly internalType: "address";
|
|
1319
|
+
readonly name: "account";
|
|
1320
|
+
readonly type: "address";
|
|
1321
|
+
}, {
|
|
1322
|
+
readonly indexed: true;
|
|
1323
|
+
readonly internalType: "address";
|
|
1324
|
+
readonly name: "sender";
|
|
1325
|
+
readonly type: "address";
|
|
1326
|
+
}];
|
|
1327
|
+
readonly name: "RoleRevoked";
|
|
1328
|
+
readonly type: "event";
|
|
1329
|
+
}, {
|
|
1330
|
+
readonly anonymous: false;
|
|
1331
|
+
readonly inputs: readonly [{
|
|
1332
|
+
readonly indexed: true;
|
|
1333
|
+
readonly internalType: "address";
|
|
1334
|
+
readonly name: "account";
|
|
1335
|
+
readonly type: "address";
|
|
1336
|
+
}, {
|
|
1337
|
+
readonly indexed: true;
|
|
1338
|
+
readonly internalType: "address";
|
|
1339
|
+
readonly name: "by";
|
|
1340
|
+
readonly type: "address";
|
|
1341
|
+
}];
|
|
1342
|
+
readonly name: "UnBlacklisted";
|
|
1343
|
+
readonly type: "event";
|
|
1344
|
+
}, {
|
|
1345
|
+
readonly anonymous: false;
|
|
1346
|
+
readonly inputs: readonly [{
|
|
1347
|
+
readonly indexed: false;
|
|
1348
|
+
readonly internalType: "address";
|
|
1349
|
+
readonly name: "account";
|
|
1350
|
+
readonly type: "address";
|
|
1351
|
+
}];
|
|
1352
|
+
readonly name: "Unpaused";
|
|
1353
|
+
readonly type: "event";
|
|
1354
|
+
}, {
|
|
1355
|
+
readonly anonymous: false;
|
|
1356
|
+
readonly inputs: readonly [{
|
|
1357
|
+
readonly indexed: true;
|
|
1358
|
+
readonly internalType: "address";
|
|
1359
|
+
readonly name: "user";
|
|
1360
|
+
readonly type: "address";
|
|
1361
|
+
}, {
|
|
1362
|
+
readonly indexed: false;
|
|
1363
|
+
readonly internalType: "uint256";
|
|
1364
|
+
readonly name: "grossAmount";
|
|
1365
|
+
readonly type: "uint256";
|
|
1366
|
+
}, {
|
|
1367
|
+
readonly indexed: false;
|
|
1368
|
+
readonly internalType: "uint256";
|
|
1369
|
+
readonly name: "netAmount";
|
|
1370
|
+
readonly type: "uint256";
|
|
1371
|
+
}];
|
|
1372
|
+
readonly name: "Withdraw";
|
|
1373
|
+
readonly type: "event";
|
|
1374
|
+
}, {
|
|
1375
|
+
readonly inputs: readonly [];
|
|
1376
|
+
readonly name: "DEFAULT_ADMIN_ROLE";
|
|
1377
|
+
readonly outputs: readonly [{
|
|
1378
|
+
readonly internalType: "bytes32";
|
|
1379
|
+
readonly name: "";
|
|
1380
|
+
readonly type: "bytes32";
|
|
1381
|
+
}];
|
|
1382
|
+
readonly stateMutability: "view";
|
|
1383
|
+
readonly type: "function";
|
|
1384
|
+
}, {
|
|
1385
|
+
readonly inputs: readonly [];
|
|
1386
|
+
readonly name: "FEE_DIVISOR";
|
|
1387
|
+
readonly outputs: readonly [{
|
|
1388
|
+
readonly internalType: "uint256";
|
|
1389
|
+
readonly name: "";
|
|
1390
|
+
readonly type: "uint256";
|
|
1391
|
+
}];
|
|
1392
|
+
readonly stateMutability: "view";
|
|
1393
|
+
readonly type: "function";
|
|
1394
|
+
}, {
|
|
1395
|
+
readonly inputs: readonly [];
|
|
1396
|
+
readonly name: "MAX_FEE_UNITS";
|
|
1397
|
+
readonly outputs: readonly [{
|
|
1398
|
+
readonly internalType: "uint256";
|
|
1399
|
+
readonly name: "";
|
|
1400
|
+
readonly type: "uint256";
|
|
1401
|
+
}];
|
|
1402
|
+
readonly stateMutability: "view";
|
|
1403
|
+
readonly type: "function";
|
|
1404
|
+
}, {
|
|
1405
|
+
readonly inputs: readonly [];
|
|
1406
|
+
readonly name: "OPERATOR_ROLE";
|
|
1407
|
+
readonly outputs: readonly [{
|
|
1408
|
+
readonly internalType: "bytes32";
|
|
1409
|
+
readonly name: "";
|
|
1410
|
+
readonly type: "bytes32";
|
|
1411
|
+
}];
|
|
1412
|
+
readonly stateMutability: "view";
|
|
1413
|
+
readonly type: "function";
|
|
1414
|
+
}, {
|
|
1415
|
+
readonly inputs: readonly [];
|
|
1416
|
+
readonly name: "accumulatedCotiFees";
|
|
1417
|
+
readonly outputs: readonly [{
|
|
1418
|
+
readonly internalType: "uint256";
|
|
1419
|
+
readonly name: "";
|
|
1420
|
+
readonly type: "uint256";
|
|
1421
|
+
}];
|
|
1422
|
+
readonly stateMutability: "view";
|
|
1423
|
+
readonly type: "function";
|
|
1424
|
+
}, {
|
|
1425
|
+
readonly inputs: readonly [];
|
|
1426
|
+
readonly name: "accumulatedFees";
|
|
1427
|
+
readonly outputs: readonly [{
|
|
1428
|
+
readonly internalType: "uint256";
|
|
1429
|
+
readonly name: "";
|
|
1430
|
+
readonly type: "uint256";
|
|
1431
|
+
}];
|
|
1432
|
+
readonly stateMutability: "view";
|
|
1433
|
+
readonly type: "function";
|
|
1434
|
+
}, {
|
|
1435
|
+
readonly inputs: readonly [{
|
|
1436
|
+
readonly internalType: "address";
|
|
1437
|
+
readonly name: "account";
|
|
1438
|
+
readonly type: "address";
|
|
1439
|
+
}];
|
|
1440
|
+
readonly name: "addOperator";
|
|
1441
|
+
readonly outputs: readonly [];
|
|
1442
|
+
readonly stateMutability: "nonpayable";
|
|
1443
|
+
readonly type: "function";
|
|
1444
|
+
}, {
|
|
1445
|
+
readonly inputs: readonly [{
|
|
1446
|
+
readonly internalType: "address";
|
|
1447
|
+
readonly name: "account";
|
|
1448
|
+
readonly type: "address";
|
|
1449
|
+
}];
|
|
1450
|
+
readonly name: "addToBlacklist";
|
|
1451
|
+
readonly outputs: readonly [];
|
|
1452
|
+
readonly stateMutability: "nonpayable";
|
|
1453
|
+
readonly type: "function";
|
|
1454
|
+
}, {
|
|
1455
|
+
readonly inputs: readonly [{
|
|
1456
|
+
readonly internalType: "address";
|
|
1457
|
+
readonly name: "";
|
|
1458
|
+
readonly type: "address";
|
|
1459
|
+
}];
|
|
1460
|
+
readonly name: "blacklisted";
|
|
1461
|
+
readonly outputs: readonly [{
|
|
1462
|
+
readonly internalType: "bool";
|
|
1463
|
+
readonly name: "";
|
|
1464
|
+
readonly type: "bool";
|
|
1465
|
+
}];
|
|
1466
|
+
readonly stateMutability: "view";
|
|
1467
|
+
readonly type: "function";
|
|
1468
|
+
}, {
|
|
1469
|
+
readonly inputs: readonly [{
|
|
1470
|
+
readonly internalType: "uint256";
|
|
1471
|
+
readonly name: "cotiAmount";
|
|
1472
|
+
readonly type: "uint256";
|
|
1473
|
+
}, {
|
|
1474
|
+
readonly internalType: "uint256";
|
|
1475
|
+
readonly name: "fixedFee";
|
|
1476
|
+
readonly type: "uint256";
|
|
1477
|
+
}, {
|
|
1478
|
+
readonly internalType: "uint256";
|
|
1479
|
+
readonly name: "percentageBps";
|
|
1480
|
+
readonly type: "uint256";
|
|
1481
|
+
}, {
|
|
1482
|
+
readonly internalType: "uint256";
|
|
1483
|
+
readonly name: "maxFee";
|
|
1484
|
+
readonly type: "uint256";
|
|
1485
|
+
}];
|
|
1486
|
+
readonly name: "computeCotiFee";
|
|
1487
|
+
readonly outputs: readonly [{
|
|
1488
|
+
readonly internalType: "uint256";
|
|
1489
|
+
readonly name: "";
|
|
1490
|
+
readonly type: "uint256";
|
|
1491
|
+
}];
|
|
1492
|
+
readonly stateMutability: "view";
|
|
1493
|
+
readonly type: "function";
|
|
1494
|
+
}, {
|
|
1495
|
+
readonly inputs: readonly [{
|
|
1496
|
+
readonly internalType: "uint256";
|
|
1497
|
+
readonly name: "cotiOracleTimestamp";
|
|
1498
|
+
readonly type: "uint256";
|
|
1499
|
+
}, {
|
|
1500
|
+
readonly internalType: "uint256";
|
|
1501
|
+
readonly name: "tokenOracleTimestamp";
|
|
1502
|
+
readonly type: "uint256";
|
|
1503
|
+
}];
|
|
1504
|
+
readonly name: "deposit";
|
|
1505
|
+
readonly outputs: readonly [];
|
|
1506
|
+
readonly stateMutability: "payable";
|
|
1507
|
+
readonly type: "function";
|
|
1508
|
+
}, {
|
|
1509
|
+
readonly inputs: readonly [];
|
|
1510
|
+
readonly name: "depositFeeBasisPoints";
|
|
1511
|
+
readonly outputs: readonly [{
|
|
1512
|
+
readonly internalType: "uint256";
|
|
1513
|
+
readonly name: "";
|
|
1514
|
+
readonly type: "uint256";
|
|
1515
|
+
}];
|
|
1516
|
+
readonly stateMutability: "view";
|
|
1517
|
+
readonly type: "function";
|
|
1518
|
+
}, {
|
|
1519
|
+
readonly inputs: readonly [];
|
|
1520
|
+
readonly name: "depositFixedFee";
|
|
1521
|
+
readonly outputs: readonly [{
|
|
1522
|
+
readonly internalType: "uint256";
|
|
1523
|
+
readonly name: "";
|
|
1524
|
+
readonly type: "uint256";
|
|
1525
|
+
}];
|
|
1526
|
+
readonly stateMutability: "view";
|
|
1527
|
+
readonly type: "function";
|
|
1528
|
+
}, {
|
|
1529
|
+
readonly inputs: readonly [];
|
|
1530
|
+
readonly name: "depositMaxFee";
|
|
1531
|
+
readonly outputs: readonly [{
|
|
1532
|
+
readonly internalType: "uint256";
|
|
1533
|
+
readonly name: "";
|
|
1534
|
+
readonly type: "uint256";
|
|
1535
|
+
}];
|
|
1536
|
+
readonly stateMutability: "view";
|
|
1537
|
+
readonly type: "function";
|
|
1538
|
+
}, {
|
|
1539
|
+
readonly inputs: readonly [];
|
|
1540
|
+
readonly name: "depositPercentageBps";
|
|
1541
|
+
readonly outputs: readonly [{
|
|
1542
|
+
readonly internalType: "uint256";
|
|
1543
|
+
readonly name: "";
|
|
1544
|
+
readonly type: "uint256";
|
|
1545
|
+
}];
|
|
1546
|
+
readonly stateMutability: "view";
|
|
1547
|
+
readonly type: "function";
|
|
1548
|
+
}, {
|
|
1549
|
+
readonly inputs: readonly [{
|
|
1550
|
+
readonly internalType: "uint256";
|
|
1551
|
+
readonly name: "cotiAmount";
|
|
1552
|
+
readonly type: "uint256";
|
|
1553
|
+
}];
|
|
1554
|
+
readonly name: "estimateDepositFee";
|
|
1555
|
+
readonly outputs: readonly [{
|
|
1556
|
+
readonly internalType: "uint256";
|
|
1557
|
+
readonly name: "fee";
|
|
1558
|
+
readonly type: "uint256";
|
|
1559
|
+
}, {
|
|
1560
|
+
readonly internalType: "uint256";
|
|
1561
|
+
readonly name: "cotiLastUpdated";
|
|
1562
|
+
readonly type: "uint256";
|
|
1563
|
+
}, {
|
|
1564
|
+
readonly internalType: "uint256";
|
|
1565
|
+
readonly name: "blockTimestamp";
|
|
1566
|
+
readonly type: "uint256";
|
|
1567
|
+
}];
|
|
1568
|
+
readonly stateMutability: "view";
|
|
1569
|
+
readonly type: "function";
|
|
1570
|
+
}, {
|
|
1571
|
+
readonly inputs: readonly [{
|
|
1572
|
+
readonly internalType: "uint256";
|
|
1573
|
+
readonly name: "cotiAmount";
|
|
1574
|
+
readonly type: "uint256";
|
|
1575
|
+
}];
|
|
1576
|
+
readonly name: "estimateWithdrawFee";
|
|
1577
|
+
readonly outputs: readonly [{
|
|
1578
|
+
readonly internalType: "uint256";
|
|
1579
|
+
readonly name: "fee";
|
|
1580
|
+
readonly type: "uint256";
|
|
1581
|
+
}, {
|
|
1582
|
+
readonly internalType: "uint256";
|
|
1583
|
+
readonly name: "cotiLastUpdated";
|
|
1584
|
+
readonly type: "uint256";
|
|
1585
|
+
}, {
|
|
1586
|
+
readonly internalType: "uint256";
|
|
1587
|
+
readonly name: "blockTimestamp";
|
|
1588
|
+
readonly type: "uint256";
|
|
1589
|
+
}];
|
|
1590
|
+
readonly stateMutability: "view";
|
|
1591
|
+
readonly type: "function";
|
|
1592
|
+
}, {
|
|
1593
|
+
readonly inputs: readonly [];
|
|
1594
|
+
readonly name: "feeRecipient";
|
|
1595
|
+
readonly outputs: readonly [{
|
|
1596
|
+
readonly internalType: "address";
|
|
1597
|
+
readonly name: "";
|
|
1598
|
+
readonly type: "address";
|
|
1599
|
+
}];
|
|
1600
|
+
readonly stateMutability: "view";
|
|
1601
|
+
readonly type: "function";
|
|
1602
|
+
}, {
|
|
1603
|
+
readonly inputs: readonly [];
|
|
1604
|
+
readonly name: "getBridgeBalance";
|
|
1605
|
+
readonly outputs: readonly [{
|
|
1606
|
+
readonly internalType: "uint256";
|
|
1607
|
+
readonly name: "";
|
|
1608
|
+
readonly type: "uint256";
|
|
1609
|
+
}];
|
|
1610
|
+
readonly stateMutability: "view";
|
|
1611
|
+
readonly type: "function";
|
|
1612
|
+
}, {
|
|
1613
|
+
readonly inputs: readonly [{
|
|
1614
|
+
readonly internalType: "bytes32";
|
|
1615
|
+
readonly name: "role";
|
|
1616
|
+
readonly type: "bytes32";
|
|
1617
|
+
}];
|
|
1618
|
+
readonly name: "getRoleAdmin";
|
|
1619
|
+
readonly outputs: readonly [{
|
|
1620
|
+
readonly internalType: "bytes32";
|
|
1621
|
+
readonly name: "";
|
|
1622
|
+
readonly type: "bytes32";
|
|
1623
|
+
}];
|
|
1624
|
+
readonly stateMutability: "view";
|
|
1625
|
+
readonly type: "function";
|
|
1626
|
+
}, {
|
|
1627
|
+
readonly inputs: readonly [{
|
|
1628
|
+
readonly internalType: "bytes32";
|
|
1629
|
+
readonly name: "role";
|
|
1630
|
+
readonly type: "bytes32";
|
|
1631
|
+
}, {
|
|
1632
|
+
readonly internalType: "uint256";
|
|
1633
|
+
readonly name: "index";
|
|
1634
|
+
readonly type: "uint256";
|
|
1635
|
+
}];
|
|
1636
|
+
readonly name: "getRoleMember";
|
|
1637
|
+
readonly outputs: readonly [{
|
|
1638
|
+
readonly internalType: "address";
|
|
1639
|
+
readonly name: "";
|
|
1640
|
+
readonly type: "address";
|
|
1641
|
+
}];
|
|
1642
|
+
readonly stateMutability: "view";
|
|
1643
|
+
readonly type: "function";
|
|
1644
|
+
}, {
|
|
1645
|
+
readonly inputs: readonly [{
|
|
1646
|
+
readonly internalType: "bytes32";
|
|
1647
|
+
readonly name: "role";
|
|
1648
|
+
readonly type: "bytes32";
|
|
1649
|
+
}];
|
|
1650
|
+
readonly name: "getRoleMemberCount";
|
|
1651
|
+
readonly outputs: readonly [{
|
|
1652
|
+
readonly internalType: "uint256";
|
|
1653
|
+
readonly name: "";
|
|
1654
|
+
readonly type: "uint256";
|
|
1655
|
+
}];
|
|
1656
|
+
readonly stateMutability: "view";
|
|
1657
|
+
readonly type: "function";
|
|
1658
|
+
}, {
|
|
1659
|
+
readonly inputs: readonly [{
|
|
1660
|
+
readonly internalType: "bytes32";
|
|
1661
|
+
readonly name: "role";
|
|
1662
|
+
readonly type: "bytes32";
|
|
1663
|
+
}, {
|
|
1664
|
+
readonly internalType: "address";
|
|
1665
|
+
readonly name: "account";
|
|
1666
|
+
readonly type: "address";
|
|
1667
|
+
}];
|
|
1668
|
+
readonly name: "grantRole";
|
|
1669
|
+
readonly outputs: readonly [];
|
|
1670
|
+
readonly stateMutability: "nonpayable";
|
|
1671
|
+
readonly type: "function";
|
|
1672
|
+
}, {
|
|
1673
|
+
readonly inputs: readonly [{
|
|
1674
|
+
readonly internalType: "bytes32";
|
|
1675
|
+
readonly name: "role";
|
|
1676
|
+
readonly type: "bytes32";
|
|
1677
|
+
}, {
|
|
1678
|
+
readonly internalType: "address";
|
|
1679
|
+
readonly name: "account";
|
|
1680
|
+
readonly type: "address";
|
|
1681
|
+
}];
|
|
1682
|
+
readonly name: "hasRole";
|
|
1683
|
+
readonly outputs: readonly [{
|
|
1684
|
+
readonly internalType: "bool";
|
|
1685
|
+
readonly name: "";
|
|
1686
|
+
readonly type: "bool";
|
|
1687
|
+
}];
|
|
1688
|
+
readonly stateMutability: "view";
|
|
1689
|
+
readonly type: "function";
|
|
1690
|
+
}, {
|
|
1691
|
+
readonly inputs: readonly [];
|
|
1692
|
+
readonly name: "isDepositEnabled";
|
|
1693
|
+
readonly outputs: readonly [{
|
|
1694
|
+
readonly internalType: "bool";
|
|
1695
|
+
readonly name: "";
|
|
1696
|
+
readonly type: "bool";
|
|
1697
|
+
}];
|
|
1698
|
+
readonly stateMutability: "view";
|
|
1699
|
+
readonly type: "function";
|
|
1700
|
+
}, {
|
|
1701
|
+
readonly inputs: readonly [{
|
|
1702
|
+
readonly internalType: "address";
|
|
1703
|
+
readonly name: "account";
|
|
1704
|
+
readonly type: "address";
|
|
1705
|
+
}];
|
|
1706
|
+
readonly name: "isOperator";
|
|
1707
|
+
readonly outputs: readonly [{
|
|
1708
|
+
readonly internalType: "bool";
|
|
1709
|
+
readonly name: "";
|
|
1710
|
+
readonly type: "bool";
|
|
1711
|
+
}];
|
|
1712
|
+
readonly stateMutability: "view";
|
|
1713
|
+
readonly type: "function";
|
|
1714
|
+
}, {
|
|
1715
|
+
readonly inputs: readonly [];
|
|
1716
|
+
readonly name: "maxDepositAmount";
|
|
1717
|
+
readonly outputs: readonly [{
|
|
1718
|
+
readonly internalType: "uint256";
|
|
1719
|
+
readonly name: "";
|
|
1720
|
+
readonly type: "uint256";
|
|
1721
|
+
}];
|
|
1722
|
+
readonly stateMutability: "view";
|
|
1723
|
+
readonly type: "function";
|
|
1724
|
+
}, {
|
|
1725
|
+
readonly inputs: readonly [];
|
|
1726
|
+
readonly name: "maxWithdrawAmount";
|
|
1727
|
+
readonly outputs: readonly [{
|
|
1728
|
+
readonly internalType: "uint256";
|
|
1729
|
+
readonly name: "";
|
|
1730
|
+
readonly type: "uint256";
|
|
1731
|
+
}];
|
|
1732
|
+
readonly stateMutability: "view";
|
|
1733
|
+
readonly type: "function";
|
|
1734
|
+
}, {
|
|
1735
|
+
readonly inputs: readonly [];
|
|
1736
|
+
readonly name: "minDepositAmount";
|
|
1737
|
+
readonly outputs: readonly [{
|
|
1738
|
+
readonly internalType: "uint256";
|
|
1739
|
+
readonly name: "";
|
|
1740
|
+
readonly type: "uint256";
|
|
1741
|
+
}];
|
|
1742
|
+
readonly stateMutability: "view";
|
|
1743
|
+
readonly type: "function";
|
|
1744
|
+
}, {
|
|
1745
|
+
readonly inputs: readonly [];
|
|
1746
|
+
readonly name: "minWithdrawAmount";
|
|
1747
|
+
readonly outputs: readonly [{
|
|
1748
|
+
readonly internalType: "uint256";
|
|
1749
|
+
readonly name: "";
|
|
1750
|
+
readonly type: "uint256";
|
|
1751
|
+
}];
|
|
1752
|
+
readonly stateMutability: "view";
|
|
1753
|
+
readonly type: "function";
|
|
1754
|
+
}, {
|
|
1755
|
+
readonly inputs: readonly [];
|
|
1756
|
+
readonly name: "nativeCotiFee";
|
|
1757
|
+
readonly outputs: readonly [{
|
|
1758
|
+
readonly internalType: "uint256";
|
|
1759
|
+
readonly name: "";
|
|
1760
|
+
readonly type: "uint256";
|
|
1761
|
+
}];
|
|
1762
|
+
readonly stateMutability: "view";
|
|
1763
|
+
readonly type: "function";
|
|
1764
|
+
}, {
|
|
1765
|
+
readonly inputs: readonly [];
|
|
1766
|
+
readonly name: "owner";
|
|
1767
|
+
readonly outputs: readonly [{
|
|
1768
|
+
readonly internalType: "address";
|
|
1769
|
+
readonly name: "";
|
|
1770
|
+
readonly type: "address";
|
|
1771
|
+
}];
|
|
1772
|
+
readonly stateMutability: "view";
|
|
1773
|
+
readonly type: "function";
|
|
1774
|
+
}, {
|
|
1775
|
+
readonly inputs: readonly [];
|
|
1776
|
+
readonly name: "pause";
|
|
1777
|
+
readonly outputs: readonly [];
|
|
1778
|
+
readonly stateMutability: "nonpayable";
|
|
1779
|
+
readonly type: "function";
|
|
1780
|
+
}, {
|
|
1781
|
+
readonly inputs: readonly [];
|
|
1782
|
+
readonly name: "paused";
|
|
1783
|
+
readonly outputs: readonly [{
|
|
1784
|
+
readonly internalType: "bool";
|
|
1785
|
+
readonly name: "";
|
|
1786
|
+
readonly type: "bool";
|
|
1787
|
+
}];
|
|
1788
|
+
readonly stateMutability: "view";
|
|
1789
|
+
readonly type: "function";
|
|
1790
|
+
}, {
|
|
1791
|
+
readonly inputs: readonly [];
|
|
1792
|
+
readonly name: "priceOracle";
|
|
1793
|
+
readonly outputs: readonly [{
|
|
1794
|
+
readonly internalType: "address";
|
|
1795
|
+
readonly name: "";
|
|
1796
|
+
readonly type: "address";
|
|
1797
|
+
}];
|
|
1798
|
+
readonly stateMutability: "view";
|
|
1799
|
+
readonly type: "function";
|
|
1800
|
+
}, {
|
|
1801
|
+
readonly inputs: readonly [];
|
|
1802
|
+
readonly name: "privateCoti";
|
|
1803
|
+
readonly outputs: readonly [{
|
|
1804
|
+
readonly internalType: "contract PrivateCOTI";
|
|
1805
|
+
readonly name: "";
|
|
1806
|
+
readonly type: "address";
|
|
1807
|
+
}];
|
|
1808
|
+
readonly stateMutability: "view";
|
|
1809
|
+
readonly type: "function";
|
|
1810
|
+
}, {
|
|
1811
|
+
readonly inputs: readonly [{
|
|
1812
|
+
readonly internalType: "address";
|
|
1813
|
+
readonly name: "account";
|
|
1814
|
+
readonly type: "address";
|
|
1815
|
+
}];
|
|
1816
|
+
readonly name: "removeFromBlacklist";
|
|
1817
|
+
readonly outputs: readonly [];
|
|
1818
|
+
readonly stateMutability: "nonpayable";
|
|
1819
|
+
readonly type: "function";
|
|
1820
|
+
}, {
|
|
1821
|
+
readonly inputs: readonly [{
|
|
1822
|
+
readonly internalType: "address";
|
|
1823
|
+
readonly name: "account";
|
|
1824
|
+
readonly type: "address";
|
|
1825
|
+
}];
|
|
1826
|
+
readonly name: "removeOperator";
|
|
1827
|
+
readonly outputs: readonly [];
|
|
1828
|
+
readonly stateMutability: "nonpayable";
|
|
1829
|
+
readonly type: "function";
|
|
1830
|
+
}, {
|
|
1831
|
+
readonly inputs: readonly [];
|
|
1832
|
+
readonly name: "renounceOwnership";
|
|
1833
|
+
readonly outputs: readonly [];
|
|
1834
|
+
readonly stateMutability: "nonpayable";
|
|
1835
|
+
readonly type: "function";
|
|
1836
|
+
}, {
|
|
1837
|
+
readonly inputs: readonly [{
|
|
1838
|
+
readonly internalType: "bytes32";
|
|
1839
|
+
readonly name: "role";
|
|
1840
|
+
readonly type: "bytes32";
|
|
1841
|
+
}, {
|
|
1842
|
+
readonly internalType: "address";
|
|
1843
|
+
readonly name: "account";
|
|
1844
|
+
readonly type: "address";
|
|
1845
|
+
}];
|
|
1846
|
+
readonly name: "renounceRole";
|
|
1847
|
+
readonly outputs: readonly [];
|
|
1848
|
+
readonly stateMutability: "nonpayable";
|
|
1849
|
+
readonly type: "function";
|
|
1850
|
+
}, {
|
|
1851
|
+
readonly inputs: readonly [{
|
|
1852
|
+
readonly internalType: "uint256";
|
|
1853
|
+
readonly name: "amount";
|
|
1854
|
+
readonly type: "uint256";
|
|
1855
|
+
}];
|
|
1856
|
+
readonly name: "rescueNative";
|
|
1857
|
+
readonly outputs: readonly [];
|
|
1858
|
+
readonly stateMutability: "nonpayable";
|
|
1859
|
+
readonly type: "function";
|
|
1860
|
+
}, {
|
|
1861
|
+
readonly inputs: readonly [];
|
|
1862
|
+
readonly name: "rescueRecipient";
|
|
1863
|
+
readonly outputs: readonly [{
|
|
1864
|
+
readonly internalType: "address";
|
|
1865
|
+
readonly name: "";
|
|
1866
|
+
readonly type: "address";
|
|
1867
|
+
}];
|
|
1868
|
+
readonly stateMutability: "view";
|
|
1869
|
+
readonly type: "function";
|
|
1870
|
+
}, {
|
|
1871
|
+
readonly inputs: readonly [{
|
|
1872
|
+
readonly internalType: "bytes32";
|
|
1873
|
+
readonly name: "role";
|
|
1874
|
+
readonly type: "bytes32";
|
|
1875
|
+
}, {
|
|
1876
|
+
readonly internalType: "address";
|
|
1877
|
+
readonly name: "account";
|
|
1878
|
+
readonly type: "address";
|
|
1879
|
+
}];
|
|
1880
|
+
readonly name: "revokeRole";
|
|
1881
|
+
readonly outputs: readonly [];
|
|
1882
|
+
readonly stateMutability: "nonpayable";
|
|
1883
|
+
readonly type: "function";
|
|
1884
|
+
}, {
|
|
1885
|
+
readonly inputs: readonly [{
|
|
1886
|
+
readonly internalType: "uint256";
|
|
1887
|
+
readonly name: "_fixedFee";
|
|
1888
|
+
readonly type: "uint256";
|
|
1889
|
+
}, {
|
|
1890
|
+
readonly internalType: "uint256";
|
|
1891
|
+
readonly name: "_percentageBps";
|
|
1892
|
+
readonly type: "uint256";
|
|
1893
|
+
}, {
|
|
1894
|
+
readonly internalType: "uint256";
|
|
1895
|
+
readonly name: "_maxFee";
|
|
1896
|
+
readonly type: "uint256";
|
|
1897
|
+
}];
|
|
1898
|
+
readonly name: "setDepositDynamicFee";
|
|
1899
|
+
readonly outputs: readonly [];
|
|
1900
|
+
readonly stateMutability: "nonpayable";
|
|
1901
|
+
readonly type: "function";
|
|
1902
|
+
}, {
|
|
1903
|
+
readonly inputs: readonly [{
|
|
1904
|
+
readonly internalType: "uint256";
|
|
1905
|
+
readonly name: "_feeBasisPoints";
|
|
1906
|
+
readonly type: "uint256";
|
|
1907
|
+
}];
|
|
1908
|
+
readonly name: "setDepositFee";
|
|
1909
|
+
readonly outputs: readonly [];
|
|
1910
|
+
readonly stateMutability: "nonpayable";
|
|
1911
|
+
readonly type: "function";
|
|
1912
|
+
}, {
|
|
1913
|
+
readonly inputs: readonly [{
|
|
1914
|
+
readonly internalType: "bool";
|
|
1915
|
+
readonly name: "_enabled";
|
|
1916
|
+
readonly type: "bool";
|
|
1917
|
+
}];
|
|
1918
|
+
readonly name: "setIsDepositEnabled";
|
|
1919
|
+
readonly outputs: readonly [];
|
|
1920
|
+
readonly stateMutability: "nonpayable";
|
|
1921
|
+
readonly type: "function";
|
|
1922
|
+
}, {
|
|
1923
|
+
readonly inputs: readonly [{
|
|
1924
|
+
readonly internalType: "uint256";
|
|
1925
|
+
readonly name: "_minDeposit";
|
|
1926
|
+
readonly type: "uint256";
|
|
1927
|
+
}, {
|
|
1928
|
+
readonly internalType: "uint256";
|
|
1929
|
+
readonly name: "_maxDeposit";
|
|
1930
|
+
readonly type: "uint256";
|
|
1931
|
+
}, {
|
|
1932
|
+
readonly internalType: "uint256";
|
|
1933
|
+
readonly name: "_minWithdraw";
|
|
1934
|
+
readonly type: "uint256";
|
|
1935
|
+
}, {
|
|
1936
|
+
readonly internalType: "uint256";
|
|
1937
|
+
readonly name: "_maxWithdraw";
|
|
1938
|
+
readonly type: "uint256";
|
|
1939
|
+
}];
|
|
1940
|
+
readonly name: "setLimits";
|
|
1941
|
+
readonly outputs: readonly [];
|
|
1942
|
+
readonly stateMutability: "nonpayable";
|
|
1943
|
+
readonly type: "function";
|
|
1944
|
+
}, {
|
|
1945
|
+
readonly inputs: readonly [{
|
|
1946
|
+
readonly internalType: "uint256";
|
|
1947
|
+
readonly name: "";
|
|
1948
|
+
readonly type: "uint256";
|
|
1949
|
+
}];
|
|
1950
|
+
readonly name: "setNativeCotiFee";
|
|
1951
|
+
readonly outputs: readonly [];
|
|
1952
|
+
readonly stateMutability: "pure";
|
|
1953
|
+
readonly type: "function";
|
|
1954
|
+
}, {
|
|
1955
|
+
readonly inputs: readonly [{
|
|
1956
|
+
readonly internalType: "address";
|
|
1957
|
+
readonly name: "_oracle";
|
|
1958
|
+
readonly type: "address";
|
|
1959
|
+
}];
|
|
1960
|
+
readonly name: "setPriceOracle";
|
|
1961
|
+
readonly outputs: readonly [];
|
|
1962
|
+
readonly stateMutability: "nonpayable";
|
|
1963
|
+
readonly type: "function";
|
|
1964
|
+
}, {
|
|
1965
|
+
readonly inputs: readonly [{
|
|
1966
|
+
readonly internalType: "uint256";
|
|
1967
|
+
readonly name: "_fixedFee";
|
|
1968
|
+
readonly type: "uint256";
|
|
1969
|
+
}, {
|
|
1970
|
+
readonly internalType: "uint256";
|
|
1971
|
+
readonly name: "_percentageBps";
|
|
1972
|
+
readonly type: "uint256";
|
|
1973
|
+
}, {
|
|
1974
|
+
readonly internalType: "uint256";
|
|
1975
|
+
readonly name: "_maxFee";
|
|
1976
|
+
readonly type: "uint256";
|
|
1977
|
+
}];
|
|
1978
|
+
readonly name: "setWithdrawDynamicFee";
|
|
1979
|
+
readonly outputs: readonly [];
|
|
1980
|
+
readonly stateMutability: "nonpayable";
|
|
1981
|
+
readonly type: "function";
|
|
1982
|
+
}, {
|
|
1983
|
+
readonly inputs: readonly [{
|
|
1984
|
+
readonly internalType: "uint256";
|
|
1985
|
+
readonly name: "_feeBasisPoints";
|
|
1986
|
+
readonly type: "uint256";
|
|
1987
|
+
}];
|
|
1988
|
+
readonly name: "setWithdrawFee";
|
|
1989
|
+
readonly outputs: readonly [];
|
|
1990
|
+
readonly stateMutability: "nonpayable";
|
|
1991
|
+
readonly type: "function";
|
|
1992
|
+
}, {
|
|
1993
|
+
readonly inputs: readonly [{
|
|
1994
|
+
readonly internalType: "bytes4";
|
|
1995
|
+
readonly name: "interfaceId";
|
|
1996
|
+
readonly type: "bytes4";
|
|
1997
|
+
}];
|
|
1998
|
+
readonly name: "supportsInterface";
|
|
1999
|
+
readonly outputs: readonly [{
|
|
2000
|
+
readonly internalType: "bool";
|
|
2001
|
+
readonly name: "";
|
|
2002
|
+
readonly type: "bool";
|
|
2003
|
+
}];
|
|
2004
|
+
readonly stateMutability: "view";
|
|
2005
|
+
readonly type: "function";
|
|
2006
|
+
}, {
|
|
2007
|
+
readonly inputs: readonly [];
|
|
2008
|
+
readonly name: "totalUserLiability";
|
|
2009
|
+
readonly outputs: readonly [{
|
|
2010
|
+
readonly internalType: "uint256";
|
|
2011
|
+
readonly name: "";
|
|
2012
|
+
readonly type: "uint256";
|
|
2013
|
+
}];
|
|
2014
|
+
readonly stateMutability: "view";
|
|
2015
|
+
readonly type: "function";
|
|
2016
|
+
}, {
|
|
2017
|
+
readonly inputs: readonly [{
|
|
2018
|
+
readonly internalType: "address";
|
|
2019
|
+
readonly name: "newOwner";
|
|
2020
|
+
readonly type: "address";
|
|
2021
|
+
}];
|
|
2022
|
+
readonly name: "transferOwnership";
|
|
2023
|
+
readonly outputs: readonly [];
|
|
2024
|
+
readonly stateMutability: "nonpayable";
|
|
2025
|
+
readonly type: "function";
|
|
2026
|
+
}, {
|
|
2027
|
+
readonly inputs: readonly [];
|
|
2028
|
+
readonly name: "unpause";
|
|
2029
|
+
readonly outputs: readonly [];
|
|
2030
|
+
readonly stateMutability: "nonpayable";
|
|
2031
|
+
readonly type: "function";
|
|
2032
|
+
}, {
|
|
2033
|
+
readonly inputs: readonly [{
|
|
2034
|
+
readonly internalType: "uint256";
|
|
2035
|
+
readonly name: "amount";
|
|
2036
|
+
readonly type: "uint256";
|
|
2037
|
+
}, {
|
|
2038
|
+
readonly internalType: "uint256";
|
|
2039
|
+
readonly name: "cotiOracleTimestamp";
|
|
2040
|
+
readonly type: "uint256";
|
|
2041
|
+
}, {
|
|
2042
|
+
readonly internalType: "uint256";
|
|
2043
|
+
readonly name: "tokenOracleTimestamp";
|
|
2044
|
+
readonly type: "uint256";
|
|
2045
|
+
}];
|
|
2046
|
+
readonly name: "withdraw";
|
|
2047
|
+
readonly outputs: readonly [];
|
|
2048
|
+
readonly stateMutability: "nonpayable";
|
|
2049
|
+
readonly type: "function";
|
|
2050
|
+
}, {
|
|
2051
|
+
readonly inputs: readonly [{
|
|
2052
|
+
readonly internalType: "uint256";
|
|
2053
|
+
readonly name: "amount";
|
|
2054
|
+
readonly type: "uint256";
|
|
2055
|
+
}];
|
|
2056
|
+
readonly name: "withdrawCotiFees";
|
|
2057
|
+
readonly outputs: readonly [];
|
|
2058
|
+
readonly stateMutability: "nonpayable";
|
|
2059
|
+
readonly type: "function";
|
|
2060
|
+
}, {
|
|
2061
|
+
readonly inputs: readonly [];
|
|
2062
|
+
readonly name: "withdrawFeeBasisPoints";
|
|
2063
|
+
readonly outputs: readonly [{
|
|
2064
|
+
readonly internalType: "uint256";
|
|
2065
|
+
readonly name: "";
|
|
2066
|
+
readonly type: "uint256";
|
|
2067
|
+
}];
|
|
2068
|
+
readonly stateMutability: "view";
|
|
2069
|
+
readonly type: "function";
|
|
2070
|
+
}, {
|
|
2071
|
+
readonly inputs: readonly [{
|
|
2072
|
+
readonly internalType: "uint256";
|
|
2073
|
+
readonly name: "amount";
|
|
2074
|
+
readonly type: "uint256";
|
|
2075
|
+
}];
|
|
2076
|
+
readonly name: "withdrawFees";
|
|
2077
|
+
readonly outputs: readonly [];
|
|
2078
|
+
readonly stateMutability: "nonpayable";
|
|
2079
|
+
readonly type: "function";
|
|
2080
|
+
}, {
|
|
2081
|
+
readonly inputs: readonly [];
|
|
2082
|
+
readonly name: "withdrawFixedFee";
|
|
2083
|
+
readonly outputs: readonly [{
|
|
2084
|
+
readonly internalType: "uint256";
|
|
2085
|
+
readonly name: "";
|
|
2086
|
+
readonly type: "uint256";
|
|
2087
|
+
}];
|
|
2088
|
+
readonly stateMutability: "view";
|
|
2089
|
+
readonly type: "function";
|
|
2090
|
+
}, {
|
|
2091
|
+
readonly inputs: readonly [];
|
|
2092
|
+
readonly name: "withdrawMaxFee";
|
|
2093
|
+
readonly outputs: readonly [{
|
|
2094
|
+
readonly internalType: "uint256";
|
|
2095
|
+
readonly name: "";
|
|
2096
|
+
readonly type: "uint256";
|
|
2097
|
+
}];
|
|
2098
|
+
readonly stateMutability: "view";
|
|
2099
|
+
readonly type: "function";
|
|
2100
|
+
}, {
|
|
2101
|
+
readonly inputs: readonly [];
|
|
2102
|
+
readonly name: "withdrawPercentageBps";
|
|
2103
|
+
readonly outputs: readonly [{
|
|
2104
|
+
readonly internalType: "uint256";
|
|
2105
|
+
readonly name: "";
|
|
2106
|
+
readonly type: "uint256";
|
|
2107
|
+
}];
|
|
2108
|
+
readonly stateMutability: "view";
|
|
2109
|
+
readonly type: "function";
|
|
2110
|
+
}, {
|
|
2111
|
+
readonly stateMutability: "payable";
|
|
2112
|
+
readonly type: "receive";
|
|
2113
|
+
}];
|
|
2114
|
+
declare const BRIDGE_ERC20_ABI: readonly [{
|
|
2115
|
+
readonly inputs: readonly [{
|
|
2116
|
+
readonly internalType: "address";
|
|
2117
|
+
readonly name: "_weth";
|
|
2118
|
+
readonly type: "address";
|
|
2119
|
+
}, {
|
|
2120
|
+
readonly internalType: "address";
|
|
2121
|
+
readonly name: "_privateWeth";
|
|
2122
|
+
readonly type: "address";
|
|
2123
|
+
}, {
|
|
2124
|
+
readonly internalType: "address";
|
|
2125
|
+
readonly name: "_feeRecipient";
|
|
2126
|
+
readonly type: "address";
|
|
2127
|
+
}, {
|
|
2128
|
+
readonly internalType: "address";
|
|
2129
|
+
readonly name: "_rescueRecipient";
|
|
2130
|
+
readonly type: "address";
|
|
2131
|
+
}];
|
|
2132
|
+
readonly stateMutability: "nonpayable";
|
|
2133
|
+
readonly type: "constructor";
|
|
2134
|
+
}, {
|
|
2135
|
+
readonly inputs: readonly [{
|
|
2136
|
+
readonly internalType: "address";
|
|
2137
|
+
readonly name: "account";
|
|
2138
|
+
readonly type: "address";
|
|
2139
|
+
}];
|
|
2140
|
+
readonly name: "AddressBlacklisted";
|
|
2141
|
+
readonly type: "error";
|
|
2142
|
+
}, {
|
|
2143
|
+
readonly inputs: readonly [];
|
|
2144
|
+
readonly name: "AmountTooLarge";
|
|
2145
|
+
readonly type: "error";
|
|
2146
|
+
}, {
|
|
2147
|
+
readonly inputs: readonly [];
|
|
2148
|
+
readonly name: "AmountTooSmall";
|
|
2149
|
+
readonly type: "error";
|
|
2150
|
+
}, {
|
|
2151
|
+
readonly inputs: readonly [];
|
|
2152
|
+
readonly name: "AmountZero";
|
|
2153
|
+
readonly type: "error";
|
|
2154
|
+
}, {
|
|
2155
|
+
readonly inputs: readonly [];
|
|
2156
|
+
readonly name: "BridgePaused";
|
|
2157
|
+
readonly type: "error";
|
|
2158
|
+
}, {
|
|
2159
|
+
readonly inputs: readonly [];
|
|
2160
|
+
readonly name: "CannotRescueBridgeToken";
|
|
2161
|
+
readonly type: "error";
|
|
2162
|
+
}, {
|
|
2163
|
+
readonly inputs: readonly [];
|
|
2164
|
+
readonly name: "DecimalsMismatch";
|
|
2165
|
+
readonly type: "error";
|
|
2166
|
+
}, {
|
|
2167
|
+
readonly inputs: readonly [];
|
|
2168
|
+
readonly name: "DepositBelowMinimum";
|
|
2169
|
+
readonly type: "error";
|
|
2170
|
+
}, {
|
|
2171
|
+
readonly inputs: readonly [];
|
|
2172
|
+
readonly name: "DepositDisabled";
|
|
2173
|
+
readonly type: "error";
|
|
2174
|
+
}, {
|
|
2175
|
+
readonly inputs: readonly [];
|
|
2176
|
+
readonly name: "DepositExceedsMaximum";
|
|
2177
|
+
readonly type: "error";
|
|
2178
|
+
}, {
|
|
2179
|
+
readonly inputs: readonly [];
|
|
2180
|
+
readonly name: "EthTransferFailed";
|
|
2181
|
+
readonly type: "error";
|
|
2182
|
+
}, {
|
|
2183
|
+
readonly inputs: readonly [];
|
|
2184
|
+
readonly name: "FeeRecipientNotSet";
|
|
2185
|
+
readonly type: "error";
|
|
2186
|
+
}, {
|
|
2187
|
+
readonly inputs: readonly [];
|
|
2188
|
+
readonly name: "InsufficientAccumulatedFees";
|
|
2189
|
+
readonly type: "error";
|
|
2190
|
+
}, {
|
|
2191
|
+
readonly inputs: readonly [];
|
|
2192
|
+
readonly name: "InsufficientBridgeLiquidity";
|
|
2193
|
+
readonly type: "error";
|
|
2194
|
+
}, {
|
|
2195
|
+
readonly inputs: readonly [];
|
|
2196
|
+
readonly name: "InsufficientCotiFee";
|
|
2197
|
+
readonly type: "error";
|
|
2198
|
+
}, {
|
|
2199
|
+
readonly inputs: readonly [];
|
|
2200
|
+
readonly name: "InsufficientEthBalance";
|
|
2201
|
+
readonly type: "error";
|
|
2202
|
+
}, {
|
|
2203
|
+
readonly inputs: readonly [];
|
|
2204
|
+
readonly name: "InvalidAddress";
|
|
2205
|
+
readonly type: "error";
|
|
2206
|
+
}, {
|
|
2207
|
+
readonly inputs: readonly [];
|
|
2208
|
+
readonly name: "InvalidFee";
|
|
2209
|
+
readonly type: "error";
|
|
2210
|
+
}, {
|
|
2211
|
+
readonly inputs: readonly [];
|
|
2212
|
+
readonly name: "InvalidFeeConfiguration";
|
|
2213
|
+
readonly type: "error";
|
|
2214
|
+
}, {
|
|
2215
|
+
readonly inputs: readonly [];
|
|
2216
|
+
readonly name: "InvalidLimitConfiguration";
|
|
2217
|
+
readonly type: "error";
|
|
2218
|
+
}, {
|
|
2219
|
+
readonly inputs: readonly [];
|
|
2220
|
+
readonly name: "InvalidPrivateTokenAddress";
|
|
2221
|
+
readonly type: "error";
|
|
2222
|
+
}, {
|
|
2223
|
+
readonly inputs: readonly [];
|
|
2224
|
+
readonly name: "InvalidScalingFactor";
|
|
2225
|
+
readonly type: "error";
|
|
2226
|
+
}, {
|
|
2227
|
+
readonly inputs: readonly [];
|
|
2228
|
+
readonly name: "InvalidTokenAddress";
|
|
2229
|
+
readonly type: "error";
|
|
2230
|
+
}, {
|
|
2231
|
+
readonly inputs: readonly [];
|
|
2232
|
+
readonly name: "InvalidTokenSender";
|
|
2233
|
+
readonly type: "error";
|
|
2234
|
+
}, {
|
|
2235
|
+
readonly inputs: readonly [];
|
|
2236
|
+
readonly name: "NativeFeeRequiredForTransferAndCallWithdraw";
|
|
2237
|
+
readonly type: "error";
|
|
2238
|
+
}, {
|
|
2239
|
+
readonly inputs: readonly [{
|
|
2240
|
+
readonly internalType: "uint256";
|
|
2241
|
+
readonly name: "expected";
|
|
2242
|
+
readonly type: "uint256";
|
|
2243
|
+
}, {
|
|
2244
|
+
readonly internalType: "uint256";
|
|
2245
|
+
readonly name: "actual";
|
|
2246
|
+
readonly type: "uint256";
|
|
2247
|
+
}];
|
|
2248
|
+
readonly name: "OracleTimestampMismatch";
|
|
2249
|
+
readonly type: "error";
|
|
2250
|
+
}, {
|
|
2251
|
+
readonly inputs: readonly [];
|
|
2252
|
+
readonly name: "TokenTransferFailed";
|
|
2253
|
+
readonly type: "error";
|
|
2254
|
+
}, {
|
|
2255
|
+
readonly inputs: readonly [];
|
|
2256
|
+
readonly name: "WithdrawBelowMinimum";
|
|
2257
|
+
readonly type: "error";
|
|
2258
|
+
}, {
|
|
2259
|
+
readonly inputs: readonly [];
|
|
2260
|
+
readonly name: "WithdrawExceedsMaximum";
|
|
2261
|
+
readonly type: "error";
|
|
2262
|
+
}, {
|
|
2263
|
+
readonly inputs: readonly [];
|
|
2264
|
+
readonly name: "WithdrawFeesMustBeOverridden";
|
|
2265
|
+
readonly type: "error";
|
|
2266
|
+
}, {
|
|
2267
|
+
readonly anonymous: false;
|
|
2268
|
+
readonly inputs: readonly [{
|
|
2269
|
+
readonly indexed: true;
|
|
2270
|
+
readonly internalType: "address";
|
|
2271
|
+
readonly name: "account";
|
|
2272
|
+
readonly type: "address";
|
|
2273
|
+
}, {
|
|
2274
|
+
readonly indexed: true;
|
|
2275
|
+
readonly internalType: "address";
|
|
2276
|
+
readonly name: "by";
|
|
2277
|
+
readonly type: "address";
|
|
2278
|
+
}];
|
|
2279
|
+
readonly name: "Blacklisted";
|
|
2280
|
+
readonly type: "event";
|
|
2281
|
+
}, {
|
|
2282
|
+
readonly anonymous: false;
|
|
2283
|
+
readonly inputs: readonly [{
|
|
2284
|
+
readonly indexed: true;
|
|
2285
|
+
readonly internalType: "address";
|
|
2286
|
+
readonly name: "to";
|
|
2287
|
+
readonly type: "address";
|
|
2288
|
+
}, {
|
|
2289
|
+
readonly indexed: false;
|
|
2290
|
+
readonly internalType: "uint256";
|
|
2291
|
+
readonly name: "amount";
|
|
2292
|
+
readonly type: "uint256";
|
|
2293
|
+
}];
|
|
2294
|
+
readonly name: "CotiFeesWithdrawn";
|
|
2295
|
+
readonly type: "event";
|
|
2296
|
+
}, {
|
|
2297
|
+
readonly anonymous: false;
|
|
2298
|
+
readonly inputs: readonly [{
|
|
2299
|
+
readonly indexed: true;
|
|
2300
|
+
readonly internalType: "address";
|
|
2301
|
+
readonly name: "user";
|
|
2302
|
+
readonly type: "address";
|
|
2303
|
+
}, {
|
|
2304
|
+
readonly indexed: false;
|
|
2305
|
+
readonly internalType: "uint256";
|
|
2306
|
+
readonly name: "grossAmount";
|
|
2307
|
+
readonly type: "uint256";
|
|
2308
|
+
}, {
|
|
2309
|
+
readonly indexed: false;
|
|
2310
|
+
readonly internalType: "uint256";
|
|
2311
|
+
readonly name: "netAmount";
|
|
2312
|
+
readonly type: "uint256";
|
|
2313
|
+
}];
|
|
2314
|
+
readonly name: "Deposit";
|
|
2315
|
+
readonly type: "event";
|
|
2316
|
+
}, {
|
|
2317
|
+
readonly anonymous: false;
|
|
2318
|
+
readonly inputs: readonly [{
|
|
2319
|
+
readonly indexed: false;
|
|
2320
|
+
readonly internalType: "bool";
|
|
2321
|
+
readonly name: "enabled";
|
|
2322
|
+
readonly type: "bool";
|
|
2323
|
+
}, {
|
|
2324
|
+
readonly indexed: true;
|
|
2325
|
+
readonly internalType: "address";
|
|
2326
|
+
readonly name: "by";
|
|
2327
|
+
readonly type: "address";
|
|
2328
|
+
}];
|
|
2329
|
+
readonly name: "DepositEnabledUpdated";
|
|
2330
|
+
readonly type: "event";
|
|
2331
|
+
}, {
|
|
2332
|
+
readonly anonymous: false;
|
|
2333
|
+
readonly inputs: readonly [{
|
|
2334
|
+
readonly indexed: false;
|
|
2335
|
+
readonly internalType: "string";
|
|
2336
|
+
readonly name: "feeType";
|
|
2337
|
+
readonly type: "string";
|
|
2338
|
+
}, {
|
|
2339
|
+
readonly indexed: false;
|
|
2340
|
+
readonly internalType: "uint256";
|
|
2341
|
+
readonly name: "fixedFee";
|
|
2342
|
+
readonly type: "uint256";
|
|
2343
|
+
}, {
|
|
2344
|
+
readonly indexed: false;
|
|
2345
|
+
readonly internalType: "uint256";
|
|
2346
|
+
readonly name: "percentageBps";
|
|
2347
|
+
readonly type: "uint256";
|
|
2348
|
+
}, {
|
|
2349
|
+
readonly indexed: false;
|
|
2350
|
+
readonly internalType: "uint256";
|
|
2351
|
+
readonly name: "maxFee";
|
|
2352
|
+
readonly type: "uint256";
|
|
2353
|
+
}];
|
|
2354
|
+
readonly name: "DynamicFeeUpdated";
|
|
2355
|
+
readonly type: "event";
|
|
2356
|
+
}, {
|
|
2357
|
+
readonly anonymous: false;
|
|
2358
|
+
readonly inputs: readonly [{
|
|
2359
|
+
readonly indexed: true;
|
|
2360
|
+
readonly internalType: "address";
|
|
2361
|
+
readonly name: "token";
|
|
2362
|
+
readonly type: "address";
|
|
2363
|
+
}, {
|
|
2364
|
+
readonly indexed: true;
|
|
2365
|
+
readonly internalType: "address";
|
|
2366
|
+
readonly name: "to";
|
|
2367
|
+
readonly type: "address";
|
|
2368
|
+
}, {
|
|
2369
|
+
readonly indexed: false;
|
|
2370
|
+
readonly internalType: "uint256";
|
|
2371
|
+
readonly name: "amount";
|
|
2372
|
+
readonly type: "uint256";
|
|
2373
|
+
}];
|
|
2374
|
+
readonly name: "ERC20Rescued";
|
|
2375
|
+
readonly type: "event";
|
|
2376
|
+
}, {
|
|
2377
|
+
readonly anonymous: false;
|
|
2378
|
+
readonly inputs: readonly [{
|
|
2379
|
+
readonly indexed: false;
|
|
2380
|
+
readonly internalType: "string";
|
|
2381
|
+
readonly name: "feeType";
|
|
2382
|
+
readonly type: "string";
|
|
2383
|
+
}, {
|
|
2384
|
+
readonly indexed: false;
|
|
2385
|
+
readonly internalType: "uint256";
|
|
2386
|
+
readonly name: "newFeeBasisPoints";
|
|
2387
|
+
readonly type: "uint256";
|
|
2388
|
+
}];
|
|
2389
|
+
readonly name: "FeeUpdated";
|
|
2390
|
+
readonly type: "event";
|
|
2391
|
+
}, {
|
|
2392
|
+
readonly anonymous: false;
|
|
2393
|
+
readonly inputs: readonly [{
|
|
2394
|
+
readonly indexed: true;
|
|
2395
|
+
readonly internalType: "address";
|
|
2396
|
+
readonly name: "to";
|
|
2397
|
+
readonly type: "address";
|
|
2398
|
+
}, {
|
|
2399
|
+
readonly indexed: false;
|
|
2400
|
+
readonly internalType: "uint256";
|
|
2401
|
+
readonly name: "amount";
|
|
2402
|
+
readonly type: "uint256";
|
|
2403
|
+
}];
|
|
2404
|
+
readonly name: "FeesWithdrawn";
|
|
2405
|
+
readonly type: "event";
|
|
2406
|
+
}, {
|
|
2407
|
+
readonly anonymous: false;
|
|
2408
|
+
readonly inputs: readonly [{
|
|
2409
|
+
readonly indexed: false;
|
|
2410
|
+
readonly internalType: "uint256";
|
|
2411
|
+
readonly name: "minDeposit";
|
|
2412
|
+
readonly type: "uint256";
|
|
2413
|
+
}, {
|
|
2414
|
+
readonly indexed: false;
|
|
2415
|
+
readonly internalType: "uint256";
|
|
2416
|
+
readonly name: "maxDeposit";
|
|
2417
|
+
readonly type: "uint256";
|
|
2418
|
+
}, {
|
|
2419
|
+
readonly indexed: false;
|
|
2420
|
+
readonly internalType: "uint256";
|
|
2421
|
+
readonly name: "minWithdraw";
|
|
2422
|
+
readonly type: "uint256";
|
|
2423
|
+
}, {
|
|
2424
|
+
readonly indexed: false;
|
|
2425
|
+
readonly internalType: "uint256";
|
|
2426
|
+
readonly name: "maxWithdraw";
|
|
2427
|
+
readonly type: "uint256";
|
|
2428
|
+
}];
|
|
2429
|
+
readonly name: "LimitsUpdated";
|
|
2430
|
+
readonly type: "event";
|
|
2431
|
+
}, {
|
|
2432
|
+
readonly anonymous: false;
|
|
2433
|
+
readonly inputs: readonly [{
|
|
2434
|
+
readonly indexed: false;
|
|
2435
|
+
readonly internalType: "uint256";
|
|
2436
|
+
readonly name: "fee";
|
|
2437
|
+
readonly type: "uint256";
|
|
2438
|
+
}, {
|
|
2439
|
+
readonly indexed: true;
|
|
2440
|
+
readonly internalType: "address";
|
|
2441
|
+
readonly name: "by";
|
|
2442
|
+
readonly type: "address";
|
|
2443
|
+
}];
|
|
2444
|
+
readonly name: "NativeCotiFeeUpdated";
|
|
2445
|
+
readonly type: "event";
|
|
2446
|
+
}, {
|
|
2447
|
+
readonly anonymous: false;
|
|
2448
|
+
readonly inputs: readonly [{
|
|
2449
|
+
readonly indexed: true;
|
|
2450
|
+
readonly internalType: "address";
|
|
2451
|
+
readonly name: "account";
|
|
2452
|
+
readonly type: "address";
|
|
2453
|
+
}, {
|
|
2454
|
+
readonly indexed: true;
|
|
2455
|
+
readonly internalType: "address";
|
|
2456
|
+
readonly name: "by";
|
|
2457
|
+
readonly type: "address";
|
|
2458
|
+
}];
|
|
2459
|
+
readonly name: "OperatorAdded";
|
|
2460
|
+
readonly type: "event";
|
|
2461
|
+
}, {
|
|
2462
|
+
readonly anonymous: false;
|
|
2463
|
+
readonly inputs: readonly [{
|
|
2464
|
+
readonly indexed: true;
|
|
2465
|
+
readonly internalType: "address";
|
|
2466
|
+
readonly name: "account";
|
|
2467
|
+
readonly type: "address";
|
|
2468
|
+
}, {
|
|
2469
|
+
readonly indexed: true;
|
|
2470
|
+
readonly internalType: "address";
|
|
2471
|
+
readonly name: "by";
|
|
2472
|
+
readonly type: "address";
|
|
2473
|
+
}];
|
|
2474
|
+
readonly name: "OperatorRemoved";
|
|
2475
|
+
readonly type: "event";
|
|
2476
|
+
}, {
|
|
2477
|
+
readonly anonymous: false;
|
|
2478
|
+
readonly inputs: readonly [{
|
|
2479
|
+
readonly indexed: true;
|
|
2480
|
+
readonly internalType: "address";
|
|
2481
|
+
readonly name: "previousOwner";
|
|
2482
|
+
readonly type: "address";
|
|
2483
|
+
}, {
|
|
2484
|
+
readonly indexed: true;
|
|
2485
|
+
readonly internalType: "address";
|
|
2486
|
+
readonly name: "newOwner";
|
|
2487
|
+
readonly type: "address";
|
|
2488
|
+
}];
|
|
2489
|
+
readonly name: "OwnershipTransferred";
|
|
2490
|
+
readonly type: "event";
|
|
2491
|
+
}, {
|
|
2492
|
+
readonly anonymous: false;
|
|
2493
|
+
readonly inputs: readonly [{
|
|
2494
|
+
readonly indexed: false;
|
|
2495
|
+
readonly internalType: "address";
|
|
2496
|
+
readonly name: "account";
|
|
2497
|
+
readonly type: "address";
|
|
2498
|
+
}];
|
|
2499
|
+
readonly name: "Paused";
|
|
2500
|
+
readonly type: "event";
|
|
2501
|
+
}, {
|
|
2502
|
+
readonly anonymous: false;
|
|
2503
|
+
readonly inputs: readonly [{
|
|
2504
|
+
readonly indexed: true;
|
|
2505
|
+
readonly internalType: "address";
|
|
2506
|
+
readonly name: "oldOracle";
|
|
2507
|
+
readonly type: "address";
|
|
2508
|
+
}, {
|
|
2509
|
+
readonly indexed: true;
|
|
2510
|
+
readonly internalType: "address";
|
|
2511
|
+
readonly name: "newOracle";
|
|
2512
|
+
readonly type: "address";
|
|
2513
|
+
}];
|
|
2514
|
+
readonly name: "PriceOracleUpdated";
|
|
2515
|
+
readonly type: "event";
|
|
2516
|
+
}, {
|
|
2517
|
+
readonly anonymous: false;
|
|
2518
|
+
readonly inputs: readonly [{
|
|
2519
|
+
readonly indexed: true;
|
|
2520
|
+
readonly internalType: "bytes32";
|
|
2521
|
+
readonly name: "role";
|
|
2522
|
+
readonly type: "bytes32";
|
|
2523
|
+
}, {
|
|
2524
|
+
readonly indexed: true;
|
|
2525
|
+
readonly internalType: "bytes32";
|
|
2526
|
+
readonly name: "previousAdminRole";
|
|
2527
|
+
readonly type: "bytes32";
|
|
2528
|
+
}, {
|
|
2529
|
+
readonly indexed: true;
|
|
2530
|
+
readonly internalType: "bytes32";
|
|
2531
|
+
readonly name: "newAdminRole";
|
|
2532
|
+
readonly type: "bytes32";
|
|
2533
|
+
}];
|
|
2534
|
+
readonly name: "RoleAdminChanged";
|
|
2535
|
+
readonly type: "event";
|
|
2536
|
+
}, {
|
|
2537
|
+
readonly anonymous: false;
|
|
2538
|
+
readonly inputs: readonly [{
|
|
2539
|
+
readonly indexed: true;
|
|
2540
|
+
readonly internalType: "bytes32";
|
|
2541
|
+
readonly name: "role";
|
|
2542
|
+
readonly type: "bytes32";
|
|
2543
|
+
}, {
|
|
2544
|
+
readonly indexed: true;
|
|
2545
|
+
readonly internalType: "address";
|
|
2546
|
+
readonly name: "account";
|
|
2547
|
+
readonly type: "address";
|
|
2548
|
+
}, {
|
|
2549
|
+
readonly indexed: true;
|
|
2550
|
+
readonly internalType: "address";
|
|
2551
|
+
readonly name: "sender";
|
|
2552
|
+
readonly type: "address";
|
|
2553
|
+
}];
|
|
2554
|
+
readonly name: "RoleGranted";
|
|
2555
|
+
readonly type: "event";
|
|
2556
|
+
}, {
|
|
2557
|
+
readonly anonymous: false;
|
|
2558
|
+
readonly inputs: readonly [{
|
|
2559
|
+
readonly indexed: true;
|
|
2560
|
+
readonly internalType: "bytes32";
|
|
2561
|
+
readonly name: "role";
|
|
2562
|
+
readonly type: "bytes32";
|
|
2563
|
+
}, {
|
|
2564
|
+
readonly indexed: true;
|
|
2565
|
+
readonly internalType: "address";
|
|
2566
|
+
readonly name: "account";
|
|
2567
|
+
readonly type: "address";
|
|
2568
|
+
}, {
|
|
2569
|
+
readonly indexed: true;
|
|
2570
|
+
readonly internalType: "address";
|
|
2571
|
+
readonly name: "sender";
|
|
2572
|
+
readonly type: "address";
|
|
2573
|
+
}];
|
|
2574
|
+
readonly name: "RoleRevoked";
|
|
2575
|
+
readonly type: "event";
|
|
2576
|
+
}, {
|
|
2577
|
+
readonly anonymous: false;
|
|
2578
|
+
readonly inputs: readonly [{
|
|
2579
|
+
readonly indexed: true;
|
|
2580
|
+
readonly internalType: "address";
|
|
2581
|
+
readonly name: "account";
|
|
2582
|
+
readonly type: "address";
|
|
2583
|
+
}, {
|
|
2584
|
+
readonly indexed: true;
|
|
2585
|
+
readonly internalType: "address";
|
|
2586
|
+
readonly name: "by";
|
|
2587
|
+
readonly type: "address";
|
|
2588
|
+
}];
|
|
2589
|
+
readonly name: "UnBlacklisted";
|
|
2590
|
+
readonly type: "event";
|
|
2591
|
+
}, {
|
|
2592
|
+
readonly anonymous: false;
|
|
2593
|
+
readonly inputs: readonly [{
|
|
2594
|
+
readonly indexed: false;
|
|
2595
|
+
readonly internalType: "address";
|
|
2596
|
+
readonly name: "account";
|
|
2597
|
+
readonly type: "address";
|
|
2598
|
+
}];
|
|
2599
|
+
readonly name: "Unpaused";
|
|
2600
|
+
readonly type: "event";
|
|
2601
|
+
}, {
|
|
2602
|
+
readonly anonymous: false;
|
|
2603
|
+
readonly inputs: readonly [{
|
|
2604
|
+
readonly indexed: true;
|
|
2605
|
+
readonly internalType: "address";
|
|
2606
|
+
readonly name: "user";
|
|
2607
|
+
readonly type: "address";
|
|
2608
|
+
}, {
|
|
2609
|
+
readonly indexed: false;
|
|
2610
|
+
readonly internalType: "uint256";
|
|
2611
|
+
readonly name: "grossAmount";
|
|
2612
|
+
readonly type: "uint256";
|
|
2613
|
+
}, {
|
|
2614
|
+
readonly indexed: false;
|
|
2615
|
+
readonly internalType: "uint256";
|
|
2616
|
+
readonly name: "netAmount";
|
|
2617
|
+
readonly type: "uint256";
|
|
2618
|
+
}];
|
|
2619
|
+
readonly name: "Withdraw";
|
|
2620
|
+
readonly type: "event";
|
|
2621
|
+
}, {
|
|
2622
|
+
readonly inputs: readonly [];
|
|
2623
|
+
readonly name: "DEFAULT_ADMIN_ROLE";
|
|
2624
|
+
readonly outputs: readonly [{
|
|
2625
|
+
readonly internalType: "bytes32";
|
|
2626
|
+
readonly name: "";
|
|
2627
|
+
readonly type: "bytes32";
|
|
2628
|
+
}];
|
|
2629
|
+
readonly stateMutability: "view";
|
|
2630
|
+
readonly type: "function";
|
|
2631
|
+
}, {
|
|
2632
|
+
readonly inputs: readonly [];
|
|
2633
|
+
readonly name: "FEE_DIVISOR";
|
|
2634
|
+
readonly outputs: readonly [{
|
|
2635
|
+
readonly internalType: "uint256";
|
|
2636
|
+
readonly name: "";
|
|
2637
|
+
readonly type: "uint256";
|
|
2638
|
+
}];
|
|
2639
|
+
readonly stateMutability: "view";
|
|
2640
|
+
readonly type: "function";
|
|
2641
|
+
}, {
|
|
2642
|
+
readonly inputs: readonly [];
|
|
2643
|
+
readonly name: "MAX_FEE_UNITS";
|
|
2644
|
+
readonly outputs: readonly [{
|
|
2645
|
+
readonly internalType: "uint256";
|
|
2646
|
+
readonly name: "";
|
|
2647
|
+
readonly type: "uint256";
|
|
2648
|
+
}];
|
|
2649
|
+
readonly stateMutability: "view";
|
|
2650
|
+
readonly type: "function";
|
|
2651
|
+
}, {
|
|
2652
|
+
readonly inputs: readonly [];
|
|
2653
|
+
readonly name: "OPERATOR_ROLE";
|
|
2654
|
+
readonly outputs: readonly [{
|
|
2655
|
+
readonly internalType: "bytes32";
|
|
2656
|
+
readonly name: "";
|
|
2657
|
+
readonly type: "bytes32";
|
|
2658
|
+
}];
|
|
2659
|
+
readonly stateMutability: "view";
|
|
2660
|
+
readonly type: "function";
|
|
2661
|
+
}, {
|
|
2662
|
+
readonly inputs: readonly [];
|
|
2663
|
+
readonly name: "accumulatedCotiFees";
|
|
2664
|
+
readonly outputs: readonly [{
|
|
2665
|
+
readonly internalType: "uint256";
|
|
2666
|
+
readonly name: "";
|
|
2667
|
+
readonly type: "uint256";
|
|
2668
|
+
}];
|
|
2669
|
+
readonly stateMutability: "view";
|
|
2670
|
+
readonly type: "function";
|
|
2671
|
+
}, {
|
|
2672
|
+
readonly inputs: readonly [];
|
|
2673
|
+
readonly name: "accumulatedFees";
|
|
2674
|
+
readonly outputs: readonly [{
|
|
2675
|
+
readonly internalType: "uint256";
|
|
2676
|
+
readonly name: "";
|
|
2677
|
+
readonly type: "uint256";
|
|
2678
|
+
}];
|
|
2679
|
+
readonly stateMutability: "view";
|
|
2680
|
+
readonly type: "function";
|
|
2681
|
+
}, {
|
|
2682
|
+
readonly inputs: readonly [{
|
|
2683
|
+
readonly internalType: "address";
|
|
2684
|
+
readonly name: "account";
|
|
2685
|
+
readonly type: "address";
|
|
2686
|
+
}];
|
|
2687
|
+
readonly name: "addOperator";
|
|
2688
|
+
readonly outputs: readonly [];
|
|
2689
|
+
readonly stateMutability: "nonpayable";
|
|
2690
|
+
readonly type: "function";
|
|
2691
|
+
}, {
|
|
2692
|
+
readonly inputs: readonly [{
|
|
2693
|
+
readonly internalType: "address";
|
|
2694
|
+
readonly name: "account";
|
|
2695
|
+
readonly type: "address";
|
|
2696
|
+
}];
|
|
2697
|
+
readonly name: "addToBlacklist";
|
|
2698
|
+
readonly outputs: readonly [];
|
|
2699
|
+
readonly stateMutability: "nonpayable";
|
|
2700
|
+
readonly type: "function";
|
|
2701
|
+
}, {
|
|
2702
|
+
readonly inputs: readonly [{
|
|
2703
|
+
readonly internalType: "address";
|
|
2704
|
+
readonly name: "";
|
|
2705
|
+
readonly type: "address";
|
|
2706
|
+
}];
|
|
2707
|
+
readonly name: "blacklisted";
|
|
2708
|
+
readonly outputs: readonly [{
|
|
2709
|
+
readonly internalType: "bool";
|
|
2710
|
+
readonly name: "";
|
|
2711
|
+
readonly type: "bool";
|
|
2712
|
+
}];
|
|
2713
|
+
readonly stateMutability: "view";
|
|
2714
|
+
readonly type: "function";
|
|
2715
|
+
}, {
|
|
2716
|
+
readonly inputs: readonly [{
|
|
2717
|
+
readonly internalType: "uint256";
|
|
2718
|
+
readonly name: "tokenAmount";
|
|
2719
|
+
readonly type: "uint256";
|
|
2720
|
+
}, {
|
|
2721
|
+
readonly internalType: "uint256";
|
|
2722
|
+
readonly name: "fixedFee";
|
|
2723
|
+
readonly type: "uint256";
|
|
2724
|
+
}, {
|
|
2725
|
+
readonly internalType: "uint256";
|
|
2726
|
+
readonly name: "percentageBps";
|
|
2727
|
+
readonly type: "uint256";
|
|
2728
|
+
}, {
|
|
2729
|
+
readonly internalType: "uint256";
|
|
2730
|
+
readonly name: "maxFee";
|
|
2731
|
+
readonly type: "uint256";
|
|
2732
|
+
}, {
|
|
2733
|
+
readonly internalType: "string";
|
|
2734
|
+
readonly name: "_tokenSymbol";
|
|
2735
|
+
readonly type: "string";
|
|
2736
|
+
}, {
|
|
2737
|
+
readonly internalType: "uint8";
|
|
2738
|
+
readonly name: "_tokenDecimals";
|
|
2739
|
+
readonly type: "uint8";
|
|
2740
|
+
}];
|
|
2741
|
+
readonly name: "computeErc20Fee";
|
|
2742
|
+
readonly outputs: readonly [{
|
|
2743
|
+
readonly internalType: "uint256";
|
|
2744
|
+
readonly name: "";
|
|
2745
|
+
readonly type: "uint256";
|
|
2746
|
+
}];
|
|
2747
|
+
readonly stateMutability: "view";
|
|
2748
|
+
readonly type: "function";
|
|
2749
|
+
}, {
|
|
2750
|
+
readonly inputs: readonly [{
|
|
2751
|
+
readonly internalType: "uint256";
|
|
2752
|
+
readonly name: "amount";
|
|
2753
|
+
readonly type: "uint256";
|
|
2754
|
+
}, {
|
|
2755
|
+
readonly internalType: "uint256";
|
|
2756
|
+
readonly name: "cotiOracleTimestamp";
|
|
2757
|
+
readonly type: "uint256";
|
|
2758
|
+
}, {
|
|
2759
|
+
readonly internalType: "uint256";
|
|
2760
|
+
readonly name: "tokenOracleTimestamp";
|
|
2761
|
+
readonly type: "uint256";
|
|
2762
|
+
}];
|
|
2763
|
+
readonly name: "deposit";
|
|
2764
|
+
readonly outputs: readonly [];
|
|
2765
|
+
readonly stateMutability: "payable";
|
|
2766
|
+
readonly type: "function";
|
|
2767
|
+
}, {
|
|
2768
|
+
readonly inputs: readonly [];
|
|
2769
|
+
readonly name: "depositFeeBasisPoints";
|
|
2770
|
+
readonly outputs: readonly [{
|
|
2771
|
+
readonly internalType: "uint256";
|
|
2772
|
+
readonly name: "";
|
|
2773
|
+
readonly type: "uint256";
|
|
2774
|
+
}];
|
|
2775
|
+
readonly stateMutability: "view";
|
|
2776
|
+
readonly type: "function";
|
|
2777
|
+
}, {
|
|
2778
|
+
readonly inputs: readonly [];
|
|
2779
|
+
readonly name: "depositFixedFee";
|
|
2780
|
+
readonly outputs: readonly [{
|
|
2781
|
+
readonly internalType: "uint256";
|
|
2782
|
+
readonly name: "";
|
|
2783
|
+
readonly type: "uint256";
|
|
2784
|
+
}];
|
|
2785
|
+
readonly stateMutability: "view";
|
|
2786
|
+
readonly type: "function";
|
|
2787
|
+
}, {
|
|
2788
|
+
readonly inputs: readonly [];
|
|
2789
|
+
readonly name: "depositMaxFee";
|
|
2790
|
+
readonly outputs: readonly [{
|
|
2791
|
+
readonly internalType: "uint256";
|
|
2792
|
+
readonly name: "";
|
|
2793
|
+
readonly type: "uint256";
|
|
2794
|
+
}];
|
|
2795
|
+
readonly stateMutability: "view";
|
|
2796
|
+
readonly type: "function";
|
|
2797
|
+
}, {
|
|
2798
|
+
readonly inputs: readonly [];
|
|
2799
|
+
readonly name: "depositPercentageBps";
|
|
2800
|
+
readonly outputs: readonly [{
|
|
2801
|
+
readonly internalType: "uint256";
|
|
2802
|
+
readonly name: "";
|
|
2803
|
+
readonly type: "uint256";
|
|
2804
|
+
}];
|
|
2805
|
+
readonly stateMutability: "view";
|
|
2806
|
+
readonly type: "function";
|
|
2807
|
+
}, {
|
|
2808
|
+
readonly inputs: readonly [{
|
|
2809
|
+
readonly internalType: "uint256";
|
|
2810
|
+
readonly name: "tokenAmount";
|
|
2811
|
+
readonly type: "uint256";
|
|
2812
|
+
}];
|
|
2813
|
+
readonly name: "estimateDepositFee";
|
|
2814
|
+
readonly outputs: readonly [{
|
|
2815
|
+
readonly internalType: "uint256";
|
|
2816
|
+
readonly name: "fee";
|
|
2817
|
+
readonly type: "uint256";
|
|
2818
|
+
}, {
|
|
2819
|
+
readonly internalType: "uint256";
|
|
2820
|
+
readonly name: "cotiLastUpdated";
|
|
2821
|
+
readonly type: "uint256";
|
|
2822
|
+
}, {
|
|
2823
|
+
readonly internalType: "uint256";
|
|
2824
|
+
readonly name: "tokenLastUpdated";
|
|
2825
|
+
readonly type: "uint256";
|
|
2826
|
+
}, {
|
|
2827
|
+
readonly internalType: "uint256";
|
|
2828
|
+
readonly name: "blockTimestamp";
|
|
2829
|
+
readonly type: "uint256";
|
|
2830
|
+
}];
|
|
2831
|
+
readonly stateMutability: "view";
|
|
2832
|
+
readonly type: "function";
|
|
2833
|
+
}, {
|
|
2834
|
+
readonly inputs: readonly [{
|
|
2835
|
+
readonly internalType: "uint256";
|
|
2836
|
+
readonly name: "tokenAmount";
|
|
2837
|
+
readonly type: "uint256";
|
|
2838
|
+
}];
|
|
2839
|
+
readonly name: "estimateWithdrawFee";
|
|
2840
|
+
readonly outputs: readonly [{
|
|
2841
|
+
readonly internalType: "uint256";
|
|
2842
|
+
readonly name: "fee";
|
|
2843
|
+
readonly type: "uint256";
|
|
2844
|
+
}, {
|
|
2845
|
+
readonly internalType: "uint256";
|
|
2846
|
+
readonly name: "cotiLastUpdated";
|
|
2847
|
+
readonly type: "uint256";
|
|
2848
|
+
}, {
|
|
2849
|
+
readonly internalType: "uint256";
|
|
2850
|
+
readonly name: "tokenLastUpdated";
|
|
2851
|
+
readonly type: "uint256";
|
|
2852
|
+
}, {
|
|
2853
|
+
readonly internalType: "uint256";
|
|
2854
|
+
readonly name: "blockTimestamp";
|
|
2855
|
+
readonly type: "uint256";
|
|
2856
|
+
}];
|
|
2857
|
+
readonly stateMutability: "view";
|
|
2858
|
+
readonly type: "function";
|
|
2859
|
+
}, {
|
|
2860
|
+
readonly inputs: readonly [];
|
|
2861
|
+
readonly name: "feeRecipient";
|
|
2862
|
+
readonly outputs: readonly [{
|
|
2863
|
+
readonly internalType: "address";
|
|
2864
|
+
readonly name: "";
|
|
2865
|
+
readonly type: "address";
|
|
2866
|
+
}];
|
|
2867
|
+
readonly stateMutability: "view";
|
|
2868
|
+
readonly type: "function";
|
|
2869
|
+
}, {
|
|
2870
|
+
readonly inputs: readonly [{
|
|
2871
|
+
readonly internalType: "bytes32";
|
|
2872
|
+
readonly name: "role";
|
|
2873
|
+
readonly type: "bytes32";
|
|
2874
|
+
}];
|
|
2875
|
+
readonly name: "getRoleAdmin";
|
|
2876
|
+
readonly outputs: readonly [{
|
|
2877
|
+
readonly internalType: "bytes32";
|
|
2878
|
+
readonly name: "";
|
|
2879
|
+
readonly type: "bytes32";
|
|
2880
|
+
}];
|
|
2881
|
+
readonly stateMutability: "view";
|
|
2882
|
+
readonly type: "function";
|
|
2883
|
+
}, {
|
|
2884
|
+
readonly inputs: readonly [{
|
|
2885
|
+
readonly internalType: "bytes32";
|
|
2886
|
+
readonly name: "role";
|
|
2887
|
+
readonly type: "bytes32";
|
|
2888
|
+
}, {
|
|
2889
|
+
readonly internalType: "uint256";
|
|
2890
|
+
readonly name: "index";
|
|
2891
|
+
readonly type: "uint256";
|
|
2892
|
+
}];
|
|
2893
|
+
readonly name: "getRoleMember";
|
|
2894
|
+
readonly outputs: readonly [{
|
|
2895
|
+
readonly internalType: "address";
|
|
2896
|
+
readonly name: "";
|
|
2897
|
+
readonly type: "address";
|
|
2898
|
+
}];
|
|
2899
|
+
readonly stateMutability: "view";
|
|
2900
|
+
readonly type: "function";
|
|
2901
|
+
}, {
|
|
2902
|
+
readonly inputs: readonly [{
|
|
2903
|
+
readonly internalType: "bytes32";
|
|
2904
|
+
readonly name: "role";
|
|
2905
|
+
readonly type: "bytes32";
|
|
2906
|
+
}];
|
|
2907
|
+
readonly name: "getRoleMemberCount";
|
|
2908
|
+
readonly outputs: readonly [{
|
|
2909
|
+
readonly internalType: "uint256";
|
|
2910
|
+
readonly name: "";
|
|
2911
|
+
readonly type: "uint256";
|
|
2912
|
+
}];
|
|
2913
|
+
readonly stateMutability: "view";
|
|
2914
|
+
readonly type: "function";
|
|
2915
|
+
}, {
|
|
2916
|
+
readonly inputs: readonly [{
|
|
2917
|
+
readonly internalType: "bytes32";
|
|
2918
|
+
readonly name: "role";
|
|
2919
|
+
readonly type: "bytes32";
|
|
2920
|
+
}, {
|
|
2921
|
+
readonly internalType: "address";
|
|
2922
|
+
readonly name: "account";
|
|
2923
|
+
readonly type: "address";
|
|
2924
|
+
}];
|
|
2925
|
+
readonly name: "grantRole";
|
|
2926
|
+
readonly outputs: readonly [];
|
|
2927
|
+
readonly stateMutability: "nonpayable";
|
|
2928
|
+
readonly type: "function";
|
|
2929
|
+
}, {
|
|
2930
|
+
readonly inputs: readonly [{
|
|
2931
|
+
readonly internalType: "bytes32";
|
|
2932
|
+
readonly name: "role";
|
|
2933
|
+
readonly type: "bytes32";
|
|
2934
|
+
}, {
|
|
2935
|
+
readonly internalType: "address";
|
|
2936
|
+
readonly name: "account";
|
|
2937
|
+
readonly type: "address";
|
|
2938
|
+
}];
|
|
2939
|
+
readonly name: "hasRole";
|
|
2940
|
+
readonly outputs: readonly [{
|
|
2941
|
+
readonly internalType: "bool";
|
|
2942
|
+
readonly name: "";
|
|
2943
|
+
readonly type: "bool";
|
|
2944
|
+
}];
|
|
2945
|
+
readonly stateMutability: "view";
|
|
2946
|
+
readonly type: "function";
|
|
2947
|
+
}, {
|
|
2948
|
+
readonly inputs: readonly [];
|
|
2949
|
+
readonly name: "isDepositEnabled";
|
|
2950
|
+
readonly outputs: readonly [{
|
|
2951
|
+
readonly internalType: "bool";
|
|
2952
|
+
readonly name: "";
|
|
2953
|
+
readonly type: "bool";
|
|
2954
|
+
}];
|
|
2955
|
+
readonly stateMutability: "view";
|
|
2956
|
+
readonly type: "function";
|
|
2957
|
+
}, {
|
|
2958
|
+
readonly inputs: readonly [{
|
|
2959
|
+
readonly internalType: "address";
|
|
2960
|
+
readonly name: "account";
|
|
2961
|
+
readonly type: "address";
|
|
2962
|
+
}];
|
|
2963
|
+
readonly name: "isOperator";
|
|
2964
|
+
readonly outputs: readonly [{
|
|
2965
|
+
readonly internalType: "bool";
|
|
2966
|
+
readonly name: "";
|
|
2967
|
+
readonly type: "bool";
|
|
2968
|
+
}];
|
|
2969
|
+
readonly stateMutability: "view";
|
|
2970
|
+
readonly type: "function";
|
|
2971
|
+
}, {
|
|
2972
|
+
readonly inputs: readonly [];
|
|
2973
|
+
readonly name: "maxDepositAmount";
|
|
2974
|
+
readonly outputs: readonly [{
|
|
2975
|
+
readonly internalType: "uint256";
|
|
2976
|
+
readonly name: "";
|
|
2977
|
+
readonly type: "uint256";
|
|
2978
|
+
}];
|
|
2979
|
+
readonly stateMutability: "view";
|
|
2980
|
+
readonly type: "function";
|
|
2981
|
+
}, {
|
|
2982
|
+
readonly inputs: readonly [];
|
|
2983
|
+
readonly name: "maxWithdrawAmount";
|
|
2984
|
+
readonly outputs: readonly [{
|
|
2985
|
+
readonly internalType: "uint256";
|
|
2986
|
+
readonly name: "";
|
|
2987
|
+
readonly type: "uint256";
|
|
2988
|
+
}];
|
|
2989
|
+
readonly stateMutability: "view";
|
|
2990
|
+
readonly type: "function";
|
|
2991
|
+
}, {
|
|
2992
|
+
readonly inputs: readonly [];
|
|
2993
|
+
readonly name: "minDepositAmount";
|
|
2994
|
+
readonly outputs: readonly [{
|
|
2995
|
+
readonly internalType: "uint256";
|
|
2996
|
+
readonly name: "";
|
|
2997
|
+
readonly type: "uint256";
|
|
2998
|
+
}];
|
|
2999
|
+
readonly stateMutability: "view";
|
|
3000
|
+
readonly type: "function";
|
|
3001
|
+
}, {
|
|
3002
|
+
readonly inputs: readonly [];
|
|
3003
|
+
readonly name: "minWithdrawAmount";
|
|
3004
|
+
readonly outputs: readonly [{
|
|
3005
|
+
readonly internalType: "uint256";
|
|
3006
|
+
readonly name: "";
|
|
3007
|
+
readonly type: "uint256";
|
|
3008
|
+
}];
|
|
3009
|
+
readonly stateMutability: "view";
|
|
3010
|
+
readonly type: "function";
|
|
3011
|
+
}, {
|
|
3012
|
+
readonly inputs: readonly [];
|
|
3013
|
+
readonly name: "nativeCotiFee";
|
|
3014
|
+
readonly outputs: readonly [{
|
|
3015
|
+
readonly internalType: "uint256";
|
|
3016
|
+
readonly name: "";
|
|
3017
|
+
readonly type: "uint256";
|
|
3018
|
+
}];
|
|
3019
|
+
readonly stateMutability: "view";
|
|
3020
|
+
readonly type: "function";
|
|
3021
|
+
}, {
|
|
3022
|
+
readonly inputs: readonly [];
|
|
3023
|
+
readonly name: "owner";
|
|
3024
|
+
readonly outputs: readonly [{
|
|
3025
|
+
readonly internalType: "address";
|
|
3026
|
+
readonly name: "";
|
|
3027
|
+
readonly type: "address";
|
|
3028
|
+
}];
|
|
3029
|
+
readonly stateMutability: "view";
|
|
3030
|
+
readonly type: "function";
|
|
3031
|
+
}, {
|
|
3032
|
+
readonly inputs: readonly [];
|
|
3033
|
+
readonly name: "pause";
|
|
3034
|
+
readonly outputs: readonly [];
|
|
3035
|
+
readonly stateMutability: "nonpayable";
|
|
3036
|
+
readonly type: "function";
|
|
3037
|
+
}, {
|
|
3038
|
+
readonly inputs: readonly [];
|
|
3039
|
+
readonly name: "paused";
|
|
3040
|
+
readonly outputs: readonly [{
|
|
3041
|
+
readonly internalType: "bool";
|
|
3042
|
+
readonly name: "";
|
|
3043
|
+
readonly type: "bool";
|
|
3044
|
+
}];
|
|
3045
|
+
readonly stateMutability: "view";
|
|
3046
|
+
readonly type: "function";
|
|
3047
|
+
}, {
|
|
3048
|
+
readonly inputs: readonly [];
|
|
3049
|
+
readonly name: "priceOracle";
|
|
3050
|
+
readonly outputs: readonly [{
|
|
3051
|
+
readonly internalType: "address";
|
|
3052
|
+
readonly name: "";
|
|
3053
|
+
readonly type: "address";
|
|
3054
|
+
}];
|
|
3055
|
+
readonly stateMutability: "view";
|
|
3056
|
+
readonly type: "function";
|
|
3057
|
+
}, {
|
|
3058
|
+
readonly inputs: readonly [];
|
|
3059
|
+
readonly name: "privateToken";
|
|
3060
|
+
readonly outputs: readonly [{
|
|
3061
|
+
readonly internalType: "contract IPrivateERC20";
|
|
3062
|
+
readonly name: "";
|
|
3063
|
+
readonly type: "address";
|
|
3064
|
+
}];
|
|
3065
|
+
readonly stateMutability: "view";
|
|
3066
|
+
readonly type: "function";
|
|
3067
|
+
}, {
|
|
3068
|
+
readonly inputs: readonly [{
|
|
3069
|
+
readonly internalType: "address";
|
|
3070
|
+
readonly name: "account";
|
|
3071
|
+
readonly type: "address";
|
|
3072
|
+
}];
|
|
3073
|
+
readonly name: "removeFromBlacklist";
|
|
3074
|
+
readonly outputs: readonly [];
|
|
3075
|
+
readonly stateMutability: "nonpayable";
|
|
3076
|
+
readonly type: "function";
|
|
3077
|
+
}, {
|
|
3078
|
+
readonly inputs: readonly [{
|
|
3079
|
+
readonly internalType: "address";
|
|
3080
|
+
readonly name: "account";
|
|
3081
|
+
readonly type: "address";
|
|
3082
|
+
}];
|
|
3083
|
+
readonly name: "removeOperator";
|
|
3084
|
+
readonly outputs: readonly [];
|
|
3085
|
+
readonly stateMutability: "nonpayable";
|
|
3086
|
+
readonly type: "function";
|
|
3087
|
+
}, {
|
|
3088
|
+
readonly inputs: readonly [];
|
|
3089
|
+
readonly name: "renounceOwnership";
|
|
3090
|
+
readonly outputs: readonly [];
|
|
3091
|
+
readonly stateMutability: "nonpayable";
|
|
3092
|
+
readonly type: "function";
|
|
3093
|
+
}, {
|
|
3094
|
+
readonly inputs: readonly [{
|
|
3095
|
+
readonly internalType: "bytes32";
|
|
3096
|
+
readonly name: "role";
|
|
3097
|
+
readonly type: "bytes32";
|
|
3098
|
+
}, {
|
|
3099
|
+
readonly internalType: "address";
|
|
3100
|
+
readonly name: "account";
|
|
3101
|
+
readonly type: "address";
|
|
3102
|
+
}];
|
|
3103
|
+
readonly name: "renounceRole";
|
|
3104
|
+
readonly outputs: readonly [];
|
|
3105
|
+
readonly stateMutability: "nonpayable";
|
|
3106
|
+
readonly type: "function";
|
|
3107
|
+
}, {
|
|
3108
|
+
readonly inputs: readonly [{
|
|
3109
|
+
readonly internalType: "address";
|
|
3110
|
+
readonly name: "_token";
|
|
3111
|
+
readonly type: "address";
|
|
3112
|
+
}, {
|
|
3113
|
+
readonly internalType: "uint256";
|
|
3114
|
+
readonly name: "amount";
|
|
3115
|
+
readonly type: "uint256";
|
|
3116
|
+
}];
|
|
3117
|
+
readonly name: "rescueERC20";
|
|
3118
|
+
readonly outputs: readonly [];
|
|
3119
|
+
readonly stateMutability: "nonpayable";
|
|
3120
|
+
readonly type: "function";
|
|
3121
|
+
}, {
|
|
3122
|
+
readonly inputs: readonly [];
|
|
3123
|
+
readonly name: "rescueRecipient";
|
|
3124
|
+
readonly outputs: readonly [{
|
|
3125
|
+
readonly internalType: "address";
|
|
3126
|
+
readonly name: "";
|
|
3127
|
+
readonly type: "address";
|
|
3128
|
+
}];
|
|
3129
|
+
readonly stateMutability: "view";
|
|
3130
|
+
readonly type: "function";
|
|
3131
|
+
}, {
|
|
3132
|
+
readonly inputs: readonly [{
|
|
3133
|
+
readonly internalType: "bytes32";
|
|
3134
|
+
readonly name: "role";
|
|
3135
|
+
readonly type: "bytes32";
|
|
3136
|
+
}, {
|
|
3137
|
+
readonly internalType: "address";
|
|
3138
|
+
readonly name: "account";
|
|
3139
|
+
readonly type: "address";
|
|
3140
|
+
}];
|
|
3141
|
+
readonly name: "revokeRole";
|
|
3142
|
+
readonly outputs: readonly [];
|
|
3143
|
+
readonly stateMutability: "nonpayable";
|
|
3144
|
+
readonly type: "function";
|
|
3145
|
+
}, {
|
|
3146
|
+
readonly inputs: readonly [{
|
|
3147
|
+
readonly internalType: "uint256";
|
|
3148
|
+
readonly name: "_fixedFee";
|
|
3149
|
+
readonly type: "uint256";
|
|
3150
|
+
}, {
|
|
3151
|
+
readonly internalType: "uint256";
|
|
3152
|
+
readonly name: "_percentageBps";
|
|
3153
|
+
readonly type: "uint256";
|
|
3154
|
+
}, {
|
|
3155
|
+
readonly internalType: "uint256";
|
|
3156
|
+
readonly name: "_maxFee";
|
|
3157
|
+
readonly type: "uint256";
|
|
3158
|
+
}];
|
|
3159
|
+
readonly name: "setDepositDynamicFee";
|
|
3160
|
+
readonly outputs: readonly [];
|
|
3161
|
+
readonly stateMutability: "nonpayable";
|
|
3162
|
+
readonly type: "function";
|
|
3163
|
+
}, {
|
|
3164
|
+
readonly inputs: readonly [{
|
|
3165
|
+
readonly internalType: "uint256";
|
|
3166
|
+
readonly name: "_feeBasisPoints";
|
|
3167
|
+
readonly type: "uint256";
|
|
3168
|
+
}];
|
|
3169
|
+
readonly name: "setDepositFee";
|
|
3170
|
+
readonly outputs: readonly [];
|
|
3171
|
+
readonly stateMutability: "nonpayable";
|
|
3172
|
+
readonly type: "function";
|
|
3173
|
+
}, {
|
|
3174
|
+
readonly inputs: readonly [{
|
|
3175
|
+
readonly internalType: "bool";
|
|
3176
|
+
readonly name: "_enabled";
|
|
3177
|
+
readonly type: "bool";
|
|
3178
|
+
}];
|
|
3179
|
+
readonly name: "setIsDepositEnabled";
|
|
3180
|
+
readonly outputs: readonly [];
|
|
3181
|
+
readonly stateMutability: "nonpayable";
|
|
3182
|
+
readonly type: "function";
|
|
3183
|
+
}, {
|
|
3184
|
+
readonly inputs: readonly [{
|
|
3185
|
+
readonly internalType: "uint256";
|
|
3186
|
+
readonly name: "_minDeposit";
|
|
3187
|
+
readonly type: "uint256";
|
|
3188
|
+
}, {
|
|
3189
|
+
readonly internalType: "uint256";
|
|
3190
|
+
readonly name: "_maxDeposit";
|
|
3191
|
+
readonly type: "uint256";
|
|
3192
|
+
}, {
|
|
3193
|
+
readonly internalType: "uint256";
|
|
3194
|
+
readonly name: "_minWithdraw";
|
|
3195
|
+
readonly type: "uint256";
|
|
3196
|
+
}, {
|
|
3197
|
+
readonly internalType: "uint256";
|
|
3198
|
+
readonly name: "_maxWithdraw";
|
|
3199
|
+
readonly type: "uint256";
|
|
3200
|
+
}];
|
|
3201
|
+
readonly name: "setLimits";
|
|
3202
|
+
readonly outputs: readonly [];
|
|
3203
|
+
readonly stateMutability: "nonpayable";
|
|
3204
|
+
readonly type: "function";
|
|
3205
|
+
}, {
|
|
3206
|
+
readonly inputs: readonly [{
|
|
3207
|
+
readonly internalType: "uint256";
|
|
3208
|
+
readonly name: "_fee";
|
|
3209
|
+
readonly type: "uint256";
|
|
3210
|
+
}];
|
|
3211
|
+
readonly name: "setNativeCotiFee";
|
|
3212
|
+
readonly outputs: readonly [];
|
|
3213
|
+
readonly stateMutability: "nonpayable";
|
|
3214
|
+
readonly type: "function";
|
|
3215
|
+
}, {
|
|
3216
|
+
readonly inputs: readonly [{
|
|
3217
|
+
readonly internalType: "address";
|
|
3218
|
+
readonly name: "_oracle";
|
|
3219
|
+
readonly type: "address";
|
|
3220
|
+
}];
|
|
3221
|
+
readonly name: "setPriceOracle";
|
|
3222
|
+
readonly outputs: readonly [];
|
|
3223
|
+
readonly stateMutability: "nonpayable";
|
|
3224
|
+
readonly type: "function";
|
|
3225
|
+
}, {
|
|
3226
|
+
readonly inputs: readonly [{
|
|
3227
|
+
readonly internalType: "uint256";
|
|
3228
|
+
readonly name: "_fixedFee";
|
|
3229
|
+
readonly type: "uint256";
|
|
3230
|
+
}, {
|
|
3231
|
+
readonly internalType: "uint256";
|
|
3232
|
+
readonly name: "_percentageBps";
|
|
3233
|
+
readonly type: "uint256";
|
|
3234
|
+
}, {
|
|
3235
|
+
readonly internalType: "uint256";
|
|
3236
|
+
readonly name: "_maxFee";
|
|
3237
|
+
readonly type: "uint256";
|
|
3238
|
+
}];
|
|
3239
|
+
readonly name: "setWithdrawDynamicFee";
|
|
3240
|
+
readonly outputs: readonly [];
|
|
3241
|
+
readonly stateMutability: "nonpayable";
|
|
3242
|
+
readonly type: "function";
|
|
3243
|
+
}, {
|
|
3244
|
+
readonly inputs: readonly [{
|
|
3245
|
+
readonly internalType: "uint256";
|
|
3246
|
+
readonly name: "_feeBasisPoints";
|
|
3247
|
+
readonly type: "uint256";
|
|
3248
|
+
}];
|
|
3249
|
+
readonly name: "setWithdrawFee";
|
|
3250
|
+
readonly outputs: readonly [];
|
|
3251
|
+
readonly stateMutability: "nonpayable";
|
|
3252
|
+
readonly type: "function";
|
|
3253
|
+
}, {
|
|
3254
|
+
readonly inputs: readonly [{
|
|
3255
|
+
readonly internalType: "bytes4";
|
|
3256
|
+
readonly name: "interfaceId";
|
|
3257
|
+
readonly type: "bytes4";
|
|
3258
|
+
}];
|
|
3259
|
+
readonly name: "supportsInterface";
|
|
3260
|
+
readonly outputs: readonly [{
|
|
3261
|
+
readonly internalType: "bool";
|
|
3262
|
+
readonly name: "";
|
|
3263
|
+
readonly type: "bool";
|
|
3264
|
+
}];
|
|
3265
|
+
readonly stateMutability: "view";
|
|
3266
|
+
readonly type: "function";
|
|
3267
|
+
}, {
|
|
3268
|
+
readonly inputs: readonly [];
|
|
3269
|
+
readonly name: "token";
|
|
3270
|
+
readonly outputs: readonly [{
|
|
3271
|
+
readonly internalType: "contract IERC20";
|
|
3272
|
+
readonly name: "";
|
|
3273
|
+
readonly type: "address";
|
|
3274
|
+
}];
|
|
3275
|
+
readonly stateMutability: "view";
|
|
3276
|
+
readonly type: "function";
|
|
3277
|
+
}, {
|
|
3278
|
+
readonly inputs: readonly [];
|
|
3279
|
+
readonly name: "tokenSymbol";
|
|
3280
|
+
readonly outputs: readonly [{
|
|
3281
|
+
readonly internalType: "string";
|
|
3282
|
+
readonly name: "";
|
|
3283
|
+
readonly type: "string";
|
|
3284
|
+
}];
|
|
3285
|
+
readonly stateMutability: "view";
|
|
3286
|
+
readonly type: "function";
|
|
3287
|
+
}, {
|
|
3288
|
+
readonly inputs: readonly [];
|
|
3289
|
+
readonly name: "totalUserLiability";
|
|
3290
|
+
readonly outputs: readonly [{
|
|
3291
|
+
readonly internalType: "uint256";
|
|
3292
|
+
readonly name: "";
|
|
3293
|
+
readonly type: "uint256";
|
|
3294
|
+
}];
|
|
3295
|
+
readonly stateMutability: "view";
|
|
3296
|
+
readonly type: "function";
|
|
3297
|
+
}, {
|
|
3298
|
+
readonly inputs: readonly [{
|
|
3299
|
+
readonly internalType: "address";
|
|
3300
|
+
readonly name: "newOwner";
|
|
3301
|
+
readonly type: "address";
|
|
3302
|
+
}];
|
|
3303
|
+
readonly name: "transferOwnership";
|
|
3304
|
+
readonly outputs: readonly [];
|
|
3305
|
+
readonly stateMutability: "nonpayable";
|
|
3306
|
+
readonly type: "function";
|
|
3307
|
+
}, {
|
|
3308
|
+
readonly inputs: readonly [];
|
|
3309
|
+
readonly name: "unpause";
|
|
3310
|
+
readonly outputs: readonly [];
|
|
3311
|
+
readonly stateMutability: "nonpayable";
|
|
3312
|
+
readonly type: "function";
|
|
3313
|
+
}, {
|
|
3314
|
+
readonly inputs: readonly [{
|
|
3315
|
+
readonly internalType: "uint256";
|
|
3316
|
+
readonly name: "amount";
|
|
3317
|
+
readonly type: "uint256";
|
|
3318
|
+
}, {
|
|
3319
|
+
readonly internalType: "uint256";
|
|
3320
|
+
readonly name: "cotiOracleTimestamp";
|
|
3321
|
+
readonly type: "uint256";
|
|
3322
|
+
}, {
|
|
3323
|
+
readonly internalType: "uint256";
|
|
3324
|
+
readonly name: "tokenOracleTimestamp";
|
|
3325
|
+
readonly type: "uint256";
|
|
3326
|
+
}];
|
|
3327
|
+
readonly name: "withdraw";
|
|
3328
|
+
readonly outputs: readonly [];
|
|
3329
|
+
readonly stateMutability: "payable";
|
|
3330
|
+
readonly type: "function";
|
|
3331
|
+
}, {
|
|
3332
|
+
readonly inputs: readonly [{
|
|
3333
|
+
readonly internalType: "uint256";
|
|
3334
|
+
readonly name: "amount";
|
|
3335
|
+
readonly type: "uint256";
|
|
3336
|
+
}];
|
|
3337
|
+
readonly name: "withdrawCotiFees";
|
|
3338
|
+
readonly outputs: readonly [];
|
|
3339
|
+
readonly stateMutability: "nonpayable";
|
|
3340
|
+
readonly type: "function";
|
|
3341
|
+
}, {
|
|
3342
|
+
readonly inputs: readonly [];
|
|
3343
|
+
readonly name: "withdrawFeeBasisPoints";
|
|
3344
|
+
readonly outputs: readonly [{
|
|
3345
|
+
readonly internalType: "uint256";
|
|
3346
|
+
readonly name: "";
|
|
3347
|
+
readonly type: "uint256";
|
|
3348
|
+
}];
|
|
3349
|
+
readonly stateMutability: "view";
|
|
3350
|
+
readonly type: "function";
|
|
3351
|
+
}, {
|
|
3352
|
+
readonly inputs: readonly [{
|
|
3353
|
+
readonly internalType: "uint256";
|
|
3354
|
+
readonly name: "amount";
|
|
3355
|
+
readonly type: "uint256";
|
|
3356
|
+
}];
|
|
3357
|
+
readonly name: "withdrawFees";
|
|
3358
|
+
readonly outputs: readonly [];
|
|
3359
|
+
readonly stateMutability: "nonpayable";
|
|
3360
|
+
readonly type: "function";
|
|
3361
|
+
}, {
|
|
3362
|
+
readonly inputs: readonly [];
|
|
3363
|
+
readonly name: "withdrawFixedFee";
|
|
3364
|
+
readonly outputs: readonly [{
|
|
3365
|
+
readonly internalType: "uint256";
|
|
3366
|
+
readonly name: "";
|
|
3367
|
+
readonly type: "uint256";
|
|
3368
|
+
}];
|
|
3369
|
+
readonly stateMutability: "view";
|
|
3370
|
+
readonly type: "function";
|
|
3371
|
+
}, {
|
|
3372
|
+
readonly inputs: readonly [];
|
|
3373
|
+
readonly name: "withdrawMaxFee";
|
|
3374
|
+
readonly outputs: readonly [{
|
|
3375
|
+
readonly internalType: "uint256";
|
|
3376
|
+
readonly name: "";
|
|
3377
|
+
readonly type: "uint256";
|
|
3378
|
+
}];
|
|
3379
|
+
readonly stateMutability: "view";
|
|
3380
|
+
readonly type: "function";
|
|
3381
|
+
}, {
|
|
3382
|
+
readonly inputs: readonly [];
|
|
3383
|
+
readonly name: "withdrawPercentageBps";
|
|
3384
|
+
readonly outputs: readonly [{
|
|
3385
|
+
readonly internalType: "uint256";
|
|
3386
|
+
readonly name: "";
|
|
3387
|
+
readonly type: "uint256";
|
|
3388
|
+
}];
|
|
3389
|
+
readonly stateMutability: "view";
|
|
3390
|
+
readonly type: "function";
|
|
3391
|
+
}];
|
|
3392
|
+
declare const COTI_PRICE_CONSUMER_ABI: readonly [{
|
|
3393
|
+
readonly inputs: readonly [{
|
|
3394
|
+
readonly internalType: "address";
|
|
3395
|
+
readonly name: "_ref";
|
|
3396
|
+
readonly type: "address";
|
|
3397
|
+
}, {
|
|
3398
|
+
readonly internalType: "uint256";
|
|
3399
|
+
readonly name: "_maxStaleness";
|
|
3400
|
+
readonly type: "uint256";
|
|
3401
|
+
}];
|
|
3402
|
+
readonly stateMutability: "nonpayable";
|
|
3403
|
+
readonly type: "constructor";
|
|
3404
|
+
}, {
|
|
3405
|
+
readonly inputs: readonly [{
|
|
3406
|
+
readonly internalType: "uint256";
|
|
3407
|
+
readonly name: "lastUpdated";
|
|
3408
|
+
readonly type: "uint256";
|
|
3409
|
+
}, {
|
|
3410
|
+
readonly internalType: "uint256";
|
|
3411
|
+
readonly name: "threshold";
|
|
3412
|
+
readonly type: "uint256";
|
|
3413
|
+
}];
|
|
3414
|
+
readonly name: "StaleOracleData";
|
|
3415
|
+
readonly type: "error";
|
|
3416
|
+
}, {
|
|
3417
|
+
readonly inputs: readonly [{
|
|
3418
|
+
readonly internalType: "uint256";
|
|
3419
|
+
readonly name: "provided";
|
|
3420
|
+
readonly type: "uint256";
|
|
3421
|
+
}, {
|
|
3422
|
+
readonly internalType: "uint256";
|
|
3423
|
+
readonly name: "minimum";
|
|
3424
|
+
readonly type: "uint256";
|
|
3425
|
+
}];
|
|
3426
|
+
readonly name: "StalenessTooLow";
|
|
3427
|
+
readonly type: "error";
|
|
3428
|
+
}, {
|
|
3429
|
+
readonly anonymous: false;
|
|
3430
|
+
readonly inputs: readonly [{
|
|
3431
|
+
readonly indexed: false;
|
|
3432
|
+
readonly internalType: "uint256";
|
|
3433
|
+
readonly name: "oldValue";
|
|
3434
|
+
readonly type: "uint256";
|
|
3435
|
+
}, {
|
|
3436
|
+
readonly indexed: false;
|
|
3437
|
+
readonly internalType: "uint256";
|
|
3438
|
+
readonly name: "newValue";
|
|
3439
|
+
readonly type: "uint256";
|
|
3440
|
+
}];
|
|
3441
|
+
readonly name: "MaxStalenessUpdated";
|
|
3442
|
+
readonly type: "event";
|
|
3443
|
+
}, {
|
|
3444
|
+
readonly inputs: readonly [];
|
|
3445
|
+
readonly name: "MIN_STALENESS";
|
|
3446
|
+
readonly outputs: readonly [{
|
|
3447
|
+
readonly internalType: "uint256";
|
|
3448
|
+
readonly name: "";
|
|
3449
|
+
readonly type: "uint256";
|
|
3450
|
+
}];
|
|
3451
|
+
readonly stateMutability: "view";
|
|
3452
|
+
readonly type: "function";
|
|
3453
|
+
}, {
|
|
3454
|
+
readonly inputs: readonly [{
|
|
3455
|
+
readonly internalType: "string";
|
|
3456
|
+
readonly name: "_base";
|
|
3457
|
+
readonly type: "string";
|
|
3458
|
+
}];
|
|
3459
|
+
readonly name: "getPrice";
|
|
3460
|
+
readonly outputs: readonly [{
|
|
3461
|
+
readonly internalType: "uint256";
|
|
3462
|
+
readonly name: "";
|
|
3463
|
+
readonly type: "uint256";
|
|
3464
|
+
}];
|
|
3465
|
+
readonly stateMutability: "view";
|
|
3466
|
+
readonly type: "function";
|
|
3467
|
+
}, {
|
|
3468
|
+
readonly inputs: readonly [{
|
|
3469
|
+
readonly internalType: "string";
|
|
3470
|
+
readonly name: "_base";
|
|
3471
|
+
readonly type: "string";
|
|
3472
|
+
}];
|
|
3473
|
+
readonly name: "getPriceData";
|
|
3474
|
+
readonly outputs: readonly [{
|
|
3475
|
+
readonly components: readonly [{
|
|
3476
|
+
readonly internalType: "uint256";
|
|
3477
|
+
readonly name: "rate";
|
|
3478
|
+
readonly type: "uint256";
|
|
3479
|
+
}, {
|
|
3480
|
+
readonly internalType: "uint256";
|
|
3481
|
+
readonly name: "lastUpdatedBase";
|
|
3482
|
+
readonly type: "uint256";
|
|
3483
|
+
}, {
|
|
3484
|
+
readonly internalType: "uint256";
|
|
3485
|
+
readonly name: "lastUpdatedQuote";
|
|
3486
|
+
readonly type: "uint256";
|
|
3487
|
+
}];
|
|
3488
|
+
readonly internalType: "struct IStdReference.ReferenceData";
|
|
3489
|
+
readonly name: "";
|
|
3490
|
+
readonly type: "tuple";
|
|
3491
|
+
}];
|
|
3492
|
+
readonly stateMutability: "view";
|
|
3493
|
+
readonly type: "function";
|
|
3494
|
+
}, {
|
|
3495
|
+
readonly inputs: readonly [{
|
|
3496
|
+
readonly internalType: "string";
|
|
3497
|
+
readonly name: "_base";
|
|
3498
|
+
readonly type: "string";
|
|
3499
|
+
}];
|
|
3500
|
+
readonly name: "getPriceWithMeta";
|
|
3501
|
+
readonly outputs: readonly [{
|
|
3502
|
+
readonly internalType: "uint256";
|
|
3503
|
+
readonly name: "rate";
|
|
3504
|
+
readonly type: "uint256";
|
|
3505
|
+
}, {
|
|
3506
|
+
readonly internalType: "uint256";
|
|
3507
|
+
readonly name: "lastUpdated";
|
|
3508
|
+
readonly type: "uint256";
|
|
3509
|
+
}, {
|
|
3510
|
+
readonly internalType: "uint256";
|
|
3511
|
+
readonly name: "blockTimestamp";
|
|
3512
|
+
readonly type: "uint256";
|
|
3513
|
+
}];
|
|
3514
|
+
readonly stateMutability: "view";
|
|
3515
|
+
readonly type: "function";
|
|
3516
|
+
}, {
|
|
3517
|
+
readonly inputs: readonly [];
|
|
3518
|
+
readonly name: "maxStaleness";
|
|
3519
|
+
readonly outputs: readonly [{
|
|
3520
|
+
readonly internalType: "uint256";
|
|
3521
|
+
readonly name: "";
|
|
3522
|
+
readonly type: "uint256";
|
|
3523
|
+
}];
|
|
3524
|
+
readonly stateMutability: "view";
|
|
3525
|
+
readonly type: "function";
|
|
3526
|
+
}, {
|
|
3527
|
+
readonly inputs: readonly [];
|
|
3528
|
+
readonly name: "owner";
|
|
3529
|
+
readonly outputs: readonly [{
|
|
3530
|
+
readonly internalType: "address";
|
|
3531
|
+
readonly name: "";
|
|
3532
|
+
readonly type: "address";
|
|
3533
|
+
}];
|
|
3534
|
+
readonly stateMutability: "view";
|
|
3535
|
+
readonly type: "function";
|
|
3536
|
+
}, {
|
|
3537
|
+
readonly inputs: readonly [];
|
|
3538
|
+
readonly name: "ref";
|
|
3539
|
+
readonly outputs: readonly [{
|
|
3540
|
+
readonly internalType: "contract IStdReference";
|
|
3541
|
+
readonly name: "";
|
|
3542
|
+
readonly type: "address";
|
|
3543
|
+
}];
|
|
3544
|
+
readonly stateMutability: "view";
|
|
3545
|
+
readonly type: "function";
|
|
3546
|
+
}, {
|
|
3547
|
+
readonly inputs: readonly [{
|
|
3548
|
+
readonly internalType: "uint256";
|
|
3549
|
+
readonly name: "_maxStaleness";
|
|
3550
|
+
readonly type: "uint256";
|
|
3551
|
+
}];
|
|
3552
|
+
readonly name: "setMaxStaleness";
|
|
3553
|
+
readonly outputs: readonly [];
|
|
3554
|
+
readonly stateMutability: "nonpayable";
|
|
3555
|
+
readonly type: "function";
|
|
3556
|
+
}];
|
|
3557
|
+
|
|
3558
|
+
declare const CONTRACT_ADDRESSES: Record<number, Record<string, string>>;
|
|
3559
|
+
declare const SUPPORTED_TOKENS: TokenConfig[];
|
|
3560
|
+
|
|
3561
|
+
declare const MINIMUM_PORTAL_IN_AMOUNTS: Record<string, string>;
|
|
3562
|
+
declare const ERC20_ABI: readonly ["function balanceOf(address owner) view returns (uint256)", "function allowance(address owner, address spender) view returns (uint256)", "function approve(address spender, uint256 value) returns (bool)", "function transfer(address to, uint256 value) returns (bool)", "function transferFrom(address from, address to, uint256 value) returns (bool)", "function decimals() view returns (uint8)", "function symbol() view returns (string)", "function name() view returns (string)"];
|
|
3563
|
+
|
|
3564
|
+
declare const LIMITS: Record<string, {
|
|
3565
|
+
min: number;
|
|
3566
|
+
max: number;
|
|
3567
|
+
}>;
|
|
3568
|
+
|
|
3569
|
+
interface UseMetamaskCallbacks {
|
|
3570
|
+
onNetworkChanged?: () => Promise<void>;
|
|
3571
|
+
onAccountChanged?: (account: string) => Promise<void>;
|
|
3572
|
+
onDisconnect?: () => void;
|
|
3573
|
+
onSnapCheck?: (account: string) => void;
|
|
3574
|
+
}
|
|
3575
|
+
/**
|
|
3576
|
+
* Custom hook to manage Metamask wallet interactions, including network management and connection.
|
|
3577
|
+
*
|
|
3578
|
+
* This hook provides a unified interface for:
|
|
3579
|
+
* 1. **Network Identification**: Detecting the current network and mapping it to a human-readable name.
|
|
3580
|
+
* 2. **Network Switching**: Requesting the wallet to switch chains (and adding the chain if missing).
|
|
3581
|
+
* 3. **Wallet Connection**: Handling the permissions request and account retrieval flow.
|
|
3582
|
+
* 4. **State Refresh**: Triggering manual updates of the network and account state.
|
|
3583
|
+
* 5. **Event Listeners**: Handling accountsChanged and chainChanged events automatically.
|
|
3584
|
+
*
|
|
3585
|
+
* @param callbacks - Object containing optional callbacks for various events.
|
|
3586
|
+
* @returns {Object} An object containing helper functions and constants.
|
|
3587
|
+
*/
|
|
3588
|
+
declare const useMetamask: ({ onNetworkChanged, onAccountChanged, onDisconnect, onSnapCheck }?: UseMetamaskCallbacks) => {
|
|
3589
|
+
networkName: string;
|
|
3590
|
+
chainId: string | null;
|
|
3591
|
+
checkNetwork: (provider: ethers.BrowserProvider) => Promise<void>;
|
|
3592
|
+
switchNetwork: (targetChainId: string) => Promise<boolean>;
|
|
3593
|
+
connectWallet: (onConnect: (account: string) => Promise<void>) => Promise<boolean>;
|
|
3594
|
+
refreshNetworkState: () => Promise<void>;
|
|
3595
|
+
registerEthereumInitializedListener: (callback: () => void) => void;
|
|
3596
|
+
COTI_MAINNET_ID: string;
|
|
3597
|
+
COTI_TESTNET_ID: string;
|
|
3598
|
+
SEPOLIA_ID: string;
|
|
3599
|
+
};
|
|
3600
|
+
|
|
3601
|
+
/**
|
|
3602
|
+
* A 256-bit encrypted value composed of four 64-bit segments.
|
|
3603
|
+
* Supports two on-chain representations:
|
|
3604
|
+
* - Flat: { ciphertextHigh, ciphertextLow } (two uint256 values)
|
|
3605
|
+
* - Nested: { high: { high, low }, low: { high, low } } (four uint256 values)
|
|
3606
|
+
*/
|
|
3607
|
+
type CtUint256 = {
|
|
3608
|
+
ciphertextHigh: bigint;
|
|
3609
|
+
ciphertextLow: bigint;
|
|
3610
|
+
} | {
|
|
3611
|
+
high: {
|
|
3612
|
+
high: bigint;
|
|
3613
|
+
low: bigint;
|
|
3614
|
+
};
|
|
3615
|
+
low: {
|
|
3616
|
+
high: bigint;
|
|
3617
|
+
low: bigint;
|
|
3618
|
+
};
|
|
3619
|
+
};
|
|
3620
|
+
|
|
3621
|
+
interface PrivateBalanceDecryptOptions {
|
|
3622
|
+
decryptCtUint64?: (value: bigint | string | number, chainId?: number | string, accountAddress?: string) => Promise<bigint | null>;
|
|
3623
|
+
decryptCtUint256?: (value: CtUint256, chainId?: number | string, accountAddress?: string) => Promise<bigint | null>;
|
|
3624
|
+
}
|
|
3625
|
+
/**
|
|
3626
|
+
* Fetches and decrypts confidential token balances.
|
|
3627
|
+
*
|
|
3628
|
+
* Encrypted 256-bit balances always use flat ctUint256. Native PoD pTokens
|
|
3629
|
+
* (p.ETH, p.AVAX) are requested via {@link isPlainBalance}, but the actual
|
|
3630
|
+
* on-chain shape is detected from the return data: current deployments store
|
|
3631
|
+
* encrypted ctUint256 (64 bytes) while legacy ones stored plain uint256 (32 bytes).
|
|
3632
|
+
*/
|
|
3633
|
+
declare const usePrivateTokenBalance: () => {
|
|
3634
|
+
fetchPrivateBalance: (userAddress: string, aesKey: string, contractAddress: string, version: 64 | 256, decimals?: number, _readChainId?: number, isPlainBalance?: boolean, decryptOptions?: PrivateBalanceDecryptOptions) => Promise<string>;
|
|
3635
|
+
};
|
|
3636
|
+
|
|
3637
|
+
/**
|
|
3638
|
+
* Normalized wallet type derived from wagmi's stable `connector.id`.
|
|
3639
|
+
* Uses connector.id (wagmi-controlled) — NOT window.ethereum.isMetaMask.
|
|
3640
|
+
*/
|
|
3641
|
+
type WalletType = 'metamask' | 'coinbase' | 'walletconnect' | 'rainbow' | 'phantom' | 'trust' | 'rabby' | 'zerion' | 'ledger' | 'unknown';
|
|
3642
|
+
/**
|
|
3643
|
+
* Information about the connected wallet type and its capabilities.
|
|
3644
|
+
*/
|
|
3645
|
+
interface WalletTypeInfo {
|
|
3646
|
+
/** True only when connector is MetaMask AND COTI Snap is installed */
|
|
3647
|
+
isMetaMaskWithSnap: boolean;
|
|
3648
|
+
/** Normalized wallet identifier derived from connector.id */
|
|
3649
|
+
walletType: WalletType;
|
|
3650
|
+
/** Raw wagmi connector.id value */
|
|
3651
|
+
connectorId: string | undefined;
|
|
3652
|
+
}
|
|
3653
|
+
/**
|
|
3654
|
+
* Detects the connected wallet type using wagmi's stable `connector.id`.
|
|
3655
|
+
* Returns routing information for AES key retrieval.
|
|
3656
|
+
*
|
|
3657
|
+
* Security: Uses `connector.id` (wagmi-controlled, stable) rather than
|
|
3658
|
+
* `window.ethereum.isMetaMask` (self-reported, spoofable by any wallet).
|
|
3659
|
+
*
|
|
3660
|
+
* When the wallet type is 'metamask', performs an async Snap installation check
|
|
3661
|
+
* via `wallet_getSnaps` to determine if the COTI Snap is available.
|
|
3662
|
+
*
|
|
3663
|
+
* @returns WalletTypeInfo with wallet type, snap capability, and raw connector ID
|
|
3664
|
+
*/
|
|
3665
|
+
declare function useWalletType(): WalletTypeInfo;
|
|
3666
|
+
|
|
3667
|
+
/**
|
|
3668
|
+
* Onboarding step identifiers matching the contract onboarding flow (steps 3-9).
|
|
3669
|
+
*/
|
|
3670
|
+
type OnboardingStep = 'idle' | 'switching-network' | 'creating-provider' | 'preparing-onboard' | 'signing-transaction' | 'retrieving-key' | 'validating-key' | 'restoring-network' | 'persisting-key' | 'restoring-backup' | 'signing-backup' | 'granting-funds' | 'waiting-for-funds' | 'saving-backup' | 'complete' | 'error';
|
|
3671
|
+
/**
|
|
3672
|
+
* Metadata for each onboarding step (for progress display).
|
|
3673
|
+
*/
|
|
3674
|
+
interface OnboardingStepInfo {
|
|
3675
|
+
id: OnboardingStep;
|
|
3676
|
+
label: string;
|
|
3677
|
+
description: string;
|
|
3678
|
+
}
|
|
3679
|
+
/**
|
|
3680
|
+
* Ordered list of steps shown in the progress UI (steps 3–9 from the onboarding flow doc).
|
|
3681
|
+
*/
|
|
3682
|
+
declare const ONBOARDING_STEPS: OnboardingStepInfo[];
|
|
3683
|
+
interface OnboardingProgressDetails {
|
|
3684
|
+
/** True when the step transition was caused by explicit user cancellation. */
|
|
3685
|
+
cancelled?: boolean;
|
|
3686
|
+
/** Human-facing failure message for error transitions. */
|
|
3687
|
+
error?: string;
|
|
3688
|
+
}
|
|
3689
|
+
/**
|
|
3690
|
+
* Callback type for receiving onboarding step progress updates.
|
|
3691
|
+
*/
|
|
3692
|
+
type OnboardingProgressCallback = (step: OnboardingStep, details?: OnboardingProgressDetails) => void;
|
|
3693
|
+
interface AesKeyProviderOptions {
|
|
3694
|
+
/**
|
|
3695
|
+
* Skip Snap retrieval and use the AccountOnboard contract path.
|
|
3696
|
+
* Required when Snap holds a key for the wrong MetaMask profile.
|
|
3697
|
+
*/
|
|
3698
|
+
forceContractOnboarding?: boolean;
|
|
3699
|
+
/** Whether contract-onboarding should save a client-encrypted AES backup. */
|
|
3700
|
+
saveBackup?: boolean;
|
|
3701
|
+
/** Only restore via Snap-side decrypt / backup; never export raw key or run contract onboarding. */
|
|
3702
|
+
restoreOnly?: boolean;
|
|
3703
|
+
/** Unlock via Snap typed decrypt RPC (no raw AES export). Used when AES is already stored in Snap. */
|
|
3704
|
+
snapSideDecrypt?: boolean;
|
|
3705
|
+
/** COTI Testnet/Mainnet chain that owns the AES key for this flow. */
|
|
3706
|
+
aesKeyChainId?: number;
|
|
3707
|
+
/** Decrypt encrypted backup blob, persist AES to Snap, return null (no raw key to dapp). */
|
|
3708
|
+
hydrateSnapFromBackup?: boolean;
|
|
3709
|
+
/** Receives contract-onboarding step updates for modal progress UI. */
|
|
3710
|
+
onProgress?: OnboardingProgressCallback;
|
|
3711
|
+
/** Called when backup restore is cancelled by the user. */
|
|
3712
|
+
onRestoreCancelled?: () => void;
|
|
3713
|
+
/** Encrypted backup blob from an earlier access probe — avoids a second fetch before sign. */
|
|
3714
|
+
prefetchedEncryptedBackup?: EncryptedAesBackup | null;
|
|
3715
|
+
}
|
|
3716
|
+
|
|
3717
|
+
/** Wallet connection slice — connect/disconnect and address. */
|
|
3718
|
+
interface PrivacyBridgeWalletContextValue {
|
|
3719
|
+
isConnected: boolean;
|
|
3720
|
+
walletAddress: string;
|
|
3721
|
+
handleConnect: () => Promise<void>;
|
|
3722
|
+
handleDisconnect: () => Promise<void>;
|
|
3723
|
+
metamaskDetected: boolean;
|
|
3724
|
+
}
|
|
3725
|
+
/** Network slice — chain id, switching, and enforcer state. */
|
|
3726
|
+
interface PrivacyBridgeNetworkContextValue {
|
|
3727
|
+
chainId: string | null;
|
|
3728
|
+
switchNetwork: (chainId: string) => Promise<boolean>;
|
|
3729
|
+
networkName: string;
|
|
3730
|
+
isUnsupportedNetwork: boolean;
|
|
3731
|
+
isOffTargetNetwork: boolean;
|
|
3732
|
+
/** @deprecated Use isUnsupportedNetwork */
|
|
3733
|
+
isWrongNetwork: boolean;
|
|
3734
|
+
networkMismatchWarning: string | null;
|
|
3735
|
+
enforceNetwork: () => Promise<void>;
|
|
3736
|
+
COTI_MAINNET_ID: string;
|
|
3737
|
+
COTI_TESTNET_ID: string;
|
|
3738
|
+
SEPOLIA_ID: string;
|
|
3739
|
+
}
|
|
3740
|
+
/** Snap / AES unlock slice. */
|
|
3741
|
+
interface PrivacyBridgeUnlockContextValue {
|
|
3742
|
+
hasSnap: boolean;
|
|
3743
|
+
snapError: string | null;
|
|
3744
|
+
/** True/false when check succeeds; null when Snap is unavailable. */
|
|
3745
|
+
hasAesKeyInSnap: (accountAddress?: string) => Promise<boolean | null>;
|
|
3746
|
+
connectToSnap: () => Promise<boolean>;
|
|
3747
|
+
requestSnapConnection: () => Promise<boolean>;
|
|
3748
|
+
/** Probes Snap via wallet_getSnaps, updates hasSnap, and returns the result. */
|
|
3749
|
+
checkSnapStatus: () => Promise<boolean>;
|
|
3750
|
+
/** Session-bound AES key. Locking hides balances but may keep this key in memory. */
|
|
3751
|
+
sessionAesKey: string | null;
|
|
3752
|
+
/** COTI Testnet/Mainnet chain used for AES onboarding, Snap, and backup state. */
|
|
3753
|
+
aesKeyChainId: number | undefined;
|
|
3754
|
+
/** Set a session/connection AES key chain. Only COTI Testnet/Mainnet are accepted. */
|
|
3755
|
+
setAesKeyChainId: (chainId: number | undefined) => void;
|
|
3756
|
+
/** True when private balances are visible. This is not the same as key existence. */
|
|
3757
|
+
isPrivateUnlocked: boolean;
|
|
3758
|
+
sendPrivateToken: (params: {
|
|
3759
|
+
symbol: string;
|
|
3760
|
+
recipient: string;
|
|
3761
|
+
amount: string;
|
|
3762
|
+
}) => Promise<{
|
|
3763
|
+
txHash: string;
|
|
3764
|
+
}>;
|
|
3765
|
+
/** Encrypt a human-readable amount into ctUint256 JSON without exposing the AES key. */
|
|
3766
|
+
encryptPrivateValue: (params: {
|
|
3767
|
+
amount: string;
|
|
3768
|
+
decimals?: number;
|
|
3769
|
+
}) => Promise<{
|
|
3770
|
+
ciphertext: string;
|
|
3771
|
+
}>;
|
|
3772
|
+
/** Decrypt ctUint256 JSON back to a human-readable amount without exposing the AES key. */
|
|
3773
|
+
decryptPrivateValue: (params: {
|
|
3774
|
+
ciphertext: string;
|
|
3775
|
+
decimals?: number;
|
|
3776
|
+
}) => Promise<{
|
|
3777
|
+
amount: string;
|
|
3778
|
+
}>;
|
|
3779
|
+
/** Low-level balance/key refresh primitive. App UI should not orchestrate unlock with this. */
|
|
3780
|
+
refreshPrivateBalances: (options?: AesKeyProviderOptions) => Promise<boolean>;
|
|
3781
|
+
/** Last contract-onboarding error produced by the AES provider. */
|
|
3782
|
+
onboardingError: string | null;
|
|
3783
|
+
/** Last non-blocking onboarding warning produced by restore/backup flows. */
|
|
3784
|
+
onboardingWarning: string | null;
|
|
3785
|
+
/** Hides private balances and clears plaintext AES session state. */
|
|
3786
|
+
lockPrivateBalances: () => void;
|
|
3787
|
+
handleOnboard: () => Promise<string | null>;
|
|
3788
|
+
saveManualAesKey: (aesKey: string, options?: Pick<AesKeyProviderOptions, 'saveBackup' | 'onProgress'>) => Promise<{
|
|
3789
|
+
backupWarning?: string;
|
|
3790
|
+
backupCancelled?: boolean;
|
|
3791
|
+
}>;
|
|
3792
|
+
handleVerifyKeys: () => Promise<void>;
|
|
3793
|
+
showSnapMissingModal: boolean;
|
|
3794
|
+
setShowSnapMissingModal: (show: boolean) => void;
|
|
3795
|
+
showCotiWalletAesKeyModal: boolean;
|
|
3796
|
+
setShowCotiWalletAesKeyModal: (show: boolean) => void;
|
|
3797
|
+
}
|
|
3798
|
+
/** Token balances exposed to the UI. */
|
|
3799
|
+
interface PrivacyBridgeTokensContextValue {
|
|
3800
|
+
publicTokens: Token[];
|
|
3801
|
+
privateTokens: Token[];
|
|
3802
|
+
}
|
|
3803
|
+
/** Bridge / swap form and transaction slice. */
|
|
3804
|
+
interface PrivacyBridgeSwapContextValue {
|
|
3805
|
+
amount: string;
|
|
3806
|
+
direction: 'to-private' | 'to-public';
|
|
3807
|
+
selectedTokenIndex: number;
|
|
3808
|
+
setAmount: (amount: string) => void;
|
|
3809
|
+
setDirection: (direction: 'to-private' | 'to-public') => void;
|
|
3810
|
+
setSelectedTokenIndex: (index: number) => void;
|
|
3811
|
+
handleSwap: (amount?: string, direction?: 'to-private' | 'to-public', tokenIndex?: number, onProgress?: (stage: SwapProgressStage, txHash?: string) => void) => Promise<void>;
|
|
3812
|
+
isBridgingLoading: boolean;
|
|
3813
|
+
isApprovalNeeded: boolean;
|
|
3814
|
+
isApproving: boolean;
|
|
3815
|
+
handleApprove: () => Promise<void>;
|
|
3816
|
+
estimatedGasFee: string | null;
|
|
3817
|
+
updateGasFee: () => Promise<void>;
|
|
3818
|
+
isGasEstimating: boolean;
|
|
3819
|
+
/** COTI bridge portal fee (COTI-denominated). Null on PoD chains. */
|
|
3820
|
+
portalFeeCoti: string | null;
|
|
3821
|
+
/** PoD Privacy Portal fee in native token (ETH/AVAX). Null on COTI chains. */
|
|
3822
|
+
portalFee: string | null;
|
|
3823
|
+
/** Native symbol for {@link portalFee} (e.g. ETH, AVAX). */
|
|
3824
|
+
portalFeeSymbol: string;
|
|
3825
|
+
/** PoD inbox fee paid via msg.value. Null on COTI chains. */
|
|
3826
|
+
podInboxFee: string | null;
|
|
3827
|
+
/** L1 execution gas estimate (wallet-paid). Null on COTI chains. */
|
|
3828
|
+
l1GasFee: string | null;
|
|
3829
|
+
/** True when connected chain uses pod-privacy-portal strategy. */
|
|
3830
|
+
isPodChain: boolean;
|
|
3831
|
+
feeDebugInfo: {
|
|
3832
|
+
cotiLastUpdated: string;
|
|
3833
|
+
tokenLastUpdated: string;
|
|
3834
|
+
blockTimestamp: string;
|
|
3835
|
+
} | null;
|
|
3836
|
+
}
|
|
3837
|
+
/** PoD portal request tracking (Sepolia). */
|
|
3838
|
+
interface PrivacyBridgePodContextValue {
|
|
3839
|
+
podRequests: PodPortalRequest[];
|
|
3840
|
+
refreshPodRequest: (request: PodPortalRequest) => Promise<void>;
|
|
3841
|
+
}
|
|
3842
|
+
/** Install / conflict modals not tied to unlock flow. */
|
|
3843
|
+
interface PrivacyBridgeModalsContextValue {
|
|
3844
|
+
showInstallModal: boolean;
|
|
3845
|
+
setShowInstallModal: (show: boolean) => void;
|
|
3846
|
+
showMultipleWalletsModal: boolean;
|
|
3847
|
+
setShowMultipleWalletsModal: (show: boolean) => void;
|
|
3848
|
+
}
|
|
3849
|
+
/**
|
|
3850
|
+
* Legacy flat context — union of all slices.
|
|
3851
|
+
* Existing consumers should keep using {@link usePrivacyBridgeContext}.
|
|
3852
|
+
*/
|
|
3853
|
+
type PrivacyBridgeContextType = PrivacyBridgeWalletContextValue & PrivacyBridgeNetworkContextValue & PrivacyBridgeUnlockContextValue & PrivacyBridgeTokensContextValue & PrivacyBridgeSwapContextValue & PrivacyBridgePodContextValue & PrivacyBridgeModalsContextValue;
|
|
3854
|
+
|
|
3855
|
+
type UpdateAccountStateOptions = {
|
|
3856
|
+
/** When true, validate MetaMask Snap keys on unlock (reuses session key when present). */
|
|
3857
|
+
validateOnUnlock?: boolean;
|
|
3858
|
+
};
|
|
3859
|
+
|
|
3860
|
+
interface UseBalanceUpdaterProps {
|
|
3861
|
+
setWalletAddress: (address: string) => void;
|
|
3862
|
+
setIsConnected: (connected: boolean) => void;
|
|
3863
|
+
setHasSnap: (hasSnap: boolean) => void;
|
|
3864
|
+
setPublicTokens: React.Dispatch<React.SetStateAction<Token[]>>;
|
|
3865
|
+
setPrivateTokens: React.Dispatch<React.SetStateAction<Token[]>>;
|
|
3866
|
+
checkNetwork: (provider: ethers.BrowserProvider) => Promise<void>;
|
|
3867
|
+
getAESKeyFromSnap: (accountAddress: string, options?: {
|
|
3868
|
+
skipCache?: boolean;
|
|
3869
|
+
} & AesKeyProviderOptions) => Promise<string | null>;
|
|
3870
|
+
fetchPrivateBalance: (userAddress: string, aesKey: string, contractAddress: string, version: 64 | 256, decimals?: number, readChainId?: number, isPlainBalance?: boolean, decryptOptions?: PrivateBalanceDecryptOptions) => Promise<string>;
|
|
3871
|
+
canUseSnapOperations?: boolean;
|
|
3872
|
+
snapDecryptOptions?: PrivateBalanceDecryptOptions;
|
|
3873
|
+
sessionAesKey?: string | null;
|
|
3874
|
+
setSessionAesKey: (key: string | null, keyWallet?: string) => void;
|
|
3875
|
+
/** MetaMask-only: read-only Snap key validation on explicit unlock. */
|
|
3876
|
+
validateMetaMaskAesKeyOnUnlock?: (snapKey: string, accountAddress: string, connectedChainId?: number | null) => Promise<void>;
|
|
3877
|
+
}
|
|
3878
|
+
/**
|
|
3879
|
+
* Custom hook to handle account state updates and balance fetching.
|
|
3880
|
+
* Dynamically iterates over SUPPORTED_TOKENS filtered by chain — no hardcoded token lists.
|
|
3881
|
+
*
|
|
3882
|
+
* @param props - State setters and helper functions required for updating the account.
|
|
3883
|
+
* @returns An object containing the `updateAccountState` function.
|
|
3884
|
+
*/
|
|
3885
|
+
declare const useBalanceUpdater: ({ setWalletAddress, setIsConnected, setHasSnap, setPublicTokens, setPrivateTokens, checkNetwork, getAESKeyFromSnap, fetchPrivateBalance, canUseSnapOperations, snapDecryptOptions, sessionAesKey, setSessionAesKey, validateMetaMaskAesKeyOnUnlock, }: UseBalanceUpdaterProps) => {
|
|
3886
|
+
updateAccountState: (account: string, checkSnap?: boolean, fetchPrivate?: boolean, aesKeyOverride?: string | null, chainOverride?: number, options?: UpdateAccountStateOptions & AesKeyProviderOptions) => Promise<boolean>;
|
|
3887
|
+
};
|
|
3888
|
+
|
|
3889
|
+
type BridgeStatus = 'active' | 'paused';
|
|
3890
|
+
declare function useBridgeStatus(bridge: BridgeData): BridgeStatus;
|
|
3891
|
+
|
|
3892
|
+
interface FeeEstimate {
|
|
3893
|
+
depositFee: string;
|
|
3894
|
+
withdrawFee: string;
|
|
3895
|
+
cotiLastUpdated: string;
|
|
3896
|
+
tokenLastUpdated: string;
|
|
3897
|
+
blockTimestamp: string;
|
|
3898
|
+
}
|
|
3899
|
+
declare function estimateBridgeFee(symbol: string, amount: string, provider: ethers.JsonRpcProvider | ethers.BrowserProvider): Promise<FeeEstimate>;
|
|
3900
|
+
|
|
3901
|
+
/**
|
|
3902
|
+
* Typed EIP-1193 provider interface for window.ethereum access.
|
|
3903
|
+
* Eliminates `as any` casts throughout the codebase.
|
|
3904
|
+
*/
|
|
3905
|
+
interface EIP1193Provider {
|
|
3906
|
+
request: (args: {
|
|
3907
|
+
method: string;
|
|
3908
|
+
params?: unknown[] | Record<string, unknown>;
|
|
3909
|
+
}) => Promise<any>;
|
|
3910
|
+
isMetaMask?: boolean;
|
|
3911
|
+
isRabby?: boolean;
|
|
3912
|
+
isPhantom?: boolean;
|
|
3913
|
+
on?: (event: string, handler: (...args: any[]) => void) => void;
|
|
3914
|
+
removeListener?: (event: string, handler: (...args: any[]) => void) => void;
|
|
3915
|
+
providers?: EIP1193Provider[];
|
|
3916
|
+
}
|
|
3917
|
+
interface InjectedWalletTarget {
|
|
3918
|
+
id: string;
|
|
3919
|
+
name: string;
|
|
3920
|
+
provider: EIP1193Provider;
|
|
3921
|
+
}
|
|
3922
|
+
/**
|
|
3923
|
+
* Returns the EIP-6963 discovered MetaMask provider when available.
|
|
3924
|
+
*/
|
|
3925
|
+
declare function getEip6963MetaMaskProvider(): EIP1193Provider | null;
|
|
3926
|
+
declare function getEip6963RabbyProvider(): EIP1193Provider | null;
|
|
3927
|
+
/**
|
|
3928
|
+
* Resolves the MetaMask injected target for wagmi/RainbowKit.
|
|
3929
|
+
* Never returns undefined — wagmi's injected() connector falls back to
|
|
3930
|
+
* window.ethereum (often Rabby) when target() is undefined.
|
|
3931
|
+
*/
|
|
3932
|
+
declare function resolveMetaMaskInjectedTarget(): InjectedWalletTarget;
|
|
3933
|
+
/**
|
|
3934
|
+
* Resolves the Rabby injected target for wagmi/RainbowKit.
|
|
3935
|
+
* Never returns undefined — avoids wagmi falling back to a generic injected provider.
|
|
3936
|
+
*/
|
|
3937
|
+
declare function resolveRabbyInjectedTarget(): InjectedWalletTarget;
|
|
3938
|
+
/**
|
|
3939
|
+
* Returns the typed EIP-1193 provider from `window.ethereum`, or null if unavailable.
|
|
3940
|
+
* Use this instead of `window.ethereum as any` throughout the codebase.
|
|
3941
|
+
* Handles the case where window.ethereum access may throw due to property
|
|
3942
|
+
* redefinition conflicts between wallet extensions.
|
|
3943
|
+
*/
|
|
3944
|
+
declare function getEthereumProvider(): EIP1193Provider | null;
|
|
3945
|
+
/** Minimal wagmi-connector shape needed to resolve its EIP-1193 provider. */
|
|
3946
|
+
interface ConnectorProviderSource {
|
|
3947
|
+
getProvider?: (params?: {
|
|
3948
|
+
chainId?: number;
|
|
3949
|
+
}) => Promise<unknown>;
|
|
3950
|
+
}
|
|
3951
|
+
/**
|
|
3952
|
+
* Resolves the EIP-1193 provider for the wallet the user actually connected.
|
|
3953
|
+
* Prefers the wagmi connector's provider (the exact wallet chosen via
|
|
3954
|
+
* RainbowKit), then the EIP-6963 MetaMask provider, and only then the
|
|
3955
|
+
* window.ethereum global — which belongs to whichever extension won the
|
|
3956
|
+
* injection race when multiple wallets are installed, so signing through it
|
|
3957
|
+
* can pop up a wallet the user never connected.
|
|
3958
|
+
*/
|
|
3959
|
+
declare function resolveConnectedProvider(connector?: ConnectorProviderSource | null): Promise<EIP1193Provider | null>;
|
|
3960
|
+
|
|
3961
|
+
/** Matches coti-snap useTokenOperations private 256-bit transfer selector. */
|
|
3962
|
+
declare const PRIVATE_ERC20_TRANSFER_256_SIG = "transfer(address,((uint256,uint256),bytes))";
|
|
3963
|
+
declare function resolvePrivateTokenContractAddress(chainId: number, addressKey: string): string | undefined;
|
|
3964
|
+
declare function resolvePrivateTokenTransferTarget(chainId: number, symbol: string): {
|
|
3965
|
+
tokenAddress: string;
|
|
3966
|
+
decimals: number;
|
|
3967
|
+
addressKey: string;
|
|
3968
|
+
} | null;
|
|
3969
|
+
|
|
3970
|
+
interface NetworkEnforcerResult {
|
|
3971
|
+
/** Wallet is on a chain outside {@link CHAIN_CONFIGS} */
|
|
3972
|
+
isUnsupportedNetwork: boolean;
|
|
3973
|
+
/** Wallet is on a supported chain but not the configured enforcement target */
|
|
3974
|
+
isOffTargetNetwork: boolean;
|
|
3975
|
+
/**
|
|
3976
|
+
* @deprecated Use {@link isUnsupportedNetwork}. Kept for backward compatibility.
|
|
3977
|
+
*/
|
|
3978
|
+
isWrongNetwork: boolean;
|
|
3979
|
+
/** Error/warning message when network switch is rejected or fails */
|
|
3980
|
+
networkMismatchWarning: string | null;
|
|
3981
|
+
/** Manually trigger network enforcement (switches to configured target) */
|
|
3982
|
+
enforceNetwork: () => Promise<void>;
|
|
3983
|
+
}
|
|
3984
|
+
/**
|
|
3985
|
+
* Network enforcement hook that supports both MetaMask (direct RPC) and
|
|
3986
|
+
* non-MetaMask wallets.
|
|
3987
|
+
*
|
|
3988
|
+
* - Both paths use the provided `switchNetwork` callback (the unified router),
|
|
3989
|
+
* which handles WalletConnect sessions (namespace check, wallet_addEthereumChain
|
|
3990
|
+
* push, deep-link foregrounding) as well as injected providers
|
|
3991
|
+
* - {@link isUnsupportedNetwork}: chain ∉ {@link CHAIN_CONFIGS}
|
|
3992
|
+
* - {@link isOffTargetNetwork}: supported chain ≠ configured target ({@link getTargetChainId})
|
|
3993
|
+
* - {@link enforceNetwork} switches to the configured target when current chain ≠ target
|
|
3994
|
+
*
|
|
3995
|
+
* @param chainId - Current chain ID as a string (decimal or hex), used for MetaMask path
|
|
3996
|
+
* @param switchNetwork - Network switch function (wallet_switchEthereumChain or unified router)
|
|
3997
|
+
*/
|
|
3998
|
+
declare const useNetworkEnforcer: (chainId: string | null, switchNetwork: (chainId: string) => Promise<boolean>) => NetworkEnforcerResult;
|
|
3999
|
+
|
|
4000
|
+
/**
|
|
4001
|
+
* Props for the OnboardModal component.
|
|
4002
|
+
*/
|
|
4003
|
+
interface OnboardModalProps {
|
|
4004
|
+
/** Whether the modal is currently visible */
|
|
4005
|
+
isOpen: boolean;
|
|
4006
|
+
/** Callback to close the modal without completing onboarding */
|
|
4007
|
+
onClose: () => void;
|
|
4008
|
+
/** Callback to initiate or retry the onboarding signature flow */
|
|
4009
|
+
onConfirm: () => void;
|
|
4010
|
+
/** Whether the generateOrRecoverAes() call is in progress */
|
|
4011
|
+
isLoading: boolean;
|
|
4012
|
+
/** Error message from a failed onboarding attempt, or null */
|
|
4013
|
+
error: string | null;
|
|
4014
|
+
/** The type of wallet connected (for display purposes) */
|
|
4015
|
+
walletType: WalletType;
|
|
4016
|
+
/** Current onboarding step (for progress display) */
|
|
4017
|
+
currentStep?: OnboardingStep;
|
|
4018
|
+
/** Retrieved AES key (shown on success screen) */
|
|
4019
|
+
aesKey?: string | null;
|
|
4020
|
+
/** Whether encrypted AES backup should be saved after contract onboarding */
|
|
4021
|
+
saveBackup?: boolean;
|
|
4022
|
+
/** When false, hides the encrypted-backup checkbox (e.g. MetaMask Snap stores the key). */
|
|
4023
|
+
showSaveBackupOption?: boolean;
|
|
4024
|
+
/** Called when the encrypted-backup checkbox changes */
|
|
4025
|
+
onSaveBackupChange?: (saveBackup: boolean) => void;
|
|
4026
|
+
/** Called when the user manually submits an AES key instead of onboarding */
|
|
4027
|
+
onManualAesKeySubmit?: (aesKey: string, options: {
|
|
4028
|
+
saveBackup: boolean;
|
|
4029
|
+
}) => void | Promise<void>;
|
|
4030
|
+
/** Non-blocking warning from restore/backup flows */
|
|
4031
|
+
warning?: string | null;
|
|
4032
|
+
/** Optional theme overrides for customizing the modal appearance */
|
|
4033
|
+
theme?: OnboardModalTheme;
|
|
4034
|
+
}
|
|
4035
|
+
/**
|
|
4036
|
+
* Theme override for the OnboardModal.
|
|
4037
|
+
* Each key corresponds to a style target. Provide a partial CSSProperties object
|
|
4038
|
+
* to override specific CSS properties while keeping the rest as defaults.
|
|
4039
|
+
*/
|
|
4040
|
+
type OnboardModalTheme = {
|
|
4041
|
+
[K in keyof typeof defaultStyles]?: react.CSSProperties;
|
|
4042
|
+
};
|
|
4043
|
+
/** Inline styles for the modal — keeps the component self-contained without external UI deps */
|
|
4044
|
+
declare const defaultStyles: {
|
|
4045
|
+
readonly backdrop: {
|
|
4046
|
+
readonly position: "fixed";
|
|
4047
|
+
readonly inset: 0;
|
|
4048
|
+
readonly backgroundColor: "rgba(0, 0, 0, 0.6)";
|
|
4049
|
+
readonly backdropFilter: "blur(4px)";
|
|
4050
|
+
readonly zIndex: 50;
|
|
4051
|
+
readonly display: "flex";
|
|
4052
|
+
readonly alignItems: "center";
|
|
4053
|
+
readonly justifyContent: "center";
|
|
4054
|
+
readonly padding: "1rem";
|
|
4055
|
+
};
|
|
4056
|
+
readonly modal: {
|
|
4057
|
+
readonly backgroundColor: "#04133D";
|
|
4058
|
+
readonly color: "#ffffff";
|
|
4059
|
+
readonly borderRadius: "16px";
|
|
4060
|
+
readonly padding: "28px";
|
|
4061
|
+
readonly width: "360px";
|
|
4062
|
+
readonly maxWidth: "100%";
|
|
4063
|
+
readonly position: "relative";
|
|
4064
|
+
readonly display: "flex";
|
|
4065
|
+
readonly flexDirection: "column";
|
|
4066
|
+
readonly alignItems: "center";
|
|
4067
|
+
readonly textAlign: "center";
|
|
4068
|
+
readonly boxShadow: "0 25px 50px -12px rgba(0, 0, 0, 0.5)";
|
|
4069
|
+
};
|
|
4070
|
+
readonly closeButton: {
|
|
4071
|
+
readonly position: "absolute";
|
|
4072
|
+
readonly top: "12px";
|
|
4073
|
+
readonly right: "12px";
|
|
4074
|
+
readonly padding: "8px";
|
|
4075
|
+
readonly background: "none";
|
|
4076
|
+
readonly border: "none";
|
|
4077
|
+
readonly color: "rgba(255, 255, 255, 0.3)";
|
|
4078
|
+
readonly cursor: "pointer";
|
|
4079
|
+
readonly borderRadius: "50%";
|
|
4080
|
+
readonly fontSize: "14px";
|
|
4081
|
+
readonly lineHeight: 1;
|
|
4082
|
+
readonly transition: "color 0.2s";
|
|
4083
|
+
};
|
|
4084
|
+
readonly titleRow: {
|
|
4085
|
+
readonly width: "100%";
|
|
4086
|
+
readonly display: "flex";
|
|
4087
|
+
readonly alignItems: "center";
|
|
4088
|
+
readonly justifyContent: "center";
|
|
4089
|
+
readonly gap: "12px";
|
|
4090
|
+
readonly marginBottom: "16px";
|
|
4091
|
+
};
|
|
4092
|
+
readonly iconContainer: {
|
|
4093
|
+
readonly width: "40px";
|
|
4094
|
+
readonly height: "40px";
|
|
4095
|
+
readonly borderRadius: "12px";
|
|
4096
|
+
readonly backgroundColor: "rgba(30, 41, 246, 0.1)";
|
|
4097
|
+
readonly border: "1px solid rgba(30, 41, 246, 0.2)";
|
|
4098
|
+
readonly display: "flex";
|
|
4099
|
+
readonly alignItems: "center";
|
|
4100
|
+
readonly justifyContent: "center";
|
|
4101
|
+
readonly flexShrink: 0;
|
|
4102
|
+
};
|
|
4103
|
+
readonly title: {
|
|
4104
|
+
readonly fontSize: "20px";
|
|
4105
|
+
readonly fontWeight: 700;
|
|
4106
|
+
readonly lineHeight: 1.2;
|
|
4107
|
+
readonly margin: 0;
|
|
4108
|
+
readonly color: "#ffffff";
|
|
4109
|
+
readonly textAlign: "left";
|
|
4110
|
+
};
|
|
4111
|
+
readonly description: {
|
|
4112
|
+
readonly color: "rgba(255, 255, 255, 0.6)";
|
|
4113
|
+
readonly fontSize: "13px";
|
|
4114
|
+
readonly lineHeight: 1.6;
|
|
4115
|
+
readonly marginBottom: "16px";
|
|
4116
|
+
readonly maxWidth: "90%";
|
|
4117
|
+
};
|
|
4118
|
+
readonly infoBox: {
|
|
4119
|
+
readonly width: "100%";
|
|
4120
|
+
readonly backgroundColor: "rgba(255, 255, 255, 0.05)";
|
|
4121
|
+
readonly border: "1px solid rgba(255, 255, 255, 0.1)";
|
|
4122
|
+
readonly borderRadius: "8px";
|
|
4123
|
+
readonly padding: "12px";
|
|
4124
|
+
readonly marginBottom: "16px";
|
|
4125
|
+
};
|
|
4126
|
+
readonly infoText: {
|
|
4127
|
+
readonly fontSize: "11px";
|
|
4128
|
+
readonly color: "rgba(255, 255, 255, 0.8)";
|
|
4129
|
+
readonly lineHeight: 1.6;
|
|
4130
|
+
readonly margin: 0;
|
|
4131
|
+
};
|
|
4132
|
+
readonly errorBox: {
|
|
4133
|
+
readonly width: "100%";
|
|
4134
|
+
readonly boxSizing: "border-box";
|
|
4135
|
+
readonly backgroundColor: "rgba(239, 68, 68, 0.1)";
|
|
4136
|
+
readonly border: "1px solid rgba(239, 68, 68, 0.3)";
|
|
4137
|
+
readonly borderRadius: "8px";
|
|
4138
|
+
readonly padding: "12px";
|
|
4139
|
+
readonly marginBottom: "16px";
|
|
4140
|
+
};
|
|
4141
|
+
readonly errorText: {
|
|
4142
|
+
readonly fontSize: "12px";
|
|
4143
|
+
readonly color: "#f87171";
|
|
4144
|
+
readonly lineHeight: 1.5;
|
|
4145
|
+
readonly margin: 0;
|
|
4146
|
+
};
|
|
4147
|
+
readonly primaryButton: {
|
|
4148
|
+
readonly width: "100%";
|
|
4149
|
+
readonly boxSizing: "border-box";
|
|
4150
|
+
readonly padding: "10px 16px";
|
|
4151
|
+
readonly backgroundColor: "#1E29F6";
|
|
4152
|
+
readonly color: "#ffffff";
|
|
4153
|
+
readonly border: "none";
|
|
4154
|
+
readonly borderRadius: "8px";
|
|
4155
|
+
readonly fontSize: "14px";
|
|
4156
|
+
readonly fontWeight: 500;
|
|
4157
|
+
readonly cursor: "pointer";
|
|
4158
|
+
readonly marginBottom: "10px";
|
|
4159
|
+
readonly transition: "background-color 0.2s";
|
|
4160
|
+
};
|
|
4161
|
+
readonly primaryButtonDisabled: {
|
|
4162
|
+
readonly width: "100%";
|
|
4163
|
+
readonly boxSizing: "border-box";
|
|
4164
|
+
readonly padding: "10px 16px";
|
|
4165
|
+
readonly backgroundColor: "rgba(30, 41, 246, 0.5)";
|
|
4166
|
+
readonly color: "rgba(255, 255, 255, 0.6)";
|
|
4167
|
+
readonly border: "none";
|
|
4168
|
+
readonly borderRadius: "8px";
|
|
4169
|
+
readonly fontSize: "14px";
|
|
4170
|
+
readonly fontWeight: 500;
|
|
4171
|
+
readonly cursor: "not-allowed";
|
|
4172
|
+
readonly marginBottom: "10px";
|
|
4173
|
+
};
|
|
4174
|
+
readonly cancelButton: {
|
|
4175
|
+
readonly background: "none";
|
|
4176
|
+
readonly border: "none";
|
|
4177
|
+
readonly fontSize: "12px";
|
|
4178
|
+
readonly color: "rgba(255, 255, 255, 0.4)";
|
|
4179
|
+
readonly cursor: "pointer";
|
|
4180
|
+
readonly fontWeight: 500;
|
|
4181
|
+
readonly transition: "color 0.2s";
|
|
4182
|
+
};
|
|
4183
|
+
readonly saveOptionCard: {
|
|
4184
|
+
readonly width: "100%";
|
|
4185
|
+
readonly boxSizing: "border-box";
|
|
4186
|
+
readonly display: "flex";
|
|
4187
|
+
readonly alignItems: "center";
|
|
4188
|
+
readonly gap: "10px";
|
|
4189
|
+
readonly padding: "10px 12px";
|
|
4190
|
+
readonly marginBottom: "12px";
|
|
4191
|
+
readonly borderRadius: "8px";
|
|
4192
|
+
readonly border: "1px solid rgba(255, 255, 255, 0.12)";
|
|
4193
|
+
readonly backgroundColor: "rgba(255, 255, 255, 0.04)";
|
|
4194
|
+
readonly textAlign: "left";
|
|
4195
|
+
};
|
|
4196
|
+
readonly saveOptionCardActive: {
|
|
4197
|
+
readonly border: "1px solid rgba(0, 229, 255, 0.35)";
|
|
4198
|
+
readonly backgroundColor: "rgba(0, 229, 255, 0.06)";
|
|
4199
|
+
};
|
|
4200
|
+
readonly saveOptionIconWrap: {
|
|
4201
|
+
readonly width: "32px";
|
|
4202
|
+
readonly height: "32px";
|
|
4203
|
+
readonly borderRadius: "8px";
|
|
4204
|
+
readonly backgroundColor: "rgba(0, 229, 255, 0.1)";
|
|
4205
|
+
readonly border: "1px solid rgba(0, 229, 255, 0.2)";
|
|
4206
|
+
readonly display: "flex";
|
|
4207
|
+
readonly alignItems: "center";
|
|
4208
|
+
readonly justifyContent: "center";
|
|
4209
|
+
readonly flexShrink: 0;
|
|
4210
|
+
readonly color: "#00E5FF";
|
|
4211
|
+
};
|
|
4212
|
+
readonly saveOptionBody: {
|
|
4213
|
+
readonly flex: 1;
|
|
4214
|
+
readonly minWidth: 0;
|
|
4215
|
+
};
|
|
4216
|
+
readonly saveOptionTitleRow: {
|
|
4217
|
+
readonly display: "flex";
|
|
4218
|
+
readonly alignItems: "center";
|
|
4219
|
+
readonly gap: "5px";
|
|
4220
|
+
readonly marginBottom: "2px";
|
|
4221
|
+
};
|
|
4222
|
+
readonly saveOptionTitle: {
|
|
4223
|
+
readonly fontSize: "13px";
|
|
4224
|
+
readonly fontWeight: 600;
|
|
4225
|
+
readonly lineHeight: 1.25;
|
|
4226
|
+
readonly color: "#ffffff";
|
|
4227
|
+
};
|
|
4228
|
+
readonly saveOptionDescription: {
|
|
4229
|
+
readonly fontSize: "11px";
|
|
4230
|
+
readonly lineHeight: 1.3;
|
|
4231
|
+
readonly color: "rgba(255, 255, 255, 0.55)";
|
|
4232
|
+
readonly margin: 0;
|
|
4233
|
+
readonly whiteSpace: "nowrap";
|
|
4234
|
+
readonly overflow: "hidden";
|
|
4235
|
+
readonly textOverflow: "ellipsis";
|
|
4236
|
+
};
|
|
4237
|
+
readonly saveOptionSwitchTrack: {
|
|
4238
|
+
readonly position: "relative";
|
|
4239
|
+
readonly width: "42px";
|
|
4240
|
+
readonly height: "24px";
|
|
4241
|
+
readonly boxSizing: "border-box";
|
|
4242
|
+
readonly borderRadius: "999px";
|
|
4243
|
+
readonly border: "1px solid transparent";
|
|
4244
|
+
readonly padding: 0;
|
|
4245
|
+
readonly flexShrink: 0;
|
|
4246
|
+
readonly cursor: "pointer";
|
|
4247
|
+
readonly transition: "background-color 0.2s, border-color 0.2s";
|
|
4248
|
+
};
|
|
4249
|
+
readonly saveOptionSwitchTrackOn: {
|
|
4250
|
+
readonly backgroundColor: "#00E5FF";
|
|
4251
|
+
readonly borderColor: "rgba(0, 229, 255, 0.45)";
|
|
4252
|
+
};
|
|
4253
|
+
readonly saveOptionSwitchTrackOff: {
|
|
4254
|
+
readonly backgroundColor: "rgba(255, 255, 255, 0.18)";
|
|
4255
|
+
readonly borderColor: "rgba(255, 255, 255, 0.28)";
|
|
4256
|
+
};
|
|
4257
|
+
readonly saveOptionSwitchKnob: {
|
|
4258
|
+
readonly position: "absolute";
|
|
4259
|
+
readonly top: "50%";
|
|
4260
|
+
readonly left: "2px";
|
|
4261
|
+
readonly width: "20px";
|
|
4262
|
+
readonly height: "20px";
|
|
4263
|
+
readonly borderRadius: "50%";
|
|
4264
|
+
readonly backgroundColor: "#ffffff";
|
|
4265
|
+
readonly transition: "transform 0.2s";
|
|
4266
|
+
readonly boxShadow: "0 1px 3px rgba(0, 0, 0, 0.25)";
|
|
4267
|
+
};
|
|
4268
|
+
readonly tooltipWrap: {
|
|
4269
|
+
readonly position: "relative";
|
|
4270
|
+
readonly display: "flex";
|
|
4271
|
+
readonly alignItems: "center";
|
|
4272
|
+
readonly justifyContent: "center";
|
|
4273
|
+
};
|
|
4274
|
+
readonly tooltipButton: {
|
|
4275
|
+
readonly width: "14px";
|
|
4276
|
+
readonly height: "14px";
|
|
4277
|
+
readonly borderRadius: "50%";
|
|
4278
|
+
readonly border: "1px solid rgba(255, 255, 255, 0.25)";
|
|
4279
|
+
readonly backgroundColor: "rgba(255, 255, 255, 0.08)";
|
|
4280
|
+
readonly color: "rgba(255, 255, 255, 0.8)";
|
|
4281
|
+
readonly fontSize: "9px";
|
|
4282
|
+
readonly lineHeight: 1;
|
|
4283
|
+
readonly padding: 0;
|
|
4284
|
+
readonly cursor: "help";
|
|
4285
|
+
readonly flexShrink: 0;
|
|
4286
|
+
readonly display: "flex";
|
|
4287
|
+
readonly alignItems: "center";
|
|
4288
|
+
readonly justifyContent: "center";
|
|
4289
|
+
readonly fontWeight: 700;
|
|
4290
|
+
};
|
|
4291
|
+
readonly tooltipBubble: {
|
|
4292
|
+
readonly position: "absolute";
|
|
4293
|
+
readonly bottom: "calc(100% + 8px)";
|
|
4294
|
+
readonly left: "50%";
|
|
4295
|
+
readonly transform: "translateX(-50%)";
|
|
4296
|
+
readonly width: "220px";
|
|
4297
|
+
readonly boxSizing: "border-box";
|
|
4298
|
+
readonly padding: "8px 10px";
|
|
4299
|
+
readonly borderRadius: "8px";
|
|
4300
|
+
readonly backgroundColor: "rgba(0, 0, 0, 0.92)";
|
|
4301
|
+
readonly border: "1px solid rgba(255, 255, 255, 0.14)";
|
|
4302
|
+
readonly color: "rgba(255, 255, 255, 0.86)";
|
|
4303
|
+
readonly fontSize: "11px";
|
|
4304
|
+
readonly lineHeight: 1.4;
|
|
4305
|
+
readonly textAlign: "left";
|
|
4306
|
+
readonly boxShadow: "0 8px 24px rgba(0, 0, 0, 0.35)";
|
|
4307
|
+
readonly zIndex: 1;
|
|
4308
|
+
};
|
|
4309
|
+
readonly actionRow: {
|
|
4310
|
+
readonly width: "100%";
|
|
4311
|
+
readonly display: "flex";
|
|
4312
|
+
readonly gap: "8px";
|
|
4313
|
+
readonly alignItems: "stretch";
|
|
4314
|
+
readonly marginBottom: "10px";
|
|
4315
|
+
readonly minHeight: "48px";
|
|
4316
|
+
};
|
|
4317
|
+
readonly actionPrimary: {
|
|
4318
|
+
readonly flex: 1;
|
|
4319
|
+
readonly minWidth: 0;
|
|
4320
|
+
readonly minHeight: "48px";
|
|
4321
|
+
readonly boxSizing: "border-box";
|
|
4322
|
+
};
|
|
4323
|
+
readonly actionFieldButton: {
|
|
4324
|
+
readonly display: "flex";
|
|
4325
|
+
readonly alignItems: "center";
|
|
4326
|
+
readonly justifyContent: "center";
|
|
4327
|
+
readonly padding: "0 16px";
|
|
4328
|
+
readonly marginBottom: 0;
|
|
4329
|
+
};
|
|
4330
|
+
readonly iconButton: {
|
|
4331
|
+
readonly width: "48px";
|
|
4332
|
+
readonly minWidth: "48px";
|
|
4333
|
+
readonly height: "48px";
|
|
4334
|
+
readonly minHeight: "48px";
|
|
4335
|
+
readonly boxSizing: "border-box";
|
|
4336
|
+
readonly padding: "0";
|
|
4337
|
+
readonly backgroundColor: "rgba(255, 255, 255, 0.06)";
|
|
4338
|
+
readonly color: "#ffffff";
|
|
4339
|
+
readonly border: "1px solid rgba(255, 255, 255, 0.14)";
|
|
4340
|
+
readonly borderRadius: "8px";
|
|
4341
|
+
readonly display: "flex";
|
|
4342
|
+
readonly alignItems: "center";
|
|
4343
|
+
readonly justifyContent: "center";
|
|
4344
|
+
readonly cursor: "pointer";
|
|
4345
|
+
};
|
|
4346
|
+
readonly iconButtonPressed: {
|
|
4347
|
+
readonly width: "48px";
|
|
4348
|
+
readonly minWidth: "48px";
|
|
4349
|
+
readonly height: "48px";
|
|
4350
|
+
readonly minHeight: "48px";
|
|
4351
|
+
readonly boxSizing: "border-box";
|
|
4352
|
+
readonly padding: "0";
|
|
4353
|
+
readonly backgroundColor: "rgba(30, 41, 246, 0.22)";
|
|
4354
|
+
readonly color: "#00E5FF";
|
|
4355
|
+
readonly border: "1px solid rgba(0, 229, 255, 0.45)";
|
|
4356
|
+
readonly borderRadius: "8px";
|
|
4357
|
+
readonly display: "flex";
|
|
4358
|
+
readonly alignItems: "center";
|
|
4359
|
+
readonly justifyContent: "center";
|
|
4360
|
+
readonly cursor: "pointer";
|
|
4361
|
+
readonly boxShadow: "inset 0 2px 6px rgba(0, 0, 0, 0.35)";
|
|
4362
|
+
};
|
|
4363
|
+
readonly iconButtonDisabled: {
|
|
4364
|
+
readonly width: "48px";
|
|
4365
|
+
readonly minWidth: "48px";
|
|
4366
|
+
readonly height: "48px";
|
|
4367
|
+
readonly minHeight: "48px";
|
|
4368
|
+
readonly boxSizing: "border-box";
|
|
4369
|
+
readonly padding: "0";
|
|
4370
|
+
readonly backgroundColor: "rgba(255, 255, 255, 0.04)";
|
|
4371
|
+
readonly color: "rgba(255, 255, 255, 0.35)";
|
|
4372
|
+
readonly border: "1px solid rgba(255, 255, 255, 0.08)";
|
|
4373
|
+
readonly borderRadius: "8px";
|
|
4374
|
+
readonly display: "flex";
|
|
4375
|
+
readonly alignItems: "center";
|
|
4376
|
+
readonly justifyContent: "center";
|
|
4377
|
+
readonly cursor: "not-allowed";
|
|
4378
|
+
};
|
|
4379
|
+
readonly manualKeyInput: {
|
|
4380
|
+
readonly width: "100%";
|
|
4381
|
+
readonly height: "48px";
|
|
4382
|
+
readonly minHeight: "48px";
|
|
4383
|
+
readonly boxSizing: "border-box";
|
|
4384
|
+
readonly padding: "0 12px";
|
|
4385
|
+
readonly backgroundColor: "rgba(0, 0, 0, 0.25)";
|
|
4386
|
+
readonly color: "#ffffff";
|
|
4387
|
+
readonly border: "1px solid rgba(255, 255, 255, 0.16)";
|
|
4388
|
+
readonly borderRadius: "8px";
|
|
4389
|
+
readonly fontSize: "14px";
|
|
4390
|
+
readonly fontFamily: "monospace";
|
|
4391
|
+
readonly outline: "none";
|
|
4392
|
+
};
|
|
4393
|
+
readonly manualKeyErrorRow: {
|
|
4394
|
+
readonly width: "100%";
|
|
4395
|
+
readonly display: "flex";
|
|
4396
|
+
readonly gap: "8px";
|
|
4397
|
+
readonly alignItems: "flex-start";
|
|
4398
|
+
readonly margin: "0 0 10px";
|
|
4399
|
+
};
|
|
4400
|
+
readonly manualKeyErrorColumn: {
|
|
4401
|
+
readonly flex: 1;
|
|
4402
|
+
readonly minWidth: 0;
|
|
4403
|
+
readonly minHeight: "17px";
|
|
4404
|
+
};
|
|
4405
|
+
readonly actionSideSpacer: {
|
|
4406
|
+
readonly width: "48px";
|
|
4407
|
+
readonly minWidth: "48px";
|
|
4408
|
+
readonly flexShrink: 0;
|
|
4409
|
+
};
|
|
4410
|
+
readonly manualKeyErrorText: {
|
|
4411
|
+
readonly fontSize: "11px";
|
|
4412
|
+
readonly color: "#b91c1c";
|
|
4413
|
+
readonly lineHeight: 1.5;
|
|
4414
|
+
readonly margin: 0;
|
|
4415
|
+
readonly paddingLeft: "12px";
|
|
4416
|
+
readonly textAlign: "left";
|
|
4417
|
+
};
|
|
4418
|
+
readonly spinner: {
|
|
4419
|
+
readonly display: "inline-block";
|
|
4420
|
+
readonly width: "20px";
|
|
4421
|
+
readonly height: "20px";
|
|
4422
|
+
readonly border: "2px solid rgba(255, 255, 255, 0.3)";
|
|
4423
|
+
readonly borderTopColor: "#ffffff";
|
|
4424
|
+
readonly borderRadius: "50%";
|
|
4425
|
+
readonly animation: "onboard-spin 0.8s linear infinite";
|
|
4426
|
+
};
|
|
4427
|
+
readonly stepperContainer: {
|
|
4428
|
+
readonly width: "100%";
|
|
4429
|
+
readonly marginBottom: "16px";
|
|
4430
|
+
};
|
|
4431
|
+
readonly stepItem: {
|
|
4432
|
+
readonly display: "flex";
|
|
4433
|
+
readonly alignItems: "flex-start";
|
|
4434
|
+
readonly gap: "10px";
|
|
4435
|
+
readonly marginBottom: "12px";
|
|
4436
|
+
readonly textAlign: "left";
|
|
4437
|
+
};
|
|
4438
|
+
readonly stepIconContainer: {
|
|
4439
|
+
readonly width: "24px";
|
|
4440
|
+
readonly height: "24px";
|
|
4441
|
+
readonly borderRadius: "50%";
|
|
4442
|
+
readonly display: "flex";
|
|
4443
|
+
readonly alignItems: "center";
|
|
4444
|
+
readonly justifyContent: "center";
|
|
4445
|
+
readonly flexShrink: 0;
|
|
4446
|
+
};
|
|
4447
|
+
readonly stepIconPending: {
|
|
4448
|
+
readonly backgroundColor: "rgba(255, 255, 255, 0.1)";
|
|
4449
|
+
readonly border: "2px solid rgba(255, 255, 255, 0.2)";
|
|
4450
|
+
};
|
|
4451
|
+
readonly stepIconActive: {
|
|
4452
|
+
readonly backgroundColor: "rgba(0, 229, 255, 0.1)";
|
|
4453
|
+
readonly border: "2px solid #00E5FF";
|
|
4454
|
+
};
|
|
4455
|
+
readonly stepIconComplete: {
|
|
4456
|
+
readonly backgroundColor: "rgba(34, 197, 94, 0.1)";
|
|
4457
|
+
readonly border: "2px solid #22c55e";
|
|
4458
|
+
};
|
|
4459
|
+
readonly stepIconError: {
|
|
4460
|
+
readonly backgroundColor: "rgba(239, 68, 68, 0.1)";
|
|
4461
|
+
readonly border: "2px solid #ef4444";
|
|
4462
|
+
};
|
|
4463
|
+
readonly stepContent: {
|
|
4464
|
+
readonly flex: 1;
|
|
4465
|
+
};
|
|
4466
|
+
readonly stepLabel: {
|
|
4467
|
+
readonly fontSize: "12px";
|
|
4468
|
+
readonly fontWeight: 600;
|
|
4469
|
+
readonly color: "#ffffff";
|
|
4470
|
+
readonly marginBottom: "4px";
|
|
4471
|
+
};
|
|
4472
|
+
readonly stepDescription: {
|
|
4473
|
+
readonly fontSize: "11px";
|
|
4474
|
+
readonly color: "rgba(255, 255, 255, 0.5)";
|
|
4475
|
+
readonly lineHeight: 1.4;
|
|
4476
|
+
};
|
|
4477
|
+
readonly aesKeyBox: {
|
|
4478
|
+
readonly width: "100%";
|
|
4479
|
+
readonly boxSizing: "border-box";
|
|
4480
|
+
readonly backgroundColor: "rgba(0, 0, 0, 0.3)";
|
|
4481
|
+
readonly border: "1px solid rgba(255, 255, 255, 0.1)";
|
|
4482
|
+
readonly borderRadius: "8px";
|
|
4483
|
+
readonly padding: "12px";
|
|
4484
|
+
readonly marginBottom: "16px";
|
|
4485
|
+
readonly fontFamily: "monospace";
|
|
4486
|
+
readonly fontSize: "11px";
|
|
4487
|
+
readonly color: "#00E5FF";
|
|
4488
|
+
readonly wordBreak: "break-all";
|
|
4489
|
+
readonly textAlign: "left";
|
|
4490
|
+
};
|
|
4491
|
+
readonly keyInputWrap: {
|
|
4492
|
+
readonly width: "100%";
|
|
4493
|
+
readonly boxSizing: "border-box";
|
|
4494
|
+
readonly position: "relative";
|
|
4495
|
+
readonly marginBottom: "16px";
|
|
4496
|
+
};
|
|
4497
|
+
readonly keyInput: {
|
|
4498
|
+
readonly width: "100%";
|
|
4499
|
+
readonly boxSizing: "border-box";
|
|
4500
|
+
readonly padding: "12px 82px 12px 12px";
|
|
4501
|
+
readonly backgroundColor: "rgba(0, 0, 0, 0.3)";
|
|
4502
|
+
readonly color: "#00E5FF";
|
|
4503
|
+
readonly border: "1px solid rgba(255, 255, 255, 0.1)";
|
|
4504
|
+
readonly borderRadius: "8px";
|
|
4505
|
+
readonly fontFamily: "monospace";
|
|
4506
|
+
readonly fontSize: "11px";
|
|
4507
|
+
readonly outline: "none";
|
|
4508
|
+
};
|
|
4509
|
+
readonly keyInputActions: {
|
|
4510
|
+
readonly position: "absolute";
|
|
4511
|
+
readonly top: "50%";
|
|
4512
|
+
readonly right: "8px";
|
|
4513
|
+
readonly transform: "translateY(-50%)";
|
|
4514
|
+
readonly display: "flex";
|
|
4515
|
+
readonly gap: "4px";
|
|
4516
|
+
};
|
|
4517
|
+
readonly inlineIconButton: {
|
|
4518
|
+
readonly width: "30px";
|
|
4519
|
+
readonly height: "30px";
|
|
4520
|
+
readonly borderRadius: "6px";
|
|
4521
|
+
readonly border: "1px solid rgba(0, 229, 255, 0.25)";
|
|
4522
|
+
readonly backgroundColor: "rgba(0, 229, 255, 0.08)";
|
|
4523
|
+
readonly color: "#00E5FF";
|
|
4524
|
+
readonly display: "flex";
|
|
4525
|
+
readonly alignItems: "center";
|
|
4526
|
+
readonly justifyContent: "center";
|
|
4527
|
+
readonly cursor: "pointer";
|
|
4528
|
+
readonly padding: 0;
|
|
4529
|
+
};
|
|
4530
|
+
readonly warningBox: {
|
|
4531
|
+
readonly width: "100%";
|
|
4532
|
+
readonly boxSizing: "border-box";
|
|
4533
|
+
readonly backgroundColor: "rgba(251, 191, 36, 0.1)";
|
|
4534
|
+
readonly border: "1px solid rgba(251, 191, 36, 0.3)";
|
|
4535
|
+
readonly borderRadius: "8px";
|
|
4536
|
+
readonly padding: "12px";
|
|
4537
|
+
readonly marginBottom: "12px";
|
|
4538
|
+
};
|
|
4539
|
+
readonly warningText: {
|
|
4540
|
+
readonly color: "rgba(255, 255, 255, 0.6)";
|
|
4541
|
+
readonly fontSize: "12px";
|
|
4542
|
+
readonly lineHeight: 1.6;
|
|
4543
|
+
readonly margin: 0;
|
|
4544
|
+
readonly fontFamily: "inherit";
|
|
4545
|
+
};
|
|
4546
|
+
readonly calloutBox: {
|
|
4547
|
+
readonly width: "100%";
|
|
4548
|
+
readonly boxSizing: "border-box";
|
|
4549
|
+
readonly backgroundColor: "rgba(0, 229, 255, 0.1)";
|
|
4550
|
+
readonly border: "1px solid rgba(0, 229, 255, 0.3)";
|
|
4551
|
+
readonly borderRadius: "8px";
|
|
4552
|
+
readonly padding: "8px 12px";
|
|
4553
|
+
readonly display: "flex";
|
|
4554
|
+
readonly alignItems: "center";
|
|
4555
|
+
readonly gap: "8px";
|
|
4556
|
+
};
|
|
4557
|
+
readonly progressCalloutSlot: {
|
|
4558
|
+
readonly width: "100%";
|
|
4559
|
+
readonly minHeight: "58px";
|
|
4560
|
+
readonly marginTop: "10px";
|
|
4561
|
+
readonly marginBottom: "4px";
|
|
4562
|
+
readonly display: "flex";
|
|
4563
|
+
readonly alignItems: "flex-start";
|
|
4564
|
+
};
|
|
4565
|
+
readonly calloutText: {
|
|
4566
|
+
readonly fontSize: "11px";
|
|
4567
|
+
readonly color: "#00E5FF";
|
|
4568
|
+
readonly lineHeight: 1.4;
|
|
4569
|
+
readonly margin: 0;
|
|
4570
|
+
readonly textAlign: "left";
|
|
4571
|
+
};
|
|
4572
|
+
};
|
|
4573
|
+
type OnboardStyleKey = keyof typeof defaultStyles;
|
|
4574
|
+
/** Style targets apps can override via `privateUnlock.theme`. */
|
|
4575
|
+
declare const ONBOARD_MODAL_STYLE_KEYS: OnboardStyleKey[];
|
|
4576
|
+
/**
|
|
4577
|
+
* OnboardModal — Multi-step modal for AES key retrieval onboarding.
|
|
4578
|
+
*
|
|
4579
|
+
* Screens:
|
|
4580
|
+
* 1. Intro: Explains the process before starting
|
|
4581
|
+
* 2. Progress: Shows step-by-step progress (steps 3-9)
|
|
4582
|
+
* 3. Success: Displays retrieved AES key with copy button
|
|
4583
|
+
* 4. Error: Shows error message with retry button
|
|
4584
|
+
*/
|
|
4585
|
+
declare const OnboardModal: react.FC<OnboardModalProps>;
|
|
4586
|
+
|
|
4587
|
+
/** Legacy flat accessor — unchanged API for existing apps. */
|
|
4588
|
+
declare const usePrivacyBridgeContext: () => PrivacyBridgeContextType;
|
|
4589
|
+
/** Wallet connection (connect, disconnect, address). */
|
|
4590
|
+
declare const usePrivacyBridgeWallet: () => PrivacyBridgeWalletContextValue;
|
|
4591
|
+
/** Network switching and enforcer state. */
|
|
4592
|
+
declare const usePrivacyBridgeNetwork: () => PrivacyBridgeNetworkContextValue;
|
|
4593
|
+
/** Snap, AES key, and private balance unlock flows. */
|
|
4594
|
+
declare const usePrivacyBridgeUnlock: () => PrivacyBridgeUnlockContextValue;
|
|
4595
|
+
/** Public and private token lists. */
|
|
4596
|
+
declare const usePrivacyBridgeTokens: () => PrivacyBridgeTokensContextValue;
|
|
4597
|
+
/** Swap form, bridge execution, gas, and approvals. */
|
|
4598
|
+
declare const usePrivacyBridgeSwap: () => PrivacyBridgeSwapContextValue;
|
|
4599
|
+
/** Sepolia PoD portal request tracker. */
|
|
4600
|
+
declare const usePrivacyBridgePod: () => PrivacyBridgePodContextValue;
|
|
4601
|
+
/** MetaMask install and multi-wallet conflict modals. */
|
|
4602
|
+
declare const usePrivacyBridgeModals: () => PrivacyBridgeModalsContextValue;
|
|
4603
|
+
|
|
4604
|
+
interface PrivateUnlockControllerOptions {
|
|
4605
|
+
theme?: OnboardModalTheme;
|
|
4606
|
+
warning?: string;
|
|
4607
|
+
/** Called after a successful unlock (restore, onboarding, or manual key). */
|
|
4608
|
+
onUnlocked?: () => void | Promise<void>;
|
|
4609
|
+
/** Called when the user cancels backup-restore signing — modal is not opened. */
|
|
4610
|
+
onRestoreCancelled?: () => void;
|
|
4611
|
+
/** Called when the user cancels contract onboarding signing — modal is dismissed. */
|
|
4612
|
+
onOnboardingCancelled?: () => void;
|
|
4613
|
+
}
|
|
4614
|
+
|
|
4615
|
+
type PrivateUnlockProviderOptions = PrivateUnlockControllerOptions;
|
|
4616
|
+
interface PrivateUnlockControllerValue {
|
|
4617
|
+
isUnlocked: boolean;
|
|
4618
|
+
isUnlocking: boolean;
|
|
4619
|
+
unlock: () => Promise<void>;
|
|
4620
|
+
lock: () => void;
|
|
4621
|
+
toggleLock: () => void;
|
|
4622
|
+
requireUnlock: (pendingAction?: () => void | Promise<void>) => Promise<boolean>;
|
|
4623
|
+
reset: () => void;
|
|
4624
|
+
/** Non-blocking message after a cancelled unlock/onboarding attempt. */
|
|
4625
|
+
statusMessage: string | null;
|
|
4626
|
+
}
|
|
4627
|
+
interface PrivateUnlockProviderProps {
|
|
4628
|
+
children: react.ReactNode;
|
|
4629
|
+
options?: PrivateUnlockProviderOptions;
|
|
4630
|
+
}
|
|
4631
|
+
declare const PrivateUnlockProvider: react.FC<PrivateUnlockProviderProps>;
|
|
4632
|
+
declare const usePrivateUnlock: () => PrivateUnlockControllerValue;
|
|
4633
|
+
|
|
4634
|
+
interface PrivacyBridgeProviderProps {
|
|
4635
|
+
children: react.ReactNode;
|
|
4636
|
+
privateUnlock?: PrivateUnlockProviderOptions;
|
|
4637
|
+
}
|
|
4638
|
+
declare const PrivacyBridgeProvider: react.FC<PrivacyBridgeProviderProps>;
|
|
4639
|
+
|
|
4640
|
+
interface WagmiConfigOptions {
|
|
4641
|
+
useEip6963MetaMask?: boolean;
|
|
4642
|
+
multiInjectedProviderDiscovery?: boolean;
|
|
4643
|
+
}
|
|
4644
|
+
interface WagmiRainbowKitProviderProps {
|
|
4645
|
+
children: react.ReactNode;
|
|
4646
|
+
/** WalletConnect Cloud project ID (falls back to configureCotiPlugin or VITE_WALLETCONNECT_PROJECT_ID). */
|
|
4647
|
+
walletConnectProjectId?: string;
|
|
4648
|
+
/** Override the chain pre-selected in the RainbowKit connect modal. Defaults to cotiTestnet. */
|
|
4649
|
+
initialChain?: Chain;
|
|
4650
|
+
/** Override the app name shown in the RainbowKit modal. Defaults to 'COTI Wallet'. */
|
|
4651
|
+
appName?: string;
|
|
4652
|
+
/**
|
|
4653
|
+
* When true, replaces the standard metaMaskWallet connector with an EIP-6963
|
|
4654
|
+
* discovered provider connector, preventing window.ethereum hijacking by
|
|
4655
|
+
* other installed wallets (Rabby, Phantom, Trust).
|
|
4656
|
+
* Default: false (keeps existing behaviour).
|
|
4657
|
+
*/
|
|
4658
|
+
useEip6963MetaMask?: boolean;
|
|
4659
|
+
}
|
|
4660
|
+
/**
|
|
4661
|
+
* Builds wagmi config from current {@link getPluginConfig} and optional WalletConnect project ID.
|
|
4662
|
+
* Returns a stable instance for unchanged plugin settings (safe for `wagmiConfig` and render).
|
|
4663
|
+
* Prefer {@link WagmiRainbowKitProvider} in React apps; use this for non-React wagmi setup.
|
|
4664
|
+
*/
|
|
4665
|
+
declare function getWagmiConfig(walletConnectProjectId?: string, options?: WagmiConfigOptions): Config;
|
|
4666
|
+
/**
|
|
4667
|
+
* Default wagmi config (backward-compatible export).
|
|
4668
|
+
* Lazily initialized on first property access — requires a configured WalletConnect project ID.
|
|
4669
|
+
* Rebuilt when {@link configureCotiPlugin} changes wagmi-relevant settings.
|
|
4670
|
+
*/
|
|
4671
|
+
declare const wagmiConfig: Config;
|
|
4672
|
+
/**
|
|
4673
|
+
* Wraps children with wagmi WagmiProvider, React Query QueryClientProvider,
|
|
4674
|
+
* and RainbowKitProvider. Single entry point for multi-wallet support.
|
|
4675
|
+
*/
|
|
4676
|
+
declare function WagmiRainbowKitProvider({ children, walletConnectProjectId, initialChain, appName, useEip6963MetaMask, }: WagmiRainbowKitProviderProps): react_jsx_runtime.JSX.Element;
|
|
4677
|
+
|
|
4678
|
+
/**
|
|
4679
|
+
* Window CustomEvent fired when a Zerion WalletConnect connection attempt fails
|
|
4680
|
+
* for a reason other than the user cancelling. Zerion only approves sessions for
|
|
4681
|
+
* networks it already knows, so a host app should listen for this event and show
|
|
4682
|
+
* instructions for adding the COTI network manually in Zerion before retrying.
|
|
4683
|
+
*/
|
|
4684
|
+
declare const WALLET_CONNECT_FAILURE_EVENT = "coti-wallet-plugin:wallet-connect-failure";
|
|
4685
|
+
interface WalletConnectFailureDetail {
|
|
4686
|
+
walletId: string;
|
|
4687
|
+
message: string;
|
|
4688
|
+
}
|
|
4689
|
+
/**
|
|
4690
|
+
* RainbowKit wallet factory for Zerion that works on both desktop (injected via
|
|
4691
|
+
* window.zerionWallet) and mobile (WalletConnect deep link), ensuring it is always
|
|
4692
|
+
* visible in the Recommended list even when the browser extension is not present.
|
|
4693
|
+
*
|
|
4694
|
+
* Mobile deep link (iOS): zerion://wc?uri=<encoded-wc-uri>
|
|
4695
|
+
*/
|
|
4696
|
+
declare const mobileZerionWallet: ({ projectId }: {
|
|
4697
|
+
projectId: string;
|
|
4698
|
+
}) => Wallet;
|
|
4699
|
+
|
|
4700
|
+
interface NetworkGuardProps {
|
|
4701
|
+
/** App content to render behind the guard when the wallet needs a network switch */
|
|
4702
|
+
children?: react.ReactNode;
|
|
4703
|
+
}
|
|
4704
|
+
/**
|
|
4705
|
+
* Blocks the UI when the connected wallet is unsupported or off the configured target network.
|
|
4706
|
+
* Uses {@link usePrivacyBridgeContext} fields wired from {@link useNetworkEnforcer}.
|
|
4707
|
+
*
|
|
4708
|
+
* Place inside {@link PrivacyBridgeProvider}:
|
|
4709
|
+
*
|
|
4710
|
+
* ```tsx
|
|
4711
|
+
* <PrivacyBridgeProvider>
|
|
4712
|
+
* <NetworkGuard>
|
|
4713
|
+
* <App />
|
|
4714
|
+
* </NetworkGuard>
|
|
4715
|
+
* </PrivacyBridgeProvider>
|
|
4716
|
+
* ```
|
|
4717
|
+
*/
|
|
4718
|
+
declare const NetworkGuard: react.FC<NetworkGuardProps>;
|
|
4719
|
+
|
|
4720
|
+
/**
|
|
4721
|
+
* Substring present in the Chrome runtime error that occurs when multiple
|
|
4722
|
+
* browser wallet extensions conflict during message passing.
|
|
4723
|
+
*/
|
|
4724
|
+
declare const MULTIPLE_WALLETS_ERROR_SUBSTRING = "chrome.runtime.sendMessage() called from a webpage must specify an Extension ID";
|
|
4725
|
+
/**
|
|
4726
|
+
* Determines if an error message indicates a multiple browser wallet
|
|
4727
|
+
* extensions conflict.
|
|
4728
|
+
*/
|
|
4729
|
+
declare function isMultipleWalletsError(message: string | undefined | null): boolean;
|
|
4730
|
+
|
|
4731
|
+
declare function truncateDecimalValue(value: string | number, decimals: number): string;
|
|
4732
|
+
declare function formatTokenBalanceDisplay(symbol: string, balance: string | number): string;
|
|
4733
|
+
declare function addThousandsSeparators(value: string | number): string;
|
|
4734
|
+
declare function formatBalanceWithNotation(value: string | number): string;
|
|
4735
|
+
|
|
4736
|
+
declare function muteChainUpdates(): void;
|
|
4737
|
+
declare function unmuteChainUpdates(): void;
|
|
4738
|
+
declare function isChainUpdatesMuted(): boolean;
|
|
4739
|
+
|
|
4740
|
+
export { type AesKeyChainId, type AesKeyProviderOptions, BRIDGE_ABI, BRIDGE_ERC20_ABI, type BridgeData, type BridgeFees, type BridgeStatus, CHAIN_CONFIGS, CONTRACT_ADDRESSES, COTI_MAINNET_CHAIN_ID, COTI_MAINNET_RPC, COTI_PRICE_CONSUMER_ABI, COTI_TESTNET_CHAIN_ID$1 as COTI_TESTNET_CHAIN_ID, COTI_TESTNET_POD_INBOX, COTI_TESTNET_RPC, type ChainIndexPageUi, type ConnectorProviderSource, type CotiBridgeFeeQuote, CotiErrorCode, type CotiPluginConfig, CotiPluginError, DEFAULT_CHAIN_ID, DEFAULT_POD_BALANCE_STATE, DEFAULT_POD_EXPLORER_BASE_URL, type EIP1193Provider, ERC20_ABI, ETHEREUM_MAINNET_CHAIN_ID, ETHEREUM_MAINNET_RPC, type EncryptedAesBackup, type FeeEstimate, type GrantResult, LIMITS, type Logger, MINIMUM_PORTAL_IN_AMOUNTS, MULTIPLE_WALLETS_ERROR_SUBSTRING, type NetworkEnforcerResult, NetworkGuard, type NetworkGuardProps, ONBOARDING_STEPS, ONBOARD_MODAL_STYLE_KEYS, OnboardModal, type OnboardModalProps, type OnboardModalTheme, type OnboardingProgressCallback, type OnboardingServiceRequest, type OnboardingServices, type OnboardingStep, type OnboardingStepInfo, COTI_TESTNET_CHAIN_ID as POD_COTI_TESTNET_CHAIN_ID, POD_INBOX_ADDRESS, POD_PORTAL_ADMIN_ABI, POD_PRICE_ORACLE_ABI, POD_PTOKEN_ABI, SEPOLIA_CHAIN_ID as POD_SEPOLIA_CHAIN_ID, PRIVACY_PORTAL_ABI, PRIVATE_ERC20_TRANSFER_256_SIG, type PodBalanceState, type PodBalanceTrustState, type PodPortalFeeQuote, type PodPortalRequest, type PodPortalRequestStatus, type PodWithdrawPermit, type ChainConfig as PortalChainConfig, type PortalStrategy, type PrivacyBridgeContextType, type PrivacyBridgeModalsContextValue, type PrivacyBridgeNetworkContextValue, type PrivacyBridgePodContextValue, PrivacyBridgeProvider, type PrivacyBridgeProviderProps, type PrivacyBridgeSwapContextValue, type PrivacyBridgeTokensContextValue, type PrivacyBridgeUnlockContextValue, type PrivacyBridgeWalletContextValue, type PrivateUnlockControllerValue, PrivateUnlockProvider, type PrivateUnlockProviderOptions, type PrivateUnlockProviderProps, type ResolvedIndexPageUi, SEPOLIA_CHAIN_ID$1 as SEPOLIA_CHAIN_ID, SEPOLIA_RPC, SEPOLIA_RPC_FALLBACK, SUPPORTED_TOKENS, type SaveEncryptedAesBackupRequest, type SimulationResult, TOKEN_ABI, type TokenConfig, type UnlockStrategy, WALLET_CONNECT_FAILURE_EVENT, type WagmiConfigOptions, WagmiRainbowKitProvider, type WalletConnectFailureDetail, type WalletNetworkConfig, type WalletType, type WalletTypeInfo, addThousandsSeparators, buildPodExplorerRequestUrl, computeCotiFee, computeErc20Fee, configureCotiPlugin, cotiMainnet, cotiTestnet, estimateBridgeFee, estimateCotiBridgeGasFeeDisplay, estimatePodPortalFees, ethereumMainnet, executePodPortalTransaction, fetchBridgeFees, fetchPodBridgeData, fetchPodOracleTokenUsdPrice, fetchTokenUsdPrice, formatBalanceWithNotation, formatPodFeeDisplay, formatPortalFeeDisplay, formatTokenBalanceDisplay, getChainConfig, getChainIdConstants, getContractAddresses, getEip6963MetaMaskProvider, getEip6963RabbyProvider, getEthereumProvider, getExplorerBaseUrlForChain, getNetworkNameForChain, getPluginConfig, getPodGasPrice, getPodInboxAddress, getPodSdkConfig, getPrivateTokensForChain, getPublicTokensForChain, getRpcUrlForChain, getRpcUrlForChainId, getRpcUrlsForChain, getSepoliaGasPrice, getSnapRequestParams, getTokenSimulationMeta, getTokensForChain, getUnlockStrategyForChain, getWagmiConfig, getWalletNetworkConfigs, getWalletNetworkOptions, hasCotiErrorCode, isChainUpdatesMuted, isCotiPluginError, isMultipleWalletsError, isSnapInstallEnabled, loadPodRequests, logger, mobileZerionWallet, muteChainUpdates, defaultStyles as onboardModalDefaultStyles, podRequestsStorageKey, quoteCotiBridgeFees, quotePodPortalTransactionFees, quotePortalFeeOnly, requireChainConfig, resolveConnectedProvider, resolveIndexPageUi, resolveMetaMaskInjectedTarget, resolvePodRequestStatus, resolvePodTxGasPrice, resolvePrivateTokenContractAddress, resolvePrivateTokenTransferTarget, resolveRabbyInjectedTarget, savePodRequests, sepolia, setDebugLogging, signPodWithdrawPermit, simulateFeeOnChain, simulatePodPortalFee, truncateDecimalValue, unmuteChainUpdates, useBalanceUpdater, useBridgeData, useBridgeStatus, useMetamask, useNetworkEnforcer, usePrivacyBridgeContext, usePrivacyBridgeModals, usePrivacyBridgeNetwork, usePrivacyBridgePod, usePrivacyBridgeSwap, usePrivacyBridgeTokens, usePrivacyBridgeUnlock, usePrivacyBridgeWallet, usePrivateTokenBalance, usePrivateUnlock, useWalletType, wagmiConfig };
|