Skip to content

Instantly share code, notes, and snippets.

@brandonbryant12
Created April 10, 2023 00:32
Show Gist options
  • Save brandonbryant12/2a4277fed50cd6ead3e1454be81c187d to your computer and use it in GitHub Desktop.
Save brandonbryant12/2a4277fed50cd6ead3e1454be81c187d to your computer and use it in GitHub Desktop.
/* eslint-disable class-methods-use-this */
type UserProfile = {
name: string;
avatarUrl: string;
balance: number;
};
abstract class AbstractWallet {
// Returns a promise that resolves an array of strings, each string is an origin
async getOrdinals(): Promise<string[]> {
throw new Error('Not implemented');
}
// Returns a promise as a string - transactionId
async sendOrdinal(origin: string, lockingScript: string): Promise<string> {
throw new Error('Not implemented');
}
// Returns a promise as a string - raw transaction hex
async createPsbtBid(ordinalOrigin: string, satoshis: number): Promise<string> {
throw new Error('Not implemented');
}
// Returns a promise as a string - transactionId
async acceptPsbtBid(psbtHex: string): Promise<string> {
throw new Error('Not implemented');
}
// Returns a promise as a string - raw transaction hex
async createPsbtListing(origin: string): Promise<string> {
throw new Error('Not implemented');
}
// Returns a promise as a string - transactionId
async acceptPsbtListing(psbtHex: string): Promise<string> {
throw new Error('Not implemented');
}
// Returns a promise as a boolean
async isOwner(origin: string): Promise<boolean> {
throw new Error('Not implemented');
}
// Returns a promise as a number - satoshis in wallet
async getBalance(): Promise<number> {
throw new Error('Not implemented');
}
async getProfile(): Promise<UserProfile> {
throw new Error('Not implemented');
}
}
export default AbstractWallet;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment