@galliun/sofi-sdk
Version:
SDK for interacting with the Galliun SocialFi protocol
81 lines (72 loc) • 1.71 kB
text/typescript
import { Transaction } from '@mysten/sui/transactions';
export type SuiAddress = string;
export type ObjectId = string;
export interface Profile {
id: ObjectId;
owner: SuiAddress;
username: string;
displayName: string;
bio: string;
profilePicture: string;
backgroundPicture: string;
links: ProfileLink[];
followers: SuiAddress[];
following: SuiAddress[];
acceptTips: boolean;
}
export interface ProfileLink {
name: string;
url: string;
}
export interface Goal {
id: ObjectId;
profile: ObjectId;
creator: SuiAddress;
coinType: string;
amount: bigint;
status: GoalStatus;
totalPaymentsMade: bigint;
totalAmountPaid: bigint;
totalAmountClaimed: bigint;
totalFeeAmount: bigint;
totalAmountRefunded: bigint;
description: string;
expiresAt?: bigint;
overFund: boolean;
}
export interface Tip {
id: ObjectId;
creator: SuiAddress;
recipient: SuiAddress;
profile: ObjectId;
coinType: string;
amount: bigint;
status: TipStatus;
totalAmountPaid: bigint;
totalAmountClaimed: bigint;
totalFeeAmount: bigint;
totalAmountRefunded: bigint;
description: string;
}
export enum GoalStatus {
InProgress = 'INPROGRESS',
Paid = 'PAID',
Completed = 'COMPLETED',
Canceled = 'CANCELED',
Rejected = 'REJECTED',
}
export enum TipStatus {
Pending = 'PENDING',
Claimed = 'CLAIMED',
Canceled = 'CANCELED'
}
export interface PaymentRecord {
timestamp: bigint;
payer: SuiAddress;
amount: bigint;
refunded: boolean;
}
export interface SdkOptions {
packageId: string;
network: 'mainnet' | 'testnet' | 'devnet' | 'localnet';
}