-
Notifications
You must be signed in to change notification settings - Fork 46
Web3Modal API v2 spec #239
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
Open
bkrem
wants to merge
29
commits into
main
Choose a base branch
from
feat/w3m-api-v2-spec
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
29 commits
Select commit
Hold shift + click to select a range
6778066
wip
bkrem 116c5c0
Update docs/specs/meta-clients/web3modal/api.md
bkrem 008e4bc
Update docs/specs/meta-clients/web3modal/api.md
bkrem 69cc212
Update docs/specs/meta-clients/web3modal/api.md
bkrem 4591ea2
Update docs/specs/meta-clients/web3modal/api.md
bkrem 267a7cc
chore: tweak title
bkrem cd22163
chore: separate out v1 spec and backlink from v2 spec
bkrem 85153e5
chore: adds missing documentation for ios-data/android-data endpoints
bkrem a1fc82e
chore: adds missing documentation for `token` image endpoint
bkrem 6f7dbfa
chore: adds missing documentation for `currency` endpoint
bkrem d4de975
chore: adds missing documentation for `get-analytics-config` endpoint
bkrem 9c7bc6e
chore: remove redundant `/public/` path segments
bkrem 95d26f0
fix: remove redundant `get-` prefix from `analytics-config` route
bkrem 1e98cea
fix: typo
bkrem 0fff040
feat: adds granular image dimension params to spec
bkrem fcc664a
chore: adds `POST /v2/wallets` endpoint variant
bkrem 87420ad
fix: provide both mobile.deep_link/mobile.universal_link over opaque
bkrem 2d8db88
refactor: simplify GET/POST /v2/wallets` to only `POST` variant
bkrem d84b320
refactor: break out compound `sv=` param into query key for each part
bkrem 00580b2
chore: mandate use of `Accept-Encoding` compression headers
bkrem 9c12054
Update docs/specs/meta-clients/web3modal/api.md
bkrem e0f756c
Update docs/specs/meta-clients/web3modal/api.md
bkrem f23a56d
fix: wording
bkrem 58c9c6d
fix: align query param example keys
bkrem 8812c59
Update docs/specs/meta-clients/web3modal/api.md
bkrem dce37ae
Update docs/specs/meta-clients/web3modal/api.md
bkrem 6d25827
chore: replace page/entries with offset/limit parameters
bkrem dd12fb0
chore: use `coinbaseWalletSDK` identifier
bkrem f7248ba
chore: add env= and os= optional query params
bkrem 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
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 |
|---|---|---|
| @@ -0,0 +1,142 @@ | ||
| # API | ||
|
|
||
| Web3Modal has it's own api available at [api.web3modal.com](https://api.web3modal.com) that is used to fetch wallet data from a WalletConnect maintained [wallet & dapp registry](https://walletconnect.com/explorer). | ||
|
|
||
| All responses are cached for a minimum of 2h. | ||
|
|
||
| ## Headers | ||
|
|
||
| All api requests must contain following headers. See [types](./types.md) | ||
|
|
||
| ```ts | ||
| interface Headers { | ||
| "x-project-id": string; | ||
| "x-sdk-type": SdkType; | ||
| "x-sdk-version": SdkVersion; | ||
| } | ||
| ``` | ||
|
|
||
| ## Methods | ||
|
|
||
| ### GET `/getWallets` | ||
|
|
||
| Returns total count and wallet data, based on provided body inputs. See [types](./types.md). | ||
|
|
||
| ```ts | ||
| interface Request { | ||
| headers: Headers; | ||
| } | ||
|
|
||
| interface UrlQueryParams { | ||
| page: string; // eg. 1 | ||
| entries: string; // eg. 100 | ||
| search?: string; // eg. MetaMa... | ||
| include?: string; // eg. id1,id2,id3 | ||
| exclude?: string; // eg. id1,id2,id3 | ||
| chains?: string; // eg. eip155:1,solana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdp | ||
| platform?: "ios" | "android"; | ||
| } | ||
|
|
||
| interface Response { | ||
chris13524 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| count: number; | ||
| data: Array<{ | ||
| id: string; | ||
| name: string; | ||
| homepage: string; | ||
| image_id: string; | ||
chris13524 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| order: number; | ||
| mobile_link: string | null; | ||
| desktop_link: string | null; | ||
| webapp_link: string | null; | ||
| app_store: string | null; | ||
| play_store: string | null; | ||
| injected: | ||
| | { | ||
| namespace: string; | ||
| injected_id: string; | ||
| }[] | ||
| | null; | ||
| }>; | ||
| } | ||
| ``` | ||
|
|
||
| ### GET `/getWalletImage/:wallet_id` | ||
|
|
||
| Returns image logo for requested `wallet_id`. See [types](./types.md). | ||
|
|
||
| ```ts | ||
| interface Request { | ||
| headers: Headers; | ||
| } | ||
|
|
||
| type Response = Blob; | ||
| ``` | ||
|
|
||
| ### GET `/public/getAssetImage/:asset_id` | ||
|
|
||
| Returns image for public asset for requested `asset_id`, i.e network logo, token logo or connector logo. | ||
|
|
||
| ```ts | ||
| interface Request { | ||
| headers: Headers; | ||
| } | ||
|
|
||
| type Response = Blob; | ||
| ``` | ||
|
|
||
| #### Known Static Asset IDs | ||
|
|
||
| There are a number of known static asset IDs that can be used to fetch images, e.g. for networks and connectors: | ||
|
|
||
| ```typescript | ||
| // Maps EIP155 chain IDs -> `asset_id` | ||
chris13524 marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| const EIP155NetworkImageIds = { | ||
|
Member
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. Ronin is missing |
||
| // Ethereum | ||
| 1: "692ed6ba-e569-459a-556a-776476829e00", | ||
| // Arbitrum | ||
| 42161: "600a9a04-c1b9-42ca-6785-9b4b6ff85200", | ||
| // Avalanche | ||
| 43114: "30c46e53-e989-45fb-4549-be3bd4eb3b00", | ||
| // Binance Smart Chain | ||
| 56: "93564157-2e8e-4ce7-81df-b264dbee9b00", | ||
| // Fantom | ||
| 250: "06b26297-fe0c-4733-5d6b-ffa5498aac00", | ||
| // Optimism | ||
| 10: "ab9c186a-c52f-464b-2906-ca59d760a400", | ||
| // Polygon | ||
| 137: "41d04d42-da3b-4453-8506-668cc0727900", | ||
| // Gnosis | ||
| 100: "02b53f6a-e3d4-479e-1cb4-21178987d100", | ||
| // Evmos | ||
| 9001: "f926ff41-260d-4028-635e-91913fc28e00", | ||
| // ZkSync | ||
| 324: "b310f07f-4ef7-49f3-7073-2a0a39685800", | ||
| // Filecoin | ||
| 314: "5a73b3dd-af74-424e-cae0-0de859ee9400", | ||
| // Iotx | ||
| 4689: "34e68754-e536-40da-c153-6ef2e7188a00", | ||
| // Metis, | ||
| 1088: "3897a66d-40b9-4833-162f-a2c90531c900", | ||
| // Moonbeam | ||
| 1284: "161038da-44ae-4ec7-1208-0ea569454b00", | ||
| // Moonriver | ||
| 1285: "f1d73bb6-5450-4e18-38f7-fb6484264a00", | ||
| // Zora | ||
| 7777777: "845c60df-d429-4991-e687-91ae45791600", | ||
| // Celo | ||
| 42220: "ab781bbc-ccc6-418d-d32d-789b15da1f00", | ||
| // Base | ||
| 8453: "7289c336-3981-4081-c5f4-efc26ac64a00", | ||
| // Aurora | ||
| 1313161554: "3ff73439-a619-4894-9262-4470c773a100", | ||
| }; | ||
|
|
||
| // Maps connector name -> `asset_id` | ||
| const ConnectorImageIds = { | ||
| coinbaseWallet: "0c2840c3-5b04-4c44-9661-fbd4b49e1800", | ||
| safe: "461db637-8616-43ce-035a-d89b8a1d5800", | ||
| ledger: "54a1aa77-d202-4f8d-0fb2-5d2bb6db0300", | ||
| walletConnect: "ef1a1fcf-7fe8-4d69-bd6d-fda1345b4400", | ||
| injected: "07ba87ed-43aa-4adf-4540-9e6a2b9cae00", | ||
| }; | ||
| ``` | ||
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.
Uh oh!
There was an error while loading. Please reload this page.