Skip to content

Commit

Permalink
Add Lantstool examples to linkdrop
Browse files Browse the repository at this point in the history
  • Loading branch information
eclipseeer committed Jan 27, 2025
1 parent 0d37edc commit e09bd6b
Show file tree
Hide file tree
Showing 6 changed files with 295 additions and 3 deletions.
273 changes: 271 additions & 2 deletions docs/2.build/5.primitives/linkdrop.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ hide_table_of_contents: false
import {FeatureList, Column, Feature} from "@site/src/components/featurelist"
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

import { LantstoolLabel } from '@site/src/components/LantstoolLabel/LantstoolLabel';

Linkdrops allow users to distribute assets and onboard people to Web3 apps through a simple web link.

Expand Down Expand Up @@ -132,7 +132,6 @@ Key pair with ed25519:33Vn9VtNEtWQPPd1f4jf5HzJ5weLcvGHU8oz7o5UnPqy public key fo
</TabItem>

<TabItem value="Keypom API" label="Keypom API">

```bash
export NUMBER_OF_DROPS=2

Expand All @@ -142,7 +141,11 @@ curl https://keypom.sctuts.com/keypair/$NUMBER_OF_DROPS/rootEntrophy
</TabItem>

</Tabs>
</TabItem>

<TabItem value="Lantstool" label={<LantstoolLabel/>}>
<p>Generate a new key on [Lantstool](https://app.lantstool.dev/)</p>
![lantstool](/docs/assets/lantstool/lantstool-near_protocol-utils-key_generator.png)
</TabItem>
</Tabs>

Expand Down Expand Up @@ -208,6 +211,46 @@ near call v2.keypom.near create_drop '{"public_keys": <PUBLIC_KEYS>, "deposit_pe
```

</TabItem>

