MCPcopy Create free account
hub / github.com/TraderAlice/OpenAlice / initialWallet

Function initialWallet

ui/src/components/uta/OrderEntryDialog.tsx:126–130  ·  view source on GitHub ↗

Initial wallet selection: the page's current scope if it names a real * wallet, else the first wallet. Empty when single-wallet (field is hidden).

(subAccounts?: SubAccountRef[], preferred?: string)

Source from the content-addressed store, hash-verified

124/** Initial wallet selection: the page's current scope if it names a real
125 * wallet, else the first wallet. Empty when single-wallet (field is hidden). */
126function initialWallet(subAccounts?: SubAccountRef[], preferred?: string): string {
127 if (!subAccounts || subAccounts.length <= 1) return ''
128 if (preferred && subAccounts.some(s => s.id === preferred)) return preferred
129 return subAccounts[0].id
130}
131
132function PlaceForm({ initialAliceId, ...p }: SharedFormProps & { initialAliceId?: string }) {
133 const [aliceId, setAliceId] = useState(initialAliceId ?? '')

Callers 2

PlaceFormFunction · 0.85
CloseFormFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected