Skip to content

Commit

Permalink
re arrange / move doc structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeffrieh committed May 30, 2024
1 parent b6b8a38 commit d10314a
Show file tree
Hide file tree
Showing 14 changed files with 146 additions and 165 deletions.
31 changes: 0 additions & 31 deletions docs/pages/docs/basics/contracts.mdx

This file was deleted.

21 changes: 0 additions & 21 deletions docs/pages/docs/glossary/asset.mdx

This file was deleted.

49 changes: 0 additions & 49 deletions docs/pages/docs/glossary/client-options.mdx

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Terminology

# Accounts and Wallets
## Accounts

Antelope accounts are different compared to other EVM blockchains, and other kinds of blockchains in the space.
You still will be working with a private key, but your private key can be linked to several accounts.
Expand All @@ -9,7 +10,7 @@ Here's a quick synopsis from the (Antelope documentation)[https://docs.antelope.
> An account identifies a participant in an Antelope blockchain. A participant can be an individual or a group depending on the assigned permissions within the account. Accounts also represent the smart contract actors that push and receive actions to and from other accounts in the blockchain. Actions are always contained within transactions. A transaction can be one or more atomic actions.
> Permissions associated with an account are used to authorize actions and transactions to other accounts. Each permission is linked to an authority table which contains a threshold that must be reached in order to allow the action associated with the given permission to be authorized for execution. The following diagram illustrates the relationship between accounts, permissions, and authorities.
Simply put, an acount contains a collection of permissions, and each permission is linked to an authority table to allow certain actions to be exectued.
Simply put, an account contains a collection of permissions, and each permission is linked to an authority table to allow certain actions to be exectued.
As mentioned above, a private key can be linked to several accounts, and each account can have different permissions.

The anatomy of an antelope account is as follows:
Expand All @@ -18,22 +19,7 @@ The anatomy of an antelope account is as follows:
- `permissions`: The permissions associated with the account
- `keys`: The keys associated with the account (private and corresponding public keys)

# Creating an Account

## Jungle4 Testnet

