From 085a43973d21dc4314b03a0c46a38547f883cf35 Mon Sep 17 00:00:00 2001 From: James Grugett Date: Thu, 20 Jun 2024 16:03:45 -0700 Subject: [PATCH] Top up manifold account --- backend/scripts/top-up-manifold.ts | 18 ++++++++++++++++++ common/src/txn.ts | 9 +++++++++ 2 files changed, 27 insertions(+) create mode 100644 backend/scripts/top-up-manifold.ts diff --git a/backend/scripts/top-up-manifold.ts b/backend/scripts/top-up-manifold.ts new file mode 100644 index 0000000000..d570a2f8cd --- /dev/null +++ b/backend/scripts/top-up-manifold.ts @@ -0,0 +1,18 @@ +import { runScript } from 'run-script' +import { runTxnFromBank } from 'shared/txn/run-txn' + +if (require.main === module) { + runScript(async ({ pg }) => { + await pg.tx(async (tx) => { + await runTxnFromBank(tx, { + amount: 2_000_000, + description: 'Top up Manifold account', + category: 'MANIFOLD_TOP_UP', + fromType: 'BANK', + toType: 'USER', + toId: 'IPTOzEqrpkWmEzh6hwvAyY9PqFb2', // Manifold account user id + token: 'M$', + }) + }) + }) +} diff --git a/common/src/txn.ts b/common/src/txn.ts index b768899588..662b3e0c0d 100644 --- a/common/src/txn.ts +++ b/common/src/txn.ts @@ -50,6 +50,7 @@ type AnyTxnType = | AirDrop | ManifestAirDrop | ExtraPurchasedMana + | ManifoldTopUp export type AnyTxnCategory = AnyTxnType['category'] @@ -459,6 +460,13 @@ type ExtraPurchasedMana = { token: 'M$' } +type ManifoldTopUp = { + category: 'MANIFOLD_TOP_UP' + fromType: 'BANK' + toType: 'USER' + token: 'M$' +} + export type AddSubsidyTxn = Txn & AddSubsidy export type DonationTxn = Txn & Donation export type TipTxn = Txn & Tip @@ -506,3 +514,4 @@ export type BotCommentFeeTxn = Txn & BotCommentFee export type AirDropTxn = Txn & AirDrop export type ManifestAirDropTxn = Txn & ManifestAirDrop export type ExtraPurchasedManaTxn = Txn & ExtraPurchasedMana +export type ManifoldTopUpTxn = Txn & ManifoldTopUp