hapi-ton-sdk
Version:
SDK for managing HAPI attestations on TON network
48 lines (45 loc) • 1.59 kB
TypeScript
import * as axios from 'axios';
import { Address } from '@ton/core';
import { ContractAdapter } from '@ton-api/ton-adapter';
import { UserResponse, TrustResponseData } from '../types/index.js';
declare class HapiSDK {
private config;
constructor(args: {
referralId: number;
staging?: boolean;
testnet?: boolean;
tonApiKey?: string;
});
getUser(jwt: string): Promise<UserResponse>;
getTrustScore(address: string, network: number, jwt: string): Promise<TrustResponseData>;
getMessage(): Promise<any>;
checkProof({ proof, address, network, }: {
proof: {
state_init: string;
timestamp: number;
domain: {
lengthBytes: number;
value: string;
};
payload: string;
signature: string;
};
address: string;
network: number;
}): Promise<axios.AxiosResponse<any, any>>;
static getUserAttestationOnchain(userAddress: string, contractAdapter: ContractAdapter): Promise<{
jettonAddress: Address;
attestationData: {
commissionOwner: Address;
trustScore: bigint;
expirationDate: bigint;
attestationAddress: Address;
};
}>;
trackAttestationResult(transactionMessageHash: string, timeInterval?: number, maxRetries?: number): Promise<{
status: boolean | null;
data: undefined;
}>;
calculateTransactionFee(isUpdate: boolean, contractAdapter: ContractAdapter): Promise<bigint>;
}
export { HapiSDK };