@coordination-network/network-member-client 0.0.1 → 0.0.2
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.cjs +4 -4
- package/dist/index.js +4 -4
- package/package.json +6 -6
- package/src/sponsored-relay.ts +1 -1
- package/src/sponsored.ts +1 -1
- package/src/submit.ts +2 -6
package/dist/index.cjs
CHANGED
|
@@ -108,7 +108,7 @@ async function readIdentity(identityReader, networkId) {
|
|
|
108
108
|
return await identityReader.getIdentity(networkId);
|
|
109
109
|
}
|
|
110
110
|
catch (error) {
|
|
111
|
-
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE",
|
|
111
|
+
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE", "identity read failed", error);
|
|
112
112
|
}
|
|
113
113
|
}
|
|
114
114
|
/**
|
|
@@ -167,7 +167,7 @@ async function submitRegistration(request, { domain, identityReader, prover, wri
|
|
|
167
167
|
}
|
|
168
168
|
throw error;
|
|
169
169
|
}
|
|
170
|
-
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE",
|
|
170
|
+
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE", "registration submission failed", error);
|
|
171
171
|
}
|
|
172
172
|
}
|
|
173
173
|
|
|
@@ -587,7 +587,7 @@ const GAS_LIMITS = {
|
|
|
587
587
|
verificationGasLimit: 500000n,
|
|
588
588
|
preVerificationGas: 100000n,
|
|
589
589
|
paymasterVerificationGasLimit: 600000n,
|
|
590
|
-
paymasterPostOpGasLimit:
|
|
590
|
+
paymasterPostOpGasLimit: 0n
|
|
591
591
|
};
|
|
592
592
|
const GAS_FEE_PER_GAS = 1000000000n; // 1 gwei
|
|
593
593
|
/**
|
|
@@ -743,7 +743,7 @@ class SponsoredIdentityRegistryWriter {
|
|
|
743
743
|
if (receipt.revertReason !== undefined && decodedErrorName(receipt.revertReason) === "AlreadyRegistered") {
|
|
744
744
|
throw new RegistryRevertError("AlreadyRegistered", receipt.revertReason);
|
|
745
745
|
}
|
|
746
|
-
throw new Error(
|
|
746
|
+
throw new Error("sponsored registerIdentity user operation reverted");
|
|
747
747
|
}
|
|
748
748
|
return { txHash: receipt.transactionHash, sponsorship };
|
|
749
749
|
}
|
package/dist/index.js
CHANGED
|
@@ -106,7 +106,7 @@ async function readIdentity(identityReader, networkId) {
|
|
|
106
106
|
return await identityReader.getIdentity(networkId);
|
|
107
107
|
}
|
|
108
108
|
catch (error) {
|
|
109
|
-
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE",
|
|
109
|
+
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE", "identity read failed", error);
|
|
110
110
|
}
|
|
111
111
|
}
|
|
112
112
|
/**
|
|
@@ -165,7 +165,7 @@ async function submitRegistration(request, { domain, identityReader, prover, wri
|
|
|
165
165
|
}
|
|
166
166
|
throw error;
|
|
167
167
|
}
|
|
168
|
-
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE",
|
|
168
|
+
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE", "registration submission failed", error);
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
|
|
@@ -585,7 +585,7 @@ const GAS_LIMITS = {
|
|
|
585
585
|
verificationGasLimit: 500000n,
|
|
586
586
|
preVerificationGas: 100000n,
|
|
587
587
|
paymasterVerificationGasLimit: 600000n,
|
|
588
|
-
paymasterPostOpGasLimit:
|
|
588
|
+
paymasterPostOpGasLimit: 0n
|
|
589
589
|
};
|
|
590
590
|
const GAS_FEE_PER_GAS = 1000000000n; // 1 gwei
|
|
591
591
|
/**
|
|
@@ -741,7 +741,7 @@ class SponsoredIdentityRegistryWriter {
|
|
|
741
741
|
if (receipt.revertReason !== undefined && decodedErrorName(receipt.revertReason) === "AlreadyRegistered") {
|
|
742
742
|
throw new RegistryRevertError("AlreadyRegistered", receipt.revertReason);
|
|
743
743
|
}
|
|
744
|
-
throw new Error(
|
|
744
|
+
throw new Error("sponsored registerIdentity user operation reverted");
|
|
745
745
|
}
|
|
746
746
|
return { txHash: receipt.transactionHash, sponsorship };
|
|
747
747
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coordination-network/network-member-client",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"description": "Issues a UserApproval credential and its Merkle path into the approved-issuer set for network-member apps, refreshable as the set changes.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,11 +36,11 @@
|
|
|
36
36
|
"build": "rimraf dist types && rollup -c rollup.config.mjs"
|
|
37
37
|
},
|
|
38
38
|
"dependencies": {
|
|
39
|
-
"@coordination-network/credential": "^0.0.
|
|
40
|
-
"@coordination-network/identity": "^0.0.
|
|
41
|
-
"@coordination-network/issuer-set": "^0.0.
|
|
42
|
-
"@coordination-network/network-member-proof": "^0.0.
|
|
43
|
-
"@coordination-network/user-client": "^0.0.
|
|
39
|
+
"@coordination-network/credential": "^0.0.2",
|
|
40
|
+
"@coordination-network/identity": "^0.0.2",
|
|
41
|
+
"@coordination-network/issuer-set": "^0.0.2",
|
|
42
|
+
"@coordination-network/network-member-proof": "^0.0.2",
|
|
43
|
+
"@coordination-network/user-client": "^0.0.2",
|
|
44
44
|
"@semaphore-protocol/group": "4.14.3",
|
|
45
45
|
"@semaphore-protocol/identity": "4.14.3",
|
|
46
46
|
"@semaphore-protocol/proof": "4.14.3",
|
package/src/sponsored-relay.ts
CHANGED
|
@@ -42,7 +42,7 @@ const GAS_LIMITS = {
|
|
|
42
42
|
verificationGasLimit: 500_000n,
|
|
43
43
|
preVerificationGas: 100_000n,
|
|
44
44
|
paymasterVerificationGasLimit: 600_000n,
|
|
45
|
-
paymasterPostOpGasLimit:
|
|
45
|
+
paymasterPostOpGasLimit: 0n
|
|
46
46
|
} as const
|
|
47
47
|
const GAS_FEE_PER_GAS = 1_000_000_000n // 1 gwei
|
|
48
48
|
|
package/src/sponsored.ts
CHANGED
|
@@ -46,7 +46,7 @@ export class SponsoredIdentityRegistryWriter implements RegistrationWriter {
|
|
|
46
46
|
if (receipt.revertReason !== undefined && decodedErrorName(receipt.revertReason) === "AlreadyRegistered") {
|
|
47
47
|
throw new RegistryRevertError("AlreadyRegistered", receipt.revertReason)
|
|
48
48
|
}
|
|
49
|
-
throw new Error(
|
|
49
|
+
throw new Error("sponsored registerIdentity user operation reverted")
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
return { txHash: receipt.transactionHash, sponsorship }
|
package/src/submit.ts
CHANGED
|
@@ -37,7 +37,7 @@ async function readIdentity(identityReader: IdentityReader, networkId: Hex): Pro
|
|
|
37
37
|
try {
|
|
38
38
|
return await identityReader.getIdentity(networkId)
|
|
39
39
|
} catch (error) {
|
|
40
|
-
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE",
|
|
40
|
+
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE", "identity read failed", error)
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
@@ -102,10 +102,6 @@ export async function submitRegistration(
|
|
|
102
102
|
}
|
|
103
103
|
throw error
|
|
104
104
|
}
|
|
105
|
-
throw new NetworkMemberClientError(
|
|
106
|
-
"REGISTRY_UNAVAILABLE",
|
|
107
|
-
`registration submission failed for ${networkId}`,
|
|
108
|
-
error
|
|
109
|
-
)
|
|
105
|
+
throw new NetworkMemberClientError("REGISTRY_UNAVAILABLE", "registration submission failed", error)
|
|
110
106
|
}
|
|
111
107
|
}
|