@campnetwork/origin 1.2.0 → 1.2.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.
@@ -168,15 +168,6 @@ declare function hasAccess(this: Origin, user: Address, tokenId: bigint): Promis
168
168
 
169
169
  declare function subscriptionExpiry(this: Origin, tokenId: bigint, user: Address): Promise<bigint>;
170
170
 
171
- interface OriginUsageReturnType {
172
- user: {
173
- multiplier: number;
174
- points: number;
175
- active: boolean;
176
- };
177
- teams: Array<any>;
178
- dataSources: Array<any>;
179
- }
180
171
  interface RoyaltyInfo {
181
172
  tokenBoundAccount: Address;
182
173
  balance: bigint;
@@ -212,33 +203,17 @@ declare class Origin {
212
203
  buyAccess: typeof buyAccess;
213
204
  hasAccess: typeof hasAccess;
214
205
  subscriptionExpiry: typeof subscriptionExpiry;
215
- private jwt;
206
+ private jwt?;
216
207
  environment: Environment;
217
208
  private viemClient?;
218
209
  baseParentId?: bigint;
219
- constructor(jwt: string, environment: Environment, viemClient?: WalletClient, baseParentId?: bigint);
220
- getJwt(): string;
210
+ constructor(environment: Environment | string, jwt?: string, viemClient?: WalletClient, baseParentId?: bigint);
211
+ getJwt(): string | undefined;
221
212
  setViemClient(client: WalletClient): void;
222
- uploadFile(file: File, options?: {
223
- progressCallback?: (percent: number) => void;
224
- }): Promise<any>;
225
213
  mintFile(file: File, metadata: Record<string, unknown>, license: LicenseTerms, parents?: bigint[], options?: {
226
214
  progressCallback?: (percent: number) => void;
227
215
  }): Promise<string | null>;
228
216
  mintSocial(source: "spotify" | "twitter" | "tiktok", metadata: Record<string, unknown>, license: LicenseTerms): Promise<string | null>;
229
- getOriginUploads(): Promise<any[] | null>;
230
- /**
231
- * Get the user's Origin stats (multiplier, consent, usage, etc.).
232
- * @returns {Promise<OriginUsageReturnType>} A promise that resolves with the user's Origin stats.
233
- */
234
- getOriginUsage(): Promise<OriginUsageReturnType>;
235
- /**
236
- * Set the user's consent for Origin usage.
237
- * @param {boolean} consent The user's consent.
238
- * @returns {Promise<void>}
239
- * @throws {Error|APIError} - Throws an error if the user is not authenticated. Also throws an error if the consent is not provided.
240
- */
241
- setOriginConsent(consent: boolean): Promise<void>;
242
217
  /**
243
218
  * Call a contract method.
244
219
  * @param {string} contractAddress The contract address.
@@ -256,7 +231,21 @@ declare class Origin {
256
231
  * @returns {Promise<any>} The result of the buyAccess call.
257
232
  */
258
233
  buyAccessSmart(tokenId: bigint): Promise<any>;
234
+ /**
235
+ * Fetch the underlying data associated with a specific token ID.
236
+ * @param {bigint} tokenId - The token ID to fetch data for.
237
+ * @returns {Promise<any>} A promise that resolves with the fetched data.
238
+ * @throws {Error} Throws an error if the data cannot be fetched.
239
+ */
259
240
  getData(tokenId: bigint): Promise<any>;
241
+ /**
242
+ * Fetch data with X402 payment handling.
243
+ * @param {bigint} tokenId The token ID to fetch data for.
244
+ * @param {any} [signer] Optional signer object for signing the X402 intent.
245
+ * @returns {Promise<any>} A promise that resolves with the fetched data.
246
+ * @throws {Error} Throws an error if the data cannot be fetched or if no signer/wallet client is provided.
247
+ */
248
+ getDataWithX402(tokenId: bigint, signer?: any): Promise<any>;
260
249
  /**
261
250
  * Get the Token Bound Account (TBA) address for a specific token ID.
262
251
  * @param {bigint} tokenId - The token ID to get the TBA address for.
@@ -697,23 +686,5 @@ type UseSocialsResult<TData = unknown, TError = Error> = UseQueryResult<TData, T
697
686
  * @returns { { data: {}, socials: {}, error: Error, isLoading: boolean, refetch: () => {} } } react-query query object.
698
687
  */
699
688
  declare const useSocials: () => UseSocialsResult;
700
- /**
701
- * Fetches the Origin usage data and uploads data.
702
- * @returns { usage: { data: any, isError: boolean, isLoading: boolean, refetch: () => void }, uploads: { data: any, isError: boolean, isLoading: boolean, refetch: () => void } } The Origin usage data and uploads data.
703
- */
704
- declare const useOrigin: () => {
705
- stats: {
706
- data: any;
707
- isError: boolean;
708
- isLoading: boolean;
709
- refetch: () => void;
710
- };
711
- uploads: {
712
- data: any[];
713
- isError: boolean;
714
- isLoading: boolean;
715
- refetch: () => void;
716
- };
717
- };
718
689
 
719
- export { StandaloneCampButton as CampButton, CampContext, CampModal, CampProvider, LinkButton, ModalContext, MyCampModal, useAuth, useAuthState, useConnect, useLinkModal, useLinkSocials, useModal, useOrigin, useProvider, useProviders, useSocials, useViem };
690
+ export { StandaloneCampButton as CampButton, CampContext, CampModal, CampProvider, LinkButton, ModalContext, MyCampModal, useAuth, useAuthState, useConnect, useLinkModal, useLinkSocials, useModal, useProvider, useProviders, useSocials, useViem };