Skip to content

Commit

Permalink
Top up manifold account
Browse files Browse the repository at this point in the history
  • Loading branch information
jahooma committed Jun 20, 2024
1 parent d8c69d2 commit 085a439
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 0 deletions.
18 changes: 18 additions & 0 deletions backend/scripts/top-up-manifold.ts
Original file line number Diff line number Diff line change
@@ -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$',
})
})
})
}
9 changes: 9 additions & 0 deletions common/src/txn.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ type AnyTxnType =
| AirDrop
| ManifestAirDrop
| ExtraPurchasedMana
| ManifoldTopUp

export type AnyTxnCategory = AnyTxnType['category']

Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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

0 comments on commit 085a439

Please sign in to comment.