@settlemint/sdk-blockscout 2.6.4-prffd0842f → 2.6.6-mainc66d59a

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/README.md CHANGED
@@ -50,7 +50,7 @@ The SettleMint Blockscout SDK provides a seamless way to interact with Blockscou
50
50
 
51
51
  > **createBlockscoutClient**\<`Setup`\>(`options`, `clientOptions?`): `object`
52
52
 
53
- Defined in: [sdk/blockscout/src/blockscout.ts:76](https://github.com/settlemint/sdk/blob/v2.6.4/sdk/blockscout/src/blockscout.ts#L76)
53
+ Defined in: [sdk/blockscout/src/blockscout.ts:76](https://github.com/settlemint/sdk/blob/v2.6.6/sdk/blockscout/src/blockscout.ts#L76)
54
54
 
55
55
  Creates a Blockscout GraphQL client with proper type safety using gql.tada
56
56
 
@@ -77,8 +77,8 @@ An object containing the GraphQL client and initialized gql.tada function
77
77
 
78
78
  | Name | Type | Defined in |
79
79
  | ------ | ------ | ------ |
80
- | `client` | `GraphQLClient` | [sdk/blockscout/src/blockscout.ts:80](https://github.com/settlemint/sdk/blob/v2.6.4/sdk/blockscout/src/blockscout.ts#L80) |
81
- | `graphql` | `initGraphQLTada`\<`Setup`\> | [sdk/blockscout/src/blockscout.ts:81](https://github.com/settlemint/sdk/blob/v2.6.4/sdk/blockscout/src/blockscout.ts#L81) |
80
+ | `client` | `GraphQLClient` | [sdk/blockscout/src/blockscout.ts:80](https://github.com/settlemint/sdk/blob/v2.6.6/sdk/blockscout/src/blockscout.ts#L80) |
81
+ | `graphql` | `initGraphQLTada`\<`Setup`\> | [sdk/blockscout/src/blockscout.ts:81](https://github.com/settlemint/sdk/blob/v2.6.6/sdk/blockscout/src/blockscout.ts#L81) |
82
82
 
83
83
  ##### Throws
84
84
 
@@ -136,7 +136,7 @@ const result = await client.request(query, {
136
136
 
137
137
  > **ClientOptions** = `object`
138
138
 
139
- Defined in: [sdk/blockscout/src/blockscout.ts:24](https://github.com/settlemint/sdk/blob/v2.6.4/sdk/blockscout/src/blockscout.ts#L24)
139
+ Defined in: [sdk/blockscout/src/blockscout.ts:24](https://github.com/settlemint/sdk/blob/v2.6.6/sdk/blockscout/src/blockscout.ts#L24)
140
140
 
141
141
  Type definition for client options derived from the ClientOptionsSchema
142
142
 
@@ -144,8 +144,8 @@ Type definition for client options derived from the ClientOptionsSchema
144
144
 
145
145
  | Name | Type | Default value | Defined in |
146
146
  | ------ | ------ | ------ | ------ |
147
- | <a id="accesstoken"></a> `accessToken?` | `string` | - | [sdk/blockscout/src/blockscout.ts:18](https://github.com/settlemint/sdk/blob/v2.6.4/sdk/blockscout/src/blockscout.ts#L18) |
148
- | <a id="instance"></a> `instance` | `string` | `UrlOrPathSchema` | [sdk/blockscout/src/blockscout.ts:17](https://github.com/settlemint/sdk/blob/v2.6.4/sdk/blockscout/src/blockscout.ts#L17) |
147
+ | <a id="accesstoken"></a> `accessToken?` | `string` | - | [sdk/blockscout/src/blockscout.ts:18](https://github.com/settlemint/sdk/blob/v2.6.6/sdk/blockscout/src/blockscout.ts#L18) |
148
+ | <a id="instance"></a> `instance` | `string` | `UrlOrPathSchema` | [sdk/blockscout/src/blockscout.ts:17](https://github.com/settlemint/sdk/blob/v2.6.6/sdk/blockscout/src/blockscout.ts#L17) |
149
149
 
150
150
  ***
151
151
 
@@ -153,7 +153,7 @@ Type definition for client options derived from the ClientOptionsSchema
153
153
 
154
154
  > **RequestConfig** = `ConstructorParameters`\<*typeof* `GraphQLClient`\>\[`1`\]
155
155
 
156
- Defined in: [sdk/blockscout/src/blockscout.ts:11](https://github.com/settlemint/sdk/blob/v2.6.4/sdk/blockscout/src/blockscout.ts#L11)
156
+ Defined in: [sdk/blockscout/src/blockscout.ts:11](https://github.com/settlemint/sdk/blob/v2.6.6/sdk/blockscout/src/blockscout.ts#L11)
157
157
 
158
158
  Type definition for GraphQL client configuration options
159
159
 
@@ -163,7 +163,7 @@ Type definition for GraphQL client configuration options
163
163
 
164
164
  > `const` **ClientOptionsSchema**: `ZodObject`\<[`ClientOptions`](#clientoptions)\>
165
165
 
166
- Defined in: [sdk/blockscout/src/blockscout.ts:16](https://github.com/settlemint/sdk/blob/v2.6.4/sdk/blockscout/src/blockscout.ts#L16)
166
+ Defined in: [sdk/blockscout/src/blockscout.ts:16](https://github.com/settlemint/sdk/blob/v2.6.6/sdk/blockscout/src/blockscout.ts#L16)
167
167
 
168
168
  Schema for validating client options for the Blockscout client.
169
169
 
@@ -1,47 +1,18 @@
1
1
  /* SettleMint Blockscout SDK - Blockchain Explorer */
2
- //#region rolldown:runtime
3
- var __create = Object.create;
4
- var __defProp = Object.defineProperty;
5
- var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
6
- var __getOwnPropNames = Object.getOwnPropertyNames;
7
- var __getProtoOf = Object.getPrototypeOf;
8
- var __hasOwnProp = Object.prototype.hasOwnProperty;
9
- var __copyProps = (to, from, except, desc) => {
10
- if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
11
- key = keys[i];
12
- if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
13
- get: ((k) => from[k]).bind(null, key),
14
- enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
15
- });
16
- }
17
- return to;
18
- };
19
- var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
20
- value: mod,
21
- enumerable: true
22
- }) : target, mod));
23
-
24
- //#endregion
25
- let __settlemint_sdk_utils_http = require("@settlemint/sdk-utils/http");
26
- __settlemint_sdk_utils_http = __toESM(__settlemint_sdk_utils_http);
27
- let __settlemint_sdk_utils_runtime = require("@settlemint/sdk-utils/runtime");
28
- __settlemint_sdk_utils_runtime = __toESM(__settlemint_sdk_utils_runtime);
29
- let __settlemint_sdk_utils_validation = require("@settlemint/sdk-utils/validation");
30
- __settlemint_sdk_utils_validation = __toESM(__settlemint_sdk_utils_validation);
2
+ let _settlemint_sdk_utils_http = require("@settlemint/sdk-utils/http");
3
+ let _settlemint_sdk_utils_runtime = require("@settlemint/sdk-utils/runtime");
4
+ let _settlemint_sdk_utils_validation = require("@settlemint/sdk-utils/validation");
31
5
  let gql_tada = require("gql.tada");
32
- gql_tada = __toESM(gql_tada);
33
6
  let graphql_request = require("graphql-request");
34
- graphql_request = __toESM(graphql_request);
35
7
  let zod = require("zod");
36
- zod = __toESM(zod);
37
8
 
38
9
  //#region src/blockscout.ts
39
10
  /**
40
11
  * Schema for validating client options for the Blockscout client.
41
12
  */
42
13
  const ClientOptionsSchema = zod.z.object({
43
- instance: __settlemint_sdk_utils_validation.UrlOrPathSchema,
44
- accessToken: __settlemint_sdk_utils_validation.ApplicationAccessTokenSchema.optional()
14
+ instance: _settlemint_sdk_utils_validation.UrlOrPathSchema,
15
+ accessToken: _settlemint_sdk_utils_validation.ApplicationAccessTokenSchema.optional()
45
16
  });
46
17
  /**
47
18
  * Creates a Blockscout GraphQL client with proper type safety using gql.tada
@@ -94,14 +65,14 @@ const ClientOptionsSchema = zod.z.object({
94
65
  * });
95
66
  */
96
67
  function createBlockscoutClient(options, clientOptions) {
97
- (0, __settlemint_sdk_utils_runtime.ensureServer)();
98
- const validatedOptions = (0, __settlemint_sdk_utils_validation.validate)(ClientOptionsSchema, options);
68
+ (0, _settlemint_sdk_utils_runtime.ensureServer)();
69
+ const validatedOptions = (0, _settlemint_sdk_utils_validation.validate)(ClientOptionsSchema, options);
99
70
  const graphql = (0, gql_tada.initGraphQLTada)();
100
71
  const fullUrl = new URL(validatedOptions.instance).toString();
101
72
  return {
102
73
  client: new graphql_request.GraphQLClient(fullUrl, {
103
74
  ...clientOptions,
104
- headers: (0, __settlemint_sdk_utils_http.appendHeaders)(clientOptions?.headers, { "x-auth-token": validatedOptions.accessToken })
75
+ headers: (0, _settlemint_sdk_utils_http.appendHeaders)(clientOptions?.headers, { "x-auth-token": validatedOptions.accessToken })
105
76
  }),
106
77
  graphql
107
78
  };
@@ -1 +1 @@
1
- {"version":3,"file":"blockscout.cjs","names":["z","UrlOrPathSchema","ApplicationAccessTokenSchema","GraphQLClient"],"sources":["../src/blockscout.ts"],"sourcesContent":["import { appendHeaders } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { ApplicationAccessTokenSchema, UrlOrPathSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport { type AbstractSetupSchema, initGraphQLTada } from \"gql.tada\";\nimport { GraphQLClient } from \"graphql-request\";\nimport { z } from \"zod\";\n\n/**\n * Type definition for GraphQL client configuration options\n */\nexport type RequestConfig = ConstructorParameters<typeof GraphQLClient>[1];\n\n/**\n * Schema for validating client options for the Blockscout client.\n */\nexport const ClientOptionsSchema = z.object({\n instance: UrlOrPathSchema,\n accessToken: ApplicationAccessTokenSchema.optional(),\n});\n\n/**\n * Type definition for client options derived from the ClientOptionsSchema\n */\nexport type ClientOptions = z.infer<typeof ClientOptionsSchema>;\n\n/**\n * Creates a Blockscout GraphQL client with proper type safety using gql.tada\n *\n * @param options - Configuration options for the client\n * @param clientOptions - Optional GraphQL client configuration options\n * @returns An object containing the GraphQL client and initialized gql.tada function\n * @throws Will throw an error if the options fail validation\n * @example\n * import { createBlockscoutClient } from '@settlemint/sdk-blockscout';\n * import type { introspection } from \"@schemas/blockscout-env\";\n * import { createLogger, requestLogger } from '@settlemint/sdk-utils/logging';\n *\n * const logger = createLogger();\n *\n * const { client, graphql } = createBlockscoutClient<{\n * introspection: introspection;\n * disableMasking: true;\n * scalars: {\n * AddressHash: string;\n * Data: string;\n * DateTime: string;\n * Decimal: string;\n * FullHash: string;\n * Json: string;\n * NonceHash: string;\n * Wei: string;\n * };\n * }>({\n * instance: process.env.SETTLEMINT_BLOCKSCOUT_ENDPOINT,\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN\n * }, {\n * fetch: requestLogger(logger, \"blockscout\", fetch) as typeof fetch,\n * });\n *\n * // Making GraphQL queries\n * const query = graphql(`\n * query GetTransaction($hash: String!) {\n * transaction(hash: $hash) {\n * hash\n * blockNumber\n * value\n * gasUsed\n * }\n * }\n * `);\n *\n * const result = await client.request(query, {\n * hash: \"0x123abc...\"\n * });\n */\nexport function createBlockscoutClient<const Setup extends AbstractSetupSchema>(\n options: ClientOptions,\n clientOptions?: RequestConfig,\n): {\n client: GraphQLClient;\n graphql: initGraphQLTada<Setup>;\n} {\n ensureServer();\n const validatedOptions = validate(ClientOptionsSchema, options);\n const graphql = initGraphQLTada<Setup>();\n const fullUrl = new URL(validatedOptions.instance).toString();\n\n return {\n client: new GraphQLClient(fullUrl, {\n ...clientOptions,\n headers: appendHeaders(clientOptions?.headers, { \"x-auth-token\": validatedOptions.accessToken }),\n }),\n graphql,\n };\n}\n\nexport type { FragmentOf, ResultOf, VariablesOf } from \"gql.tada\";\nexport { readFragment } from \"gql.tada\";\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAeA,MAAa,sBAAsBA,MAAE,OAAO;CAC1C,UAAUC;CACV,aAAaC,+DAA6B,UAAU;CACrD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDF,SAAgB,uBACd,SACA,eAIA;AACA,mDAAc;CACd,MAAM,mEAA4B,qBAAqB,QAAQ;CAC/D,MAAM,yCAAkC;CACxC,MAAM,UAAU,IAAI,IAAI,iBAAiB,SAAS,CAAC,UAAU;AAE7D,QAAO;EACL,QAAQ,IAAIC,8BAAc,SAAS;GACjC,GAAG;GACH,wDAAuB,eAAe,SAAS,EAAE,gBAAgB,iBAAiB,aAAa,CAAC;GACjG,CAAC;EACF;EACD"}
1
+ {"version":3,"file":"blockscout.cjs","names":["z","UrlOrPathSchema","ApplicationAccessTokenSchema","GraphQLClient"],"sources":["../src/blockscout.ts"],"sourcesContent":["import { appendHeaders } from \"@settlemint/sdk-utils/http\";\nimport { ensureServer } from \"@settlemint/sdk-utils/runtime\";\nimport { ApplicationAccessTokenSchema, UrlOrPathSchema, validate } from \"@settlemint/sdk-utils/validation\";\nimport { type AbstractSetupSchema, initGraphQLTada } from \"gql.tada\";\nimport { GraphQLClient } from \"graphql-request\";\nimport { z } from \"zod\";\n\n/**\n * Type definition for GraphQL client configuration options\n */\nexport type RequestConfig = ConstructorParameters<typeof GraphQLClient>[1];\n\n/**\n * Schema for validating client options for the Blockscout client.\n */\nexport const ClientOptionsSchema = z.object({\n instance: UrlOrPathSchema,\n accessToken: ApplicationAccessTokenSchema.optional(),\n});\n\n/**\n * Type definition for client options derived from the ClientOptionsSchema\n */\nexport type ClientOptions = z.infer<typeof ClientOptionsSchema>;\n\n/**\n * Creates a Blockscout GraphQL client with proper type safety using gql.tada\n *\n * @param options - Configuration options for the client\n * @param clientOptions - Optional GraphQL client configuration options\n * @returns An object containing the GraphQL client and initialized gql.tada function\n * @throws Will throw an error if the options fail validation\n * @example\n * import { createBlockscoutClient } from '@settlemint/sdk-blockscout';\n * import type { introspection } from \"@schemas/blockscout-env\";\n * import { createLogger, requestLogger } from '@settlemint/sdk-utils/logging';\n *\n * const logger = createLogger();\n *\n * const { client, graphql } = createBlockscoutClient<{\n * introspection: introspection;\n * disableMasking: true;\n * scalars: {\n * AddressHash: string;\n * Data: string;\n * DateTime: string;\n * Decimal: string;\n * FullHash: string;\n * Json: string;\n * NonceHash: string;\n * Wei: string;\n * };\n * }>({\n * instance: process.env.SETTLEMINT_BLOCKSCOUT_ENDPOINT,\n * accessToken: process.env.SETTLEMINT_ACCESS_TOKEN\n * }, {\n * fetch: requestLogger(logger, \"blockscout\", fetch) as typeof fetch,\n * });\n *\n * // Making GraphQL queries\n * const query = graphql(`\n * query GetTransaction($hash: String!) {\n * transaction(hash: $hash) {\n * hash\n * blockNumber\n * value\n * gasUsed\n * }\n * }\n * `);\n *\n * const result = await client.request(query, {\n * hash: \"0x123abc...\"\n * });\n */\nexport function createBlockscoutClient<const Setup extends AbstractSetupSchema>(\n options: ClientOptions,\n clientOptions?: RequestConfig,\n): {\n client: GraphQLClient;\n graphql: initGraphQLTada<Setup>;\n} {\n ensureServer();\n const validatedOptions = validate(ClientOptionsSchema, options);\n const graphql = initGraphQLTada<Setup>();\n const fullUrl = new URL(validatedOptions.instance).toString();\n\n return {\n client: new GraphQLClient(fullUrl, {\n ...clientOptions,\n headers: appendHeaders(clientOptions?.headers, { \"x-auth-token\": validatedOptions.accessToken }),\n }),\n graphql,\n };\n}\n\nexport type { FragmentOf, ResultOf, VariablesOf } from \"gql.tada\";\nexport { readFragment } from \"gql.tada\";\n"],"mappings":";;;;;;;;;;;;AAeA,MAAa,sBAAsBA,MAAE,OAAO;CAC1C,UAAUC;CACV,aAAaC,8DAA6B,UAAU;CACrD,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDF,SAAgB,uBACd,SACA,eAIA;AACA,kDAAc;CACd,MAAM,kEAA4B,qBAAqB,QAAQ;CAC/D,MAAM,yCAAkC;CACxC,MAAM,UAAU,IAAI,IAAI,iBAAiB,SAAS,CAAC,UAAU;AAE7D,QAAO;EACL,QAAQ,IAAIC,8BAAc,SAAS;GACjC,GAAG;GACH,uDAAuB,eAAe,SAAS,EAAE,gBAAgB,iBAAiB,aAAa,CAAC;GACjG,CAAC;EACF;EACD"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@settlemint/sdk-blockscout",
3
3
  "description": "Blockscout integration module for SettleMint SDK, enabling blockchain explorer and analytics functionality",
4
- "version": "2.6.4-prffd0842f",
4
+ "version": "2.6.6-mainc66d59a",
5
5
  "type": "module",
6
6
  "private": false,
7
7
  "license": "FSL-1.1-MIT",
@@ -47,14 +47,14 @@
47
47
  "test": "bun test",
48
48
  "test:coverage": "bun test --coverage",
49
49
  "typecheck": "tsc --noEmit",
50
- "publish-npm": "bun publish --tag ${TAG} --access public || exit 0",
50
+ "publish-npm": "npm publish --provenance --tag ${TAG} --access public",
51
51
  "prepack": "cp ../../LICENSE .",
52
52
  "docs": "typedoc --options '../../typedoc.config.mjs' --entryPoints src/blockscout.ts --out ./docs"
53
53
  },
54
54
  "devDependencies": {},
55
55
  "dependencies": {
56
56
  "gql.tada": "^1",
57
- "@settlemint/sdk-utils": "2.6.4-prffd0842f",
57
+ "@settlemint/sdk-utils": "2.6.6-mainc66d59a",
58
58
  "graphql-request": "^7",
59
59
  "zod": "^4"
60
60
  },