@bsv/wallet-toolbox
Version:
BRC100 conforming wallet, wallet storage and wallet signer components
300 lines • 7.49 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const sdk_1 = require("@bsv/sdk");
const StorageProvider_1 = require("../StorageProvider");
const Services_1 = require("../../services/Services");
describe('getBeefForTransaction tests', () => {
jest.setTimeout(99999999);
test('0 ProtoStorage.getBeefForTxid', async () => {
const ps = new ProtoStorage('main');
const beef = await ps.getBeefForTxid('794f836052ad73732a550c38bea3697a722c6a1e54bcbe63735ba79e0d23f623');
expect(beef.bumps.length > 0);
{
const beef = await ps.getBeefForTxid('53023657e79f446ca457040a0ab3b903000d7281a091397c7853f021726a560e');
expect(beef.bumps.length > 0);
}
});
test.skip('1 obtain atomic beef hex for txid', async () => {
const ps = new ProtoStorage('main');
const txid = '4cefbe79926d6ef2cc727d8faccac186d9bb141f170411dd75bc6329f428f5a4';
const beef = await ps.getBeefForTxid(txid);
expect(beef.bumps.length > 0);
console.log(beef.toLogString());
const hex = sdk_1.Utils.toHex(beef.toBinaryAtomic(txid));
console.log(hex);
});
});
class ProtoStorage extends StorageProvider_1.StorageProvider {
constructor(chain) {
const o = StorageProvider_1.StorageProvider.createStorageBaseOptions(chain);
super(o);
this.nip = new Error('Method not implemented.');
const so = Services_1.Services.createDefaultOptions(chain);
// so.whatsOnChainApiKey = 'my_api_key'
const s = new Services_1.Services(so);
this.setServices(s);
this.gbo = {
ignoreNewProven: true,
ignoreServices: false,
ignoreStorage: true
};
this.maxRecursionDepth = 2;
}
async getBeefForTxid(txid) {
const beef = this.getBeefForTransaction(txid, this.gbo);
return beef;
}
reviewStatus(args) {
throw this.nip;
}
purgeData(params, trx) {
throw this.nip;
}
allocateChangeInput(userId, basketId, targetSatoshis, exactSatoshis, excludeSending, transactionId) {
throw this.nip;
}
getProvenOrRawTx(txid, trx) {
throw this.nip;
}
getRawTxOfKnownValidTransaction(txid, offset, length, trx) {
throw this.nip;
}
getLabelsForTransactionId(transactionId, trx) {
throw this.nip;
}
getTagsForOutputId(outputId, trx) {
throw this.nip;
}
listActions(auth, args) {
throw this.nip;
}
listOutputs(auth, args) {
throw this.nip;
}
countChangeInputs(userId, basketId, excludeSending) {
throw this.nip;
}
findCertificatesAuth(auth, args) {
throw this.nip;
}
findOutputBasketsAuth(auth, args) {
throw this.nip;
}
findOutputsAuth(auth, args) {
throw this.nip;
}
insertCertificateAuth(auth, certificate) {
throw this.nip;
}
dropAllData() {
throw this.nip;
}
migrate(storageName, storageIdentityKey) {
throw this.nip;
}
findOutputTagMaps(args) {
throw this.nip;
}
findProvenTxReqs(args) {
throw this.nip;
}
findProvenTxs(args) {
throw this.nip;
}
findTxLabelMaps(args) {
throw this.nip;
}
countOutputTagMaps(args) {
throw this.nip;
}
countProvenTxReqs(args) {
throw this.nip;
}
countProvenTxs(args) {
throw this.nip;
}
countTxLabelMaps(args) {
throw this.nip;
}
insertCertificate(certificate, trx) {
throw this.nip;
}
insertCertificateField(certificateField, trx) {
throw this.nip;
}
insertCommission(commission, trx) {
throw this.nip;
}
insertMonitorEvent(event, trx) {
throw this.nip;
}
insertOutput(output, trx) {
throw this.nip;
}
insertOutputBasket(basket, trx) {
throw this.nip;
}
insertOutputTag(tag, trx) {
throw this.nip;
}
insertOutputTagMap(tagMap, trx) {
throw this.nip;
}
insertProvenTx(tx, trx) {
throw this.nip;
}
insertProvenTxReq(tx, trx) {
throw this.nip;
}
insertSyncState(syncState, trx) {
throw this.nip;
}
insertTransaction(tx, trx) {
throw this.nip;
}
insertTxLabel(label, trx) {
throw this.nip;
}
insertTxLabelMap(labelMap, trx) {
throw this.nip;
}
insertUser(user, trx) {
throw this.nip;
}
updateCertificate(id, update, trx) {
throw this.nip;
}
updateCertificateField(certificateId, fieldName, update, trx) {
throw this.nip;
}
updateCommission(id, update, trx) {
throw this.nip;
}
updateMonitorEvent(id, update, trx) {
throw this.nip;
}
updateOutput(id, update, trx) {
throw this.nip;
}
updateOutputBasket(id, update, trx) {
throw this.nip;
}
updateOutputTag(id, update, trx) {
throw this.nip;
}
updateOutputTagMap(outputId, tagId, update, trx) {
throw this.nip;
}
updateProvenTx(id, update, trx) {
throw this.nip;
}
updateProvenTxReq(id, update, trx) {
throw this.nip;
}
updateSyncState(id, update, trx) {
throw this.nip;
}
updateTransaction(id, update, trx) {
throw this.nip;
}
updateTxLabel(id, update, trx) {
throw this.nip;
}
updateTxLabelMap(transactionId, txLabelId, update, trx) {
throw this.nip;
}
updateUser(id, update, trx) {
throw this.nip;
}
destroy() {
throw this.nip;
}
transaction(scope, trx) {
throw this.nip;
}
readSettings(trx) {
throw this.nip;
}
findCertificateFields(args) {
throw this.nip;
}
findCertificates(args) {
throw this.nip;
}
findCommissions(args) {
throw this.nip;
}
findMonitorEvents(args) {
throw this.nip;
}
findOutputBaskets(args) {
throw this.nip;
}
findOutputs(args) {
throw this.nip;
}
findOutputTags(args) {
throw this.nip;
}
findSyncStates(args) {
throw this.nip;
}
findTransactions(args) {
throw this.nip;
}
findTxLabels(args) {
throw this.nip;
}
findUsers(args) {
throw this.nip;
}
countCertificateFields(args) {
throw this.nip;
}
countCertificates(args) {
throw this.nip;
}
countCommissions(args) {
throw this.nip;
}
countMonitorEvents(args) {
throw this.nip;
}
countOutputBaskets(args) {
throw this.nip;
}
countOutputs(args) {
throw this.nip;
}
countOutputTags(args) {
throw this.nip;
}
countSyncStates(args) {
throw this.nip;
}
countTransactions(args) {
throw this.nip;
}
countTxLabels(args) {
throw this.nip;
}
countUsers(args) {
throw this.nip;
}
getProvenTxsForUser(args) {
throw this.nip;
}
getProvenTxReqsForUser(args) {
throw this.nip;
}
getTxLabelMapsForUser(args) {
throw this.nip;
}
getOutputTagMapsForUser(args) {
throw this.nip;
}
adminStats(adminIdentityKey) {
throw this.nip;
}
}
//# sourceMappingURL=getBeefForTransaction.test.js.map