Skip to content

Commit

Permalink
Merge pull request #11 from koinos/8-read-contract
Browse files Browse the repository at this point in the history
#8: Update API paths and move read contract to contract/[contract_id]…
  • Loading branch information
sgerbino authored May 7, 2024
2 parents 8ed25ee + 9101f02 commit b282c0c
Show file tree
Hide file tree
Showing 25 changed files with 26 additions and 27 deletions.
2 changes: 1 addition & 1 deletion app/v1/account/[account]/nonce/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { decode } from 'punycode'

/**
* @swagger
* /api/account/{account}/nonce:
* /v1/account/{account}/nonce:
* get:
* tags: [Accounts]
* description: Returns the account's nonce
Expand Down
2 changes: 1 addition & 1 deletion app/v1/block/[block_id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { decodeOperations } from '@/utils/operations'

/**
* @swagger
* /api/block/{block_id}:
* /v1/block/{block_id}:
* get:
* tags: [Blocks]
* description: Input a block id or number. Return data about that block and its receipt.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/chain/fork_heads/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getProvider } from '@/utils/providers'

/**
* @swagger
* /api/chain/fork_heads:
* /v1/chain/fork_heads:
* get:
* tags: [Chain]
* description: Returns the chain's fork heads
Expand Down
2 changes: 1 addition & 1 deletion app/v1/chain/head_info/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getProvider } from '@/utils/providers'

/**
* @swagger
* /api/chain/head_info:
* /v1/chain/head_info:
* get:
* tags: [Chain]
* description: Returns the chain's head info
Expand Down
2 changes: 1 addition & 1 deletion app/v1/chain/id/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getProvider } from '@/utils/providers'

/**
* @swagger
* /api/chain/id:
* /v1/chain/id:
* get:
* tags: [Chain]
* description: Returns the chain id
Expand Down
2 changes: 1 addition & 1 deletion app/v1/chain/resource_limits/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { getProvider } from '@/utils/providers'

/**
* @swagger
* /api/chain/resource_limits:
* /v1/chain/resource_limits:
* get:
* tags: [Chain]
* description: Returns the chain's resource limits
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { AppError, handleError, getErrorMessage } from '@/utils/errors'

/**
* @swagger
* /api/contract/{contract_id}/read/{method}:
* /v1/contract/{contract_id}/{method}:
* get:
* tags: [Contracts]
* description: Read the contract contract using the method and arguments provided
Expand Down Expand Up @@ -89,7 +89,7 @@ export async function GET(

/**
* @swagger
* /api/contract/{contract_id}/read/{method}:
* /v1/contract/{contract_id}/{method}:
* post:
* tags: [Contracts]
* description: Read the contract using the method and arguments provided
Expand All @@ -108,7 +108,6 @@ export async function GET(
* description: Method of the contract to call
* required: true
* example: balance_of
* - $ref: '#/components/parameters/X-JSON-RPC-URL'
* requestBody:
* description: Arguments for the method call
* required: true
Expand Down
2 changes: 1 addition & 1 deletion app/v1/contract/[contract_id]/abi/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import protobufjs from 'protobufjs'

/**
* @swagger
* /api/contract/{contract_id}/abi:
* /v1/contract/{contract_id}/abi:
* get:
* tags: [Contracts]
* description: Returns the contract's ABI
Expand Down
2 changes: 1 addition & 1 deletion app/v1/decode/events/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { decodeEvents } from '@/utils/events'

/**
* @swagger
* /api/decode/events:
* /v1/decode/events:
* post:
* tags: [Decode]
* description: This endpoint takes an array of "encoded" events and returns an array of "decoded" events. Feel free to test the example request body and response below before testing out your own data.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/decode/operations/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { decodeOperations } from '@/utils/operations'

/**
* @swagger
* /api/decode/operations:
* /v1/decode/operations:
* post:
* tags: [Decode]
* description: This endpoint takes an array of 'encoded' operations and returns an array of 'decoded' operations. Feel free to test the example request body and response below before testing out your own data.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/nft/[contract_id]/balance/[account]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getNFTContract } from '@/utils/tokens'

/**
* @swagger
* /api/nft/{contract_id}/balance/{account}:
* /v1/nft/{contract_id}/balance/{account}:
* get:
* tags: [Non Fungible Tokens]
* description: Returns the non fungible token's account balance.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/nft/[contract_id]/info/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { utils } from 'koilib'

/**
* @swagger
* /api/nft/{contract_id}/info:
* /v1/nft/{contract_id}/info:
* get:
* tags: [Non Fungible Tokens]
* description: Returns information about the non fungible token, such as its name, symbol, total supply, and URI.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/nft/[contract_id]/name/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getNFTContract } from '@/utils/tokens'

/**
* @swagger
* /api/nft/{contract_id}/name:
* /v1/nft/{contract_id}/name:
* get:
* tags: [Non Fungible Tokens]
* description: Returns the name of the non fungible token.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/nft/[contract_id]/symbol/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getNFTContract } from '@/utils/tokens'

/**
* @swagger
* /api/nft/{contract_id}/symbol:
* /v1/nft/{contract_id}/symbol:
* get:
* tags: [Non Fungible Tokens]
* description: Returns the symbol of the non fungible token.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/nft/[contract_id]/total_supply/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getNFTContract } from '@/utils/tokens'

/**
* @swagger
* /api/nft/{contract_id}/total_supply:
* /v1/nft/{contract_id}/total_supply:
* get:
* tags: [Non Fungible Tokens]
* description: Returns the total supply of the non fungible token.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/nft/[contract_id]/uri/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getNFTContract } from '@/utils/tokens'

/**
* @swagger
* /api/nft/{contract_id}/uri:
* /v1/nft/{contract_id}/uri:
* get:
* tags: [Non Fungible Tokens]
* description: Returns the URI associated with the non fungible token contract.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/token/[contract_id]/balance/[account]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { utils } from 'koilib'

/**
* @swagger
* /api/token/{contract_id}/balance/{account}:
* /v1/token/{contract_id}/balance/{account}:
* get:
* tags: [Fungible Tokens]
* description: Returns the fungible token balance for a specific account
Expand Down
2 changes: 1 addition & 1 deletion app/v1/token/[contract_id]/decimals/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getFTContract } from '@/utils/tokens'

/**
* @swagger
* /api/token/{contract_id}/decimals:
* /v1/token/{contract_id}/decimals:
* get:
* tags: [Fungible Tokens]
* description: Returns the number of decimals for a fungible token
Expand Down
2 changes: 1 addition & 1 deletion app/v1/token/[contract_id]/info/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { utils } from 'koilib'

/**
* @swagger
* /api/token/{contract_id}/info:
* /v1/token/{contract_id}/info:
* get:
* tags: [Fungible Tokens]
* description: Returns the fungible token's information such as name, symbol, decimals, and total supply
Expand Down
2 changes: 1 addition & 1 deletion app/v1/token/[contract_id]/name/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getFTContract } from '@/utils/tokens'

/**
* @swagger
* /api/token/{contract_id}/name:
* /v1/token/{contract_id}/name:
* get:
* tags: [Fungible Tokens]
* description: Returns the name of the fungible token
Expand Down
2 changes: 1 addition & 1 deletion app/v1/token/[contract_id]/symbol/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { getFTContract } from '@/utils/tokens'

/**
* @swagger
* /api/token/{contract_id}/symbol:
* /v1/token/{contract_id}/symbol:
* get:
* tags: [Fungible Tokens]
* description: Returns the symbol of the fungible token
Expand Down
2 changes: 1 addition & 1 deletion app/v1/token/[contract_id]/total_supply/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { utils } from 'koilib'

/**
* @swagger
* /api/token/{contract_id}/total_supply:
* /v1/token/{contract_id}/total_supply:
* get:
* tags: [Fungible Tokens]
* description: Returns the total supply of the fungible token
Expand Down
2 changes: 1 addition & 1 deletion app/v1/transaction/[transaction_id]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { interfaces } from 'koilib'

/**
* @swagger
* /api/transaction/{transaction_id}:
* /v1/transaction/{transaction_id}:
* get:
* tags: [Transactions]
* description: Returns detailed information about a specific transaction.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/transaction/prepare/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { NextRequest, NextResponse } from 'next/server'

/**
* @swagger
* /api/transaction/prepare:
* /v1/transaction/prepare:
* post:
* tags: [Transactions]
* description: This endpoint takes a transaction and an optional provider and/or payer, then returns a prepared transaction object.
Expand Down
2 changes: 1 addition & 1 deletion app/v1/transaction/submit/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { revalidatePath } from 'next/cache'

/**
* @swagger
* /api/transaction/submit:
* /v1/transaction/submit:
* post:
* tags: [Transactions]
* description: This endpoint takes a transaction and submits it to the JSON RPC node.
Expand Down

0 comments on commit b282c0c

Please sign in to comment.