diff --git a/api/starknet_write_api.json b/api/starknet_write_api.json index 557eeb4..e47c630 100644 --- a/api/starknet_write_api.json +++ b/api/starknet_write_api.json @@ -105,7 +105,7 @@ }, "errors": [ { - "$ref": "#/components/errors/CLASS_HASH_NOT_FOUND" + "$ref": "./api/starknet_api_openrpc.json#/components/errors/CLASS_HASH_NOT_FOUND" } ] } @@ -141,6 +141,66 @@ }, "FUNCTION_CALL": { "$ref": "./api/starknet_api_openrpc.json#/components/schemas/FUNCTION_CALL" + }, + "SIERRA_ENTRY_POINT": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/SIERRA_ENTRY_POINT" + }, + "BROADCASTED_TXN_COMMON_PROPERTIES": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_TXN_COMMON_PROPERTIES" + }, + "INVOKE_TXN_V0": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/INVOKE_TXN_V0" + }, + "INVOKE_TXN_V1": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/INVOKE_TXN_V1" + }, + "ADDRESS": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/ADDRESS" + }, + "BROADCASTED_DECLARE_TXN_V1": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_DECLARE_TXN_V1" + }, + "DEPRECATED_CONTRACT_CLASS": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/DEPRECATED_CONTRACT_CLASS" + }, + "DEPRECATED_CAIRO_ENTRY_POINT": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/DEPRECATED_CAIRO_ENTRY_POINT" + }, + "CONTRACT_ABI": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/CONTRACT_ABI" + }, + "CONTRACT_ABI_ENTRY": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/CONTRACT_ABI_ENTRY" + }, + "FUNCTION_ABI_ENTRY": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/FUNCTION_ABI_ENTRY" + }, + "FUNCTION_ABI_TYPE": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/FUNCTION_ABI_TYPE" + }, + "TYPED_PARAMETER": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/TYPED_PARAMETER" + }, + "EVENT_ABI_ENTRY": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/EVENT_ABI_ENTRY" + }, + "EVENT_ABI_TYPE": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/EVENT_ABI_TYPE" + }, + "STRUCT_ABI_ENTRY": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/STRUCT_ABI_ENTRY" + }, + "STRUCT_ABI_TYPE": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/STRUCT_ABI_TYPE" + }, + "STRUCT_MEMBER": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/STRUCT_MEMBER" + }, + "BROADCASTED_DECLARE_TXN_V2": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/BROADCASTED_DECLARE_TXN_V2" + }, + "DEPLOY_ACCOUNT_TXN_PROPERTIES": { + "$ref": "./api/starknet_api_openrpc.json#/components/schemas/DEPLOY_ACCOUNT_TXN_PROPERTIES" } }, "errors": { @@ -148,9 +208,6 @@ "code": 50, "message": "Invalid contract class" }, - "CLASS_HASH_NOT_FOUND": { - "$ref": "./api/starknet_api_openrpc.json#/components/errors/CLASS_HASH_NOT_FOUND" - }, "CLASS_ALREADY_DECLARED": { "code": 51, "message": "Class already declared" diff --git a/package.json b/package.json index f60c7e0..9233cd2 100644 --- a/package.json +++ b/package.json @@ -7,13 +7,17 @@ "url": "https://github.com/starkware-libs/starknet-specs.git" }, "scripts": { - "validate_all": "node validate.js api/starknet_api_openrpc.json && node validate.js api/starknet_write_api.json && node validate.js api/starknet_trace_api_openrpc.json" + "validate_all": "node validate.js api/starknet_api_openrpc.json && node validate.js api/starknet_write_api.json && node validate.js api/starknet_trace_api_openrpc.json", + "gen_api": " node ./node_modules/@open-rpc/typings/build/cli.js -d ./api/starknet_api_openrpc.json --output-ts . --name-ts starknet_api", + "gen_write_api": " node ./node_modules/@open-rpc/typings/build/cli.js -d ./api/starknet_write_api.json --output-ts . --name-ts starknet_write_api", + "gen_trace_api": " node ./node_modules/@open-rpc/typings/build/cli.js -d ./api/starknet_trace_api_openrpc.json --output-ts . --name-ts starknet_trace_api" }, "author": "Lior Schejter", "license": "MIT", "dependencies": { + "@json-schema-tools/dereferencer": "1.5.4", "@open-rpc/schema-utils-js": "^1.16.1", - "fs-extra": "10.1.0", - "@json-schema-tools/dereferencer": "1.5.4" + "@open-rpc/typings": "^1.12.3", + "fs-extra": "10.1.0" } }