tempo.ts 0.6.0 → 0.6.2
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 +433 -0
- package/dist/viem/Actions/account.d.ts +40 -0
- package/dist/viem/Actions/account.d.ts.map +1 -0
- package/dist/viem/Actions/account.js +87 -0
- package/dist/viem/Actions/account.js.map +1 -0
- 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/Decorator.d.ts +28 -0
- package/dist/viem/Decorator.d.ts.map +1 -1
- package/dist/viem/Decorator.js +2 -0
- package/dist/viem/Decorator.js.map +1 -1
- package/package.json +4 -3
- package/src/viem/Actions/account.test.ts +414 -0
- package/src/viem/Actions/account.ts +108 -0
- package/src/viem/Actions/index.ts +1 -0
- package/src/viem/Decorator.test.ts +1 -0
- package/src/viem/Decorator.ts +32 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,433 @@
|
|
|
1
|
+
# tempo.ts
|
|
2
|
+
|
|
3
|
+
## 0.6.2
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#80](https://github.com/tempoxyz/tempo-ts/pull/80) [`ec4fb0d`](https://github.com/tempoxyz/tempo-ts/commit/ec4fb0d99868cb16fe28fdf0053253e01adc8c33) Thanks [@jxom](https://github.com/jxom)! - `tempo.ts/viem`: Added `verifyHash` action.
|
|
8
|
+
|
|
9
|
+
## 0.6.1
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- [`82d51eb`](https://github.com/tempoxyz/tempo-ts/commit/82d51eb5dfa872b0a6b2dfdb6da78660ebb07c4e) Thanks [@jxom](https://github.com/jxom)! - Published CHANGELOG.md
|
|
14
|
+
|
|
15
|
+
## 0.6.0
|
|
16
|
+
|
|
17
|
+
### Minor Changes
|
|
18
|
+
|
|
19
|
+
- [#71](https://github.com/tempoxyz/tempo-ts/pull/71) [`95d4649`](https://github.com/tempoxyz/tempo-ts/commit/95d464995bc13d5ba46a91f9e2a6f7b1c14675e0) Thanks [@gorried](https://github.com/gorried)! - Renamed `Instance#faucet.address` to `faucet.addresses` in order to support multiple tokens.
|
|
20
|
+
|
|
21
|
+
- [#78](https://github.com/tempoxyz/tempo-ts/pull/78) [`6c20dc0`](https://github.com/tempoxyz/tempo-ts/commit/6c20dc090b21a092e90855c7244d9c9d5d22930d) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Removed `feePayer` from `Transaction`. Extract the `feePayer` from `TransactionReceipt` instead.
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- [`57ee208`](https://github.com/tempoxyz/tempo-ts/commit/57ee2084c40929dba587ccd5b4ed1aac4cb327b9) Thanks [@jxom](https://github.com/jxom)! - Removed sig envelope assertions on account signing.
|
|
26
|
+
|
|
27
|
+
- [#74](https://github.com/tempoxyz/tempo-ts/pull/74) [`b604600`](https://github.com/tempoxyz/tempo-ts/commit/b604600fd2c0202807175d4f669db648cb5dae95) Thanks [@gorried](https://github.com/gorried)! - Fixed formatting of `addresses` when starting prool `Instance`
|
|
28
|
+
|
|
29
|
+
- [`e82713f`](https://github.com/tempoxyz/tempo-ts/commit/e82713f192206e94a63e425307cb1566ce800092) Thanks [@jxom](https://github.com/jxom)! - Normalized `credential` before storing.
|
|
30
|
+
|
|
31
|
+
## 0.5.4
|
|
32
|
+
|
|
33
|
+
### Patch Changes
|
|
34
|
+
|
|
35
|
+
- [`3961295`](https://github.com/tempoxyz/tempo-ts/commit/3961295ef1079deb6b5031114614216aa69bbd57) Thanks [@jxom](https://github.com/jxom)! - Added `timeout` property to `faucet.fundSync`.
|
|
36
|
+
|
|
37
|
+
## 0.5.3
|
|
38
|
+
|
|
39
|
+
### Patch Changes
|
|
40
|
+
|
|
41
|
+
- [`dd6275a`](https://github.com/tempoxyz/tempo-ts/commit/dd6275a11642d2c02c1616c7360fb91aff5bfc85) Thanks [@jxom](https://github.com/jxom)! - Added `fundSync` action and `useFundSync` hook in `tempo.ts/wagmi`.
|
|
42
|
+
|
|
43
|
+
- [`fa39d52`](https://github.com/tempoxyz/tempo-ts/commit/fa39d52fd7f4d164ab7a89a6281c7b95db139fd3) Thanks [@jxom](https://github.com/jxom)! - Fixed fee token preferences when a `feePayer` is supplied to transactions.
|
|
44
|
+
|
|
45
|
+
## 0.5.2
|
|
46
|
+
|
|
47
|
+
### Patch Changes
|
|
48
|
+
|
|
49
|
+
- [`6b0e328`](https://github.com/tempoxyz/tempo-ts/commit/6b0e328e4bff2c6e4a701487c4b41e3780396c57) Thanks [@jxom](https://github.com/jxom)! - Added `walletNamespaceCompat` transport to `tempo.ts/viem` so local accounts can leverage `wallet_` RPC actions (`sendCalls`, etc).
|
|
50
|
+
|
|
51
|
+
- [#64](https://github.com/tempoxyz/tempo-ts/pull/64) [`3aa7cb7`](https://github.com/tempoxyz/tempo-ts/commit/3aa7cb7d4fd8a7505d0752372c229ce818c47af8) Thanks [@tmm](https://github.com/tmm)! - Added Wagmi Policy Actions/Hooks
|
|
52
|
+
|
|
53
|
+
## 0.5.1
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- [`640df1c`](https://github.com/tempoxyz/tempo-ts/commit/640df1cd37820bf6605724d98adb520d2b8e5a33) Thanks [@jxom](https://github.com/jxom)! - Added support for \`eth_fillTransaction\`
|
|
58
|
+
|
|
59
|
+
## 0.5.0
|
|
60
|
+
|
|
61
|
+
### Minor Changes
|
|
62
|
+
|
|
63
|
+
- [`8bb03a5`](https://github.com/tempoxyz/tempo-ts/commit/8bb03a594238897c6aa68d87ff93442069a017cc) Thanks [@jxom](https://github.com/jxom)! - **Breaking(`tempo.ts/prool`):** Migrated to support Tempo Docker container from using a standalone Tempo binary.
|
|
64
|
+
|
|
65
|
+
### Patch Changes
|
|
66
|
+
|
|
67
|
+
- [`8bb03a5`](https://github.com/tempoxyz/tempo-ts/commit/8bb03a594238897c6aa68d87ff93442069a017cc) Thanks [@jxom](https://github.com/jxom)! - Added `tempoTestnet` chain.
|
|
68
|
+
|
|
69
|
+
- [`8bb03a5`](https://github.com/tempoxyz/tempo-ts/commit/8bb03a594238897c6aa68d87ff93442069a017cc) Thanks [@jxom](https://github.com/jxom)! - Updated `tempoDev` chain ID.
|
|
70
|
+
|
|
71
|
+
## 0.4.4
|
|
72
|
+
|
|
73
|
+
### Patch Changes
|
|
74
|
+
|
|
75
|
+
- [`fd95d62`](https://github.com/tempoxyz/tempo-ts/commit/fd95d62381006f9e7bdaaee3f362977563852868) Thanks [@tmm](https://github.com/tmm)! - Fixed TSDoc using incorrect role
|
|
76
|
+
|
|
77
|
+
- [`cd5e46b`](https://github.com/tempoxyz/tempo-ts/commit/cd5e46b47d44110c7e32357b94b934f8b390cf70) Thanks [@jxom](https://github.com/jxom)! - Added ERC-5792 compatibility to Wagmi connectors.
|
|
78
|
+
|
|
79
|
+
## 0.4.3
|
|
80
|
+
|
|
81
|
+
### Patch Changes
|
|
82
|
+
|
|
83
|
+
- [`9b2ad01`](https://github.com/tempoxyz/tempo-ts/commit/9b2ad016687b06dbadd6bad2e90dfa1b2722c913) Thanks [@jxom](https://github.com/jxom)! - Fixed `feeToken` hoisting.
|
|
84
|
+
|
|
85
|
+
- [`626134c`](https://github.com/tempoxyz/tempo-ts/commit/626134c7a144af051daadc175c80f3727c4d445c) Thanks [@jxom](https://github.com/jxom)! - Enhanced wallet compatibility.
|
|
86
|
+
|
|
87
|
+
## 0.4.2
|
|
88
|
+
|
|
89
|
+
### Patch Changes
|
|
90
|
+
|
|
91
|
+
- [`e6af89f`](https://github.com/tempoxyz/tempo-ts/commit/e6af89f725633da4320d618e58d13952e758f66e) Thanks [@jxom](https://github.com/jxom)! - Tweaked Wagmi types for `feeToken`.
|
|
92
|
+
|
|
93
|
+
## 0.4.1
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- [`b3aa00d`](https://github.com/tempoxyz/tempo-ts/commit/b3aa00dfa60ecf60b888104616002239d2b54323) Thanks [@jxom](https://github.com/jxom)! - Added `rpId` parameter to `webAuthn` connector.
|
|
98
|
+
|
|
99
|
+
## 0.4.0
|
|
100
|
+
|
|
101
|
+
### Minor Changes
|
|
102
|
+
|
|
103
|
+
- [#49](https://github.com/tempoxyz/tempo-ts/pull/49) [`28f1853`](https://github.com/tempoxyz/tempo-ts/commit/28f18537eda6c0e93badf0175154cc452cbd96ab) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Renamed `dex.getPriceLevel` to `dex.getTickLevel`.
|
|
104
|
+
|
|
105
|
+
## 0.3.0
|
|
106
|
+
|
|
107
|
+
### Minor Changes
|
|
108
|
+
|
|
109
|
+
- [`6230a60`](https://github.com/tempoxyz/tempo-ts/commit/6230a60f3bd55f6d98b682ea2b6bc34629c5386d) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Modified `fee.getUserToken` to return `null` when no user token is set.
|
|
110
|
+
|
|
111
|
+
### Patch Changes
|
|
112
|
+
|
|
113
|
+
- [#46](https://github.com/tempoxyz/tempo-ts/pull/46) [`4bcade6`](https://github.com/tempoxyz/tempo-ts/commit/4bcade6c284cbe6ec5fa245dcc0dd3d705ed7aae) Thanks [@jxom](https://github.com/jxom)! - Pruned `package.json` before publish of unneeded properties.
|
|
114
|
+
|
|
115
|
+
- [`3ecd488`](https://github.com/tempoxyz/tempo-ts/commit/3ecd488c8c3dfe70f6c979d353df959f0081390e) Thanks [@jxom](https://github.com/jxom)! - Added `const` to `Chain.define`
|
|
116
|
+
|
|
117
|
+
- [`5aeecc2`](https://github.com/tempoxyz/tempo-ts/commit/5aeecc2512d5dbd5c06ac5067fbe11113c1103fd) Thanks [@jxom](https://github.com/jxom)! - Fixed \`Chain.define\` type.
|
|
118
|
+
|
|
119
|
+
## 0.2.1
|
|
120
|
+
|
|
121
|
+
### Patch Changes
|
|
122
|
+
|
|
123
|
+
- [`db8cfa1`](https://github.com/tempoxyz/tempo-ts/commit/db8cfa1ccf2fdfcd1ec329662bddebffa998e16d) Thanks [@jxom](https://github.com/jxom)! - Added `getOptions.getPublicKey` and `createOptions.getChallenge` to `webAuthn` connector.
|
|
124
|
+
|
|
125
|
+
- [`fec93f9`](https://github.com/tempoxyz/tempo-ts/commit/fec93f903a8ecbf8d196604d91a300b51a569424) Thanks [@jxom](https://github.com/jxom)! - Added `faucet.fund` action.
|
|
126
|
+
|
|
127
|
+
- [#44](https://github.com/tempoxyz/tempo-ts/pull/44) [`58a6a11`](https://github.com/tempoxyz/tempo-ts/commit/58a6a113b10412bde1ef69531153e400e0a95a94) Thanks [@jxom](https://github.com/jxom)! - Added `mintWithValidatorToken` support to `amm.mint` action.
|
|
128
|
+
|
|
129
|
+
## 0.2.0
|
|
130
|
+
|
|
131
|
+
### Minor Changes
|
|
132
|
+
|
|
133
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added `reward` Actions on `tempo.ts/viem`.
|
|
134
|
+
|
|
135
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added `dex.getOrderbook` action.
|
|
136
|
+
|
|
137
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added support for Native "Account Abstraction" accounts.
|
|
138
|
+
|
|
139
|
+
New account types supported:
|
|
140
|
+
|
|
141
|
+
### WebAuthn (P256)
|
|
142
|
+
|
|
143
|
+
```ts
|
|
144
|
+
import { Account, WebAuthnP256 } from "tempo.ts/viem";
|
|
145
|
+
|
|
146
|
+
const credential = await WebAuthnP256.createCredential({
|
|
147
|
+
name: "Example",
|
|
148
|
+
});
|
|
149
|
+
const account = Account.fromWebAuthnP256(credential);
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
### WebCrypto (P256)
|
|
153
|
+
|
|
154
|
+
```ts
|
|
155
|
+
import { Account, WebCryptoP256 } from "tempo.ts/viem";
|
|
156
|
+
|
|
157
|
+
const keyPair = await WebCryptoP256.createKeyPair();
|
|
158
|
+
const account = Account.fromWebCryptoP256(keyPair);
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
### P256
|
|
162
|
+
|
|
163
|
+
```ts
|
|
164
|
+
import { Account, P256 } from "tempo.ts/viem";
|
|
165
|
+
|
|
166
|
+
const privateKey = P256.randomPrivateKey();
|
|
167
|
+
const account = Account.fromP256(privateKey);
|
|
168
|
+
```
|
|
169
|
+
|
|
170
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added `dangerous_secp256k1` connector.
|
|
171
|
+
|
|
172
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Removed `amm.getPoolId`. Use `PoolId.from` from `tempo.ts/ox` instead.
|
|
173
|
+
|
|
174
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added Wagmi Actions & Hooks for `fee` and `token`.
|
|
175
|
+
|
|
176
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added `WebAuthnP256`, `P256`, `WebCryptoP256` modules.
|
|
177
|
+
|
|
178
|
+
- [#43](https://github.com/tempoxyz/tempo-ts/pull/43) [`e932099`](https://github.com/tempoxyz/tempo-ts/commit/e9320992d29e26d59646251a3bccc099a002e7a2) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Removed `Addresses.defaultFeeToken` and `Addresses.defaultQuoteToken`.
|
|
179
|
+
|
|
180
|
+
- [`899c120`](https://github.com/tempoxyz/tempo-ts/commit/899c1201a563121bd08f08b012d84439e9d1b816) Thanks [@jxom](https://github.com/jxom)! - **Breaking:**
|
|
181
|
+
- Renamed `updateQuoteToken` to `prepareUpdateQuoteToken`.
|
|
182
|
+
- Renamed `finalizeUpdateQuoteToken` to `updateQuoteToken`.
|
|
183
|
+
|
|
184
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added support for WebAuthn & P256 accounts with the `Account` module.
|
|
185
|
+
|
|
186
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added `dex.getOrders`.
|
|
187
|
+
|
|
188
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Removed `amm.getTotalSupply`. Use `amm.getPool` instead.
|
|
189
|
+
|
|
190
|
+
- [#43](https://github.com/tempoxyz/tempo-ts/pull/43) [`e932099`](https://github.com/tempoxyz/tempo-ts/commit/e9320992d29e26d59646251a3bccc099a002e7a2) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Removed `createTempoClient`. Construct your Client with `viem` primitives:
|
|
191
|
+
|
|
192
|
+
```diff
|
|
193
|
+
-import { createTempoClient } from 'tempo.ts/viem'
|
|
194
|
+
+import { createClient, http } from 'viem'
|
|
195
|
+
+import { tempo } from 'tempo.ts/chains'
|
|
196
|
+
|
|
197
|
+
-const client = createTempoClient()
|
|
198
|
+
+const client = createClient({
|
|
199
|
+
+ chain: tempo({
|
|
200
|
+
+ feeToken: '0x20c0000000000000000000000000000000000001'
|
|
201
|
+
+ }),
|
|
202
|
+
+ transport: http(),
|
|
203
|
+
+})
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added `tempoDevnet` chain.
|
|
207
|
+
|
|
208
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added `reward` actions + hooks to `tempo.ts/wagmi`
|
|
209
|
+
|
|
210
|
+
- [`210b95c`](https://github.com/tempoxyz/tempo-ts/commit/210b95c6ca7a043a7684b7ff869cdf32c7afa0ee) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Removed `permit` from `Actions.token`
|
|
211
|
+
|
|
212
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added `tempo.ts/wagmi` entrypoint and `webAuthn` connector.
|
|
213
|
+
|
|
214
|
+
- [#43](https://github.com/tempoxyz/tempo-ts/pull/43) [`e932099`](https://github.com/tempoxyz/tempo-ts/commit/e9320992d29e26d59646251a3bccc099a002e7a2) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** `feeToken` is now required on all transaction actions. You must either pass `feeToken` explicitly, or hoist a
|
|
215
|
+
`feeToken` on the Client:
|
|
216
|
+
|
|
217
|
+
### Non-hoisted Fee Token
|
|
218
|
+
|
|
219
|
+
`feeToken` will need to be set per-action.
|
|
220
|
+
|
|
221
|
+
```ts
|
|
222
|
+
// fee token NOT set on client
|
|
223
|
+
const client2 = createClient({
|
|
224
|
+
chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
225
|
+
transport: http(),
|
|
226
|
+
});
|
|
227
|
+
|
|
228
|
+
// ⚠️ `feeToken` needs to be set per-action
|
|
229
|
+
await sendTransaction(client2, {
|
|
230
|
+
feeToken: "0x20c...0001",
|
|
231
|
+
to: "0x0000000000000000000000000000000000000000",
|
|
232
|
+
});
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
### Hoisted Fee Token
|
|
236
|
+
|
|
237
|
+
Pass `feeToken` to the Client to apply it to all transactions.
|
|
238
|
+
|
|
239
|
+
```ts
|
|
240
|
+
const client1 = createClient({
|
|
241
|
+
chain: tempo({ feeToken: "0x20c...001" }), // note: pass `null` to opt-in to protocol preferences.
|
|
242
|
+
transport: http(),
|
|
243
|
+
});
|
|
244
|
+
|
|
245
|
+
// ✅ no fee token needed, hoisted on client
|
|
246
|
+
await sendTransaction(client1, {
|
|
247
|
+
to: "0x0000000000000000000000000000000000000000",
|
|
248
|
+
});
|
|
249
|
+
```
|
|
250
|
+
|
|
251
|
+
### Patch Changes
|
|
252
|
+
|
|
253
|
+
- [#40](https://github.com/tempoxyz/tempo-ts/pull/40) [`619b943`](https://github.com/tempoxyz/tempo-ts/commit/619b9437bc78a7ef7c7b2344fcc5f0e827a6238d) Thanks [@gorried](https://github.com/gorried)! - **Breaking:** Updated latest chain to Andantino.
|
|
254
|
+
|
|
255
|
+
- [`a90d48c`](https://github.com/tempoxyz/tempo-ts/commit/a90d48c049c48601ae4aca78334b13b3ebb2ea85) Thanks [@jxom](https://github.com/jxom)! - Added `token.getRoleAdmin`
|
|
256
|
+
|
|
257
|
+
- [#42](https://github.com/tempoxyz/tempo-ts/pull/42) [`74ed4a7`](https://github.com/tempoxyz/tempo-ts/commit/74ed4a74cc43febca597f681d0b595b242f8d619) Thanks [@gorried](https://github.com/gorried)! - Updated `chain.id` for Andantino.
|
|
258
|
+
|
|
259
|
+
## 0.1.5
|
|
260
|
+
|
|
261
|
+
### Patch Changes
|
|
262
|
+
|
|
263
|
+
- [`09eb31f`](https://github.com/tempoxyz/tempo-ts/commit/09eb31fa3050bff0f9dc9b459656c2ce4b2297f9) Thanks [@jxom](https://github.com/jxom)! - Added `log` option to `tempo` instance.
|
|
264
|
+
|
|
265
|
+
## 0.1.4
|
|
266
|
+
|
|
267
|
+
### Patch Changes
|
|
268
|
+
|
|
269
|
+
- [`c278bf5`](https://github.com/tempoxyz/tempo-ts/commit/c278bf521ffb9e07661f30fe0d2f0bc05a033091) Thanks [@tmm](https://github.com/tmm)! - Exported decorator type
|
|
270
|
+
|
|
271
|
+
## 0.1.3
|
|
272
|
+
|
|
273
|
+
### Patch Changes
|
|
274
|
+
|
|
275
|
+
- [`92312c6`](https://github.com/tempoxyz/tempo-ts/commit/92312c6a4961596de107bf75c7525e8b6c4f781f) Thanks [@jxom](https://github.com/jxom)! - Fixed dist output.
|
|
276
|
+
|
|
277
|
+
## 0.1.2
|
|
278
|
+
|
|
279
|
+
### Patch Changes
|
|
280
|
+
|
|
281
|
+
- [`287924c`](https://github.com/tempoxyz/tempo-ts/commit/287924c21ae250be0fe3d73e5f928e0f9cb1cd5b) Thanks [@jxom](https://github.com/jxom)! - Fixed `token.getMetadata` against the quote token.
|
|
282
|
+
|
|
283
|
+
- [`5c47beb`](https://github.com/tempoxyz/tempo-ts/commit/5c47bebebbc2efddb0c8cf0702afcba450c7fc80) Thanks [@jxom](https://github.com/jxom)! - `tempo.ts/prool`: Fixed `blockTime` parameter type.
|
|
284
|
+
|
|
285
|
+
- [`287924c`](https://github.com/tempoxyz/tempo-ts/commit/287924c21ae250be0fe3d73e5f928e0f9cb1cd5b) Thanks [@jxom](https://github.com/jxom)! - Added `TokenId.from` to instantiate a token id from an address or number.
|
|
286
|
+
|
|
287
|
+
## 0.1.1
|
|
288
|
+
|
|
289
|
+
### Patch Changes
|
|
290
|
+
|
|
291
|
+
- [`dd4cd43`](https://github.com/tempoxyz/tempo-ts/commit/dd4cd43fb10ac1a8d766751b1e6f958b62befa07) Thanks [@jxom](https://github.com/jxom)! - Fixed `token.getMetadata` for the default quote token.
|
|
292
|
+
|
|
293
|
+
## 0.1.0
|
|
294
|
+
|
|
295
|
+
### Minor Changes
|
|
296
|
+
|
|
297
|
+
- [#4](https://github.com/tempoxyz/tempo-ts/pull/4) [`528aa00`](https://github.com/tempoxyz/tempo-ts/commit/528aa0019876bf166724378de877a7acfd4a3013) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Removed support for `type: 'feeToken'` / `type: '0x77'` transactions. Use `type: 'aa'` / `type: '0x76'` transactions instead.
|
|
298
|
+
|
|
299
|
+
- [#4](https://github.com/tempoxyz/tempo-ts/pull/4) [`528aa00`](https://github.com/tempoxyz/tempo-ts/commit/528aa0019876bf166724378de877a7acfd4a3013) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Renamed `usdAddress` and `usdId`.
|
|
300
|
+
|
|
301
|
+
```diff
|
|
302
|
+
- import { usdAddress, usdId } from 'tempo.ts/viem'
|
|
303
|
+
+ import { Addresses, TokenId } from 'tempo.ts/viem'
|
|
304
|
+
|
|
305
|
+
- usdAddress
|
|
306
|
+
+ Addresses.defaultFeeToken
|
|
307
|
+
|
|
308
|
+
- usdId
|
|
309
|
+
+ TokenId.defaultFeeToken
|
|
310
|
+
```
|
|
311
|
+
|
|
312
|
+
- [#4](https://github.com/tempoxyz/tempo-ts/pull/4) [`528aa00`](https://github.com/tempoxyz/tempo-ts/commit/528aa0019876bf166724378de877a7acfd4a3013) Thanks [@jxom](https://github.com/jxom)! - `tempo.ts/ox`: Added `TransactionEnvelopeAA` and `SignatureEnvelope`.
|
|
313
|
+
|
|
314
|
+
- [#4](https://github.com/tempoxyz/tempo-ts/pull/4) [`528aa00`](https://github.com/tempoxyz/tempo-ts/commit/528aa0019876bf166724378de877a7acfd4a3013) Thanks [@jxom](https://github.com/jxom)! - Added **Stablecoin Exchange** actions:
|
|
315
|
+
- `dex.buy`
|
|
316
|
+
- `dex.buySync`
|
|
317
|
+
- `dex.cancel`
|
|
318
|
+
- `dex.cancelSync`
|
|
319
|
+
- `dex.createPair`
|
|
320
|
+
- `dex.createPairSync`
|
|
321
|
+
- `dex.getBalance`
|
|
322
|
+
- `dex.getBuyQuote`
|
|
323
|
+
- `dex.getOrder`
|
|
324
|
+
- `dex.getPriceLevel`
|
|
325
|
+
- `dex.getSellQuote`
|
|
326
|
+
- `dex.place`
|
|
327
|
+
- `dex.placeSync`
|
|
328
|
+
- `dex.placeFlip`
|
|
329
|
+
- `dex.placeFlipSync`
|
|
330
|
+
- `dex.sell`
|
|
331
|
+
- `dex.sellSync`
|
|
332
|
+
- `dex.withdraw`
|
|
333
|
+
- `dex.withdrawSync`
|
|
334
|
+
- `dex.watchFlipOrderPlaced`
|
|
335
|
+
- `dex.watchOrderCancelled`
|
|
336
|
+
- `dex.watchOrderFilled`
|
|
337
|
+
- `dex.watchOrderPlaced`
|
|
338
|
+
|
|
339
|
+
- [#4](https://github.com/tempoxyz/tempo-ts/pull/4) [`528aa00`](https://github.com/tempoxyz/tempo-ts/commit/528aa0019876bf166724378de877a7acfd4a3013) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Removed support for deprecated `tempoLento` chain. Update to use `tempoAndante` instead.
|
|
340
|
+
|
|
341
|
+
- [#4](https://github.com/tempoxyz/tempo-ts/pull/4) [`528aa00`](https://github.com/tempoxyz/tempo-ts/commit/528aa0019876bf166724378de877a7acfd4a3013) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** Refactored structure to use PascalCased namespaces to future-proof against naming conflicts, excessive imports, and future versions of Viem.
|
|
342
|
+
- Renamed `actions` import to `Actions`.
|
|
343
|
+
|
|
344
|
+
```diff
|
|
345
|
+
- import { actions } from 'tempo.ts/viem'
|
|
346
|
+
+ import { Actions } from 'tempo.ts/viem'
|
|
347
|
+
```
|
|
348
|
+
|
|
349
|
+
- Renamed `parseTransaction` to `deserialize`.
|
|
350
|
+
|
|
351
|
+
```diff
|
|
352
|
+
- import { parseTransaction } from 'tempo.ts/viem'
|
|
353
|
+
+ import { Transaction } from 'tempo.ts/viem'
|
|
354
|
+
|
|
355
|
+
- parseTransaction(serialized)
|
|
356
|
+
+ Transaction.deserialize(serialized)
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
- Renamed `serializeTransaction` to `serialize`.
|
|
360
|
+
|
|
361
|
+
```diff
|
|
362
|
+
- import { serializeTransaction } from 'tempo.ts/viem'
|
|
363
|
+
+ import { Transaction } from 'tempo.ts/viem'
|
|
364
|
+
|
|
365
|
+
- serializeTransaction(transaction)
|
|
366
|
+
+ Transaction.serialize(transaction)
|
|
367
|
+
```
|
|
368
|
+
|
|
369
|
+
- Placed all `*Abi` exports in the `Abis` namespace.
|
|
370
|
+
|
|
371
|
+
```diff
|
|
372
|
+
- import { tip20Abi } from 'tempo.ts/viem'
|
|
373
|
+
+ import { Abis } from 'tempo.ts/viem'
|
|
374
|
+
|
|
375
|
+
- tip20Abi
|
|
376
|
+
+ Abis.tip20
|
|
377
|
+
```
|
|
378
|
+
|
|
379
|
+
- Placed all `*Address` exports in the `Addresses` namespace.
|
|
380
|
+
|
|
381
|
+
```diff
|
|
382
|
+
- import { feeManagerAddress } from 'tempo.ts/viem'
|
|
383
|
+
+ import { Addresses } from 'tempo.ts/viem'
|
|
384
|
+
|
|
385
|
+
- feeManagerAddress
|
|
386
|
+
+ Addresses.feeManager
|
|
387
|
+
```
|
|
388
|
+
|
|
389
|
+
### Patch Changes
|
|
390
|
+
|
|
391
|
+
- [#4](https://github.com/tempoxyz/tempo-ts/pull/4) [`528aa00`](https://github.com/tempoxyz/tempo-ts/commit/528aa0019876bf166724378de877a7acfd4a3013) Thanks [@jxom](https://github.com/jxom)! - Added `watchUpdateQuoteToken` Action.
|
|
392
|
+
|
|
393
|
+
- [#4](https://github.com/tempoxyz/tempo-ts/pull/4) [`528aa00`](https://github.com/tempoxyz/tempo-ts/commit/528aa0019876bf166724378de877a7acfd4a3013) Thanks [@jxom](https://github.com/jxom)! - Added `token.updateQuoteToken` and `token.finalizeUpdateQuoteToken` Actions.
|
|
394
|
+
|
|
395
|
+
## 0.0.6
|
|
396
|
+
|
|
397
|
+
### Patch Changes
|
|
398
|
+
|
|
399
|
+
- [`b04eb82`](https://github.com/tempoxyz/tempo-ts/commit/b04eb8278b2b88636311b1821c2238024af89f84) Thanks [@jxom](https://github.com/jxom)! - **Breaking:** `transferPolicy` renamed to `transferPolicyId` on `token.getMetadata` return value. It also now returns a `bigint` instead of a `string`.
|
|
400
|
+
|
|
401
|
+
## 0.0.5
|
|
402
|
+
|
|
403
|
+
### Patch Changes
|
|
404
|
+
|
|
405
|
+
- [`7cd6a18`](https://github.com/tempoxyz/tempo-ts/commit/7cd6a18a52f3c2c8a7b6277935cdcce6ae14511d) Thanks [@jxom](https://github.com/jxom)! - Set `*FeePerGas` fields to undefined for gas estimation.
|
|
406
|
+
|
|
407
|
+
## 0.0.4
|
|
408
|
+
|
|
409
|
+
### Patch Changes
|
|
410
|
+
|
|
411
|
+
- [`7caa3da`](https://github.com/tempoxyz/tempo-ts/commit/7caa3daf124150d254dcce09f26a8ced0bb948a6) Thanks [@jxom](https://github.com/jxom)! - Added support for `throwOnReceiptRevert` on `*Sync` actions.
|
|
412
|
+
|
|
413
|
+
## 0.0.3
|
|
414
|
+
|
|
415
|
+
### Patch Changes
|
|
416
|
+
|
|
417
|
+
- [`c74482a`](https://github.com/tempoxyz/tempo-ts/commit/c74482ace559efeaff4c49e9bcd45cdd3cf37300) Thanks [@jxom](https://github.com/jxom)! - Generated ABIs from Tempo Node precompiles.
|
|
418
|
+
|
|
419
|
+
- [`739cb02`](https://github.com/tempoxyz/tempo-ts/commit/739cb02551eb758ad556edc58c1097d78e5b6fa6) Thanks [@jxom](https://github.com/jxom)! - Narrowed `TokenRole` type.
|
|
420
|
+
|
|
421
|
+
- [#10](https://github.com/tempoxyz/tempo-ts/pull/10) [`fd0594d`](https://github.com/tempoxyz/tempo-ts/commit/fd0594df47c8fd943d7d2b95b391af53dfe8f96a) Thanks [@jxom](https://github.com/jxom)! - Added `actions.token.hasRole`.
|
|
422
|
+
|
|
423
|
+
## 0.0.2
|
|
424
|
+
|
|
425
|
+
### Patch Changes
|
|
426
|
+
|
|
427
|
+
- [#7](https://github.com/tempoxyz/tempo-ts/pull/7) [`f955968`](https://github.com/tempoxyz/tempo-ts/commit/f955968212042726fa44b0c78281b3ca502c82a1) Thanks [@tmm](https://github.com/tmm)! - Exported addresses in Viem entrypoint
|
|
428
|
+
|
|
429
|
+
## 0.0.1
|
|
430
|
+
|
|
431
|
+
### Patch Changes
|
|
432
|
+
|
|
433
|
+
- [`8e28099`](https://github.com/tempoxyz/tempo-ts/commit/8e280992b07d6cb7a096f60113cce3815ae24cb6) Thanks [@jxom](https://github.com/jxom)! - Initial release.
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import type { Chain, Client, Transport } from 'viem';
|
|
2
|
+
import type { VerifyHashParameters, VerifyHashReturnType } from 'viem/actions';
|
|
3
|
+
import type { PartialBy } from '../../internal/types.js';
|
|
4
|
+
/**
|
|
5
|
+
* Verifies that a signature is valid for a given hash and address.
|
|
6
|
+
* Supports multiple signature types: Secp256k1, P256, WebCrypto P256, and WebAuthn P256.
|
|
7
|
+
*
|
|
8
|
+
* @example
|
|
9
|
+
* ```ts
|
|
10
|
+
* import { createClient, http } from 'viem'
|
|
11
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
12
|
+
* import { Actions, Account, P256 } from 'tempo.ts/viem'
|
|
13
|
+
*
|
|
14
|
+
* const client = createClient({
|
|
15
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
16
|
+
* transport: http(),
|
|
17
|
+
* })
|
|
18
|
+
*
|
|
19
|
+
* const privateKey = P256.randomPrivateKey()
|
|
20
|
+
* const account = Account.fromP256(privateKey)
|
|
21
|
+
*
|
|
22
|
+
* const hash = '0x...'
|
|
23
|
+
* const signature = await account.sign({ hash })
|
|
24
|
+
*
|
|
25
|
+
* const valid = await Actions.verifyHash(client, {
|
|
26
|
+
* hash,
|
|
27
|
+
* signature,
|
|
28
|
+
* })
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @param client - Client.
|
|
32
|
+
* @param parameters - Parameters.
|
|
33
|
+
* @returns Whether the signature is valid.
|
|
34
|
+
*/
|
|
35
|
+
export declare function verifyHash<chain extends Chain | undefined>(client: Client<Transport, chain>, parameters: verifyHash.Parameters): Promise<verifyHash.ReturnValue>;
|
|
36
|
+
export declare namespace verifyHash {
|
|
37
|
+
type Parameters = PartialBy<VerifyHashParameters, 'address'>;
|
|
38
|
+
type ReturnValue = VerifyHashReturnType;
|
|
39
|
+
}
|
|
40
|
+
//# sourceMappingURL=account.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../../src/viem/Actions/account.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,MAAM,CAAA;AACpD,OAAO,KAAK,EAAE,oBAAoB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAA;AAG9E,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAGxD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,wBAAsB,UAAU,CAAC,KAAK,SAAS,KAAK,GAAG,SAAS,EAC9D,MAAM,EAAE,MAAM,CAAC,SAAS,EAAE,KAAK,CAAC,EAChC,UAAU,EAAE,UAAU,CAAC,UAAU,GAChC,OAAO,CAAC,UAAU,CAAC,WAAW,CAAC,CAwDjC;AAED,MAAM,CAAC,OAAO,WAAW,UAAU,CAAC;IAClC,KAAY,UAAU,GAAG,SAAS,CAAC,oBAAoB,EAAE,SAAS,CAAC,CAAA;IAEnE,KAAY,WAAW,GAAG,oBAAoB,CAAA;CAC/C"}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { Secp256k1 } from 'ox';
|
|
2
|
+
import * as Hex from 'ox/Hex';
|
|
3
|
+
import * as P256 from 'ox/P256';
|
|
4
|
+
import * as WebAuthnP256 from 'ox/WebAuthnP256';
|
|
5
|
+
import { verifyHash as viem_verifyHash } from 'viem/actions';
|
|
6
|
+
import { getAction } from 'viem/utils';
|
|
7
|
+
import * as SignatureEnvelope from '../../ox/SignatureEnvelope.js';
|
|
8
|
+
/**
|
|
9
|
+
* Verifies that a signature is valid for a given hash and address.
|
|
10
|
+
* Supports multiple signature types: Secp256k1, P256, WebCrypto P256, and WebAuthn P256.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* import { createClient, http } from 'viem'
|
|
15
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
16
|
+
* import { Actions, Account, P256 } from 'tempo.ts/viem'
|
|
17
|
+
*
|
|
18
|
+
* const client = createClient({
|
|
19
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
20
|
+
* transport: http(),
|
|
21
|
+
* })
|
|
22
|
+
*
|
|
23
|
+
* const privateKey = P256.randomPrivateKey()
|
|
24
|
+
* const account = Account.fromP256(privateKey)
|
|
25
|
+
*
|
|
26
|
+
* const hash = '0x...'
|
|
27
|
+
* const signature = await account.sign({ hash })
|
|
28
|
+
*
|
|
29
|
+
* const valid = await Actions.verifyHash(client, {
|
|
30
|
+
* hash,
|
|
31
|
+
* signature,
|
|
32
|
+
* })
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @param client - Client.
|
|
36
|
+
* @param parameters - Parameters.
|
|
37
|
+
* @returns Whether the signature is valid.
|
|
38
|
+
*/
|
|
39
|
+
export async function verifyHash(client, parameters) {
|
|
40
|
+
const { hash } = parameters;
|
|
41
|
+
const signature = (() => {
|
|
42
|
+
const signature = parameters.signature;
|
|
43
|
+
if (Hex.validate(signature))
|
|
44
|
+
return signature;
|
|
45
|
+
if (typeof signature === 'object' && 'r' in signature && 's' in signature)
|
|
46
|
+
return SignatureEnvelope.serialize({
|
|
47
|
+
type: 'secp256k1',
|
|
48
|
+
signature: {
|
|
49
|
+
r: BigInt(signature.r),
|
|
50
|
+
s: BigInt(signature.s),
|
|
51
|
+
yParity: signature.yParity,
|
|
52
|
+
},
|
|
53
|
+
});
|
|
54
|
+
return Hex.fromBytes(signature);
|
|
55
|
+
})();
|
|
56
|
+
const [envelope, userAddress] = (() => {
|
|
57
|
+
const envelope = SignatureEnvelope.from(signature);
|
|
58
|
+
// TODO: add once we have key auth
|
|
59
|
+
// if (envelope.type === 'keychain')
|
|
60
|
+
// return [envelope.inner, envelope.userAddress]
|
|
61
|
+
return [envelope, undefined];
|
|
62
|
+
})();
|
|
63
|
+
if (envelope.type === 'p256')
|
|
64
|
+
return P256.verify({
|
|
65
|
+
payload: hash,
|
|
66
|
+
publicKey: envelope.publicKey,
|
|
67
|
+
signature: envelope.signature,
|
|
68
|
+
hash: envelope.prehash,
|
|
69
|
+
});
|
|
70
|
+
if (envelope.type === 'webAuthn')
|
|
71
|
+
return WebAuthnP256.verify({
|
|
72
|
+
challenge: hash,
|
|
73
|
+
metadata: envelope.metadata,
|
|
74
|
+
publicKey: envelope.publicKey,
|
|
75
|
+
signature: envelope.signature,
|
|
76
|
+
});
|
|
77
|
+
// TODO: add once we have key auth
|
|
78
|
+
// if (envelope.type === 'keychain') throw new Error('not supported')
|
|
79
|
+
const address = parameters.address ??
|
|
80
|
+
userAddress ??
|
|
81
|
+
Secp256k1.recoverAddress({
|
|
82
|
+
payload: hash,
|
|
83
|
+
signature: envelope.signature,
|
|
84
|
+
});
|
|
85
|
+
return await getAction(client, viem_verifyHash, 'verifyHash')({ ...parameters, address });
|
|
86
|
+
}
|
|
87
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/viem/Actions/account.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,IAAI,CAAA;AAC9B,OAAO,KAAK,GAAG,MAAM,QAAQ,CAAA;AAC7B,OAAO,KAAK,IAAI,MAAM,SAAS,CAAA;AAC/B,OAAO,KAAK,YAAY,MAAM,iBAAiB,CAAA;AAG/C,OAAO,EAAE,UAAU,IAAI,eAAe,EAAE,MAAM,cAAc,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAA;AAEtC,OAAO,KAAK,iBAAiB,MAAM,+BAA+B,CAAA;AAElE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,MAAM,CAAC,KAAK,UAAU,UAAU,CAC9B,MAAgC,EAChC,UAAiC;IAEjC,MAAM,EAAE,IAAI,EAAE,GAAG,UAAU,CAAA;IAE3B,MAAM,SAAS,GAAG,CAAC,GAAG,EAAE;QACtB,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAA;QACtC,IAAI,GAAG,CAAC,QAAQ,CAAC,SAAS,CAAC;YAAE,OAAO,SAAS,CAAA;QAC7C,IAAI,OAAO,SAAS,KAAK,QAAQ,IAAI,GAAG,IAAI,SAAS,IAAI,GAAG,IAAI,SAAS;YACvE,OAAO,iBAAiB,CAAC,SAAS,CAAC;gBACjC,IAAI,EAAE,WAAW;gBACjB,SAAS,EAAE;oBACT,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;oBACtB,CAAC,EAAE,MAAM,CAAC,SAAS,CAAC,CAAC,CAAC;oBACtB,OAAO,EAAE,SAAS,CAAC,OAAQ;iBAC5B;aACF,CAAC,CAAA;QACJ,OAAO,GAAG,CAAC,SAAS,CAAC,SAAS,CAAC,CAAA;IACjC,CAAC,CAAC,EAAE,CAAA;IAEJ,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,CAAC,GAAG,EAAE;QACpC,MAAM,QAAQ,GAAG,iBAAiB,CAAC,IAAI,CAAC,SAAS,CAAC,CAAA;QAClD,kCAAkC;QAClC,oCAAoC;QACpC,kDAAkD;QAClD,OAAO,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAA;IAC9B,CAAC,CAAC,EAAE,CAAA;IAEJ,IAAI,QAAQ,CAAC,IAAI,KAAK,MAAM;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC;YACjB,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,IAAI,EAAE,QAAQ,CAAC,OAAO;SACvB,CAAC,CAAA;IACJ,IAAI,QAAQ,CAAC,IAAI,KAAK,UAAU;QAC9B,OAAO,YAAY,CAAC,MAAM,CAAC;YACzB,SAAS,EAAE,IAAI;YACf,QAAQ,EAAE,QAAQ,CAAC,QAAQ;YAC3B,SAAS,EAAE,QAAQ,CAAC,SAAS;YAC7B,SAAS,EAAE,QAAQ,CAAC,SAAS;SAC9B,CAAC,CAAA;IACJ,kCAAkC;IAClC,qEAAqE;IAErE,MAAM,OAAO,GACX,UAAU,CAAC,OAAO;QAClB,WAAW;QACX,SAAS,CAAC,cAAc,CAAC;YACvB,OAAO,EAAE,IAAI;YACb,SAAS,EAAE,QAAQ,CAAC,SAAS;SAC9B,CAAC,CAAA;IAEJ,OAAO,MAAM,SAAS,CACpB,MAAM,EACN,eAAe,EACf,YAAY,CACb,CAAC,EAAE,GAAG,UAAU,EAAE,OAAO,EAAW,CAAC,CAAA;AACxC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/viem/Actions/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,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/viem/Actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,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,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/viem/Actions/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,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/viem/Actions/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACzC,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,MAAM,MAAM,aAAa,CAAA;AACrC,OAAO,KAAK,KAAK,MAAM,YAAY,CAAA"}
|
package/dist/viem/Decorator.d.ts
CHANGED
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
import type { Account, Chain, Client, Transport } from 'viem';
|
|
2
|
+
import type { VerifyHashParameters, VerifyHashReturnType } from 'viem/actions';
|
|
3
|
+
import type { PartialBy } from '../internal/types.js';
|
|
2
4
|
import * as ammActions from './Actions/amm.js';
|
|
3
5
|
import * as dexActions from './Actions/dex.js';
|
|
4
6
|
import * as faucetActions from './Actions/faucet.js';
|
|
@@ -7,6 +9,32 @@ import * as policyActions from './Actions/policy.js';
|
|
|
7
9
|
import * as rewardActions from './Actions/reward.js';
|
|
8
10
|
import * as tokenActions from './Actions/token.js';
|
|
9
11
|
export type Decorator<chain extends Chain | undefined = Chain | undefined, account extends Account | undefined = Account | undefined> = {
|
|
12
|
+
/**
|
|
13
|
+
* Verifies that a signature is valid for a given hash and address.
|
|
14
|
+
* Supports Secp256k1, P256, WebCrypto P256, and WebAuthn signatures.
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* import { createClient, http } from 'viem'
|
|
19
|
+
* import { tempo } from 'tempo.ts/chains'
|
|
20
|
+
* import { tempoActions } from 'tempo.ts/viem'
|
|
21
|
+
*
|
|
22
|
+
* const client = createClient({
|
|
23
|
+
* chain: tempo({ feeToken: '0x20c0000000000000000000000000000000000001' })
|
|
24
|
+
* transport: http(),
|
|
25
|
+
* }).extend(tempoActions())
|
|
26
|
+
*
|
|
27
|
+
* const valid = await client.verifyHash({
|
|
28
|
+
* address: '0x...',
|
|
29
|
+
* hash: '0x...',
|
|
30
|
+
* signature: '0x...',
|
|
31
|
+
* })
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @param parameters - Parameters.
|
|
35
|
+
* @returns Whether the signature is valid.
|
|
36
|
+
*/
|
|
37
|
+
verifyHash: (parameters: PartialBy<VerifyHashParameters, 'address'>) => Promise<VerifyHashReturnType>;
|
|
10
38
|
amm: {
|
|
11
39
|
/**
|
|
12
40
|
* Gets the reserves for a liquidity pool.
|