Generate md file for zod schemas using modified version of zod2md #622
+295
−60
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Type of PR:
Required reviews:
What this does:
Issues fixed/closed:
Why it's needed:
Notes for reviewers:
The generated file would be something similar to:
Conditions Schemas
AnyCondition
Union of the following possible types:
UserAddress
Enum string, one of the following possible values:
':userAddress'
':userAddressExternalEIP4361'
BaseCondition
Object containing the following properties:
conditionType
(*)string
(*) Required.
HttpsURL
String which is a valid URL.
JsonPath
String.
PlainString
String.
CompoundCondition
Object containing the following properties:
conditionType
'compound'
'compound'
operator
(*)'and' | 'or' | 'not'
operands
(*)(*) Required.
ContextParam
String which matches the regular expression
/^:[a-zA-Z_][a-zA-Z0-9_]*$/
.ParamOrContextParam
Union of the following possible types:
boolean
ornumber
ContractCondition
Object containing the following properties:
conditionType
'contract'
'contract'
chain
(*)number
(int, ≥0)method
(*)string
parameters
(*)returnValueTest
(*)contractAddress
(*)string
standardContractType
'ERC20' | 'ERC721'
functionAbi
(*) Required.
FunctionAbi
Object containing the following properties:
name
(*)string
type
(*)'function'
inputs
(*)outputs
(*)stateMutability
(*)'view' | 'pure'
(*) Required.
FunctionAbiVariable
Object containing the following properties:
name
(*)string
type
(*)'bool' | 'string' | 'address' | 'address payable' | 'bytes1' | 'bytes2' | 'bytes3' | 'bytes4' | 'bytes5' | 'bytes6' | 'bytes7' | 'bytes8' | 'bytes9' | 'bytes10' | 'bytes11' | 'bytes12' | 'bytes13' | 'bytes14' | 'bytes15' | 'bytes16' | ...
internalType
(*)'bool' | 'string' | 'address' | 'address payable' | 'bytes1' | 'bytes2' | 'bytes3' | 'bytes4' | 'bytes5' | 'bytes6' | 'bytes7' | 'bytes8' | 'bytes9' | 'bytes10' | 'bytes11' | 'bytes12' | 'bytes13' | 'bytes14' | 'bytes15' | 'bytes16' | ...
(*) Required.
IfThenElseCondition
Object containing the following properties:
conditionType
'if-then-else'
'if-then-else'
ifCondition
(*)thenCondition
(*)elseCondition
(*)boolean
(*) Required.
JsonApiCondition
Object containing the following properties:
conditionType
'json-api'
'json-api'
endpoint
(*)parameters
string
and values of typeunknown
(optional & nullable)query
authorizationToken
returnValueTest
(*)(*) Required.
JsonRpcCondition
Object containing the following properties:
conditionType
'json-rpc'
'json-rpc'
endpoint
(*)method
(*)string
params
Array<unknown>
or Object with dynamic keys of typestring
and values of typeunknown
(optional & nullable)query
authorizationToken
returnValueTest
(*)(*) Required.
ReturnValueTest
Object containing the following properties:
index
number
(int, ≥0)comparator
(*)'==' | '>' | '<' | '>=' | '<=' | '!='
value
(*)(*) Required.
RpcCondition
eth_getBalance schema specification
Object containing the following properties:
conditionType
'rpc'
'rpc'
chain
(*)number
(int, ≥0)method
(*)'eth_getBalance'
parameters
(*)
Description: Spec requires 2 parameters: an address and a block identifierstring
, UserAddress or ContextParamnumber
(int, ≥0),string
(regex:/^0x[a-fA-F0-9]{64}$/
) or'earliest' | 'finalized' | 'safe' | 'latest' | 'pending'
or ContextParamor Tuple:
Description: Block identifier can be omitted, since web3py (which runs on TACo exec layer) defaults to 'latest'string
, UserAddress or ContextParamreturnValueTest
(*)(*) Required.
ConditionVariable
Object containing the following properties:
varName
(*)condition
(*)(*) Required.
SequentialCondition
Object containing the following properties:
conditionType
'sequential'
'sequential'
conditionVariables
(*)(*) Required.
TimeCondition
Object containing the following properties:
conditionType
'time'
'time'
chain
(*)number
(int, ≥0)method
'blocktime'
'blocktime'
returnValueTest
(*)(*) Required.