mirror of
https://github.com/luxfi/safe-wallet.git
synced 2026-10-30 15:19:21 +00:00
* chore: migrate tx-builder from safe-apps repo to this monorepo create-react-app is deprecated and I’ve migrated the code to vite. web3 is deprecated and I’ve moved the code to ethersjs the cypress tests were broken and I dropped them original code used mui4 -> here we’ve migrated to mui6 * fix(tx-builder): remove build from tx-builder * fix(tx-builder): vite config * fix(tx-builder): linting * fix(tx-builder): fix typo * fix(tx-builder): don’t mutate array * fix(tx-builder): fix exponential backtracking * fix(tx-builder): git workflows * fix(tx-builder): fix lint setup * fix(tx-builder): align package dependencies * fix(tx-builder): invalid react-dom version * fix(tx-builder): git workflow * fix(tx-builder): drag and drop was not working react-beautiful-dnd was no longer supported and it was not compatible with react 19. Moved to @hello-pangea/dnd * fix(tx-builder): fix pallet issues
1.5 KiB
1.5 KiB
External APIs
Etherscan API
Used for fetching contract ABIs when not available from Safe Gateway.
Get Contract ABI
GET https://api.etherscan.io/api
?module=contract
&action=getabi
&address={contractAddress}
&apikey={apiKey}
Response:
{
"status": "1",
"message": "OK",
"result": "[{\"constant\":true,...}]"
}
Network Endpoints
| Chain | Endpoint |
|---|---|
| Ethereum | api.etherscan.io |
| Goerli | api-goerli.etherscan.io |
| Polygon | api.polygonscan.com |
| Arbitrum | api.arbiscan.io |
| Optimism | api-optimistic.etherscan.io |
| Base | api.basescan.org |
Sourcify API
Alternative source for verified contract ABIs.
Get Contract Metadata
GET https://sourcify.dev/server/files/any/{chainId}/{address}
Response includes full contract metadata with ABI.
RPC Endpoints
tx-builder uses the Safe Apps SDK's built-in provider, which proxies through the Safe{Wallet} host application. Direct RPC calls are made for:
- Reading contract state (view/pure functions)
- Estimating gas
- Detecting proxy implementations
The provider is accessed via:
import { useSafeAppsSDK } from '@safe-global/safe-apps-react-sdk'
import { SafeAppProvider } from '@safe-global/safe-apps-provider'
const { sdk, safe } = useSafeAppsSDK()
const provider = new SafeAppProvider(safe, sdk)