@cfxlabsinc/b2b-services
    Preparing search index...

    Variable walletAccountTransactionTableConst

    walletAccountTransactionTable: Omit<
        PgTableWithColumns<
            {
                columns: {
                    accountKey: PgBuildColumn<
                        "wallet_account_transaction",
                        SetNotNull<PgTextBuilder<[string, ...string[]]>>,
                        {
                            data: string;
                            dataType: "string";
                            driverParam: string;
                            enumValues: undefined;
                            generated: undefined;
                            hasDefault: false;
                            hasRuntimeDefault: false;
                            identity: undefined;
                            isAutoincrement: false;
                            isPrimaryKey: false;
                            name: string;
                            notNull: true;
                            tableName: "wallet_account_transaction";
                        },
                    >;
                    amount: PgBuildColumn<
                        "wallet_account_transaction",
                        SetNotNull<PgNumericBuilder>,
                        {
                            data: string;
                            dataType: "string numeric";
                            driverParam: string;
                            enumValues: undefined;
                            generated: undefined;
                            hasDefault: false;
                            hasRuntimeDefault: false;
                            identity: undefined;
                            isAutoincrement: false;
                            isPrimaryKey: false;
                            name: string;
                            notNull: true;
                            tableName: "wallet_account_transaction";
                        },
                    >;
                    mint: PgBuildColumn<
                        "wallet_account_transaction",
                        SetNotNull<PgTextBuilder<[string, ...string[]]>>,
                        {
                            data: string;
                            dataType: "string";
                            driverParam: string;
                            enumValues: undefined;
                            generated: undefined;
                            hasDefault: false;
                            hasRuntimeDefault: false;
                            identity: undefined;
                            isAutoincrement: false;
                            isPrimaryKey: false;
                            name: string;
                            notNull: true;
                            tableName: "wallet_account_transaction";
                        },
                    >;
                    postBalance: PgBuildColumn<
                        "wallet_account_transaction",
                        PgNumericBuilder,
                        {
                            data: string;
                            dataType: "string numeric";
                            driverParam: string;
                            enumValues: undefined;
                            generated: undefined;
                            hasDefault: false;
                            hasRuntimeDefault: false;
                            identity: undefined;
                            isAutoincrement: false;
                            isPrimaryKey: false;
                            name: string;
                            notNull: false;
                            tableName: "wallet_account_transaction";
                        },
                    >;
                    preBalance: PgBuildColumn<
                        "wallet_account_transaction",
                        PgNumericBuilder,
                        {
                            data: string;
                            dataType: "string numeric";
                            driverParam: string;
                            enumValues: undefined;
                            generated: undefined;
                            hasDefault: false;
                            hasRuntimeDefault: false;
                            identity: undefined;
                            isAutoincrement: false;
                            isPrimaryKey: false;
                            name: string;
                            notNull: false;
                            tableName: "wallet_account_transaction";
                        },
                    >;
                    programId: PgBuildColumn<
                        "wallet_account_transaction",
                        SetNotNull<PgTextBuilder<[string, ...string[]]>>,
                        {
                            data: string;
                            dataType: "string";
                            driverParam: string;
                            enumValues: undefined;
                            generated: undefined;
                            hasDefault: false;
                            hasRuntimeDefault: false;
                            identity: undefined;
                            isAutoincrement: false;
                            isPrimaryKey: false;
                            name: string;
                            notNull: true;
                            tableName: "wallet_account_transaction";
                        },
                    >;
                    tokenId: PgBuildColumn<
                        "wallet_account_transaction",
                        PgIntegerBuilder,
                        {
                            data: number;
                            dataType: "number int32";
                            driverParam: string
                            | number;
                            enumValues: undefined;
                            generated: undefined;
                            hasDefault: false;
                            hasRuntimeDefault: false;
                            identity: undefined;
                            isAutoincrement: false;
                            isPrimaryKey: false;
                            name: string;
                            notNull: false;
                            tableName: "wallet_account_transaction";
                        },
                    >;
                    walletAddressId: PgBuildColumn<
                        "wallet_account_transaction",
                        PgIntegerBuilder,
                        {
                            data: number;
                            dataType: "number int32";
                            driverParam: string
                            | number;
                            enumValues: undefined;
                            generated: undefined;
                            hasDefault: false;
                            hasRuntimeDefault: false;
                            identity: undefined;
                            isAutoincrement: false;
                            isPrimaryKey: false;
                            name: string;
                            notNull: false;
                            tableName: "wallet_account_transaction";
                        },
                    >;
                    walletTransactionId: PgBuildColumn<
                        "wallet_account_transaction",
                        SetNotNull<PgIntegerBuilder>,
                        {
                            data: number;
                            dataType: "number int32";
                            driverParam: string | number;
                            enumValues: undefined;
                            generated: undefined;
                            hasDefault: false;
                            hasRuntimeDefault: false;
                            identity: undefined;
                            isAutoincrement: false;
                            isPrimaryKey: false;
                            name: string;
                            notNull: true;
                            tableName: "wallet_account_transaction";
                        },
                    >;
                };
                dialect: "pg";
                isAlias: false;
                name: "wallet_account_transaction";
                schema: "b2b";
            },
        >,
        "enableRLS",
    > = ...

    One balance change per (account, transaction, mint), on any chain: solana_account_transaction with wallet_transaction in place of solana_transaction, and no ledger account or customer. The ledger accounts holding an address come through wallet_address → wallet → ledger_account, so a wallet several customers share is stored once. Balances are base units.

    Ingest contract, for any chain's pipeline. A row counts toward balances only when:

    • walletAddressId and tokenId are set: the address is one of ours, the mint a known token.
    • amount is the change in base units. postBalance, where the chain reports it, is the balance after; elsewhere readers run a sum of amount.
    • its wallet_transaction has block_time, and slot / index_within_block hold the chain's own ordering (EVM: block number, log index).

    mint is a token's contract address, or native for a chain's own coin.

    dbmate owns the DDL: 20261019165925_wallet_account_transaction.sql, then 20261023193347_wallet_transaction_network.sql.