@magicnewton/newton-protocol-sdk 0.6.0 → 0.6.1
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 +0 -9
- package/dist/cjs/const.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/cjs/types/core/exception-types.js +1 -1
- package/dist/es/const.mjs +1 -1
- package/dist/es/index.mjs +1 -1
- package/dist/es/types/core/exception-types.mjs +1 -1
- package/dist/types/const.d.mts +0 -1
- package/dist/types/const.d.ts +0 -1
- package/dist/types/index.d.mts +0 -4
- package/dist/types/index.d.ts +0 -4
- package/dist/types/types/core/exception-types.d.mts +1 -5
- package/dist/types/types/core/exception-types.d.ts +1 -5
- package/dist/types/types/identity.d.mts +0 -28
- package/dist/types/types/identity.d.ts +0 -28
- package/dist/types/types/index.d.mts +0 -1
- package/dist/types/types/index.d.ts +0 -1
- package/package.json +1 -1
- package/dist/cjs/modules/identity/index.js +0 -1
- package/dist/es/modules/identity/index.mjs +0 -1
- package/dist/types/modules/identity/index.d.mts +0 -30
- package/dist/types/modules/identity/index.d.ts +0 -30
package/README.md
CHANGED
|
@@ -109,15 +109,6 @@ The SDK includes a privacy module for client-side HPKE encryption used in privac
|
|
|
109
109
|
|
|
110
110
|
See the [SDK Reference](https://docs.newton.xyz/developers/reference/sdk-reference) for full API documentation.
|
|
111
111
|
|
|
112
|
-
## Identity Module
|
|
113
|
-
|
|
114
|
-
The SDK includes an identity module for submitting EIP-712 signed identity data to the on-chain IdentityRegistry. Key exports:
|
|
115
|
-
|
|
116
|
-
- `sendIdentityEncrypted` -- sign and submit encrypted identity data to the gateway
|
|
117
|
-
- `identityDomainHash` -- compute the bytes32 domain identifier from a name (e.g., `identityDomainHash("kyc")`)
|
|
118
|
-
|
|
119
|
-
The module uses viem's `signTypedData` with domain `{name: "IdentityRegistry", version: "1"}` and a single EIP-712 struct `EncryptedIdentityData { string data }` that works across all identity domains.
|
|
120
|
-
|
|
121
112
|
## Testing
|
|
122
113
|
|
|
123
114
|
The project uses Vitest for unit testing:
|
package/dist/cjs/const.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var e=require("viem/chains");const
|
|
1
|
+
"use strict";var e=require("viem/chains");const a={[e.sepolia.id]:"https://gateway.testnet.newton.xyz/rpc",[e.mainnet.id]:"https://gateway.newton.xyz/rpc",[e.baseSepolia.id]:"https://gateway.testnet.newton.xyz/rpc",[e.base.id]:"https://gateway.newton.xyz/rpc"},t={createTask:"newt_createTask",sendTask:"newt_sendTask",simulatePolicy:"newt_simulatePolicy",simulateTask:"newt_simulateTask",simulatePolicyData:"newt_simulatePolicyData",simulatePolicyDataWithClient:"newt_simulatePolicyDataWithClient",getPrivacyPublicKey:"newt_getPrivacyPublicKey",uploadEncryptedData:"newt_uploadEncryptedData",storeEncryptedSecrets:"newt_storeEncryptedSecrets"},i={[e.sepolia.id]:"0xecb741f4875770f9a5f060cb30f6c9eb5966ed13",[e.mainnet.id]:"0x2010dbaa5438801bdc3f08174a799fe344f544ee",[e.baseSepolia.id]:"0xc3dc89b5e5241ef53c468dfbaa371a7f1d465eb7"},c={[e.sepolia.id]:"0x26f452e4b9c9c28508cb836ba486cceaa95b429c",[e.mainnet.id]:"0x263c275c15867a4611a44c600e77144a23012a06",[e.baseSepolia.id]:"0x4e21b596944ebe8bd3773dd70c6f134bd2840a73"};exports.ATTESTATION_VALIDATOR=c,exports.GATEWAY_API_URLS=a,exports.GATEWAY_METHODS=t,exports.NEWTON_PROVER_TASK_MANAGER=i;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var s=require("viem/chains"),d=require("./modules/avs/index.js"),
|
|
1
|
+
"use strict";var s=require("viem/chains"),d=require("./modules/avs/index.js"),o=require("./modules/policy/index.js"),c=require("./modules/privacy/index.js"),w=require("./const.js"),y=require("./service/popup.js");require("./types/core/exception-types.js");var C=require("./types/core/json-rpc-types.js"),A=require("./utils/get-payload-id.js");const g=[s.mainnet.id,s.sepolia.id,s.baseSepolia.id],R=(h,l)=>e=>{const{apiKey:r,policyContractAddress:n}=h,p=()=>{if(!n)throw new Error('Newton SDK: policyContractAddress is required. Ensure you instantiate viem client actions extension with policyContractAddress parameter. Example: newtonWalletClientActions({ policyContractAddress: "0x123..." })');return n};if(!g.includes(e?.chain?.id??s.sepolia.id))throw new Error(`Newton SDK: Invalid network specified for newtonWalletClientActions. Only ${g.join(", ")} are supported`);const P=l?.taskManagerAddress??w.NEWTON_PROVER_TASK_MANAGER[e?.chain?.id??s.sepolia.id],t=l?.gatewayApiUrl??void 0,a=l?.newtonIdpUrl,m=l?.identityRegistry??void 0;return{submitEvaluationRequest:i=>d.submitEvaluationRequest(e,i,P,r,t),evaluateIntentDirect:i=>d.evaluateIntentDirect(e,i,r,t),submitIntentAndSubscribe:i=>d.submitIntentAndSubscribe(e,i,r,t),simulateTask:i=>d.simulateTask(e,i,r,t),simulatePolicy:i=>d.simulatePolicy(e,i,r,t),simulatePolicyData:i=>d.simulatePolicyData(e,i,r,t),simulatePolicyDataWithClient:i=>d.simulatePolicyDataWithClient(e,i,r,t),initialize:i=>{const u=p();return o.policyWriteFunctions.initialize({walletClient:e,policyContractAddress:u,...i})},renounceOwnership:()=>{const i=p();return o.policyWriteFunctions.renounceOwnership({walletClient:e,policyContractAddress:i})},transferOwnership:i=>{const u=p();return o.policyWriteFunctions.transferOwnership({walletClient:e,policyContractAddress:u,...i})},connectIdentityWithNewton:i=>y.popupRequest({method:C.NewtonIdpPayloadMethod.Connect,id:A.getPayloadId(),jsonrpc:"2.0",params:{apiKey:r,chainId:e.chain?.id,appWalletAddress:i.appWalletAddress,appClientAddress:i.appClientAddress}},a),registerUserData:i=>y.popupRequest({method:C.NewtonIdpPayloadMethod.RegisterUserData,id:A.getPayloadId(),jsonrpc:"2.0",params:{apiKey:r,userData:i.userData,gatewayApiUrlOverride:t,chainId:e.chain?.id,appIdentityDomain:i.appIdentityDomain,identityRegistryOverride:m}},a),linkApp:i=>y.popupRequest({method:C.NewtonIdpPayloadMethod.LinkApp,id:A.getPayloadId(),jsonrpc:"2.0",params:{apiKey:r,appWalletAddress:i.appWalletAddress,appClientAddress:i.appClientAddress,appIdentityDomain:i.appIdentityDomain,chainId:e.chain?.id,identityRegistryOverride:m}},a),unlinkApp:i=>y.popupRequest({method:C.NewtonIdpPayloadMethod.Unlink,id:A.getPayloadId(),jsonrpc:"2.0",params:{apiKey:r,appWalletAddress:i.appWalletAddress,appClientAddress:i.appClientAddress,chainId:e.chain?.id,appIdentityDomain:i.appIdentityDomain,identityRegistryOverride:m}},a),getPrivacyPublicKey:()=>c.getPrivacyPublicKey(e?.chain?.id??s.sepolia.id,r,t),createSecureEnvelope:(i,u)=>c.createSecureEnvelope(i,u),uploadEncryptedData:i=>c.uploadEncryptedData(e?.chain?.id??s.sepolia.id,r,i,t),uploadSecureEnvelope:i=>c.uploadSecureEnvelope(e?.chain?.id??s.sepolia.id,r,i,t),generateSigningKeyPair:()=>c.generateSigningKeyPair(),storeEncryptedSecrets:i=>c.storeEncryptedSecrets(e?.chain?.id??s.sepolia.id,r,i,t),signPrivacyAuthorization:i=>c.signPrivacyAuthorization(i)}},v=(h,l)=>e=>{if(!g.includes(e?.chain?.id??s.sepolia.id))throw new Error(`Newton SDK: Invalid network specified for newtonPublicActions. Only ${g.join(", ")} are supported.`);const r=h?.policyContractAddress,n=()=>{if(!r)throw new Error('Newton SDK: policyContractAddress is required. Ensure you instantiate viem client actions extension with policyContractAddress parameter. Example: newtonPublicClientActions({ policyContractAddress: "0x123..." })');return r},p=l?.taskManagerAddress??w.NEWTON_PROVER_TASK_MANAGER[e?.chain?.id??s.sepolia.id],P=l?.attestationValidatorAddress??w.ATTESTATION_VALIDATOR[e?.chain?.id??s.sepolia.id];return{waitForTaskResponded:t=>d.waitForTaskResponded(e,t,p),getTaskResponseHash:t=>d.getTaskResponseHash(e,t,p),getTaskStatus:t=>d.getTaskStatus(e,t,p,P),clientToPolicyId:t=>{const a=n();return o.policyReadFunctions.clientToPolicyId({publicClient:e,policyContractAddress:a,...t})},entrypoint:()=>{const t=n();return o.policyReadFunctions.entrypoint({publicClient:e,policyContractAddress:t})},factory:()=>{const t=n();return o.policyReadFunctions.factory({publicClient:e,policyContractAddress:t})},getEntrypoint:()=>{const t=n();return o.policyReadFunctions.getEntrypoint({publicClient:e,policyContractAddress:t})},getMetadataCid:()=>{const t=n();return o.policyReadFunctions.getMetadataCid({publicClient:e,policyContractAddress:t})},getPolicyCid:()=>{const t=n();return o.policyReadFunctions.getPolicyCid({publicClient:e,policyContractAddress:t})},getPolicyConfig:t=>{const a=n();return o.policyReadFunctions.getPolicyConfig({publicClient:e,policyContractAddress:a,...t})},getPolicyData:()=>{const t=n();return o.policyReadFunctions.getPolicyData({publicClient:e,policyContractAddress:t})},getPolicyId:t=>{const a=n();return o.policyReadFunctions.getPolicyId({publicClient:e,policyContractAddress:a,...t})},getSchemaCid:()=>{const t=n();return o.policyReadFunctions.getSchemaCid({publicClient:e,policyContractAddress:t})},isPolicyVerified:()=>{const t=n();return o.policyReadFunctions.isPolicyVerified({publicClient:e,policyContractAddress:t})},metadataCid:()=>{const t=n();return o.policyReadFunctions.metadataCid({publicClient:e,policyContractAddress:t})},owner:()=>{const t=n();return o.policyReadFunctions.owner({publicClient:e,policyContractAddress:t})},policyCid:()=>{const t=n();return o.policyReadFunctions.policyCid({publicClient:e,policyContractAddress:t})},policyData:t=>{const a=n();return o.policyReadFunctions.policyData({publicClient:e,policyContractAddress:a,...t})},schemaCid:()=>{const t=n();return o.policyReadFunctions.schemaCid({publicClient:e,policyContractAddress:t})},supportsInterface:t=>{const a=n();return o.policyReadFunctions.supportsInterface({publicClient:e,policyContractAddress:a,...t})},precomputePolicyId:t=>{const a=n();return o.policyReadFunctions.precomputePolicyId({publicClient:e,policyContractAddress:a,...t})}}};exports.createSecureEnvelope=c.createSecureEnvelope,exports.generateSigningKeyPair=c.generateSigningKeyPair,exports.getPrivacyPublicKey=c.getPrivacyPublicKey,exports.signPrivacyAuthorization=c.signPrivacyAuthorization,exports.storeEncryptedSecrets=c.storeEncryptedSecrets,exports.uploadEncryptedData=c.uploadEncryptedData,exports.uploadSecureEnvelope=c.uploadSecureEnvelope,exports.newtonPublicClientActions=v,exports.newtonWalletClientActions=R;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";exports.SDKErrorCode=void 0,(function(e){e.MissingApiKey="MISSING_API_KEY",e.PopupAlreadyExists="POPUP_ALREADY_EXISTS",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e.FailedToOpenPopup="FAILED_TO_OPEN_POPUP",e.FailedToRetrieveNativeTokenBalance="FAILED_TO_RETRIEVE_NATIVE_TOKEN_BALANCE"
|
|
1
|
+
"use strict";exports.SDKErrorCode=void 0,(function(e){e.MissingApiKey="MISSING_API_KEY",e.PopupAlreadyExists="POPUP_ALREADY_EXISTS",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e.FailedToOpenPopup="FAILED_TO_OPEN_POPUP",e.FailedToRetrieveNativeTokenBalance="FAILED_TO_RETRIEVE_NATIVE_TOKEN_BALANCE"})(exports.SDKErrorCode||(exports.SDKErrorCode={})),exports.SDKWarningCode=void 0,(function(e){e.SyncWeb3Method="SYNC_WEB3_METHOD",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT"})(exports.SDKWarningCode||(exports.SDKWarningCode={})),exports.RPCErrorCode=void 0,(function(e){e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e[e.UserRejectedAction=-10012]="UserRejectedAction",e[e.RequestCancelled=-10014]="RequestCancelled",e[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e[e.NewtonWalletSessionTerminated=-10016]="NewtonWalletSessionTerminated",e[e.PopupRequestOverriden=-10017]="PopupRequestOverriden"})(exports.RPCErrorCode||(exports.RPCErrorCode={}));
|
package/dist/es/const.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{base as c,baseSepolia as e,mainnet as t,sepolia as a}from"viem/chains";const i={[a.id]:"https://gateway.testnet.newton.xyz/rpc",[t.id]:"https://gateway.newton.xyz/rpc",[e.id]:"https://gateway.testnet.newton.xyz/rpc",[c.id]:"https://gateway.newton.xyz/rpc"},n={createTask:"newt_createTask",sendTask:"newt_sendTask",simulatePolicy:"newt_simulatePolicy",simulateTask:"newt_simulateTask",simulatePolicyData:"newt_simulatePolicyData",simulatePolicyDataWithClient:"newt_simulatePolicyDataWithClient",getPrivacyPublicKey:"newt_getPrivacyPublicKey",uploadEncryptedData:"newt_uploadEncryptedData",storeEncryptedSecrets:"newt_storeEncryptedSecrets"
|
|
1
|
+
import{base as c,baseSepolia as e,mainnet as t,sepolia as a}from"viem/chains";const i={[a.id]:"https://gateway.testnet.newton.xyz/rpc",[t.id]:"https://gateway.newton.xyz/rpc",[e.id]:"https://gateway.testnet.newton.xyz/rpc",[c.id]:"https://gateway.newton.xyz/rpc"},n={createTask:"newt_createTask",sendTask:"newt_sendTask",simulatePolicy:"newt_simulatePolicy",simulateTask:"newt_simulateTask",simulatePolicyData:"newt_simulatePolicyData",simulatePolicyDataWithClient:"newt_simulatePolicyDataWithClient",getPrivacyPublicKey:"newt_getPrivacyPublicKey",uploadEncryptedData:"newt_uploadEncryptedData",storeEncryptedSecrets:"newt_storeEncryptedSecrets"},s={[a.id]:"0xecb741f4875770f9a5f060cb30f6c9eb5966ed13",[t.id]:"0x2010dbaa5438801bdc3f08174a799fe344f544ee",[e.id]:"0xc3dc89b5e5241ef53c468dfbaa371a7f1d465eb7"},d={[a.id]:"0x26f452e4b9c9c28508cb836ba486cceaa95b429c",[t.id]:"0x263c275c15867a4611a44c600e77144a23012a06",[e.id]:"0x4e21b596944ebe8bd3773dd70c6f134bd2840a73"};export{d as ATTESTATION_VALIDATOR,i as GATEWAY_API_URLS,n as GATEWAY_METHODS,s as NEWTON_PROVER_TASK_MANAGER};
|
package/dist/es/index.mjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{mainnet as
|
|
1
|
+
import{mainnet as S,sepolia as s,baseSepolia as R}from"viem/chains";import{getTaskStatus as T,getTaskResponseHash as k,waitForTaskResponded as K,simulatePolicyDataWithClient as W,simulatePolicyData as O,simulatePolicy as N,simulateTask as x,submitIntentAndSubscribe as U,evaluateIntentDirect as j,submitEvaluationRequest as z}from"./modules/avs/index.mjs";import{policyReadFunctions as a,policyWriteFunctions as g}from"./modules/policy/index.mjs";import{signPrivacyAuthorization as w,storeEncryptedSecrets as P,generateSigningKeyPair as b,uploadSecureEnvelope as I,uploadEncryptedData as D,createSecureEnvelope as f,getPrivacyPublicKey as E}from"./modules/privacy/index.mjs";import{NEWTON_PROVER_TASK_MANAGER as v,ATTESTATION_VALIDATOR as F}from"./const.mjs";import{popupRequest as p}from"./service/popup.mjs";import"./types/core/exception-types.mjs";import{NewtonIdpPayloadMethod as u}from"./types/core/json-rpc-types.mjs";import{getPayloadId as y}from"./utils/get-payload-id.mjs";const C=[S.id,s.id,R.id],M=(A,c)=>i=>{const{apiKey:r,policyContractAddress:n}=A,d=()=>{if(!n)throw new Error('Newton SDK: policyContractAddress is required. Ensure you instantiate viem client actions extension with policyContractAddress parameter. Example: newtonWalletClientActions({ policyContractAddress: "0x123..." })');return n};if(!C.includes(i?.chain?.id??s.id))throw new Error(`Newton SDK: Invalid network specified for newtonWalletClientActions. Only ${C.join(", ")} are supported`);const m=c?.taskManagerAddress??v[i?.chain?.id??s.id],t=c?.gatewayApiUrl??void 0,o=c?.newtonIdpUrl,h=c?.identityRegistry??void 0;return{submitEvaluationRequest:e=>z(i,e,m,r,t),evaluateIntentDirect:e=>j(i,e,r,t),submitIntentAndSubscribe:e=>U(i,e,r,t),simulateTask:e=>x(i,e,r,t),simulatePolicy:e=>N(i,e,r,t),simulatePolicyData:e=>O(i,e,r,t),simulatePolicyDataWithClient:e=>W(i,e,r,t),initialize:e=>{const l=d();return g.initialize({walletClient:i,policyContractAddress:l,...e})},renounceOwnership:()=>{const e=d();return g.renounceOwnership({walletClient:i,policyContractAddress:e})},transferOwnership:e=>{const l=d();return g.transferOwnership({walletClient:i,policyContractAddress:l,...e})},connectIdentityWithNewton:e=>p({method:u.Connect,id:y(),jsonrpc:"2.0",params:{apiKey:r,chainId:i.chain?.id,appWalletAddress:e.appWalletAddress,appClientAddress:e.appClientAddress}},o),registerUserData:e=>p({method:u.RegisterUserData,id:y(),jsonrpc:"2.0",params:{apiKey:r,userData:e.userData,gatewayApiUrlOverride:t,chainId:i.chain?.id,appIdentityDomain:e.appIdentityDomain,identityRegistryOverride:h}},o),linkApp:e=>p({method:u.LinkApp,id:y(),jsonrpc:"2.0",params:{apiKey:r,appWalletAddress:e.appWalletAddress,appClientAddress:e.appClientAddress,appIdentityDomain:e.appIdentityDomain,chainId:i.chain?.id,identityRegistryOverride:h}},o),unlinkApp:e=>p({method:u.Unlink,id:y(),jsonrpc:"2.0",params:{apiKey:r,appWalletAddress:e.appWalletAddress,appClientAddress:e.appClientAddress,chainId:i.chain?.id,appIdentityDomain:e.appIdentityDomain,identityRegistryOverride:h}},o),getPrivacyPublicKey:()=>E(i?.chain?.id??s.id,r,t),createSecureEnvelope:(e,l)=>f(e,l),uploadEncryptedData:e=>D(i?.chain?.id??s.id,r,e,t),uploadSecureEnvelope:e=>I(i?.chain?.id??s.id,r,e,t),generateSigningKeyPair:()=>b(),storeEncryptedSecrets:e=>P(i?.chain?.id??s.id,r,e,t),signPrivacyAuthorization:e=>w(e)}},q=(A,c)=>i=>{if(!C.includes(i?.chain?.id??s.id))throw new Error(`Newton SDK: Invalid network specified for newtonPublicActions. Only ${C.join(", ")} are supported.`);const r=A?.policyContractAddress,n=()=>{if(!r)throw new Error('Newton SDK: policyContractAddress is required. Ensure you instantiate viem client actions extension with policyContractAddress parameter. Example: newtonPublicClientActions({ policyContractAddress: "0x123..." })');return r},d=c?.taskManagerAddress??v[i?.chain?.id??s.id],m=c?.attestationValidatorAddress??F[i?.chain?.id??s.id];return{waitForTaskResponded:t=>K(i,t,d),getTaskResponseHash:t=>k(i,t,d),getTaskStatus:t=>T(i,t,d,m),clientToPolicyId:t=>{const o=n();return a.clientToPolicyId({publicClient:i,policyContractAddress:o,...t})},entrypoint:()=>{const t=n();return a.entrypoint({publicClient:i,policyContractAddress:t})},factory:()=>{const t=n();return a.factory({publicClient:i,policyContractAddress:t})},getEntrypoint:()=>{const t=n();return a.getEntrypoint({publicClient:i,policyContractAddress:t})},getMetadataCid:()=>{const t=n();return a.getMetadataCid({publicClient:i,policyContractAddress:t})},getPolicyCid:()=>{const t=n();return a.getPolicyCid({publicClient:i,policyContractAddress:t})},getPolicyConfig:t=>{const o=n();return a.getPolicyConfig({publicClient:i,policyContractAddress:o,...t})},getPolicyData:()=>{const t=n();return a.getPolicyData({publicClient:i,policyContractAddress:t})},getPolicyId:t=>{const o=n();return a.getPolicyId({publicClient:i,policyContractAddress:o,...t})},getSchemaCid:()=>{const t=n();return a.getSchemaCid({publicClient:i,policyContractAddress:t})},isPolicyVerified:()=>{const t=n();return a.isPolicyVerified({publicClient:i,policyContractAddress:t})},metadataCid:()=>{const t=n();return a.metadataCid({publicClient:i,policyContractAddress:t})},owner:()=>{const t=n();return a.owner({publicClient:i,policyContractAddress:t})},policyCid:()=>{const t=n();return a.policyCid({publicClient:i,policyContractAddress:t})},policyData:t=>{const o=n();return a.policyData({publicClient:i,policyContractAddress:o,...t})},schemaCid:()=>{const t=n();return a.schemaCid({publicClient:i,policyContractAddress:t})},supportsInterface:t=>{const o=n();return a.supportsInterface({publicClient:i,policyContractAddress:o,...t})},precomputePolicyId:t=>{const o=n();return a.precomputePolicyId({publicClient:i,policyContractAddress:o,...t})}}};export{f as createSecureEnvelope,b as generateSigningKeyPair,E as getPrivacyPublicKey,q as newtonPublicClientActions,M as newtonWalletClientActions,w as signPrivacyAuthorization,P as storeEncryptedSecrets,D as uploadEncryptedData,I as uploadSecureEnvelope};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
var
|
|
1
|
+
var n;(function(e){e.MissingApiKey="MISSING_API_KEY",e.PopupAlreadyExists="POPUP_ALREADY_EXISTS",e.MalformedResponse="MALFORMED_RESPONSE",e.InvalidArgument="INVALID_ARGUMENT",e.ExtensionNotInitialized="EXTENSION_NOT_INITIALIZED",e.IncompatibleExtensions="INCOMPATIBLE_EXTENSIONS",e.FailedToOpenPopup="FAILED_TO_OPEN_POPUP",e.FailedToRetrieveNativeTokenBalance="FAILED_TO_RETRIEVE_NATIVE_TOKEN_BALANCE"})(n||(n={}));var o;(function(e){e.SyncWeb3Method="SYNC_WEB3_METHOD",e.ReactNativeEndpointConfiguration="REACT_NATIVE_ENDPOINT_CONFIGURATION",e.DeprecationNotice="DEPRECATION_NOTICE",e.ProductAnnouncement="ANNOUNCEMENT"})(o||(o={}));var r;(function(e){e[e.ParseError=-32700]="ParseError",e[e.InvalidRequest=-32600]="InvalidRequest",e[e.MethodNotFound=-32601]="MethodNotFound",e[e.InvalidParams=-32602]="InvalidParams",e[e.InternalError=-32603]="InternalError",e[e.MagicLinkRateLimited=-10002]="MagicLinkRateLimited",e[e.UserAlreadyLoggedIn=-10003]="UserAlreadyLoggedIn",e[e.AccessDeniedToUser=-10011]="AccessDeniedToUser",e[e.UserRejectedAction=-10012]="UserRejectedAction",e[e.RequestCancelled=-10014]="RequestCancelled",e[e.RedirectLoginComplete=-10015]="RedirectLoginComplete",e[e.NewtonWalletSessionTerminated=-10016]="NewtonWalletSessionTerminated",e[e.PopupRequestOverriden=-10017]="PopupRequestOverriden"})(r||(r={}));export{r as RPCErrorCode,n as SDKErrorCode,o as SDKWarningCode};
|
package/dist/types/const.d.mts
CHANGED
|
@@ -10,7 +10,6 @@ export declare const GATEWAY_METHODS: {
|
|
|
10
10
|
getPrivacyPublicKey: string;
|
|
11
11
|
uploadEncryptedData: string;
|
|
12
12
|
storeEncryptedSecrets: string;
|
|
13
|
-
sendIdentityEncrypted: string;
|
|
14
13
|
};
|
|
15
14
|
export declare const NEWTON_PROVER_TASK_MANAGER: Record<number, Hex>;
|
|
16
15
|
export declare const ATTESTATION_VALIDATOR: Record<number, Hex>;
|
package/dist/types/const.d.ts
CHANGED
|
@@ -10,7 +10,6 @@ export declare const GATEWAY_METHODS: {
|
|
|
10
10
|
getPrivacyPublicKey: string;
|
|
11
11
|
uploadEncryptedData: string;
|
|
12
12
|
storeEncryptedSecrets: string;
|
|
13
|
-
sendIdentityEncrypted: string;
|
|
14
13
|
};
|
|
15
14
|
export declare const NEWTON_PROVER_TASK_MANAGER: Record<number, Hex>;
|
|
16
15
|
export declare const ATTESTATION_VALIDATOR: Record<number, Hex>;
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Address, Hex, PublicClient, WalletClient } from 'viem';
|
|
2
2
|
import { type PendingTaskBuilder } from './modules/avs/index.d.mts';
|
|
3
|
-
import { identityDomainHash, sendIdentityEncrypted } from './modules/identity/index.d.mts';
|
|
4
3
|
import { createSecureEnvelope, generateSigningKeyPair, getPrivacyPublicKey, signPrivacyAuthorization, storeEncryptedSecrets, uploadEncryptedData, uploadSecureEnvelope } from './modules/privacy/index.d.mts';
|
|
5
|
-
import type { SendIdentityEncryptedParams, SendIdentityEncryptedResponse } from './types/identity.d.mts';
|
|
6
4
|
import type { PolicyParamsJson } from './types/policy.d.mts';
|
|
7
5
|
import type { CreateSecureEnvelopeParams, Ed25519KeyPair, PrivacyAuthorizationResult, PrivacyPublicKeyResponse, SecureEnvelopeResult, SignPrivacyAuthorizationParams, StoreEncryptedSecretsParams, StoreEncryptedSecretsResponse, UploadEncryptedDataParams, UploadEncryptedDataResponse, UploadSecureEnvelopeParams } from './types/privacy.d.mts';
|
|
8
6
|
import type { SimulatePolicyDataParams, SimulatePolicyDataResult, SimulatePolicyDataWithClientParams, SimulatePolicyDataWithClientResult, SimulatePolicyParams, SimulatePolicyResult, SimulateTaskParams, SimulateTaskResult, SubmitEvaluationRequestParams, SubmitIntentResult, Task, TaskId, TaskResponseResult, TaskStatus } from './types/task.d.mts';
|
|
@@ -78,7 +76,6 @@ declare const newtonWalletClientActions: (config: {
|
|
|
78
76
|
generateSigningKeyPair: () => Ed25519KeyPair;
|
|
79
77
|
storeEncryptedSecrets: (args: StoreEncryptedSecretsParams) => Promise<StoreEncryptedSecretsResponse>;
|
|
80
78
|
signPrivacyAuthorization: (args: SignPrivacyAuthorizationParams) => PrivacyAuthorizationResult;
|
|
81
|
-
sendIdentityEncrypted: (args: SendIdentityEncryptedParams) => Promise<SendIdentityEncryptedResponse>;
|
|
82
79
|
};
|
|
83
80
|
declare const newtonPublicClientActions: (options?: {
|
|
84
81
|
policyContractAddress?: Address;
|
|
@@ -138,5 +135,4 @@ declare const newtonPublicClientActions: (options?: {
|
|
|
138
135
|
}) => string;
|
|
139
136
|
};
|
|
140
137
|
export { newtonPublicClientActions, newtonWalletClientActions };
|
|
141
|
-
export { identityDomainHash, sendIdentityEncrypted };
|
|
142
138
|
export { createSecureEnvelope, generateSigningKeyPair, getPrivacyPublicKey, signPrivacyAuthorization, storeEncryptedSecrets, uploadEncryptedData, uploadSecureEnvelope, };
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import type { Address, Hex, PublicClient, WalletClient } from 'viem';
|
|
2
2
|
import { type PendingTaskBuilder } from './modules/avs';
|
|
3
|
-
import { identityDomainHash, sendIdentityEncrypted } from './modules/identity';
|
|
4
3
|
import { createSecureEnvelope, generateSigningKeyPair, getPrivacyPublicKey, signPrivacyAuthorization, storeEncryptedSecrets, uploadEncryptedData, uploadSecureEnvelope } from './modules/privacy';
|
|
5
|
-
import type { SendIdentityEncryptedParams, SendIdentityEncryptedResponse } from './types/identity';
|
|
6
4
|
import type { PolicyParamsJson } from './types/policy';
|
|
7
5
|
import type { CreateSecureEnvelopeParams, Ed25519KeyPair, PrivacyAuthorizationResult, PrivacyPublicKeyResponse, SecureEnvelopeResult, SignPrivacyAuthorizationParams, StoreEncryptedSecretsParams, StoreEncryptedSecretsResponse, UploadEncryptedDataParams, UploadEncryptedDataResponse, UploadSecureEnvelopeParams } from './types/privacy';
|
|
8
6
|
import type { SimulatePolicyDataParams, SimulatePolicyDataResult, SimulatePolicyDataWithClientParams, SimulatePolicyDataWithClientResult, SimulatePolicyParams, SimulatePolicyResult, SimulateTaskParams, SimulateTaskResult, SubmitEvaluationRequestParams, SubmitIntentResult, Task, TaskId, TaskResponseResult, TaskStatus } from './types/task';
|
|
@@ -78,7 +76,6 @@ declare const newtonWalletClientActions: (config: {
|
|
|
78
76
|
generateSigningKeyPair: () => Ed25519KeyPair;
|
|
79
77
|
storeEncryptedSecrets: (args: StoreEncryptedSecretsParams) => Promise<StoreEncryptedSecretsResponse>;
|
|
80
78
|
signPrivacyAuthorization: (args: SignPrivacyAuthorizationParams) => PrivacyAuthorizationResult;
|
|
81
|
-
sendIdentityEncrypted: (args: SendIdentityEncryptedParams) => Promise<SendIdentityEncryptedResponse>;
|
|
82
79
|
};
|
|
83
80
|
declare const newtonPublicClientActions: (options?: {
|
|
84
81
|
policyContractAddress?: Address;
|
|
@@ -138,5 +135,4 @@ declare const newtonPublicClientActions: (options?: {
|
|
|
138
135
|
}) => string;
|
|
139
136
|
};
|
|
140
137
|
export { newtonPublicClientActions, newtonWalletClientActions };
|
|
141
|
-
export { identityDomainHash, sendIdentityEncrypted };
|
|
142
138
|
export { createSecureEnvelope, generateSigningKeyPair, getPrivacyPublicKey, signPrivacyAuthorization, storeEncryptedSecrets, uploadEncryptedData, uploadSecureEnvelope, };
|
|
@@ -6,11 +6,7 @@ export declare enum SDKErrorCode {
|
|
|
6
6
|
ExtensionNotInitialized = "EXTENSION_NOT_INITIALIZED",
|
|
7
7
|
IncompatibleExtensions = "INCOMPATIBLE_EXTENSIONS",
|
|
8
8
|
FailedToOpenPopup = "FAILED_TO_OPEN_POPUP",
|
|
9
|
-
FailedToRetrieveNativeTokenBalance = "FAILED_TO_RETRIEVE_NATIVE_TOKEN_BALANCE"
|
|
10
|
-
MissingChain = "MISSING_CHAIN",
|
|
11
|
-
MissingAccount = "MISSING_ACCOUNT",
|
|
12
|
-
InvalidAddress = "INVALID_ADDRESS",
|
|
13
|
-
IdentityOwnerMismatch = "IDENTITY_OWNER_MISMATCH"
|
|
9
|
+
FailedToRetrieveNativeTokenBalance = "FAILED_TO_RETRIEVE_NATIVE_TOKEN_BALANCE"
|
|
14
10
|
}
|
|
15
11
|
export declare enum SDKWarningCode {
|
|
16
12
|
SyncWeb3Method = "SYNC_WEB3_METHOD",
|
|
@@ -6,11 +6,7 @@ export declare enum SDKErrorCode {
|
|
|
6
6
|
ExtensionNotInitialized = "EXTENSION_NOT_INITIALIZED",
|
|
7
7
|
IncompatibleExtensions = "INCOMPATIBLE_EXTENSIONS",
|
|
8
8
|
FailedToOpenPopup = "FAILED_TO_OPEN_POPUP",
|
|
9
|
-
FailedToRetrieveNativeTokenBalance = "FAILED_TO_RETRIEVE_NATIVE_TOKEN_BALANCE"
|
|
10
|
-
MissingChain = "MISSING_CHAIN",
|
|
11
|
-
MissingAccount = "MISSING_ACCOUNT",
|
|
12
|
-
InvalidAddress = "INVALID_ADDRESS",
|
|
13
|
-
IdentityOwnerMismatch = "IDENTITY_OWNER_MISMATCH"
|
|
9
|
+
FailedToRetrieveNativeTokenBalance = "FAILED_TO_RETRIEVE_NATIVE_TOKEN_BALANCE"
|
|
14
10
|
}
|
|
15
11
|
export declare enum SDKWarningCode {
|
|
16
12
|
SyncWeb3Method = "SYNC_WEB3_METHOD",
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem';
|
|
2
1
|
type DateString = `${number}${number}${number}${number}-${number}${number}-${number}${number}`;
|
|
3
2
|
export interface KycUserData {
|
|
4
3
|
status: string;
|
|
@@ -10,31 +9,4 @@ export interface KycUserData {
|
|
|
10
9
|
issue_date: DateString;
|
|
11
10
|
issuing_authority: string;
|
|
12
11
|
}
|
|
13
|
-
/** Well-known identity domain name strings. */
|
|
14
|
-
export type IdentityDomainName = 'kyc';
|
|
15
|
-
/** Parameters for sending encrypted identity data to the gateway. */
|
|
16
|
-
export interface SendIdentityEncryptedParams {
|
|
17
|
-
/** The identity owner's EVM address (must match the wallet signer) */
|
|
18
|
-
identityOwner: Address;
|
|
19
|
-
/** The encrypted identity data blob (opaque string — encrypted by the caller) */
|
|
20
|
-
identityData: string;
|
|
21
|
-
/** Identity domain name (e.g., "kyc"). Hashed to bytes32 via keccak256. */
|
|
22
|
-
identityDomain: IdentityDomainName | string;
|
|
23
|
-
/** IdentityRegistry contract address for the EIP-712 domain */
|
|
24
|
-
identityRegistryAddress: Address;
|
|
25
|
-
}
|
|
26
|
-
/** Response from newt_sendIdentityEncrypted. */
|
|
27
|
-
export interface SendIdentityEncryptedResponse {
|
|
28
|
-
/** Transaction hash where the identity data was included on-chain */
|
|
29
|
-
inclusion_tx: string;
|
|
30
|
-
}
|
|
31
|
-
/** RPC request body for newt_sendIdentityEncrypted (snake_case, matches gateway). */
|
|
32
|
-
export interface SendIdentityEncryptedRpcRequest {
|
|
33
|
-
identity_owner: Address;
|
|
34
|
-
identity_owner_sig: Hex;
|
|
35
|
-
identity_data: {
|
|
36
|
-
data: string;
|
|
37
|
-
};
|
|
38
|
-
identity_domain: Hex;
|
|
39
|
-
}
|
|
40
12
|
export {};
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import type { Address, Hex } from 'viem';
|
|
2
1
|
type DateString = `${number}${number}${number}${number}-${number}${number}-${number}${number}`;
|
|
3
2
|
export interface KycUserData {
|
|
4
3
|
status: string;
|
|
@@ -10,31 +9,4 @@ export interface KycUserData {
|
|
|
10
9
|
issue_date: DateString;
|
|
11
10
|
issuing_authority: string;
|
|
12
11
|
}
|
|
13
|
-
/** Well-known identity domain name strings. */
|
|
14
|
-
export type IdentityDomainName = 'kyc';
|
|
15
|
-
/** Parameters for sending encrypted identity data to the gateway. */
|
|
16
|
-
export interface SendIdentityEncryptedParams {
|
|
17
|
-
/** The identity owner's EVM address (must match the wallet signer) */
|
|
18
|
-
identityOwner: Address;
|
|
19
|
-
/** The encrypted identity data blob (opaque string — encrypted by the caller) */
|
|
20
|
-
identityData: string;
|
|
21
|
-
/** Identity domain name (e.g., "kyc"). Hashed to bytes32 via keccak256. */
|
|
22
|
-
identityDomain: IdentityDomainName | string;
|
|
23
|
-
/** IdentityRegistry contract address for the EIP-712 domain */
|
|
24
|
-
identityRegistryAddress: Address;
|
|
25
|
-
}
|
|
26
|
-
/** Response from newt_sendIdentityEncrypted. */
|
|
27
|
-
export interface SendIdentityEncryptedResponse {
|
|
28
|
-
/** Transaction hash where the identity data was included on-chain */
|
|
29
|
-
inclusion_tx: string;
|
|
30
|
-
}
|
|
31
|
-
/** RPC request body for newt_sendIdentityEncrypted (snake_case, matches gateway). */
|
|
32
|
-
export interface SendIdentityEncryptedRpcRequest {
|
|
33
|
-
identity_owner: Address;
|
|
34
|
-
identity_owner_sig: Hex;
|
|
35
|
-
identity_data: {
|
|
36
|
-
data: string;
|
|
37
|
-
};
|
|
38
|
-
identity_domain: Hex;
|
|
39
|
-
}
|
|
40
12
|
export {};
|
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";var g=require("../../const.js"),i=require("../../sdk-exceptions.js"),n=require("../../types/core/exception-types.js"),h=require("../../utils/https.js"),t=require("viem");function o(r){return t.keccak256(t.toBytes(r))}async function E(r,e,y,c){const s=r.chain?.id;if(!s)throw new i.SDKError(n.SDKErrorCode.MissingChain,"walletClient must have a chain configured");const d=r.account;if(!d)throw new i.SDKError(n.SDKErrorCode.MissingAccount,"walletClient must have an account configured");if(!t.isAddress(e.identityOwner))throw new i.SDKError(n.SDKErrorCode.InvalidAddress,`invalid identityOwner address: ${e.identityOwner}`);if(!t.isAddress(e.identityRegistryAddress))throw new i.SDKError(n.SDKErrorCode.InvalidAddress,`invalid identityRegistryAddress: ${e.identityRegistryAddress}`);if(t.getAddress(d.address)!==t.getAddress(e.identityOwner))throw new i.SDKError(n.SDKErrorCode.IdentityOwnerMismatch,`wallet account ${d.address} does not match identityOwner ${e.identityOwner}`);const w=await r.signTypedData({account:d,domain:{name:"IdentityRegistry",version:"1",chainId:BigInt(s),verifyingContract:e.identityRegistryAddress},types:{EncryptedIdentityData:[{name:"data",type:"string"}]},primaryType:"EncryptedIdentityData",message:{data:e.identityData}}),u=o(e.identityDomain),D={identity_owner:e.identityOwner,identity_owner_sig:w,identity_data:{data:e.identityData},identity_domain:u},a=await new h.AvsHttpService(s,c).Post(g.GATEWAY_METHODS.sendIdentityEncrypted,D,y);if(a.error)throw a.error;return a.result}exports.identityDomainHash=o,exports.sendIdentityEncrypted=E;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{GATEWAY_METHODS as h}from"../../const.mjs";import{SDKError as e}from"../../sdk-exceptions.mjs";import{SDKErrorCode as n}from"../../types/core/exception-types.mjs";import{AvsHttpService as p}from"../../utils/https.mjs";import{keccak256 as u,toBytes as l,isAddress as s,getAddress as o}from"viem";function y(i){return u(l(i))}async function A(i,t,c,w){const d=i.chain?.id;if(!d)throw new e(n.MissingChain,"walletClient must have a chain configured");const r=i.account;if(!r)throw new e(n.MissingAccount,"walletClient must have an account configured");if(!s(t.identityOwner))throw new e(n.InvalidAddress,`invalid identityOwner address: ${t.identityOwner}`);if(!s(t.identityRegistryAddress))throw new e(n.InvalidAddress,`invalid identityRegistryAddress: ${t.identityRegistryAddress}`);if(o(r.address)!==o(t.identityOwner))throw new e(n.IdentityOwnerMismatch,`wallet account ${r.address} does not match identityOwner ${t.identityOwner}`);const m=await i.signTypedData({account:r,domain:{name:"IdentityRegistry",version:"1",chainId:BigInt(d),verifyingContract:t.identityRegistryAddress},types:{EncryptedIdentityData:[{name:"data",type:"string"}]},primaryType:"EncryptedIdentityData",message:{data:t.identityData}}),g=y(t.identityDomain),f={identity_owner:t.identityOwner,identity_owner_sig:m,identity_data:{data:t.identityData},identity_domain:g},a=await new p(d,w).Post(h.sendIdentityEncrypted,f,c);if(a.error)throw a.error;return a.result}export{y as identityDomainHash,A as sendIdentityEncrypted};
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Newton Identity Module — EIP-712 signed identity data submission to the on-chain IdentityRegistry.
|
|
3
|
-
*
|
|
4
|
-
* The gateway's `newt_sendIdentityEncrypted` RPC method accepts an EIP-712 signature over
|
|
5
|
-
* `EncryptedIdentityData { string data }` with domain `{name: "IdentityRegistry", version: "1"}`.
|
|
6
|
-
* The `identity_domain` field (bytes32 = keccak256 of the domain name) tells the gateway
|
|
7
|
-
* how to interpret the blob after decryption.
|
|
8
|
-
*/
|
|
9
|
-
import type { SendIdentityEncryptedParams, SendIdentityEncryptedResponse } from '@core/types/identity';
|
|
10
|
-
import { type Hex, type WalletClient } from 'viem';
|
|
11
|
-
/**
|
|
12
|
-
* Compute the bytes32 identity domain hash from a human-readable domain name.
|
|
13
|
-
*
|
|
14
|
-
* Matches the Rust convention: `keccak256(toBytes("kyc"))` producing a bytes32 hash.
|
|
15
|
-
*/
|
|
16
|
-
export declare function identityDomainHash(domainName: string): Hex;
|
|
17
|
-
/**
|
|
18
|
-
* Sign encrypted identity data with EIP-712 and submit to the gateway.
|
|
19
|
-
*
|
|
20
|
-
* The wallet client signs `EncryptedIdentityData { string data }` using the
|
|
21
|
-
* EIP-712 domain `{name: "IdentityRegistry", version: "1", chainId, verifyingContract}`.
|
|
22
|
-
* The gateway validates the signature, then submits the data to the on-chain IdentityRegistry.
|
|
23
|
-
*
|
|
24
|
-
* @param walletClient - viem WalletClient with a connected account
|
|
25
|
-
* @param params - Identity data and domain parameters
|
|
26
|
-
* @param apiKey - Newton API key for gateway authentication
|
|
27
|
-
* @param gatewayApiUrlOverride - Optional gateway URL override
|
|
28
|
-
* @returns Transaction hash of the on-chain inclusion
|
|
29
|
-
*/
|
|
30
|
-
export declare function sendIdentityEncrypted(walletClient: WalletClient, params: SendIdentityEncryptedParams, apiKey: string, gatewayApiUrlOverride?: string): Promise<SendIdentityEncryptedResponse>;
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Newton Identity Module — EIP-712 signed identity data submission to the on-chain IdentityRegistry.
|
|
3
|
-
*
|
|
4
|
-
* The gateway's `newt_sendIdentityEncrypted` RPC method accepts an EIP-712 signature over
|
|
5
|
-
* `EncryptedIdentityData { string data }` with domain `{name: "IdentityRegistry", version: "1"}`.
|
|
6
|
-
* The `identity_domain` field (bytes32 = keccak256 of the domain name) tells the gateway
|
|
7
|
-
* how to interpret the blob after decryption.
|
|
8
|
-
*/
|
|
9
|
-
import type { SendIdentityEncryptedParams, SendIdentityEncryptedResponse } from '../../types/identity';
|
|
10
|
-
import { type Hex, type WalletClient } from 'viem';
|
|
11
|
-
/**
|
|
12
|
-
* Compute the bytes32 identity domain hash from a human-readable domain name.
|
|
13
|
-
*
|
|
14
|
-
* Matches the Rust convention: `keccak256(toBytes("kyc"))` producing a bytes32 hash.
|
|
15
|
-
*/
|
|
16
|
-
export declare function identityDomainHash(domainName: string): Hex;
|
|
17
|
-
/**
|
|
18
|
-
* Sign encrypted identity data with EIP-712 and submit to the gateway.
|
|
19
|
-
*
|
|
20
|
-
* The wallet client signs `EncryptedIdentityData { string data }` using the
|
|
21
|
-
* EIP-712 domain `{name: "IdentityRegistry", version: "1", chainId, verifyingContract}`.
|
|
22
|
-
* The gateway validates the signature, then submits the data to the on-chain IdentityRegistry.
|
|
23
|
-
*
|
|
24
|
-
* @param walletClient - viem WalletClient with a connected account
|
|
25
|
-
* @param params - Identity data and domain parameters
|
|
26
|
-
* @param apiKey - Newton API key for gateway authentication
|
|
27
|
-
* @param gatewayApiUrlOverride - Optional gateway URL override
|
|
28
|
-
* @returns Transaction hash of the on-chain inclusion
|
|
29
|
-
*/
|
|
30
|
-
export declare function sendIdentityEncrypted(walletClient: WalletClient, params: SendIdentityEncryptedParams, apiKey: string, gatewayApiUrlOverride?: string): Promise<SendIdentityEncryptedResponse>;
|