@arkade-os/boltz-swap
Version:
A production-ready TypeScript package that brings Boltz submarine-swaps to Arkade.
63 lines (59 loc) • 1.99 kB
TypeScript
import { RealmLike } from '@arkade-os/sdk/repositories/realm';
import { m as SwapRepository, B as BoltzSwap, p as GetSwapsFilter } from '../../types-BKEkNZxK.js';
import '@arkade-os/sdk';
/**
* Realm-based implementation of SwapRepository.
*
* `realm` is a peer dependency and not installed in this package; consumers
* open Realm with the schemas from `./schemas.ts` and pass the instance to
* the constructor, where it is validated against the shared `RealmLike`
* shape exported by `@arkade-os/sdk`.
*
* Realm handles schema creation on open, so `ensureInit()` is a no-op.
* The consumer owns the Realm lifecycle — `[Symbol.asyncDispose]` is a no-op.
*/
declare class RealmSwapRepository implements SwapRepository {
private readonly realm;
readonly version: 1;
constructor(realm: RealmLike);
private ensureInit;
[Symbol.asyncDispose](): Promise<void>;
saveSwap<T extends BoltzSwap>(swap: T): Promise<void>;
deleteSwap(id: string): Promise<void>;
getAllSwaps<T extends BoltzSwap>(filter?: GetSwapsFilter): Promise<T[]>;
clear(): Promise<void>;
private addFilterCondition;
}
/**
* Realm object schemas for the Boltz swap repository.
*
* All schema names are prefixed with "Boltz" to avoid collisions with
* other Realm schemas in the consuming application.
*
* Since `realm` is a peer dependency (not installed in this package),
* schemas are defined as plain JS objects conforming to Realm's
* ObjectSchema shape.
*/
declare const BoltzSwapSchema: {
name: string;
primaryKey: string;
properties: {
id: string;
type: string;
status: string;
createdAt: string;
data: string;
};
};
declare const BoltzRealmSchemas: {
name: string;
primaryKey: string;
properties: {
id: string;
type: string;
status: string;
createdAt: string;
data: string;
};
}[];
export { BoltzRealmSchemas, BoltzSwapSchema, RealmSwapRepository };