4 User.buyStock Method
asdia edited this page 2021-01-06 22:49:22 +08:00
Class: User

Buys a stock using the user's account.

Parameters

Name Type Default Value Comment
Ticker string The stock's ticker
Amount number In credits
Price CreditAmount In credits

Returns

String
A string determining whether the transaction succeeded or failed.

Example

const user = new User('u-02c977bb-0a6c-4eb2-bfca-5e9101025aaf')
user.buyStock('VC', 1, 5)