For the complete documentation index, see llms.txt. This page is also available as Markdown.

Contracts

Compile a contract script

post

Compiles a contract script written in ALPH TxScript language. Returns metadata about the compiled bytecode, fields, functions, and any warnings.

Authorizations
api-keystringRequired
Body
codestringOptional

The contract script source code in TxScript language

Example: TxScript Main { let token = Token(#36cdbfabca2d71622b6) token.withdraw(@1AujpupFP4KWeZvqA7itsHY9cLJmx4qTzojVZrg8W9y, 1024) }
Responses
200

Compilation result with bytecode and metadata

application/json
versionstringOptional

Version of the compiler used

Example: v0.0.1
namestringOptional

Name of the contract

Example: Main
bytecodeTemplatestringOptional

Bytecode template of the compiled contract

Example: 35d1b2a520a0da34c5eb8d712aa9cc
bytecodeDebugPatchstringOptional

Debug patch information for the bytecode

Example: =1-1+ef
warningsstring[]Optional

List of compilation warnings

Example: ["Found unused fields in Foo: a"]
post/contracts/compile-script

Execute script

post

Build an unsigned script

Authorizations
api-keystringRequired
Body
fromPublicKeystring · hex-stringRequired
fromPublicKeyTypestring · hex-stringOptional
bytecodestring · hex-stringRequired
attoAlphAmountstring · uint256Optional
gasAmountinteger · gasOptional
gasPricestring · uint256Optional
targetBlockHashstring · block-hashOptional
gasEstimationMultipliernumber · doubleOptional
Responses
200

Valid response

application/json
fromGroupinteger · int32Required
toGroupinteger · int32Required
unsignedTxstringRequired
gasAmountinteger · gasRequired
gasPricestring · uint256Required
txIdstring · 32-byte-hashRequired
post/contracts/unsigned-tx/execute-script

Compile contract

post

Compile a smart contract

Authorizations
api-keystringRequired
Body
codestringRequired
Responses
200

Valid response

application/json
versionstringRequired
namestringRequired
bytecodestringRequired
bytecodeDebugPatchstringRequired
codeHashstring · 32-byte-hashRequired
codeHashDebugstring · 32-byte-hashRequired
warningsstring[]Required
stdInterfaceIdstringOptional
post/contracts/compile-contract

Compile a project

post

Compile project

Authorizations
api-keystringRequired
Body
codestringRequired
Responses
200

Valid response

application/json
post/contracts/compile-project

Build an unsigned contract

post

Deploy-contract

Authorizations
api-keystringRequired
Body
fromPublicKeystring · hex-stringRequired
fromPublicKeyTypestring · hex-stringOptional
bytecodestring · hex-stringRequired
initialAttoAlphAmountstring · uint256Optional
issueTokenAmountstring · uint256Optional
issueTokenTostring · addressOptional
gasAmountinteger · gasOptional
gasPricestring · uint256Optional
targetBlockHashstring · block-hashOptional
Responses
200

Valid response

application/json
fromGroupinteger · int32Required
toGroupinteger · int32Required
unsignedTxstringRequired
gasAmountinteger · gasRequired
gasPricestring · uint256Required
txIdstring · 32-byte-hashRequired
contractAddressstring · addressRequired
post/contracts/unsigned-tx/deploy-contract

Get contract state

get
Authorizations
api-keystringRequired
Path parameters
addressstring · addressRequired
Responses
200

Valid response

application/json
addressstring · addressRequired
bytecodestring · contractRequired
codeHashstring · 32-byte-hashRequired
initialStateHashstring · 32-byte-hashOptional
get/contracts/{address}/state

Test contract

post

Test contract

Authorizations
api-keystringRequired
Body
groupinteger · int32Optional
blockHashstring · block-hashOptional
blockTimeStampinteger · int64Optional
txIdstring · 32-byte-hashOptional
addressstring · addressOptional
callerAddressstring · addressOptional
bytecodestring · contractRequired
methodIndexinteger · int32Optional
Responses
200

Valid response

application/json
addressstring · addressRequired
codeHashstring · 32-byte-hashRequired
gasUsedinteger · int32Required
txInputsstring · address[]Required
post/contracts/test-contract

Call contract

post

Call contract

Authorizations
api-keystringRequired
Body
groupinteger · int32Required
worldStateBlockHashstring · block-hashOptional
txIdstring · 32-byte-hashOptional
addressstring · addressRequired
callerAddressstring · addressOptional
methodIndexinteger · int32Required
interestedContractsstring · address[]Optional
Responses
200

Valid response

application/json
or
post/contracts/call-contract

Multiple call contract

post

Multicall contract

Authorizations
api-keystringRequired
Body
Responses
200

Valid response

application/json
post/contracts/multicall-contract

Call TxScript

post

Call TxScript

Authorizations
api-keystringRequired
Body
groupinteger · int32Required
bytecodestring · hex-stringRequired
callerAddressstring · addressOptional
worldStateBlockHashstring · block-hashOptional
txIdstring · 32-byte-hashOptional
interestedContractsstring · address[]Optional
Responses
200

Valid response

application/json
gasUsedinteger · int32Required
txInputsstring · address[]Required
post/contracts/call-tx-script

Last updated