-
Notifications
You must be signed in to change notification settings - Fork 64
docs: expand TypeScript SDK overview #786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -42,29 +42,65 @@ The Tempo extensions cover common chain operations such as querying state, sendi | |
|
|
||
| Use Viem for Node.js scripts, servers, and other headless applications. | ||
|
|
||
| ### Create a testnet client | ||
| ### Connect to Tempo Testnet and send a stablecoin | ||
|
|
||
| Install Viem: | ||
|
|
||
| ```bash | ||
| npm install viem | ||
| ``` | ||
|
|
||
| Connect to Tempo Testnet and use the [faucet](/docs/quickstart/faucet) to fund the account with test tokens. | ||
| Connect to Tempo Testnet, fund an account, read its pathUSD balance, and send a confirmed transfer. | ||
|
|
||
| ```ts twoslash [testnet.ts] filename="testnet.ts" | ||
| // [!include ~/snippets/node-viem-quickstart.ts:testnet] | ||
| ``` | ||
|
|
||
| :::warning | ||
| This example is testnet-only. For mainnet, use a separately funded mainnet account, omit `testnet: true`, and remove the faucet call. | ||
| This example is testnet-only. For mainnet, use a funded mainnet account and token, omit `testnet: true`, and remove the faucet call. | ||
| ::: | ||
|
|
||
| Tempo actions are grouped by feature under namespaces such as `client.token`, `client.policy`, `client.fee`, `client.dex`, `client.accessKey`, and `client.receivePolicy`. See the [Viem Actions reference](https://viem.sh/tempo/actions) for the full list. | ||
| `balance` includes the amount in base units, the token's decimals, and a formatted value. `transferSync` waits for the transaction to be included; `receipt.transactionHash` identifies the transaction. | ||
|
|
||
| The T3-compatible `viem` release includes the updated access-key ABI, including periodic limits and call scoping. See the [T3 network upgrade](/docs/protocol/upgrades/t3) for migration details. | ||
| The same client includes standard Viem methods such as `getBlockNumber`, `getTransaction`, `getTransactionReceipt`, `getLogs`, `readContract`, and `simulateContract`. | ||
|
|
||
| ### Tempo Transactions | ||
|
|
||
| | Goal | Viem input | Guide | | ||
| | --- | --- | --- | | ||
| | Send multiple calls together | `calls` | [Batch calls](/docs/guide/tempo-transaction#batch-calls) | | ||
| | Pay fees with a chosen token | `feeToken` | [Configurable fee tokens](/docs/guide/tempo-transaction#configurable-fee-tokens) | | ||
| | Let another account pay the fees | `feePayer` | [Fee sponsorship](/docs/guide/tempo-transaction#fee-sponsorship) | | ||
| | Send independent transaction sequences | `nonceKey` | [Concurrent transactions](/docs/guide/tempo-transaction#concurrent-transactions) | | ||
| | Limit when a transaction can run | `validAfter` and `validBefore` | [Scheduled transactions](/docs/guide/tempo-transaction#scheduled-transactions) | | ||
|
|
||
| ### Tempo guides and API reference | ||
|
|
||
| <Cards> | ||
| <Card | ||
| description="Send and accept stablecoins, attach memos, and configure payment controls" | ||
| to="/docs/guide/payments" | ||
| icon="lucide:send" | ||
| title="Payments" | ||
| /> | ||
| <Card | ||
| description="Launch and operate a TIP-20 stablecoin" | ||
| to="/docs/guide/issuance" | ||
| icon="lucide:coins" | ||
| title="Stablecoin Issuance" | ||
| /> | ||
| <Card | ||
| description="Trade stablecoins and provide liquidity" | ||
| to="/docs/guide/stablecoin-dex" | ||
| icon="lucide:arrow-left-right" | ||
| title="Stablecoin Exchange" | ||
| /> | ||
| <Card | ||
| description="Use fee tokens, sponsorship, batching, access keys, and concurrent transactions" | ||
| to="/docs/guide/tempo-transaction" | ||
| icon="lucide:workflow" | ||
| title="Tempo Transactions" | ||
| /> | ||
| <Card | ||
| description="Viem Actions for querying data, sending transactions, managing tokens & AMM pools, and more" | ||
| to="https://viem.sh/tempo/actions" | ||
|
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. we should keep a link to tempo actions |
||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preserve
#create-a-testnet-clientwhen renaming this heading; otherwise existing bookmarks and external links to/docs/sdk/typescript#create-a-testnet-clientno longer reach the intended section. Add the old ID as an explicit anchor or alias while retaining the new heading text.AGENTS.md reference: AGENTS.md:L66-L70
Useful? React with 👍 / 👎.