Skip to content

Commit

Permalink
updated docs (#33)
Browse files Browse the repository at this point in the history
* updated docs

* updated the tab name for providing additional target support
  • Loading branch information
moskalyk authored Apr 10, 2024
1 parent 7775dc6 commit 9a468d9
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 191 deletions.
47 changes: 0 additions & 47 deletions docs/components/TabGroup.tsx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
import { TabGroup, Tab, TabPanel } from "../../../../../components/TabGroup.tsx";
import { Callout } from "vocs/components";

## GetTopOrders

import { Callout } from "vocs/components";

Query the protocol for the top order based on various filters.

Fetch the top orders from the protocol, optionally excluding those created by a specific user.
Expand Down Expand Up @@ -40,11 +38,10 @@ Fetch the top orders from the protocol, optionally excluding those created by a
- `orderbookContractAddress` (string) -- the orderbook contract address
]

<TabGroup>
<Tab>curl</Tab>
<TabPanel>
```bash class=wrap
curl --request POST \
:::code-group

```shell twoslash [curl] filename="curl"
curl --request POST \
--url https://dev-marketplace-api.sequence.app/arbitrum-sepolia/rpc/Marketplace/GetTopOrders \
--header 'Content-Type: application/json' \
--data '{
Expand All @@ -57,12 +54,9 @@ Fetch the top orders from the protocol, optionally excluding those created by a
"isListing": true,
"priceSort": "DESC"
}'
```
</TabPanel>
<Tab>js</Tab>
<TabPanel>
```

```ts
```ts twoslash [js]
// Works in both a Webapp (browser) or Node.js:
import fetch from "cross-fetch";

Expand All @@ -88,14 +82,10 @@ import fetch from "cross-fetch";
})();
```

</TabPanel>
<Tab>other</Tab>
<TabPanel>
Please [contact our team](/support) for assistance with integrations to another target.
</TabPanel>
</TabGroup>
```shell twoslash [other]
Please contact our team for assistance with integrations to another target.
```
:::

### Example implementation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { Callout } from "vocs/components";
import { TabGroup, Tab, TabPanel } from "../../../../../components/TabGroup.tsx";

## GetOrderbookOrders

Expand Down Expand Up @@ -58,11 +57,10 @@ _Sequence Orderbook `GetOrderbookOrders` Method:_
`max` is required to have orders appear in the query
</Callout>

<TabGroup>
<Tab>curl</Tab>
<TabPanel>

```bash class=wrap
:::code-group
```shell twoslash [curl] filename="curl"

curl --request POST \
--url https://dev-marketplace-api.sequence.app/arbitrum-sepolia/rpc/Marketplace/GetOrderbookOrders \
--header 'Content-Type: application/json' \
Expand Down Expand Up @@ -93,13 +91,9 @@ curl --request POST \
},
"orderbookContractAddress": "0xB537a160472183f2150d42EB1c3DD6684A55f74c"
}'
```
```

</TabPanel>
<Tab>js</Tab>
<TabPanel>

```ts
```js twoslash [js]
// Works in both a Webapp (browser) or Node.js:
import fetch from "cross-fetch";

Expand Down Expand Up @@ -136,15 +130,10 @@ import fetch from "cross-fetch";
})();
```

</TabPanel>
<Tab>other</Tab>
<TabPanel>

Please [contact our team](/support) for assistance with integrations to another target.

</TabPanel>

</TabGroup>
```shell twoslash [other]
Please contact our team for assistance with integrations to another target.
```
:::

### Example implementation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { TabGroup, Tab, TabPanel } from "../../../../../components/TabGroup.tsx";

## GetUserActivities

Retrieve activity data for a specific user, including orders and trades.
Expand Down Expand Up @@ -36,11 +34,10 @@ Retrieve activity data for a specific user, including orders and trades.

**Example: `GetUserActivities` for a user with specific token IDs**

<TabGroup>
<Tab>curl</Tab>
<TabPanel>

```bash class=wrap

:::code-group

```shell twoslash [curl] filename="curl"
curl -X POST -H "Content-Type: application/json" https://dev-marketplace-api.sequence.app/arbitrum-sepolia/rpc/Marketplace/GetUserActivities -d '{
"orderbookContractAddress": "0xB537a160472183f2150d42EB1c3DD6684A55f74c",
"collectionAddress": "0x1693ffc74edbb50d6138517fe5cd64fd1c917709",
Expand All @@ -51,12 +48,8 @@ curl -X POST -H "Content-Type: application/json" https://dev-marketplace-api.seq
"tokenIDs": ["1"]
}'

````
</TabPanel>
<Tab>js</Tab>
<TabPanel>

```ts
```
```js twoslash [js]
// Works in both a Webapp (browser) or Node.js:
import fetch from "cross-fetch";

Expand All @@ -82,15 +75,11 @@ import fetch from "cross-fetch";

console.log("res", await res.json());
})();
````
</TabPanel>
<Tab>other</Tab>
<TabPanel>
Please [contact our team](/support) for assistance with integrations to another target.
</TabPanel>
```

</TabGroup>
```shell twoslash [other]
Please contact our team for assistance with integrations to another target.
```

### Example implementation

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
import { TabGroup, Tab, TabPanel } from "../../../../../components/TabGroup.tsx";

# Wallet Configuration

Every Sequence wallet has a configuration defined by a threshold and a list of signers with their corresponding weights.
Expand Down Expand Up @@ -64,35 +62,31 @@ Wallets that never have been updated don't store the `imageHash` directly, inste

#### Compute image hash

<TabGroup>
<Tab>Solidity</Tab>
<TabPanel>
```
keccak256(abi.encode( uint8 weight_1, address signer_1,
keccak256(abi.encode( uint8 weight_2, address signer_2,
keccak256(abi.encode( uint8 weight_3, address signer_3,
keccak256(abi.encode( uint256 threshold )) )) )) ))
```
</TabPanel>
<Tab>Javascript</Tab>
<TabPanel>
```ts
let tmp = ethers.utils.solidityPack(['uint256'], [configuration.threshold])

for (const signer of configuration.signers) {
tmp = ethers.utils.keccak256(
ethers.utils.defaultAbiCoder.encode(
['bytes32', 'uint8', 'address'],
[tmp, signer.weight, signer.address]
)
:::code-group

```solidity twoslash [solidity]
keccak256(abi.encode( uint8 weight_1, address signer_1,
keccak256(abi.encode( uint8 weight_2, address signer_2,
keccak256(abi.encode( uint8 weight_3, address signer_3,
keccak256(abi.encode( uint256 threshold )) )) )) ))
```

```js twoslash [js]
let tmp = ethers.utils.solidityPack(['uint256'], [configuration.threshold])

for (const signer of configuration.signers) {
tmp = ethers.utils.keccak256(
ethers.utils.defaultAbiCoder.encode(
['bytes32', 'uint8', 'address'],
[tmp, signer.weight, signer.address]
)
}
)
}

const imageHash = tmp
const imageHash = tmp
```

````
</TabPanel>
</TabGroup>
:::

## Initial wallet configuration

Expand Down
Loading

0 comments on commit 9a468d9

Please sign in to comment.