Skip to content

Commit

Permalink
Merge branch 'main' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
oable committed Jul 4, 2024
2 parents 01d8f46 + 0c59813 commit 1865f1f
Show file tree
Hide file tree
Showing 90 changed files with 10,325 additions and 4,313 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/update_prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/update_qa_stand.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [16]
node-version: [18]
steps:
- name: Checkout
uses: actions/checkout@v1
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM node:16-alpine
FROM node:18-alpine

WORKDIR /app
COPY package*.json ./
Expand Down
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
30 changes: 15 additions & 15 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 @@ -172,7 +172,7 @@ The [JSON](#get-neon-gas-price-request-as-json) for this request schema is avail

<TabItem value="Schema" label="Response" default>

The [JSON](#get-neon-gas-price-request-as-json) for this response schema is available below.
The [JSON](#get-neon-gas-price-response-as-json) for this response schema is available below.

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

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

## 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

0 comments on commit 1865f1f

Please sign in to comment.