Skip to content
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

jasper-edits #94

Open
wants to merge 136 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
136 commits
Select commit Hold shift + click to select a range
a7bc162
feat(studio): Add Apollo sandbox for API
croberge1 Oct 1, 2024
1bfdf8b
Redirect to new page
croberge1 Oct 1, 2024
e5911fe
cleanup
croberge1 Oct 1, 2024
023e715
show headers for now
croberge1 Oct 1, 2024
4cb7666
Add public API key
croberge1 Oct 2, 2024
7d621ae
usused dependency
croberge1 Oct 2, 2024
f32e431
cleanup
croberge1 Oct 2, 2024
c7fee1a
cleanup lockfiele
croberge1 Oct 2, 2024
6a7e465
wow
jasperstuffs Nov 6, 2024
5427797
next
jasperstuffs Nov 6, 2024
7ee06c7
make new folder
jasperstuffs Nov 6, 2024
7f4d717
change name
jasperstuffs Nov 6, 2024
50fb0d9
test
jasperstuffs Nov 6, 2024
c3427b4
add more sub folders
jasperstuffs Nov 6, 2024
d013c10
remove double title
jasperstuffs Nov 6, 2024
3fe7baa
more sub folders
jasperstuffs Nov 6, 2024
f9d7ce7
fix name
jasperstuffs Nov 6, 2024
a9de7fa
fix
jasperstuffs Nov 6, 2024
684f041
test scroll navigation
jasperstuffs Nov 6, 2024
8444144
test
jasperstuffs Nov 6, 2024
99d2eeb
adding h2
jasperstuffs Nov 6, 2024
58851e9
fix
jasperstuffs Nov 6, 2024
fc4554c
fix top nav
jasperstuffs Nov 6, 2024
64de1e0
maybe fix?
jasperstuffs Nov 6, 2024
a326451
try again
jasperstuffs Nov 6, 2024
1ecb82f
test cards
jasperstuffs Nov 6, 2024
dccaeee
fix that
jasperstuffs Nov 6, 2024
b3157fa
add beta tag
jasperstuffs Nov 6, 2024
8a87212
add overview text
jasperstuffs Nov 6, 2024
db8cc68
adjust
jasperstuffs Nov 6, 2024
e0cbf6f
test divider
jasperstuffs Nov 6, 2024
597a424
test code snippet
jasperstuffs Nov 6, 2024
bbaa62a
collapse interpretation by default
jasperstuffs Nov 6, 2024
b139ed9
HRT rough draft
jasperstuffs Nov 6, 2024
983daaa
change name
jasperstuffs Nov 6, 2024
b11bd1b
fix
jasperstuffs Nov 6, 2024
851abc9
more content
jasperstuffs Nov 6, 2024
a81d2ee
updated content
jasperstuffs Nov 7, 2024
a54b815
add queries
jasperstuffs Nov 7, 2024
b5810c6
fix italic
jasperstuffs Nov 7, 2024
7cf059f
Adjust
jasperstuffs Nov 7, 2024
73d7981
fix order
jasperstuffs Nov 7, 2024
8392e89
edit
jasperstuffs Nov 7, 2024
ae08b55
make link nice
jasperstuffs Nov 7, 2024
f8434b2
fink link
jasperstuffs Nov 7, 2024
0ea741e
test
jasperstuffs Nov 7, 2024
be74c83
new
jasperstuffs Nov 7, 2024
99ec541
add line
jasperstuffs Nov 7, 2024
f5928b8
add notes ui
jasperstuffs Nov 7, 2024
dc9d3c4
test table
jasperstuffs Nov 7, 2024
13dc557
edit
jasperstuffs Nov 7, 2024
2d29b3d
more tables
jasperstuffs Nov 7, 2024
c6816d6
more edits
jasperstuffs Nov 7, 2024
eea1300
changes
jasperstuffs Nov 7, 2024
7f6efc7
more stuff
jasperstuffs Nov 7, 2024
8a5e2fa
change
jasperstuffs Nov 7, 2024
cb8329f
fix
jasperstuffs Nov 7, 2024
6988d8e
fix table
jasperstuffs Nov 7, 2024
e45ab8f
titles
jasperstuffs Nov 7, 2024
935efa1
job status
jasperstuffs Nov 7, 2024
004c1a1
test
jasperstuffs Nov 7, 2024
b61ed90
example
jasperstuffs Nov 7, 2024
f6b5fba
tip
jasperstuffs Nov 7, 2024
644950f
descriptions
jasperstuffs Nov 7, 2024
bbfe76f
more
jasperstuffs Nov 7, 2024
b9944cc
fix
jasperstuffs Nov 7, 2024
584444d
fix
jasperstuffs Nov 7, 2024
849b96a
tiny change
jasperstuffs Nov 7, 2024
a7a066b
even smaller
jasperstuffs Nov 7, 2024
49b70d1
order
jasperstuffs Nov 7, 2024
14a8cbd
ttest
jasperstuffs Nov 7, 2024
66885ac
messaging
jasperstuffs Nov 7, 2024
95276dd
Chains
jasperstuffs Nov 7, 2024
c5e9cd4
app
jasperstuffs Nov 7, 2024
d3eca08
add sandbox placeholders
jasperstuffs Nov 7, 2024
4c79823
descriptions not done
jasperstuffs Nov 7, 2024
02c744b
more descriptions
jasperstuffs Nov 7, 2024
25359ea
test collapsable row
jasperstuffs Nov 7, 2024
b662435
more descriptions
jasperstuffs Nov 7, 2024
66fa321
powerful
jasperstuffs Nov 7, 2024
01ade5c
edit
jasperstuffs Nov 7, 2024
b5c1ef8
remove onchain prices
jasperstuffs Nov 7, 2024
2935999
cleaner placeholder for field/argument descriptions that haven't been…
jasperstuffs Nov 7, 2024
3800cb8
smol
jasperstuffs Nov 7, 2024
a574b75
applications
jasperstuffs Nov 7, 2024
9e2e282
spacing
jasperstuffs Nov 7, 2024
e2bd531
test
jasperstuffs Nov 7, 2024
8824269
Fixes
jasperstuffs Nov 7, 2024
33c90dd
Identity
jasperstuffs Nov 7, 2024
3e374a3
App Balances
jasperstuffs Nov 7, 2024
945febe
human
jasperstuffs Nov 7, 2024
406151f
remove
jasperstuffs Nov 7, 2024
7eaaf2f
Merge branch 'studio-add-apollo-sandbox' into add-sanbox-to-v2-api-docs
croberge1 Nov 7, 2024
ac9ddf1
test
jasperstuffs Nov 7, 2024
409c624
changes
jasperstuffs Nov 7, 2024
9fc0dfb
lets see what breaks
jasperstuffs Nov 7, 2024
d4d2ef8
Collapsible Sections
jasperstuffs Nov 7, 2024
ffd21da
Format
jasperstuffs Nov 7, 2024
584e469
add new formatting
jasperstuffs Nov 7, 2024
bd60944
remove code snippet bc sanbox is better
jasperstuffs Nov 7, 2024
c7335bd
move notes
jasperstuffs Nov 7, 2024
1f7816d
padding
jasperstuffs Nov 7, 2024
87254d7
try it
jasperstuffs Nov 7, 2024
cbf8744
move note
jasperstuffs Nov 7, 2024
d2e305a
subtitle
jasperstuffs Nov 7, 2024
042f41e
OCP
jasperstuffs Nov 7, 2024
72dfcca
gql
jasperstuffs Nov 7, 2024
a1de1e1
custom queries for sanbox
croberge1 Nov 8, 2024
5385dd6
kebab
jasperstuffs Nov 8, 2024
b064017
test
jasperstuffs Nov 8, 2024
2606b63
well im an idiot
jasperstuffs Nov 8, 2024
7f939e0
edit
jasperstuffs Nov 8, 2024
b31f241
try title
jasperstuffs Nov 8, 2024
05a2d66
titles fix
jasperstuffs Nov 8, 2024
b666c5a
fix links
jasperstuffs Nov 8, 2024
8b81aa7
Token Balances
jasperstuffs Nov 8, 2024
e07c6f2
some more fields
jasperstuffs Nov 12, 2024
a49ba8b
try code
jasperstuffs Nov 12, 2024
f26b28b
code
jasperstuffs Nov 12, 2024
1e8abc7
fix
jasperstuffs Nov 12, 2024
504b2a9
change
jasperstuffs Nov 12, 2024
61f81f0
make better
jasperstuffs Nov 12, 2024
b63cda1
add identity example
jasperstuffs Nov 12, 2024
014caf4
fix
jasperstuffs Nov 12, 2024
0c5a97f
fixv2
jasperstuffs Nov 12, 2024
99098f0
change name
jasperstuffs Nov 12, 2024
92a10a2
Wallet Holdigns example
jasperstuffs Nov 12, 2024
3fb05d7
add totals
jasperstuffs Nov 12, 2024
d626973
wif
jasperstuffs Nov 12, 2024
df1c6f1
fix
jasperstuffs Nov 12, 2024
0e89ba9
data
jasperstuffs Nov 12, 2024
9cc762d
wording
jasperstuffs Nov 12, 2024
6778240
identity primitive
jasperstuffs Nov 12, 2024
0078ea9
fix
jasperstuffs Nov 12, 2024
8688b22
accounts query
jasperstuffs Nov 12, 2024
648c0ac
woop
jasperstuffs Nov 12, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/Interpretation/_category_.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"label": "Interpretation",
"position": 2,
"collapsible": true,
"collapsed": false
"collapsed": true
}
54 changes: 0 additions & 54 deletions docs/api-intro.md

