casual-simulation / casualos

Casual Open Simulation for the Web
https://ab1.bot
MIT License
48 stars 9 forks source link

Implement `xpGetUserHeldContracts` procedure #507

Open KallynGowdy opened 1 month ago

KallynGowdy commented 1 month ago

Name: xpGetUserHeldContracts HTTP: GET /api/v2/xp/user/heldContracts Authentication: REQUIRED - sessionKey Input: none Operation: Get user held contracts by holdingUserId === sessionKey.userId. The returned information should be limited to the information specified below. Success Output:

{
    success: true,
    contracts: [
        {
            id: 'contract-id',
            issuerUserId: 'issuer-user-id',
            holdingUserId: 'holding-user-id',
            accountBalance: 123,
            accountCurrency: 'usd',
            accountEntries: [
                {
                    id: 'entry-id',
                    amount: 123,
                    balance: 456,
                    timeMs: 123,
                    transactionId: 'transaction-id',
                    note: 'string'
                }
            ],
            rate: 123,
            description: 'desc',
            status: 'open',
            accountId: 'account-id',
            createdAtMs: 123,
            updatedAtMs: 123,
        }
    ]
}