feat(sdk): add EthereumService with viem contract instances for all Audius ETH contracts#13929
feat(sdk): add EthereumService with viem contract instances for all Audius ETH contracts#13929rickyrombo merged 16 commits intomainfrom
Conversation
|
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 4714545 | Triggered | Generic High Entropy Secret | c567e27 | packages/sdk/src/sdk/config/development.ts | View secret |
| 10622417 | Triggered | Generic High Entropy Secret | c567e27 | packages/sdk/src/sdk/config/development.ts | View secret |
| 1606950 | Triggered | Generic High Entropy Secret | b46317f | packages/sdk/src/sdk/config/production.ts | View secret |
| 10622416 | Triggered | Generic High Entropy Secret | c567e27 | packages/sdk/src/sdk/config/production.ts | View secret |
| 1606950 | Triggered | Generic High Entropy Secret | c567e27 | packages/sdk/src/sdk/config/production.ts | View secret |
| 2460750 | Triggered | Generic High Entropy Secret | c567e27 | packages/sdk/src/sdk/config/production.ts | View secret |
| 10622416 | Triggered | Generic High Entropy Secret | b46317f | packages/sdk/src/sdk/config/production.ts | View secret |
| 10622417 | Triggered | Generic High Entropy Secret | b46317f | packages/sdk/src/sdk/config/development.ts | View secret |
| 4714545 | Triggered | Generic High Entropy Secret | b46317f | packages/sdk/src/sdk/config/development.ts | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secrets safely. Learn here the best practices.
- Revoke and rotate these secrets.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
🦋 Changeset detectedLatest commit: 7794bbd The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
…udius ETH contracts Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…iusTokenAddress Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…ervices - Add ethWalletClient and ethPublicClient as injectable overrides in ServicesContainer - createSdkWithServices uses injected clients when building EthereumService, then exposes them on the returned container via ethereum.ethWalletClient / .publicClient - Web audiusSdk.ts only injects ethWalletClient (identity relay) — no longer needs to construct EthereumService manually - WalletClient.ts uses ethereum.audiusWormhole.address instead of importing AudiusWormhole from @audius/eth directly - Remove @audius/eth from packages/common dependencies Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Consistent with publicClient — both are unprefixed inside EthereumService since the eth context is already implied by the class name. ServicesContainer retains ethWalletClient/ethPublicClient for disambiguation. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
getAddress() already returns Address (0x${string}), no cast needed.
Also drops unused Hex import from both files.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…t to EthereumService Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…alletClient Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
ceb8211 to
a6a46cf
Compare
Conflict resolution during rebase accidentally changed sdk() — revert to createSdkWithServices which wires up EthereumService automatically. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…diusBackend Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
🌐 Web preview readyPreview URL: https://audius-web-preview-pr-13929.audius.workers.dev Unique preview for this PR (deployed from this branch). |
Summary
EthereumService— a new SDK service exposing viem contract instances for all 10 Audius Ethereum contracts (AudiusToken, AudiusWormhole, Staking, DelegateManager, Governance, ServiceProviderFactory, ClaimsManager, EthRewardsManager, ServiceTypeManager, TrustedNotifierManager)getDefaultEthereumServiceConfig+mergeConfigWithDefaultsfor config, with per-environment address overridespublicClient,ethWalletClient, andaudiusWalletClientare constructor params onEthereumService; no longer separate fields onServicesContainersdk.services.ethereum.<contract>.read.*directly instead of one-off helper functions@audius/commonethereum wrapper — deletedpackages/common/src/services/ethereum/ethereum.ts;AudiusBackend.tsanduseAudioBalance.tsnow usesdk.services.ethereumcontracts directlyethWalletClientfor web — web'saudiusSdk.tsinjects a customEthereumServicewith a viem wallet client that proxies writes throughIDENTITY_SERVICE/ethereum/rpcso identity pays gas feesKey design decisions
getContract({ client: { public, wallet } })gives every contract instance both.read.*and.simulate.*(and.write.*) without needing to thread clients through every call siteGetContractReturnType<Abi, { public: PublicClient; wallet: WalletClient }>annotations on contract properties — avoids TypeScript "type too large to serialize" errors from inferenceaudiusWalletClientstored privately onEthereumService;permitAudioTokenandwormholeTransferTokensuse it directly for typed-data signing with no extra parametersTest plan
npm run typecheckinpackages/web)npm run typecheckinpackages/common)npm run typecheckinpackages/sdk)audiusToken.read.balanceOf,staking.read.totalStakedFor,delegateManager.read.getTotalDelegatorStake)🤖 Generated with Claude Code