@azuro-org/toolkit
Version:
This framework-agnostic package provides essential utilities for building applications on the Azuro Protocol.
41 lines (40 loc) • 1.32 kB
TypeScript
import { type Address } from 'viem';
import { type ChainId } from '../../config';
export type CreateUserFavoriteParams = {
chainId: ChainId;
token: string;
country: string;
league?: string;
sportId: number;
};
export type CreateUserFavoriteResult = {
favoritesId: string;
userId: Address;
affiliateId: Address;
country: string;
league: string | null;
sportId: number;
createdAt: string;
};
/**
* Creates a user favorite (entire country isolated by sport, or exact league) via an authenticated POST request.
* Requires a valid Bearer JWT obtained from `verifySiwe` — the server derives `userId` and
* `affiliateId` from the token, so they must not be passed in the body.
*
* - Auth: `Authorization: Bearer <token>` (see {@link https://gem.azuro.org/hub/apps/toolkit/auth/verifySiwe verifySiwe})
* - Docs: https://gem.azuro.org/hub/apps/toolkit/user/createUserFavorite
*
* @example
* import { createUserFavorite } from '@azuro-org/toolkit'
*
* const result = await createUserFavorite({
* chainId: 137,
* token: jwtToken,
* country: 'England',
* league: 'Premier League',
* sportId: 33,
* })
*
* console.log(result.favoritesId)
* */
export declare const createUserFavorite: (props: CreateUserFavoriteParams) => Promise<CreateUserFavoriteResult>;