@quaivault/sdk 0.1.1 → 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/README.md +37 -3
- package/dist/index.cjs +717 -254
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +426 -31
- package/dist/index.d.ts +426 -31
- package/dist/index.js +719 -256
- package/dist/index.js.map +1 -1
- package/package.json +6 -5
package/README.md
CHANGED
|
@@ -164,9 +164,11 @@ qv.indexerHealth()
|
|
|
164
164
|
```ts
|
|
165
165
|
vault.info() / owners() / threshold() / balance() / modules() / delegatecallTargets()
|
|
166
166
|
vault.isOwner(a) / isModuleEnabled(m) / isDelegatecallAllowed(t) / isValidSignature(hash)
|
|
167
|
-
vault.transaction(txHash) /
|
|
168
|
-
vault.transactionHash(to, value, data, nonce?)
|
|
169
|
-
vault.
|
|
167
|
+
vault.transaction(txHash) / transactions(txHashes) / pendingTransactions(page?)
|
|
168
|
+
vault.transactionHistory(page?) / transactionHash(to, value, data, nonce?)
|
|
169
|
+
vault.hasApproved(txHash, owner)
|
|
170
|
+
vault.affordances(txHash, caller?, at?) / describe(txHash, caller?)
|
|
171
|
+
vault.view() / pinned(view) // explicit owners+threshold snapshot
|
|
170
172
|
vault.balances(opts?) / deposits(page?) / tokenTransfers(page?) / signedMessages()
|
|
171
173
|
vault.waitForExecutable(txHash, opts?)
|
|
172
174
|
vault.watch(handler, opts?) // Supabase Realtime
|
|
@@ -335,6 +337,38 @@ nonce and funds errors are permanent by definition, and anything unrecognised is
|
|
|
335
337
|
permanent too — so a genuine bug surfaces immediately instead of hiding behind three slow
|
|
336
338
|
attempts. Rate limits, 5xx and raw transport failures are retried.
|
|
337
339
|
|
|
340
|
+
## Clock skew
|
|
341
|
+
|
|
342
|
+
The contracts decide with `block.timestamp`. Everything the SDK derives locally — a
|
|
343
|
+
transaction's `ready` vs `timelocked`, what a caller may do next, whether a recovery period
|
|
344
|
+
has elapsed — predicts that, and a machine whose clock is wrong predicts wrongly.
|
|
345
|
+
Containers, CI runners and VMs resumed from a snapshot drift in ways a desktop usually
|
|
346
|
+
does not.
|
|
347
|
+
|
|
348
|
+
If you have measured the offset, feed it back in:
|
|
349
|
+
|
|
350
|
+
```ts
|
|
351
|
+
const block = await qv.provider.getBlock('latest');
|
|
352
|
+
const skew = Date.now() / 1000 - Number(block.timestamp); // positive: local clock ahead
|
|
353
|
+
|
|
354
|
+
const qv = connect({ network: 'mainnet', now: () => Date.now() / 1000 - skew });
|
|
355
|
+
```
|
|
356
|
+
|
|
357
|
+
A function rather than a scalar offset on purpose: an offset needs a sign convention, and
|
|
358
|
+
getting it backwards doubles the error instead of cancelling it, silently. Here the
|
|
359
|
+
arithmetic sits in your code, where it reads as what it means.
|
|
360
|
+
|
|
361
|
+
Detection is deliberately yours. Deriving the offset costs an RPC call the SDK should not
|
|
362
|
+
make on your behalf, and caching one has no clear invalidation.
|
|
363
|
+
|
|
364
|
+
**This never touches elapsed-time measurement** — retry backoff, timeouts, poll intervals
|
|
365
|
+
and cache TTLs stay on the raw local clock. A clock being 12 seconds fast does not make 30
|
|
366
|
+
seconds of backoff into 18.
|
|
367
|
+
|
|
368
|
+
Nothing here can change an on-chain outcome; the chain is the authority and a wrong local
|
|
369
|
+
time fails safe into a revert or a refusal. What it changes is what the SDK *tells* you,
|
|
370
|
+
which is most of what the SDK is for.
|
|
371
|
+
|
|
338
372
|
## Development
|
|
339
373
|
|
|
340
374
|
```bash
|