This file was deleted.

6 changes: 6 additions & 0 deletions docs/api-intro/_category_.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"label": "API",
"position": 4,
"collapsible": true,
"collapsed": true
}
47 changes: 47 additions & 0 deletions docs/api-intro/api-intro.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
---
sidebar_position: 1
---
import ApolloSandboxComponent from '@site/src/components/ApolloSandboxComponent';


# Getting Started


Access powerful onchain data curated by the Zapper protocol with a GraphQL API for your applications.

---

## What do I get?

#### [Human-Readable Transactions](/docs/api-intro/human-readable-transactions)

Simplify onchain transactions with human-friendly descriptions.

#### [Onchain Identity](/docs/api-intro/onchain-identity)

Enrich your app by surfacing onchain identity such as avatars, ENS, Farcaster, and more.


#### [Portfolio Balances](/docs/api-intro/token-balances)

A set of portfolio queries to fetch tokens, NFTs, DeFi Positions, and other App Balances.


#### [Onchain Prices](/docs/api-intro/app-balances)

A price for every token that has an onchain market, including historical data.

## Get an API key

Visit the **[Dashboard](/dashboard)** to get your API key.

## Buy credits

Zapper API uses a credit system to manage how many queries an API key can perform. Each query made costs a certain amount of credits, and these credits are deducted from your credit balance.

