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

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.
@@ -1,5 +1,5 @@
1
1
  import React, { JSX } from 'react';
2
- import { Address, Hex, WalletClient, Abi } from 'viem';
2
+ import { Address, Hex, Abi } from 'viem';
3
3
  import { UseQueryResult } from '@tanstack/react-query';
4
4
 
5
5
  interface Environment {
@@ -12,7 +12,6 @@ interface Environment {
12
12
  CHAIN: any;
13
13
  IPNFT_ABI?: any;
14
14
  MARKETPLACE_ABI?: any;
15
- ROYALTY_VAULT_ABI?: any;
16
15
  }
17
16
 
18
17
  /**
@@ -82,14 +81,6 @@ declare function updateTerms(this: Origin, tokenId: bigint, newTerms: LicenseTer
82
81
  */
83
82
  declare function finalizeDelete(this: Origin, tokenId: bigint): Promise<any>;
84
83
 
85
- /**
86
- * Calls the getOrCreateRoyaltyVault method on the IPNFT contract.
87
- * @param tokenOwner The address of the token owner for whom to get or create the royalty vault.
88
- * @param simulateOnly If true, simulates the transaction without executing it.
89
- * @returns The address of the royalty vault associated with the specified token owner.
90
- */
91
- declare function getOrCreateRoyaltyVault(this: Origin, tokenOwner: Address, simulateOnly?: boolean): Promise<Address>;
92
-
93
84
  /**
94
85
  * Returns the license terms associated with a specific token ID.
95
86
  * @param tokenId The token ID to query.
@@ -172,16 +163,10 @@ interface OriginUsageReturnType {
172
163
  teams: Array<any>;
173
164
  dataSources: Array<any>;
174
165
  }
175
- interface RoyaltyInfo {
176
- royaltyVault: Address;
177
- balance: bigint;
178
- balanceFormatted: string;
179
- }
180
166
  type CallOptions = {
181
167
  value?: bigint;
182
168
  gas?: bigint;
183
169
  waitForReceipt?: boolean;
184
- simulate?: boolean;
185
170
  };
186
171
  /**
187
172
  * The Origin class
@@ -193,7 +178,6 @@ declare class Origin {
193
178
  registerIpNFT: typeof registerIpNFT;
194
179
  updateTerms: typeof updateTerms;
195
180
  finalizeDelete: typeof finalizeDelete;
196
- getOrCreateRoyaltyVault: typeof getOrCreateRoyaltyVault;
197
181
  getTerms: typeof getTerms;
198
182
  ownerOf: typeof ownerOf;
199
183
  balanceOf: typeof balanceOf;
@@ -210,17 +194,17 @@ declare class Origin {
210
194
  private jwt;
211
195
  environment: Environment;
212
196
  private viemClient?;
213
- constructor(jwt: string, environment: Environment, viemClient?: WalletClient);
197
+ constructor(jwt: string, environment: Environment, viemClient?: any);
214
198
  getJwt(): string;
215
- setViemClient(client: WalletClient): void;
216
- uploadFile(file: File, options?: {
199
+ setViemClient(client: any): void;
200
+ uploadFile: (file: File, options?: {
217
201
  progressCallback?: (percent: number) => void;
218
- }): Promise<any>;
219
- mintFile(file: File, metadata: Record<string, unknown>, license: LicenseTerms, parents?: bigint[], options?: {
202
+ }) => Promise<any>;
203
+ mintFile: (file: File, metadata: Record<string, unknown>, license: LicenseTerms, parents?: bigint[], options?: {
220
204
  progressCallback?: (percent: number) => void;
221
- }): Promise<string | null>;
222
- mintSocial(source: "spotify" | "twitter" | "tiktok", metadata: Record<string, unknown>, license: LicenseTerms): Promise<string | null>;
223
- getOriginUploads(): Promise<any[] | null>;
205
+ }) => Promise<string | null>;
206
+ mintSocial: (source: "spotify" | "twitter" | "tiktok", metadata: Record<string, unknown>, license: LicenseTerms) => Promise<string | null>;
207
+ getOriginUploads: () => Promise<any>;
224
208
  /**
225
209
  * Get the user's Origin stats (multiplier, consent, usage, etc.).
226
210
  * @returns {Promise<OriginUsageReturnType>} A promise that resolves with the user's Origin stats.
@@ -251,30 +235,6 @@ declare class Origin {
251
235
  */
252
236
  buyAccessSmart(tokenId: bigint): Promise<any>;
253
237
  getData(tokenId: bigint): Promise<any>;
254
- /**
255
- * Get royalty information for a wallet address, including the royalty vault address and its balance.
256
- * @param {Address} [token] - Optional token address to check royalties for. If not provided, checks for native token.
257
- * @param {Address} [owner] - Optional wallet address to check royalties for. If not provided, uses the connected wallet.
258
- * @returns {Promise<RoyaltyInfo>} A promise that resolves with the royalty vault address and balance information.
259
- * @throws {Error} Throws an error if no wallet is connected and no owner address is provided.
260
- * @example
261
- * ```typescript
262
- * // Get royalties for connected wallet
263
- * const royalties = await origin.getRoyalties();
264
- *
265
- * // Get royalties for specific address
266
- * const royalties = await origin.getRoyalties("0x1234...");
267
- * ```
268
- */
269
- getRoyalties(token?: Address, owner?: Address): Promise<RoyaltyInfo>;
270
- /**
271
- * Claim royalties from the royalty vault.
272
- * @param {Address} [token] - Optional token address to claim royalties in. If not provided, claims in native token.
273
- * @param {Address} [owner] - Optional wallet address to claim royalties for. If not provided, uses the connected wallet.
274
- * @returns {Promise<any>} A promise that resolves when the claim transaction is confirmed.
275
- * @throws {Error} Throws an error if no wallet is connected and no owner address is provided.
276
- */
277
- claimRoyalties(token?: Address, owner?: Address): Promise<any>;
278
238
  }
279
239
 
280
240
  declare global {