-
Notifications
You must be signed in to change notification settings - Fork 13
WDK Core Documentation Refactor #64
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
base: develop
Are you sure you want to change the base?
WDK Core Documentation Refactor #64
Conversation
lucas-tortora
left a comment
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.
Beautiful PR :) Just a few comments regarding style and structure.
| {% endcode %} | ||
|
|
||
| {% hint style="info" %} | ||
| The WDK instance caches accounts. calling `getAccount` twice for the same index returns the same object instance. |
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.
| The WDK instance caches accounts. calling `getAccount` twice for the same index returns the same object instance. | |
| The WDK instance caches accounts. If you call `getAccount` twice using the same index, the function will return the same `Account` object instance. |
| {% hint style="warning" %} | ||
| **Network Mismatch Warning** | ||
| Ensure your WDK instance configuration matches your account environment. | ||
| * If using **Testnet** keys, ensure you registered the wallet with a **Testnet RPC**. |
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.
Please add links to the RPCs
| Ensure your WDK instance configuration matches your account environment. | ||
| * If using **Testnet** keys, ensure you registered the wallet with a **Testnet RPC**. | ||
| * If using **Mainnet** keys, ensure you registered the wallet with a **Mainnet RPC**. | ||
| Using a Mainnet key on a Testnet RPC (or vice versa) will result in "Network not allowed" or 0 balance errors. |
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.
| Using a Mainnet key on a Testnet RPC (or vice versa) will result in "Network not allowed" or 0 balance errors. | |
| Using a Mainnet key on a Testnet RPC (or vice versa) will result in "Network not allowed" or zero balance errors. |
We should spell out numbers unless they are being used in opertions.
|
|
||
| ## View Addresses | ||
|
|
||
| Once you have an account object, you can retrieve its public blockchain address. |
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.
| Once you have an account object, you can retrieve its public blockchain address. | |
| Once you have an account object, you can retrieve its public blockchain address using the `getAddress` function. |
|
|
||
| ## Check Balances | ||
|
|
||
| You can check the native token balance of any account (e.g., ETH on Ethereum, TON on TON). |
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.
| You can check the native token balance of any account (e.g., ETH on Ethereum, TON on TON). | |
| You can check the native token balance of any account (e.g., ETH on Ethereum, TON on TON) by using the `getBalance()` function. |
| ## Multi-Chain Transactions | ||
|
|
||
| You can orchestrate payments across different chains in a single function by acting on multiple account objects sequentially. | ||
|
|
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.
| The following example will: | |
| 1. Retrieve an ETH and ton account using the `getAccount()` method. | |
| 2. Send ETH and `await` the transaction. | |
| 3. Send TON and `await` the transaction. |
| npm install @tetherto/wdk-wallet-evm @tetherto/wdk-wallet-ton @tetherto/wdk-wallet-btc | ||
| ``` | ||
|
|
||
| ## Example: Registering Multiple Wallets |
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.
| ## Example: Registering Multiple Wallets | |
| ## Register Multiple Wallets |
|
|
||
| ## Installation | ||
|
|
||
| Install the wallet managers for the blockchains you want to support: |
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.
Please add link to the wallet modules home page.
| ``` | ||
|
|
||
| ## Example: Registering Multiple Wallets | ||
|
|
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.
| ### Import the Wallet Manager Packages | |
| ``` | ||
| {% endcode %} | ||
|
|
||
| Then, instantiate WDK and chain the registration calls: |
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.
| Then, instantiate WDK and chain the registration calls: | |
| ### Register the Wallets | |
| Then, instantiate WDK and chain the registration calls: |
Please add link to the instantiate doc
lucas-tortora
left a comment
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.
Beautiful PR :) Just a few comments regarding style and structure.
This PR refactors the monolithic sdk/core-module/usage.md into 8 granular "How-to" guides.
This refactor was validated using a "User Zero" approach: verification was performed by explicitly following the newly created guides step-by-step from a fresh state to ensure accuracy and reproducibility. During this process, several critical gaps and inaccuracies were identified and resolved.
Resolved Issues
1. Replaced Unavailable TON Bridge
@tetherto/wdk-protocol-bridge-usdt0-tonis not available on NPM.@tetherto/wdk-protocol-bridge-usdt0-evmpackage in protocol-integration.md.2. Corrected Failover Middleware
@tetherto/wdk-wrapper-failover-cascadewere incorrect (404).@tetherto/wdk-provider-failoverwith the correctcreateFallbackWalletwrapper pattern (moved out ofregisterMiddleware).Corrections & Value Additions
2. Configuration Corrections (TON)
tonApiKey,tonApiEndpoint) but the SDK requires a nestedtonClientobject.https://t.me/toncenter) and their docs (https://docs.ton.org/...) in guides/wallet-registration.md.3. Functional Verification Fixes
npm installsteps for wallet and protocol packages.UQCz5ON7jj...).4. Visual & Style Improvements
{% hint style="info" %}) for consistent rendering.File Changes
sdk/core-module/guides/*.mdcreateFallbackWalletwrapper pattern)Verification Report
@tetherto/wdksuccessfully.registerMiddleware).dispose()functionality.