viem 2.55.5 → 2.55.8
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 +32 -0
- package/_cjs/errors/version.js +1 -1
- package/_cjs/tempo/Abis.js +1809 -1
- package/_cjs/tempo/Abis.js.map +1 -1
- package/_cjs/tempo/Decorator.js +25 -2
- package/_cjs/tempo/Decorator.js.map +1 -1
- package/_cjs/tempo/actions/earn.js +1368 -0
- package/_cjs/tempo/actions/earn.js.map +1 -0
- package/_cjs/tempo/actions/index.js +2 -1
- package/_cjs/tempo/actions/index.js.map +1 -1
- package/_cjs/tempo/actions/zone.js +47 -61
- package/_cjs/tempo/actions/zone.js.map +1 -1
- package/_cjs/tempo/chainConfig.js +3 -1
- package/_cjs/tempo/chainConfig.js.map +1 -1
- package/_cjs/tempo/errors.js +28 -4
- package/_cjs/tempo/errors.js.map +1 -1
- package/_cjs/tempo/index.js +2 -1
- package/_cjs/tempo/index.js.map +1 -1
- package/_cjs/tempo/internal/WithdrawalSenderTag.js +9 -0
- package/_cjs/tempo/internal/WithdrawalSenderTag.js.map +1 -0
- package/_cjs/tempo/zones/Abis.js +46 -0
- package/_cjs/tempo/zones/Abis.js.map +1 -1
- package/_cjs/tempo/zones/Addresses.js +17 -0
- package/_cjs/tempo/zones/Addresses.js.map +1 -0
- package/_cjs/tempo/zones/index.js +2 -2
- package/_cjs/tempo/zones/index.js.map +1 -1
- package/_cjs/tempo/zones/zone.js +30 -16
- package/_cjs/tempo/zones/zone.js.map +1 -1
- package/_cjs/utils/blob/fromBlobs.js +5 -2
- package/_cjs/utils/blob/fromBlobs.js.map +1 -1
- package/_cjs/utils/encoding/fromBytes.js +2 -2
- package/_cjs/utils/encoding/fromBytes.js.map +1 -1
- package/_esm/errors/version.js +1 -1
- package/_esm/tempo/Abis.js +1810 -0
- package/_esm/tempo/Abis.js.map +1 -1
- package/_esm/tempo/Decorator.js +25 -2
- package/_esm/tempo/Decorator.js.map +1 -1
- package/_esm/tempo/actions/earn.js +2100 -0
- package/_esm/tempo/actions/earn.js.map +1 -0
- package/_esm/tempo/actions/index.js +1 -0
- package/_esm/tempo/actions/index.js.map +1 -1
- package/_esm/tempo/actions/zone.js +104 -119
- package/_esm/tempo/actions/zone.js.map +1 -1
- package/_esm/tempo/chainConfig.js +4 -1
- package/_esm/tempo/chainConfig.js.map +1 -1
- package/_esm/tempo/errors.js +25 -2
- package/_esm/tempo/errors.js.map +1 -1
- package/_esm/tempo/index.js +1 -1
- package/_esm/tempo/index.js.map +1 -1
- package/_esm/tempo/internal/WithdrawalSenderTag.js +7 -0
- package/_esm/tempo/internal/WithdrawalSenderTag.js.map +1 -0
- package/_esm/tempo/zones/Abis.js +46 -0
- package/_esm/tempo/zones/Abis.js.map +1 -1
- package/_esm/tempo/zones/Addresses.js +14 -0
- package/_esm/tempo/zones/Addresses.js.map +1 -0
- package/_esm/tempo/zones/index.js +2 -1
- package/_esm/tempo/zones/index.js.map +1 -1
- package/_esm/tempo/zones/zone.js +29 -15
- package/_esm/tempo/zones/zone.js.map +1 -1
- package/_esm/utils/blob/fromBlobs.js +6 -2
- package/_esm/utils/blob/fromBlobs.js.map +1 -1
- package/_esm/utils/encoding/fromBytes.js +2 -2
- package/_esm/utils/encoding/fromBytes.js.map +1 -1
- package/_types/errors/version.d.ts +1 -1
- package/_types/tempo/Abis.d.ts +2880 -0
- package/_types/tempo/Abis.d.ts.map +1 -1
- package/_types/tempo/Decorator.d.ts +499 -41
- package/_types/tempo/Decorator.d.ts.map +1 -1
- package/_types/tempo/actions/earn.d.ts +7549 -0
- package/_types/tempo/actions/earn.d.ts.map +1 -0
- package/_types/tempo/actions/index.d.ts +1 -0
- package/_types/tempo/actions/index.d.ts.map +1 -1
- package/_types/tempo/actions/zone.d.ts +86 -109
- package/_types/tempo/actions/zone.d.ts.map +1 -1
- package/_types/tempo/chainConfig.d.ts.map +1 -1
- package/_types/tempo/errors.d.ts +33 -3
- package/_types/tempo/errors.d.ts.map +1 -1
- package/_types/tempo/index.d.ts +1 -1
- package/_types/tempo/index.d.ts.map +1 -1
- package/_types/tempo/internal/WithdrawalSenderTag.d.ts +11 -0
- package/_types/tempo/internal/WithdrawalSenderTag.d.ts.map +1 -0
- package/_types/tempo/zones/Abis.d.ts +87 -0
- package/_types/tempo/zones/Abis.d.ts.map +1 -1
- package/_types/tempo/zones/Addresses.d.ts +13 -0
- package/_types/tempo/zones/Addresses.d.ts.map +1 -0
- package/_types/tempo/zones/index.d.ts +2 -1
- package/_types/tempo/zones/index.d.ts.map +1 -1
- package/_types/tempo/zones/zone.d.ts +14 -33
- package/_types/tempo/zones/zone.d.ts.map +1 -1
- package/_types/utils/blob/fromBlobs.d.ts.map +1 -1
- package/errors/version.ts +1 -1
- package/package.json +2 -2
- package/tempo/Abis.ts +1822 -0
- package/tempo/Decorator.ts +572 -47
- package/tempo/actions/earn.ts +3319 -0
- package/tempo/actions/index.ts +1 -0
- package/tempo/actions/zone.ts +183 -230
- package/tempo/chainConfig.ts +7 -1
- package/tempo/errors.ts +54 -6
- package/tempo/index.ts +1 -0
- package/tempo/internal/WithdrawalSenderTag.ts +20 -0
- package/tempo/zones/Abis.ts +46 -0
- package/tempo/zones/Addresses.ts +15 -0
- package/tempo/zones/index.ts +1 -1
- package/tempo/zones/zone.ts +38 -17
- package/utils/blob/fromBlobs.ts +6 -2
- package/utils/encoding/fromBytes.ts +2 -2
package/tempo/Decorator.ts
CHANGED
|
@@ -7,6 +7,7 @@ import * as accessKeyActions from './actions/accessKey.js'
|
|
|
7
7
|
import * as ammActions from './actions/amm.js'
|
|
8
8
|
import * as channelActions from './actions/channel.js'
|
|
9
9
|
import * as dexActions from './actions/dex.js'
|
|
10
|
+
import * as earnActions from './actions/earn.js'
|
|
10
11
|
import * as faucetActions from './actions/faucet.js'
|
|
11
12
|
import * as feeActions from './actions/fee.js'
|
|
12
13
|
import * as nonceActions from './actions/nonce.js'
|
|
@@ -1742,6 +1743,534 @@ type DecoratorBase<
|
|
|
1742
1743
|
parameters: dexActions.watchOrderPlaced.Parameters,
|
|
1743
1744
|
) => () => void
|
|
1744
1745
|
}
|
|
1746
|
+
earn: {
|
|
1747
|
+
/**
|
|
1748
|
+
* Creates and attaches an admission-only TIP-403 policy to an Earn vault
|
|
1749
|
+
* share token. Existing holders remain able to send shares while
|
|
1750
|
+
* recipients and mint recipients must belong to the same whitelist.
|
|
1751
|
+
*
|
|
1752
|
+
* @example
|
|
1753
|
+
* ```ts
|
|
1754
|
+
* const { policy } = await client.earn.configureExitSafePolicy({
|
|
1755
|
+
* accessAdministrator: '0x...',
|
|
1756
|
+
* initialMembers: ['0x...', '0x...'],
|
|
1757
|
+
* shareToken: '0x...',
|
|
1758
|
+
* })
|
|
1759
|
+
* ```
|
|
1760
|
+
*
|
|
1761
|
+
* @param parameters - Share token, administrator, and initial members.
|
|
1762
|
+
* @returns The configured policy IDs and transaction receipts.
|
|
1763
|
+
*/
|
|
1764
|
+
configureExitSafePolicy: (
|
|
1765
|
+
parameters: earnActions.configureExitSafePolicy.Parameters<account>,
|
|
1766
|
+
) => Promise<earnActions.configureExitSafePolicy.ReturnValue>
|
|
1767
|
+
/**
|
|
1768
|
+
* Deposits assets into a vault and mints vault shares to `recipient`. The
|
|
1769
|
+
* transaction includes the required asset approval.
|
|
1770
|
+
*
|
|
1771
|
+
* @example
|
|
1772
|
+
* ```ts
|
|
1773
|
+
* import { createClient, http } from 'viem'
|
|
1774
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1775
|
+
* import { tempoModerato } from 'viem/chains'
|
|
1776
|
+
* import { tempoActions } from 'viem/tempo'
|
|
1777
|
+
*
|
|
1778
|
+
* const client = createClient({
|
|
1779
|
+
* account: privateKeyToAccount('0x...'),
|
|
1780
|
+
* chain: tempoModerato,
|
|
1781
|
+
* transport: http(),
|
|
1782
|
+
* }).extend(tempoActions())
|
|
1783
|
+
*
|
|
1784
|
+
* const hash = await client.earn.deposit({
|
|
1785
|
+
* assetAmount: 100_000_000n,
|
|
1786
|
+
* shareAmountMin: 99_400_000n,
|
|
1787
|
+
* vault: '0x...',
|
|
1788
|
+
* })
|
|
1789
|
+
* ```
|
|
1790
|
+
*
|
|
1791
|
+
* @param parameters - Parameters.
|
|
1792
|
+
* @returns The transaction hash.
|
|
1793
|
+
*/
|
|
1794
|
+
deposit: (
|
|
1795
|
+
parameters: earnActions.deposit.Parameters<chain, account>,
|
|
1796
|
+
) => Promise<earnActions.deposit.ReturnValue>
|
|
1797
|
+
/**
|
|
1798
|
+
* Deposits venue shares into a vault and mints vault shares to
|
|
1799
|
+
* `recipient`. The transaction includes the required venue share approval.
|
|
1800
|
+
*
|
|
1801
|
+
* @example
|
|
1802
|
+
* ```ts
|
|
1803
|
+
* import { createClient, http } from 'viem'
|
|
1804
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1805
|
+
* import { tempoModerato } from 'viem/chains'
|
|
1806
|
+
* import { tempoActions } from 'viem/tempo'
|
|
1807
|
+
*
|
|
1808
|
+
* const client = createClient({
|
|
1809
|
+
* account: privateKeyToAccount('0x...'),
|
|
1810
|
+
* chain: tempoModerato,
|
|
1811
|
+
* transport: http(),
|
|
1812
|
+
* }).extend(tempoActions())
|
|
1813
|
+
*
|
|
1814
|
+
* const hash = await client.earn.depositShares({
|
|
1815
|
+
* earnShareAmountMin: 499_000_000n,
|
|
1816
|
+
* vault: '0x...',
|
|
1817
|
+
* venueShareAmount: 500_000_000n,
|
|
1818
|
+
* venueShareToken: '0x...',
|
|
1819
|
+
* })
|
|
1820
|
+
* ```
|
|
1821
|
+
*
|
|
1822
|
+
* @param parameters - Parameters.
|
|
1823
|
+
* @returns The transaction hash.
|
|
1824
|
+
*/
|
|
1825
|
+
depositShares: (
|
|
1826
|
+
parameters: earnActions.depositShares.Parameters<chain, account>,
|
|
1827
|
+
) => Promise<earnActions.depositShares.ReturnValue>
|
|
1828
|
+
/**
|
|
1829
|
+
* Deposits venue shares and returns the confirmed receipt and event data.
|
|
1830
|
+
*
|
|
1831
|
+
* @example
|
|
1832
|
+
* ```ts
|
|
1833
|
+
* import { createClient, http } from 'viem'
|
|
1834
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1835
|
+
* import { tempoModerato } from 'viem/chains'
|
|
1836
|
+
* import { tempoActions } from 'viem/tempo'
|
|
1837
|
+
*
|
|
1838
|
+
* const client = createClient({
|
|
1839
|
+
* account: privateKeyToAccount('0x...'),
|
|
1840
|
+
* chain: tempoModerato,
|
|
1841
|
+
* transport: http(),
|
|
1842
|
+
* }).extend(tempoActions())
|
|
1843
|
+
*
|
|
1844
|
+
* const { earnShareAmount } = await client.earn.depositSharesSync({
|
|
1845
|
+
* earnShareAmountMin: 499_000_000n,
|
|
1846
|
+
* vault: '0x...',
|
|
1847
|
+
* venueShareAmount: 500_000_000n,
|
|
1848
|
+
* venueShareToken: '0x...',
|
|
1849
|
+
* })
|
|
1850
|
+
* ```
|
|
1851
|
+
*
|
|
1852
|
+
* @param parameters - Parameters.
|
|
1853
|
+
* @returns The transaction receipt and event data.
|
|
1854
|
+
*/
|
|
1855
|
+
depositSharesSync: (
|
|
1856
|
+
parameters: earnActions.depositSharesSync.Parameters<chain, account>,
|
|
1857
|
+
) => Promise<earnActions.depositSharesSync.ReturnValue>
|
|
1858
|
+
/**
|
|
1859
|
+
* Deposits assets and returns the confirmed receipt and event data.
|
|
1860
|
+
*
|
|
1861
|
+
* @example
|
|
1862
|
+
* ```ts
|
|
1863
|
+
* import { createClient, http } from 'viem'
|
|
1864
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1865
|
+
* import { tempoModerato } from 'viem/chains'
|
|
1866
|
+
* import { tempoActions } from 'viem/tempo'
|
|
1867
|
+
*
|
|
1868
|
+
* const client = createClient({
|
|
1869
|
+
* account: privateKeyToAccount('0x...'),
|
|
1870
|
+
* chain: tempoModerato,
|
|
1871
|
+
* transport: http(),
|
|
1872
|
+
* }).extend(tempoActions())
|
|
1873
|
+
*
|
|
1874
|
+
* const { shareAmount } = await client.earn.depositSync({
|
|
1875
|
+
* assetAmount: 100_000_000n,
|
|
1876
|
+
* shareAmountMin: 99_400_000n,
|
|
1877
|
+
* vault: '0x...',
|
|
1878
|
+
* })
|
|
1879
|
+
* ```
|
|
1880
|
+
*
|
|
1881
|
+
* @param parameters - Parameters.
|
|
1882
|
+
* @returns The transaction receipt and event data.
|
|
1883
|
+
*/
|
|
1884
|
+
depositSync: (
|
|
1885
|
+
parameters: earnActions.depositSync.Parameters<chain, account>,
|
|
1886
|
+
) => Promise<earnActions.depositSync.ReturnValue>
|
|
1887
|
+
/**
|
|
1888
|
+
* Withdraws assets from a Zone and deposits them into a vault on the
|
|
1889
|
+
* parent chain.
|
|
1890
|
+
*
|
|
1891
|
+
* @example
|
|
1892
|
+
* ```ts
|
|
1893
|
+
* const prepared = await parentClient.earn.privateDeposit.prepare({
|
|
1894
|
+
* assetAmount: 100_000_000n,
|
|
1895
|
+
* assetToken: '0x...',
|
|
1896
|
+
* gateway: '0x...',
|
|
1897
|
+
* recipient: '0x...',
|
|
1898
|
+
* recoveryRecipient: '0x...',
|
|
1899
|
+
* shareAmountMin: 99_500_000n,
|
|
1900
|
+
* vaultAssetAmountMin: 99_000_000n,
|
|
1901
|
+
* })
|
|
1902
|
+
* const hash = await zoneClient.earn.privateDeposit(prepared)
|
|
1903
|
+
* ```
|
|
1904
|
+
*
|
|
1905
|
+
* @param parameters - Prepared deposit and transaction parameters.
|
|
1906
|
+
* @returns The transaction hash.
|
|
1907
|
+
*/
|
|
1908
|
+
privateDeposit: (
|
|
1909
|
+
parameters: earnActions.privateDeposit.Parameters<chain, account>,
|
|
1910
|
+
) => Promise<earnActions.privateDeposit.ReturnValue>
|
|
1911
|
+
/**
|
|
1912
|
+
* Requests a private Zone deposit and waits for the Zone transaction
|
|
1913
|
+
* receipt.
|
|
1914
|
+
*
|
|
1915
|
+
* @example
|
|
1916
|
+
* ```ts
|
|
1917
|
+
* const { receipt, senderTag } =
|
|
1918
|
+
* await zoneClient.earn.privateDepositSync(prepared)
|
|
1919
|
+
* ```
|
|
1920
|
+
*
|
|
1921
|
+
* @param parameters - Prepared deposit and transaction parameters.
|
|
1922
|
+
* @returns The Zone transaction receipt and parent-chain withdrawal sender tag.
|
|
1923
|
+
*/
|
|
1924
|
+
privateDepositSync: (
|
|
1925
|
+
parameters: earnActions.privateDepositSync.Parameters<chain, account>,
|
|
1926
|
+
) => Promise<earnActions.privateDepositSync.ReturnValue>
|
|
1927
|
+
/**
|
|
1928
|
+
* Gets the vault's active fee configuration, pending fees, and fee baselines.
|
|
1929
|
+
*
|
|
1930
|
+
* @example
|
|
1931
|
+
* ```ts
|
|
1932
|
+
* import { createClient, http } from 'viem'
|
|
1933
|
+
* import { tempoModerato } from 'viem/chains'
|
|
1934
|
+
* import { tempoActions } from 'viem/tempo'
|
|
1935
|
+
*
|
|
1936
|
+
* const client = createClient({
|
|
1937
|
+
* chain: tempoModerato,
|
|
1938
|
+
* transport: http(),
|
|
1939
|
+
* }).extend(tempoActions())
|
|
1940
|
+
*
|
|
1941
|
+
* const feeState = await client.earn.getFeeState({
|
|
1942
|
+
* vault: '0x...',
|
|
1943
|
+
* })
|
|
1944
|
+
* ```
|
|
1945
|
+
*
|
|
1946
|
+
* @param parameters - Parameters.
|
|
1947
|
+
* @returns The active fee configuration, pending fees, and baselines.
|
|
1948
|
+
*/
|
|
1949
|
+
getFeeState: (
|
|
1950
|
+
parameters: earnActions.getFeeState.Parameters,
|
|
1951
|
+
) => Promise<earnActions.getFeeState.ReturnValue>
|
|
1952
|
+
/**
|
|
1953
|
+
* Gets an account's asset and vault share balances, allowances, and
|
|
1954
|
+
* current share value. The value includes fees.
|
|
1955
|
+
*
|
|
1956
|
+
* @example
|
|
1957
|
+
* ```ts
|
|
1958
|
+
* import { createClient, http } from 'viem'
|
|
1959
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
1960
|
+
* import { tempoModerato } from 'viem/chains'
|
|
1961
|
+
* import { tempoActions } from 'viem/tempo'
|
|
1962
|
+
*
|
|
1963
|
+
* const client = createClient({
|
|
1964
|
+
* account: privateKeyToAccount('0x...'),
|
|
1965
|
+
* chain: tempoModerato,
|
|
1966
|
+
* transport: http(),
|
|
1967
|
+
* }).extend(tempoActions())
|
|
1968
|
+
*
|
|
1969
|
+
* const position = await client.earn.getPosition({
|
|
1970
|
+
* vault: '0x...',
|
|
1971
|
+
* })
|
|
1972
|
+
* ```
|
|
1973
|
+
*
|
|
1974
|
+
* @param parameters - Parameters.
|
|
1975
|
+
* @returns The asset and vault share balances, allowances, and value.
|
|
1976
|
+
*/
|
|
1977
|
+
getPosition: (
|
|
1978
|
+
parameters: earnActions.getPosition.Parameters<account>,
|
|
1979
|
+
) => Promise<earnActions.getPosition.ReturnValue>
|
|
1980
|
+
/**
|
|
1981
|
+
* Gets the vault's addresses, configuration, accounting state, and
|
|
1982
|
+
* supported actions. Throws `GetVaultEngineChangedError` if its engine
|
|
1983
|
+
* changes mid-read.
|
|
1984
|
+
*
|
|
1985
|
+
* @example
|
|
1986
|
+
* ```ts
|
|
1987
|
+
* import { createClient, http } from 'viem'
|
|
1988
|
+
* import { tempoModerato } from 'viem/chains'
|
|
1989
|
+
* import { tempoActions } from 'viem/tempo'
|
|
1990
|
+
*
|
|
1991
|
+
* const client = createClient({
|
|
1992
|
+
* chain: tempoModerato,
|
|
1993
|
+
* transport: http(),
|
|
1994
|
+
* }).extend(tempoActions())
|
|
1995
|
+
*
|
|
1996
|
+
* const vault = await client.earn.getVault({
|
|
1997
|
+
* vault: '0x...',
|
|
1998
|
+
* })
|
|
1999
|
+
* ```
|
|
2000
|
+
*
|
|
2001
|
+
* @param parameters - Parameters.
|
|
2002
|
+
* @returns The vault state and metadata.
|
|
2003
|
+
*/
|
|
2004
|
+
getVault: (
|
|
2005
|
+
parameters: earnActions.getVault.Parameters,
|
|
2006
|
+
) => Promise<earnActions.getVault.ReturnValue>
|
|
2007
|
+
/**
|
|
2008
|
+
* Gets the asset output for an exact vault share input, including fees.
|
|
2009
|
+
*
|
|
2010
|
+
* @example
|
|
2011
|
+
* ```ts
|
|
2012
|
+
* import { createClient, http } from 'viem'
|
|
2013
|
+
* import { tempoModerato } from 'viem/chains'
|
|
2014
|
+
* import { tempoActions } from 'viem/tempo'
|
|
2015
|
+
*
|
|
2016
|
+
* const client = createClient({
|
|
2017
|
+
* chain: tempoModerato,
|
|
2018
|
+
* transport: http(),
|
|
2019
|
+
* }).extend(tempoActions())
|
|
2020
|
+
*
|
|
2021
|
+
* const assetAmount = await client.earn.getRedeemQuote({
|
|
2022
|
+
* shareAmount: 100_000_000n,
|
|
2023
|
+
* vault: '0x...',
|
|
2024
|
+
* })
|
|
2025
|
+
* ```
|
|
2026
|
+
*
|
|
2027
|
+
* @param parameters - Parameters.
|
|
2028
|
+
* @returns The asset output, including fees.
|
|
2029
|
+
*/
|
|
2030
|
+
getRedeemQuote: (
|
|
2031
|
+
parameters: earnActions.getRedeemQuote.Parameters,
|
|
2032
|
+
) => Promise<earnActions.getRedeemQuote.ReturnValue>
|
|
2033
|
+
/**
|
|
2034
|
+
* Gets the vault shares required for an exact asset output, including
|
|
2035
|
+
* fees and ceiling rounding.
|
|
2036
|
+
*
|
|
2037
|
+
* @example
|
|
2038
|
+
* ```ts
|
|
2039
|
+
* import { createClient, http } from 'viem'
|
|
2040
|
+
* import { tempoModerato } from 'viem/chains'
|
|
2041
|
+
* import { tempoActions } from 'viem/tempo'
|
|
2042
|
+
*
|
|
2043
|
+
* const client = createClient({
|
|
2044
|
+
* chain: tempoModerato,
|
|
2045
|
+
* transport: http(),
|
|
2046
|
+
* }).extend(tempoActions())
|
|
2047
|
+
*
|
|
2048
|
+
* const shareAmount = await client.earn.getWithdrawQuote({
|
|
2049
|
+
* assetAmount: 250_000_000n,
|
|
2050
|
+
* vault: '0x...',
|
|
2051
|
+
* })
|
|
2052
|
+
* ```
|
|
2053
|
+
*
|
|
2054
|
+
* @param parameters - Parameters.
|
|
2055
|
+
* @returns The required vault share input, ceiling-rounded.
|
|
2056
|
+
*/
|
|
2057
|
+
getWithdrawQuote: (
|
|
2058
|
+
parameters: earnActions.getWithdrawQuote.Parameters,
|
|
2059
|
+
) => Promise<earnActions.getWithdrawQuote.ReturnValue>
|
|
2060
|
+
/**
|
|
2061
|
+
* Redeems vault shares for assets sent to `recipient`. The transaction
|
|
2062
|
+
* includes the required vault share approval.
|
|
2063
|
+
*
|
|
2064
|
+
* @example
|
|
2065
|
+
* ```ts
|
|
2066
|
+
* import { createClient, http } from 'viem'
|
|
2067
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2068
|
+
* import { tempoModerato } from 'viem/chains'
|
|
2069
|
+
* import { tempoActions } from 'viem/tempo'
|
|
2070
|
+
*
|
|
2071
|
+
* const client = createClient({
|
|
2072
|
+
* account: privateKeyToAccount('0x...'),
|
|
2073
|
+
* chain: tempoModerato,
|
|
2074
|
+
* transport: http(),
|
|
2075
|
+
* }).extend(tempoActions())
|
|
2076
|
+
*
|
|
2077
|
+
* const hash = await client.earn.redeem({
|
|
2078
|
+
* shareAmount: 100_000_000n,
|
|
2079
|
+
* slippageBps: 50,
|
|
2080
|
+
* vault: '0x...',
|
|
2081
|
+
* })
|
|
2082
|
+
* ```
|
|
2083
|
+
*
|
|
2084
|
+
* @param parameters - Parameters.
|
|
2085
|
+
* @returns The transaction hash.
|
|
2086
|
+
*/
|
|
2087
|
+
redeem: (
|
|
2088
|
+
parameters: earnActions.redeem.Parameters<chain, account>,
|
|
2089
|
+
) => Promise<earnActions.redeem.ReturnValue>
|
|
2090
|
+
/**
|
|
2091
|
+
* Redeems vault shares and returns the confirmed receipt and event data.
|
|
2092
|
+
*
|
|
2093
|
+
* @example
|
|
2094
|
+
* ```ts
|
|
2095
|
+
* import { createClient, http } from 'viem'
|
|
2096
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2097
|
+
* import { tempoModerato } from 'viem/chains'
|
|
2098
|
+
* import { tempoActions } from 'viem/tempo'
|
|
2099
|
+
*
|
|
2100
|
+
* const client = createClient({
|
|
2101
|
+
* account: privateKeyToAccount('0x...'),
|
|
2102
|
+
* chain: tempoModerato,
|
|
2103
|
+
* transport: http(),
|
|
2104
|
+
* }).extend(tempoActions())
|
|
2105
|
+
*
|
|
2106
|
+
* const { assetAmount } = await client.earn.redeemSync({
|
|
2107
|
+
* assetAmountMin: 99_500_000n,
|
|
2108
|
+
* shareAmount: 100_000_000n,
|
|
2109
|
+
* vault: '0x...',
|
|
2110
|
+
* })
|
|
2111
|
+
* ```
|
|
2112
|
+
*
|
|
2113
|
+
* @param parameters - Parameters.
|
|
2114
|
+
* @returns The transaction receipt and event data.
|
|
2115
|
+
*/
|
|
2116
|
+
redeemSync: (
|
|
2117
|
+
parameters: earnActions.redeemSync.Parameters<chain, account>,
|
|
2118
|
+
) => Promise<earnActions.redeemSync.ReturnValue>
|
|
2119
|
+
/**
|
|
2120
|
+
* Withdraws vault shares from a Zone and redeems them on the parent chain.
|
|
2121
|
+
*
|
|
2122
|
+
* @example
|
|
2123
|
+
* ```ts
|
|
2124
|
+
* const prepared = await parentClient.earn.privateRedeem.prepare({
|
|
2125
|
+
* gateway: '0x...',
|
|
2126
|
+
* recipient: '0x...',
|
|
2127
|
+
* recoveryRecipient: '0x...',
|
|
2128
|
+
* shareAmount: 100_000_000n,
|
|
2129
|
+
* slippageBps: 50,
|
|
2130
|
+
* })
|
|
2131
|
+
* const hash = await zoneClient.earn.privateRedeem(prepared)
|
|
2132
|
+
* ```
|
|
2133
|
+
*
|
|
2134
|
+
* @param parameters - Prepared redemption and transaction parameters.
|
|
2135
|
+
* @returns The transaction hash.
|
|
2136
|
+
*/
|
|
2137
|
+
privateRedeem: (
|
|
2138
|
+
parameters: earnActions.privateRedeem.Parameters<chain, account>,
|
|
2139
|
+
) => Promise<earnActions.privateRedeem.ReturnValue>
|
|
2140
|
+
/**
|
|
2141
|
+
* Requests a private Zone redemption and waits for the Zone transaction
|
|
2142
|
+
* receipt.
|
|
2143
|
+
*
|
|
2144
|
+
* @example
|
|
2145
|
+
* ```ts
|
|
2146
|
+
* const { receipt, senderTag } =
|
|
2147
|
+
* await zoneClient.earn.privateRedeemSync(prepared)
|
|
2148
|
+
* ```
|
|
2149
|
+
*
|
|
2150
|
+
* @param parameters - Prepared redemption and transaction parameters.
|
|
2151
|
+
* @returns The Zone transaction receipt and parent-chain withdrawal sender tag.
|
|
2152
|
+
*/
|
|
2153
|
+
privateRedeemSync: (
|
|
2154
|
+
parameters: earnActions.privateRedeemSync.Parameters<chain, account>,
|
|
2155
|
+
) => Promise<earnActions.privateRedeemSync.ReturnValue>
|
|
2156
|
+
/**
|
|
2157
|
+
* Waits for a Zone gateway deposit to complete on the parent chain.
|
|
2158
|
+
*
|
|
2159
|
+
* @example
|
|
2160
|
+
* ```ts
|
|
2161
|
+
* const result = await parentClient.earn.waitForPrivateDeposit({
|
|
2162
|
+
* actionId: prepared.actionId,
|
|
2163
|
+
* fromBlock: prepared.fromBlock,
|
|
2164
|
+
* gateway: '0x...',
|
|
2165
|
+
* })
|
|
2166
|
+
* ```
|
|
2167
|
+
*
|
|
2168
|
+
* @param parameters - Correlation and polling parameters.
|
|
2169
|
+
* @returns The completed gateway deposit.
|
|
2170
|
+
*/
|
|
2171
|
+
waitForPrivateDeposit: (
|
|
2172
|
+
parameters: earnActions.waitForPrivateDeposit.Parameters,
|
|
2173
|
+
) => Promise<earnActions.waitForPrivateDeposit.ReturnType>
|
|
2174
|
+
/**
|
|
2175
|
+
* Waits for a Zone gateway redemption to complete on the parent chain.
|
|
2176
|
+
*
|
|
2177
|
+
* @example
|
|
2178
|
+
* ```ts
|
|
2179
|
+
* const result = await parentClient.earn.waitForPrivateRedeem({
|
|
2180
|
+
* actionId: prepared.actionId,
|
|
2181
|
+
* fromBlock: prepared.fromBlock,
|
|
2182
|
+
* gateway: '0x...',
|
|
2183
|
+
* })
|
|
2184
|
+
* ```
|
|
2185
|
+
*
|
|
2186
|
+
* @param parameters - Correlation and polling parameters.
|
|
2187
|
+
* @returns The completed gateway redemption.
|
|
2188
|
+
*/
|
|
2189
|
+
waitForPrivateRedeem: (
|
|
2190
|
+
parameters: earnActions.waitForPrivateRedeem.Parameters,
|
|
2191
|
+
) => Promise<earnActions.waitForPrivateRedeem.ReturnType>
|
|
2192
|
+
/**
|
|
2193
|
+
* Verifies that an Earn vault share token uses the expected exit-safe
|
|
2194
|
+
* TIP-403 policy and that every required member can receive transfers and
|
|
2195
|
+
* mints.
|
|
2196
|
+
*
|
|
2197
|
+
* @example
|
|
2198
|
+
* ```ts
|
|
2199
|
+
* await client.earn.validateExitSafePolicy({
|
|
2200
|
+
* accessAdministrator: '0x...',
|
|
2201
|
+
* policy,
|
|
2202
|
+
* requiredMembers: ['0x...', '0x...'],
|
|
2203
|
+
* shareToken: '0x...',
|
|
2204
|
+
* })
|
|
2205
|
+
* ```
|
|
2206
|
+
*
|
|
2207
|
+
* @param parameters - Expected policy, administrator, and required members.
|
|
2208
|
+
* @returns Nothing when the policy is valid.
|
|
2209
|
+
*/
|
|
2210
|
+
validateExitSafePolicy: (
|
|
2211
|
+
parameters: earnActions.validateExitSafePolicy.Parameters,
|
|
2212
|
+
) => Promise<earnActions.validateExitSafePolicy.ReturnValue>
|
|
2213
|
+
/**
|
|
2214
|
+
* Withdraws an exact asset amount to `recipient`, up to the specified
|
|
2215
|
+
* vault share limit. The transaction includes the required vault share
|
|
2216
|
+
* approval; use `redeem` for a full exit.
|
|
2217
|
+
*
|
|
2218
|
+
* @example
|
|
2219
|
+
* ```ts
|
|
2220
|
+
* import { createClient, http } from 'viem'
|
|
2221
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2222
|
+
* import { tempoModerato } from 'viem/chains'
|
|
2223
|
+
* import { tempoActions } from 'viem/tempo'
|
|
2224
|
+
*
|
|
2225
|
+
* const client = createClient({
|
|
2226
|
+
* account: privateKeyToAccount('0x...'),
|
|
2227
|
+
* chain: tempoModerato,
|
|
2228
|
+
* transport: http(),
|
|
2229
|
+
* }).extend(tempoActions())
|
|
2230
|
+
*
|
|
2231
|
+
* const hash = await client.earn.withdrawExact({
|
|
2232
|
+
* assetAmount: 40_000_000n,
|
|
2233
|
+
* slippageBps: 50,
|
|
2234
|
+
* vault: '0x...',
|
|
2235
|
+
* })
|
|
2236
|
+
* ```
|
|
2237
|
+
*
|
|
2238
|
+
* @param parameters - Parameters.
|
|
2239
|
+
* @returns The transaction hash.
|
|
2240
|
+
*/
|
|
2241
|
+
withdrawExact: (
|
|
2242
|
+
parameters: earnActions.withdrawExact.Parameters<chain, account>,
|
|
2243
|
+
) => Promise<earnActions.withdrawExact.ReturnValue>
|
|
2244
|
+
/**
|
|
2245
|
+
* Withdraws an exact asset amount and returns the confirmed receipt and event data.
|
|
2246
|
+
*
|
|
2247
|
+
* @example
|
|
2248
|
+
* ```ts
|
|
2249
|
+
* import { createClient, http } from 'viem'
|
|
2250
|
+
* import { privateKeyToAccount } from 'viem/accounts'
|
|
2251
|
+
* import { tempoModerato } from 'viem/chains'
|
|
2252
|
+
* import { tempoActions } from 'viem/tempo'
|
|
2253
|
+
*
|
|
2254
|
+
* const client = createClient({
|
|
2255
|
+
* account: privateKeyToAccount('0x...'),
|
|
2256
|
+
* chain: tempoModerato,
|
|
2257
|
+
* transport: http(),
|
|
2258
|
+
* }).extend(tempoActions())
|
|
2259
|
+
*
|
|
2260
|
+
* const { shareAmount } = await client.earn.withdrawExactSync({
|
|
2261
|
+
* assetAmount: 40_000_000n,
|
|
2262
|
+
* shareAmountMax: 40_200_000n,
|
|
2263
|
+
* vault: '0x...',
|
|
2264
|
+
* })
|
|
2265
|
+
* ```
|
|
2266
|
+
*
|
|
2267
|
+
* @param parameters - Parameters.
|
|
2268
|
+
* @returns The transaction receipt and event data.
|
|
2269
|
+
*/
|
|
2270
|
+
withdrawExactSync: (
|
|
2271
|
+
parameters: earnActions.withdrawExactSync.Parameters<chain, account>,
|
|
2272
|
+
) => Promise<earnActions.withdrawExactSync.ReturnValue>
|
|
2273
|
+
}
|
|
1745
2274
|
faucet: {
|
|
1746
2275
|
/**
|
|
1747
2276
|
* Funds an account with an initial amount of set token(s)
|
|
@@ -4926,47 +5455,6 @@ type DecoratorBase<
|
|
|
4926
5455
|
* @returns The account address and token expiry.
|
|
4927
5456
|
*/
|
|
4928
5457
|
getAuthorizationTokenInfo: () => Promise<zoneActions.getAuthorizationTokenInfo.ReturnType>
|
|
4929
|
-
/**
|
|
4930
|
-
* Returns deposit processing status for a given Tempo block number.
|
|
4931
|
-
*
|
|
4932
|
-
* @example
|
|
4933
|
-
* ```ts
|
|
4934
|
-
* import { createClient } from 'viem'
|
|
4935
|
-
* import { http, zoneModerato } from 'viem/tempo/zones'
|
|
4936
|
-
* import { tempoActions } from 'viem/tempo'
|
|
4937
|
-
*
|
|
4938
|
-
* const client = createClient({
|
|
4939
|
-
* chain: zoneModerato(7),
|
|
4940
|
-
* transport: http(),
|
|
4941
|
-
* }).extend(tempoActions())
|
|
4942
|
-
*
|
|
4943
|
-
* const status = await client.zone.getDepositStatus({
|
|
4944
|
-
* tempoBlockNumber: 1n,
|
|
4945
|
-
* })
|
|
4946
|
-
* ```
|
|
4947
|
-
*
|
|
4948
|
-
* @param parameters - Parameters.
|
|
4949
|
-
* @returns The deposit status.
|
|
4950
|
-
*/
|
|
4951
|
-
getDepositStatus: (
|
|
4952
|
-
parameters: zoneActions.getDepositStatus.Parameters,
|
|
4953
|
-
) => Promise<zoneActions.getDepositStatus.ReturnType>
|
|
4954
|
-
/**
|
|
4955
|
-
* Waits for a Tempo block's deposits to be processed by a zone.
|
|
4956
|
-
*
|
|
4957
|
-
* @example
|
|
4958
|
-
* ```ts
|
|
4959
|
-
* const status = await client.zone.waitForDepositStatus({
|
|
4960
|
-
* tempoBlockNumber: 1n,
|
|
4961
|
-
* })
|
|
4962
|
-
* ```
|
|
4963
|
-
*
|
|
4964
|
-
* @param parameters - Parameters.
|
|
4965
|
-
* @returns The processed deposit status.
|
|
4966
|
-
*/
|
|
4967
|
-
waitForDepositStatus: (
|
|
4968
|
-
parameters: zoneActions.waitForDepositStatus.Parameters,
|
|
4969
|
-
) => Promise<zoneActions.waitForDepositStatus.ReturnType>
|
|
4970
5458
|
/**
|
|
4971
5459
|
* Returns the withdrawal fee for a given gas limit.
|
|
4972
5460
|
*
|
|
@@ -5010,6 +5498,15 @@ type DecoratorBase<
|
|
|
5010
5498
|
* @returns The zone metadata.
|
|
5011
5499
|
*/
|
|
5012
5500
|
getZoneInfo: () => Promise<zoneActions.getZoneInfo.ReturnType>
|
|
5501
|
+
/**
|
|
5502
|
+
* Waits for a zone to import a Tempo block.
|
|
5503
|
+
*
|
|
5504
|
+
* @param parameters - Tempo block number and polling options.
|
|
5505
|
+
* @returns Zone metadata after the block has been imported.
|
|
5506
|
+
*/
|
|
5507
|
+
waitForTempoBlock: (
|
|
5508
|
+
parameters: zoneActions.waitForTempoBlock.Parameters,
|
|
5509
|
+
) => Promise<zoneActions.waitForTempoBlock.ReturnType>
|
|
5013
5510
|
/**
|
|
5014
5511
|
* Requests a withdrawal from a zone to the parent Tempo chain.
|
|
5015
5512
|
* Batches approve and withdrawal into a single transaction.
|
|
@@ -5071,14 +5568,14 @@ type DecoratorBase<
|
|
|
5071
5568
|
* transport: http(),
|
|
5072
5569
|
* }).extend(tempoActions())
|
|
5073
5570
|
*
|
|
5074
|
-
* const { receipt } = await client.zone.requestWithdrawalSync({
|
|
5571
|
+
* const { receipt, senderTag } = await client.zone.requestWithdrawalSync({
|
|
5075
5572
|
* token: '0x20c0...0001',
|
|
5076
5573
|
* amount: 1_000_000n,
|
|
5077
5574
|
* })
|
|
5078
5575
|
* ```
|
|
5079
5576
|
*
|
|
5080
5577
|
* @param parameters - Parameters.
|
|
5081
|
-
* @returns The transaction receipt.
|
|
5578
|
+
* @returns The transaction receipt and sender tag for the parent-chain withdrawal event.
|
|
5082
5579
|
*/
|
|
5083
5580
|
requestWithdrawalSync: (
|
|
5084
5581
|
parameters: zoneActions.requestWithdrawalSync.Parameters<chain, account>,
|
|
@@ -5186,11 +5683,13 @@ type BoundActionHelpers<action> = (action extends { call: infer helper }
|
|
|
5186
5683
|
(action extends { simulate: infer helper }
|
|
5187
5684
|
? { simulate: BoundHelper<helper> }
|
|
5188
5685
|
: {}) &
|
|
5686
|
+
// `extractEvent(s)` helpers are client-less and copied through unwrapped by
|
|
5687
|
+
// `bindActionDecorators`, so their full signatures are preserved.
|
|
5189
5688
|
(action extends { extractEvent: infer helper }
|
|
5190
|
-
? { extractEvent:
|
|
5689
|
+
? { extractEvent: helper }
|
|
5191
5690
|
: {}) &
|
|
5192
5691
|
(action extends { extractEvents: infer helper }
|
|
5193
|
-
? { extractEvents:
|
|
5692
|
+
? { extractEvents: helper }
|
|
5194
5693
|
: {})
|
|
5195
5694
|
|
|
5196
5695
|
type BoundAction<action> = action extends (
|
|
@@ -5236,6 +5735,10 @@ export type Decorator<
|
|
|
5236
5735
|
DecoratorBase<chain, account>['dex'],
|
|
5237
5736
|
typeof dexActions
|
|
5238
5737
|
>
|
|
5738
|
+
earn: DecorateNamespace<
|
|
5739
|
+
DecoratorBase<chain, account>['earn'],
|
|
5740
|
+
typeof earnActions
|
|
5741
|
+
>
|
|
5239
5742
|
faucet: DecorateNamespace<
|
|
5240
5743
|
DecoratorBase<chain, account>['faucet'],
|
|
5241
5744
|
typeof faucetActions
|
|
@@ -5378,6 +5881,29 @@ export function decorator() {
|
|
|
5378
5881
|
'watchOrderFilled',
|
|
5379
5882
|
'watchOrderPlaced',
|
|
5380
5883
|
]),
|
|
5884
|
+
earn: bindActions(client, earnActions, [
|
|
5885
|
+
'configureExitSafePolicy',
|
|
5886
|
+
'deposit',
|
|
5887
|
+
'depositSync',
|
|
5888
|
+
'depositShares',
|
|
5889
|
+
'depositSharesSync',
|
|
5890
|
+
'privateDeposit',
|
|
5891
|
+
'privateDepositSync',
|
|
5892
|
+
'getFeeState',
|
|
5893
|
+
'getPosition',
|
|
5894
|
+
'getRedeemQuote',
|
|
5895
|
+
'getVault',
|
|
5896
|
+
'getWithdrawQuote',
|
|
5897
|
+
'redeem',
|
|
5898
|
+
'redeemSync',
|
|
5899
|
+
'privateRedeem',
|
|
5900
|
+
'privateRedeemSync',
|
|
5901
|
+
'waitForPrivateDeposit',
|
|
5902
|
+
'waitForPrivateRedeem',
|
|
5903
|
+
'validateExitSafePolicy',
|
|
5904
|
+
'withdrawExact',
|
|
5905
|
+
'withdrawExactSync',
|
|
5906
|
+
]),
|
|
5381
5907
|
faucet: bindActions(client, faucetActions, ['fund', 'fundSync']),
|
|
5382
5908
|
nonce: bindActions(client, nonceActions, [
|
|
5383
5909
|
'getNonce',
|
|
@@ -5520,7 +6046,6 @@ export function decorator() {
|
|
|
5520
6046
|
'encryptedDeposit',
|
|
5521
6047
|
'encryptedDepositSync',
|
|
5522
6048
|
'getAuthorizationTokenInfo',
|
|
5523
|
-
'getDepositStatus',
|
|
5524
6049
|
'getEncryptionKey',
|
|
5525
6050
|
'getWithdrawalFee',
|
|
5526
6051
|
'getZoneInfo',
|
|
@@ -5529,7 +6054,7 @@ export function decorator() {
|
|
|
5529
6054
|
'requestVerifiableWithdrawal',
|
|
5530
6055
|
'requestVerifiableWithdrawalSync',
|
|
5531
6056
|
'signAuthorizationToken',
|
|
5532
|
-
'
|
|
6057
|
+
'waitForTempoBlock',
|
|
5533
6058
|
]),
|
|
5534
6059
|
} as Decorator<chain, account>
|
|
5535
6060
|
}
|