@settlemint/sdk-eas 2.3.14-pr9ea16ef8 → 2.3.14-pra1fe7e80
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 +63 -1072
- package/dist/browser/eas.d.ts +1 -7
- package/dist/browser/eas.js +21 -20
- package/dist/browser/eas.js.map +1 -1
- package/dist/eas.cjs +20 -19
- package/dist/eas.cjs.map +1 -1
- package/dist/eas.d.cts +1 -7
- package/dist/eas.d.ts +1 -7
- package/dist/eas.js +21 -20
- package/dist/eas.js.map +1 -1
- package/package.json +3 -3
package/dist/eas.d.cts
CHANGED
|
@@ -3816,7 +3816,7 @@ type PortalClient = ReturnType<typeof createPortalClient<{
|
|
|
3816
3816
|
//#endregion
|
|
3817
3817
|
//#region src/utils/validation.d.ts
|
|
3818
3818
|
/**
|
|
3819
|
-
* Zod schema for EASClientOptions.
|
|
3819
|
+
* @description Zod schema for EASClientOptions.
|
|
3820
3820
|
*/
|
|
3821
3821
|
declare const EASClientOptionsSchema: z.ZodObject<{
|
|
3822
3822
|
instance: z.ZodString;
|
|
@@ -3988,7 +3988,6 @@ interface DeploymentResult {
|
|
|
3988
3988
|
}
|
|
3989
3989
|
/**
|
|
3990
3990
|
* @deprecated Use SchemaRequest instead
|
|
3991
|
-
* @internal
|
|
3992
3991
|
*/
|
|
3993
3992
|
interface RegisterSchemaOptions extends SchemaRequest {}
|
|
3994
3993
|
//#endregion
|
|
@@ -4120,11 +4119,6 @@ declare class EASClient {
|
|
|
4120
4119
|
private readonly portalClient;
|
|
4121
4120
|
private readonly portalGraphql;
|
|
4122
4121
|
private deployedAddresses?;
|
|
4123
|
-
/**
|
|
4124
|
-
* Create a new EAS client instance
|
|
4125
|
-
*
|
|
4126
|
-
* @param options - Configuration options for the EAS client
|
|
4127
|
-
*/
|
|
4128
4122
|
constructor(options: EASClientOptions);
|
|
4129
4123
|
/**
|
|
4130
4124
|
* Deploy EAS contracts via Portal
|
package/dist/eas.d.ts
CHANGED
|
@@ -3816,7 +3816,7 @@ type PortalClient = ReturnType<typeof createPortalClient<{
|
|
|
3816
3816
|
//#endregion
|
|
3817
3817
|
//#region src/utils/validation.d.ts
|
|
3818
3818
|
/**
|
|
3819
|
-
* Zod schema for EASClientOptions.
|
|
3819
|
+
* @description Zod schema for EASClientOptions.
|
|
3820
3820
|
*/
|
|
3821
3821
|
declare const EASClientOptionsSchema: z.ZodObject<{
|
|
3822
3822
|
instance: z.ZodString;
|
|
@@ -3988,7 +3988,6 @@ interface DeploymentResult {
|
|
|
3988
3988
|
}
|
|
3989
3989
|
/**
|
|
3990
3990
|
* @deprecated Use SchemaRequest instead
|
|
3991
|
-
* @internal
|
|
3992
3991
|
*/
|
|
3993
3992
|
interface RegisterSchemaOptions extends SchemaRequest {}
|
|
3994
3993
|
//#endregion
|
|
@@ -4120,11 +4119,6 @@ declare class EASClient {
|
|
|
4120
4119
|
private readonly portalClient;
|
|
4121
4120
|
private readonly portalGraphql;
|
|
4122
4121
|
private deployedAddresses?;
|
|
4123
|
-
/**
|
|
4124
|
-
* Create a new EAS client instance
|
|
4125
|
-
*
|
|
4126
|
-
* @param options - Configuration options for the EAS client
|
|
4127
|
-
*/
|
|
4128
4122
|
constructor(options: EASClientOptions);
|
|
4129
4123
|
/**
|
|
4130
4124
|
* Deploy EAS contracts via Portal
|
package/dist/eas.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { createPortalClient, waitForTransactionReceipt } from "@settlemint/sdk-portal";
|
|
3
3
|
import { createLogger, requestLogger } from "@settlemint/sdk-utils/logging";
|
|
4
|
-
import { ApplicationAccessTokenSchema,
|
|
4
|
+
import { ApplicationAccessTokenSchema, validate } from "@settlemint/sdk-utils/validation";
|
|
5
5
|
import { isAddress, zeroAddress } from "viem";
|
|
6
6
|
|
|
7
7
|
//#region rolldown:runtime
|
|
@@ -10854,10 +10854,10 @@ var v4_default = classic_default;
|
|
|
10854
10854
|
//#region src/utils/validation.ts
|
|
10855
10855
|
const ethAddressSchema = custom((val) => typeof val === "string" && isAddress(val), "Invalid Ethereum address");
|
|
10856
10856
|
/**
|
|
10857
|
-
* Zod schema for EASClientOptions.
|
|
10857
|
+
* @description Zod schema for EASClientOptions.
|
|
10858
10858
|
*/
|
|
10859
10859
|
const EASClientOptionsSchema = object({
|
|
10860
|
-
instance:
|
|
10860
|
+
instance: string$1().url("Invalid instance URL"),
|
|
10861
10861
|
accessToken: ApplicationAccessTokenSchema.optional(),
|
|
10862
10862
|
easContractAddress: ethAddressSchema.optional(),
|
|
10863
10863
|
schemaRegistryContractAddress: ethAddressSchema.optional(),
|
|
@@ -10867,7 +10867,6 @@ const EASClientOptionsSchema = object({
|
|
|
10867
10867
|
//#endregion
|
|
10868
10868
|
//#region src/eas.ts
|
|
10869
10869
|
const LOGGER = createLogger();
|
|
10870
|
-
const DEFAULT_GAS_LIMIT = "0x3d0900";
|
|
10871
10870
|
/**
|
|
10872
10871
|
* Main EAS client class for interacting with Ethereum Attestation Service via Portal
|
|
10873
10872
|
*
|
|
@@ -10890,11 +10889,6 @@ var EASClient = class {
|
|
|
10890
10889
|
portalClient;
|
|
10891
10890
|
portalGraphql;
|
|
10892
10891
|
deployedAddresses;
|
|
10893
|
-
/**
|
|
10894
|
-
* Create a new EAS client instance
|
|
10895
|
-
*
|
|
10896
|
-
* @param options - Configuration options for the EAS client
|
|
10897
|
-
*/
|
|
10898
10892
|
constructor(options) {
|
|
10899
10893
|
this.options = validate(EASClientOptionsSchema, options);
|
|
10900
10894
|
const { client: portalClient, graphql: portalGraphql } = createPortalClient({
|
|
@@ -10935,11 +10929,12 @@ var EASClient = class {
|
|
|
10935
10929
|
const defaultForwarder = forwarderAddress || ZERO_ADDRESS;
|
|
10936
10930
|
const defaultGasLimit = gasLimit || "0x7a1200";
|
|
10937
10931
|
try {
|
|
10938
|
-
const
|
|
10932
|
+
const schemaRegistryResult = await this.portalClient.request(GraphQLOperations.mutations.deploySchemaRegistry(this.portalGraphql), {
|
|
10939
10933
|
from: deployerAddress,
|
|
10940
10934
|
constructorArguments: { forwarder: defaultForwarder },
|
|
10941
10935
|
gasLimit: defaultGasLimit
|
|
10942
10936
|
});
|
|
10937
|
+
const schemaRegistryResponse = schemaRegistryResult;
|
|
10943
10938
|
if (!schemaRegistryResponse.DeployContractEASSchemaRegistry?.transactionHash) {
|
|
10944
10939
|
throw new Error("Schema Registry deployment failed - no transaction hash returned");
|
|
10945
10940
|
}
|
|
@@ -10961,10 +10956,11 @@ var EASClient = class {
|
|
|
10961
10956
|
},
|
|
10962
10957
|
gasLimit: defaultGasLimit
|
|
10963
10958
|
});
|
|
10964
|
-
|
|
10959
|
+
const easResult = easResponse;
|
|
10960
|
+
if (!easResult.DeployContractEAS?.transactionHash) {
|
|
10965
10961
|
throw new Error("EAS deployment failed - no transaction hash returned");
|
|
10966
10962
|
}
|
|
10967
|
-
const easTxHash =
|
|
10963
|
+
const easTxHash = easResult.DeployContractEAS.transactionHash;
|
|
10968
10964
|
const easTransaction = await waitForTransactionReceipt(easTxHash, {
|
|
10969
10965
|
portalGraphqlEndpoint: this.options.instance,
|
|
10970
10966
|
accessToken: this.options.accessToken,
|
|
@@ -11025,7 +11021,7 @@ var EASClient = class {
|
|
|
11025
11021
|
throw new Error("Schema string is required. Provide either 'schema' or 'fields'.");
|
|
11026
11022
|
}
|
|
11027
11023
|
try {
|
|
11028
|
-
const
|
|
11024
|
+
const result = await this.portalClient.request(GraphQLOperations.mutations.registerSchema(this.portalGraphql), {
|
|
11029
11025
|
address: schemaRegistryAddress,
|
|
11030
11026
|
from: fromAddress,
|
|
11031
11027
|
input: {
|
|
@@ -11033,8 +11029,9 @@ var EASClient = class {
|
|
|
11033
11029
|
resolver: request.resolver,
|
|
11034
11030
|
revocable: request.revocable
|
|
11035
11031
|
},
|
|
11036
|
-
gasLimit: gasLimit ||
|
|
11032
|
+
gasLimit: gasLimit || "0x3d0900"
|
|
11037
11033
|
});
|
|
11034
|
+
const response = result;
|
|
11038
11035
|
const transactionHash = response.EASSchemaRegistryRegister?.transactionHash;
|
|
11039
11036
|
if (!transactionHash) {
|
|
11040
11037
|
throw new Error("No transaction hash returned from Portal");
|
|
@@ -11086,7 +11083,7 @@ var EASClient = class {
|
|
|
11086
11083
|
async attest(request, fromAddress, gasLimit) {
|
|
11087
11084
|
const easAddress = this.getEASAddress();
|
|
11088
11085
|
try {
|
|
11089
|
-
const
|
|
11086
|
+
const result = await this.portalClient.request(GraphQLOperations.mutations.attest(this.portalGraphql), {
|
|
11090
11087
|
address: easAddress,
|
|
11091
11088
|
from: fromAddress,
|
|
11092
11089
|
input: { request: {
|
|
@@ -11100,8 +11097,9 @@ var EASClient = class {
|
|
|
11100
11097
|
value: request.data.value?.toString() || "0"
|
|
11101
11098
|
}
|
|
11102
11099
|
} },
|
|
11103
|
-
gasLimit: gasLimit ||
|
|
11100
|
+
gasLimit: gasLimit || "0x3d0900"
|
|
11104
11101
|
});
|
|
11102
|
+
const response = result;
|
|
11105
11103
|
const transactionHash = response.EASAttest?.transactionHash;
|
|
11106
11104
|
if (!transactionHash) {
|
|
11107
11105
|
throw new Error("No transaction hash returned from Portal");
|
|
@@ -11169,7 +11167,7 @@ var EASClient = class {
|
|
|
11169
11167
|
}
|
|
11170
11168
|
const easAddress = this.getEASAddress();
|
|
11171
11169
|
try {
|
|
11172
|
-
const
|
|
11170
|
+
const result = await this.portalClient.request(GraphQLOperations.mutations.multiAttest(this.portalGraphql), {
|
|
11173
11171
|
address: easAddress,
|
|
11174
11172
|
from: fromAddress,
|
|
11175
11173
|
input: { multiRequests: requests.map((req) => ({
|
|
@@ -11183,8 +11181,9 @@ var EASClient = class {
|
|
|
11183
11181
|
value: req.data.value?.toString() || "0"
|
|
11184
11182
|
}]
|
|
11185
11183
|
})) },
|
|
11186
|
-
gasLimit: gasLimit ||
|
|
11184
|
+
gasLimit: gasLimit || "0x3d0900"
|
|
11187
11185
|
});
|
|
11186
|
+
const response = result;
|
|
11188
11187
|
const transactionHash = response.EASMultiAttest?.transactionHash;
|
|
11189
11188
|
if (!transactionHash) {
|
|
11190
11189
|
throw new Error("No transaction hash returned from Portal");
|
|
@@ -11228,8 +11227,9 @@ var EASClient = class {
|
|
|
11228
11227
|
* ```
|
|
11229
11228
|
*/
|
|
11230
11229
|
async revoke(schemaUID, attestationUID, fromAddress, value, gasLimit) {
|
|
11230
|
+
const easAddress = this.getEASAddress();
|
|
11231
11231
|
try {
|
|
11232
|
-
const
|
|
11232
|
+
const result = await this.portalClient.request(GraphQLOperations.mutations.revoke(this.portalGraphql), {
|
|
11233
11233
|
address: this.getEASAddress(),
|
|
11234
11234
|
from: fromAddress,
|
|
11235
11235
|
input: { request: {
|
|
@@ -11239,8 +11239,9 @@ var EASClient = class {
|
|
|
11239
11239
|
value: value?.toString() || "0"
|
|
11240
11240
|
}
|
|
11241
11241
|
} },
|
|
11242
|
-
gasLimit: gasLimit ||
|
|
11242
|
+
gasLimit: gasLimit || "0x3d0900"
|
|
11243
11243
|
});
|
|
11244
|
+
const response = result;
|
|
11244
11245
|
const transactionHash = response.EASRevoke?.transactionHash;
|
|
11245
11246
|
if (!transactionHash) {
|
|
11246
11247
|
throw new Error("No transaction hash returned from Portal");
|