Skip to content

Commit ecd5dbd

Browse files
committed
feat(contracts): wording and finalize
1 parent 9280dc7 commit ecd5dbd

File tree

1 file changed

+57
-58
lines changed

1 file changed

+57
-58
lines changed

build/13-contracts-api.md

+57-58
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
# Contracts API
22

3-
API for creation and management of smart contracts through Apillon wallets on all supported EVM chains.
3+
API for creation and management of smart contracts through Apillon wallets on supported EVM chains.
44

5-
Enables developers without blockchain experience to automate, scale, efficiently manage, secure, and ensure transparency
6-
in smart contract operations on the blockchain through simple API calls.
5+
Enables developers (even without blockchain experience) to deploy, automate, scale, and efficiently manage smart contracts
6+
on the blockchain through simple API calls.
77

88
### Get Contract
99

10-
> Get contracts (available for deploy) by UUID
10+
> Get contract (available for deploy) by UUID
1111
1212
<CodeDiv>GET /contracts/:uuid</CodeDiv>
1313

@@ -26,25 +26,28 @@ in smart contract operations on the blockchain through simple API calls.
2626
| -------- |---------------------|
2727
| 40421001 | Contract not found. |
2828

29-
#### Response
30-
31-
Response is a list of items (shorter version) described [under Response Fields above](#response-fields-2).
29+
#### Response Fields
30+
Contract that can be used to create an instance of deployed contract.
3231

33-
Item is a shorter version because it is a flat object and it doesn't include nested `contractVersion` (with `abi`,
34-
`methods` and `contract`), instead it exposes some details from this table:
32+
| Name | Type | Description |
33+
| --------------- |------------|-----------------------------------------------------|
34+
| contractUuid | `string` | Unique identifier for the contract. |
35+
| contractType | `number` | Type identifier of the contract (described bellow). |
36+
| chainType | `number` | Type of blockchain the contract is deployed on. |
37+
| name | `string` | Name of the contract. |
38+
| description | `string` | Description of the contract. |
39+
| contractVersion | `string` | Version of the contract. |
40+
| createTime | `DateTime` | Creation time of the contract. |
41+
| updateTime | `DateTime` | Update time of the contract. |
3542

36-
##### Response Fields
43+
##### Contract Types
3744

38-
| Name | Type | Description |
39-
| --------------- |-------------------|-----------------------------------------------------|
40-
| contractUuid | `string` | Unique identifier for the contract. |
41-
| contractType | `number` | Type identifier of the contract (described bellow). |
42-
| chainType | `number` | Type of blockchain the contract is deployed on. |
43-
| name | `string` | Name of the contract. |
44-
| description | `string` | Description of the contract. |
45-
| contractVersion | `ContractVersion` | Version of the contract (if available). |
46-
| createTime | `DateTime` | Creation time of the contract. |
47-
| updateTime | `DateTime` | Update time of the contract. |
45+
| Name | Value | Description |
46+
|-----------|-------|-------------------------------|
47+
| OTHER | 1 | Other Contracts |
48+
| ERC_20 | 2 | ERC-20 Compatible Contracts |
49+
| ERC_721 | 3 | ERC-721 Compatible Contracts |
50+
| ERC_1155 | 4 | ERC-1155 Compatible Contracts |
4851

4952
##### Contract Version
5053
Version of the contract used for deploying.
@@ -58,6 +61,7 @@ Version of the contract used for deploying.
5861
| updateTime | `DateTime` | Contract last update time. |
5962

6063
###### Contract ABI
64+
ABI for deployable contract.
6165

6266
| Name | Type | Description |
6367
| --------------- | -------------- | -------------------------------------------- |
@@ -67,6 +71,7 @@ Version of the contract used for deploying.
6771
| outputs | `Output[]` | List of output parameters for the function. |
6872

6973
###### Contract Method
74+
Methods of deployable contract.
7075

7176
| Name | Type | Description |
7277
| ------------- | ---------- | ------------------------------------ |
@@ -76,6 +81,7 @@ Version of the contract used for deploying.
7681
| createTime | `DateTime` | Creation time of the method. |
7782
| updateTime | `DateTime` | Update time of the method. |
7883

