@campnetwork/origin 1.0.0-alpha.2 → 1.0.0-alpha.4

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.
@@ -206,6 +206,7 @@ interface Environment {
206
206
  CHAIN: any;
207
207
  IPNFT_ABI?: any;
208
208
  MARKETPLACE_ABI?: any;
209
+ ROYALTY_VAULT_ABI?: any;
209
210
  }
210
211
 
211
212
  /**
@@ -275,6 +276,13 @@ declare function updateTerms(this: Origin, tokenId: bigint, newTerms: LicenseTer
275
276
  */
276
277
  declare function finalizeDelete(this: Origin, tokenId: bigint): Promise<any>;
277
278
 
279
+ /**
280
+ * Calls the getOrCreateRoyaltyVault method on the IPNFT contract.
281
+ * @param tokenOwner The address of the token owner for whom to get or create the royalty vault.
282
+ * @returns The address of the royalty vault associated with the specified token owner.
283
+ */
284
+ declare function getOrCreateRoyaltyVault(this: Origin, tokenOwner: Address): Promise<Address>;
285
+
278
286
  /**
279
287
  * Returns the license terms associated with a specific token ID.
280
288
  * @param tokenId The token ID to query.
@@ -357,6 +365,11 @@ interface OriginUsageReturnType {
357
365
  teams: Array<any>;
358
366
  dataSources: Array<any>;
359
367
  }
368
+ interface RoyaltyInfo {
369
+ royaltyVault: Address;
370
+ balance: bigint;
371
+ balanceFormatted: string;
372
+ }
360
373
  type CallOptions = {
361
374
  value?: bigint;
362
375
  gas?: bigint;
@@ -372,6 +385,7 @@ declare class Origin {
372
385
  registerIpNFT: typeof registerIpNFT;
373
386
  updateTerms: typeof updateTerms;
374
387
  finalizeDelete: typeof finalizeDelete;
388
+ getOrCreateRoyaltyVault: typeof getOrCreateRoyaltyVault;
375
389
  getTerms: typeof getTerms;
376
390
  ownerOf: typeof ownerOf;
377
391
  balanceOf: typeof balanceOf;
@@ -391,14 +405,14 @@ declare class Origin {
391
405
  constructor(jwt: string, environment: Environment, viemClient?: any);
392
406
  getJwt(): string;
393
407
  setViemClient(client: any): void;
394
- uploadFile: (file: File, options?: {
408
+ uploadFile(file: File, options?: {
395
409
  progressCallback?: (percent: number) => void;
396
- }) => Promise<any>;
397
- mintFile: (file: File, metadata: Record<string, unknown>, license: LicenseTerms, parents?: bigint[], options?: {
410
+ }): Promise<any>;
411
+ mintFile(file: File, metadata: Record<string, unknown>, license: LicenseTerms, parents?: bigint[], options?: {
398
412
  progressCallback?: (percent: number) => void;
399
- }) => Promise<string | null>;
400
- mintSocial: (source: "spotify" | "twitter" | "tiktok", metadata: Record<string, unknown>, license: LicenseTerms) => Promise<string | null>;
401
- getOriginUploads: () => Promise<any>;
413
+ }): Promise<string | null>;
414
+ mintSocial(source: "spotify" | "twitter" | "tiktok", metadata: Record<string, unknown>, license: LicenseTerms): Promise<string | null>;
415
+ getOriginUploads(): Promise<any[] | null>;
402
416
  /**
403
417
  * Get the user's Origin stats (multiplier, consent, usage, etc.).
404
418
  * @returns {Promise<OriginUsageReturnType>} A promise that resolves with the user's Origin stats.
@@ -429,6 +443,29 @@ declare class Origin {
429
443
  */
430
444
  buyAccessSmart(tokenId: bigint): Promise<any>;
431
445
  getData(tokenId: bigint): Promise<any>;
446
+ /**
447
+ * Get royalty information for a wallet address, including the royalty vault address and its balance.
448
+ * @param {Address} [owner] - Optional wallet address to check royalties for. If not provided, uses the connected wallet.
449
+ * @returns {Promise<RoyaltyInfo>} A promise that resolves with the royalty vault address and balance information.
450
+ * @throws {Error} Throws an error if no wallet is connected and no owner address is provided.
451
+ * @example
452
+ * ```typescript
453
+ * // Get royalties for connected wallet
454
+ * const royalties = await origin.getRoyalties();
455
+ *
456
+ * // Get royalties for specific address
457
+ * const royalties = await origin.getRoyalties("0x1234...");
458
+ * ```
459
+ */
460
+ getRoyalties(token?: Address, owner?: Address): Promise<RoyaltyInfo>;
461
+ /**
462
+ * Claim royalties from the royalty vault.
463
+ * @param {Address} [token] - Optional token address to claim royalties in. If not provided, claims in native token.
464
+ * @param {Address} [owner] - Optional wallet address to claim royalties for. If not provided, uses the connected wallet.
465
+ * @returns {Promise<any>} A promise that resolves when the claim transaction is confirmed.
466
+ * @throws {Error} Throws an error if no wallet is connected and no owner address is provided.
467
+ */
468
+ claimRoyalties(token?: Address, owner?: Address): Promise<any>;
432
469
  }
433
470
 
434
471
  declare global {