viem 2.56.7 → 2.56.9
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/CHANGELOG.md +44 -0
- package/README.md +0 -1
- package/_cjs/actions/index.js +5 -3
- package/_cjs/actions/index.js.map +1 -1
- package/_cjs/actions/public/getStorageValues.js +17 -0
- package/_cjs/actions/public/getStorageValues.js.map +1 -0
- package/_cjs/actions/public/simulateBlocks.js +2 -0
- package/_cjs/actions/public/simulateBlocks.js.map +1 -1
- package/_cjs/chains/definitions/rabbitChainTestnet.js +24 -0
- package/_cjs/chains/definitions/rabbitChainTestnet.js.map +1 -0
- package/_cjs/chains/index.js +7 -5
- package/_cjs/chains/index.js.map +1 -1
- package/_cjs/clients/decorators/public.js +2 -0
- package/_cjs/clients/decorators/public.js.map +1 -1
- package/_cjs/errors/version.js +1 -1
- package/_cjs/index.js.map +1 -1
- package/_cjs/tempo/Abis.js +1211 -32
- package/_cjs/tempo/Abis.js.map +1 -1
- package/_cjs/tempo/Addresses.js +2 -1
- package/_cjs/tempo/Addresses.js.map +1 -1
- package/_cjs/tempo/Decorator.js +12 -0
- package/_cjs/tempo/Decorator.js.map +1 -1
- package/_cjs/tempo/Selectors.js +7 -4
- package/_cjs/tempo/Selectors.js.map +1 -1
- package/_cjs/tempo/actions/index.js +2 -1
- package/_cjs/tempo/actions/index.js.map +1 -1
- package/_cjs/tempo/actions/propAmm.js +349 -0
- package/_cjs/tempo/actions/propAmm.js.map +1 -0
- package/_cjs/tokens/definitions/eurc.js +1 -0
- package/_cjs/tokens/definitions/eurc.js.map +1 -1
- package/_cjs/tokens/definitions/usdc.js +1 -0
- package/_cjs/tokens/definitions/usdc.js.map +1 -1
- package/_cjs/utils/formatters/formatter.js.map +1 -1
- package/_esm/actions/index.js +1 -0
- package/_esm/actions/index.js.map +1 -1
- package/_esm/actions/public/getStorageValues.js +39 -0
- package/_esm/actions/public/getStorageValues.js.map +1 -0
- package/_esm/actions/public/simulateBlocks.js +4 -0
- package/_esm/actions/public/simulateBlocks.js.map +1 -1
- package/_esm/chains/definitions/rabbitChainTestnet.js +21 -0
- package/_esm/chains/definitions/rabbitChainTestnet.js.map +1 -0
- package/_esm/chains/index.js +1 -0
- package/_esm/chains/index.js.map +1 -1
- package/_esm/clients/decorators/public.js +2 -0
- package/_esm/clients/decorators/public.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/index.js.map +1 -1
- package/_esm/tempo/Abis.js +1214 -34
- package/_esm/tempo/Abis.js.map +1 -1
- package/_esm/tempo/Addresses.js +2 -0
- package/_esm/tempo/Addresses.js.map +1 -1
- package/_esm/tempo/Decorator.js +12 -0
- package/_esm/tempo/Decorator.js.map +1 -1
- package/_esm/tempo/Selectors.js +6 -3
- package/_esm/tempo/Selectors.js.map +1 -1
- package/_esm/tempo/actions/index.js +1 -0
- package/_esm/tempo/actions/index.js.map +1 -1
- package/_esm/tempo/actions/propAmm.js +539 -0
- package/_esm/tempo/actions/propAmm.js.map +1 -0
- package/_esm/tokens/definitions/eurc.js +1 -0
- package/_esm/tokens/definitions/eurc.js.map +1 -1
- package/_esm/tokens/definitions/usdc.js +1 -0
- package/_esm/tokens/definitions/usdc.js.map +1 -1
- package/_esm/utils/formatters/formatter.js +1 -0
- package/_esm/utils/formatters/formatter.js.map +1 -1
- package/_types/actions/index.d.ts +1 -0
- package/_types/actions/index.d.ts.map +1 -1
- package/_types/actions/public/getStorageValues.d.ts +59 -0
- package/_types/actions/public/getStorageValues.d.ts.map +1 -0
- package/_types/actions/public/simulateBlocks.d.ts +8 -0
- package/_types/actions/public/simulateBlocks.d.ts.map +1 -1
- package/_types/celo/chainConfig.d.ts +6 -840
- package/_types/celo/chainConfig.d.ts.map +1 -1
- package/_types/celo/formatters.d.ts +4 -421
- package/_types/celo/formatters.d.ts.map +1 -1
- package/_types/chains/definitions/abstract.d.ts +4 -371
- package/_types/chains/definitions/abstract.d.ts.map +1 -1
- package/_types/chains/definitions/abstractTestnet.d.ts +4 -371
- package/_types/chains/definitions/abstractTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8.d.ts +3 -226
- package/_types/chains/definitions/ancient8.d.ts.map +1 -1
- package/_types/chains/definitions/ancient8Sepolia.d.ts +3 -226
- package/_types/chains/definitions/ancient8Sepolia.d.ts.map +1 -1
- package/_types/chains/definitions/base.d.ts +6 -452
- package/_types/chains/definitions/base.d.ts.map +1 -1
- package/_types/chains/definitions/baseGoerli.d.ts +3 -226
- package/_types/chains/definitions/baseGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/baseSepolia.d.ts +6 -452
- package/_types/chains/definitions/baseSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/battlechain.d.ts +4 -371
- package/_types/chains/definitions/battlechain.d.ts.map +1 -1
- package/_types/chains/definitions/battlechainTestnet.d.ts +4 -371
- package/_types/chains/definitions/battlechainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/blast.d.ts +3 -226
- package/_types/chains/definitions/blast.d.ts.map +1 -1
- package/_types/chains/definitions/bob.d.ts +3 -226
- package/_types/chains/definitions/bob.d.ts.map +1 -1
- package/_types/chains/definitions/bobSepolia.d.ts +3 -226
- package/_types/chains/definitions/bobSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/celo.d.ts +6 -840
- package/_types/chains/definitions/celo.d.ts.map +1 -1
- package/_types/chains/definitions/celoAlfajores.d.ts +6 -840
- package/_types/chains/definitions/celoAlfajores.d.ts.map +1 -1
- package/_types/chains/definitions/celoSepolia.d.ts +6 -840
- package/_types/chains/definitions/celoSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/codex.d.ts +3 -226
- package/_types/chains/definitions/codex.d.ts.map +1 -1
- package/_types/chains/definitions/codexTestnet.d.ts +3 -226
- package/_types/chains/definitions/codexTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/dchain.d.ts +3 -226
- package/_types/chains/definitions/dchain.d.ts.map +1 -1
- package/_types/chains/definitions/dchainTestnet.d.ts +3 -226
- package/_types/chains/definitions/dchainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/elysiumTestnet.d.ts +3 -226
- package/_types/chains/definitions/elysiumTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/fraxtal.d.ts +3 -226
- package/_types/chains/definitions/fraxtal.d.ts.map +1 -1
- package/_types/chains/definitions/fraxtalTestnet.d.ts +3 -226
- package/_types/chains/definitions/fraxtalTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/funkiMainnet.d.ts +3 -226
- package/_types/chains/definitions/funkiMainnet.d.ts.map +1 -1
- package/_types/chains/definitions/funkiSepolia.d.ts +3 -226
- package/_types/chains/definitions/funkiSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/garnet.d.ts +3 -226
- package/_types/chains/definitions/garnet.d.ts.map +1 -1
- package/_types/chains/definitions/giwaSepolia.d.ts +6 -452
- package/_types/chains/definitions/giwaSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/ink.d.ts +3 -226
- package/_types/chains/definitions/ink.d.ts.map +1 -1
- package/_types/chains/definitions/inkSepolia.d.ts +3 -226
- package/_types/chains/definitions/inkSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/lisk.d.ts +3 -226
- package/_types/chains/definitions/lisk.d.ts.map +1 -1
- package/_types/chains/definitions/liskSepolia.d.ts +3 -226
- package/_types/chains/definitions/liskSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/megaeth.d.ts +3 -226
- package/_types/chains/definitions/megaeth.d.ts.map +1 -1
- package/_types/chains/definitions/metalL2.d.ts +3 -226
- package/_types/chains/definitions/metalL2.d.ts.map +1 -1
- package/_types/chains/definitions/mode.d.ts +3 -226
- package/_types/chains/definitions/mode.d.ts.map +1 -1
- package/_types/chains/definitions/modeTestnet.d.ts +3 -226
- package/_types/chains/definitions/modeTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/optimism.d.ts +3 -226
- package/_types/chains/definitions/optimism.d.ts.map +1 -1
- package/_types/chains/definitions/optimismGoerli.d.ts +3 -226
- package/_types/chains/definitions/optimismGoerli.d.ts.map +1 -1
- package/_types/chains/definitions/optimismSepolia.d.ts +3 -226
- package/_types/chains/definitions/optimismSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/pgn.d.ts +3 -226
- package/_types/chains/definitions/pgn.d.ts.map +1 -1
- package/_types/chains/definitions/pgnTestnet.d.ts +3 -226
- package/_types/chains/definitions/pgnTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/playfiAlbireo.d.ts +4 -371
- package/_types/chains/definitions/playfiAlbireo.d.ts.map +1 -1
- package/_types/chains/definitions/pyrope.d.ts +3 -226
- package/_types/chains/definitions/pyrope.d.ts.map +1 -1
- package/_types/chains/definitions/rabbitChainTestnet.d.ts +51 -0
- package/_types/chains/definitions/rabbitChainTestnet.d.ts.map +1 -0
- package/_types/chains/definitions/redstone.d.ts +3 -226
- package/_types/chains/definitions/redstone.d.ts.map +1 -1
- package/_types/chains/definitions/rss3.d.ts +3 -226
- package/_types/chains/definitions/rss3.d.ts.map +1 -1
- package/_types/chains/definitions/rss3Sepolia.d.ts +3 -226
- package/_types/chains/definitions/rss3Sepolia.d.ts.map +1 -1
- package/_types/chains/definitions/shape.d.ts +3 -226
- package/_types/chains/definitions/shape.d.ts.map +1 -1
- package/_types/chains/definitions/shapeSepolia.d.ts +3 -226
- package/_types/chains/definitions/shapeSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/snax.d.ts +3 -226
- package/_types/chains/definitions/snax.d.ts.map +1 -1
- package/_types/chains/definitions/snaxTestnet.d.ts +3 -226
- package/_types/chains/definitions/snaxTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/soneium.d.ts +3 -226
- package/_types/chains/definitions/soneium.d.ts.map +1 -1
- package/_types/chains/definitions/soneiumMinato.d.ts +3 -226
- package/_types/chains/definitions/soneiumMinato.d.ts.map +1 -1
- package/_types/chains/definitions/sophon.d.ts +4 -371
- package/_types/chains/definitions/sophon.d.ts.map +1 -1
- package/_types/chains/definitions/sophonTestnet.d.ts +4 -371
- package/_types/chains/definitions/sophonTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/superseed.d.ts +3 -226
- package/_types/chains/definitions/superseed.d.ts.map +1 -1
- package/_types/chains/definitions/superseedSepolia.d.ts +3 -226
- package/_types/chains/definitions/superseedSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/swellchain.d.ts +3 -226
- package/_types/chains/definitions/swellchain.d.ts.map +1 -1
- package/_types/chains/definitions/swellchainTestnet.d.ts +3 -226
- package/_types/chains/definitions/swellchainTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempo.d.ts +6 -910
- package/_types/chains/definitions/tempo.d.ts.map +1 -1
- package/_types/chains/definitions/tempoDevnet.d.ts +6 -910
- package/_types/chains/definitions/tempoDevnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempoLocalnet.d.ts +6 -910
- package/_types/chains/definitions/tempoLocalnet.d.ts.map +1 -1
- package/_types/chains/definitions/tempoModerato.d.ts +6 -910
- package/_types/chains/definitions/tempoModerato.d.ts.map +1 -1
- package/_types/chains/definitions/treasure.d.ts +4 -371
- package/_types/chains/definitions/treasure.d.ts.map +1 -1
- package/_types/chains/definitions/treasureTopaz.d.ts +4 -371
- package/_types/chains/definitions/treasureTopaz.d.ts.map +1 -1
- package/_types/chains/definitions/unichain.d.ts +3 -226
- package/_types/chains/definitions/unichain.d.ts.map +1 -1
- package/_types/chains/definitions/unichainSepolia.d.ts +3 -226
- package/_types/chains/definitions/unichainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/whitechainSepolia.d.ts +3 -226
- package/_types/chains/definitions/whitechainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/worldchain.d.ts +3 -226
- package/_types/chains/definitions/worldchain.d.ts.map +1 -1
- package/_types/chains/definitions/worldchainSepolia.d.ts +3 -226
- package/_types/chains/definitions/worldchainSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/zircuit.d.ts +3 -226
- package/_types/chains/definitions/zircuit.d.ts.map +1 -1
- package/_types/chains/definitions/zircuitGarfieldTestnet.d.ts +3 -226
- package/_types/chains/definitions/zircuitGarfieldTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zksync.d.ts +4 -371
- package/_types/chains/definitions/zksync.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncInMemoryNode.d.ts +4 -371
- package/_types/chains/definitions/zksyncInMemoryNode.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts +4 -371
- package/_types/chains/definitions/zksyncLocalCustomHyperchain.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalHyperchain.d.ts +4 -371
- package/_types/chains/definitions/zksyncLocalHyperchain.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncLocalNode.d.ts +4 -371
- package/_types/chains/definitions/zksyncLocalNode.d.ts.map +1 -1
- package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts +4 -371
- package/_types/chains/definitions/zksyncSepoliaTestnet.d.ts.map +1 -1
- package/_types/chains/definitions/zora.d.ts +3 -226
- package/_types/chains/definitions/zora.d.ts.map +1 -1
- package/_types/chains/definitions/zoraSepolia.d.ts +3 -226
- package/_types/chains/definitions/zoraSepolia.d.ts.map +1 -1
- package/_types/chains/definitions/zoraTestnet.d.ts +3 -226
- package/_types/chains/definitions/zoraTestnet.d.ts.map +1 -1
- package/_types/chains/index.d.ts +1 -0
- package/_types/chains/index.d.ts.map +1 -1
- package/_types/clients/decorators/public.d.ts +11 -0
- package/_types/clients/decorators/public.d.ts.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/index.d.ts +1 -0
- package/_types/index.d.ts.map +1 -1
- package/_types/op-stack/chainConfig.d.ts +3 -226
- package/_types/op-stack/chainConfig.d.ts.map +1 -1
- package/_types/op-stack/formatters.d.ts +5 -228
- package/_types/op-stack/formatters.d.ts.map +1 -1
- package/_types/tempo/Abis.d.ts +14686 -9568
- package/_types/tempo/Abis.d.ts.map +1 -1
- package/_types/tempo/Addresses.d.ts +2 -0
- package/_types/tempo/Addresses.d.ts.map +1 -1
- package/_types/tempo/Decorator.d.ts +205 -1
- package/_types/tempo/Decorator.d.ts.map +1 -1
- package/_types/tempo/Selectors.d.ts +6 -3
- package/_types/tempo/Selectors.d.ts.map +1 -1
- package/_types/tempo/actions/earn.d.ts +621 -1
- package/_types/tempo/actions/earn.d.ts.map +1 -1
- package/_types/tempo/actions/index.d.ts +1 -0
- package/_types/tempo/actions/index.d.ts.map +1 -1
- package/_types/tempo/actions/propAmm.d.ts +2228 -0
- package/_types/tempo/actions/propAmm.d.ts.map +1 -0
- package/_types/tempo/chainConfig.d.ts +4 -457
- package/_types/tempo/chainConfig.d.ts.map +1 -1
- package/_types/tokens/definitions/eurc.d.ts +1 -0
- package/_types/tokens/definitions/eurc.d.ts.map +1 -1
- package/_types/tokens/definitions/usdc.d.ts +1 -0
- package/_types/tokens/definitions/usdc.d.ts.map +1 -1
- package/_types/tokens/sets.d.ts +3 -0
- package/_types/tokens/sets.d.ts.map +1 -1
- package/_types/types/eip1193.d.ts +20 -0
- package/_types/types/eip1193.d.ts.map +1 -1
- package/_types/utils/formatters/block.d.ts +1 -1
- package/_types/utils/formatters/formatter.d.ts +1 -2
- package/_types/utils/formatters/formatter.d.ts.map +1 -1
- package/_types/utils/formatters/transaction.d.ts +1 -1
- package/_types/utils/formatters/transactionReceipt.d.ts +1 -1
- package/_types/utils/formatters/transactionRequest.d.ts +1 -1
- package/_types/zksync/chainConfig.d.ts +4 -371
- package/_types/zksync/chainConfig.d.ts.map +1 -1
- package/_types/zksync/formatters.d.ts +6 -374
- package/_types/zksync/formatters.d.ts.map +1 -1
- package/actions/index.ts +6 -0
- package/actions/public/getStorageValues.ts +93 -0
- package/actions/public/simulateBlocks.ts +13 -0
- package/chains/definitions/rabbitChainTestnet.ts +21 -0
- package/chains/index.ts +1 -0
- package/clients/decorators/public.ts +18 -0
- package/errors/version.ts +1 -1
- package/index.ts +5 -0
- package/package.json +1 -1
- package/tempo/Abis.ts +1218 -34
- package/tempo/Addresses.ts +2 -0
- package/tempo/Decorator.ts +239 -3
- package/tempo/Selectors.ts +10 -4
- package/tempo/actions/index.ts +1 -0
- package/tempo/actions/propAmm.ts +998 -0
- package/tokens/definitions/eurc.ts +1 -0
- package/tokens/definitions/usdc.ts +1 -0
- package/types/eip1193.ts +20 -0
- package/utils/formatters/formatter.ts +4 -4
|
@@ -0,0 +1,2228 @@
|
|
|
1
|
+
import type { Address } from 'abitype';
|
|
2
|
+
import * as Hex from 'ox/Hex';
|
|
3
|
+
import type { Account } from '../../accounts/types.js';
|
|
4
|
+
import type { ReadContractReturnType } from '../../actions/public/readContract.js';
|
|
5
|
+
import { type SendTransactionReturnType, sendTransaction } from '../../actions/wallet/sendTransaction.js';
|
|
6
|
+
import { sendTransactionSync } from '../../actions/wallet/sendTransactionSync.js';
|
|
7
|
+
import type { Client } from '../../clients/createClient.js';
|
|
8
|
+
import type { Transport } from '../../clients/transports/createTransport.js';
|
|
9
|
+
import type { BaseErrorType } from '../../errors/base.js';
|
|
10
|
+
import type { Chain } from '../../types/chain.js';
|
|
11
|
+
import type { GetEventArgs } from '../../types/contract.js';
|
|
12
|
+
import type { Log } from '../../types/log.js';
|
|
13
|
+
import type { Compute, UnionOmit } from '../../types/utils.js';
|
|
14
|
+
import * as Abis from '../Abis.js';
|
|
15
|
+
import type { ReadParameters, WriteParameters } from '../internal/types.js';
|
|
16
|
+
import type { TransactionReceipt } from '../Transaction.js';
|
|
17
|
+
import * as simulateActions from './simulate.js';
|
|
18
|
+
/**
|
|
19
|
+
* Reads the base token of a propAMM pool.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* import { createClient, http } from 'viem'
|
|
24
|
+
* import { tempo } from 'viem/chains'
|
|
25
|
+
* import { Actions } from 'viem/tempo'
|
|
26
|
+
*
|
|
27
|
+
* const client = createClient({ chain: tempo, transport: http() })
|
|
28
|
+
*
|
|
29
|
+
* const token = await Actions.propAmm.baseToken(client, { pool: '0x...' })
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param client - Client.
|
|
33
|
+
* @param parameters - Pool and read options.
|
|
34
|
+
* @returns Base token address.
|
|
35
|
+
*/
|
|
36
|
+
export declare function baseToken<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: baseToken.Parameters): Promise<baseToken.ReturnValue>;
|
|
37
|
+
export declare namespace baseToken {
|
|
38
|
+
type Args = {
|
|
39
|
+
/** Pool address. */
|
|
40
|
+
pool: Address;
|
|
41
|
+
};
|
|
42
|
+
type Parameters = ReadParameters & Args;
|
|
43
|
+
type ReturnValue = ReadContractReturnType<typeof Abis.directPropAmm, 'baseToken'>;
|
|
44
|
+
/**
|
|
45
|
+
* Defines the pool's `baseToken` call.
|
|
46
|
+
*/
|
|
47
|
+
function call({ pool }: Args): {
|
|
48
|
+
abi: [{
|
|
49
|
+
readonly type: "function";
|
|
50
|
+
readonly name: "baseToken";
|
|
51
|
+
readonly inputs: readonly [];
|
|
52
|
+
readonly outputs: readonly [{
|
|
53
|
+
readonly name: "";
|
|
54
|
+
readonly type: "address";
|
|
55
|
+
readonly internalType: "contract ITIP20";
|
|
56
|
+
}];
|
|
57
|
+
readonly stateMutability: "view";
|
|
58
|
+
}];
|
|
59
|
+
functionName: "baseToken";
|
|
60
|
+
} & {
|
|
61
|
+
args?: readonly [] | undefined;
|
|
62
|
+
} & {
|
|
63
|
+
address: Address;
|
|
64
|
+
} & {
|
|
65
|
+
data: import("../../index.js").Hex;
|
|
66
|
+
to: Address;
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Reads the quote token of a propAMM pool.
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* import { createClient, http } from 'viem'
|
|
75
|
+
* import { tempo } from 'viem/chains'
|
|
76
|
+
* import { Actions } from 'viem/tempo'
|
|
77
|
+
*
|
|
78
|
+
* const client = createClient({ chain: tempo, transport: http() })
|
|
79
|
+
*
|
|
80
|
+
* const token = await Actions.propAmm.quoteToken(client, { pool: '0x...' })
|
|
81
|
+
* ```
|
|
82
|
+
*
|
|
83
|
+
* @param client - Client.
|
|
84
|
+
* @param parameters - Pool and read options.
|
|
85
|
+
* @returns Quote token address.
|
|
86
|
+
*/
|
|
87
|
+
export declare function quoteToken<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: quoteToken.Parameters): Promise<quoteToken.ReturnValue>;
|
|
88
|
+
export declare namespace quoteToken {
|
|
89
|
+
type Args = {
|
|
90
|
+
/** Pool address. */
|
|
91
|
+
pool: Address;
|
|
92
|
+
};
|
|
93
|
+
type Parameters = ReadParameters & Args;
|
|
94
|
+
type ReturnValue = ReadContractReturnType<typeof Abis.directPropAmm, 'quoteToken'>;
|
|
95
|
+
/**
|
|
96
|
+
* Defines the pool's `quoteToken` call.
|
|
97
|
+
*/
|
|
98
|
+
function call({ pool }: Args): {
|
|
99
|
+
abi: [{
|
|
100
|
+
readonly type: "function";
|
|
101
|
+
readonly name: "quoteToken";
|
|
102
|
+
readonly inputs: readonly [];
|
|
103
|
+
readonly outputs: readonly [{
|
|
104
|
+
readonly name: "";
|
|
105
|
+
readonly type: "address";
|
|
106
|
+
readonly internalType: "contract ITIP20";
|
|
107
|
+
}];
|
|
108
|
+
readonly stateMutability: "view";
|
|
109
|
+
}];
|
|
110
|
+
functionName: "quoteToken";
|
|
111
|
+
} & {
|
|
112
|
+
args?: readonly [] | undefined;
|
|
113
|
+
} & {
|
|
114
|
+
address: Address;
|
|
115
|
+
} & {
|
|
116
|
+
data: import("../../index.js").Hex;
|
|
117
|
+
to: Address;
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
/**
|
|
121
|
+
* Reads whether a propAMM pool is paused.
|
|
122
|
+
*
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* import { createClient, http } from 'viem'
|
|
126
|
+
* import { tempo } from 'viem/chains'
|
|
127
|
+
* import { Actions } from 'viem/tempo'
|
|
128
|
+
*
|
|
129
|
+
* const client = createClient({ chain: tempo, transport: http() })
|
|
130
|
+
*
|
|
131
|
+
* const isPaused = await Actions.propAmm.paused(client, { pool: '0x...' })
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* @param client - Client.
|
|
135
|
+
* @param parameters - Pool and read options.
|
|
136
|
+
* @returns Whether swaps are paused.
|
|
137
|
+
*/
|
|
138
|
+
export declare function paused<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: paused.Parameters): Promise<paused.ReturnValue>;
|
|
139
|
+
export declare namespace paused {
|
|
140
|
+
type Args = {
|
|
141
|
+
/** Pool address. */
|
|
142
|
+
pool: Address;
|
|
143
|
+
};
|
|
144
|
+
type Parameters = ReadParameters & Args;
|
|
145
|
+
type ReturnValue = ReadContractReturnType<typeof Abis.directPropAmm, 'paused'>;
|
|
146
|
+
/**
|
|
147
|
+
* Defines the pool's `paused` call.
|
|
148
|
+
*/
|
|
149
|
+
function call({ pool }: Args): {
|
|
150
|
+
abi: [{
|
|
151
|
+
readonly type: "function";
|
|
152
|
+
readonly name: "paused";
|
|
153
|
+
readonly inputs: readonly [];
|
|
154
|
+
readonly outputs: readonly [{
|
|
155
|
+
readonly name: "";
|
|
156
|
+
readonly type: "bool";
|
|
157
|
+
readonly internalType: "bool";
|
|
158
|
+
}];
|
|
159
|
+
readonly stateMutability: "view";
|
|
160
|
+
}];
|
|
161
|
+
functionName: "paused";
|
|
162
|
+
} & {
|
|
163
|
+
args?: readonly [] | undefined;
|
|
164
|
+
} & {
|
|
165
|
+
address: Address;
|
|
166
|
+
} & {
|
|
167
|
+
data: import("../../index.js").Hex;
|
|
168
|
+
to: Address;
|
|
169
|
+
};
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Reads whether an address may call swaps on a pool.
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```ts
|
|
176
|
+
* import { createClient, http } from 'viem'
|
|
177
|
+
* import { tempo } from 'viem/chains'
|
|
178
|
+
* import { Actions } from 'viem/tempo'
|
|
179
|
+
*
|
|
180
|
+
* const client = createClient({ chain: tempo, transport: http() })
|
|
181
|
+
*
|
|
182
|
+
* const allowed = await Actions.propAmm.takerAllowed(client, { pool: '0x...', taker: '0x...' })
|
|
183
|
+
* ```
|
|
184
|
+
*
|
|
185
|
+
* @param client - Client.
|
|
186
|
+
* @param parameters - Pool, taker, and read options.
|
|
187
|
+
* @returns Whether the taker is allowed.
|
|
188
|
+
*/
|
|
189
|
+
export declare function takerAllowed<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: takerAllowed.Parameters): Promise<takerAllowed.ReturnValue>;
|
|
190
|
+
export declare namespace takerAllowed {
|
|
191
|
+
type Args = {
|
|
192
|
+
/** Pool address. */
|
|
193
|
+
pool: Address;
|
|
194
|
+
/** Address that calls the swap. */
|
|
195
|
+
taker: Address;
|
|
196
|
+
};
|
|
197
|
+
type Parameters = ReadParameters & Args;
|
|
198
|
+
type ReturnValue = ReadContractReturnType<typeof Abis.directPropAmm, 'takerAllowed'>;
|
|
199
|
+
/**
|
|
200
|
+
* Defines the pool's `takerAllowed` call.
|
|
201
|
+
*/
|
|
202
|
+
function call({ pool, taker }: Args): {
|
|
203
|
+
abi: [{
|
|
204
|
+
readonly type: "function";
|
|
205
|
+
readonly name: "takerAllowed";
|
|
206
|
+
readonly inputs: readonly [{
|
|
207
|
+
readonly name: "taker";
|
|
208
|
+
readonly type: "address";
|
|
209
|
+
readonly internalType: "address";
|
|
210
|
+
}];
|
|
211
|
+
readonly outputs: readonly [{
|
|
212
|
+
readonly name: "allowed";
|
|
213
|
+
readonly type: "bool";
|
|
214
|
+
readonly internalType: "bool";
|
|
215
|
+
}];
|
|
216
|
+
readonly stateMutability: "view";
|
|
217
|
+
}];
|
|
218
|
+
functionName: "takerAllowed";
|
|
219
|
+
} & {
|
|
220
|
+
args: readonly [taker: `0x${string}`];
|
|
221
|
+
} & {
|
|
222
|
+
address: Address;
|
|
223
|
+
} & {
|
|
224
|
+
data: import("../../index.js").Hex;
|
|
225
|
+
to: Address;
|
|
226
|
+
};
|
|
227
|
+
}
|
|
228
|
+
/**
|
|
229
|
+
* Reads whether a resolved address may receive swap output.
|
|
230
|
+
*
|
|
231
|
+
* @example
|
|
232
|
+
* ```ts
|
|
233
|
+
* import { createClient, http } from 'viem'
|
|
234
|
+
* import { tempo } from 'viem/chains'
|
|
235
|
+
* import { Actions } from 'viem/tempo'
|
|
236
|
+
*
|
|
237
|
+
* const client = createClient({ chain: tempo, transport: http() })
|
|
238
|
+
*
|
|
239
|
+
* const allowed = await Actions.propAmm.recipientAllowed(client, { pool: '0x...', recipient: '0x...' })
|
|
240
|
+
* ```
|
|
241
|
+
*
|
|
242
|
+
* @param client - Client.
|
|
243
|
+
* @param parameters - Pool, resolved recipient, and read options.
|
|
244
|
+
* @returns Whether the resolved recipient is allowed.
|
|
245
|
+
*/
|
|
246
|
+
export declare function recipientAllowed<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: recipientAllowed.Parameters): Promise<recipientAllowed.ReturnValue>;
|
|
247
|
+
export declare namespace recipientAllowed {
|
|
248
|
+
type Args = {
|
|
249
|
+
/** Pool address. */
|
|
250
|
+
pool: Address;
|
|
251
|
+
/** Resolved address to check. */
|
|
252
|
+
recipient: Address;
|
|
253
|
+
};
|
|
254
|
+
type Parameters = ReadParameters & Args;
|
|
255
|
+
type ReturnValue = ReadContractReturnType<typeof Abis.directPropAmm, 'recipientAllowed'>;
|
|
256
|
+
/**
|
|
257
|
+
* Defines the pool's `recipientAllowed` call.
|
|
258
|
+
*/
|
|
259
|
+
function call({ pool, recipient }: Args): {
|
|
260
|
+
abi: [{
|
|
261
|
+
readonly type: "function";
|
|
262
|
+
readonly name: "recipientAllowed";
|
|
263
|
+
readonly inputs: readonly [{
|
|
264
|
+
readonly name: "recipient";
|
|
265
|
+
readonly type: "address";
|
|
266
|
+
readonly internalType: "address";
|
|
267
|
+
}];
|
|
268
|
+
readonly outputs: readonly [{
|
|
269
|
+
readonly name: "allowed";
|
|
270
|
+
readonly type: "bool";
|
|
271
|
+
readonly internalType: "bool";
|
|
272
|
+
}];
|
|
273
|
+
readonly stateMutability: "view";
|
|
274
|
+
}];
|
|
275
|
+
functionName: "recipientAllowed";
|
|
276
|
+
} & {
|
|
277
|
+
args: readonly [recipient: `0x${string}`];
|
|
278
|
+
} & {
|
|
279
|
+
address: Address;
|
|
280
|
+
} & {
|
|
281
|
+
data: import("../../index.js").Hex;
|
|
282
|
+
to: Address;
|
|
283
|
+
};
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Resolves a Tempo recipient to the address checked by the pool's allowlist.
|
|
287
|
+
*
|
|
288
|
+
* @example
|
|
289
|
+
* ```ts
|
|
290
|
+
* import { createClient, http } from 'viem'
|
|
291
|
+
* import { tempo } from 'viem/chains'
|
|
292
|
+
* import { Actions } from 'viem/tempo'
|
|
293
|
+
*
|
|
294
|
+
* const client = createClient({ chain: tempo, transport: http() })
|
|
295
|
+
*
|
|
296
|
+
* const resolved = await Actions.propAmm.resolveRecipient(client, { pool: '0x...', recipient: '0x...' })
|
|
297
|
+
* ```
|
|
298
|
+
*
|
|
299
|
+
* @param client - Client.
|
|
300
|
+
* @param parameters - Pool, recipient, and read options.
|
|
301
|
+
* @returns Resolved recipient address.
|
|
302
|
+
*/
|
|
303
|
+
export declare function resolveRecipient<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: resolveRecipient.Parameters): Promise<resolveRecipient.ReturnValue>;
|
|
304
|
+
export declare namespace resolveRecipient {
|
|
305
|
+
type Args = {
|
|
306
|
+
/** Pool address. */
|
|
307
|
+
pool: Address;
|
|
308
|
+
/** Destination provided to the swap. */
|
|
309
|
+
recipient: Address;
|
|
310
|
+
};
|
|
311
|
+
type Parameters = ReadParameters & Args;
|
|
312
|
+
type ReturnValue = ReadContractReturnType<typeof Abis.directPropAmm, 'resolveRecipient'>;
|
|
313
|
+
/**
|
|
314
|
+
* Defines the pool's `resolveRecipient` call.
|
|
315
|
+
*/
|
|
316
|
+
function call({ pool, recipient }: Args): {
|
|
317
|
+
abi: [{
|
|
318
|
+
readonly type: "function";
|
|
319
|
+
readonly name: "resolveRecipient";
|
|
320
|
+
readonly inputs: readonly [{
|
|
321
|
+
readonly name: "recipient";
|
|
322
|
+
readonly type: "address";
|
|
323
|
+
readonly internalType: "address";
|
|
324
|
+
}];
|
|
325
|
+
readonly outputs: readonly [{
|
|
326
|
+
readonly name: "resolved";
|
|
327
|
+
readonly type: "address";
|
|
328
|
+
readonly internalType: "address";
|
|
329
|
+
}];
|
|
330
|
+
readonly stateMutability: "view";
|
|
331
|
+
}];
|
|
332
|
+
functionName: "resolveRecipient";
|
|
333
|
+
} & {
|
|
334
|
+
args: readonly [recipient: `0x${string}`];
|
|
335
|
+
} & {
|
|
336
|
+
address: Address;
|
|
337
|
+
} & {
|
|
338
|
+
data: import("../../index.js").Hex;
|
|
339
|
+
to: Address;
|
|
340
|
+
};
|
|
341
|
+
}
|
|
342
|
+
/**
|
|
343
|
+
* Quotes an exact input or exact output for a caller, recipient, and customer route.
|
|
344
|
+
*
|
|
345
|
+
* @example
|
|
346
|
+
* ```ts
|
|
347
|
+
* import { createClient, http } from 'viem'
|
|
348
|
+
* import { tempo } from 'viem/chains'
|
|
349
|
+
* import { Actions } from 'viem/tempo'
|
|
350
|
+
*
|
|
351
|
+
* const client = createClient({ chain: tempo, transport: http() })
|
|
352
|
+
*
|
|
353
|
+
* const { amountOut, price, updatedAt } = await Actions.propAmm.getSwapQuote(client, {
|
|
354
|
+
* pool: '0x...',
|
|
355
|
+
* taker: '0x...',
|
|
356
|
+
* recipient: '0x...',
|
|
357
|
+
* mode: 'exactInput',
|
|
358
|
+
* amountIn: 1_000_000n,
|
|
359
|
+
* })
|
|
360
|
+
* ```
|
|
361
|
+
*
|
|
362
|
+
* @param client - Client.
|
|
363
|
+
* @param parameters - Route, swap mode, amount, and read options. Taker defaults to the read or client account.
|
|
364
|
+
* @returns Quoted amount, oracle observation, rounding credit, and swap request.
|
|
365
|
+
*/
|
|
366
|
+
export declare function getSwapQuote<chain extends Chain | undefined, const parameters extends getSwapQuote.Parameters>(client: Client<Transport, chain>, parameters: parameters): Promise<getSwapQuote.ReturnValue<parameters>>;
|
|
367
|
+
export declare namespace getSwapQuote {
|
|
368
|
+
type Args = {
|
|
369
|
+
/** True sends base and receives quote; false sends quote and receives base. */
|
|
370
|
+
baseToQuote: boolean;
|
|
371
|
+
/** Nonzero attribution and rounding-route identifier. */
|
|
372
|
+
customerId: Hex.Hex;
|
|
373
|
+
/** Pool address. */
|
|
374
|
+
pool: Address;
|
|
375
|
+
/** Destination of the output token. */
|
|
376
|
+
recipient: Address;
|
|
377
|
+
/** Address that will call the swap. */
|
|
378
|
+
taker: Address;
|
|
379
|
+
} & ({
|
|
380
|
+
/** Exact-input quote. */
|
|
381
|
+
mode: 'exactInput';
|
|
382
|
+
/** Input amount in token base units. */
|
|
383
|
+
amountIn: bigint;
|
|
384
|
+
} | {
|
|
385
|
+
/** Exact-output quote. */
|
|
386
|
+
mode: 'exactOutput';
|
|
387
|
+
/** Output amount in token base units. */
|
|
388
|
+
amountOut: bigint;
|
|
389
|
+
});
|
|
390
|
+
type Parameters = ReadParameters & UnionOmit<Args, 'baseToQuote' | 'customerId' | 'recipient' | 'taker'> & {
|
|
391
|
+
/** True sends base and receives quote. Defaults to true. */
|
|
392
|
+
baseToQuote?: boolean | undefined;
|
|
393
|
+
/** Route identifier. Defaults to the taker address left-padded to 32 bytes. */
|
|
394
|
+
customerId?: Hex.Hex | undefined;
|
|
395
|
+
/** Output destination. Defaults to the read account or client account. */
|
|
396
|
+
recipient?: Address | undefined;
|
|
397
|
+
/** Address that will call the swap. Defaults to the read account or client account. */
|
|
398
|
+
taker?: Address | undefined;
|
|
399
|
+
};
|
|
400
|
+
/** Quoted amount, oracle observation, rounding credit, and swap request. */
|
|
401
|
+
type ReturnValue<parameters extends Parameters = Parameters> = Compute<{
|
|
402
|
+
/** Oracle price used for the quote. */
|
|
403
|
+
price: bigint;
|
|
404
|
+
/** Oracle observation timestamp. */
|
|
405
|
+
updatedAt: bigint;
|
|
406
|
+
/** Route's remaining rounding credit. */
|
|
407
|
+
creditAfter: bigint;
|
|
408
|
+
} & (parameters extends {
|
|
409
|
+
mode: 'exactInput';
|
|
410
|
+
} ? {
|
|
411
|
+
/** Quoted output amount in token base units. */
|
|
412
|
+
amountOut: bigint;
|
|
413
|
+
/** Swap inputs bound to this quote. */
|
|
414
|
+
request: Omit<Extract<swap.Args, {
|
|
415
|
+
mode: 'exactInput';
|
|
416
|
+
}>, 'deadline' | 'tradeId'>;
|
|
417
|
+
} : {
|
|
418
|
+
/** Required input amount in token base units. */
|
|
419
|
+
amountIn: bigint;
|
|
420
|
+
/** Swap inputs bound to this quote. */
|
|
421
|
+
request: Omit<Extract<swap.Args, {
|
|
422
|
+
mode: 'exactOutput';
|
|
423
|
+
}>, 'deadline' | 'tradeId'>;
|
|
424
|
+
})>;
|
|
425
|
+
/**
|
|
426
|
+
* Defines a route-aware quote call.
|
|
427
|
+
*/
|
|
428
|
+
function call(parameters: Extract<Args, {
|
|
429
|
+
mode: 'exactInput';
|
|
430
|
+
}>): ReturnType<typeof quoteExactInputCall>;
|
|
431
|
+
function call(parameters: Extract<Args, {
|
|
432
|
+
mode: 'exactOutput';
|
|
433
|
+
}>): ReturnType<typeof quoteExactOutputCall>;
|
|
434
|
+
function call(parameters: Args): ReturnType<typeof quoteExactInputCall> | ReturnType<typeof quoteExactOutputCall>;
|
|
435
|
+
}
|
|
436
|
+
declare function quoteExactInputCall(parameters: Extract<getSwapQuote.Args, {
|
|
437
|
+
mode: 'exactInput';
|
|
438
|
+
}>): {
|
|
439
|
+
abi: [{
|
|
440
|
+
readonly type: "function";
|
|
441
|
+
readonly name: "quoteExactInputFor";
|
|
442
|
+
readonly inputs: readonly [{
|
|
443
|
+
readonly name: "taker";
|
|
444
|
+
readonly type: "address";
|
|
445
|
+
readonly internalType: "address";
|
|
446
|
+
}, {
|
|
447
|
+
readonly name: "recipient";
|
|
448
|
+
readonly type: "address";
|
|
449
|
+
readonly internalType: "address";
|
|
450
|
+
}, {
|
|
451
|
+
readonly name: "customerId";
|
|
452
|
+
readonly type: "bytes32";
|
|
453
|
+
readonly internalType: "bytes32";
|
|
454
|
+
}, {
|
|
455
|
+
readonly name: "baseToQuote";
|
|
456
|
+
readonly type: "bool";
|
|
457
|
+
readonly internalType: "bool";
|
|
458
|
+
}, {
|
|
459
|
+
readonly name: "amountIn";
|
|
460
|
+
readonly type: "uint256";
|
|
461
|
+
readonly internalType: "uint256";
|
|
462
|
+
}];
|
|
463
|
+
readonly outputs: readonly [{
|
|
464
|
+
readonly name: "amountOut";
|
|
465
|
+
readonly type: "uint256";
|
|
466
|
+
readonly internalType: "uint256";
|
|
467
|
+
}, {
|
|
468
|
+
readonly name: "price";
|
|
469
|
+
readonly type: "uint256";
|
|
470
|
+
readonly internalType: "uint256";
|
|
471
|
+
}, {
|
|
472
|
+
readonly name: "updatedAt";
|
|
473
|
+
readonly type: "uint256";
|
|
474
|
+
readonly internalType: "uint256";
|
|
475
|
+
}, {
|
|
476
|
+
readonly name: "creditAfter";
|
|
477
|
+
readonly type: "uint256";
|
|
478
|
+
readonly internalType: "uint256";
|
|
479
|
+
}];
|
|
480
|
+
readonly stateMutability: "view";
|
|
481
|
+
}];
|
|
482
|
+
functionName: "quoteExactInputFor";
|
|
483
|
+
} & {
|
|
484
|
+
args: readonly [taker: `0x${string}`, recipient: `0x${string}`, `0x${string}`, boolean, amountIn: bigint];
|
|
485
|
+
} & {
|
|
486
|
+
address: Address;
|
|
487
|
+
} & {
|
|
488
|
+
data: import("../../index.js").Hex;
|
|
489
|
+
to: Address;
|
|
490
|
+
};
|
|
491
|
+
declare function quoteExactOutputCall(parameters: Extract<getSwapQuote.Args, {
|
|
492
|
+
mode: 'exactOutput';
|
|
493
|
+
}>): {
|
|
494
|
+
abi: [{
|
|
495
|
+
readonly type: "function";
|
|
496
|
+
readonly name: "quoteExactOutputFor";
|
|
497
|
+
readonly inputs: readonly [{
|
|
498
|
+
readonly name: "taker";
|
|
499
|
+
readonly type: "address";
|
|
500
|
+
readonly internalType: "address";
|
|
501
|
+
}, {
|
|
502
|
+
readonly name: "recipient";
|
|
503
|
+
readonly type: "address";
|
|
504
|
+
readonly internalType: "address";
|
|
505
|
+
}, {
|
|
506
|
+
readonly name: "customerId";
|
|
507
|
+
readonly type: "bytes32";
|
|
508
|
+
readonly internalType: "bytes32";
|
|
509
|
+
}, {
|
|
510
|
+
readonly name: "baseToQuote";
|
|
511
|
+
readonly type: "bool";
|
|
512
|
+
readonly internalType: "bool";
|
|
513
|
+
}, {
|
|
514
|
+
readonly name: "amountOut";
|
|
515
|
+
readonly type: "uint256";
|
|
516
|
+
readonly internalType: "uint256";
|
|
517
|
+
}];
|
|
518
|
+
readonly outputs: readonly [{
|
|
519
|
+
readonly name: "amountIn";
|
|
520
|
+
readonly type: "uint256";
|
|
521
|
+
readonly internalType: "uint256";
|
|
522
|
+
}, {
|
|
523
|
+
readonly name: "price";
|
|
524
|
+
readonly type: "uint256";
|
|
525
|
+
readonly internalType: "uint256";
|
|
526
|
+
}, {
|
|
527
|
+
readonly name: "updatedAt";
|
|
528
|
+
readonly type: "uint256";
|
|
529
|
+
readonly internalType: "uint256";
|
|
530
|
+
}, {
|
|
531
|
+
readonly name: "creditAfter";
|
|
532
|
+
readonly type: "uint256";
|
|
533
|
+
readonly internalType: "uint256";
|
|
534
|
+
}];
|
|
535
|
+
readonly stateMutability: "view";
|
|
536
|
+
}];
|
|
537
|
+
functionName: "quoteExactOutputFor";
|
|
538
|
+
} & {
|
|
539
|
+
args: readonly [taker: `0x${string}`, recipient: `0x${string}`, `0x${string}`, boolean, amountOut: bigint];
|
|
540
|
+
} & {
|
|
541
|
+
address: Address;
|
|
542
|
+
} & {
|
|
543
|
+
data: import("../../index.js").Hex;
|
|
544
|
+
to: Address;
|
|
545
|
+
};
|
|
546
|
+
/**
|
|
547
|
+
* Internal exact-input contract call.
|
|
548
|
+
*/
|
|
549
|
+
declare namespace exactInput {
|
|
550
|
+
type Args = {
|
|
551
|
+
amountIn: bigint;
|
|
552
|
+
baseToQuote: boolean;
|
|
553
|
+
customerId: Hex.Hex;
|
|
554
|
+
deadline: bigint;
|
|
555
|
+
expectedOraclePrice: bigint;
|
|
556
|
+
minAmountOut: bigint;
|
|
557
|
+
minimumOracleUpdatedAt: bigint;
|
|
558
|
+
oraclePriceToleranceBps: bigint;
|
|
559
|
+
pool: Address;
|
|
560
|
+
recipient: Address;
|
|
561
|
+
tradeId: Hex.Hex;
|
|
562
|
+
};
|
|
563
|
+
function call({ amountIn, baseToQuote, customerId, deadline, expectedOraclePrice, minAmountOut, minimumOracleUpdatedAt, oraclePriceToleranceBps, pool, recipient, tradeId, }: Args): {
|
|
564
|
+
abi: [{
|
|
565
|
+
readonly type: "function";
|
|
566
|
+
readonly name: "swapExactInput";
|
|
567
|
+
readonly inputs: readonly [{
|
|
568
|
+
readonly name: "baseToQuote";
|
|
569
|
+
readonly type: "bool";
|
|
570
|
+
readonly internalType: "bool";
|
|
571
|
+
}, {
|
|
572
|
+
readonly name: "amountIn";
|
|
573
|
+
readonly type: "uint256";
|
|
574
|
+
readonly internalType: "uint256";
|
|
575
|
+
}, {
|
|
576
|
+
readonly name: "minAmountOut";
|
|
577
|
+
readonly type: "uint256";
|
|
578
|
+
readonly internalType: "uint256";
|
|
579
|
+
}, {
|
|
580
|
+
readonly name: "recipient";
|
|
581
|
+
readonly type: "address";
|
|
582
|
+
readonly internalType: "address";
|
|
583
|
+
}, {
|
|
584
|
+
readonly name: "customerId";
|
|
585
|
+
readonly type: "bytes32";
|
|
586
|
+
readonly internalType: "bytes32";
|
|
587
|
+
}, {
|
|
588
|
+
readonly name: "tradeId";
|
|
589
|
+
readonly type: "bytes32";
|
|
590
|
+
readonly internalType: "bytes32";
|
|
591
|
+
}, {
|
|
592
|
+
readonly name: "deadline";
|
|
593
|
+
readonly type: "uint256";
|
|
594
|
+
readonly internalType: "uint256";
|
|
595
|
+
}, {
|
|
596
|
+
readonly name: "expectedOraclePrice";
|
|
597
|
+
readonly type: "uint256";
|
|
598
|
+
readonly internalType: "uint256";
|
|
599
|
+
}, {
|
|
600
|
+
readonly name: "oraclePriceToleranceBps";
|
|
601
|
+
readonly type: "uint256";
|
|
602
|
+
readonly internalType: "uint256";
|
|
603
|
+
}, {
|
|
604
|
+
readonly name: "minimumOracleUpdatedAt";
|
|
605
|
+
readonly type: "uint256";
|
|
606
|
+
readonly internalType: "uint256";
|
|
607
|
+
}];
|
|
608
|
+
readonly outputs: readonly [{
|
|
609
|
+
readonly name: "amountOut";
|
|
610
|
+
readonly type: "uint256";
|
|
611
|
+
readonly internalType: "uint256";
|
|
612
|
+
}];
|
|
613
|
+
readonly stateMutability: "nonpayable";
|
|
614
|
+
}];
|
|
615
|
+
functionName: "swapExactInput";
|
|
616
|
+
} & {
|
|
617
|
+
args: readonly [boolean, amountIn: bigint, minAmountOut: bigint, recipient: `0x${string}`, `0x${string}`, `0x${string}`, deadline: bigint, bigint, bigint, bigint];
|
|
618
|
+
} & {
|
|
619
|
+
address: Address;
|
|
620
|
+
} & {
|
|
621
|
+
data: import("../../index.js").Hex;
|
|
622
|
+
to: Address;
|
|
623
|
+
};
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Internal exact-output contract call.
|
|
627
|
+
*/
|
|
628
|
+
declare namespace exactOutput {
|
|
629
|
+
type Args = {
|
|
630
|
+
amountOut: bigint;
|
|
631
|
+
baseToQuote: boolean;
|
|
632
|
+
customerId: Hex.Hex;
|
|
633
|
+
deadline: bigint;
|
|
634
|
+
expectedOraclePrice: bigint;
|
|
635
|
+
maxAmountIn: bigint;
|
|
636
|
+
minimumOracleUpdatedAt: bigint;
|
|
637
|
+
oraclePriceToleranceBps: bigint;
|
|
638
|
+
pool: Address;
|
|
639
|
+
recipient: Address;
|
|
640
|
+
tradeId: Hex.Hex;
|
|
641
|
+
};
|
|
642
|
+
function call({ amountOut, baseToQuote, customerId, deadline, expectedOraclePrice, maxAmountIn, minimumOracleUpdatedAt, oraclePriceToleranceBps, pool, recipient, tradeId, }: Args): {
|
|
643
|
+
abi: [{
|
|
644
|
+
readonly type: "function";
|
|
645
|
+
readonly name: "swapExactOutput";
|
|
646
|
+
readonly inputs: readonly [{
|
|
647
|
+
readonly name: "baseToQuote";
|
|
648
|
+
readonly type: "bool";
|
|
649
|
+
readonly internalType: "bool";
|
|
650
|
+
}, {
|
|
651
|
+
readonly name: "amountOut";
|
|
652
|
+
readonly type: "uint256";
|
|
653
|
+
readonly internalType: "uint256";
|
|
654
|
+
}, {
|
|
655
|
+
readonly name: "maxAmountIn";
|
|
656
|
+
readonly type: "uint256";
|
|
657
|
+
readonly internalType: "uint256";
|
|
658
|
+
}, {
|
|
659
|
+
readonly name: "recipient";
|
|
660
|
+
readonly type: "address";
|
|
661
|
+
readonly internalType: "address";
|
|
662
|
+
}, {
|
|
663
|
+
readonly name: "customerId";
|
|
664
|
+
readonly type: "bytes32";
|
|
665
|
+
readonly internalType: "bytes32";
|
|
666
|
+
}, {
|
|
667
|
+
readonly name: "tradeId";
|
|
668
|
+
readonly type: "bytes32";
|
|
669
|
+
readonly internalType: "bytes32";
|
|
670
|
+
}, {
|
|
671
|
+
readonly name: "deadline";
|
|
672
|
+
readonly type: "uint256";
|
|
673
|
+
readonly internalType: "uint256";
|
|
674
|
+
}, {
|
|
675
|
+
readonly name: "expectedOraclePrice";
|
|
676
|
+
readonly type: "uint256";
|
|
677
|
+
readonly internalType: "uint256";
|
|
678
|
+
}, {
|
|
679
|
+
readonly name: "oraclePriceToleranceBps";
|
|
680
|
+
readonly type: "uint256";
|
|
681
|
+
readonly internalType: "uint256";
|
|
682
|
+
}, {
|
|
683
|
+
readonly name: "minimumOracleUpdatedAt";
|
|
684
|
+
readonly type: "uint256";
|
|
685
|
+
readonly internalType: "uint256";
|
|
686
|
+
}];
|
|
687
|
+
readonly outputs: readonly [{
|
|
688
|
+
readonly name: "amountIn";
|
|
689
|
+
readonly type: "uint256";
|
|
690
|
+
readonly internalType: "uint256";
|
|
691
|
+
}];
|
|
692
|
+
readonly stateMutability: "nonpayable";
|
|
693
|
+
}];
|
|
694
|
+
functionName: "swapExactOutput";
|
|
695
|
+
} & {
|
|
696
|
+
args: readonly [boolean, amountOut: bigint, maxAmountIn: bigint, recipient: `0x${string}`, `0x${string}`, `0x${string}`, deadline: bigint, bigint, bigint, bigint];
|
|
697
|
+
} & {
|
|
698
|
+
address: Address;
|
|
699
|
+
} & {
|
|
700
|
+
data: import("../../index.js").Hex;
|
|
701
|
+
to: Address;
|
|
702
|
+
};
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* Approves the input token and swaps through an allowed propAMM pool in one transaction.
|
|
706
|
+
*
|
|
707
|
+
* @example
|
|
708
|
+
* ```ts
|
|
709
|
+
* import { createClient, http } from 'viem'
|
|
710
|
+
* import { tempo } from 'viem/chains'
|
|
711
|
+
* import { Actions } from 'viem/tempo'
|
|
712
|
+
*
|
|
713
|
+
* const client = createClient({ chain: tempo, transport: http(), account: '0x...' })
|
|
714
|
+
*
|
|
715
|
+
* const hash = await Actions.propAmm.swap(client, {
|
|
716
|
+
* pool: '0x...',
|
|
717
|
+
* mode: 'exactInput',
|
|
718
|
+
* amountIn: 1_000_000n,
|
|
719
|
+
* minAmountOut: 1_000_000n,
|
|
720
|
+
* expectedOraclePrice: 1_000_000_000_000_000_000n,
|
|
721
|
+
* minimumOracleUpdatedAt: 1_799_999_000n,
|
|
722
|
+
* })
|
|
723
|
+
* ```
|
|
724
|
+
*
|
|
725
|
+
* @param client - Client.
|
|
726
|
+
* @param parameters - Swap and transaction options.
|
|
727
|
+
* @returns Transaction hash.
|
|
728
|
+
*/
|
|
729
|
+
export declare function swap<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: swap.Parameters<chain, account>): Promise<swap.ReturnValue>;
|
|
730
|
+
export declare namespace swap {
|
|
731
|
+
type Args = {
|
|
732
|
+
/** True sends base and receives quote; false sends quote and receives base. */
|
|
733
|
+
baseToQuote: boolean;
|
|
734
|
+
/** Nonzero attribution and rounding-route identifier. */
|
|
735
|
+
customerId: Hex.Hex;
|
|
736
|
+
/** Last accepted execution timestamp in seconds. */
|
|
737
|
+
deadline: bigint;
|
|
738
|
+
/** Oracle price returned by the quote. */
|
|
739
|
+
expectedOraclePrice: bigint;
|
|
740
|
+
/** Earliest accepted oracle observation timestamp. */
|
|
741
|
+
minimumOracleUpdatedAt: bigint;
|
|
742
|
+
/** Accepted oracle-price movement in basis points. Zero binds exactly. */
|
|
743
|
+
oraclePriceToleranceBps: bigint;
|
|
744
|
+
/** Pool address. */
|
|
745
|
+
pool: Address;
|
|
746
|
+
/** Destination of the output token. */
|
|
747
|
+
recipient: Address;
|
|
748
|
+
/** Trade attribution value, not replay protection. */
|
|
749
|
+
tradeId: Hex.Hex;
|
|
750
|
+
} & ({
|
|
751
|
+
/** Exact-input swap. */
|
|
752
|
+
mode: 'exactInput';
|
|
753
|
+
/** Exact input amount in token base units. */
|
|
754
|
+
amountIn: bigint;
|
|
755
|
+
/** Lowest accepted output in token base units. */
|
|
756
|
+
minAmountOut: bigint;
|
|
757
|
+
} | {
|
|
758
|
+
/** Exact-output swap. */
|
|
759
|
+
mode: 'exactOutput';
|
|
760
|
+
/** Exact output amount in token base units. */
|
|
761
|
+
amountOut: bigint;
|
|
762
|
+
/** Highest accepted input in token base units; unused approval remains. */
|
|
763
|
+
maxAmountIn: bigint;
|
|
764
|
+
});
|
|
765
|
+
type InputArgs = UnionOmit<Args, 'baseToQuote' | 'customerId' | 'deadline' | 'oraclePriceToleranceBps' | 'recipient' | 'tradeId'> & {
|
|
766
|
+
/** True sends base and receives quote. Defaults to true. */
|
|
767
|
+
baseToQuote?: boolean | undefined;
|
|
768
|
+
/** Route identifier. Defaults to the sender address left-padded to 32 bytes. */
|
|
769
|
+
customerId?: Hex.Hex | undefined;
|
|
770
|
+
/** Last accepted execution timestamp. Defaults to five minutes from now. */
|
|
771
|
+
deadline?: bigint | undefined;
|
|
772
|
+
/** Output destination. Defaults to the sending account. */
|
|
773
|
+
recipient?: Address | undefined;
|
|
774
|
+
/** Accepted oracle-price movement in basis points. Defaults to zero. */
|
|
775
|
+
oraclePriceToleranceBps?: bigint | undefined;
|
|
776
|
+
/** Trade attribution value. Defaults to a random 32-byte value per swap. */
|
|
777
|
+
tradeId?: Hex.Hex | undefined;
|
|
778
|
+
};
|
|
779
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = WriteParameters<chain, account> & InputArgs;
|
|
780
|
+
type ReturnValue = SendTransactionReturnType;
|
|
781
|
+
type ErrorType = BaseErrorType;
|
|
782
|
+
/** @internal */
|
|
783
|
+
function inner<action extends typeof sendTransaction | typeof sendTransactionSync, chain extends Chain | undefined, account extends Account | undefined>(action: action, client: Client<Transport, chain, account>, parameters: Parameters<chain, account>): Promise<ReturnType<action>>;
|
|
784
|
+
/**
|
|
785
|
+
* Estimates gas for the approval and swap transaction.
|
|
786
|
+
*
|
|
787
|
+
* @param client - Client.
|
|
788
|
+
* @param parameters - Swap and transaction options.
|
|
789
|
+
* @returns The gas estimate.
|
|
790
|
+
*/
|
|
791
|
+
function estimateGas<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: Parameters<chain, account>): Promise<bigint>;
|
|
792
|
+
/**
|
|
793
|
+
* Simulates the approval and swap calls without submitting a transaction.
|
|
794
|
+
*
|
|
795
|
+
* @param client - Client.
|
|
796
|
+
* @param parameters - Swap and simulation options.
|
|
797
|
+
* @returns The approval and swap simulation results.
|
|
798
|
+
*/
|
|
799
|
+
function simulate<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: simulate.Parameters): Promise<simulateActions.simulateCalls.ReturnType<readonly [{
|
|
800
|
+
abi: [{
|
|
801
|
+
readonly name: "approve";
|
|
802
|
+
readonly type: "function";
|
|
803
|
+
readonly stateMutability: "nonpayable";
|
|
804
|
+
readonly inputs: readonly [{
|
|
805
|
+
readonly type: "address";
|
|
806
|
+
readonly name: "spender";
|
|
807
|
+
}, {
|
|
808
|
+
readonly type: "uint256";
|
|
809
|
+
readonly name: "amount";
|
|
810
|
+
}];
|
|
811
|
+
readonly outputs: readonly [{
|
|
812
|
+
readonly type: "bool";
|
|
813
|
+
}];
|
|
814
|
+
}];
|
|
815
|
+
functionName: "approve";
|
|
816
|
+
} & {
|
|
817
|
+
args: readonly [spender: `0x${string}`, amount: bigint];
|
|
818
|
+
} & {
|
|
819
|
+
address: Address;
|
|
820
|
+
} & {
|
|
821
|
+
data: import("../../index.js").Hex;
|
|
822
|
+
to: Address;
|
|
823
|
+
}, ({
|
|
824
|
+
abi: [{
|
|
825
|
+
readonly type: "function";
|
|
826
|
+
readonly name: "swapExactInput";
|
|
827
|
+
readonly inputs: readonly [{
|
|
828
|
+
readonly name: "baseToQuote";
|
|
829
|
+
readonly type: "bool";
|
|
830
|
+
readonly internalType: "bool";
|
|
831
|
+
}, {
|
|
832
|
+
readonly name: "amountIn";
|
|
833
|
+
readonly type: "uint256";
|
|
834
|
+
readonly internalType: "uint256";
|
|
835
|
+
}, {
|
|
836
|
+
readonly name: "minAmountOut";
|
|
837
|
+
readonly type: "uint256";
|
|
838
|
+
readonly internalType: "uint256";
|
|
839
|
+
}, {
|
|
840
|
+
readonly name: "recipient";
|
|
841
|
+
readonly type: "address";
|
|
842
|
+
readonly internalType: "address";
|
|
843
|
+
}, {
|
|
844
|
+
readonly name: "customerId";
|
|
845
|
+
readonly type: "bytes32";
|
|
846
|
+
readonly internalType: "bytes32";
|
|
847
|
+
}, {
|
|
848
|
+
readonly name: "tradeId";
|
|
849
|
+
readonly type: "bytes32";
|
|
850
|
+
readonly internalType: "bytes32";
|
|
851
|
+
}, {
|
|
852
|
+
readonly name: "deadline";
|
|
853
|
+
readonly type: "uint256";
|
|
854
|
+
readonly internalType: "uint256";
|
|
855
|
+
}, {
|
|
856
|
+
readonly name: "expectedOraclePrice";
|
|
857
|
+
readonly type: "uint256";
|
|
858
|
+
readonly internalType: "uint256";
|
|
859
|
+
}, {
|
|
860
|
+
readonly name: "oraclePriceToleranceBps";
|
|
861
|
+
readonly type: "uint256";
|
|
862
|
+
readonly internalType: "uint256";
|
|
863
|
+
}, {
|
|
864
|
+
readonly name: "minimumOracleUpdatedAt";
|
|
865
|
+
readonly type: "uint256";
|
|
866
|
+
readonly internalType: "uint256";
|
|
867
|
+
}];
|
|
868
|
+
readonly outputs: readonly [{
|
|
869
|
+
readonly name: "amountOut";
|
|
870
|
+
readonly type: "uint256";
|
|
871
|
+
readonly internalType: "uint256";
|
|
872
|
+
}];
|
|
873
|
+
readonly stateMutability: "nonpayable";
|
|
874
|
+
}];
|
|
875
|
+
functionName: "swapExactInput";
|
|
876
|
+
} & {
|
|
877
|
+
args: readonly [boolean, amountIn: bigint, minAmountOut: bigint, recipient: `0x${string}`, `0x${string}`, `0x${string}`, deadline: bigint, bigint, bigint, bigint];
|
|
878
|
+
} & {
|
|
879
|
+
address: Address;
|
|
880
|
+
} & {
|
|
881
|
+
data: import("../../index.js").Hex;
|
|
882
|
+
to: Address;
|
|
883
|
+
}) | ({
|
|
884
|
+
abi: [{
|
|
885
|
+
readonly type: "function";
|
|
886
|
+
readonly name: "swapExactOutput";
|
|
887
|
+
readonly inputs: readonly [{
|
|
888
|
+
readonly name: "baseToQuote";
|
|
889
|
+
readonly type: "bool";
|
|
890
|
+
readonly internalType: "bool";
|
|
891
|
+
}, {
|
|
892
|
+
readonly name: "amountOut";
|
|
893
|
+
readonly type: "uint256";
|
|
894
|
+
readonly internalType: "uint256";
|
|
895
|
+
}, {
|
|
896
|
+
readonly name: "maxAmountIn";
|
|
897
|
+
readonly type: "uint256";
|
|
898
|
+
readonly internalType: "uint256";
|
|
899
|
+
}, {
|
|
900
|
+
readonly name: "recipient";
|
|
901
|
+
readonly type: "address";
|
|
902
|
+
readonly internalType: "address";
|
|
903
|
+
}, {
|
|
904
|
+
readonly name: "customerId";
|
|
905
|
+
readonly type: "bytes32";
|
|
906
|
+
readonly internalType: "bytes32";
|
|
907
|
+
}, {
|
|
908
|
+
readonly name: "tradeId";
|
|
909
|
+
readonly type: "bytes32";
|
|
910
|
+
readonly internalType: "bytes32";
|
|
911
|
+
}, {
|
|
912
|
+
readonly name: "deadline";
|
|
913
|
+
readonly type: "uint256";
|
|
914
|
+
readonly internalType: "uint256";
|
|
915
|
+
}, {
|
|
916
|
+
readonly name: "expectedOraclePrice";
|
|
917
|
+
readonly type: "uint256";
|
|
918
|
+
readonly internalType: "uint256";
|
|
919
|
+
}, {
|
|
920
|
+
readonly name: "oraclePriceToleranceBps";
|
|
921
|
+
readonly type: "uint256";
|
|
922
|
+
readonly internalType: "uint256";
|
|
923
|
+
}, {
|
|
924
|
+
readonly name: "minimumOracleUpdatedAt";
|
|
925
|
+
readonly type: "uint256";
|
|
926
|
+
readonly internalType: "uint256";
|
|
927
|
+
}];
|
|
928
|
+
readonly outputs: readonly [{
|
|
929
|
+
readonly name: "amountIn";
|
|
930
|
+
readonly type: "uint256";
|
|
931
|
+
readonly internalType: "uint256";
|
|
932
|
+
}];
|
|
933
|
+
readonly stateMutability: "nonpayable";
|
|
934
|
+
}];
|
|
935
|
+
functionName: "swapExactOutput";
|
|
936
|
+
} & {
|
|
937
|
+
args: readonly [boolean, amountOut: bigint, maxAmountIn: bigint, recipient: `0x${string}`, `0x${string}`, `0x${string}`, deadline: bigint, bigint, bigint, bigint];
|
|
938
|
+
} & {
|
|
939
|
+
address: Address;
|
|
940
|
+
} & {
|
|
941
|
+
data: import("../../index.js").Hex;
|
|
942
|
+
to: Address;
|
|
943
|
+
})]>>;
|
|
944
|
+
namespace simulate {
|
|
945
|
+
/** Swap inputs and batch simulation options. */
|
|
946
|
+
type Parameters = InputArgs & Omit<simulateActions.simulateCalls.Parameters, 'calls'>;
|
|
947
|
+
}
|
|
948
|
+
/**
|
|
949
|
+
* Defines the raw swap call without its input-token approval.
|
|
950
|
+
*/
|
|
951
|
+
function call(parameters: Extract<Args, {
|
|
952
|
+
mode: 'exactInput';
|
|
953
|
+
}>): ReturnType<typeof exactInput.call>;
|
|
954
|
+
function call(parameters: Extract<Args, {
|
|
955
|
+
mode: 'exactOutput';
|
|
956
|
+
}>): ReturnType<typeof exactOutput.call>;
|
|
957
|
+
function call(parameters: Args): ReturnType<typeof exactInput.call> | ReturnType<typeof exactOutput.call>;
|
|
958
|
+
/**
|
|
959
|
+
* Extracts the unique matching trade event from a receipt.
|
|
960
|
+
*/
|
|
961
|
+
function extractEvent(logs: Log[], args: {
|
|
962
|
+
pool: Address;
|
|
963
|
+
tradeId: Hex.Hex;
|
|
964
|
+
}): Log<bigint, number, false, undefined, true, readonly [{
|
|
965
|
+
readonly type: "constructor";
|
|
966
|
+
readonly inputs: readonly [{
|
|
967
|
+
readonly name: "baseToken_";
|
|
968
|
+
readonly type: "address";
|
|
969
|
+
readonly internalType: "contract ITIP20";
|
|
970
|
+
}, {
|
|
971
|
+
readonly name: "quoteToken_";
|
|
972
|
+
readonly type: "address";
|
|
973
|
+
readonly internalType: "contract ITIP20";
|
|
974
|
+
}, {
|
|
975
|
+
readonly name: "oracle_";
|
|
976
|
+
readonly type: "address";
|
|
977
|
+
readonly internalType: "contract IPriceOracle";
|
|
978
|
+
}, {
|
|
979
|
+
readonly name: "addressRegistry_";
|
|
980
|
+
readonly type: "address";
|
|
981
|
+
readonly internalType: "contract IAddressRegistry";
|
|
982
|
+
}, {
|
|
983
|
+
readonly name: "owner_";
|
|
984
|
+
readonly type: "address";
|
|
985
|
+
readonly internalType: "address";
|
|
986
|
+
}, {
|
|
987
|
+
readonly name: "guardian_";
|
|
988
|
+
readonly type: "address";
|
|
989
|
+
readonly internalType: "address";
|
|
990
|
+
}, {
|
|
991
|
+
readonly name: "maxOracleAge_";
|
|
992
|
+
readonly type: "uint256";
|
|
993
|
+
readonly internalType: "uint256";
|
|
994
|
+
}, {
|
|
995
|
+
readonly name: "maxPriceDeviationBps_";
|
|
996
|
+
readonly type: "uint256";
|
|
997
|
+
readonly internalType: "uint256";
|
|
998
|
+
}];
|
|
999
|
+
readonly stateMutability: "nonpayable";
|
|
1000
|
+
}, {
|
|
1001
|
+
readonly type: "function";
|
|
1002
|
+
readonly name: "BPS";
|
|
1003
|
+
readonly inputs: readonly [];
|
|
1004
|
+
readonly outputs: readonly [{
|
|
1005
|
+
readonly name: "";
|
|
1006
|
+
readonly type: "uint256";
|
|
1007
|
+
readonly internalType: "uint256";
|
|
1008
|
+
}];
|
|
1009
|
+
readonly stateMutability: "view";
|
|
1010
|
+
}, {
|
|
1011
|
+
readonly type: "function";
|
|
1012
|
+
readonly name: "acceptOwnership";
|
|
1013
|
+
readonly inputs: readonly [];
|
|
1014
|
+
readonly outputs: readonly [];
|
|
1015
|
+
readonly stateMutability: "nonpayable";
|
|
1016
|
+
}, {
|
|
1017
|
+
readonly type: "function";
|
|
1018
|
+
readonly name: "addressRegistry";
|
|
1019
|
+
readonly inputs: readonly [];
|
|
1020
|
+
readonly outputs: readonly [{
|
|
1021
|
+
readonly name: "";
|
|
1022
|
+
readonly type: "address";
|
|
1023
|
+
readonly internalType: "contract IAddressRegistry";
|
|
1024
|
+
}];
|
|
1025
|
+
readonly stateMutability: "view";
|
|
1026
|
+
}, {
|
|
1027
|
+
readonly type: "function";
|
|
1028
|
+
readonly name: "baseDecimals";
|
|
1029
|
+
readonly inputs: readonly [];
|
|
1030
|
+
readonly outputs: readonly [{
|
|
1031
|
+
readonly name: "";
|
|
1032
|
+
readonly type: "uint8";
|
|
1033
|
+
readonly internalType: "uint8";
|
|
1034
|
+
}];
|
|
1035
|
+
readonly stateMutability: "view";
|
|
1036
|
+
}, {
|
|
1037
|
+
readonly type: "function";
|
|
1038
|
+
readonly name: "baseToQuotePriceAnchor";
|
|
1039
|
+
readonly inputs: readonly [];
|
|
1040
|
+
readonly outputs: readonly [{
|
|
1041
|
+
readonly name: "";
|
|
1042
|
+
readonly type: "uint256";
|
|
1043
|
+
readonly internalType: "uint256";
|
|
1044
|
+
}];
|
|
1045
|
+
readonly stateMutability: "view";
|
|
1046
|
+
}, {
|
|
1047
|
+
readonly type: "function";
|
|
1048
|
+
readonly name: "baseToken";
|
|
1049
|
+
readonly inputs: readonly [];
|
|
1050
|
+
readonly outputs: readonly [{
|
|
1051
|
+
readonly name: "";
|
|
1052
|
+
readonly type: "address";
|
|
1053
|
+
readonly internalType: "contract ITIP20";
|
|
1054
|
+
}];
|
|
1055
|
+
readonly stateMutability: "view";
|
|
1056
|
+
}, {
|
|
1057
|
+
readonly type: "function";
|
|
1058
|
+
readonly name: "fund";
|
|
1059
|
+
readonly inputs: readonly [{
|
|
1060
|
+
readonly name: "token";
|
|
1061
|
+
readonly type: "address";
|
|
1062
|
+
readonly internalType: "address";
|
|
1063
|
+
}, {
|
|
1064
|
+
readonly name: "amount";
|
|
1065
|
+
readonly type: "uint256";
|
|
1066
|
+
readonly internalType: "uint256";
|
|
1067
|
+
}, {
|
|
1068
|
+
readonly name: "memo";
|
|
1069
|
+
readonly type: "bytes32";
|
|
1070
|
+
readonly internalType: "bytes32";
|
|
1071
|
+
}];
|
|
1072
|
+
readonly outputs: readonly [];
|
|
1073
|
+
readonly stateMutability: "nonpayable";
|
|
1074
|
+
}, {
|
|
1075
|
+
readonly type: "function";
|
|
1076
|
+
readonly name: "guardian";
|
|
1077
|
+
readonly inputs: readonly [];
|
|
1078
|
+
readonly outputs: readonly [{
|
|
1079
|
+
readonly name: "";
|
|
1080
|
+
readonly type: "address";
|
|
1081
|
+
readonly internalType: "address";
|
|
1082
|
+
}];
|
|
1083
|
+
readonly stateMutability: "view";
|
|
1084
|
+
}, {
|
|
1085
|
+
readonly type: "function";
|
|
1086
|
+
readonly name: "maxOracleAge";
|
|
1087
|
+
readonly inputs: readonly [];
|
|
1088
|
+
readonly outputs: readonly [{
|
|
1089
|
+
readonly name: "";
|
|
1090
|
+
readonly type: "uint80";
|
|
1091
|
+
readonly internalType: "uint80";
|
|
1092
|
+
}];
|
|
1093
|
+
readonly stateMutability: "view";
|
|
1094
|
+
}, {
|
|
1095
|
+
readonly type: "function";
|
|
1096
|
+
readonly name: "maxPriceDeviationBps";
|
|
1097
|
+
readonly inputs: readonly [];
|
|
1098
|
+
readonly outputs: readonly [{
|
|
1099
|
+
readonly name: "";
|
|
1100
|
+
readonly type: "uint16";
|
|
1101
|
+
readonly internalType: "uint16";
|
|
1102
|
+
}];
|
|
1103
|
+
readonly stateMutability: "view";
|
|
1104
|
+
}, {
|
|
1105
|
+
readonly type: "function";
|
|
1106
|
+
readonly name: "oracle";
|
|
1107
|
+
readonly inputs: readonly [];
|
|
1108
|
+
readonly outputs: readonly [{
|
|
1109
|
+
readonly name: "";
|
|
1110
|
+
readonly type: "address";
|
|
1111
|
+
readonly internalType: "contract IPriceOracle";
|
|
1112
|
+
}];
|
|
1113
|
+
readonly stateMutability: "view";
|
|
1114
|
+
}, {
|
|
1115
|
+
readonly type: "function";
|
|
1116
|
+
readonly name: "oracleDecimals";
|
|
1117
|
+
readonly inputs: readonly [];
|
|
1118
|
+
readonly outputs: readonly [{
|
|
1119
|
+
readonly name: "";
|
|
1120
|
+
readonly type: "uint8";
|
|
1121
|
+
readonly internalType: "uint8";
|
|
1122
|
+
}];
|
|
1123
|
+
readonly stateMutability: "view";
|
|
1124
|
+
}, {
|
|
1125
|
+
readonly type: "function";
|
|
1126
|
+
readonly name: "owner";
|
|
1127
|
+
readonly inputs: readonly [];
|
|
1128
|
+
readonly outputs: readonly [{
|
|
1129
|
+
readonly name: "";
|
|
1130
|
+
readonly type: "address";
|
|
1131
|
+
readonly internalType: "address";
|
|
1132
|
+
}];
|
|
1133
|
+
readonly stateMutability: "view";
|
|
1134
|
+
}, {
|
|
1135
|
+
readonly type: "function";
|
|
1136
|
+
readonly name: "pause";
|
|
1137
|
+
readonly inputs: readonly [];
|
|
1138
|
+
readonly outputs: readonly [];
|
|
1139
|
+
readonly stateMutability: "nonpayable";
|
|
1140
|
+
}, {
|
|
1141
|
+
readonly type: "function";
|
|
1142
|
+
readonly name: "paused";
|
|
1143
|
+
readonly inputs: readonly [];
|
|
1144
|
+
readonly outputs: readonly [{
|
|
1145
|
+
readonly name: "";
|
|
1146
|
+
readonly type: "bool";
|
|
1147
|
+
readonly internalType: "bool";
|
|
1148
|
+
}];
|
|
1149
|
+
readonly stateMutability: "view";
|
|
1150
|
+
}, {
|
|
1151
|
+
readonly type: "function";
|
|
1152
|
+
readonly name: "pendingOwner";
|
|
1153
|
+
readonly inputs: readonly [];
|
|
1154
|
+
readonly outputs: readonly [{
|
|
1155
|
+
readonly name: "";
|
|
1156
|
+
readonly type: "address";
|
|
1157
|
+
readonly internalType: "address";
|
|
1158
|
+
}];
|
|
1159
|
+
readonly stateMutability: "view";
|
|
1160
|
+
}, {
|
|
1161
|
+
readonly type: "function";
|
|
1162
|
+
readonly name: "priceAnchor";
|
|
1163
|
+
readonly inputs: readonly [{
|
|
1164
|
+
readonly name: "baseToQuote";
|
|
1165
|
+
readonly type: "bool";
|
|
1166
|
+
readonly internalType: "bool";
|
|
1167
|
+
}];
|
|
1168
|
+
readonly outputs: readonly [{
|
|
1169
|
+
readonly name: "";
|
|
1170
|
+
readonly type: "uint256";
|
|
1171
|
+
readonly internalType: "uint256";
|
|
1172
|
+
}];
|
|
1173
|
+
readonly stateMutability: "view";
|
|
1174
|
+
}, {
|
|
1175
|
+
readonly type: "function";
|
|
1176
|
+
readonly name: "priceScale";
|
|
1177
|
+
readonly inputs: readonly [];
|
|
1178
|
+
readonly outputs: readonly [{
|
|
1179
|
+
readonly name: "";
|
|
1180
|
+
readonly type: "uint256";
|
|
1181
|
+
readonly internalType: "uint256";
|
|
1182
|
+
}];
|
|
1183
|
+
readonly stateMutability: "view";
|
|
1184
|
+
}, {
|
|
1185
|
+
readonly type: "function";
|
|
1186
|
+
readonly name: "quoteDecimals";
|
|
1187
|
+
readonly inputs: readonly [];
|
|
1188
|
+
readonly outputs: readonly [{
|
|
1189
|
+
readonly name: "";
|
|
1190
|
+
readonly type: "uint8";
|
|
1191
|
+
readonly internalType: "uint8";
|
|
1192
|
+
}];
|
|
1193
|
+
readonly stateMutability: "view";
|
|
1194
|
+
}, {
|
|
1195
|
+
readonly type: "function";
|
|
1196
|
+
readonly name: "quoteExactInput";
|
|
1197
|
+
readonly inputs: readonly [{
|
|
1198
|
+
readonly name: "baseToQuote";
|
|
1199
|
+
readonly type: "bool";
|
|
1200
|
+
readonly internalType: "bool";
|
|
1201
|
+
}, {
|
|
1202
|
+
readonly name: "amountIn";
|
|
1203
|
+
readonly type: "uint256";
|
|
1204
|
+
readonly internalType: "uint256";
|
|
1205
|
+
}];
|
|
1206
|
+
readonly outputs: readonly [{
|
|
1207
|
+
readonly name: "amountOut";
|
|
1208
|
+
readonly type: "uint256";
|
|
1209
|
+
readonly internalType: "uint256";
|
|
1210
|
+
}, {
|
|
1211
|
+
readonly name: "price";
|
|
1212
|
+
readonly type: "uint256";
|
|
1213
|
+
readonly internalType: "uint256";
|
|
1214
|
+
}, {
|
|
1215
|
+
readonly name: "updatedAt";
|
|
1216
|
+
readonly type: "uint256";
|
|
1217
|
+
readonly internalType: "uint256";
|
|
1218
|
+
}];
|
|
1219
|
+
readonly stateMutability: "view";
|
|
1220
|
+
}, {
|
|
1221
|
+
readonly type: "function";
|
|
1222
|
+
readonly name: "quoteExactInputFor";
|
|
1223
|
+
readonly inputs: readonly [{
|
|
1224
|
+
readonly name: "taker";
|
|
1225
|
+
readonly type: "address";
|
|
1226
|
+
readonly internalType: "address";
|
|
1227
|
+
}, {
|
|
1228
|
+
readonly name: "recipient";
|
|
1229
|
+
readonly type: "address";
|
|
1230
|
+
readonly internalType: "address";
|
|
1231
|
+
}, {
|
|
1232
|
+
readonly name: "customerId";
|
|
1233
|
+
readonly type: "bytes32";
|
|
1234
|
+
readonly internalType: "bytes32";
|
|
1235
|
+
}, {
|
|
1236
|
+
readonly name: "baseToQuote";
|
|
1237
|
+
readonly type: "bool";
|
|
1238
|
+
readonly internalType: "bool";
|
|
1239
|
+
}, {
|
|
1240
|
+
readonly name: "amountIn";
|
|
1241
|
+
readonly type: "uint256";
|
|
1242
|
+
readonly internalType: "uint256";
|
|
1243
|
+
}];
|
|
1244
|
+
readonly outputs: readonly [{
|
|
1245
|
+
readonly name: "amountOut";
|
|
1246
|
+
readonly type: "uint256";
|
|
1247
|
+
readonly internalType: "uint256";
|
|
1248
|
+
}, {
|
|
1249
|
+
readonly name: "price";
|
|
1250
|
+
readonly type: "uint256";
|
|
1251
|
+
readonly internalType: "uint256";
|
|
1252
|
+
}, {
|
|
1253
|
+
readonly name: "updatedAt";
|
|
1254
|
+
readonly type: "uint256";
|
|
1255
|
+
readonly internalType: "uint256";
|
|
1256
|
+
}, {
|
|
1257
|
+
readonly name: "creditAfter";
|
|
1258
|
+
readonly type: "uint256";
|
|
1259
|
+
readonly internalType: "uint256";
|
|
1260
|
+
}];
|
|
1261
|
+
readonly stateMutability: "view";
|
|
1262
|
+
}, {
|
|
1263
|
+
readonly type: "function";
|
|
1264
|
+
readonly name: "quoteExactOutput";
|
|
1265
|
+
readonly inputs: readonly [{
|
|
1266
|
+
readonly name: "baseToQuote";
|
|
1267
|
+
readonly type: "bool";
|
|
1268
|
+
readonly internalType: "bool";
|
|
1269
|
+
}, {
|
|
1270
|
+
readonly name: "amountOut";
|
|
1271
|
+
readonly type: "uint256";
|
|
1272
|
+
readonly internalType: "uint256";
|
|
1273
|
+
}];
|
|
1274
|
+
readonly outputs: readonly [{
|
|
1275
|
+
readonly name: "amountIn";
|
|
1276
|
+
readonly type: "uint256";
|
|
1277
|
+
readonly internalType: "uint256";
|
|
1278
|
+
}, {
|
|
1279
|
+
readonly name: "price";
|
|
1280
|
+
readonly type: "uint256";
|
|
1281
|
+
readonly internalType: "uint256";
|
|
1282
|
+
}, {
|
|
1283
|
+
readonly name: "updatedAt";
|
|
1284
|
+
readonly type: "uint256";
|
|
1285
|
+
readonly internalType: "uint256";
|
|
1286
|
+
}];
|
|
1287
|
+
readonly stateMutability: "view";
|
|
1288
|
+
}, {
|
|
1289
|
+
readonly type: "function";
|
|
1290
|
+
readonly name: "quoteExactOutputFor";
|
|
1291
|
+
readonly inputs: readonly [{
|
|
1292
|
+
readonly name: "taker";
|
|
1293
|
+
readonly type: "address";
|
|
1294
|
+
readonly internalType: "address";
|
|
1295
|
+
}, {
|
|
1296
|
+
readonly name: "recipient";
|
|
1297
|
+
readonly type: "address";
|
|
1298
|
+
readonly internalType: "address";
|
|
1299
|
+
}, {
|
|
1300
|
+
readonly name: "customerId";
|
|
1301
|
+
readonly type: "bytes32";
|
|
1302
|
+
readonly internalType: "bytes32";
|
|
1303
|
+
}, {
|
|
1304
|
+
readonly name: "baseToQuote";
|
|
1305
|
+
readonly type: "bool";
|
|
1306
|
+
readonly internalType: "bool";
|
|
1307
|
+
}, {
|
|
1308
|
+
readonly name: "amountOut";
|
|
1309
|
+
readonly type: "uint256";
|
|
1310
|
+
readonly internalType: "uint256";
|
|
1311
|
+
}];
|
|
1312
|
+
readonly outputs: readonly [{
|
|
1313
|
+
readonly name: "amountIn";
|
|
1314
|
+
readonly type: "uint256";
|
|
1315
|
+
readonly internalType: "uint256";
|
|
1316
|
+
}, {
|
|
1317
|
+
readonly name: "price";
|
|
1318
|
+
readonly type: "uint256";
|
|
1319
|
+
readonly internalType: "uint256";
|
|
1320
|
+
}, {
|
|
1321
|
+
readonly name: "updatedAt";
|
|
1322
|
+
readonly type: "uint256";
|
|
1323
|
+
readonly internalType: "uint256";
|
|
1324
|
+
}, {
|
|
1325
|
+
readonly name: "creditAfter";
|
|
1326
|
+
readonly type: "uint256";
|
|
1327
|
+
readonly internalType: "uint256";
|
|
1328
|
+
}];
|
|
1329
|
+
readonly stateMutability: "view";
|
|
1330
|
+
}, {
|
|
1331
|
+
readonly type: "function";
|
|
1332
|
+
readonly name: "quoteToBasePriceAnchor";
|
|
1333
|
+
readonly inputs: readonly [];
|
|
1334
|
+
readonly outputs: readonly [{
|
|
1335
|
+
readonly name: "";
|
|
1336
|
+
readonly type: "uint256";
|
|
1337
|
+
readonly internalType: "uint256";
|
|
1338
|
+
}];
|
|
1339
|
+
readonly stateMutability: "view";
|
|
1340
|
+
}, {
|
|
1341
|
+
readonly type: "function";
|
|
1342
|
+
readonly name: "quoteToken";
|
|
1343
|
+
readonly inputs: readonly [];
|
|
1344
|
+
readonly outputs: readonly [{
|
|
1345
|
+
readonly name: "";
|
|
1346
|
+
readonly type: "address";
|
|
1347
|
+
readonly internalType: "contract ITIP20";
|
|
1348
|
+
}];
|
|
1349
|
+
readonly stateMutability: "view";
|
|
1350
|
+
}, {
|
|
1351
|
+
readonly type: "function";
|
|
1352
|
+
readonly name: "recipientAllowed";
|
|
1353
|
+
readonly inputs: readonly [{
|
|
1354
|
+
readonly name: "recipient";
|
|
1355
|
+
readonly type: "address";
|
|
1356
|
+
readonly internalType: "address";
|
|
1357
|
+
}];
|
|
1358
|
+
readonly outputs: readonly [{
|
|
1359
|
+
readonly name: "allowed";
|
|
1360
|
+
readonly type: "bool";
|
|
1361
|
+
readonly internalType: "bool";
|
|
1362
|
+
}];
|
|
1363
|
+
readonly stateMutability: "view";
|
|
1364
|
+
}, {
|
|
1365
|
+
readonly type: "function";
|
|
1366
|
+
readonly name: "resetPriceAnchor";
|
|
1367
|
+
readonly inputs: readonly [{
|
|
1368
|
+
readonly name: "baseToQuote";
|
|
1369
|
+
readonly type: "bool";
|
|
1370
|
+
readonly internalType: "bool";
|
|
1371
|
+
}];
|
|
1372
|
+
readonly outputs: readonly [];
|
|
1373
|
+
readonly stateMutability: "nonpayable";
|
|
1374
|
+
}, {
|
|
1375
|
+
readonly type: "function";
|
|
1376
|
+
readonly name: "resolveRecipient";
|
|
1377
|
+
readonly inputs: readonly [{
|
|
1378
|
+
readonly name: "recipient";
|
|
1379
|
+
readonly type: "address";
|
|
1380
|
+
readonly internalType: "address";
|
|
1381
|
+
}];
|
|
1382
|
+
readonly outputs: readonly [{
|
|
1383
|
+
readonly name: "resolved";
|
|
1384
|
+
readonly type: "address";
|
|
1385
|
+
readonly internalType: "address";
|
|
1386
|
+
}];
|
|
1387
|
+
readonly stateMutability: "view";
|
|
1388
|
+
}, {
|
|
1389
|
+
readonly type: "function";
|
|
1390
|
+
readonly name: "roundingCredit";
|
|
1391
|
+
readonly inputs: readonly [{
|
|
1392
|
+
readonly name: "routeKey";
|
|
1393
|
+
readonly type: "bytes32";
|
|
1394
|
+
readonly internalType: "bytes32";
|
|
1395
|
+
}];
|
|
1396
|
+
readonly outputs: readonly [{
|
|
1397
|
+
readonly name: "credit";
|
|
1398
|
+
readonly type: "uint256";
|
|
1399
|
+
readonly internalType: "uint256";
|
|
1400
|
+
}];
|
|
1401
|
+
readonly stateMutability: "view";
|
|
1402
|
+
}, {
|
|
1403
|
+
readonly type: "function";
|
|
1404
|
+
readonly name: "roundingRouteKey";
|
|
1405
|
+
readonly inputs: readonly [{
|
|
1406
|
+
readonly name: "taker";
|
|
1407
|
+
readonly type: "address";
|
|
1408
|
+
readonly internalType: "address";
|
|
1409
|
+
}, {
|
|
1410
|
+
readonly name: "recipient";
|
|
1411
|
+
readonly type: "address";
|
|
1412
|
+
readonly internalType: "address";
|
|
1413
|
+
}, {
|
|
1414
|
+
readonly name: "customerId";
|
|
1415
|
+
readonly type: "bytes32";
|
|
1416
|
+
readonly internalType: "bytes32";
|
|
1417
|
+
}];
|
|
1418
|
+
readonly outputs: readonly [{
|
|
1419
|
+
readonly name: "";
|
|
1420
|
+
readonly type: "bytes32";
|
|
1421
|
+
readonly internalType: "bytes32";
|
|
1422
|
+
}];
|
|
1423
|
+
readonly stateMutability: "view";
|
|
1424
|
+
}, {
|
|
1425
|
+
readonly type: "function";
|
|
1426
|
+
readonly name: "setGuardian";
|
|
1427
|
+
readonly inputs: readonly [{
|
|
1428
|
+
readonly name: "newGuardian";
|
|
1429
|
+
readonly type: "address";
|
|
1430
|
+
readonly internalType: "address";
|
|
1431
|
+
}];
|
|
1432
|
+
readonly outputs: readonly [];
|
|
1433
|
+
readonly stateMutability: "nonpayable";
|
|
1434
|
+
}, {
|
|
1435
|
+
readonly type: "function";
|
|
1436
|
+
readonly name: "setMaxOracleAge";
|
|
1437
|
+
readonly inputs: readonly [{
|
|
1438
|
+
readonly name: "newMaxOracleAge";
|
|
1439
|
+
readonly type: "uint256";
|
|
1440
|
+
readonly internalType: "uint256";
|
|
1441
|
+
}];
|
|
1442
|
+
readonly outputs: readonly [];
|
|
1443
|
+
readonly stateMutability: "nonpayable";
|
|
1444
|
+
}, {
|
|
1445
|
+
readonly type: "function";
|
|
1446
|
+
readonly name: "setMaxPriceDeviationBps";
|
|
1447
|
+
readonly inputs: readonly [{
|
|
1448
|
+
readonly name: "newMaxPriceDeviationBps";
|
|
1449
|
+
readonly type: "uint256";
|
|
1450
|
+
readonly internalType: "uint256";
|
|
1451
|
+
}];
|
|
1452
|
+
readonly outputs: readonly [];
|
|
1453
|
+
readonly stateMutability: "nonpayable";
|
|
1454
|
+
}, {
|
|
1455
|
+
readonly type: "function";
|
|
1456
|
+
readonly name: "setOracle";
|
|
1457
|
+
readonly inputs: readonly [{
|
|
1458
|
+
readonly name: "newOracle";
|
|
1459
|
+
readonly type: "address";
|
|
1460
|
+
readonly internalType: "contract IPriceOracle";
|
|
1461
|
+
}];
|
|
1462
|
+
readonly outputs: readonly [];
|
|
1463
|
+
readonly stateMutability: "nonpayable";
|
|
1464
|
+
}, {
|
|
1465
|
+
readonly type: "function";
|
|
1466
|
+
readonly name: "setRecipientAllowed";
|
|
1467
|
+
readonly inputs: readonly [{
|
|
1468
|
+
readonly name: "recipient";
|
|
1469
|
+
readonly type: "address";
|
|
1470
|
+
readonly internalType: "address";
|
|
1471
|
+
}, {
|
|
1472
|
+
readonly name: "allowed";
|
|
1473
|
+
readonly type: "bool";
|
|
1474
|
+
readonly internalType: "bool";
|
|
1475
|
+
}];
|
|
1476
|
+
readonly outputs: readonly [];
|
|
1477
|
+
readonly stateMutability: "nonpayable";
|
|
1478
|
+
}, {
|
|
1479
|
+
readonly type: "function";
|
|
1480
|
+
readonly name: "setTakerAllowed";
|
|
1481
|
+
readonly inputs: readonly [{
|
|
1482
|
+
readonly name: "taker";
|
|
1483
|
+
readonly type: "address";
|
|
1484
|
+
readonly internalType: "address";
|
|
1485
|
+
}, {
|
|
1486
|
+
readonly name: "allowed";
|
|
1487
|
+
readonly type: "bool";
|
|
1488
|
+
readonly internalType: "bool";
|
|
1489
|
+
}];
|
|
1490
|
+
readonly outputs: readonly [];
|
|
1491
|
+
readonly stateMutability: "nonpayable";
|
|
1492
|
+
}, {
|
|
1493
|
+
readonly type: "function";
|
|
1494
|
+
readonly name: "swapExactInput";
|
|
1495
|
+
readonly inputs: readonly [{
|
|
1496
|
+
readonly name: "baseToQuote";
|
|
1497
|
+
readonly type: "bool";
|
|
1498
|
+
readonly internalType: "bool";
|
|
1499
|
+
}, {
|
|
1500
|
+
readonly name: "amountIn";
|
|
1501
|
+
readonly type: "uint256";
|
|
1502
|
+
readonly internalType: "uint256";
|
|
1503
|
+
}, {
|
|
1504
|
+
readonly name: "minAmountOut";
|
|
1505
|
+
readonly type: "uint256";
|
|
1506
|
+
readonly internalType: "uint256";
|
|
1507
|
+
}, {
|
|
1508
|
+
readonly name: "recipient";
|
|
1509
|
+
readonly type: "address";
|
|
1510
|
+
readonly internalType: "address";
|
|
1511
|
+
}, {
|
|
1512
|
+
readonly name: "customerId";
|
|
1513
|
+
readonly type: "bytes32";
|
|
1514
|
+
readonly internalType: "bytes32";
|
|
1515
|
+
}, {
|
|
1516
|
+
readonly name: "tradeId";
|
|
1517
|
+
readonly type: "bytes32";
|
|
1518
|
+
readonly internalType: "bytes32";
|
|
1519
|
+
}, {
|
|
1520
|
+
readonly name: "deadline";
|
|
1521
|
+
readonly type: "uint256";
|
|
1522
|
+
readonly internalType: "uint256";
|
|
1523
|
+
}, {
|
|
1524
|
+
readonly name: "expectedOraclePrice";
|
|
1525
|
+
readonly type: "uint256";
|
|
1526
|
+
readonly internalType: "uint256";
|
|
1527
|
+
}, {
|
|
1528
|
+
readonly name: "oraclePriceToleranceBps";
|
|
1529
|
+
readonly type: "uint256";
|
|
1530
|
+
readonly internalType: "uint256";
|
|
1531
|
+
}, {
|
|
1532
|
+
readonly name: "minimumOracleUpdatedAt";
|
|
1533
|
+
readonly type: "uint256";
|
|
1534
|
+
readonly internalType: "uint256";
|
|
1535
|
+
}];
|
|
1536
|
+
readonly outputs: readonly [{
|
|
1537
|
+
readonly name: "amountOut";
|
|
1538
|
+
readonly type: "uint256";
|
|
1539
|
+
readonly internalType: "uint256";
|
|
1540
|
+
}];
|
|
1541
|
+
readonly stateMutability: "nonpayable";
|
|
1542
|
+
}, {
|
|
1543
|
+
readonly type: "function";
|
|
1544
|
+
readonly name: "swapExactOutput";
|
|
1545
|
+
readonly inputs: readonly [{
|
|
1546
|
+
readonly name: "baseToQuote";
|
|
1547
|
+
readonly type: "bool";
|
|
1548
|
+
readonly internalType: "bool";
|
|
1549
|
+
}, {
|
|
1550
|
+
readonly name: "amountOut";
|
|
1551
|
+
readonly type: "uint256";
|
|
1552
|
+
readonly internalType: "uint256";
|
|
1553
|
+
}, {
|
|
1554
|
+
readonly name: "maxAmountIn";
|
|
1555
|
+
readonly type: "uint256";
|
|
1556
|
+
readonly internalType: "uint256";
|
|
1557
|
+
}, {
|
|
1558
|
+
readonly name: "recipient";
|
|
1559
|
+
readonly type: "address";
|
|
1560
|
+
readonly internalType: "address";
|
|
1561
|
+
}, {
|
|
1562
|
+
readonly name: "customerId";
|
|
1563
|
+
readonly type: "bytes32";
|
|
1564
|
+
readonly internalType: "bytes32";
|
|
1565
|
+
}, {
|
|
1566
|
+
readonly name: "tradeId";
|
|
1567
|
+
readonly type: "bytes32";
|
|
1568
|
+
readonly internalType: "bytes32";
|
|
1569
|
+
}, {
|
|
1570
|
+
readonly name: "deadline";
|
|
1571
|
+
readonly type: "uint256";
|
|
1572
|
+
readonly internalType: "uint256";
|
|
1573
|
+
}, {
|
|
1574
|
+
readonly name: "expectedOraclePrice";
|
|
1575
|
+
readonly type: "uint256";
|
|
1576
|
+
readonly internalType: "uint256";
|
|
1577
|
+
}, {
|
|
1578
|
+
readonly name: "oraclePriceToleranceBps";
|
|
1579
|
+
readonly type: "uint256";
|
|
1580
|
+
readonly internalType: "uint256";
|
|
1581
|
+
}, {
|
|
1582
|
+
readonly name: "minimumOracleUpdatedAt";
|
|
1583
|
+
readonly type: "uint256";
|
|
1584
|
+
readonly internalType: "uint256";
|
|
1585
|
+
}];
|
|
1586
|
+
readonly outputs: readonly [{
|
|
1587
|
+
readonly name: "amountIn";
|
|
1588
|
+
readonly type: "uint256";
|
|
1589
|
+
readonly internalType: "uint256";
|
|
1590
|
+
}];
|
|
1591
|
+
readonly stateMutability: "nonpayable";
|
|
1592
|
+
}, {
|
|
1593
|
+
readonly type: "function";
|
|
1594
|
+
readonly name: "takerAllowed";
|
|
1595
|
+
readonly inputs: readonly [{
|
|
1596
|
+
readonly name: "taker";
|
|
1597
|
+
readonly type: "address";
|
|
1598
|
+
readonly internalType: "address";
|
|
1599
|
+
}];
|
|
1600
|
+
readonly outputs: readonly [{
|
|
1601
|
+
readonly name: "allowed";
|
|
1602
|
+
readonly type: "bool";
|
|
1603
|
+
readonly internalType: "bool";
|
|
1604
|
+
}];
|
|
1605
|
+
readonly stateMutability: "view";
|
|
1606
|
+
}, {
|
|
1607
|
+
readonly type: "function";
|
|
1608
|
+
readonly name: "transferOwnership";
|
|
1609
|
+
readonly inputs: readonly [{
|
|
1610
|
+
readonly name: "newOwner";
|
|
1611
|
+
readonly type: "address";
|
|
1612
|
+
readonly internalType: "address";
|
|
1613
|
+
}];
|
|
1614
|
+
readonly outputs: readonly [];
|
|
1615
|
+
readonly stateMutability: "nonpayable";
|
|
1616
|
+
}, {
|
|
1617
|
+
readonly type: "function";
|
|
1618
|
+
readonly name: "unpause";
|
|
1619
|
+
readonly inputs: readonly [];
|
|
1620
|
+
readonly outputs: readonly [];
|
|
1621
|
+
readonly stateMutability: "nonpayable";
|
|
1622
|
+
}, {
|
|
1623
|
+
readonly type: "function";
|
|
1624
|
+
readonly name: "withdraw";
|
|
1625
|
+
readonly inputs: readonly [{
|
|
1626
|
+
readonly name: "token";
|
|
1627
|
+
readonly type: "address";
|
|
1628
|
+
readonly internalType: "address";
|
|
1629
|
+
}, {
|
|
1630
|
+
readonly name: "recipient";
|
|
1631
|
+
readonly type: "address";
|
|
1632
|
+
readonly internalType: "address";
|
|
1633
|
+
}, {
|
|
1634
|
+
readonly name: "amount";
|
|
1635
|
+
readonly type: "uint256";
|
|
1636
|
+
readonly internalType: "uint256";
|
|
1637
|
+
}, {
|
|
1638
|
+
readonly name: "memo";
|
|
1639
|
+
readonly type: "bytes32";
|
|
1640
|
+
readonly internalType: "bytes32";
|
|
1641
|
+
}];
|
|
1642
|
+
readonly outputs: readonly [];
|
|
1643
|
+
readonly stateMutability: "nonpayable";
|
|
1644
|
+
}, {
|
|
1645
|
+
readonly type: "event";
|
|
1646
|
+
readonly name: "Funded";
|
|
1647
|
+
readonly inputs: readonly [{
|
|
1648
|
+
readonly name: "token";
|
|
1649
|
+
readonly type: "address";
|
|
1650
|
+
readonly indexed: true;
|
|
1651
|
+
readonly internalType: "address";
|
|
1652
|
+
}, {
|
|
1653
|
+
readonly name: "amount";
|
|
1654
|
+
readonly type: "uint256";
|
|
1655
|
+
readonly indexed: false;
|
|
1656
|
+
readonly internalType: "uint256";
|
|
1657
|
+
}, {
|
|
1658
|
+
readonly name: "memo";
|
|
1659
|
+
readonly type: "bytes32";
|
|
1660
|
+
readonly indexed: true;
|
|
1661
|
+
readonly internalType: "bytes32";
|
|
1662
|
+
}];
|
|
1663
|
+
readonly anonymous: false;
|
|
1664
|
+
}, {
|
|
1665
|
+
readonly type: "event";
|
|
1666
|
+
readonly name: "GuardianUpdated";
|
|
1667
|
+
readonly inputs: readonly [{
|
|
1668
|
+
readonly name: "oldGuardian";
|
|
1669
|
+
readonly type: "address";
|
|
1670
|
+
readonly indexed: true;
|
|
1671
|
+
readonly internalType: "address";
|
|
1672
|
+
}, {
|
|
1673
|
+
readonly name: "newGuardian";
|
|
1674
|
+
readonly type: "address";
|
|
1675
|
+
readonly indexed: true;
|
|
1676
|
+
readonly internalType: "address";
|
|
1677
|
+
}];
|
|
1678
|
+
readonly anonymous: false;
|
|
1679
|
+
}, {
|
|
1680
|
+
readonly type: "event";
|
|
1681
|
+
readonly name: "MaxOracleAgeUpdated";
|
|
1682
|
+
readonly inputs: readonly [{
|
|
1683
|
+
readonly name: "oldMaxAge";
|
|
1684
|
+
readonly type: "uint256";
|
|
1685
|
+
readonly indexed: false;
|
|
1686
|
+
readonly internalType: "uint256";
|
|
1687
|
+
}, {
|
|
1688
|
+
readonly name: "newMaxAge";
|
|
1689
|
+
readonly type: "uint256";
|
|
1690
|
+
readonly indexed: false;
|
|
1691
|
+
readonly internalType: "uint256";
|
|
1692
|
+
}];
|
|
1693
|
+
readonly anonymous: false;
|
|
1694
|
+
}, {
|
|
1695
|
+
readonly type: "event";
|
|
1696
|
+
readonly name: "MaxPriceDeviationBpsUpdated";
|
|
1697
|
+
readonly inputs: readonly [{
|
|
1698
|
+
readonly name: "oldMaxPriceDeviationBps";
|
|
1699
|
+
readonly type: "uint256";
|
|
1700
|
+
readonly indexed: false;
|
|
1701
|
+
readonly internalType: "uint256";
|
|
1702
|
+
}, {
|
|
1703
|
+
readonly name: "newMaxPriceDeviationBps";
|
|
1704
|
+
readonly type: "uint256";
|
|
1705
|
+
readonly indexed: false;
|
|
1706
|
+
readonly internalType: "uint256";
|
|
1707
|
+
}];
|
|
1708
|
+
readonly anonymous: false;
|
|
1709
|
+
}, {
|
|
1710
|
+
readonly type: "event";
|
|
1711
|
+
readonly name: "OracleUpdated";
|
|
1712
|
+
readonly inputs: readonly [{
|
|
1713
|
+
readonly name: "oldOracle";
|
|
1714
|
+
readonly type: "address";
|
|
1715
|
+
readonly indexed: true;
|
|
1716
|
+
readonly internalType: "address";
|
|
1717
|
+
}, {
|
|
1718
|
+
readonly name: "newOracle";
|
|
1719
|
+
readonly type: "address";
|
|
1720
|
+
readonly indexed: true;
|
|
1721
|
+
readonly internalType: "address";
|
|
1722
|
+
}, {
|
|
1723
|
+
readonly name: "decimals";
|
|
1724
|
+
readonly type: "uint8";
|
|
1725
|
+
readonly indexed: false;
|
|
1726
|
+
readonly internalType: "uint8";
|
|
1727
|
+
}];
|
|
1728
|
+
readonly anonymous: false;
|
|
1729
|
+
}, {
|
|
1730
|
+
readonly type: "event";
|
|
1731
|
+
readonly name: "OwnershipTransferStarted";
|
|
1732
|
+
readonly inputs: readonly [{
|
|
1733
|
+
readonly name: "oldOwner";
|
|
1734
|
+
readonly type: "address";
|
|
1735
|
+
readonly indexed: true;
|
|
1736
|
+
readonly internalType: "address";
|
|
1737
|
+
}, {
|
|
1738
|
+
readonly name: "pendingOwner";
|
|
1739
|
+
readonly type: "address";
|
|
1740
|
+
readonly indexed: true;
|
|
1741
|
+
readonly internalType: "address";
|
|
1742
|
+
}];
|
|
1743
|
+
readonly anonymous: false;
|
|
1744
|
+
}, {
|
|
1745
|
+
readonly type: "event";
|
|
1746
|
+
readonly name: "OwnershipTransferred";
|
|
1747
|
+
readonly inputs: readonly [{
|
|
1748
|
+
readonly name: "oldOwner";
|
|
1749
|
+
readonly type: "address";
|
|
1750
|
+
readonly indexed: true;
|
|
1751
|
+
readonly internalType: "address";
|
|
1752
|
+
}, {
|
|
1753
|
+
readonly name: "newOwner";
|
|
1754
|
+
readonly type: "address";
|
|
1755
|
+
readonly indexed: true;
|
|
1756
|
+
readonly internalType: "address";
|
|
1757
|
+
}];
|
|
1758
|
+
readonly anonymous: false;
|
|
1759
|
+
}, {
|
|
1760
|
+
readonly type: "event";
|
|
1761
|
+
readonly name: "PausedStateChanged";
|
|
1762
|
+
readonly inputs: readonly [{
|
|
1763
|
+
readonly name: "paused";
|
|
1764
|
+
readonly type: "bool";
|
|
1765
|
+
readonly indexed: false;
|
|
1766
|
+
readonly internalType: "bool";
|
|
1767
|
+
}];
|
|
1768
|
+
readonly anonymous: false;
|
|
1769
|
+
}, {
|
|
1770
|
+
readonly type: "event";
|
|
1771
|
+
readonly name: "PriceAnchorUpdated";
|
|
1772
|
+
readonly inputs: readonly [{
|
|
1773
|
+
readonly name: "baseToQuote";
|
|
1774
|
+
readonly type: "bool";
|
|
1775
|
+
readonly indexed: true;
|
|
1776
|
+
readonly internalType: "bool";
|
|
1777
|
+
}, {
|
|
1778
|
+
readonly name: "oldAnchor";
|
|
1779
|
+
readonly type: "uint256";
|
|
1780
|
+
readonly indexed: false;
|
|
1781
|
+
readonly internalType: "uint256";
|
|
1782
|
+
}, {
|
|
1783
|
+
readonly name: "newAnchor";
|
|
1784
|
+
readonly type: "uint256";
|
|
1785
|
+
readonly indexed: false;
|
|
1786
|
+
readonly internalType: "uint256";
|
|
1787
|
+
}];
|
|
1788
|
+
readonly anonymous: false;
|
|
1789
|
+
}, {
|
|
1790
|
+
readonly type: "event";
|
|
1791
|
+
readonly name: "RecipientPermissionUpdated";
|
|
1792
|
+
readonly inputs: readonly [{
|
|
1793
|
+
readonly name: "recipient";
|
|
1794
|
+
readonly type: "address";
|
|
1795
|
+
readonly indexed: true;
|
|
1796
|
+
readonly internalType: "address";
|
|
1797
|
+
}, {
|
|
1798
|
+
readonly name: "allowed";
|
|
1799
|
+
readonly type: "bool";
|
|
1800
|
+
readonly indexed: false;
|
|
1801
|
+
readonly internalType: "bool";
|
|
1802
|
+
}];
|
|
1803
|
+
readonly anonymous: false;
|
|
1804
|
+
}, {
|
|
1805
|
+
readonly type: "event";
|
|
1806
|
+
readonly name: "RoundingCreditUpdated";
|
|
1807
|
+
readonly inputs: readonly [{
|
|
1808
|
+
readonly name: "routeKey";
|
|
1809
|
+
readonly type: "bytes32";
|
|
1810
|
+
readonly indexed: true;
|
|
1811
|
+
readonly internalType: "bytes32";
|
|
1812
|
+
}, {
|
|
1813
|
+
readonly name: "previousCredit";
|
|
1814
|
+
readonly type: "uint256";
|
|
1815
|
+
readonly indexed: false;
|
|
1816
|
+
readonly internalType: "uint256";
|
|
1817
|
+
}, {
|
|
1818
|
+
readonly name: "newCredit";
|
|
1819
|
+
readonly type: "uint256";
|
|
1820
|
+
readonly indexed: false;
|
|
1821
|
+
readonly internalType: "uint256";
|
|
1822
|
+
}];
|
|
1823
|
+
readonly anonymous: false;
|
|
1824
|
+
}, {
|
|
1825
|
+
readonly type: "event";
|
|
1826
|
+
readonly name: "TakerPermissionUpdated";
|
|
1827
|
+
readonly inputs: readonly [{
|
|
1828
|
+
readonly name: "taker";
|
|
1829
|
+
readonly type: "address";
|
|
1830
|
+
readonly indexed: true;
|
|
1831
|
+
readonly internalType: "address";
|
|
1832
|
+
}, {
|
|
1833
|
+
readonly name: "allowed";
|
|
1834
|
+
readonly type: "bool";
|
|
1835
|
+
readonly indexed: false;
|
|
1836
|
+
readonly internalType: "bool";
|
|
1837
|
+
}];
|
|
1838
|
+
readonly anonymous: false;
|
|
1839
|
+
}, {
|
|
1840
|
+
readonly type: "event";
|
|
1841
|
+
readonly name: "TradeExecuted";
|
|
1842
|
+
readonly inputs: readonly [{
|
|
1843
|
+
readonly name: "taker";
|
|
1844
|
+
readonly type: "address";
|
|
1845
|
+
readonly indexed: true;
|
|
1846
|
+
readonly internalType: "address";
|
|
1847
|
+
}, {
|
|
1848
|
+
readonly name: "recipient";
|
|
1849
|
+
readonly type: "address";
|
|
1850
|
+
readonly indexed: true;
|
|
1851
|
+
readonly internalType: "address";
|
|
1852
|
+
}, {
|
|
1853
|
+
readonly name: "customerId";
|
|
1854
|
+
readonly type: "bytes32";
|
|
1855
|
+
readonly indexed: true;
|
|
1856
|
+
readonly internalType: "bytes32";
|
|
1857
|
+
}, {
|
|
1858
|
+
readonly name: "tradeId";
|
|
1859
|
+
readonly type: "bytes32";
|
|
1860
|
+
readonly indexed: false;
|
|
1861
|
+
readonly internalType: "bytes32";
|
|
1862
|
+
}, {
|
|
1863
|
+
readonly name: "tokenIn";
|
|
1864
|
+
readonly type: "address";
|
|
1865
|
+
readonly indexed: false;
|
|
1866
|
+
readonly internalType: "address";
|
|
1867
|
+
}, {
|
|
1868
|
+
readonly name: "tokenOut";
|
|
1869
|
+
readonly type: "address";
|
|
1870
|
+
readonly indexed: false;
|
|
1871
|
+
readonly internalType: "address";
|
|
1872
|
+
}, {
|
|
1873
|
+
readonly name: "amountIn";
|
|
1874
|
+
readonly type: "uint256";
|
|
1875
|
+
readonly indexed: false;
|
|
1876
|
+
readonly internalType: "uint256";
|
|
1877
|
+
}, {
|
|
1878
|
+
readonly name: "amountOut";
|
|
1879
|
+
readonly type: "uint256";
|
|
1880
|
+
readonly indexed: false;
|
|
1881
|
+
readonly internalType: "uint256";
|
|
1882
|
+
}, {
|
|
1883
|
+
readonly name: "oraclePrice";
|
|
1884
|
+
readonly type: "uint256";
|
|
1885
|
+
readonly indexed: false;
|
|
1886
|
+
readonly internalType: "uint256";
|
|
1887
|
+
}, {
|
|
1888
|
+
readonly name: "oracleUpdatedAt";
|
|
1889
|
+
readonly type: "uint256";
|
|
1890
|
+
readonly indexed: false;
|
|
1891
|
+
readonly internalType: "uint256";
|
|
1892
|
+
}];
|
|
1893
|
+
readonly anonymous: false;
|
|
1894
|
+
}, {
|
|
1895
|
+
readonly type: "event";
|
|
1896
|
+
readonly name: "Withdrawn";
|
|
1897
|
+
readonly inputs: readonly [{
|
|
1898
|
+
readonly name: "token";
|
|
1899
|
+
readonly type: "address";
|
|
1900
|
+
readonly indexed: true;
|
|
1901
|
+
readonly internalType: "address";
|
|
1902
|
+
}, {
|
|
1903
|
+
readonly name: "recipient";
|
|
1904
|
+
readonly type: "address";
|
|
1905
|
+
readonly indexed: true;
|
|
1906
|
+
readonly internalType: "address";
|
|
1907
|
+
}, {
|
|
1908
|
+
readonly name: "amount";
|
|
1909
|
+
readonly type: "uint256";
|
|
1910
|
+
readonly indexed: false;
|
|
1911
|
+
readonly internalType: "uint256";
|
|
1912
|
+
}, {
|
|
1913
|
+
readonly name: "memo";
|
|
1914
|
+
readonly type: "bytes32";
|
|
1915
|
+
readonly indexed: false;
|
|
1916
|
+
readonly internalType: "bytes32";
|
|
1917
|
+
}];
|
|
1918
|
+
readonly anonymous: false;
|
|
1919
|
+
}, {
|
|
1920
|
+
readonly type: "error";
|
|
1921
|
+
readonly name: "AmountIsZero";
|
|
1922
|
+
readonly inputs: readonly [];
|
|
1923
|
+
}, {
|
|
1924
|
+
readonly type: "error";
|
|
1925
|
+
readonly name: "CustomerIdIsZero";
|
|
1926
|
+
readonly inputs: readonly [];
|
|
1927
|
+
}, {
|
|
1928
|
+
readonly type: "error";
|
|
1929
|
+
readonly name: "DeadlineExpired";
|
|
1930
|
+
readonly inputs: readonly [{
|
|
1931
|
+
readonly name: "deadline";
|
|
1932
|
+
readonly type: "uint256";
|
|
1933
|
+
readonly internalType: "uint256";
|
|
1934
|
+
}, {
|
|
1935
|
+
readonly name: "currentTimestamp";
|
|
1936
|
+
readonly type: "uint256";
|
|
1937
|
+
readonly internalType: "uint256";
|
|
1938
|
+
}];
|
|
1939
|
+
}, {
|
|
1940
|
+
readonly type: "error";
|
|
1941
|
+
readonly name: "ExactBalanceDeltaFailed";
|
|
1942
|
+
readonly inputs: readonly [{
|
|
1943
|
+
readonly name: "token";
|
|
1944
|
+
readonly type: "address";
|
|
1945
|
+
readonly internalType: "address";
|
|
1946
|
+
}, {
|
|
1947
|
+
readonly name: "expected";
|
|
1948
|
+
readonly type: "uint256";
|
|
1949
|
+
readonly internalType: "uint256";
|
|
1950
|
+
}, {
|
|
1951
|
+
readonly name: "actual";
|
|
1952
|
+
readonly type: "uint256";
|
|
1953
|
+
readonly internalType: "uint256";
|
|
1954
|
+
}];
|
|
1955
|
+
}, {
|
|
1956
|
+
readonly type: "error";
|
|
1957
|
+
readonly name: "FutureOracleTimestamp";
|
|
1958
|
+
readonly inputs: readonly [{
|
|
1959
|
+
readonly name: "updatedAt";
|
|
1960
|
+
readonly type: "uint256";
|
|
1961
|
+
readonly internalType: "uint256";
|
|
1962
|
+
}, {
|
|
1963
|
+
readonly name: "currentTime";
|
|
1964
|
+
readonly type: "uint256";
|
|
1965
|
+
readonly internalType: "uint256";
|
|
1966
|
+
}];
|
|
1967
|
+
}, {
|
|
1968
|
+
readonly type: "error";
|
|
1969
|
+
readonly name: "InsufficientInventory";
|
|
1970
|
+
readonly inputs: readonly [{
|
|
1971
|
+
readonly name: "token";
|
|
1972
|
+
readonly type: "address";
|
|
1973
|
+
readonly internalType: "address";
|
|
1974
|
+
}, {
|
|
1975
|
+
readonly name: "available";
|
|
1976
|
+
readonly type: "uint256";
|
|
1977
|
+
readonly internalType: "uint256";
|
|
1978
|
+
}, {
|
|
1979
|
+
readonly name: "required";
|
|
1980
|
+
readonly type: "uint256";
|
|
1981
|
+
readonly internalType: "uint256";
|
|
1982
|
+
}];
|
|
1983
|
+
}, {
|
|
1984
|
+
readonly type: "error";
|
|
1985
|
+
readonly name: "InvalidAddress";
|
|
1986
|
+
readonly inputs: readonly [];
|
|
1987
|
+
}, {
|
|
1988
|
+
readonly type: "error";
|
|
1989
|
+
readonly name: "InvalidMaxOracleAge";
|
|
1990
|
+
readonly inputs: readonly [];
|
|
1991
|
+
}, {
|
|
1992
|
+
readonly type: "error";
|
|
1993
|
+
readonly name: "InvalidMaxPriceDeviationBps";
|
|
1994
|
+
readonly inputs: readonly [{
|
|
1995
|
+
readonly name: "supplied";
|
|
1996
|
+
readonly type: "uint256";
|
|
1997
|
+
readonly internalType: "uint256";
|
|
1998
|
+
}, {
|
|
1999
|
+
readonly name: "maximum";
|
|
2000
|
+
readonly type: "uint256";
|
|
2001
|
+
readonly internalType: "uint256";
|
|
2002
|
+
}];
|
|
2003
|
+
}, {
|
|
2004
|
+
readonly type: "error";
|
|
2005
|
+
readonly name: "InvalidOraclePriceToleranceBps";
|
|
2006
|
+
readonly inputs: readonly [{
|
|
2007
|
+
readonly name: "supplied";
|
|
2008
|
+
readonly type: "uint256";
|
|
2009
|
+
readonly internalType: "uint256";
|
|
2010
|
+
}, {
|
|
2011
|
+
readonly name: "maximum";
|
|
2012
|
+
readonly type: "uint256";
|
|
2013
|
+
readonly internalType: "uint256";
|
|
2014
|
+
}];
|
|
2015
|
+
}, {
|
|
2016
|
+
readonly type: "error";
|
|
2017
|
+
readonly name: "InvalidPrice";
|
|
2018
|
+
readonly inputs: readonly [];
|
|
2019
|
+
}, {
|
|
2020
|
+
readonly type: "error";
|
|
2021
|
+
readonly name: "NotGuardianOrOwner";
|
|
2022
|
+
readonly inputs: readonly [];
|
|
2023
|
+
}, {
|
|
2024
|
+
readonly type: "error";
|
|
2025
|
+
readonly name: "NotOwner";
|
|
2026
|
+
readonly inputs: readonly [];
|
|
2027
|
+
}, {
|
|
2028
|
+
readonly type: "error";
|
|
2029
|
+
readonly name: "NotPaused";
|
|
2030
|
+
readonly inputs: readonly [];
|
|
2031
|
+
}, {
|
|
2032
|
+
readonly type: "error";
|
|
2033
|
+
readonly name: "NotPendingOwner";
|
|
2034
|
+
readonly inputs: readonly [];
|
|
2035
|
+
}, {
|
|
2036
|
+
readonly type: "error";
|
|
2037
|
+
readonly name: "OracleDecimalsChanged";
|
|
2038
|
+
readonly inputs: readonly [{
|
|
2039
|
+
readonly name: "currentDecimals";
|
|
2040
|
+
readonly type: "uint8";
|
|
2041
|
+
readonly internalType: "uint8";
|
|
2042
|
+
}, {
|
|
2043
|
+
readonly name: "proposedDecimals";
|
|
2044
|
+
readonly type: "uint8";
|
|
2045
|
+
readonly internalType: "uint8";
|
|
2046
|
+
}];
|
|
2047
|
+
}, {
|
|
2048
|
+
readonly type: "error";
|
|
2049
|
+
readonly name: "OraclePriceToleranceExceeded";
|
|
2050
|
+
readonly inputs: readonly [{
|
|
2051
|
+
readonly name: "expectedPrice";
|
|
2052
|
+
readonly type: "uint256";
|
|
2053
|
+
readonly internalType: "uint256";
|
|
2054
|
+
}, {
|
|
2055
|
+
readonly name: "actualPrice";
|
|
2056
|
+
readonly type: "uint256";
|
|
2057
|
+
readonly internalType: "uint256";
|
|
2058
|
+
}, {
|
|
2059
|
+
readonly name: "toleranceBps";
|
|
2060
|
+
readonly type: "uint256";
|
|
2061
|
+
readonly internalType: "uint256";
|
|
2062
|
+
}];
|
|
2063
|
+
}, {
|
|
2064
|
+
readonly type: "error";
|
|
2065
|
+
readonly name: "OracleTimestampTooOld";
|
|
2066
|
+
readonly inputs: readonly [{
|
|
2067
|
+
readonly name: "minimumUpdatedAt";
|
|
2068
|
+
readonly type: "uint256";
|
|
2069
|
+
readonly internalType: "uint256";
|
|
2070
|
+
}, {
|
|
2071
|
+
readonly name: "actualUpdatedAt";
|
|
2072
|
+
readonly type: "uint256";
|
|
2073
|
+
readonly internalType: "uint256";
|
|
2074
|
+
}];
|
|
2075
|
+
}, {
|
|
2076
|
+
readonly type: "error";
|
|
2077
|
+
readonly name: "Paused";
|
|
2078
|
+
readonly inputs: readonly [];
|
|
2079
|
+
}, {
|
|
2080
|
+
readonly type: "error";
|
|
2081
|
+
readonly name: "PriceAnchorNotInitialized";
|
|
2082
|
+
readonly inputs: readonly [{
|
|
2083
|
+
readonly name: "baseToQuote";
|
|
2084
|
+
readonly type: "bool";
|
|
2085
|
+
readonly internalType: "bool";
|
|
2086
|
+
}];
|
|
2087
|
+
}, {
|
|
2088
|
+
readonly type: "error";
|
|
2089
|
+
readonly name: "PriceDeviationExceeded";
|
|
2090
|
+
readonly inputs: readonly [{
|
|
2091
|
+
readonly name: "baseToQuote";
|
|
2092
|
+
readonly type: "bool";
|
|
2093
|
+
readonly internalType: "bool";
|
|
2094
|
+
}, {
|
|
2095
|
+
readonly name: "price";
|
|
2096
|
+
readonly type: "uint256";
|
|
2097
|
+
readonly internalType: "uint256";
|
|
2098
|
+
}, {
|
|
2099
|
+
readonly name: "anchor";
|
|
2100
|
+
readonly type: "uint256";
|
|
2101
|
+
readonly internalType: "uint256";
|
|
2102
|
+
}, {
|
|
2103
|
+
readonly name: "maxDeviationBps";
|
|
2104
|
+
readonly type: "uint256";
|
|
2105
|
+
readonly internalType: "uint256";
|
|
2106
|
+
}];
|
|
2107
|
+
}, {
|
|
2108
|
+
readonly type: "error";
|
|
2109
|
+
readonly name: "RecipientNotAllowed";
|
|
2110
|
+
readonly inputs: readonly [{
|
|
2111
|
+
readonly name: "recipient";
|
|
2112
|
+
readonly type: "address";
|
|
2113
|
+
readonly internalType: "address";
|
|
2114
|
+
}];
|
|
2115
|
+
}, {
|
|
2116
|
+
readonly type: "error";
|
|
2117
|
+
readonly name: "ReentrancyGuardReentrantCall";
|
|
2118
|
+
readonly inputs: readonly [];
|
|
2119
|
+
}, {
|
|
2120
|
+
readonly type: "error";
|
|
2121
|
+
readonly name: "SameToken";
|
|
2122
|
+
readonly inputs: readonly [];
|
|
2123
|
+
}, {
|
|
2124
|
+
readonly type: "error";
|
|
2125
|
+
readonly name: "SlippageExceeded";
|
|
2126
|
+
readonly inputs: readonly [{
|
|
2127
|
+
readonly name: "limit";
|
|
2128
|
+
readonly type: "uint256";
|
|
2129
|
+
readonly internalType: "uint256";
|
|
2130
|
+
}, {
|
|
2131
|
+
readonly name: "actual";
|
|
2132
|
+
readonly type: "uint256";
|
|
2133
|
+
readonly internalType: "uint256";
|
|
2134
|
+
}];
|
|
2135
|
+
}, {
|
|
2136
|
+
readonly type: "error";
|
|
2137
|
+
readonly name: "StaleOraclePrice";
|
|
2138
|
+
readonly inputs: readonly [{
|
|
2139
|
+
readonly name: "updatedAt";
|
|
2140
|
+
readonly type: "uint256";
|
|
2141
|
+
readonly internalType: "uint256";
|
|
2142
|
+
}, {
|
|
2143
|
+
readonly name: "maxAge";
|
|
2144
|
+
readonly type: "uint256";
|
|
2145
|
+
readonly internalType: "uint256";
|
|
2146
|
+
}];
|
|
2147
|
+
}, {
|
|
2148
|
+
readonly type: "error";
|
|
2149
|
+
readonly name: "TakerNotAllowed";
|
|
2150
|
+
readonly inputs: readonly [{
|
|
2151
|
+
readonly name: "taker";
|
|
2152
|
+
readonly type: "address";
|
|
2153
|
+
readonly internalType: "address";
|
|
2154
|
+
}];
|
|
2155
|
+
}, {
|
|
2156
|
+
readonly type: "error";
|
|
2157
|
+
readonly name: "TokenTransferFailed";
|
|
2158
|
+
readonly inputs: readonly [{
|
|
2159
|
+
readonly name: "token";
|
|
2160
|
+
readonly type: "address";
|
|
2161
|
+
readonly internalType: "address";
|
|
2162
|
+
}];
|
|
2163
|
+
}, {
|
|
2164
|
+
readonly type: "error";
|
|
2165
|
+
readonly name: "UnsupportedDecimals";
|
|
2166
|
+
readonly inputs: readonly [{
|
|
2167
|
+
readonly name: "baseDecimals";
|
|
2168
|
+
readonly type: "uint8";
|
|
2169
|
+
readonly internalType: "uint8";
|
|
2170
|
+
}, {
|
|
2171
|
+
readonly name: "quoteDecimals";
|
|
2172
|
+
readonly type: "uint8";
|
|
2173
|
+
readonly internalType: "uint8";
|
|
2174
|
+
}, {
|
|
2175
|
+
readonly name: "oracleDecimals";
|
|
2176
|
+
readonly type: "uint8";
|
|
2177
|
+
readonly internalType: "uint8";
|
|
2178
|
+
}];
|
|
2179
|
+
}, {
|
|
2180
|
+
readonly type: "error";
|
|
2181
|
+
readonly name: "UnsupportedToken";
|
|
2182
|
+
readonly inputs: readonly [{
|
|
2183
|
+
readonly name: "token";
|
|
2184
|
+
readonly type: "address";
|
|
2185
|
+
readonly internalType: "address";
|
|
2186
|
+
}];
|
|
2187
|
+
}], "TradeExecuted">;
|
|
2188
|
+
}
|
|
2189
|
+
/**
|
|
2190
|
+
* Approves the input token, swaps, and returns the confirmed trade and receipt.
|
|
2191
|
+
*
|
|
2192
|
+
* @example
|
|
2193
|
+
* ```ts
|
|
2194
|
+
* import { createClient, http } from 'viem'
|
|
2195
|
+
* import { tempo } from 'viem/chains'
|
|
2196
|
+
* import { Actions } from 'viem/tempo'
|
|
2197
|
+
*
|
|
2198
|
+
* const client = createClient({ chain: tempo, transport: http(), account: '0x...' })
|
|
2199
|
+
*
|
|
2200
|
+
* const trade = await Actions.propAmm.swapSync(client, {
|
|
2201
|
+
* pool: '0x...',
|
|
2202
|
+
* mode: 'exactInput',
|
|
2203
|
+
* amountIn: 1_000_000n,
|
|
2204
|
+
* minAmountOut: 1_000_000n,
|
|
2205
|
+
* expectedOraclePrice: 1_000_000_000_000_000_000n,
|
|
2206
|
+
* minimumOracleUpdatedAt: 1_799_999_000n,
|
|
2207
|
+
* })
|
|
2208
|
+
* console.log(trade.amountOut, trade.receipt.transactionHash)
|
|
2209
|
+
* ```
|
|
2210
|
+
*
|
|
2211
|
+
* @param client - Client.
|
|
2212
|
+
* @param parameters - Swap and transaction options.
|
|
2213
|
+
* @returns Confirmed trade data and receipt.
|
|
2214
|
+
*/
|
|
2215
|
+
export declare function swapSync<chain extends Chain | undefined, account extends Account | undefined>(client: Client<Transport, chain, account>, parameters: swapSync.Parameters<chain, account>): Promise<swapSync.ReturnValue>;
|
|
2216
|
+
export declare namespace swapSync {
|
|
2217
|
+
type Args = swap.InputArgs;
|
|
2218
|
+
type Parameters<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = swap.Parameters<chain, account>;
|
|
2219
|
+
type ReturnValue = Compute<GetEventArgs<typeof Abis.directPropAmm, 'TradeExecuted', {
|
|
2220
|
+
IndexedOnly: false;
|
|
2221
|
+
Required: true;
|
|
2222
|
+
}> & {
|
|
2223
|
+
/** Confirmed receipt. */
|
|
2224
|
+
receipt: TransactionReceipt;
|
|
2225
|
+
}>;
|
|
2226
|
+
}
|
|
2227
|
+
export {};
|
|
2228
|
+
//# sourceMappingURL=propAmm.d.ts.map
|