84+
7985
</div>
8086
<div class="split_side">
8187

@@ -292,15 +298,17 @@ All query parameters from [listing request](1-apillon-api.md#listing-requests),
292298
#### Response Fields
293299
Endpoint returns ABI methods as an array.
294300

295-
Array item(s) format depends on value of `solidityJson` passed as query parameter (human-readable ABI or ABI in Solidity JSON format).
301+
Array item(s) format depends on value of `solidityJson` passed as query parameter:
302+
- Human-readable ABI (solidityJson=false)
303+
- ABI in Solidity JSON format (solidityJson=true)
296304

297305
</div>
298306
</div>
299307

300308

301309
### Deploy Contract
302310

303-
> Deploy a new contract
311+
> Deploy an instance of contract
304312
305313
<CodeDiv>POST /contracts/:uuid/deploy</CodeDiv>
306314

@@ -423,7 +431,7 @@ curl --location 'https://api.apillon.io/contracts/:uuid/deploy' \
423431

424432
#### Response Fields
425433

426-
| Name | Type | Description |
434+
| Field | Type | Description |
427435
|----------------------|------------------------------|------------------------------------------------------------------------|
428436
| contractUuid | `string` | Unique identifier of the contract. |
429437
| projectUuid | `string` | Unique identifier of the project. |
@@ -441,19 +449,6 @@ curl --location 'https://api.apillon.io/contracts/:uuid/deploy' \
441449
| createTime | `DateTime` | Collection create time. |
442450
| updateTime | `DateTime` | Collection last update time. |
443451

444-
###### Contract
445-
Contract details can be found under contractVersion.contract.
446-
447-
| Name | Type | Description |
448-
| --------------- |------------|-----------------------------------------------------|
449-
| contractUuid | `string` | Unique identifier for the contract. |
450-
| contractType | `number` | Type identifier of the contract (described bellow). |
451-
| chainType | `number` | Type of blockchain the contract is deployed on. |
452-
| name | `string` | Name of the contract. |
453-
| description | `string` | Description of the contract. |
454-
| contractVersion | `string` | Version of the contract. |
455-
| createTime | `DateTime` | Creation time of the contract. |
456-
| updateTime | `DateTime` | Update time of the contract. |
457452

458453
</div>
459454
<div class="split_side">
@@ -603,15 +598,6 @@ curl --location 'https://api.apillon.io/contracts/deployed/:uuid' --header 'Auth
603598
| Moonbase | 1287 | Moonbase Network |
604599
| Moonbeam | 1284 | Moonbeam Network |
605600

606-
###### Contract Types
607-
608-
| Name | Value | Description |
609-
|-----------|-------|-------------------------------|
610-
| OTHER | 1 | Other Contracts |
611-
| ERC_20 | 2 | ERC-20 Compatible Contracts |
612-
| ERC_721 | 3 | ERC-721 Compatible Contracts |
613-
| ERC_1155 | 4 | ERC-1155 Compatible Contracts |
614-
615601
##### Contract Statuses
616602

617603
| Name | Value | Description |
@@ -635,6 +621,7 @@ curl --location 'https://api.apillon.io/contracts/deployed/:uuid' --header 'Auth
635621
### List Deployed Contracts
636622

637623
> Get a list of deployed contracts
624+
638625
> Items are paginated and can be filtered and ordered through query parameters.
639626
640627
<CodeDiv>GET /contracts/deployed</CodeDiv>
@@ -652,7 +639,7 @@ All query parameters from [listing request](1-apillon-api.md#listing-requests) p
652639

653640
#### Response
654641

655-
Response is a list of items (shorter version) described [under Response Fields above](#response-fields-2).
642+
Response is a list of items (shorter version) described [under Response Fields above](#response-fields).
656643

657644
Item is a shorter version because it is a flat object and it doesn't include nested `contractVersion` (with `abi`,
658645
`methods` and `contract`), instead it exposes some details from this table:
@@ -742,7 +729,7 @@ curl --location 'https://api.apillon.io/contracts/deployed' --header 'Authorizat
742729

743730
### Call Deployed Contract
744731

745-
> Execute a function on a deployed contract
732+
> Execute a write function on a deployed contract
746733
747734
<CodeDiv>POST /contracts/deployed/:uuid/call</CodeDiv>
748735

@@ -776,10 +763,9 @@ NOTE: See contract ABI for available methods and arguments required for calling
776763
| 50021006 | Contract address missing. |
777764

778765
#### Response
779-
A response is an instance of the newly created [contract](/build/8-computing-api.html#response-fields-computing-contract).
766+
Response contains transaction details.
780767

781768
##### Response Fields
782-
Response with transaction details.
783769

784770
| Name | Type | Description |
785771
|-------------------|-------------| --------------------------------------------- |
@@ -792,7 +778,7 @@ Response with transaction details.
792778
| transactionHash | `string` | Hash of the transaction. |
793779
| referenceTable | `string` | Reference table for the transaction metadata. |
794780
| referenceId | `string` | Reference identifier for related data. |
795-
| data | `null` | Additional transaction data (if any). |
781+
| data | `any` | Additional transaction data (if any). |
796782
| projectUuid | `string` | Unique identifier of the project. |
797783

798784
</div>
@@ -931,9 +917,7 @@ curl --location --request GET 'https://api.apillon.io/contracts/deployed/:uuid/a
931917
| 40300000 | Not allowed to access deployed contract. |
932918

933919
#### Response
934-
Endpoint returns archived contract.
935-
936-
Array item(s) format depends on value of `solidityJson` passed as query parameter (human-readable ABI or ABI in Solidity JSON format).
920+
Response includes details about archived contract.
937921

938922
##### Response Fields
939923

@@ -1002,7 +986,7 @@ curl --location --request GET 'https://api.apillon.io/contracts/deployed/:uuid/a
1002986

1003987
### List Contract Transactions
1004988

1005-
> Get a list of transactions for a deployed contract
989+
> Get a list of transactions for deployed contract
1006990
1007991
<CodeDiv>GET /contracts/deployed/:uuid/transactions</CodeDiv>
1008992

@@ -1034,9 +1018,24 @@ Endpoint returns transactions for deployed contract based on filters.
10341018

10351019
##### Response Fields
10361020

1037-
| Name | Type | Description |
1038-
| --------------------- |--------------------| --------------------------------------------- |
1039-
| createTime | `DateTime` | Creation time of the contract. |
1021+
| Name | Type | Description |
1022+
|-------------------------|------------|-------------------------------------|
1023+
| `contractUuid` | `string` | UUID of the contract. |
1024+
| `projectUuid` | `string` | UUID of the associated project. |
1025+
| `name` | `string` | Name of the contract. |
1026+
| `description` | `string` | Description of the contract. |
1027+
| `chainType` | `number` | Type of blockchain chain. |
1028+
| `chain` | `number` | ID of the blockchain. |
1029+
| `versionId` | `number` | Version ID of the contract. |
1030+
| `constructorArguments` | `any[]` | Arguments for the constructor. |
1031+
| `contractStatus` | `number` | Status of the contract deployment. |
1032+
| `contractAddress` | `string` | Deployed contract address. |
1033+
| `deployerAddress` | `string` | Address of the deployer. |
1034+
| `transactionHash` | `string` | Transaction hash of deployment. |
1035+
| `contractVersion` | `string` | Version of the contract (nullable). |
1036+
| `createTime` | `Datetime` | Creation time of the contract. |
1037+
| `updateTime` | `Datetime` | Last update time of the contract. |
1038+
10401039

10411040
</div>
10421041
<div class="split_side">
@@ -1045,7 +1044,7 @@ Endpoint returns transactions for deployed contract based on filters.
10451044
<CodeGroupItem title="cURL" active>
10461045

10471046
```sh
1048-
curl --location --request GET 'https://api.apillon.io/contracts/deployed/:uuid' --header 'Authorization: Basic :credentials'
1047+
curl --location --request GET 'https://api.apillon.io/contracts/deployed/:uuid/transactions' --header 'Authorization: Basic :credentials'
10491048
```
10501049

10511050
</CodeGroupItem>

0 commit comments

Comments
 (0)