@campnetwork/origin 1.0.0-alpha.10 → 1.0.0-alpha.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/core.cjs CHANGED
@@ -186,7 +186,7 @@ const i=[{inputs:[{name:"owner",type:"address"}],name:"balanceOf",outputs:[{name
186
186
  * @param {Address} [owner] - Optional wallet address to claim royalties for. If not provided, uses the connected wallet.
187
187
  * @returns {Promise<any>} A promise that resolves when the claim transaction is confirmed.
188
188
  * @throws {Error} Throws an error if no wallet is connected and no owner address is provided.
189
- */claimRoyalties(e,n){return a(this,void 0,void 0,(function*(){const i=yield r(this,q,"m",V).call(this,n),a=yield this.getOrCreateRoyaltyVault(i,!0);return this.callContractMethod(a,this.environment.ROYALTY_VAULT_ABI,"claimRoyalties",[null!=e?e:t.zeroAddress],{waitForReceipt:!0})}))}}q=new WeakSet,W=function(e){return a(this,void 0,void 0,(function*(){try{const t=yield fetch(`${this.environment.AUTH_HUB_BASE_API}/${this.environment.AUTH_ENDPOINT}/origin/upload-url`,{method:"POST",body:JSON.stringify({name:e.name,type:e.type}),headers:{Authorization:`Bearer ${this.jwt}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);const n=yield t.json();if(n.isError)throw new Error(n.message||"Failed to generate upload URL");return n.data}catch(e){throw console.error("Failed to generate upload URL:",e),e}}))},z=function(e,t){return a(this,void 0,void 0,(function*(){try{const n=yield fetch(`${this.environment.AUTH_HUB_BASE_API}/${this.environment.AUTH_ENDPOINT}/origin/update-status`,{method:"PATCH",body:JSON.stringify({status:t,fileKey:e}),headers:{Authorization:`Bearer ${this.jwt}`,"Content-Type":"application/json"}});if(!n.ok){const e=yield n.text().catch((()=>"Unknown error"));throw new Error(`HTTP ${n.status}: ${e}`)}return!0}catch(e){throw console.error("Failed to update origin status:",e),e}}))},K=function(e){return a(this,arguments,void 0,(function*(e,t={}){var n,i,a;const r=m();let s=e;const o=null!==(n=t.confirmations)&&void 0!==n?n:1,d=null!==(i=t.timeoutMs)&&void 0!==i?i:18e4,u=null!==(a=t.pollingIntervalMs)&&void 0!==a?a:1500;try{return yield r.waitForTransactionReceipt({hash:s,confirmations:o,timeout:d,pollingInterval:u,onReplaced:e=>{s=e.transaction.hash}})}catch(e){
189
+ */claimRoyalties(e,n){return a(this,void 0,void 0,(function*(){const i=yield r(this,q,"m",V).call(this,n),a=yield this.getOrCreateRoyaltyVault(i,!0);return this.callContractMethod(a,this.environment.ROYALTY_VAULT_ABI,"claimRoyalty",[null!=e?e:t.zeroAddress],{waitForReceipt:!0})}))}}q=new WeakSet,W=function(e){return a(this,void 0,void 0,(function*(){try{const t=yield fetch(`${this.environment.AUTH_HUB_BASE_API}/${this.environment.AUTH_ENDPOINT}/origin/upload-url`,{method:"POST",body:JSON.stringify({name:e.name,type:e.type}),headers:{Authorization:`Bearer ${this.jwt}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);const n=yield t.json();if(n.isError)throw new Error(n.message||"Failed to generate upload URL");return n.data}catch(e){throw console.error("Failed to generate upload URL:",e),e}}))},z=function(e,t){return a(this,void 0,void 0,(function*(){try{const n=yield fetch(`${this.environment.AUTH_HUB_BASE_API}/${this.environment.AUTH_ENDPOINT}/origin/update-status`,{method:"PATCH",body:JSON.stringify({status:t,fileKey:e}),headers:{Authorization:`Bearer ${this.jwt}`,"Content-Type":"application/json"}});if(!n.ok){const e=yield n.text().catch((()=>"Unknown error"));throw new Error(`HTTP ${n.status}: ${e}`)}return!0}catch(e){throw console.error("Failed to update origin status:",e),e}}))},K=function(e){return a(this,arguments,void 0,(function*(e,t={}){var n,i,a;const r=m();let s=e;const o=null!==(n=t.confirmations)&&void 0!==n?n:1,d=null!==(i=t.timeoutMs)&&void 0!==i?i:18e4,u=null!==(a=t.pollingIntervalMs)&&void 0!==a?a:1500;try{return yield r.waitForTransactionReceipt({hash:s,confirmations:o,timeout:d,pollingInterval:u,onReplaced:e=>{s=e.transaction.hash}})}catch(e){
190
190
  // fallback
191
191
  const t=Date.now();for(;Date.now()-t<d;){try{const e=yield r.getTransactionReceipt({hash:s});if(e&&e.blockNumber)return e}catch(e){}yield new Promise((e=>setTimeout(e,u)))}throw e}}))},J=function(e){return a(this,void 0,void 0,(function*(){
192
192
  // return;
package/dist/core.esm.js CHANGED
@@ -349,7 +349,7 @@ const n=[{inputs:[{name:"owner",type:"address"}],name:"balanceOf",outputs:[{name
349
349
  * @param {Address} [owner] - Optional wallet address to claim royalties for. If not provided, uses the connected wallet.
350
350
  * @returns {Promise<any>} A promise that resolves when the claim transaction is confirmed.
351
351
  * @throws {Error} Throws an error if no wallet is connected and no owner address is provided.
352
- */claimRoyalties(e,t){return c(this,void 0,void 0,(function*(){const n=yield h(this,ee,"m",re).call(this,t),i=yield this.getOrCreateRoyaltyVault(n,!0);return this.callContractMethod(i,this.environment.ROYALTY_VAULT_ABI,"claimRoyalties",[null!=e?e:o],{waitForReceipt:!0})}))}}ee=new WeakSet,te=function(e){return c(this,void 0,void 0,(function*(){try{const t=yield fetch(`${this.environment.AUTH_HUB_BASE_API}/${this.environment.AUTH_ENDPOINT}/origin/upload-url`,{method:"POST",body:JSON.stringify({name:e.name,type:e.type}),headers:{Authorization:`Bearer ${this.jwt}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);const n=yield t.json();if(n.isError)throw new Error(n.message||"Failed to generate upload URL");return n.data}catch(e){throw console.error("Failed to generate upload URL:",e),e}}))},ne=function(e,t){return c(this,void 0,void 0,(function*(){try{const n=yield fetch(`${this.environment.AUTH_HUB_BASE_API}/${this.environment.AUTH_ENDPOINT}/origin/update-status`,{method:"PATCH",body:JSON.stringify({status:t,fileKey:e}),headers:{Authorization:`Bearer ${this.jwt}`,"Content-Type":"application/json"}});if(!n.ok){const e=yield n.text().catch((()=>"Unknown error"));throw new Error(`HTTP ${n.status}: ${e}`)}return!0}catch(e){throw console.error("Failed to update origin status:",e),e}}))},ie=function(e){return c(this,arguments,void 0,(function*(e,t={}){var n,i,a;const r=C();let s=e;const o=null!==(n=t.confirmations)&&void 0!==n?n:1,d=null!==(i=t.timeoutMs)&&void 0!==i?i:18e4,u=null!==(a=t.pollingIntervalMs)&&void 0!==a?a:1500;try{return yield r.waitForTransactionReceipt({hash:s,confirmations:o,timeout:d,pollingInterval:u,onReplaced:e=>{s=e.transaction.hash}})}catch(e){
352
+ */claimRoyalties(e,t){return c(this,void 0,void 0,(function*(){const n=yield h(this,ee,"m",re).call(this,t),i=yield this.getOrCreateRoyaltyVault(n,!0);return this.callContractMethod(i,this.environment.ROYALTY_VAULT_ABI,"claimRoyalty",[null!=e?e:o],{waitForReceipt:!0})}))}}ee=new WeakSet,te=function(e){return c(this,void 0,void 0,(function*(){try{const t=yield fetch(`${this.environment.AUTH_HUB_BASE_API}/${this.environment.AUTH_ENDPOINT}/origin/upload-url`,{method:"POST",body:JSON.stringify({name:e.name,type:e.type}),headers:{Authorization:`Bearer ${this.jwt}`,"Content-Type":"application/json"}});if(!t.ok)throw new Error(`HTTP ${t.status}: ${t.statusText}`);const n=yield t.json();if(n.isError)throw new Error(n.message||"Failed to generate upload URL");return n.data}catch(e){throw console.error("Failed to generate upload URL:",e),e}}))},ne=function(e,t){return c(this,void 0,void 0,(function*(){try{const n=yield fetch(`${this.environment.AUTH_HUB_BASE_API}/${this.environment.AUTH_ENDPOINT}/origin/update-status`,{method:"PATCH",body:JSON.stringify({status:t,fileKey:e}),headers:{Authorization:`Bearer ${this.jwt}`,"Content-Type":"application/json"}});if(!n.ok){const e=yield n.text().catch((()=>"Unknown error"));throw new Error(`HTTP ${n.status}: ${e}`)}return!0}catch(e){throw console.error("Failed to update origin status:",e),e}}))},ie=function(e){return c(this,arguments,void 0,(function*(e,t={}){var n,i,a;const r=C();let s=e;const o=null!==(n=t.confirmations)&&void 0!==n?n:1,d=null!==(i=t.timeoutMs)&&void 0!==i?i:18e4,u=null!==(a=t.pollingIntervalMs)&&void 0!==a?a:1500;try{return yield r.waitForTransactionReceipt({hash:s,confirmations:o,timeout:d,pollingInterval:u,onReplaced:e=>{s=e.transaction.hash}})}catch(e){
353
353
  // fallback
354
354
  const t=Date.now();for(;Date.now()-t<d;){try{const e=yield r.getTransactionReceipt({hash:s});if(e&&e.blockNumber)return e}catch(e){}yield new Promise((e=>setTimeout(e,u)))}throw e}}))},ae=function(e){return c(this,void 0,void 0,(function*(){
355
355
  // return;
@@ -3277,7 +3277,7 @@ class Origin {
3277
3277
  return __awaiter(this, void 0, void 0, function* () {
3278
3278
  const walletAddress = yield __classPrivateFieldGet(this, _Origin_instances, "m", _Origin_resolveWalletAddress).call(this, owner);
3279
3279
  const royaltyVaultAddress = yield this.getOrCreateRoyaltyVault(walletAddress, true);
3280
- return this.callContractMethod(royaltyVaultAddress, this.environment.ROYALTY_VAULT_ABI, "claimRoyalties", [token !== null && token !== void 0 ? token : zeroAddress], { waitForReceipt: true });
3280
+ return this.callContractMethod(royaltyVaultAddress, this.environment.ROYALTY_VAULT_ABI, "claimRoyalty", [token !== null && token !== void 0 ? token : zeroAddress], { waitForReceipt: true });
3281
3281
  });
3282
3282
  }
3283
3283
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@campnetwork/origin",
3
- "version": "1.0.0-alpha.10",
3
+ "version": "1.0.0-alpha.11",
4
4
  "main": "dist/core.cjs",
5
5
  "exports": {
6
6
  ".": {