@blockscout/contracts-info-types 0.0.1-beta.820070b
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/camel/contracts_info.d.ts +306 -0
- package/dist/camel/contracts_info.js +26 -0
- package/dist/camel/contracts_info.ts +354 -0
- package/dist/contracts_info.d.ts +306 -0
- package/dist/contracts_info.js +26 -0
- package/dist/contracts_info.ts +354 -0
- package/index.d.ts +19 -0
- package/index.js +5 -0
- package/index.ts +61 -0
- package/package.json +29 -0
package/index.d.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import type { Pagination } from './dist/contracts_info';
|
|
2
|
+
import type { TokenInfo as TokenInfoCamel, VerifiedAddress as VerifiedAddressCamel } from './dist/camel/contracts_info';
|
|
3
|
+
export * from './dist/contracts_info';
|
|
4
|
+
export type TokenInfo = TokenInfoCamel;
|
|
5
|
+
export { VerifiedAddress, AddressMetadata, VerifiedAddressOwner, VerifyAddressResponse, VerifyAddressResponse_Status, VerifyAddressResponse_Success, VerifyAddressResponse_InvalidSignerError, PrepareAddressResponse, PrepareAddressResponse_Status, PrepareAddressResponse_Success, } from './dist/camel/contracts_info';
|
|
6
|
+
export interface ListTokenInfosResponse {
|
|
7
|
+
token_infos: TokenInfo[];
|
|
8
|
+
}
|
|
9
|
+
export interface SearchTokenInfosResponse {
|
|
10
|
+
token_infos: TokenInfo[];
|
|
11
|
+
next_page_params: Pagination | undefined;
|
|
12
|
+
}
|
|
13
|
+
export interface ImportTokenInfoAdminRequest {
|
|
14
|
+
/** Token info to be imported. */
|
|
15
|
+
token_info: TokenInfo | undefined;
|
|
16
|
+
}
|
|
17
|
+
export interface ListUserVerifiedAddressesResponse {
|
|
18
|
+
verifiedAddresses: VerifiedAddressCamel[];
|
|
19
|
+
}
|
package/index.js
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
// All messages, serialized snake_case by the gRPC gateway
|
|
2
|
+
// (build.rs sets `json_names_for_fields=false`). This is the default for
|
|
3
|
+
// most resources (pools, dexes, etc.).
|
|
4
|
+
export * from './dist/contracts_info';
|
|
5
|
+
export { VerifyAddressResponse_Status, PrepareAddressResponse_Status, } from './dist/camel/contracts_info';
|
package/index.ts
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import type {Pagination} from './dist/contracts_info';
|
|
2
|
+
import type {
|
|
3
|
+
TokenInfo as TokenInfoCamel,
|
|
4
|
+
VerifiedAddress as VerifiedAddressCamel,
|
|
5
|
+
} from './dist/camel/contracts_info';
|
|
6
|
+
|
|
7
|
+
// All messages, serialized snake_case by the gRPC gateway
|
|
8
|
+
// (build.rs sets `json_names_for_fields=false`). This is the default for
|
|
9
|
+
// most resources (pools, dexes, etc.).
|
|
10
|
+
export * from './dist/contracts_info';
|
|
11
|
+
|
|
12
|
+
// ---------------------------------------------------------------------------
|
|
13
|
+
// camelCase resources
|
|
14
|
+
//
|
|
15
|
+
// A few resources are NOT serialized by the gRPC gateway but by a serde layer
|
|
16
|
+
// with `#[serde(rename_all = "camelCase")]` (see contracts-info-core
|
|
17
|
+
// handlers/token_info.rs and handlers/verified_address.rs). Their JSON is
|
|
18
|
+
// camelCase on both the request and response side — confirmed against the live
|
|
19
|
+
// service (e.g. PrepareAddress rejects `contract_address`, requires
|
|
20
|
+
// `contractAddress`). We pull those messages from a second, camelCase build and
|
|
21
|
+
// let these explicit exports shadow the snake_case versions from `export *`.
|
|
22
|
+
// ---------------------------------------------------------------------------
|
|
23
|
+
export type TokenInfo = TokenInfoCamel;
|
|
24
|
+
export {
|
|
25
|
+
VerifiedAddress,
|
|
26
|
+
AddressMetadata,
|
|
27
|
+
VerifiedAddressOwner,
|
|
28
|
+
VerifyAddressResponse,
|
|
29
|
+
VerifyAddressResponse_Status,
|
|
30
|
+
VerifyAddressResponse_Success,
|
|
31
|
+
VerifyAddressResponse_InvalidSignerError,
|
|
32
|
+
PrepareAddressResponse,
|
|
33
|
+
PrepareAddressResponse_Status,
|
|
34
|
+
PrepareAddressResponse_Success,
|
|
35
|
+
} from './dist/camel/contracts_info';
|
|
36
|
+
|
|
37
|
+
// ---------------------------------------------------------------------------
|
|
38
|
+
// Mixed wrappers
|
|
39
|
+
//
|
|
40
|
+
// List/search responses are serialized snake_case at the wrapper level
|
|
41
|
+
// (e.g. `{"token_infos": [...]}`), but the nested resource objects come back
|
|
42
|
+
// camelCase. So we keep the snake field names and only swap the element type
|
|
43
|
+
// to the camelCase version.
|
|
44
|
+
// ---------------------------------------------------------------------------
|
|
45
|
+
export interface ListTokenInfosResponse {
|
|
46
|
+
token_infos: TokenInfo[];
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
export interface SearchTokenInfosResponse {
|
|
50
|
+
token_infos: TokenInfo[];
|
|
51
|
+
next_page_params: Pagination | undefined;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
export interface ImportTokenInfoAdminRequest {
|
|
55
|
+
/** Token info to be imported. */
|
|
56
|
+
token_info: TokenInfo | undefined;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface ListUserVerifiedAddressesResponse {
|
|
60
|
+
verifiedAddresses: VerifiedAddressCamel[];
|
|
61
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blockscout/contracts-info-types",
|
|
3
|
+
"version": "0.0.1-beta.820070b",
|
|
4
|
+
"description": "TypeScript definitions for Contracts Info microservice",
|
|
5
|
+
"main": "./index.js",
|
|
6
|
+
"types": "./index.d.ts",
|
|
7
|
+
"scripts": {
|
|
8
|
+
"build": "npm run compile:proto && npm run compile:ts",
|
|
9
|
+
"compile:proto": "npm run compile:proto:snake && npm run compile:proto:camel",
|
|
10
|
+
"compile:proto:snake": "mkdir -p ./dist && protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=removeEnumPrefix=true --ts_proto_opt=unrecognizedEnum=false --ts_proto_opt=snakeToCamel=false --ts_proto_opt=stringEnums=true --ts_proto_opt=onlyTypes=true --ts_proto_opt=emitImportedFiles=false --ts_proto_opt=exportCommonSymbols=false --ts_proto_opt=forceLong=string --proto_path=../contracts-info-proto/proto --proto_path=../../proto --ts_proto_out=./dist ../contracts-info-proto/proto/contracts_info.proto",
|
|
11
|
+
"compile:proto:camel": "mkdir -p ./dist/camel && protoc --plugin=./node_modules/.bin/protoc-gen-ts_proto --ts_proto_opt=removeEnumPrefix=true --ts_proto_opt=unrecognizedEnum=false --ts_proto_opt=stringEnums=true --ts_proto_opt=onlyTypes=true --ts_proto_opt=emitImportedFiles=false --ts_proto_opt=exportCommonSymbols=false --ts_proto_opt=forceLong=string --proto_path=../contracts-info-proto/proto --proto_path=../../proto --ts_proto_out=./dist/camel ../contracts-info-proto/proto/contracts_info.proto",
|
|
12
|
+
"compile:ts": "tsc --declaration ./index.ts",
|
|
13
|
+
"publish:dev": "npm version 0.0.1-beta.$(git rev-parse --short HEAD) && npm publish --access public --tag beta"
|
|
14
|
+
},
|
|
15
|
+
"repository": {
|
|
16
|
+
"type": "git",
|
|
17
|
+
"url": "git+https://github.com/blockscout/blockscout-admin.git",
|
|
18
|
+
"directory": "contracts-info/types"
|
|
19
|
+
},
|
|
20
|
+
"license": "MIT",
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/blockscout/blockscout-admin/issues"
|
|
23
|
+
},
|
|
24
|
+
"homepage": "https://github.com/blockscout/blockscout-admin#readme",
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"ts-proto": "1.176.2",
|
|
27
|
+
"typescript": "6.0.3"
|
|
28
|
+
}
|
|
29
|
+
}
|