tempo.ts 0.2.0 → 0.2.1
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/dist/chains.d.ts.map +1 -1
- package/dist/chains.js +3 -1
- package/dist/chains.js.map +1 -1
- package/dist/viem/Actions/amm.d.ts +64 -43
- package/dist/viem/Actions/amm.d.ts.map +1 -1
- package/dist/viem/Actions/amm.js +62 -47
- package/dist/viem/Actions/amm.js.map +1 -1
- package/dist/viem/Actions/dex.d.ts +32 -32
- package/dist/viem/Actions/dex.js +32 -32
- package/dist/viem/Actions/faucet.d.ts +34 -0
- package/dist/viem/Actions/faucet.d.ts.map +1 -0
- package/dist/viem/Actions/faucet.js +33 -0
- package/dist/viem/Actions/faucet.js.map +1 -0
- package/dist/viem/Actions/fee.d.ts +13 -13
- package/dist/viem/Actions/fee.js +13 -13
- package/dist/viem/Actions/index.d.ts +1 -0
- package/dist/viem/Actions/index.d.ts.map +1 -1
- package/dist/viem/Actions/index.js +1 -0
- package/dist/viem/Actions/index.js.map +1 -1
- package/dist/viem/Actions/policy.d.ts +46 -46
- package/dist/viem/Actions/policy.js +46 -46
- package/dist/viem/Actions/reward.d.ts +38 -38
- package/dist/viem/Actions/reward.js +38 -38
- package/dist/viem/Actions/token.d.ts +159 -159
- package/dist/viem/Actions/token.js +159 -159
- package/dist/viem/Decorator.d.ts +128 -101
- package/dist/viem/Decorator.d.ts.map +1 -1
- package/dist/viem/Decorator.js +4 -0
- package/dist/viem/Decorator.js.map +1 -1
- package/dist/wagmi/Actions/amm.d.ts +12 -12
- package/dist/wagmi/Actions/amm.js +12 -12
- package/dist/wagmi/Actions/dex.d.ts +25 -25
- package/dist/wagmi/Actions/dex.js +25 -25
- package/dist/wagmi/Actions/faucet.d.ts +35 -0
- package/dist/wagmi/Actions/faucet.d.ts.map +1 -0
- package/dist/wagmi/Actions/faucet.js +33 -0
- package/dist/wagmi/Actions/faucet.js.map +1 -0
- package/dist/wagmi/Actions/fee.d.ts +3 -3
- package/dist/wagmi/Actions/fee.js +3 -3
- package/dist/wagmi/Actions/index.d.ts +1 -0
- package/dist/wagmi/Actions/index.d.ts.map +1 -1
- package/dist/wagmi/Actions/index.js +1 -0
- package/dist/wagmi/Actions/index.js.map +1 -1
- package/dist/wagmi/Actions/reward.d.ts +10 -10
- package/dist/wagmi/Actions/reward.js +10 -10
- package/dist/wagmi/Actions/token.d.ts +45 -45
- package/dist/wagmi/Actions/token.js +46 -46
- package/dist/wagmi/Actions/token.js.map +1 -1
- package/dist/wagmi/Connector.d.ts +11 -3
- package/dist/wagmi/Connector.d.ts.map +1 -1
- package/dist/wagmi/Connector.js +16 -4
- package/dist/wagmi/Connector.js.map +1 -1
- package/dist/wagmi/Hooks/faucet.d.ts +39 -0
- package/dist/wagmi/Hooks/faucet.d.ts.map +1 -0
- package/dist/wagmi/Hooks/faucet.js +40 -0
- package/dist/wagmi/Hooks/faucet.js.map +1 -0
- package/dist/wagmi/Hooks/index.d.ts +1 -0
- package/dist/wagmi/Hooks/index.d.ts.map +1 -1
- package/dist/wagmi/Hooks/index.js +1 -0
- package/dist/wagmi/Hooks/index.js.map +1 -1
- package/package.json +1 -1
- package/src/chains.ts +3 -1
- package/src/viem/Actions/amm.test.ts +75 -0
- package/src/viem/Actions/amm.ts +63 -48
- package/src/viem/Actions/dex.ts +32 -32
- package/src/viem/Actions/faucet.ts +50 -0
- package/src/viem/Actions/fee.ts +13 -13
- package/src/viem/Actions/index.ts +1 -0
- package/src/viem/Actions/policy.ts +46 -46
- package/src/viem/Actions/reward.ts +38 -38
- package/src/viem/Actions/token.ts +159 -159
- package/src/viem/Chain.bench-d.ts +12 -0
- package/src/viem/Decorator.bench-d.ts +1 -1
- package/src/viem/Decorator.test.ts +1 -0
- package/src/viem/Decorator.ts +133 -101
- package/src/wagmi/Actions/amm.ts +12 -12
- package/src/wagmi/Actions/dex.ts +25 -25
- package/src/wagmi/Actions/faucet.ts +46 -0
- package/src/wagmi/Actions/fee.ts +3 -3
- package/src/wagmi/Actions/index.ts +1 -0
- package/src/wagmi/Actions/reward.ts +10 -10
- package/src/wagmi/Actions/token.ts +46 -46
- package/src/wagmi/Connector.ts +31 -8
- package/src/wagmi/Hooks/faucet.ts +76 -0
- package/src/wagmi/Hooks/index.ts +1 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { useConfig } from 'wagmi';
|
|
2
|
+
import { useMutation } from 'wagmi/query';
|
|
3
|
+
import { fund } from '../Actions/faucet.js';
|
|
4
|
+
/**
|
|
5
|
+
* Hook for funding an account with an initial amount of set token(s)
|
|
6
|
+
* on Tempo's testnet.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```tsx
|
|
10
|
+
* import { Hooks } from 'tempo.ts/wagmi'
|
|
11
|
+
*
|
|
12
|
+
* function App() {
|
|
13
|
+
* const { mutate, isPending } = Hooks.faucet.useFund()
|
|
14
|
+
*
|
|
15
|
+
* return (
|
|
16
|
+
* <button
|
|
17
|
+
* onClick={() => mutate({ account: '0xdeadbeef...' })}
|
|
18
|
+
* disabled={isPending}
|
|
19
|
+
* >
|
|
20
|
+
* Fund Account
|
|
21
|
+
* </button>
|
|
22
|
+
* )
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @param parameters - Parameters.
|
|
27
|
+
* @returns Mutation result.
|
|
28
|
+
*/
|
|
29
|
+
export function useFund(parameters = {}) {
|
|
30
|
+
const { mutation } = parameters;
|
|
31
|
+
const config = useConfig(parameters);
|
|
32
|
+
return useMutation({
|
|
33
|
+
...mutation,
|
|
34
|
+
async mutationFn(variables) {
|
|
35
|
+
return fund(config, variables);
|
|
36
|
+
},
|
|
37
|
+
mutationKey: ['fund'],
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=faucet.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"faucet.js","sourceRoot":"","sources":["../../../src/wagmi/Hooks/faucet.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAAE,MAAM,OAAO,CAAA;AAEjC,OAAO,EAA8B,WAAW,EAAE,MAAM,aAAa,CAAA;AAErE,OAAO,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAE3C;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,MAAM,UAAU,OAAO,CAIrB,aAAkD,EAAE;IAEpD,MAAM,EAAE,QAAQ,EAAE,GAAG,UAAU,CAAA;IAC/B,MAAM,MAAM,GAAG,SAAS,CAAC,UAAU,CAAC,CAAA;IACpC,OAAO,WAAW,CAAC;QACjB,GAAG,QAAQ;QACX,KAAK,CAAC,UAAU,CAAC,SAAS;YACxB,OAAO,IAAI,CAAC,MAAM,EAAE,SAAS,CAAC,CAAA;QAChC,CAAC;QACD,WAAW,EAAE,CAAC,MAAM,CAAC;KACtB,CAAC,CAAA;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wagmi/Hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/wagmi/Hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/wagmi/Hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/wagmi/Hooks/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,GAAG,MAAM,UAAU,CAAA;AAC/B,OAAO,KAAK,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
package/package.json
CHANGED
package/src/chains.ts
CHANGED
|
@@ -110,6 +110,81 @@ describe('mint', () => {
|
|
|
110
110
|
})
|
|
111
111
|
expect(lpBalance).toBeGreaterThan(0n)
|
|
112
112
|
})
|
|
113
|
+
|
|
114
|
+
test('behavior: single-sided mint (mintWithValidatorToken)', async () => {
|
|
115
|
+
// Create a new token for testing
|
|
116
|
+
const { token } = await Actions.token.createSync(client, {
|
|
117
|
+
name: 'Test Token 2',
|
|
118
|
+
symbol: 'TEST2',
|
|
119
|
+
currency: 'USD',
|
|
120
|
+
})
|
|
121
|
+
|
|
122
|
+
// Grant issuer role to mint tokens
|
|
123
|
+
await Actions.token.grantRolesSync(client, {
|
|
124
|
+
token,
|
|
125
|
+
roles: ['issuer'],
|
|
126
|
+
to: client.account.address,
|
|
127
|
+
})
|
|
128
|
+
|
|
129
|
+
// Mint some tokens to account
|
|
130
|
+
await Actions.token.mintSync(client, {
|
|
131
|
+
to: account.address,
|
|
132
|
+
amount: parseUnits('1000', 6),
|
|
133
|
+
token,
|
|
134
|
+
})
|
|
135
|
+
|
|
136
|
+
// First, establish initial liquidity with two-sided mint
|
|
137
|
+
await Actions.amm.mintSync(client, {
|
|
138
|
+
userToken: {
|
|
139
|
+
address: token,
|
|
140
|
+
amount: parseUnits('100', 6),
|
|
141
|
+
},
|
|
142
|
+
validatorToken: {
|
|
143
|
+
address: 1n,
|
|
144
|
+
amount: parseUnits('100', 6),
|
|
145
|
+
},
|
|
146
|
+
to: account.address,
|
|
147
|
+
})
|
|
148
|
+
|
|
149
|
+
// Get initial pool state
|
|
150
|
+
const poolBefore = await Actions.amm.getPool(client, {
|
|
151
|
+
userToken: token,
|
|
152
|
+
validatorToken: 1n,
|
|
153
|
+
})
|
|
154
|
+
|
|
155
|
+
// Add single-sided liquidity (only validatorToken)
|
|
156
|
+
const { receipt: mintReceipt, ...mintResult } = await Actions.amm.mintSync(
|
|
157
|
+
client,
|
|
158
|
+
{
|
|
159
|
+
userToken: {
|
|
160
|
+
address: token,
|
|
161
|
+
},
|
|
162
|
+
validatorToken: {
|
|
163
|
+
address: 1n,
|
|
164
|
+
amount: parseUnits('50', 6),
|
|
165
|
+
},
|
|
166
|
+
to: account.address,
|
|
167
|
+
},
|
|
168
|
+
)
|
|
169
|
+
|
|
170
|
+
expect(mintReceipt).toBeDefined()
|
|
171
|
+
// amountUserToken should be 0 for single-sided mint
|
|
172
|
+
expect(mintResult.amountUserToken).toBe(0n)
|
|
173
|
+
expect(mintResult.amountValidatorToken).toBe(parseUnits('50', 6))
|
|
174
|
+
expect(mintResult.liquidity).toBeGreaterThan(0n)
|
|
175
|
+
|
|
176
|
+
// Verify pool reserves - only validatorToken should increase
|
|
177
|
+
const poolAfter = await Actions.amm.getPool(client, {
|
|
178
|
+
userToken: token,
|
|
179
|
+
validatorToken: 1n,
|
|
180
|
+
})
|
|
181
|
+
|
|
182
|
+
expect(poolAfter.reserveUserToken).toBe(poolBefore.reserveUserToken)
|
|
183
|
+
expect(poolAfter.reserveValidatorToken).toBe(
|
|
184
|
+
poolBefore.reserveValidatorToken + parseUnits('50', 6),
|
|
185
|
+
)
|
|
186
|
+
expect(poolAfter.totalSupply).toBeGreaterThan(poolBefore.totalSupply)
|
|
187
|
+
})
|
|
113
188
|
})
|
|
114
189
|
|
|
115
190
|
describe('burn', () => {
|
package/src/viem/Actions/amm.ts
CHANGED
|
@@ -38,14 +38,14 @@ import { defineCall } from '../internal/utils.js'
|
|
|
38
38
|
* ```ts
|
|
39
39
|
* import { createClient, http } from 'viem'
|
|
40
40
|
* import { tempo } from 'tempo.ts/chains'
|
|
41
|
-
* import
|
|
41
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
42
42
|
*
|
|
43
43
|
* const client = createClient({
|
|
44
|
-
* chain: tempo
|
|
44
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
45
45
|
* transport: http(),
|
|
46
46
|
* })
|
|
47
47
|
*
|
|
48
|
-
* const pool = await
|
|
48
|
+
* const pool = await Actions.amm.getPool(client, {
|
|
49
49
|
* userToken: '0x...',
|
|
50
50
|
* validatorToken: '0x...',
|
|
51
51
|
* })
|
|
@@ -128,19 +128,19 @@ export namespace getPool {
|
|
|
128
128
|
* ```ts
|
|
129
129
|
* import { createClient, http } from 'viem'
|
|
130
130
|
* import { tempo } from 'tempo.ts/chains'
|
|
131
|
-
* import
|
|
131
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
132
132
|
*
|
|
133
133
|
* const client = createClient({
|
|
134
|
-
* chain: tempo
|
|
134
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
135
135
|
* transport: http(),
|
|
136
136
|
* })
|
|
137
137
|
*
|
|
138
|
-
* const poolId = await
|
|
138
|
+
* const poolId = await Actions.amm.getPoolId(client, {
|
|
139
139
|
* userToken: '0x...',
|
|
140
140
|
* validatorToken: '0x...',
|
|
141
141
|
* })
|
|
142
142
|
*
|
|
143
|
-
* const balance = await
|
|
143
|
+
* const balance = await Actions.amm.getLiquidityBalance(client, {
|
|
144
144
|
* poolId,
|
|
145
145
|
* address: '0x...',
|
|
146
146
|
* })
|
|
@@ -226,16 +226,16 @@ export namespace getLiquidityBalance {
|
|
|
226
226
|
* ```ts
|
|
227
227
|
* import { createClient, http } from 'viem'
|
|
228
228
|
* import { tempo } from 'tempo.ts/chains'
|
|
229
|
-
* import
|
|
229
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
230
230
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
231
231
|
*
|
|
232
232
|
* const client = createClient({
|
|
233
233
|
* account: privateKeyToAccount('0x...'),
|
|
234
|
-
* chain: tempo
|
|
234
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
235
235
|
* transport: http(),
|
|
236
236
|
* })
|
|
237
237
|
*
|
|
238
|
-
* const hash = await
|
|
238
|
+
* const hash = await Actions.amm.rebalanceSwap(client, {
|
|
239
239
|
* userToken: '0x...',
|
|
240
240
|
* validatorToken: '0x...',
|
|
241
241
|
* amountOut: 100n,
|
|
@@ -311,10 +311,10 @@ export namespace rebalanceSwap {
|
|
|
311
311
|
* ```ts
|
|
312
312
|
* import { createClient, http, walletActions } from 'viem'
|
|
313
313
|
* import { tempo } from 'tempo.ts/chains'
|
|
314
|
-
* import
|
|
314
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
315
315
|
*
|
|
316
316
|
* const client = createClient({
|
|
317
|
-
* chain: tempo
|
|
317
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
318
318
|
* transport: http(),
|
|
319
319
|
* }).extend(walletActions)
|
|
320
320
|
*
|
|
@@ -379,16 +379,16 @@ export namespace rebalanceSwap {
|
|
|
379
379
|
* ```ts
|
|
380
380
|
* import { createClient, http } from 'viem'
|
|
381
381
|
* import { tempo } from 'tempo.ts/chains'
|
|
382
|
-
* import
|
|
382
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
383
383
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
384
384
|
*
|
|
385
385
|
* const client = createClient({
|
|
386
386
|
* account: privateKeyToAccount('0x...'),
|
|
387
|
-
* chain: tempo
|
|
387
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
388
388
|
* transport: http(),
|
|
389
389
|
* })
|
|
390
390
|
*
|
|
391
|
-
* const result = await
|
|
391
|
+
* const result = await Actions.amm.rebalanceSwapSync(client, {
|
|
392
392
|
* userToken: '0x...',
|
|
393
393
|
* validatorToken: '0x...',
|
|
394
394
|
* amountOut: 100n,
|
|
@@ -446,16 +446,16 @@ export namespace rebalanceSwapSync {
|
|
|
446
446
|
* ```ts
|
|
447
447
|
* import { createClient, http } from 'viem'
|
|
448
448
|
* import { tempo } from 'tempo.ts/chains'
|
|
449
|
-
* import
|
|
449
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
450
450
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
451
451
|
*
|
|
452
452
|
* const client = createClient({
|
|
453
453
|
* account: privateKeyToAccount('0x...'),
|
|
454
|
-
* chain: tempo
|
|
454
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
455
455
|
* transport: http(),
|
|
456
456
|
* })
|
|
457
457
|
*
|
|
458
|
-
* const hash = await
|
|
458
|
+
* const hash = await Actions.amm.mint(client, {
|
|
459
459
|
* userToken: {
|
|
460
460
|
* address: '0x20c0...beef',
|
|
461
461
|
* amount: 100n,
|
|
@@ -496,7 +496,7 @@ export namespace mint {
|
|
|
496
496
|
/** Address or ID of the user token. */
|
|
497
497
|
address: TokenId.TokenIdOrAddress
|
|
498
498
|
/** Amount of user token to add. */
|
|
499
|
-
amount
|
|
499
|
+
amount?: bigint | undefined
|
|
500
500
|
}
|
|
501
501
|
/** Validator token address and amount. */
|
|
502
502
|
validatorToken: {
|
|
@@ -539,10 +539,10 @@ export namespace mint {
|
|
|
539
539
|
* ```ts
|
|
540
540
|
* import { createClient, http, walletActions } from 'viem'
|
|
541
541
|
* import { tempo } from 'tempo.ts/chains'
|
|
542
|
-
* import
|
|
542
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
543
543
|
*
|
|
544
544
|
* const client = createClient({
|
|
545
|
-
* chain: tempo
|
|
545
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
546
546
|
* transport: http(),
|
|
547
547
|
* }).extend(walletActions)
|
|
548
548
|
*
|
|
@@ -579,17 +579,32 @@ export namespace mint {
|
|
|
579
579
|
*/
|
|
580
580
|
export function call(args: Args) {
|
|
581
581
|
const { to, userToken, validatorToken } = args
|
|
582
|
+
const callArgs = (() => {
|
|
583
|
+
if (userToken.amount)
|
|
584
|
+
return {
|
|
585
|
+
functionName: 'mint',
|
|
586
|
+
args: [
|
|
587
|
+
TokenId.toAddress(userToken.address),
|
|
588
|
+
TokenId.toAddress(validatorToken.address),
|
|
589
|
+
userToken.amount,
|
|
590
|
+
validatorToken.amount,
|
|
591
|
+
to,
|
|
592
|
+
],
|
|
593
|
+
} as const
|
|
594
|
+
return {
|
|
595
|
+
functionName: 'mintWithValidatorToken',
|
|
596
|
+
args: [
|
|
597
|
+
TokenId.toAddress(userToken.address),
|
|
598
|
+
TokenId.toAddress(validatorToken.address),
|
|
599
|
+
validatorToken.amount,
|
|
600
|
+
to,
|
|
601
|
+
],
|
|
602
|
+
} as const
|
|
603
|
+
})()
|
|
582
604
|
return defineCall({
|
|
583
605
|
address: Addresses.feeManager,
|
|
584
606
|
abi: Abis.feeAmm,
|
|
585
|
-
|
|
586
|
-
args: [
|
|
587
|
-
TokenId.toAddress(userToken.address),
|
|
588
|
-
TokenId.toAddress(validatorToken.address),
|
|
589
|
-
userToken.amount,
|
|
590
|
-
validatorToken.amount,
|
|
591
|
-
to,
|
|
592
|
-
],
|
|
607
|
+
...callArgs,
|
|
593
608
|
})
|
|
594
609
|
}
|
|
595
610
|
|
|
@@ -618,16 +633,16 @@ export namespace mint {
|
|
|
618
633
|
* ```ts
|
|
619
634
|
* import { createClient, http } from 'viem'
|
|
620
635
|
* import { tempo } from 'tempo.ts/chains'
|
|
621
|
-
* import
|
|
636
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
622
637
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
623
638
|
*
|
|
624
639
|
* const client = createClient({
|
|
625
640
|
* account: privateKeyToAccount('0x...'),
|
|
626
|
-
* chain: tempo
|
|
641
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
627
642
|
* transport: http(),
|
|
628
643
|
* })
|
|
629
644
|
*
|
|
630
|
-
* const hash = await
|
|
645
|
+
* const hash = await Actions.amm.mint(client, {
|
|
631
646
|
* userToken: {
|
|
632
647
|
* address: '0x20c0...beef',
|
|
633
648
|
* amount: 100n,
|
|
@@ -690,16 +705,16 @@ export namespace mintSync {
|
|
|
690
705
|
* ```ts
|
|
691
706
|
* import { createClient, http } from 'viem'
|
|
692
707
|
* import { tempo } from 'tempo.ts/chains'
|
|
693
|
-
* import
|
|
708
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
694
709
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
695
710
|
*
|
|
696
711
|
* const client = createClient({
|
|
697
712
|
* account: privateKeyToAccount('0x...'),
|
|
698
|
-
* chain: tempo
|
|
713
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
699
714
|
* transport: http(),
|
|
700
715
|
* })
|
|
701
716
|
*
|
|
702
|
-
* const hash = await
|
|
717
|
+
* const hash = await Actions.amm.burn(client, {
|
|
703
718
|
* userToken: '0x20c0...beef',
|
|
704
719
|
* validatorToken: '0x20c0...babe',
|
|
705
720
|
* liquidity: 50n,
|
|
@@ -770,10 +785,10 @@ export namespace burn {
|
|
|
770
785
|
* ```ts
|
|
771
786
|
* import { createClient, http, walletActions } from 'viem'
|
|
772
787
|
* import { tempo } from 'tempo.ts/chains'
|
|
773
|
-
* import
|
|
788
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
774
789
|
*
|
|
775
790
|
* const client = createClient({
|
|
776
|
-
* chain: tempo
|
|
791
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
777
792
|
* transport: http(),
|
|
778
793
|
* }).extend(walletActions)
|
|
779
794
|
*
|
|
@@ -838,16 +853,16 @@ export namespace burn {
|
|
|
838
853
|
* ```ts
|
|
839
854
|
* import { createClient, http } from 'viem'
|
|
840
855
|
* import { tempo } from 'tempo.ts/chains'
|
|
841
|
-
* import
|
|
856
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
842
857
|
* import { privateKeyToAccount } from 'viem/accounts'
|
|
843
858
|
*
|
|
844
859
|
* const client = createClient({
|
|
845
860
|
* account: privateKeyToAccount('0x...'),
|
|
846
|
-
* chain: tempo
|
|
861
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
847
862
|
* transport: http(),
|
|
848
863
|
* })
|
|
849
864
|
*
|
|
850
|
-
* const result = await
|
|
865
|
+
* const result = await Actions.amm.burnSync(client, {
|
|
851
866
|
* userToken: '0x20c0...beef',
|
|
852
867
|
* validatorToken: '0x20c0...babe',
|
|
853
868
|
* liquidity: 50n,
|
|
@@ -905,10 +920,10 @@ export namespace burnSync {
|
|
|
905
920
|
* ```ts
|
|
906
921
|
* import { createClient, http } from 'viem'
|
|
907
922
|
* import { tempo } from 'tempo.ts/chains'
|
|
908
|
-
* import
|
|
923
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
909
924
|
*
|
|
910
925
|
* const client = createClient({
|
|
911
|
-
* chain: tempo
|
|
926
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
912
927
|
* transport: http(),
|
|
913
928
|
* })
|
|
914
929
|
*
|
|
@@ -985,10 +1000,10 @@ export declare namespace watchRebalanceSwap {
|
|
|
985
1000
|
* ```ts
|
|
986
1001
|
* import { createClient, http } from 'viem'
|
|
987
1002
|
* import { tempo } from 'tempo.ts/chains'
|
|
988
|
-
* import
|
|
1003
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
989
1004
|
*
|
|
990
1005
|
* const client = createClient({
|
|
991
|
-
* chain: tempo
|
|
1006
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
992
1007
|
* transport: http(),
|
|
993
1008
|
* })
|
|
994
1009
|
*
|
|
@@ -1065,10 +1080,10 @@ export declare namespace watchFeeSwap {
|
|
|
1065
1080
|
* ```ts
|
|
1066
1081
|
* import { createClient, http } from 'viem'
|
|
1067
1082
|
* import { tempo } from 'tempo.ts/chains'
|
|
1068
|
-
* import
|
|
1083
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1069
1084
|
*
|
|
1070
1085
|
* const client = createClient({
|
|
1071
|
-
* chain: tempo
|
|
1086
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1072
1087
|
* transport: http(),
|
|
1073
1088
|
* })
|
|
1074
1089
|
*
|
|
@@ -1170,10 +1185,10 @@ export declare namespace watchMint {
|
|
|
1170
1185
|
* ```ts
|
|
1171
1186
|
* import { createClient, http } from 'viem'
|
|
1172
1187
|
* import { tempo } from 'tempo.ts/chains'
|
|
1173
|
-
* import
|
|
1188
|
+
* import { Actions } from 'tempo.ts/viem'
|
|
1174
1189
|
*
|
|
1175
1190
|
* const client = createClient({
|
|
1176
|
-
* chain: tempo
|
|
1191
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
1177
1192
|
* transport: http(),
|
|
1178
1193
|
* })
|
|
1179
1194
|
*
|