@magicnewton/newton-protocol-sdk 0.2.11--canary.93.20312354859.0 → 0.2.11
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/cjs/const.js +1 -1
- package/dist/cjs/index.js +1 -1
- package/dist/es/const.js +1 -1
- package/dist/es/index.js +1 -1
- package/dist/types/const.d.ts +2 -2
- package/package.json +1 -1
package/dist/cjs/const.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const A="https://prover-avs.sepolia.newt.foundation/",T="https://prover-avs.newt.foundation/",_={createTaskAndWait:"newton_createTaskAndWait"},E="
|
|
1
|
+
"use strict";const A="https://prover-avs.sepolia.newt.foundation/",T="https://prover-avs.newt.foundation/",_={createTaskAndWait:"newton_createTaskAndWait"},E="0x8cabf24f2ad134e0c25d7dd96cf901e7c430aa57",N="0xe54f46353b7210d7c3cf092034c1dc76fcba0a83",a="0x2010dbaa5438801bdc3f08174a799fe344f544ee",I="0x263c275c15867a4611a44c600e77144a23012a06";exports.AVS_METHODS=_,exports.MAINNET_ATTESTATION_VALIDATOR=I,exports.MAINNET_AVS_API=T,exports.MAINNET_NEWTON_PROVER_TASK_MANAGER=a,exports.SEPOLIA_ATTESTATION_VALIDATOR=N,exports.SEPOLIA_NEWTON_PROVER_TASK_MANAGER=E,exports.TESTNET_AVS_API=A;
|
package/dist/cjs/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";var a=require("./modules/avs/index.js"),i=require("./modules/policy/index.js"),
|
|
1
|
+
"use strict";var a=require("viem/chains"),d=require("./modules/avs/index.js"),i=require("./modules/policy/index.js"),s=require("./const.js");const C=(p,r)=>e=>{const{developerPk:l,policyContractAddress:n}=p,c=()=>{if(n)return n;throw new Error('Newton SDK: policyContractAddress is required. Ensure you instantiate viem client actions extension with policyContractAddress parameter. Example: newtonWalletClientActions({ policyContractAddress: "0x123..." })')};if(e?.chain?.id!==a.mainnet.id&&e?.chain?.id!==a.sepolia.id)throw new Error("Newton SDK: Invalid network specified for newtonWalletClientActions. Only mainnet and sepolia are supported");const u=r?.taskManagerAddress??(e?.chain?.testnet?s.SEPOLIA_NEWTON_PROVER_TASK_MANAGER:s.MAINNET_NEWTON_PROVER_TASK_MANAGER),t=r?.proverApiUrl??void 0;return{submitEvaluationRequest:o=>d.submitEvaluationRequest(e,o,u,l,t),initialize:o=>{const y=c();return i.policyWriteFunctions.initialize({walletClient:e,policyContractAddress:y,...o})},renounceOwnership:()=>{const o=c();return i.policyWriteFunctions.renounceOwnership({walletClient:e,policyContractAddress:o})},transferOwnership:o=>{const y=c();return i.policyWriteFunctions.transferOwnership({walletClient:e,policyContractAddress:y,...o})}}},A=(p,r)=>e=>{if(e?.chain?.id!==a.mainnet.id&&e?.chain?.id!==a.sepolia.id)throw new Error("Newton SDK: Invalid network specified for newtonPublicActions. Only mainnet and sepolia are supported");const l=p?.policyContractAddress,n=()=>{if(!l)throw new Error('Newton SDK: policyContractAddress is required. Ensure you instantiate viem client actions extension with policyContractAddress parameter. Example: newtonPublicClientActions({ policyContractAddress: "0x123..." })');return l},c=r?.taskManagerAddress??(e?.chain?.testnet?s.SEPOLIA_NEWTON_PROVER_TASK_MANAGER:s.MAINNET_NEWTON_PROVER_TASK_MANAGER),u=r?.attestationValidatorAddress??(e?.chain?.testnet?s.SEPOLIA_ATTESTATION_VALIDATOR:s.MAINNET_ATTESTATION_VALIDATOR);return{waitForTaskResponded:t=>d.waitForTaskResponded(e,t,c),getTaskResponseHash:t=>d.getTaskResponseHash(e,t,c),getTaskStatus:t=>d.getTaskStatus(e,t,c,u),clientToPolicyId:t=>{const o=n();return i.policyReadFunctions.clientToPolicyId({publicClient:e,policyContractAddress:o,...t})},entrypoint:()=>{const t=n();return i.policyReadFunctions.entrypoint({publicClient:e,policyContractAddress:t})},factory:()=>{const t=n();return i.policyReadFunctions.factory({publicClient:e,policyContractAddress:t})},getEntrypoint:()=>{const t=n();return i.policyReadFunctions.getEntrypoint({publicClient:e,policyContractAddress:t})},getMetadataCid:()=>{const t=n();return i.policyReadFunctions.getMetadataCid({publicClient:e,policyContractAddress:t})},getPolicyCid:()=>{const t=n();return i.policyReadFunctions.getPolicyCid({publicClient:e,policyContractAddress:t})},getPolicyConfig:t=>{const o=n();return i.policyReadFunctions.getPolicyConfig({publicClient:e,policyContractAddress:o,...t})},getPolicyData:()=>{const t=n();return i.policyReadFunctions.getPolicyData({publicClient:e,policyContractAddress:t})},getPolicyId:t=>{const o=n();return i.policyReadFunctions.getPolicyId({publicClient:e,policyContractAddress:o,...t})},getSchemaCid:()=>{const t=n();return i.policyReadFunctions.getSchemaCid({publicClient:e,policyContractAddress:t})},isPolicyVerified:()=>{const t=n();return i.policyReadFunctions.isPolicyVerified({publicClient:e,policyContractAddress:t})},metadataCid:()=>{const t=n();return i.policyReadFunctions.metadataCid({publicClient:e,policyContractAddress:t})},owner:()=>{const t=n();return i.policyReadFunctions.owner({publicClient:e,policyContractAddress:t})},policyCid:()=>{const t=n();return i.policyReadFunctions.policyCid({publicClient:e,policyContractAddress:t})},policyData:t=>{const o=n();return i.policyReadFunctions.policyData({publicClient:e,policyContractAddress:o,...t})},schemaCid:()=>{const t=n();return i.policyReadFunctions.schemaCid({publicClient:e,policyContractAddress:t})},supportsInterface:t=>{const o=n();return i.policyReadFunctions.supportsInterface({publicClient:e,policyContractAddress:o,...t})},precomputePolicyId:t=>{const o=n();return i.policyReadFunctions.precomputePolicyId({publicClient:e,policyContractAddress:o,...t})}}};exports.newtonPublicClientActions=A,exports.newtonWalletClientActions=C;
|
package/dist/es/const.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const
|
|
1
|
+
const A="https://prover-avs.sepolia.newt.foundation/",a="https://prover-avs.newt.foundation/",T={createTaskAndWait:"newton_createTaskAndWait"},e="0x8cabf24f2ad134e0c25d7dd96cf901e7c430aa57",_="0xe54f46353b7210d7c3cf092034c1dc76fcba0a83",c="0x2010dbaa5438801bdc3f08174a799fe344f544ee",E="0x263c275c15867a4611a44c600e77144a23012a06";export{T as AVS_METHODS,E as MAINNET_ATTESTATION_VALIDATOR,a as MAINNET_AVS_API,c as MAINNET_NEWTON_PROVER_TASK_MANAGER,_ as SEPOLIA_ATTESTATION_VALIDATOR,e as SEPOLIA_NEWTON_PROVER_TASK_MANAGER,A as TESTNET_AVS_API};
|
package/dist/es/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{getTaskStatus as
|
|
1
|
+
import{mainnet as u,sepolia as C}from"viem/chains";import{getTaskStatus as w,getTaskResponseHash as m,waitForTaskResponded as h,submitEvaluationRequest as E}from"./modules/avs/index.js";import{policyReadFunctions as o,policyWriteFunctions as p}from"./modules/policy/index.js";import{SEPOLIA_NEWTON_PROVER_TASK_MANAGER as y,MAINNET_NEWTON_PROVER_TASK_MANAGER as A,SEPOLIA_ATTESTATION_VALIDATOR as T,MAINNET_ATTESTATION_VALIDATOR as b}from"./const.js";const f=(a,c)=>e=>{const{developerPk:r,policyContractAddress:n}=a,s=()=>{if(n)return n;throw new Error('Newton SDK: policyContractAddress is required. Ensure you instantiate viem client actions extension with policyContractAddress parameter. Example: newtonWalletClientActions({ policyContractAddress: "0x123..." })')};if(e?.chain?.id!==u.id&&e?.chain?.id!==C.id)throw new Error("Newton SDK: Invalid network specified for newtonWalletClientActions. Only mainnet and sepolia are supported");const l=c?.taskManagerAddress??(e?.chain?.testnet?y:A),t=c?.proverApiUrl??void 0;return{submitEvaluationRequest:i=>E(e,i,l,r,t),initialize:i=>{const d=s();return p.initialize({walletClient:e,policyContractAddress:d,...i})},renounceOwnership:()=>{const i=s();return p.renounceOwnership({walletClient:e,policyContractAddress:i})},transferOwnership:i=>{const d=s();return p.transferOwnership({walletClient:e,policyContractAddress:d,...i})}}},g=(a,c)=>e=>{if(e?.chain?.id!==u.id&&e?.chain?.id!==C.id)throw new Error("Newton SDK: Invalid network specified for newtonPublicActions. Only mainnet and sepolia 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},s=c?.taskManagerAddress??(e?.chain?.testnet?y:A),l=c?.attestationValidatorAddress??(e?.chain?.testnet?T:b);return{waitForTaskResponded:t=>h(e,t,s),getTaskResponseHash:t=>m(e,t,s),getTaskStatus:t=>w(e,t,s,l),clientToPolicyId:t=>{const i=n();return o.clientToPolicyId({publicClient:e,policyContractAddress:i,...t})},entrypoint:()=>{const t=n();return o.entrypoint({publicClient:e,policyContractAddress:t})},factory:()=>{const t=n();return o.factory({publicClient:e,policyContractAddress:t})},getEntrypoint:()=>{const t=n();return o.getEntrypoint({publicClient:e,policyContractAddress:t})},getMetadataCid:()=>{const t=n();return o.getMetadataCid({publicClient:e,policyContractAddress:t})},getPolicyCid:()=>{const t=n();return o.getPolicyCid({publicClient:e,policyContractAddress:t})},getPolicyConfig:t=>{const i=n();return o.getPolicyConfig({publicClient:e,policyContractAddress:i,...t})},getPolicyData:()=>{const t=n();return o.getPolicyData({publicClient:e,policyContractAddress:t})},getPolicyId:t=>{const i=n();return o.getPolicyId({publicClient:e,policyContractAddress:i,...t})},getSchemaCid:()=>{const t=n();return o.getSchemaCid({publicClient:e,policyContractAddress:t})},isPolicyVerified:()=>{const t=n();return o.isPolicyVerified({publicClient:e,policyContractAddress:t})},metadataCid:()=>{const t=n();return o.metadataCid({publicClient:e,policyContractAddress:t})},owner:()=>{const t=n();return o.owner({publicClient:e,policyContractAddress:t})},policyCid:()=>{const t=n();return o.policyCid({publicClient:e,policyContractAddress:t})},policyData:t=>{const i=n();return o.policyData({publicClient:e,policyContractAddress:i,...t})},schemaCid:()=>{const t=n();return o.schemaCid({publicClient:e,policyContractAddress:t})},supportsInterface:t=>{const i=n();return o.supportsInterface({publicClient:e,policyContractAddress:i,...t})},precomputePolicyId:t=>{const i=n();return o.precomputePolicyId({publicClient:e,policyContractAddress:i,...t})}}};export{g as newtonPublicClientActions,f as newtonWalletClientActions};
|
package/dist/types/const.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export declare const AVS_METHODS: {
|
|
|
5
5
|
waitForTaskId: string;
|
|
6
6
|
createTaskAndWait: string;
|
|
7
7
|
};
|
|
8
|
-
export declare const SEPOLIA_NEWTON_PROVER_TASK_MANAGER = "
|
|
9
|
-
export declare const SEPOLIA_ATTESTATION_VALIDATOR = "
|
|
8
|
+
export declare const SEPOLIA_NEWTON_PROVER_TASK_MANAGER = "0x8cabf24f2ad134e0c25d7dd96cf901e7c430aa57";
|
|
9
|
+
export declare const SEPOLIA_ATTESTATION_VALIDATOR = "0xe54f46353b7210d7c3cf092034c1dc76fcba0a83";
|
|
10
10
|
export declare const MAINNET_NEWTON_PROVER_TASK_MANAGER = "0x2010dbaa5438801bdc3f08174a799fe344f544ee";
|
|
11
11
|
export declare const MAINNET_ATTESTATION_VALIDATOR = "0x263c275c15867a4611a44c600e77144a23012a06";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@magicnewton/newton-protocol-sdk",
|
|
3
|
-
"version": "0.2.11
|
|
3
|
+
"version": "0.2.11",
|
|
4
4
|
"description": "Official SDK for the Newton Protocol.",
|
|
5
5
|
"author": "Newton Foundation <https://x.com/newtfoundation> (https://newton.foundation)",
|
|
6
6
|
"private": false,
|