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

API Reference, seid reference, transactions page addition #90

Closed
wants to merge 12 commits into from

Conversation

codebycarson
Copy link
Contributor

This PR adds an API reference section and a seid reference section as well as makes some small content tweaks and adds a new transactions page to show the strucuture of TX's.

  • Added dynamic routes for the API from the openapi spec generated by the "sei-chain" repo
  • Added code highlight component
  • Added seid reference and script to generate seid docs
  • Moved EVM endpoints
  • Added transaction structure
  • Added ts-node to dev dependencies

- Added dynamic routes for the API from the openapi spec generated by the "sei-chain" repo
- Added code highlight component
- Added seid reference and script to generate seid docs
- Moved EVM endpoints
- Added transaction structure
- Added ts-node to dev dependencies
@codebycarson codebycarson requested a review from a team as a code owner June 25, 2024 17:00
{`import { getQueryClient } from '@sei-js/cosmjs';

const queryClient = await getQueryClient("YOUR_RPC_URL");
const { ${routeNames.functionName} } = queryClient.${parts[0]}.${parts[1]}.${parts[2]};
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a more programatic way to do this? i.e. what if there's only 2 parts or there's more than 3?

also, can we have some sort of mapping of function name to parts instead of parsing the actual endpoint to get the query client function?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Any route I've seen has at least three parts. I can look into optimizations, but this works and doesn't require a mapping registry.


Transactions are fundamental operations on the Sei blockchain and are required for any state updates on chain such as token transfers, account creation, and smart contract execution. Transactions are cryptographically signed by the sender’s private key to ensure authenticity and ownership. For more information on private keys, refer to the advanced section on [HD Paths and Coin Types](/dev-advanced-concepts/hd-path-coin-types)

## Transaction Types
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

might be useful to show how an evm tx looks on the cosmos side?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe this can be broken down a bit and show just the good bits

${restAddress}/cosmos/tx/v1beta1/txs/${txHash}

{
  "tx": {
    "body": {
      "messages": [
        {
          "@type": "string",
          "data": {
            "@type": "string",
            "chain_id": "string",
            "nonce": "string",
            "gas_tip_cap": "string",
            "gas_fee_cap": "string",
            "gas_limit": "string",
            "to": "string",
            "value": "string",
            "data": "string|null",
            "accesses": "array",
            "v": "string|null",
            "r": "string",
            "s": "string"
          },
          "derived": "string|null"
        }
      ],
      "memo": "string",
      "timeout_height": "string",
      "extension_options": "array",
      "non_critical_extension_options": "array"
    },
    "auth_info": {
      "signer_infos": "array",
      "fee": {
        "amount": "array",
        "gas_limit": "string",
        "payer": "string",
        "granter": "string"
      }
    },
    "signatures": "array"
  },
  "tx_response": {
    "height": "string",
    "txhash": "string",
    "codespace": "string",
    "code": "integer",
    "data": "string",
    "raw_log": "string",
    "logs": [
      {
        "msg_index": "integer",
        "log": "string",
        "events": [
          {
            "type": "string",
            "attributes": [
              {
                "key": "string",
                "value": "string"
              },
              {
                "key": "string",
                "value": "string"
              }
            ]
          }
        ]
      }
    ],
    "info": "string",
    "gas_wanted": "string",
    "gas_used": "string",
    "tx": {
      "@type": "string",
      "body": {
        "messages": [
          {
            "@type": "string",
            "data": {
              "@type": "string",
              "chain_id": "string",
              "nonce": "string",
              "gas_tip_cap": "string",
              "gas_fee_cap": "string",
              "gas_limit": "string",
              "to": "string",
              "value": "string",
              "data": "string|null",
              "accesses": "array",
              "v": "string|null",
              "r": "string",
              "s": "string"
            },
            "derived": "string|null"
          }
        ],
        "memo": "string",
        "timeout_height": "string",
        "extension_options": "array",
        "non_critical_extension_options": "array"
      },
      "auth_info": {
        "signer_infos": "array",
        "fee": {
          "amount": "array",
          "gas_limit": "string",
          "payer": "string",
          "granter": "string"
        }
      },
      "signatures": "array"
    },
    "timestamp": "string",
    "events": [
      {
        "type": "string",
        "attributes": [
          {
            "key": "string",
            "value": "string",
            "index": "boolean"
          },
          {
            "key": "string",
            "value": "string",
            "index": "boolean"
          }
        ]
      },
      {
        "type": "string",
        "attributes": [
          {
            "key": "string",
            "value": "string",
            "index": "boolean"
          },
          {
            "key": "string",
            "value": "string",
            "index": "boolean"
          }
        ]
      }
    ]
  }
}

yarn-error.log Outdated
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

probably should gitigore this?

- Added dynamic routes for the API from the openapi spec generated by the "sei-chain" repo
- Added code highlight component
- Added seid reference and script to generate seid docs
- Moved EVM endpoints
- Added transaction structure
- Added ts-node to dev dependencies
-gitignored yarn error.log
- Slight improvement to endpoint page to be more clear
@besated besated self-requested a review July 1, 2024 22:14
@cordt-sei
Copy link
Contributor

Looks good to me after local build + testing

@codebycarson codebycarson deleted the feature/seid-api-reference branch July 2, 2024 01:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants