Skip to content

Commit

Permalink
Merge pull request #179 from okto-hq/main
Browse files Browse the repository at this point in the history
raw read and nft portfolio api
  • Loading branch information
oviawork authored Dec 6, 2024
2 parents f60afae + a2a4d7a commit 52e73b6
Show file tree
Hide file tree
Showing 4 changed files with 359 additions and 2 deletions.
2 changes: 1 addition & 1 deletion app/api-docs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const App = () => {
<ApiReferenceReact
configuration={{
spec: {
url: 'https://docs.okto.tech/api-sec',
url: '/api-sec',
},
theme: 'none',
darkMode: theme === 'dark',
Expand Down
2 changes: 1 addition & 1 deletion app/server-api-docs/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ const App = () => {
<ApiReferenceReact
configuration={{
spec: {
url: 'https://docs.okto.tech/server-api-sec',
url: '/server-api-sec',
},
theme: 'none',
darkMode: theme === 'dark',
Expand Down
135 changes: 135 additions & 0 deletions public/server.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -421,6 +421,125 @@ paths:
application/json:
schema:
"$ref": "#/components/responses/BadRequest"
"/s2s/api/v1/readContractData":
post:
tags:
- Server
summary: Read Contract Data
description: |
Read data from a smart contract on a specified network. The API returns the data from the contract based on the input parameters. Supports both EVM and Aptos networks.
operationId: readContractData
security: [
{
apiKeyHeader: []
}
]
parameters:
- "$ref": "#/components/parameters/x_api_key"
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- network_name
- data
properties:
network_name:
type: string
description: "The network on which to read the contract data"
example: "POLYGON"
data:
type: object
description: |
Read data from a contract on a network. Choose the appropriate data object based on the network it is meant for.
oneOf:
- type: object
description: "EVM Contract Read Data"
required:
- contractAddress
- abi
properties:
contractAddress:
type: string
description: "The address of the contract to read from"
example: "0x3BA4c387f786bFEE076A58914F5Bd38d668B42c3"
abi:
type: object
properties:
inputs:
type: array
items:
type: object
example: []
name:
type: string
example: "totalSupply"
outputs:
type: array
items:
type: object
properties:
internalType:
type: string
name:
type: string
type:
type: string
example: [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
]
stateMutability:
type: string
example: "view"
type:
type: string
example: "function"
args:
type: object
description: "Arguments to pass to the function"
example: {}
- type: object
description: "Aptos Contract Read Data"
required:
- function
- typeArguments
- functionArguments
properties:
function:
type: string
description: "The full function path to call"
example: "0x1::chain_id::get"
typeArguments:
type: array
description: "Type arguments for the function"
items:
type: string
example: []
functionArguments:
type: array
description: "Arguments to pass to the function"
items:
type: string
example: []
responses:
"200":
description: Contract data read successfully
content:
application/json:
schema:
"$ref": "#/components/schemas/ServerReadContractDataResponse"
"400":
description: Bad Request
content:
application/json:
schema:
"$ref": "#/components/responses/BadRequest"
"/s2s/api/v1/rawtransaction/execute/{TW_USER_ID}":
post:
tags:
Expand Down Expand Up @@ -2550,6 +2669,22 @@ components:
required:
- status
- data
ServerReadContractDataResponse:
type: object
properties:
status:
type: string
description: Status of the contract read request
enum: [success, failure]
data:
type: array
description: Array containing the return values from the contract
items:
type: string
example: ["17568733881984076448"]
required:
- status
- data
ServerRawTransactionStatusResponse:
type: object
properties:
Expand Down
Loading

0 comments on commit 52e73b6

Please sign in to comment.