Skip to content

Commit

Permalink
building dapps (#173)
Browse files Browse the repository at this point in the history
* docs: building dapps

* remove allow lists from docs

* docs: move tech concepts to the build section

* fix: titles
  • Loading branch information
Maksandre authored Sep 16, 2024
1 parent 00236eb commit 440ccd2
Show file tree
Hide file tree
Showing 8 changed files with 279 additions and 608 deletions.
18 changes: 9 additions & 9 deletions docs/.vuepress/configs/sidebar.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,14 +46,6 @@ export const sidebar: Record<string, SidebarConfig> = {
'/about/network-features/sdk-indexer',
'/about/network-features/marketplace.md',
]
},
{
text: 'Tech Concepts',
children: [
'/about/tech-concepts/addresses',
'/about/tech-concepts/balances/index.md',
//'/about/tech-concepts/glossary.md',
]
}
],
'/build': [
Expand All @@ -77,14 +69,15 @@ export const sidebar: Record<string, SidebarConfig> = {
]
},
{
text: 'SDK V2 [Alpha]',
text: 'SDK-2.0 [Alpha]',
children: [
'/build/sdk/v2/quick-start.md',
'/build/sdk/v2/balances.md',
'/build/sdk/v2/collections.md',
'/build/sdk/v2/tokens.md',
'/build/sdk/v2/sponsoring.md',
'/build/sdk/v2/indexer.md',
'/build/sdk/v2/dapps.md',
]
},
{
Expand All @@ -106,6 +99,13 @@ export const sidebar: Record<string, SidebarConfig> = {
},
'/build/evm/UniqueNFT.md',
],
},
{
text: 'Tech Concepts',
children: [
'/about/tech-concepts/addresses',
'/about/tech-concepts/balances/index.md',
]
}
],
'/tutorials': [
Expand Down
5 changes: 2 additions & 3 deletions docs/about/network-features/sponsoring.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,9 @@ Unique Network supports sponsoring various types of transactions to enhance user

## Preventing Attacks

One potential risk with sponsoring transactions is the possibility of DOS attacks, where malicious actors deplete sponsor funds by sending numerous "free" transactions. Unique Network addresses this issue by implementing rate limits. Rate Limiting Strategies:
One potential risk with sponsoring transactions is the possibility of DOS attacks, where malicious actors deplete sponsor funds by sending numerous "free" transactions. Unique Network addresses this issue by implementing rate limits:

1. **Time limits**: Set a rate limit where an NFT transferred will be sponsored only once every X block. This prevents excessive transactions in a short period.
2. **Allow Lists**: Implement a rate limit based on an allow list, ensuring only trusted transactions are processed frequently.
**Time limits**: Set a rate limit where an NFT transferred will be sponsored only once every X block. This prevents excessive transactions in a short period.

## Learn More

Expand Down
67 changes: 0 additions & 67 deletions docs/about/tech-concepts/glossary.md

This file was deleted.

122 changes: 1 addition & 121 deletions docs/build/sdk/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ In Unique Network, the collection has the following entities:
- **limits** - a set that defines the rules for a collection, e.g. whether it can be transferred, or how much tokens you can mint in it;
- **owner** - an address that created a collection (or if the collection was transferred, the address that owns the collection at the moment);
- **admins** - a collection can be controlled by multiple admin addresses. Admins can issue and burn NFTs, as well as add and remove other admins, but they cannot change NFT or collection ownership;
- **allow list** - a list of addresses collected that allow certain community members a guaranteed spot for minting a new NFT.


## Prerequisites

Expand Down Expand Up @@ -668,126 +668,6 @@ curl -X 'POST' \
</CodeGroupItem>
</CodeGroup>


## Allow list

### Add to allow list

Adds an address to the allow list of a collection.

Please check the samples below to learn how to add an address to the allow list.

<CodeGroup>
<CodeGroupItem title="SDK">

```typescript:no-line-numbers
import Sdk from '@unique-nft/sdk'
const sdk = new Sdk({ baseUrl: 'https://rest.unique.network/opal' });
const { parsed } = await sdk.collection.addToAllowList.submitWaitResult({
address: '5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y',
collectionId: 1,
newAdmin: '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
});
const { address, collectionId } = parsed;
console.log(`Address ${address} is allowed in collection # ${collectionId}.`);
```

</CodeGroupItem>

<CodeGroupItem title="REST">

```bash:no-line-numbers
curl -X 'POST' \
'https://rest.unique.network/opal/collection/add-to-allow-list' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"address": "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y",
"collectionId": 1,
"newAdminId": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty"
}'
```
</CodeGroupItem>
</CodeGroup>


### Get the allow list

You can get the allow list of the specified collection.

Please check the samples below to learn how to get the allow list.

<CodeGroup>
<CodeGroupItem title="SDK">

```typescript:no-line-numbers
import Sdk from '@unique-nft/sdk'
const sdk = new Sdk({ baseUrl: 'https://rest.unique.network/opal' });
const { addresses } = await sdk.collection.allowList({ collectionId: 1 });
console.log(`The addresses in the collection allow list: ${addresses}`);
```

</CodeGroupItem>
<CodeGroupItem title="REST">

```bash:no-line-numbers
curl -X 'GET' \
'https://rest.unique.network/opal/collection/allow-list?collectionId=1'
```
</CodeGroupItem>
</CodeGroup>


### Remove from the allow list

You can get the allow list of the specified collection.

Please check the samples below to learn how to get the allow list.

<CodeGroup>
<CodeGroupItem title="SDK">

```typescript:no-line-numbers
import Sdk from '@unique-nft/sdk'
const sdk = new Sdk({ baseUrl: 'https://rest.unique.network/opal' });
const { parsed } = await sdk.collection.removeFromAllowList.submitWaitResult({
address: '5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y',
collectionId: 1,
addressToDelete: '5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty',
});
const { collectionId, address } = parsed;
console.log(`Address ${address} removed from allow list in collection ${collectionId}.`);
```

</CodeGroupItem>

<CodeGroupItem title="REST">

```bash:no-line-numbers
curl -X 'POST' \
'https://rest.unique.network/opal/collection/remove-from-allow-list' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"address": "5FLSigC9HGRKVhB9FiEo4Y3koPsNmBmLJbpXg2mp1hXcS59Y",
"collectionId": 1,
"addressToDelete": "5FHneW46xGXgs5mUiveU4sbTyGBzmstUspZC92UhjJM694ty"
}'
```
</CodeGroupItem>
</CodeGroup>

## Destroy a collection

#### Limitations
Expand Down
1 change: 0 additions & 1 deletion docs/build/sdk/v2/collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ In Unique Network, the collection has the following entities:
- **limits** - a set that defines the rules for a collection, e.g., whether it can be transferred or how many tokens you can mint in it;
- **owner** - an address that created a collection (or if the collection was transferred, the address that owns the collection at the moment);
- **admins** - a collection can be controlled by multiple admin addresses. Admins can issue and burn NFTs, as well as add and remove other admins, but they cannot change NFT or collection ownership;
- **allow list** - a list of addresses collected that allow certain community members a guaranteed spot for minting a new NFT.

## Prerequisite

Expand Down
Loading

0 comments on commit 440ccd2

Please sign in to comment.