Skip to content

Commit

Permalink
docs
Browse files Browse the repository at this point in the history
  • Loading branch information
dfstio committed Dec 22, 2024
1 parent b381bf0 commit 3f8765c
Show file tree
Hide file tree
Showing 357 changed files with 27,065 additions and 354 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MinaTokens
# MinaTokens API

## MinaTokens API Documentation

Expand Down
108 changes: 108 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,108 @@
---
title: MinaTokens API
category: 6749c4dba3a7a4005bae1197
hidden: false
order: 1
---

# MinaTokens API

## MinaTokens API Documentation

Welcome to the MinaTokens API documentation! This API enables developers to easily create and manage custom tokens on the MINA blockchain using zkCloudWorker technology.

Explore our comprehensive API documentation and try out live API endpoints at [docs.minatokens.com](https://docs.minatokens.com)

To obtain an API key, visit [minatokens.com/api](https://minatokens.com/api)

## Overview

MinaTokens is a no-code custom token launchpad that simplifies the creation and management of MINA custom tokens. Our API provides developers with programmatic access to token operations, allowing seamless integration into your applications.

### Key Features

- **Token Creation**: Launch custom tokens with configurable parameters
- **Token Management**: Mint, transfer, and manage token distributions
- **Batch Operations**: Perform batch mints and transfers for airdrops
- **Transaction Building**: Automated transaction building and proving
- **Monitoring**: Track token statistics and transaction status

## Getting Started

### Authentication

All API requests require authentication using an API key. Include your API key in the request headers:

'x-api-key': 'your-api-key'

To obtain an API key, visit [minatokens.com/api](https://minatokens.com/api)

### Base URLs

- Devnet: `https://minatokens.com/api/v1/`
- Zeko: `https://zekotokens.com/api/v1/`

## Quick Start Guide

### 1. Deploy a New Token

```javascript
const response = await fetch("https://minatokens.com/api/v1/deploy", {
method: "POST",
headers: {
"x-api-key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
adminAddress: "B62...",
symbol: "TEST",
decimals: 9,
uri: "https://minatokens.com",
}),
});
```

### 2. Get Token Information

```typescript
const response = await fetch("https://minatokens.com/api/v1/info", {
method: "POST",
headers: {
"x-api-key": "your-api-key",
"Content-Type": "application/json",
},
body: JSON.stringify({
tokenAddress: "B62qpFzLKkGKMZcmY6wrbyn8Sf9sWUT1HG4omSbvFKH2nXSNjCoQ6Xs",
}),
});
```

See the complete examples at https://github.com/zkcloudworker/tokens-api-example

## Core Concepts

### Token Types

MinaTokens supports two categories of tokens:

1. **Regular Tokens**: Can be freely created and transferred by any user
2. **Whitelisted Tokens**: Created with MDA (Mina Developers Alliance) endorsement, enabling additional features like buying and selling

### Transaction Flow

1. **Build**: Create a transaction using `/transaction` endpoint
2. **Prove**: Submit the transaction for proving using `/prove` endpoint
3. **Monitor**: Track transaction status using `/tx-status` endpoint

## Security Considerations

- All sensitive operations require proper authentication
- Whitelisted tokens require MDA member endorsement
- Transaction proving occurs in secure cloud environment
- Wallet signatures are required for all transactions

## Support

For technical support or questions:

- Email: [email protected]
61 changes: 61 additions & 0 deletions docs/abi.src.Function.buildTokenLaunchTransaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
---
title: buildTokenLaunchTransaction
category: 6749c4dba3a7a4005bae1197
hidden: false
slug: abi.src.Function.buildTokenLaunchTransaction
order: 20
---

# Function: buildTokenLaunchTransaction()

```ts
function buildTokenLaunchTransaction(params: {
args: LaunchTokenStandardAdminParams | LaunchTokenAdvancedAdminParams;
chain: blockchain;
developerAddress: string;
provingFee: number;
provingKey: string;
}): Promise<{
isAdvanced: boolean;
request: LaunchTokenStandardAdminParams | LaunchTokenAdvancedAdminParams;
tx: Transaction<false, false>;
verificationKeyHashes: string[];
}>
```

## Parameters

### params

#### args

`LaunchTokenStandardAdminParams` \| `LaunchTokenAdvancedAdminParams`

#### chain

[`blockchain`](abisrctypealiasblockchain)

#### developerAddress

`string`

#### provingFee

`number`

#### provingKey

`string`

## Returns

`Promise`\<\{
`isAdvanced`: `boolean`;
`request`: `LaunchTokenStandardAdminParams` \| `LaunchTokenAdvancedAdminParams`;
`tx`: `Transaction`\<`false`, `false`\>;
`verificationKeyHashes`: `string`[];
\}\>

## Defined in

[packages/abi/src/token/build.ts:32](https://github.com/zkcloudworker/minatokens-lib/blob/main/packages/abi/src/token/build.ts#L32)
89 changes: 89 additions & 0 deletions docs/abi.src.Function.buildTokenTransaction.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,89 @@
---
title: buildTokenTransaction
category: 6749c4dba3a7a4005bae1197
hidden: false
slug: abi.src.Function.buildTokenTransaction
order: 21
---

# Function: buildTokenTransaction()

```ts
function buildTokenTransaction(params: {
args: | TokenMintTransactionParams
| TokenTransferTransactionParams
| TokenAirdropTransactionParams
| TokenOfferTransactionParams
| TokenBidTransactionParams
| TokenBuyTransactionParams
| TokenSellTransactionParams
| TokenWithdrawBidTransactionParams
| TokenWithdrawOfferTransactionParams
| TokenUpdateBidWhitelistTransactionParams
| TokenUpdateOfferWhitelistTransactionParams
| TokenUpdateAdminWhitelistTransactionParams;
chain: blockchain;
developerAddress: string;
provingFee: number;
provingKey: string;
}): Promise<{
adminAddress: PublicKey;
adminContractAddress: PublicKey;
isAdvanced: boolean;
request: Exclude<TokenTransactionParams, LaunchTokenStandardAdminParams | LaunchTokenAdvancedAdminParams>;
symbol: string;
tx: Transaction<false, false>;
verificationKeyHashes: string[];
}>
```

## Parameters

### params

#### args

\| `TokenMintTransactionParams`
\| `TokenTransferTransactionParams`
\| `TokenAirdropTransactionParams`
\| `TokenOfferTransactionParams`
\| `TokenBidTransactionParams`
\| `TokenBuyTransactionParams`
\| `TokenSellTransactionParams`
\| `TokenWithdrawBidTransactionParams`
\| `TokenWithdrawOfferTransactionParams`
\| `TokenUpdateBidWhitelistTransactionParams`
\| `TokenUpdateOfferWhitelistTransactionParams`
\| `TokenUpdateAdminWhitelistTransactionParams`

#### chain

[`blockchain`](abisrctypealiasblockchain)

#### developerAddress

`string`

#### provingFee

`number`

#### provingKey

`string`

## Returns

`Promise`\<\{
`adminAddress`: `PublicKey`;
`adminContractAddress`: `PublicKey`;
`isAdvanced`: `boolean`;
`request`: `Exclude`\<`TokenTransactionParams`, `LaunchTokenStandardAdminParams` \| `LaunchTokenAdvancedAdminParams`\>;
`symbol`: `string`;
`tx`: `Transaction`\<`false`, `false`\>;
`verificationKeyHashes`: `string`[];
\}\>

## Defined in

[packages/abi/src/token/build.ts:222](https://github.com/zkcloudworker/minatokens-lib/blob/main/packages/abi/src/token/build.ts#L222)
53 changes: 53 additions & 0 deletions docs/abi.src.Function.fetchMinaAccount.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
---
title: fetchMinaAccount
category: 6749c4dba3a7a4005bae1197
hidden: false
slug: abi.src.Function.fetchMinaAccount
order: 22
---

# Function: fetchMinaAccount()

```ts
function fetchMinaAccount(params: {
force: boolean;
publicKey: string | PublicKey;
tokenId: string | Field;
}): Promise<Account | undefined>
```

Fetches the Mina account for a given public key with error handling

## Parameters

### params

the parameters for fetching the account

#### force

`boolean`

whether to force the fetch - use it only if you are sure the account exists

#### publicKey

`string` \| `PublicKey`

the public key of the account

#### tokenId

`string` \| `Field`

the token id of the account

## Returns

`Promise`\<`Account` \| `undefined`\>

the account object

## Defined in

[packages/abi/src/fetch.ts:11](https://github.com/zkcloudworker/minatokens-lib/blob/main/packages/abi/src/fetch.ts#L11)
70 changes: 70 additions & 0 deletions docs/abi.src.Function.getTokenSymbolAndAdmin.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: getTokenSymbolAndAdmin
category: 6749c4dba3a7a4005bae1197
hidden: false
slug: abi.src.Function.getTokenSymbolAndAdmin
order: 23
---

# Function: getTokenSymbolAndAdmin()

```ts
function getTokenSymbolAndAdmin(params: {
bidAddress: PublicKey;
chain: blockchain;
offerAddress: PublicKey;
to: PublicKey;
tokenAddress: PublicKey;
txType: TokenTransactionType;
}): Promise<{
adminAddress: PublicKey;
adminContractAddress: PublicKey;
isAdvanced: boolean;
isToNewAccount: boolean;
symbol: string;
verificationKeyHashes: string[];
}>
```

## Parameters

### params

#### bidAddress

`PublicKey`

#### chain

[`blockchain`](abisrctypealiasblockchain)

#### offerAddress

`PublicKey`

#### to

`PublicKey`

#### tokenAddress

`PublicKey`

#### txType

`TokenTransactionType`

## Returns

`Promise`\<\{
`adminAddress`: `PublicKey`;
`adminContractAddress`: `PublicKey`;
`isAdvanced`: `boolean`;
`isToNewAccount`: `boolean`;
`symbol`: `string`;
`verificationKeyHashes`: `string`[];
\}\>

## Defined in

[packages/abi/src/token/build.ts:658](https://github.com/zkcloudworker/minatokens-lib/blob/main/packages/abi/src/token/build.ts#L658)
Loading

0 comments on commit 3f8765c

Please sign in to comment.