You can track your usage and purchase additional credits on the API **[Dashboard](/dashboard)**


## Try it in Sandbox

<ApolloSandboxComponent />
119 changes: 119 additions & 0 deletions docs/api-intro/app-balances.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
---
sidebar_position: 4
sidebar_label: App Balances
---

import ApolloSandboxComponent from '@site/src/components/ApolloSandboxComponent';

export const appBalancesQuery = `query Portfolio($addresses: [Address!]!) {
portfolio(addresses: $addresses) {
appBalances {
address
appName
balanceUSD
network
products {
label
assets {
address
}
}
}
}
}`;

export const appBalancesVars = {
"addresses": ["0xd8da6bf26964af9d7eed9e03e53415d37aa96045"]
};

# App Balances

Surfaces balances that a user might hold inside of an onchain application. Use cases include showing DeFi positions, claimables, or portfolio tracking.

---



### `appBalances`

The `appBalances` query takes an `address` with optional `networks` or `appIds` and returns fields such as `appId`, `appName`, `balanceUSD`, `assets`, `label` and other data useful for app balance use cases.


### Common Uses

##### App Holdings

Imagine you want to surface all positions a user has across in every onchain app they have used for a particular network. You would pass `address` for the user and `network` for the selected chain returning the `appBalances` object, with fields such as `address`, `appName`, `balanceUSD`, `network`, and `products`. Example of the response below:


```json
{
"address": "0xe321bd63cde8ea046b382f82964575f2a5586474",
"appName": "Aave V3",
"balanceUSD": 46.05200420761579,
"network": "OPTIMISM_MAINNET",
"products": [
{
"label": "Lending",
"assets": [
{
"address": "0x513c7e3a9c69ca3e22550ef58ac1c0088e918fff"
},
{
"address": "0x625e7708f30ca75bfd92586e17077590c60eb4cd"
},
{
"address": "0xe50fa9b3c56ffb159cb0fca61f5c9d750e8128c8"
}
}
}
```


### Sandbox

<ApolloSandboxComponent
query={appBalancesQuery}
variables={appBalancesVars}
/>


:::note

Smart accounts accounts like Maker’s `DSProxy` are automatically included in the balance response as part of an “implicit” bundle.

Typically, a single transaction generates multiple timeline events: one for each wallet impacted by the transaction and one for the associated application, if any.

:::

### Reference

<details>
<summary>Arguments for appBalances</summary>

| Argument | Description | Type |
| ----------- | ----------- | ----------- |
| `address` | Addresses for which to retrieve balances, inputted as an array. | `String!` |
| `networks` | Networks for which to retrieve balances, inputted an array. | `Network!` |
| `appIds` | Filter by a specific app. | `String!` |
| `withOverrides` | - | `Boolean = false` |

</details>

<details>
<summary>Fields for appBalances</summary>


