Working tree is now the canonical repo. Off-chain play-money + trustless on-chain (FPMM AMM + CLOB via UMA settlement), AI market factory, creator/social/distribution, mobile shell + push, one-command demo + deploy-kit. Secrets excluded (see ENV-AND-KEYS.md). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
32 lines
856 B
TypeScript
32 lines
856 B
TypeScript
import * as admin from 'firebase-admin'
|
|
import { SupabaseClient } from 'common/supabase/utils'
|
|
import { getLocalEnv, initAdmin } from 'shared/init-admin'
|
|
import { getServiceAccountCredentials, loadSecretsToEnv } from 'common/secrets'
|
|
import {
|
|
createSupabaseClient,
|
|
createSupabaseDirectClient,
|
|
SupabaseDirectClientTimeout,
|
|
} from 'shared/supabase/init'
|
|
|
|
initAdmin()
|
|
|
|
export const runScript = async (
|
|
main: (services: {
|
|
db: SupabaseClient
|
|
pg: SupabaseDirectClientTimeout
|
|
firestore: admin.firestore.Firestore
|
|
}) => Promise<any> | any
|
|
) => {
|
|
const env = getLocalEnv()
|
|
const credentials = getServiceAccountCredentials(env)
|
|
|
|
await loadSecretsToEnv(credentials)
|
|
|
|
const db = createSupabaseClient()
|
|
const pg = createSupabaseDirectClient()
|
|
const firestore = admin.firestore()
|
|
await main({ db, pg, firestore })
|
|
|
|
process.exit()
|
|
}
|