Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation updates #322

Merged
merged 41 commits into from
Jul 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
41 commits
Select commit Hold shift + click to select a range
1cde586
Change algora config.
oable May 18, 2023
4a0f108
Merge branch 'main' into develop
oable May 19, 2023
0194c5a
merge branch 'main' into develop
oable Feb 16, 2024
01d8f46
Merge branch 'main' into develop
oable Feb 28, 2024
34b0289
Update neon-api.mdx with temporary fix of :construction_worker: and u…
OlehSyzonov Jun 21, 2024
a3210f1
Update json_rpc_api_methods.md with list of methods that return chainId
OlehSyzonov Jun 21, 2024
46a074d
Update request.json with the correct example of neon_emulate id
OlehSyzonov Jun 21, 2024
8f5b0fe
Update response.json with modern response example
OlehSyzonov Jun 21, 2024
2b75e28
Update request.json with correct neon_getEvmParams method name and id…
OlehSyzonov Jun 21, 2024
7612595
Update response.json with modern result example
OlehSyzonov Jun 21, 2024
6e3fdd9
Update json_rpc_api_methods.md fix of typo
OlehSyzonov Jun 21, 2024
e531e8e
Update neon-api.mdx with <!-- The text :construction_worker: is hidde…
OlehSyzonov Jun 21, 2024
abc8fc4
Update neon-api.mdx Extra space removed
OlehSyzonov Jun 21, 2024
bf258b9
Revert "Update neon-api.mdx Extra space removed"
OlehSyzonov Jun 21, 2024
4f2af86
Revert "Update neon-api.mdx with <!-- The text :construction_worker: …
OlehSyzonov Jun 21, 2024
05252f2
Update neon-api.mdx with fixed internal links
OlehSyzonov Jun 21, 2024
cc37fbe
Merge pull request #158 from neonlabsorg/TBA-131-on_fixed-branch
Vedad84 Jun 24, 2024
c72351b
Add new pages for composability in the sidebar
sukanyaparashar Jun 27, 2024
414c7b3
Add common solana terminology page
sukanyaparashar Jun 27, 2024
180cb18
Add ICallSolana page
sukanyaparashar Jun 27, 2024
82c5d34
Add setup and configure page
sukanyaparashar Jun 27, 2024
2b941bf
Add transfer SOLs page
sukanyaparashar Jun 27, 2024
ab719c7
Add transfer SPL token page
sukanyaparashar Jun 27, 2024
566a781
Add swap on orca page
sukanyaparashar Jun 27, 2024
993be5e
Add using VRF page
sukanyaparashar Jun 27, 2024
c6d31a2
Update docs/composability/common_solana_terminology.md
sukanyaparashar Jun 28, 2024
371c499
Replace : with -
sukanyaparashar Jun 28, 2024
5ac1116
Update docs/composability/call_solana_interface.md
sukanyaparashar Jun 28, 2024
2d98c7d
Merge branch 'add/composability' of https://github.com/neonlabsorg/ne…
sukanyaparashar Jun 28, 2024
c42f32c
Change programs to accounts for non-executable
sukanyaparashar Jul 1, 2024
2902e90
Change the links to the example tutorials
sukanyaparashar Jul 1, 2024
b875762
Nest ATA under Token Accounts
sukanyaparashar Jul 2, 2024
2048440
Move common files to setup and configure page
sukanyaparashar Jul 2, 2024
63f7738
Add full code link to the tutorial pages
sukanyaparashar Jul 2, 2024
e73d1d4
Change Composability name in the sidebar
sukanyaparashar Jul 2, 2024
0fde4f1
Change the contents of executable programs
sukanyaparashar Jul 2, 2024
ba058bd
Merge pull request #159 from neonlabsorg/add/composability
BoogVAr Jul 3, 2024
0c59813
Updated vendors. Fixed links. (#161)
oable Jul 4, 2024
1865f1f
Merge branch 'main' into develop
oable Jul 4, 2024
cd0ac27
Feature/front 107 update consent mode (#160)
Tkachez Jul 4, 2024
c452652
Merge pull request #162 from neonlabsorg/develop
oable Jul 4, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Documentation

[Docs](https://docs.neonfoundation.io/) are built using [Docusaurus 2](https://docusaurus.io/).
[Docs](https://neonevm.org) are built using [Docusaurus 3](https://docusaurus.io/).

### Installation

Expand Down
28 changes: 14 additions & 14 deletions docs/api/neon-api.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ import neon_solanaVersion_response from "@site/static/schemas/neon-api/v1/neon_s

:::danger

This page is wip :construction_worker:
This page is wip 👷 <!-- The text :construction_worker: is sobstituted with the refenced symbol 👷 -->

:::

Expand Down Expand Up @@ -107,14 +107,14 @@ The method [neon_gasPrice](#get-neon-gas-price) returns data on gas price.

### 3. Neon transaction data

- [neon_getLogs](#get-transaction-logs): returns transaction log data
- [neon_getTransactionReceipt](#get-transaction-receipt): returns transaction receipt data
- [neon_getSolanaTransactionByNeonTransaction](#get-solana-transactions): returns a list of Solana transactions that correspond to a given Neon transaction
- [neon_emulate](#emulate-a-neon-transaction): returns details of an emultated transaction
- [neon_getLogs](#get-transaction-logs--): returns transaction log data
- [neon_getTransactionReceipt](#get-transaction-receipt--): returns transaction receipt data
- [neon_getSolanaTransactionByNeonTransaction](#get-solana-transactions--): returns a list of Solana transactions that correspond to a given Neon transaction
- [neon_emulate](#emulate-a-neon-transaction--): returns details of an emultated transaction

### 4. Parameters

[neon_getEvmParams](#get-parameters): returns parameters of the Neon EVM program deployed on Solana.
[neon_getEvmParams](#get-parameters--): returns parameters of the Neon EVM program deployed on Solana.

## Get versions

Expand Down Expand Up @@ -186,7 +186,7 @@ The [JSON](#get-neon-gas-price-response-as-json) for this response schema is ava

## Get transaction data

### Get transaction logs :construction_worker:
### Get transaction logs 👷 <!-- The text :construction_worker: is sobstituted with the refenced symbol 👷 -->

The `neon_getLogs` method returns transaction log data. This is an extended variant of the [eth_getLogs](https://ethereum.org/en/developers/docs/apis/json-rpc/#eth_getlogs) API method.

Expand Down Expand Up @@ -221,7 +221,7 @@ The `neon_getLogs` method returns transaction log data. This is an extended vari
</TabItem>
</Tabs>

### Get transaction receipt :construction_worker:
### Get transaction receipt 👷 <!-- The text :construction_worker: is sobstituted with the refenced symbol 👷 -->

The `neon_getTransactionReceipt` method returns transaction receipt data.

Expand Down Expand Up @@ -255,7 +255,7 @@ The `neon_getTransactionReceipt` method returns transaction receipt data.
</TabItem>
</Tabs>

### Get Solana transactions :construction_worker:
### Get Solana transactions 👷 <!-- The text :construction_worker: is sobstituted with the refenced symbol 👷 -->

The `neon_getSolanaTransactionByNeonTransaction` method returns a list of Solana transactions that correspond to a given Neon transaction.

Expand Down Expand Up @@ -290,7 +290,7 @@ The `neon_getSolanaTransactionByNeonTransaction` method returns a list of Solana
</Tabs>


## Emulate a Neon transaction :construction_worker:
## Emulate a Neon transaction 👷 <!-- The text :construction_worker: is sobstituted with the refenced symbol 👷 -->

The `neon_emulate` method returns details of an emultated transaction.

Expand Down Expand Up @@ -321,10 +321,10 @@ The [JSON](#get-neon-emulate-response-as-json) for this response schema is avail
</TabItem>
</Tabs>

## Get Parameters :construction_worker:
## Get Parameters 👷 <!-- The text :construction_worker: is sobstituted with the refenced symbol 👷 -->


The `neon_getEVMParams` method returns details of the EVM.
The `neon_getEvmParams` method returns details of the EVM.

<Tabs>
<TabItem value="RSchema" label="Request" default>
Expand All @@ -333,7 +333,7 @@ The [JSON](#get-neon-evm-parameters-request-as-json) for this request schema is

<JSONSchemaViewer schema={ neon_getEvmParams_request } viewerOptions={{ showExamples: true }} />

#### Get Neon EVM parameters request as JSON
The `neon_getEvmParams` method returns details of the EVM.

<CodeBlock language="json">{JSON.stringify(neon_getEvmParams_request, null, 2)}</CodeBlock>

Expand All @@ -351,4 +351,4 @@ The [JSON](#get-neon-evm-parameters-response-as-json) for this response schema i
<CodeBlock language="json">{JSON.stringify(neon_getEvmParams_response, null, 2)}</CodeBlock>

</TabItem>
</Tabs>
</Tabs>
70 changes: 70 additions & 0 deletions docs/composability/call_solana_interface.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
---
title: 'ICallSolana Interface'
proofedDate: 20240627
iterationBy: na
includedInSite: false
approvedBy: na
---

## Introduction

To use the **Composability** feature of Solana, let us learn about the interface and the functions included in the interface that will be used to interact with the Solana programs via the precompile `0xFF00000000000000000000000000000000000006`.

The interface contract `ICallSolana.sol` can be found in this [Github Repository](https://github.com/neonlabsorg/neon-tutorials/blob/main/hardhat/contracts/TestCallSolana/interfaces/ICallSolana.sol).

## Struct Variables

1. `AccountMeta` : For each account needed by an instruction, the following details must be provided -
- **account:** The account's on-chain address in bytes32.
- **is_writable:** Indicates if the account's data will be modified in boolean.
- **is_signer:** Indicates if the account needs to sign the transaction in boolean.
2. `Instruction` : Instruction struct variable includes the following -
- **program_id:** The address of the program that contains the execution logic for the invoked instruction.
- **accounts:** Contains the AccountMeta for each account required by an instruction.
- **instruction_data:** The instruction data as a buffer of bytes.

## Functions

| getNeonAddress(address) -> bytes32 |
| :--------------------------------------------------------------------------------- |
| This function returns the Solana address in bytes32 format for a Neon EVM address. |

| getResourceAddress(bytes32 salt) -> bytes32 |
| :-------------------------------------------------------------------------------------------------------------- |
| This function returns the Solana address in bytes32 format of a resource represented by the salt for contracts. |

| createResource(bytes32 salt, uint64 space, uint64 lamports, bytes32 owner) -> bytes32 |
| :--------------------------------------------------------------------------------------------------------------------------------- |
| This function creates a resource with the specified salt and returns the Solana address of the created resource in bytes32 format. |

| getSolanaPDA(bytes32 program_id, bytes memory seeds) -> bytes32 |
| :------------------------------------------------------------------------------------------------------------ |
| This function returns the Solana PDA in bytes32 format generated from the specified `program_id` and `seeds`. |

| getExtAuthority(bytes32 salt) -> bytes32 |
| :------------------------------------------------------------------------------------------------------------ |
| This function returns the Solana address in bytes32 format of the external authority represented by the salt. |

| getPayer() -> bytes32 |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| This function returns the Solana address of the payer account in bytes32 format. Payer account is required if an instruction needs an account to fund newly created accounts. |

| execute(uint64 lamports, Instruction memory instruction) -> bytes |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| This function executes the instruction with a call to the Solana program and returns the data of the executed instruction in bytes format. The `lamports` parameter specifies the amount of lamports that will be required to create new accounts during execution. These lamports are transferred to the `payer` account. The `instruction` parameter is the struct variable with the values of program_id, accounts and instruction_data. |

| executeWithSeed(uint64 lamports, bytes32 salt, Instruction memory instruction) -> bytes |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| This function executes the instruction with a call to the Solana program and returns the data of the executed instruction in bytes format. The `lamports` parameter specifies the amount of lamports that will be required to create new accounts during execution. These lamports are transferred to the `payer` account. The `salt` parameter is to generate an address of external authority. The `instruction` parameter is the struct variable with the values of program_id, accounts and instruction_data. |

| execute(uint64 lamports, bytes memory instruction) -> bytes |
| :---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| This function executes the instruction with a call to the Solana program and returns the data of the executed instruction in bytes format. The `lamports` parameter specifies the amount of lamports that will be required to create new accounts during execution. These lamports are transferred to the `payer` account. The `instruction` is the bincode serialized instruction which needs to be executed. This method uses PDA of the sender to authorize the operation. |

| executeWithSeed(uint64 lamports, bytes32 salt, bytes memory instruction) -> bytes |
| :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| This function executes the instruction with a call to the Solana program and returns the data of the executed instruction in bytes format. The `lamports` parameter specifies the amount of lamports that will be required to create new accounts during execution. These lamports are transferred to the `payer` account. The `salt` parameter is to generate an address of external authority. The `instruction` is the bincode serialized instruction which needs to be executed. This method uses external authority to authorize the operation. |

| getReturnData() -> bytes32, bytes |
| :------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| This function returns the `program_id` and returned data of the last executed instruction. Note: This method should be called after `execute` / `executeWithSeed` methods. |
Loading
Loading