| Field | Description | Type |
| ----------- | ----------- | ----------- |
| `key` | Description goes here. | `String!` |
| `address` | Address the position queried is for | `String!` |
| `appId` | ID of the app | `String!` |
| `appName` | Display name of app | `String!` |
| `appImage` | Icon of the app | `String!` |
| `network` | Network(s) the app is on. | `Network!` |
| `updatedAt` | Timestamp at which time this wallet's balance for this app was calculated | `Timestamp!` |
| `balanceUSD` | Value of all positions associated with this app on this network for this wallet, in USD | `Float!` |
| `products` | Object containing details on all products owned by this wallet | `ProductItem!` |

</details>
135 changes: 135 additions & 0 deletions docs/api-intro/human-readable-transactions.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
---
sidebar_position: 1
sidebar_label: Human-Readable Transactions
---
import ApolloSandboxComponent from '@site/src/components/ApolloSandboxComponent';

export const accountsTimelineQuery = `query($addresses: [Address!]) {
accountsTimeline(addresses: $addresses) {
edges {
node {
transaction {
fromUser {
address
displayName {
value
}
}
toUser {
displayName {
value
}
}
}
interpretation {
processedDescription
}
}
}
}
}`;

export const accountsTimelineVariables = {
"addresses": [
"0xd8da6bf26964af9d7eed9e03e53415d37aa96045",
"0x6f6e75fb472ee39d847d825cc7c9a613e227e261"
]
};

# Human-Readable Transactions


Presents onchain activity in a simple descriptive summary including references to dynamic elements of the transaction such as tokens, NFTs, and accounts. Great for use in account histories, social feeds, or app specific feeds.

---

### `accountsTimeline`

The `accountsTimeline` query returns a descriptive and human-readable summary of the transaction's details from one or multiple wallets, along with tokens transferred, paginated, chain-agnostic. Typically, a single transaction generates multiple timeline events: one for each wallet impacted by the transaction and one for the associated application, if any.

### Common Uses

##### Transaction History

Let's say you want to show users an activity feed for their onchain transactions in a human-readable format with network and app information. You would pass `addresses` for the user and return `processedDescription`, `network`, and `app`. Part of the response below:

```json
{
"fromUser": {
"address": "0x52c8ff44260056f896e20d8a43610dd88f05701b",
"displayName": {
"value": "0xjasper.eth"
}
}

"interpretation": {
"processedDescription": "Started battle with sebaudet.eth"
},

"network": "BASE_MAINNET"

"app": {
"name": "Tokiemon",
},
}
```

:::note
Textual description of each transaction is presented from the perspective of the signer. Events with descriptions such as "Did something with …" indicate that an interpreter for that type of onchain interaction is not available, yet.
:::

### Sandbox

<ApolloSandboxComponent
query={accountsTimelineQuery}
variables={accountsTimelineVariables}
/>

### Reference

<details>
<summary>Arguments for accountsTimeline</summary>

| Argument | Description | Type |
| ----------- | ----------- | ----------- |
| `network` | Networks for which to retrieve, inputted as an array. | `Network!` |
| `realtimeInterpretation` | Human-readable transactions, default is on | `Boolean = true` |
| `addresses` | Addresses to retrive, inputted as an array. | `String!` |
| `tokenAddresses` | Filter by token address | `Address!` |
| `isSigner` | Filter by signer | `Boolean` |
| `spamFilter` | Filter for spam, default is on | `Boolean = true` |
| `first` | - | `Int!` |
| `after` | - | `String!` |



</details>

<details>
<summary>Fields for accountsTimeline</summary>


| Field | Description | Type |
| ----------- | ----------- | ----------- |
| `key` | A unique identifier. | `String!` |
| `network` | Network on which the transaction happened. | `Network!` |
| `processedDescription` | The human-readble description of the transaction. | `ActivityInterpretation!` |
| `transaction` | Contains onchain information like `nounce` , `hash`, `blockNumber`, `gasPrice` and more. | `OnChainTransaction!` |
| `app` | The app that is associate with the transaction. | `Int!` |
| `fromUser` | The address that the transaction was initiated from. | `Int!` |
| `toUser` | The address that the transaction interacted with. | `Int!` |
| `displayName` | Returns the display name of an address (ENS, Farcaster, Lens, etc.). | `Int!` |
| `source` | - | `String!` |
| `eventType` | Returns the event type. | `String!` |
| `isAbiAvailable` | - | `Boolean!` |
| `isEditable` | - | `Boolean!` |
| `interpreterId` | - | `String!` |
| `interpreter` | - | `ActivityEventInterpreter!` |
| `actors` | - | `ActorDisplayItem!` |
| `timestamp` | - | `Timestamp!` |
| `perspective` | - | `ActivityPerspective!` |
| `similarEventCount` | - | `String!` |
| `perspectiveDelta` | - | `ActivityAccountDelta!` |
| `sigHash` | - | `String!` |

</details>
Loading