Skip to main content

Partner Integration

Methods for partner authorization and management.

isAuthorizedPartner

Checks if an address is an authorized partner.
async isAuthorizedPartner(partnerAddress: Address): Promise<boolean>

Parameters

NameTypeDescription
partnerAddressAddressAddress to check

Returns

boolean - True if authorized, false otherwise.

Example

const isPartner = await sdk.isAuthorizedPartner('0x5678...');
console.log('Is partner:', isPartner);

getPartnerSubscription

Gets subscription details for a partner.
async getPartnerSubscription(partnerAddress: Address): Promise<PartnerSubscription>

Parameters

NameTypeDescription
partnerAddressAddressAddress of the partner

Returns

PartnerSubscription object containing subscription details.

Example

const subscription = await sdk.getPartnerSubscription('0x5678...');
console.log('Subscription tier:', subscription.tier);
console.log('Expiry time:', subscription.expiryTime);

getPlatformFee

Gets the current platform fee percentage.
async getPlatformFee(): Promise<number>

Returns

number - Platform fee percentage in basis points (e.g., 1500 = 15%).

Example

const fee = await sdk.getPlatformFee();
console.log('Platform fee:', fee / 100, '%');

getTreasury

Gets the treasury address.
async getTreasury(): Promise<Address>

Returns

Address - Treasury address.

Example

const treasury = await sdk.getTreasury();
console.log('Treasury address:', treasury);

recordAction

Records a user action that triggers referral rewards (partner-only method).
async recordAction(userAddress: Address, actionValue: bigint): Promise<Hex>

Parameters

NameTypeDescription
userAddressAddressAddress of the user performing the action
actionValuebigintValue of the action in wei

Returns

Hex - Transaction hash of the action recording.

Example

// Check if authorized partner
const isPartner = await sdk.isAuthorizedPartner(partnerAddress);

if (isPartner) {
  const actionValue = 1000000000000000000n; // 1 cUSD
  const txHash = await sdk.recordAction('0x1234...', actionValue);
  console.log('Action recorded:', txHash);
}