@wasserstoff/tribes-sdk
Version:
SDK for integrating with Tribes by Astrix platform on any EVM compatible chain
40 lines (39 loc) • 1.73 kB
TypeScript
import { ethers } from 'ethers';
/**
* Create a signature for spending tokens on behalf of an organization
* @param signer Signer to sign the message
* @param organization Organization address
* @param recipient Recipient address
* @param amount Amount to spend
* @param reason Reason for spending
* @returns Signature that can be used with spendWithSignature
*/
export declare function createSpendSignature(signer: ethers.Signer, organization: string, recipient: string, amount: bigint, reason: string): Promise<string>;
/**
* Create a signature for point redemption
* @param signer Signer to sign the message
* @param user User address
* @param points Number of points
* @param collectibleType Type of collectible
* @returns Signature that can be used with redeemPoints
*/
export declare function createPointRedemptionSignature(signer: ethers.Signer, user: string, points: number, collectibleType: number): Promise<string>;
/**
* Verify a signature for spending tokens
* @param signature Signature to verify
* @param organization Organization address
* @param recipient Recipient address
* @param amount Amount to spend
* @param reason Reason for spending
* @returns Address of the signer
*/
export declare function verifySpendSignature(signature: string, organization: string, recipient: string, amount: bigint, reason: string): string;
/**
* Verify a signature for point redemption
* @param signature Signature to verify
* @param user User address
* @param points Number of points
* @param collectibleType Type of collectible
* @returns Address of the signer
*/
export declare function verifyPointRedemptionSignature(signature: string, user: string, points: number, collectibleType: number): string;