<TabItem value="Lantstool" label={<LantstoolLabel/>}>
<p>
Try it out on [Lantstool](https://app.lantstool.dev/import/gh/lantstool/examples.near-protocol/main/docs/2.build/5.primitives/linkdrop/create-near-drop.zip)
</p>
```json
{
"blockchain": "near-protocol",
"networkId": "mainnet",
"transaction": {
"version": "1.0",
"name": "Create NEAR Drop",
"signerId": "",
"signerKey": "",
"receiverId": "v2.keypom.near",
"actions": [
{
"type": "FunctionCall",
"contractId": "v2.keypom.near",
"methodName": "create_drop",
"args": {
"public_keys": [
"<public_key_1>"
],
"deposit_per_use": "10000000000000000000000"
},
"gas": {
"amount": "50",
"unit": "TGas"
},
"deposit": {
"amount": "0.05",
"unit": "NEAR"
}
}
]
}
}
```
</TabItem>
</Tabs>

:::info
Expand Down Expand Up @@ -296,6 +339,50 @@ near call v2.keypom.near create_drop '{"public_keys": <PUBLIC_KEYS>, "deposit_pe
```
</TabItem>
<TabItem value="Lantstool" label={<LantstoolLabel/>}>
<p>
Try it out on [Lantstool](https://app.lantstool.dev/import/gh/lantstool/examples.near-protocol/main/docs/2.build/5.primitives/linkdrop/create-nft-drop.zip)
</p>
```json
{
"blockchain": "near-protocol",
"networkId": "mainnet",
"transaction": {
"version": "1.0",
"name": "Create NFT Drop",
"signerId": "",
"signerKey": "",
"receiverId": "v2.keypom.near",
"actions": [
{
"type": "FunctionCall",
"contractId": "v2.keypom.near",
"methodName": "create_drop",
"args": {
"public_keys": [
"<public_key_1>"
],
"deposit_per_use": "10000000000000000000000",
"nft": {
"sender_id": "<nft_owner_id>",
"contract_id": "nft.primitives.near"
}
},
"gas": {
"amount": "100",
"unit": "TGas"
},
"deposit": {
"amount": "0.05",
"unit": "NEAR"
}
}
]
}
}
```
</TabItem>
</Tabs>
#### 2. Transferring the NFT
Expand Down Expand Up @@ -357,6 +444,45 @@ near call nft.primitives.near nft_transfer_call '{"receiver_id": "v2.keypom.near
```
</TabItem>
<TabItem value="Lantstool" label={<LantstoolLabel/>}>
<p>
Try it out on [Lantstool](https://app.lantstool.dev/import/gh/lantstool/examples.near-protocol/main/docs/2.build/5.primitives/linkdrop/transfer-nft-to-v2keypomnear.zip)
</p>
```json
{
"blockchain": "near-protocol",
"networkId": "mainnet",
"transaction": {
"version": "1.0",
"name": "Transfer NFT to v2.keypom.near",
"signerId": "",
"signerKey": "",
"receiverId": "nft.primitives.near",
"actions": [
{
"type": "FunctionCall",
"contractId": "nft.primitives.near",
"methodName": "nft_transfer_call",
"args": {
"receiver_id": "v2.keypom.near",
"token_id": "<token_id>",
"msg": "<drop_id>"
},
"gas": {
"amount": "50",
"unit": "TGas"
},
"deposit": {
"amount": "1",
"unit": "yoctoNEAR"
}
}
]
}
}
```
</TabItem>
</Tabs>
:::tip
Expand Down Expand Up @@ -447,6 +573,51 @@ near call v2.keypom.near create_drop '{"public_keys": <PUBLIC_KEYS>, "deposit_pe
```
</TabItem>
<TabItem value="Lantstool" label={<LantstoolLabel/>}>
<p>
Try it out on [Lantstool](https://app.lantstool.dev/import/gh/lantstool/examples.near-protocol/main/docs/2.build/5.primitives/linkdrop/create-ft-drop.zip)
</p>
```json
{
"blockchain": "near-protocol",
"networkId": "mainnet",
"transaction": {
"version": "1.0",
"name": "Create FT Drop",
"signerId": "",
"signerKey": "",
"receiverId": "v2.keypom.near",
"actions": [
{
"type": "FunctionCall",
"contractId": "v2.keypom.near",
"methodName": "create_drop",
"args": {
"public_keys": [
"<public_key_1>"
],
"deposit_per_use": "10000000000000000000000",
"ftData": {
"contractId": "ft.primitives.near",
"senderId": "<ft_owner_id>",
"amount": "1"
}
},
"gas": {
"amount": "100",
"unit": "TGas"
},
"deposit": {
"amount": "0.05",
"unit": "NEAR"
}
}
]
}
}
```
</TabItem>
</Tabs>
#### 2. Transferring FT
Expand Down Expand Up @@ -508,6 +679,44 @@ near call ft.primitives.near ft_transfer '{"receiver_id": "v2.keypom.near", "amo
```
</TabItem>
<TabItem value="Lantstool" label={<LantstoolLabel/>}>
<p>
Try it out on [Lantstool](https://app.lantstool.dev/import/gh/lantstool/examples.near-protocol/main/docs/2.build/5.primitives/linkdrop/transfer-ft-to-v2keypomnear.zip)
</p>
```json
{
"blockchain": "near-protocol",
"networkId": "mainnet",
"transaction": {
"version": "1.0",
"name": "Transfer FT to v2.keypom.near",
"signerId": "",
"signerKey": "",
"receiverId": "ft.primitives.near",
"actions": [
{
"type": "FunctionCall",
"contractId": "ft.primitives.near",
"methodName": "ft_transfer",
"args": {
"receiver_id": "v2.keypom.near",
"amount": "1"
},
"gas": {
"amount": "50",
"unit": "TGas"
},
"deposit": {
"amount": "1",
"unit": "yoctoNEAR"
}
}
]
}
}
```
</TabItem>
</Tabs>
---
Expand Down Expand Up @@ -624,6 +833,66 @@ near call v2.keypom.near create_drop '{"public_keys": <PUBLIC_KEYS>, "deposit_pe
```
</TabItem>
<TabItem value="Lantstool" label={<LantstoolLabel/>}>
<p>
Try it out on [Lantstool](https://app.lantstool.dev/import/gh/lantstool/examples.near-protocol/main/docs/2.build/5.primitives/linkdrop/create-function-call-drop.zip)
</p>
```json
{
"blockchain": "near-protocol",
"networkId": "mainnet",
"transaction": {
"version": "1.0",
"name": "Create Function Call Drop",
"signerId": "",
"signerKey": "",
"receiverId": "v2.keypom.near",
"actions": [
{
"type": "FunctionCall",
"contractId": "v2.keypom.near",
"methodName": "create_drop",
"args": {
"public_keys": [
"<public_key_1>"
],
"deposit_per_use": "10000000000000000000000",
"fcData": {
"methods": [
[
{
"receiverId": "nft.primitives.near",
"methodName": "nft_mint",
"args": {
"token_id": "1",
"metadata": {
"title": "My NFT drop",
"description": "",
"media": ""
},
"accountIdField": "<receiver_id>",
"attachedDeposit": "10000000000000000000000"
}
}
]
]
}
},
"gas": {
"amount": "100",
"unit": "TGas"
},
"deposit": {
"amount": "0.05",
"unit": "NEAR"
}
}
]
}
}
```
</TabItem>
</Tabs>
---
Expand Down
2 changes: 1 addition & 1 deletion docs/2.build/5.primitives/what-is.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,4 @@ DAOs are ideal to create **decentralized governance**, **funding**, and **decisi

:::tip
LinkDrops are ideal to do **drops**, and **onboard new users** into Web3 apps.
:::
:::
9 changes: 9 additions & 0 deletions website/src/components/LantstoolLabel/LantstoolLabel.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import LantstoolLogo from "@site/static/docs/assets/lantstool/lantstool-logo-circle.svg";
import cn from './LantstoolLabel.module.scss'

export const LantstoolLabel = () => (
<div className={cn.container}>
<LantstoolLogo className={cn.logo}/>
Lantstool
</div>
);
10 changes: 10 additions & 0 deletions website/src/components/LantstoolLabel/LantstoolLabel.module.scss
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
.container {
display: flex;
gap: 4px;
align-items: center;
}

.logo {
height: 16px;
width: 16px;
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit e09bd6b

Please sign in to comment.