We recomend first creating an account on the Jungle4 testnet, to get a feel for how Antelope accounts work.
To create an account on the Jungle4 testnet, you can use the [Jungle Testnet](https://monitor4.jungletestnet.io/).

There you will be able to generate key pairs, create an account, you will be able to retrieve native tokens using the faucet, you will be able to _power up_ you account (to make transactions).

## Mainnet

To create an account, we recomend using the [Unicove](https://unicove.com/) wallet.
Unicove is a wallet that allows you to create and manage Antelope accounts, and also allows you to interact with Antelope smart contracts.
Note that in order to create an account, you will need to do a transction on the blockchain, Unicove will guide you through this process, and you will be able to pay with Credit Card.

# Wallets
## Wallets

There are several wallets that you can use to interact with Antelope blockchains, some of them are:
We recomend using Unicove and Anchor Wallet, as they are the most user friendly wallets.
Expand All @@ -43,3 +29,36 @@ We recomend using Unicove and Anchor Wallet, as they are the most user friendly
- [TokenPocket](https://www.tokenpocket.pro/)
- [Wombat](https://getwombat.io/)

## Contracts

These are the important smart contracts that are used in the Effect Network.
The important contract for developing on Effect Network are:

- tasks
- token
- vaccount

With these contracts you can create tasks, and retrieve virtual accounts.

These are the contracts that are deployed on the Jungle4 testnet for the Effect Network.
[https://jungle4.eosq.eosnation.io/](https://jungle4.eosq.eosnation.io/)

- tasks: [effecttasks2](https://jungle4.eosq.eosnation.io/account/effecttasks2)
- token: [efxtoken1112](https://jungle4.eosq.eosnation.io/account/efxtoken1112)
- stake: [efxstake1111](https://jungle4.eosq.eosnation.io/account/efxstake1111)
- feepool: [efxfeepool11](https://jungle4.eosq.eosnation.io/account/efxfeepool11)
- proposals: [efxproposals](https://jungle4.eosq.eosnation.io/account/efxproposals)
- vaccount: [efxaccount11](https://jungle4.eosq.eosnation.io/account/efxaccount11)


These are the contracts that are depoloyed on the EOS mainnet for the Effect Network.
[https://www.bloks.io/](https://www.bloks.io/)


- tasks: [force.efx](https://www.bloks.io/account/force.efx)
- token: [effecttokens](https://www.bloks.io/account/effecttokens)
- stake: [efxstakepool](https://www.bloks.io/account/efxstakepool)
- feepool: [feepool.efx](https://www.bloks.io/account/feepool.efx)
- proposals: [daoproposals](https://www.bloks.io/account/daoproposals)
- vaccount: [vaccount.efx](https://www.bloks.io/account/vaccount.efx)
- dao: [theeffectdao](https://www.bloks.io/account/theeffectdao)
26 changes: 0 additions & 26 deletions docs/pages/docs/glossary/transaction-result.mdx

This file was deleted.

99 changes: 98 additions & 1 deletion docs/pages/docs/glossary/types.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,103 @@
# Types [Glossary of Types in effect-js.]
# Types [Glossary of Types in the effect sdk.]

## Campaign

[See Type](https://github.com/effectai/effect-js/blob/main/src/types/campaign.ts)

## Client Options

The ClientOpts interface is used to define the options that can be passed to the EffectAI Client constructor.

```typescript
interface ClientOpts {
ipfsCacheDurationInMs?: number | null;
fetchProvider?: FetchProviderOptions;
cacheImplementation?: Cache;
}
```

As we can see, the ClientOpts interface has three optional properties:

## `ipfsCacheDurationIMs`

This property is used to set the cache duration for the IPFS data.
The default value is 600_000 milliseconds; 10 minutes.

## `fetchProvider`

This property is used to set the fetch provider.
This is needed because of the different runtimes availalbe to Java Script.
For example, in older versions of Node.js, the fetch API is not available.
For older versions of Node.js, you can use the [`node-fetch` ](https://github.com/node-fetch/node-fetch) package.

Since Node.js v18.0.0, the fetch API is available by default.

In the browser fetch is generally available, and is available on the `window.fetch` object.
You can read more about it here: [MDN Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API)

Other serverside Java Script runtimes such as [Bun](https://bun.sh/) and (Deno)[https://deno.com/] already have fetch available on the global `fetch` object.

## `cacheImplementation`

This property is used to set the cache implementation.
There are three different cache mechanigms abailable in the EffectAI SDK.
First of all, "IDBCache", "LocalStorageCache", "MemoryCache".
Any of these can be passed to the `cacheImplementation` property while instanlizing the EffectAI Client.

```typescript
import { createClient, IDBCache, LocalStorageCache, MemoryCache } from '@effectai/sdk'
const client = createClient({
cacheImplementation: new IDBCache() // or new LocalStorageCache() or new MemoryCache()
})
```

[See Type](https://github.com/effectai/effect-js/blob/main/src/client.ts)

## Asset

### Description

Some functions with the `@effectai/sdk` package will return a `Asset` object.
This object contains information about tokens on the blockchain and contain information such as the symbol, precision, and amount.

An example for the `Asset` object is as follows:


```json
{
"precision": 4,
"symbol": "EFX",
"units": 10000,
"value": 1
}
```

Read more about the `Asset` object here:
https://wharfkit.com/docs/antelope/asset

## Transaction Result

### Description

Some functions with the `@effectai/sdk` package will return a `TransactionResult` object.
This object contains the transaction hash and the transaction receipt.

The interface for the `TransactionResult` object is as follows:


```ts
interface TransactResult {
chain: ChainDefinition
request: SigningRequest
resolved: ResolvedSigningRequest | undefined
response?: { [key: string]: any }
revisions: TransactRevisions
signatures: Signature[]
signer: PermissionLevel
transaction: ResolvedTransaction | undefined
}
```

Read more about the `TransactionResult` object here:

https://wharfkit.com/docs/session-kit/transact-result
2 changes: 1 addition & 1 deletion docs/pages/docs/tasks/campaigns/create-campaign.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ response: {

**Description:**
Returns a transaction response object that contains the transaction id block number, and various properties that correlate to the transaction.
Read more about the transaction response here: [TransactionResponse](/docs/glossary/transaction-result.mdx)
Read more about the transaction response here: [TransactionResponse](/docs/glossary/types#transaction-result)
2 changes: 1 addition & 1 deletion docs/pages/docs/token/get-balance.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -41,4 +41,4 @@ Returns the balance of the account in the form of an Asset object.
The asset object has properties that represent the amount and symbol of the balance of the user.
Note that the Asset object has a `toString` method that can be used to convert the balance to a string.

You can read more about the: [`Asset` object](/docs/glossary/asset)
You can read more about the: [`Asset` object](/docs/glossary/types#asset)
4 changes: 2 additions & 2 deletions docs/pages/docs/token/swap.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ Other wallet plugins can be used to sign transactions and can be found at: https

## Output

Read more about the transaction response here: [TransactionResponse](/docs/glossary/transaction-result.mdx)
Read more about the transaction response here: [TransactionResponse](/docs/glossary/types#transaction-result)

```
response: {
Expand Down Expand Up @@ -171,5 +171,5 @@ The direction of the swap. It can be either "UsdtToEfx" or "EfxToUsdt".

**Description:**
Returns a transaction response object that contains the transaction id block number, and various properties that correlate to the transaction.
Read more about the transaction response here: [TransactionResponse](/docs/glossary/transaction-result.mdx)
Read more about the transaction response here: [TransactionResponse](/docs/glossary/types#transaction-result)

2 changes: 1 addition & 1 deletion docs/pages/docs/vaccount/claim.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,6 @@ response: {

**Description:**
Returns a transaction response object that contains the transaction id block number, and various properties that correlate to the transaction.
Read more about the transaction response here: [TransactionResponse](/docs/glossary/transaction-result.mdx)
Read more about the transaction response here: [TransactionResponse](/docs/glossary/types#transaction-result)


2 changes: 1 addition & 1 deletion docs/pages/docs/vaccount/deposit.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ response: {

**Description:**
Returns a transaction response object that contains the transaction id block number, and various properties that correlate to the transaction.
Read more about the transaction response here: [TransactionResponse](/docs/glossary/transaction-result.mdx)
Read more about the transaction response here: [TransactionResponse](/docs/glossary/types#transaction-result)


2 changes: 1 addition & 1 deletion docs/pages/docs/vaccount/payout.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ response: {

**Description:**
Returns a transaction response object that contains the transaction id block number, and various properties that correlate to the transaction.
Read more about the transaction response here: [TransactionResponse](/docs/glossary/transaction-result.mdx)
Read more about the transaction response here: [TransactionResponse](/docs/glossary/types#transaction-result)


2 changes: 1 addition & 1 deletion docs/pages/docs/vaccount/withdraw.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,6 @@ response: {

**Description:**
Returns a transaction response object that contains the transaction id block number, and various properties that correlate to the transaction.
Read more about the transaction response here: [TransactionResponse](/docs/glossary/transaction-result.mdx)
Read more about the transaction response here: [TransactionResponse](/docs/glossary/types#transaction-result)


Loading

0 comments on commit d10314a

Please sign in to comment.