@herd-labs/sdk 0.4.0 → 0.5.0
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/index.d.ts +17 -17
- package/dist/index.js +17 -17
- package/dist/src/config.d.ts +4 -4
- package/dist/src/config.js +2 -2
- package/dist/src/errors.d.ts +6 -0
- package/dist/src/errors.js +7 -1
- package/dist/src/live/ActionsServiceLive.d.ts +3 -3
- package/dist/src/live/ActionsServiceLive.js +7 -7
- package/dist/src/live/AdaptersServiceLive.d.ts +3 -3
- package/dist/src/live/AdaptersServiceLive.js +4 -4
- package/dist/src/live/AgentSafesServiceLive.d.ts +3 -3
- package/dist/src/live/AgentSafesServiceLive.js +4 -4
- package/dist/src/live/AgentWalletsServiceLive.d.ts +2 -2
- package/dist/src/live/AgentWalletsServiceLive.js +3 -3
- package/dist/src/live/AgentWorkflowsServiceLive.d.ts +3 -3
- package/dist/src/live/AgentWorkflowsServiceLive.js +8 -8
- package/dist/src/live/AuthServiceLive.d.ts +3 -3
- package/dist/src/live/AuthServiceLive.js +5 -5
- package/dist/src/live/BookmarksServiceLive.d.ts +3 -3
- package/dist/src/live/BookmarksServiceLive.js +6 -6
- package/dist/src/live/CodeBlocksServiceLive.d.ts +3 -3
- package/dist/src/live/CodeBlocksServiceLive.js +7 -7
- package/dist/src/live/CollectionsServiceLive.d.ts +3 -3
- package/dist/src/live/CollectionsServiceLive.js +4 -4
- package/dist/src/live/ContractsServiceLive.d.ts +3 -3
- package/dist/src/live/ContractsServiceLive.js +6 -6
- package/dist/src/live/DocsServiceLive.d.ts +3 -3
- package/dist/src/live/DocsServiceLive.js +3 -3
- package/dist/src/live/GroupsServiceLive.d.ts +3 -3
- package/dist/src/live/GroupsServiceLive.js +7 -7
- package/dist/src/live/HalServiceLive.d.ts +3 -3
- package/dist/src/live/HalServiceLive.js +3 -3
- package/dist/src/live/TransactionsServiceLive.d.ts +3 -3
- package/dist/src/live/TransactionsServiceLive.js +4 -4
- package/dist/src/live/WalletsServiceLive.d.ts +3 -3
- package/dist/src/live/WalletsServiceLive.js +5 -5
- package/dist/src/live/http.d.ts +2 -2
- package/dist/src/live/http.js +2 -2
- package/dist/src/schemas/actions.d.ts +127 -59
- package/dist/src/schemas/actions.js +42 -42
- package/dist/src/schemas/adapters.d.ts +4 -4
- package/dist/src/schemas/adapters.js +3 -3
- package/dist/src/schemas/agent-wallets.d.ts +57 -37
- package/dist/src/schemas/agent-wallets.js +35 -35
- package/dist/src/schemas/agent-workflows.d.ts +35 -35
- package/dist/src/schemas/agent-workflows.js +19 -19
- package/dist/src/schemas/auth.d.ts +19 -19
- package/dist/src/schemas/auth.js +10 -10
- package/dist/src/schemas/bookmarks.d.ts +58 -36
- package/dist/src/schemas/bookmarks.js +34 -34
- package/dist/src/schemas/codeblocks.d.ts +89 -52
- package/dist/src/schemas/codeblocks.js +34 -34
- package/dist/src/schemas/collections.d.ts +76 -32
- package/dist/src/schemas/collections.js +23 -23
- package/dist/src/schemas/common.d.ts +8 -8
- package/dist/src/schemas/common.js +5 -5
- package/dist/src/schemas/contracts.d.ts +176 -61
- package/dist/src/schemas/contracts.js +47 -47
- package/dist/src/schemas/docs.d.ts +7 -7
- package/dist/src/schemas/docs.js +5 -5
- package/dist/src/schemas/groups.d.ts +27 -27
- package/dist/src/schemas/groups.js +16 -16
- package/dist/src/schemas/hal.d.ts +64 -18
- package/dist/src/schemas/hal.js +18 -18
- package/dist/src/schemas/transactions.d.ts +264 -56
- package/dist/src/schemas/transactions.js +50 -50
- package/dist/src/schemas/wallets.d.ts +434 -84
- package/dist/src/schemas/wallets.js +114 -69
- package/dist/src/services/ActionsService.d.ts +2 -2
- package/dist/src/services/AgentSafesService.d.ts +4 -4
- package/dist/src/services/AgentWalletsService.d.ts +2 -2
- package/dist/src/services/AgentWorkflowsService.d.ts +8 -8
- package/dist/src/services/AuthService.d.ts +3 -3
- package/dist/src/services/BookmarksService.d.ts +2 -2
- package/dist/src/services/ContractsService.d.ts +5 -5
- package/dist/src/services/GroupsService.d.ts +11 -11
- package/dist/src/services/TransactionsService.d.ts +4 -4
- package/dist/src/services/WalletsService.d.ts +4 -4
- package/package.json +2 -2
|
@@ -1,30 +1,30 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
3
|
//#region src/schemas/collections.ts
|
|
4
|
-
|
|
4
|
+
const CollectionSpecItemSchema = Schema.Struct({
|
|
5
5
|
expressionRef: Schema.String,
|
|
6
6
|
id: Schema.String,
|
|
7
7
|
type: Schema.Literals(["action", "adapter"])
|
|
8
|
-
})
|
|
9
|
-
|
|
10
|
-
items: Schema.Array(
|
|
8
|
+
});
|
|
9
|
+
const CollectionSpecSchema = Schema.Struct({
|
|
10
|
+
items: Schema.Array(CollectionSpecItemSchema),
|
|
11
11
|
version: Schema.String
|
|
12
|
-
})
|
|
13
|
-
|
|
12
|
+
});
|
|
13
|
+
const CollectionVersionSchema = Schema.Struct({
|
|
14
14
|
expressionImports: Schema.Array(Schema.String),
|
|
15
15
|
herdVerifiedAt: Schema.NullOr(Schema.String),
|
|
16
16
|
id: Schema.String,
|
|
17
17
|
name: Schema.String,
|
|
18
18
|
protocols: Schema.Array(Schema.String),
|
|
19
|
-
spec:
|
|
20
|
-
})
|
|
21
|
-
|
|
19
|
+
spec: CollectionSpecSchema
|
|
20
|
+
});
|
|
21
|
+
const CollectionSchema = Schema.Struct({
|
|
22
22
|
description: Schema.String,
|
|
23
23
|
id: Schema.String,
|
|
24
|
-
latestVersion: Schema.NullOr(
|
|
24
|
+
latestVersion: Schema.NullOr(CollectionVersionSchema),
|
|
25
25
|
name: Schema.String
|
|
26
|
-
})
|
|
27
|
-
|
|
26
|
+
});
|
|
27
|
+
const CollectionsSearchParamsSchema = Schema.Struct({
|
|
28
28
|
filters: Schema.optional(Schema.Struct({ name: Schema.optional(Schema.String) })),
|
|
29
29
|
limit: Schema.Number,
|
|
30
30
|
offset: Schema.Number,
|
|
@@ -33,12 +33,12 @@ var CollectionsSearchParams = class extends Schema.Class("CollectionsSearchParam
|
|
|
33
33
|
"all",
|
|
34
34
|
"verified"
|
|
35
35
|
])))
|
|
36
|
-
})
|
|
37
|
-
|
|
38
|
-
items: Schema.Array(
|
|
36
|
+
});
|
|
37
|
+
const CollectionsSearchResponseSchema = Schema.Struct({
|
|
38
|
+
items: Schema.Array(CollectionSchema),
|
|
39
39
|
total: Schema.Number
|
|
40
|
-
})
|
|
41
|
-
|
|
40
|
+
});
|
|
41
|
+
const CreateCollectionParamsSchema = Schema.Struct({
|
|
42
42
|
description: Schema.optional(Schema.String),
|
|
43
43
|
expressionImports: Schema.Array(Schema.String),
|
|
44
44
|
name: Schema.String,
|
|
@@ -51,8 +51,8 @@ var CreateCollectionParams = class extends Schema.Class("CreateCollectionParams"
|
|
|
51
51
|
expressionRef: Schema.String
|
|
52
52
|
}))
|
|
53
53
|
})
|
|
54
|
-
})
|
|
55
|
-
|
|
54
|
+
});
|
|
55
|
+
const CreateCollectionResponseSchema = Schema.Struct({
|
|
56
56
|
collection: Schema.Struct({
|
|
57
57
|
description: Schema.String,
|
|
58
58
|
id: Schema.String,
|
|
@@ -63,8 +63,8 @@ var CreateCollectionResponse = class extends Schema.Class("CreateCollectionRespo
|
|
|
63
63
|
name: Schema.String,
|
|
64
64
|
protocols: Schema.optional(Schema.Array(Schema.String))
|
|
65
65
|
})
|
|
66
|
-
})
|
|
67
|
-
|
|
66
|
+
});
|
|
67
|
+
const UpdateCollectionParamsSchema = Schema.Struct({
|
|
68
68
|
description: Schema.optional(Schema.String),
|
|
69
69
|
expressionImports: Schema.optional(Schema.Array(Schema.String)),
|
|
70
70
|
name: Schema.optional(Schema.String),
|
|
@@ -77,7 +77,7 @@ var UpdateCollectionParams = class extends Schema.Class("UpdateCollectionParams"
|
|
|
77
77
|
expressionRef: Schema.String
|
|
78
78
|
}))
|
|
79
79
|
}))
|
|
80
|
-
})
|
|
80
|
+
});
|
|
81
81
|
|
|
82
82
|
//#endregion
|
|
83
|
-
export {
|
|
83
|
+
export { CollectionSchema, CollectionSpecItemSchema, CollectionSpecSchema, CollectionVersionSchema, CollectionsSearchParamsSchema, CollectionsSearchResponseSchema, CreateCollectionParamsSchema, CreateCollectionResponseSchema, UpdateCollectionParamsSchema };
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
3
|
//#region src/schemas/common.d.ts
|
|
4
|
-
declare const
|
|
5
|
-
type
|
|
6
|
-
declare const
|
|
7
|
-
type
|
|
8
|
-
declare const
|
|
4
|
+
declare const BlockchainSchema: Schema.Literals<readonly ["ethereum", "base"]>;
|
|
5
|
+
type Blockchain = typeof BlockchainSchema.Type;
|
|
6
|
+
declare const EvmAddressSchema: Schema.brand<Schema.String, "EvmAddress">;
|
|
7
|
+
type EvmAddress = typeof EvmAddressSchema.Type;
|
|
8
|
+
declare const PaginationParamsSchema: Schema.Struct<{
|
|
9
9
|
readonly afterBlocknumber: Schema.optional<Schema.Number>;
|
|
10
10
|
readonly afterTimestamp: Schema.optional<Schema.Number>;
|
|
11
11
|
readonly beforeBlocknumber: Schema.optional<Schema.Number>;
|
|
12
12
|
readonly beforeTimestamp: Schema.optional<Schema.Number>;
|
|
13
13
|
readonly page: Schema.optional<Schema.Number>;
|
|
14
|
-
}
|
|
15
|
-
|
|
14
|
+
}>;
|
|
15
|
+
type PaginationParams = typeof PaginationParamsSchema.Type;
|
|
16
16
|
//#endregion
|
|
17
|
-
export { Blockchain,
|
|
17
|
+
export { Blockchain, BlockchainSchema, EvmAddress, EvmAddressSchema, PaginationParams, PaginationParamsSchema };
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
3
|
//#region src/schemas/common.ts
|
|
4
|
-
const
|
|
5
|
-
const
|
|
6
|
-
|
|
4
|
+
const BlockchainSchema = Schema.Literals(["ethereum", "base"]);
|
|
5
|
+
const EvmAddressSchema = Schema.String.check(Schema.isPattern(/^0x[0-9a-fA-F]{40}$/u)).pipe(Schema.brand("EvmAddress"));
|
|
6
|
+
const PaginationParamsSchema = Schema.Struct({
|
|
7
7
|
afterBlocknumber: Schema.optional(Schema.Number),
|
|
8
8
|
afterTimestamp: Schema.optional(Schema.Number),
|
|
9
9
|
beforeBlocknumber: Schema.optional(Schema.Number),
|
|
10
10
|
beforeTimestamp: Schema.optional(Schema.Number),
|
|
11
11
|
page: Schema.optional(Schema.Number)
|
|
12
|
-
})
|
|
12
|
+
});
|
|
13
13
|
|
|
14
14
|
//#endregion
|
|
15
|
-
export {
|
|
15
|
+
export { BlockchainSchema, EvmAddressSchema, PaginationParamsSchema };
|
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
import { Schema } from "effect";
|
|
2
2
|
|
|
3
3
|
//#region src/schemas/contracts.d.ts
|
|
4
|
-
declare const
|
|
4
|
+
declare const FunctionSummarySchema: Schema.Struct<{
|
|
5
5
|
readonly name: Schema.String;
|
|
6
6
|
readonly signature: Schema.String;
|
|
7
7
|
readonly summary: Schema.String;
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
declare const
|
|
8
|
+
}>;
|
|
9
|
+
type FunctionSummary = typeof FunctionSummarySchema.Type;
|
|
10
|
+
declare const EventSummarySchema: Schema.Struct<{
|
|
11
11
|
readonly name: Schema.String;
|
|
12
12
|
readonly summary: Schema.String;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
declare const
|
|
13
|
+
}>;
|
|
14
|
+
type EventSummary = typeof EventSummarySchema.Type;
|
|
15
|
+
declare const TokenImageSchema: Schema.Struct<{
|
|
16
16
|
readonly large: Schema.optional<Schema.String>;
|
|
17
17
|
readonly small: Schema.optional<Schema.String>;
|
|
18
18
|
readonly thumb: Schema.optional<Schema.String>;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare const
|
|
19
|
+
}>;
|
|
20
|
+
type TokenImage = typeof TokenImageSchema.Type;
|
|
21
|
+
declare const TopHolderSchema: Schema.Struct<{
|
|
22
22
|
readonly address: Schema.String;
|
|
23
23
|
readonly balance: Schema.Number;
|
|
24
24
|
readonly coingeckoLabel: Schema.optional<Schema.String>;
|
|
@@ -28,26 +28,40 @@ declare const TopHolder_base: Schema.Class<TopHolder, Schema.Struct<{
|
|
|
28
28
|
readonly sharePercentage: Schema.Number;
|
|
29
29
|
readonly type: Schema.Literals<readonly ["contract", "wallet"]>;
|
|
30
30
|
readonly valueUsd: Schema.Number;
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare const
|
|
31
|
+
}>;
|
|
32
|
+
type TopHolder = typeof TopHolderSchema.Type;
|
|
33
|
+
declare const TokenDetailsSchema: Schema.Struct<{
|
|
34
34
|
readonly athUsd: Schema.optional<Schema.Number>;
|
|
35
35
|
readonly currentPriceUsd: Schema.optional<Schema.Number>;
|
|
36
36
|
readonly decimals: Schema.optional<Schema.Number>;
|
|
37
37
|
readonly description: Schema.optional<Schema.String>;
|
|
38
38
|
readonly fullyDilutedValuationUsd: Schema.optional<Schema.Number>;
|
|
39
|
-
readonly image: Schema.optional<
|
|
39
|
+
readonly image: Schema.optional<Schema.Struct<{
|
|
40
|
+
readonly large: Schema.optional<Schema.String>;
|
|
41
|
+
readonly small: Schema.optional<Schema.String>;
|
|
42
|
+
readonly thumb: Schema.optional<Schema.String>;
|
|
43
|
+
}>>;
|
|
40
44
|
readonly marketCapRank: Schema.optional<Schema.Number>;
|
|
41
45
|
readonly marketCapUsd: Schema.optional<Schema.Number>;
|
|
42
46
|
readonly name: Schema.String;
|
|
43
47
|
readonly symbol: Schema.String;
|
|
44
48
|
readonly tokenType: Schema.Literals<readonly ["ERC20", "ERC721", "ERC1155"]>;
|
|
45
|
-
readonly topHolders: Schema.optional<Schema.$Array<
|
|
49
|
+
readonly topHolders: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
50
|
+
readonly address: Schema.String;
|
|
51
|
+
readonly balance: Schema.Number;
|
|
52
|
+
readonly coingeckoLabel: Schema.optional<Schema.String>;
|
|
53
|
+
readonly entityLabel: Schema.optional<Schema.String>;
|
|
54
|
+
readonly name: Schema.optional<Schema.String>;
|
|
55
|
+
readonly rank: Schema.Number;
|
|
56
|
+
readonly sharePercentage: Schema.Number;
|
|
57
|
+
readonly type: Schema.Literals<readonly ["contract", "wallet"]>;
|
|
58
|
+
readonly valueUsd: Schema.Number;
|
|
59
|
+
}>>>;
|
|
46
60
|
readonly totalSupply: Schema.optional<Schema.Number>;
|
|
47
61
|
readonly totalVolumeUsd: Schema.optional<Schema.Number>;
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
declare const
|
|
62
|
+
}>;
|
|
63
|
+
type TokenDetails = typeof TokenDetailsSchema.Type;
|
|
64
|
+
declare const AddressDetailsSchema: Schema.Struct<{
|
|
51
65
|
readonly address: Schema.String;
|
|
52
66
|
readonly constructorArgs: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
53
67
|
readonly deploymentBlockNumber: Schema.optional<Schema.Number>;
|
|
@@ -58,9 +72,9 @@ declare const AddressDetails_base: Schema.Class<AddressDetails, Schema.Struct<{
|
|
|
58
72
|
readonly name: Schema.String;
|
|
59
73
|
readonly address: Schema.String;
|
|
60
74
|
}>>;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
declare const
|
|
75
|
+
}>;
|
|
76
|
+
type AddressDetails = typeof AddressDetailsSchema.Type;
|
|
77
|
+
declare const HistoricalImplementationSchema: Schema.Struct<{
|
|
64
78
|
readonly address: Schema.String;
|
|
65
79
|
readonly deploymentBlockNumber: Schema.optional<Schema.Number>;
|
|
66
80
|
readonly deploymentBlockTimestamp: Schema.optional<Schema.Number>;
|
|
@@ -69,79 +83,180 @@ declare const HistoricalImplementation_base: Schema.Class<HistoricalImplementati
|
|
|
69
83
|
readonly newEvents: Schema.optional<Schema.$Array<Schema.String>>;
|
|
70
84
|
readonly newFunctions: Schema.optional<Schema.$Array<Schema.String>>;
|
|
71
85
|
readonly versionNumber: Schema.Number;
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
declare const
|
|
86
|
+
}>;
|
|
87
|
+
type HistoricalImplementation = typeof HistoricalImplementationSchema.Type;
|
|
88
|
+
declare const ContractMetadataSchema: Schema.Struct<{
|
|
75
89
|
readonly abi: Schema.optional<Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
76
|
-
readonly addressDetails: Schema.optional<
|
|
90
|
+
readonly addressDetails: Schema.optional<Schema.Struct<{
|
|
91
|
+
readonly address: Schema.String;
|
|
92
|
+
readonly constructorArgs: Schema.optional<Schema.$Record<Schema.String, Schema.Unknown>>;
|
|
93
|
+
readonly deploymentBlockNumber: Schema.optional<Schema.Number>;
|
|
94
|
+
readonly deploymentTimestamp: Schema.optional<Schema.String>;
|
|
95
|
+
readonly deploymentTimestampUtc: Schema.optional<Schema.String>;
|
|
96
|
+
readonly deploymentTxHash: Schema.optional<Schema.String>;
|
|
97
|
+
readonly factory: Schema.optional<Schema.Struct<{
|
|
98
|
+
readonly name: Schema.String;
|
|
99
|
+
readonly address: Schema.String;
|
|
100
|
+
}>>;
|
|
101
|
+
}>>;
|
|
77
102
|
readonly contractName: Schema.optional<Schema.String>;
|
|
78
103
|
readonly contractSummary: Schema.optional<Schema.String>;
|
|
79
104
|
readonly errorMessage: Schema.optional<Schema.String>;
|
|
80
|
-
readonly eventSummaries: Schema.optional<Schema.$Array<
|
|
81
|
-
|
|
82
|
-
|
|
105
|
+
readonly eventSummaries: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
106
|
+
readonly name: Schema.String;
|
|
107
|
+
readonly summary: Schema.String;
|
|
108
|
+
}>>>;
|
|
109
|
+
readonly functionSummaries: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
110
|
+
readonly name: Schema.String;
|
|
111
|
+
readonly signature: Schema.String;
|
|
112
|
+
readonly summary: Schema.String;
|
|
113
|
+
}>>>;
|
|
114
|
+
readonly historicalImplementations: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
115
|
+
readonly address: Schema.String;
|
|
116
|
+
readonly deploymentBlockNumber: Schema.optional<Schema.Number>;
|
|
117
|
+
readonly deploymentBlockTimestamp: Schema.optional<Schema.Number>;
|
|
118
|
+
readonly deploymentBlockTimestampUtc: Schema.optional<Schema.String>;
|
|
119
|
+
readonly deploymentTxHash: Schema.optional<Schema.String>;
|
|
120
|
+
readonly newEvents: Schema.optional<Schema.$Array<Schema.String>>;
|
|
121
|
+
readonly newFunctions: Schema.optional<Schema.$Array<Schema.String>>;
|
|
122
|
+
readonly versionNumber: Schema.Number;
|
|
123
|
+
}>>>;
|
|
83
124
|
readonly proxyAbi: Schema.optional<Schema.$Array<Schema.$Record<Schema.String, Schema.Unknown>>>;
|
|
84
125
|
readonly signatureImplementationNames: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
85
126
|
readonly signatureImplementations: Schema.optional<Schema.$Record<Schema.String, Schema.String>>;
|
|
86
|
-
readonly tokenDetails: Schema.optional<
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
127
|
+
readonly tokenDetails: Schema.optional<Schema.Struct<{
|
|
128
|
+
readonly athUsd: Schema.optional<Schema.Number>;
|
|
129
|
+
readonly currentPriceUsd: Schema.optional<Schema.Number>;
|
|
130
|
+
readonly decimals: Schema.optional<Schema.Number>;
|
|
131
|
+
readonly description: Schema.optional<Schema.String>;
|
|
132
|
+
readonly fullyDilutedValuationUsd: Schema.optional<Schema.Number>;
|
|
133
|
+
readonly image: Schema.optional<Schema.Struct<{
|
|
134
|
+
readonly large: Schema.optional<Schema.String>;
|
|
135
|
+
readonly small: Schema.optional<Schema.String>;
|
|
136
|
+
readonly thumb: Schema.optional<Schema.String>;
|
|
137
|
+
}>>;
|
|
138
|
+
readonly marketCapRank: Schema.optional<Schema.Number>;
|
|
139
|
+
readonly marketCapUsd: Schema.optional<Schema.Number>;
|
|
140
|
+
readonly name: Schema.String;
|
|
141
|
+
readonly symbol: Schema.String;
|
|
142
|
+
readonly tokenType: Schema.Literals<readonly ["ERC20", "ERC721", "ERC1155"]>;
|
|
143
|
+
readonly topHolders: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
144
|
+
readonly address: Schema.String;
|
|
145
|
+
readonly balance: Schema.Number;
|
|
146
|
+
readonly coingeckoLabel: Schema.optional<Schema.String>;
|
|
147
|
+
readonly entityLabel: Schema.optional<Schema.String>;
|
|
148
|
+
readonly name: Schema.optional<Schema.String>;
|
|
149
|
+
readonly rank: Schema.Number;
|
|
150
|
+
readonly sharePercentage: Schema.Number;
|
|
151
|
+
readonly type: Schema.Literals<readonly ["contract", "wallet"]>;
|
|
152
|
+
readonly valueUsd: Schema.Number;
|
|
153
|
+
}>>>;
|
|
154
|
+
readonly totalSupply: Schema.optional<Schema.Number>;
|
|
155
|
+
readonly totalVolumeUsd: Schema.optional<Schema.Number>;
|
|
156
|
+
}>>;
|
|
157
|
+
}>;
|
|
158
|
+
type ContractMetadata = typeof ContractMetadataSchema.Type;
|
|
159
|
+
declare const ContractCodeMatchBlockSchema: Schema.Struct<{
|
|
90
160
|
readonly code: Schema.String;
|
|
91
161
|
readonly endLine: Schema.Number;
|
|
92
162
|
readonly fileName: Schema.String;
|
|
93
163
|
readonly numberOfMatches: Schema.Number;
|
|
94
164
|
readonly patterns: Schema.$Array<Schema.String>;
|
|
95
165
|
readonly startLine: Schema.Number;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
declare const
|
|
166
|
+
}>;
|
|
167
|
+
type ContractCodeMatchBlock = typeof ContractCodeMatchBlockSchema.Type;
|
|
168
|
+
declare const ContractCodeSearchResultSchema: Schema.Struct<{
|
|
99
169
|
readonly blockchain: Schema.Literals<readonly ["ethereum", "base"]>;
|
|
100
170
|
readonly code: Schema.optional<Schema.String>;
|
|
101
171
|
readonly contractAddress: Schema.brand<Schema.String, "EvmAddress">;
|
|
102
172
|
readonly contractName: Schema.String;
|
|
103
|
-
readonly matches: Schema.optional<Schema.$Array<
|
|
173
|
+
readonly matches: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
174
|
+
readonly code: Schema.String;
|
|
175
|
+
readonly endLine: Schema.Number;
|
|
176
|
+
readonly fileName: Schema.String;
|
|
177
|
+
readonly numberOfMatches: Schema.Number;
|
|
178
|
+
readonly patterns: Schema.$Array<Schema.String>;
|
|
179
|
+
readonly startLine: Schema.Number;
|
|
180
|
+
}>>>;
|
|
104
181
|
readonly proxyCode: Schema.optional<Schema.String>;
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
declare const
|
|
182
|
+
}>;
|
|
183
|
+
type ContractCodeSearchResult = typeof ContractCodeSearchResultSchema.Type;
|
|
184
|
+
declare const GetContractCodeParamsSchema: Schema.Struct<{
|
|
108
185
|
readonly contractAddresses: Schema.$Array<Schema.brand<Schema.String, "EvmAddress">>;
|
|
109
186
|
readonly includeProxies: Schema.optional<Schema.Boolean>;
|
|
110
187
|
readonly patterns: Schema.optional<Schema.$Array<Schema.String>>;
|
|
111
188
|
readonly query: Schema.String;
|
|
112
189
|
readonly returnAllCode: Schema.optional<Schema.Boolean>;
|
|
113
|
-
}
|
|
114
|
-
|
|
115
|
-
declare const
|
|
190
|
+
}>;
|
|
191
|
+
type GetContractCodeParams = typeof GetContractCodeParamsSchema.Type;
|
|
192
|
+
declare const GetContractCodeResponseSchema: Schema.Struct<{
|
|
116
193
|
readonly allSearchPatterns: Schema.optional<Schema.$Array<Schema.String>>;
|
|
117
|
-
readonly codeSearchResults: Schema.optional<Schema.$Array<
|
|
194
|
+
readonly codeSearchResults: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
195
|
+
readonly blockchain: Schema.Literals<readonly ["ethereum", "base"]>;
|
|
196
|
+
readonly code: Schema.optional<Schema.String>;
|
|
197
|
+
readonly contractAddress: Schema.brand<Schema.String, "EvmAddress">;
|
|
198
|
+
readonly contractName: Schema.String;
|
|
199
|
+
readonly matches: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
200
|
+
readonly code: Schema.String;
|
|
201
|
+
readonly endLine: Schema.Number;
|
|
202
|
+
readonly fileName: Schema.String;
|
|
203
|
+
readonly numberOfMatches: Schema.Number;
|
|
204
|
+
readonly patterns: Schema.$Array<Schema.String>;
|
|
205
|
+
readonly startLine: Schema.Number;
|
|
206
|
+
}>>>;
|
|
207
|
+
readonly proxyCode: Schema.optional<Schema.String>;
|
|
208
|
+
}>>>;
|
|
118
209
|
readonly errorMessage: Schema.optional<Schema.String>;
|
|
119
210
|
readonly query: Schema.optional<Schema.String>;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
declare const
|
|
211
|
+
}>;
|
|
212
|
+
type GetContractCodeResponse = typeof GetContractCodeResponseSchema.Type;
|
|
213
|
+
declare const DiffVersionInfoSchema: Schema.Struct<{
|
|
123
214
|
readonly blockNumber: Schema.Number;
|
|
124
215
|
readonly contractName: Schema.String;
|
|
125
216
|
readonly implementationAddress: Schema.String;
|
|
126
217
|
readonly versionNumber: Schema.Number;
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
declare const
|
|
218
|
+
}>;
|
|
219
|
+
type DiffVersionInfo = typeof DiffVersionInfoSchema.Type;
|
|
220
|
+
declare const DiffEntrySchema: Schema.Struct<{
|
|
130
221
|
readonly diff: Schema.String;
|
|
131
|
-
readonly version1Info:
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
222
|
+
readonly version1Info: Schema.Struct<{
|
|
223
|
+
readonly blockNumber: Schema.Number;
|
|
224
|
+
readonly contractName: Schema.String;
|
|
225
|
+
readonly implementationAddress: Schema.String;
|
|
226
|
+
readonly versionNumber: Schema.Number;
|
|
227
|
+
}>;
|
|
228
|
+
readonly version2Info: Schema.Struct<{
|
|
229
|
+
readonly blockNumber: Schema.Number;
|
|
230
|
+
readonly contractName: Schema.String;
|
|
231
|
+
readonly implementationAddress: Schema.String;
|
|
232
|
+
readonly versionNumber: Schema.Number;
|
|
233
|
+
}>;
|
|
234
|
+
}>;
|
|
235
|
+
type DiffEntry = typeof DiffEntrySchema.Type;
|
|
236
|
+
declare const ContractDiffSchema: Schema.Struct<{
|
|
136
237
|
readonly blockchain: Schema.optional<Schema.String>;
|
|
137
238
|
readonly contractAddress: Schema.optional<Schema.String>;
|
|
138
|
-
readonly diffs: Schema.optional<Schema.$Array<
|
|
239
|
+
readonly diffs: Schema.optional<Schema.$Array<Schema.Struct<{
|
|
240
|
+
readonly diff: Schema.String;
|
|
241
|
+
readonly version1Info: Schema.Struct<{
|
|
242
|
+
readonly blockNumber: Schema.Number;
|
|
243
|
+
readonly contractName: Schema.String;
|
|
244
|
+
readonly implementationAddress: Schema.String;
|
|
245
|
+
readonly versionNumber: Schema.Number;
|
|
246
|
+
}>;
|
|
247
|
+
readonly version2Info: Schema.Struct<{
|
|
248
|
+
readonly blockNumber: Schema.Number;
|
|
249
|
+
readonly contractName: Schema.String;
|
|
250
|
+
readonly implementationAddress: Schema.String;
|
|
251
|
+
readonly versionNumber: Schema.Number;
|
|
252
|
+
}>;
|
|
253
|
+
}>>>;
|
|
139
254
|
readonly errorMessage: Schema.optional<Schema.String>;
|
|
140
|
-
}
|
|
141
|
-
|
|
142
|
-
declare const
|
|
255
|
+
}>;
|
|
256
|
+
type ContractDiff = typeof ContractDiffSchema.Type;
|
|
257
|
+
declare const DiffVersionsParamsSchema: Schema.Struct<{
|
|
143
258
|
readonly compareAllVersions: Schema.optional<Schema.Boolean>;
|
|
144
|
-
}
|
|
145
|
-
|
|
259
|
+
}>;
|
|
260
|
+
type DiffVersionsParams = typeof DiffVersionsParamsSchema.Type;
|
|
146
261
|
//#endregion
|
|
147
|
-
export { AddressDetails, ContractCodeMatchBlock, ContractCodeSearchResult, ContractDiff, ContractMetadata, DiffEntry, DiffVersionInfo, DiffVersionsParams, EventSummary, FunctionSummary, GetContractCodeParams, GetContractCodeResponse, HistoricalImplementation, TokenDetails, TokenImage, TopHolder };
|
|
262
|
+
export { AddressDetails, AddressDetailsSchema, ContractCodeMatchBlock, ContractCodeMatchBlockSchema, ContractCodeSearchResult, ContractCodeSearchResultSchema, ContractDiff, ContractDiffSchema, ContractMetadata, ContractMetadataSchema, DiffEntry, DiffEntrySchema, DiffVersionInfo, DiffVersionInfoSchema, DiffVersionsParams, DiffVersionsParamsSchema, EventSummary, EventSummarySchema, FunctionSummary, FunctionSummarySchema, GetContractCodeParams, GetContractCodeParamsSchema, GetContractCodeResponse, GetContractCodeResponseSchema, HistoricalImplementation, HistoricalImplementationSchema, TokenDetails, TokenDetailsSchema, TokenImage, TokenImageSchema, TopHolder, TopHolderSchema };
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EvmAddressSchema } from "./common.js";
|
|
2
2
|
import { Schema } from "effect";
|
|
3
3
|
|
|
4
4
|
//#region src/schemas/contracts.ts
|
|
5
|
-
|
|
5
|
+
const FunctionSummarySchema = Schema.Struct({
|
|
6
6
|
name: Schema.String,
|
|
7
7
|
signature: Schema.String,
|
|
8
8
|
summary: Schema.String
|
|
9
|
-
})
|
|
10
|
-
|
|
9
|
+
});
|
|
10
|
+
const EventSummarySchema = Schema.Struct({
|
|
11
11
|
name: Schema.String,
|
|
12
12
|
summary: Schema.String
|
|
13
|
-
})
|
|
14
|
-
|
|
13
|
+
});
|
|
14
|
+
const TokenImageSchema = Schema.Struct({
|
|
15
15
|
large: Schema.optional(Schema.String),
|
|
16
16
|
small: Schema.optional(Schema.String),
|
|
17
17
|
thumb: Schema.optional(Schema.String)
|
|
18
|
-
})
|
|
19
|
-
|
|
18
|
+
});
|
|
19
|
+
const TopHolderSchema = Schema.Struct({
|
|
20
20
|
address: Schema.String,
|
|
21
21
|
balance: Schema.Number,
|
|
22
22
|
coingeckoLabel: Schema.optional(Schema.String),
|
|
@@ -26,14 +26,14 @@ var TopHolder = class extends Schema.Class("TopHolder")({
|
|
|
26
26
|
sharePercentage: Schema.Number,
|
|
27
27
|
type: Schema.Literals(["contract", "wallet"]),
|
|
28
28
|
valueUsd: Schema.Number
|
|
29
|
-
})
|
|
30
|
-
|
|
29
|
+
});
|
|
30
|
+
const TokenDetailsSchema = Schema.Struct({
|
|
31
31
|
athUsd: Schema.optional(Schema.Number),
|
|
32
32
|
currentPriceUsd: Schema.optional(Schema.Number),
|
|
33
33
|
decimals: Schema.optional(Schema.Number),
|
|
34
34
|
description: Schema.optional(Schema.String),
|
|
35
35
|
fullyDilutedValuationUsd: Schema.optional(Schema.Number),
|
|
36
|
-
image: Schema.optional(
|
|
36
|
+
image: Schema.optional(TokenImageSchema),
|
|
37
37
|
marketCapRank: Schema.optional(Schema.Number),
|
|
38
38
|
marketCapUsd: Schema.optional(Schema.Number),
|
|
39
39
|
name: Schema.String,
|
|
@@ -43,11 +43,11 @@ var TokenDetails = class extends Schema.Class("TokenDetails")({
|
|
|
43
43
|
"ERC721",
|
|
44
44
|
"ERC1155"
|
|
45
45
|
]),
|
|
46
|
-
topHolders: Schema.optional(Schema.Array(
|
|
46
|
+
topHolders: Schema.optional(Schema.Array(TopHolderSchema)),
|
|
47
47
|
totalSupply: Schema.optional(Schema.Number),
|
|
48
48
|
totalVolumeUsd: Schema.optional(Schema.Number)
|
|
49
|
-
})
|
|
50
|
-
|
|
49
|
+
});
|
|
50
|
+
const AddressDetailsSchema = Schema.Struct({
|
|
51
51
|
address: Schema.String,
|
|
52
52
|
constructorArgs: Schema.optional(Schema.Record(Schema.String, Schema.Unknown)),
|
|
53
53
|
deploymentBlockNumber: Schema.optional(Schema.Number),
|
|
@@ -58,8 +58,8 @@ var AddressDetails = class extends Schema.Class("AddressDetails")({
|
|
|
58
58
|
name: Schema.String,
|
|
59
59
|
address: Schema.String
|
|
60
60
|
}))
|
|
61
|
-
})
|
|
62
|
-
|
|
61
|
+
});
|
|
62
|
+
const HistoricalImplementationSchema = Schema.Struct({
|
|
63
63
|
address: Schema.String,
|
|
64
64
|
deploymentBlockNumber: Schema.optional(Schema.Number),
|
|
65
65
|
deploymentBlockTimestamp: Schema.optional(Schema.Number),
|
|
@@ -68,68 +68,68 @@ var HistoricalImplementation = class extends Schema.Class("HistoricalImplementat
|
|
|
68
68
|
newEvents: Schema.optional(Schema.Array(Schema.String)),
|
|
69
69
|
newFunctions: Schema.optional(Schema.Array(Schema.String)),
|
|
70
70
|
versionNumber: Schema.Number
|
|
71
|
-
})
|
|
72
|
-
|
|
71
|
+
});
|
|
72
|
+
const ContractMetadataSchema = Schema.Struct({
|
|
73
73
|
abi: Schema.optional(Schema.Array(Schema.Record(Schema.String, Schema.Unknown))),
|
|
74
|
-
addressDetails: Schema.optional(
|
|
74
|
+
addressDetails: Schema.optional(AddressDetailsSchema),
|
|
75
75
|
contractName: Schema.optional(Schema.String),
|
|
76
76
|
contractSummary: Schema.optional(Schema.String),
|
|
77
77
|
errorMessage: Schema.optional(Schema.String),
|
|
78
|
-
eventSummaries: Schema.optional(Schema.Array(
|
|
79
|
-
functionSummaries: Schema.optional(Schema.Array(
|
|
80
|
-
historicalImplementations: Schema.optional(Schema.Array(
|
|
78
|
+
eventSummaries: Schema.optional(Schema.Array(EventSummarySchema)),
|
|
79
|
+
functionSummaries: Schema.optional(Schema.Array(FunctionSummarySchema)),
|
|
80
|
+
historicalImplementations: Schema.optional(Schema.Array(HistoricalImplementationSchema)),
|
|
81
81
|
proxyAbi: Schema.optional(Schema.Array(Schema.Record(Schema.String, Schema.Unknown))),
|
|
82
82
|
signatureImplementationNames: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
83
83
|
signatureImplementations: Schema.optional(Schema.Record(Schema.String, Schema.String)),
|
|
84
|
-
tokenDetails: Schema.optional(
|
|
85
|
-
})
|
|
86
|
-
|
|
84
|
+
tokenDetails: Schema.optional(TokenDetailsSchema)
|
|
85
|
+
});
|
|
86
|
+
const ContractCodeMatchBlockSchema = Schema.Struct({
|
|
87
87
|
code: Schema.String,
|
|
88
88
|
endLine: Schema.Number,
|
|
89
89
|
fileName: Schema.String,
|
|
90
90
|
numberOfMatches: Schema.Number,
|
|
91
91
|
patterns: Schema.Array(Schema.String),
|
|
92
92
|
startLine: Schema.Number
|
|
93
|
-
})
|
|
94
|
-
|
|
93
|
+
});
|
|
94
|
+
const ContractCodeSearchResultSchema = Schema.Struct({
|
|
95
95
|
blockchain: Schema.Literals(["ethereum", "base"]),
|
|
96
96
|
code: Schema.optional(Schema.String),
|
|
97
|
-
contractAddress:
|
|
97
|
+
contractAddress: EvmAddressSchema,
|
|
98
98
|
contractName: Schema.String,
|
|
99
|
-
matches: Schema.optional(Schema.Array(
|
|
99
|
+
matches: Schema.optional(Schema.Array(ContractCodeMatchBlockSchema)),
|
|
100
100
|
proxyCode: Schema.optional(Schema.String)
|
|
101
|
-
})
|
|
102
|
-
|
|
103
|
-
contractAddresses: Schema.Array(
|
|
101
|
+
});
|
|
102
|
+
const GetContractCodeParamsSchema = Schema.Struct({
|
|
103
|
+
contractAddresses: Schema.Array(EvmAddressSchema),
|
|
104
104
|
includeProxies: Schema.optional(Schema.Boolean),
|
|
105
105
|
patterns: Schema.optional(Schema.Array(Schema.String)),
|
|
106
106
|
query: Schema.String,
|
|
107
107
|
returnAllCode: Schema.optional(Schema.Boolean)
|
|
108
|
-
})
|
|
109
|
-
|
|
108
|
+
});
|
|
109
|
+
const GetContractCodeResponseSchema = Schema.Struct({
|
|
110
110
|
allSearchPatterns: Schema.optional(Schema.Array(Schema.String)),
|
|
111
|
-
codeSearchResults: Schema.optional(Schema.Array(
|
|
111
|
+
codeSearchResults: Schema.optional(Schema.Array(ContractCodeSearchResultSchema)),
|
|
112
112
|
errorMessage: Schema.optional(Schema.String),
|
|
113
113
|
query: Schema.optional(Schema.String)
|
|
114
|
-
})
|
|
115
|
-
|
|
114
|
+
});
|
|
115
|
+
const DiffVersionInfoSchema = Schema.Struct({
|
|
116
116
|
blockNumber: Schema.Number,
|
|
117
117
|
contractName: Schema.String,
|
|
118
118
|
implementationAddress: Schema.String,
|
|
119
119
|
versionNumber: Schema.Number
|
|
120
|
-
})
|
|
121
|
-
|
|
120
|
+
});
|
|
121
|
+
const DiffEntrySchema = Schema.Struct({
|
|
122
122
|
diff: Schema.String,
|
|
123
|
-
version1Info:
|
|
124
|
-
version2Info:
|
|
125
|
-
})
|
|
126
|
-
|
|
123
|
+
version1Info: DiffVersionInfoSchema,
|
|
124
|
+
version2Info: DiffVersionInfoSchema
|
|
125
|
+
});
|
|
126
|
+
const ContractDiffSchema = Schema.Struct({
|
|
127
127
|
blockchain: Schema.optional(Schema.String),
|
|
128
128
|
contractAddress: Schema.optional(Schema.String),
|
|
129
|
-
diffs: Schema.optional(Schema.Array(
|
|
129
|
+
diffs: Schema.optional(Schema.Array(DiffEntrySchema)),
|
|
130
130
|
errorMessage: Schema.optional(Schema.String)
|
|
131
|
-
})
|
|
132
|
-
|
|
131
|
+
});
|
|
132
|
+
const DiffVersionsParamsSchema = Schema.Struct({ compareAllVersions: Schema.optional(Schema.Boolean) });
|
|
133
133
|
|
|
134
134
|
//#endregion
|
|
135
|
-
export {
|
|
135
|
+
export { AddressDetailsSchema, ContractCodeMatchBlockSchema, ContractCodeSearchResultSchema, ContractDiffSchema, ContractMetadataSchema, DiffEntrySchema, DiffVersionInfoSchema, DiffVersionsParamsSchema, EventSummarySchema, FunctionSummarySchema, GetContractCodeParamsSchema, GetContractCodeResponseSchema, HistoricalImplementationSchema, TokenDetailsSchema, TokenImageSchema, TopHolderSchema };
|