@campnetwork/origin 1.4.0-alpha.2 → 1.4.0-alpha.3
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/core.cjs +2 -2
- package/dist/core.esm.js +2 -2
- package/dist/react/index.esm.js +4 -4
- package/package.json +1 -1
package/dist/core.cjs
CHANGED
|
@@ -838,9 +838,9 @@ o,this.appId)}catch(e){throw new Error(`Failed to register Social IpNFT: ${e ins
|
|
|
838
838
|
* @param {CallOptions} [options] The call options.
|
|
839
839
|
* @returns {Promise<any>} A promise that resolves with the result of the contract call or transaction hash.
|
|
840
840
|
* @throws {Error} - Throws an error if the wallet client is not connected and the method is not a view function.
|
|
841
|
-
*/callContractMethod(t,n,i,r){return a(this,arguments,void 0,(function*(t,n,i,a,r={}){var o;let
|
|
841
|
+
*/callContractMethod(t,n,i,r){return a(this,arguments,void 0,(function*(t,n,i,a,r={}){var o,p;let d=null;try{d=yield s(this,Le,"m",Ke).call(this)}catch(e){throw new v(`Cannot call "${i}" on contract ${t}: wallet not connected`)}const u=e.getAbiItem({abi:n,name:i});if(u&&"stateMutability"in u&&("view"===u.stateMutability||"pure"===u.stateMutability)){const e=C();return null!==(o=yield e.readContract({address:t,abi:n,functionName:i,args:a}))&&void 0!==o?o:null}yield s(this,Le,"m",Ge).call(this,this.environment.CHAIN);const l=C(),{result:y,request:c}=yield l.simulateContract({account:d,address:t,abi:n,functionName:i,args:a,value:r.value});
|
|
842
842
|
// simulate
|
|
843
|
-
if(r.simulate)return
|
|
843
|
+
if(r.simulate)return y;try{const e=yield null===(p=this.viemClient)||void 0===p?void 0:p.writeContract(c);if("string"!=typeof e)throw new w(`Transaction for "${i}" failed to send: no transaction hash returned`,{contractName:t,methodName:i});if(!r.waitForReceipt)return{txHash:e,simulatedResult:y};return{txHash:e,receipt:yield s(this,Le,"m",We).call(this,e),simulatedResult:y}}catch(e){if(e instanceof w||e instanceof v)throw e;throw new w(`Transaction for "${i}" failed: ${A(e)}`,{contractName:t,methodName:i})}}))}
|
|
844
844
|
/**
|
|
845
845
|
* Gets comprehensive token information in a single call.
|
|
846
846
|
* Combines owner, status, terms, URI, and access information.
|
package/dist/core.esm.js
CHANGED
|
@@ -828,9 +828,9 @@ r,this.appId)}catch(e){throw new Error(`Failed to register Social IpNFT: ${e ins
|
|
|
828
828
|
* @param {CallOptions} [options] The call options.
|
|
829
829
|
* @returns {Promise<any>} A promise that resolves with the result of the contract call or transaction hash.
|
|
830
830
|
* @throws {Error} - Throws an error if the wallet client is not connected and the method is not a view function.
|
|
831
|
-
*/callContractMethod(e,t,n,i){return m(this,arguments,void 0,(function*(e,t,n,i,a={}){var s;let
|
|
831
|
+
*/callContractMethod(e,t,n,i){return m(this,arguments,void 0,(function*(e,t,n,i,a={}){var s,r;let p=null;try{p=yield h(this,nt,"m",dt).call(this)}catch(t){throw new R(`Cannot call "${n}" on contract ${e}: wallet not connected`)}const d=o({abi:t,name:n});if(d&&"stateMutability"in d&&("view"===d.stateMutability||"pure"===d.stateMutability)){const a=B();return null!==(s=yield a.readContract({address:e,abi:t,functionName:n,args:i}))&&void 0!==s?s:null}yield h(this,nt,"m",pt).call(this,this.environment.CHAIN);const u=B(),{result:l,request:y}=yield u.simulateContract({account:p,address:e,abi:t,functionName:n,args:i,value:a.value});
|
|
832
832
|
// simulate
|
|
833
|
-
if(a.simulate)return
|
|
833
|
+
if(a.simulate)return l;try{const t=yield null===(r=this.viemClient)||void 0===r?void 0:r.writeContract(y);if("string"!=typeof t)throw new x(`Transaction for "${n}" failed to send: no transaction hash returned`,{contractName:e,methodName:n});if(!a.waitForReceipt)return{txHash:t,simulatedResult:l};return{txHash:t,receipt:yield h(this,nt,"m",ot).call(this,t),simulatedResult:l}}catch(t){if(t instanceof x||t instanceof R)throw t;throw new x(`Transaction for "${n}" failed: ${k(t)}`,{contractName:e,methodName:n})}}))}
|
|
834
834
|
/**
|
|
835
835
|
* Gets comprehensive token information in a single call.
|
|
836
836
|
* Combines owner, status, terms, URI, and access information.
|
package/dist/react/index.esm.js
CHANGED
|
@@ -8874,7 +8874,7 @@ class Origin {
|
|
|
8874
8874
|
*/
|
|
8875
8875
|
callContractMethod(contractAddress_1, abi_1, methodName_1, params_1) {
|
|
8876
8876
|
return __awaiter(this, arguments, void 0, function* (contractAddress, abi, methodName, params, options = {}) {
|
|
8877
|
-
var _a;
|
|
8877
|
+
var _a, _b;
|
|
8878
8878
|
let account = null;
|
|
8879
8879
|
try {
|
|
8880
8880
|
account = yield __classPrivateFieldGet(this, _Origin_instances, "m", _Origin_getCurrentAccount).call(this);
|
|
@@ -8889,12 +8889,12 @@ class Origin {
|
|
|
8889
8889
|
abiItem.stateMutability === "pure");
|
|
8890
8890
|
if (isView) {
|
|
8891
8891
|
const publicClient = getPublicClient();
|
|
8892
|
-
const result = (yield publicClient.readContract({
|
|
8892
|
+
const result = (_a = (yield publicClient.readContract({
|
|
8893
8893
|
address: contractAddress,
|
|
8894
8894
|
abi,
|
|
8895
8895
|
functionName: methodName,
|
|
8896
8896
|
args: params,
|
|
8897
|
-
}))
|
|
8897
|
+
}))) !== null && _a !== void 0 ? _a : null;
|
|
8898
8898
|
return result;
|
|
8899
8899
|
}
|
|
8900
8900
|
yield __classPrivateFieldGet(this, _Origin_instances, "m", _Origin_ensureChainId).call(this, this.environment.CHAIN);
|
|
@@ -8912,7 +8912,7 @@ class Origin {
|
|
|
8912
8912
|
return simulatedResult;
|
|
8913
8913
|
}
|
|
8914
8914
|
try {
|
|
8915
|
-
const txHash = yield ((
|
|
8915
|
+
const txHash = yield ((_b = this.viemClient) === null || _b === void 0 ? void 0 : _b.writeContract(request));
|
|
8916
8916
|
if (typeof txHash !== "string") {
|
|
8917
8917
|
throw new ContractError(`Transaction for "${methodName}" failed to send: no transaction hash returned`, { contractName: contractAddress, methodName });
|
|
8918
8918
|
}
|