refactor
This commit is contained in:
@@ -14,6 +14,7 @@
|
|||||||
"hono": "^4.8.3"
|
"hono": "^4.8.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "@repo/tsconfig/tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"types": ["bun"],
|
"types": ["bun"],
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
|
|||||||
@@ -24,6 +24,7 @@
|
|||||||
"zod": "^4.4.3"
|
"zod": "^4.4.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
"drizzle-kit": "^0.31.1",
|
"drizzle-kit": "^0.31.1",
|
||||||
"typescript": "^5"
|
"typescript": "^5"
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import { mkdirSync } from 'node:fs'
|
import { mkdirSync } from 'node:fs'
|
||||||
import { dirname, resolve } from 'node:path'
|
import { dirname, resolve } from 'node:path'
|
||||||
|
|
||||||
export type ServerConfig = {
|
export interface ServerConfig {
|
||||||
port: number
|
port: number
|
||||||
databasePath: string
|
databasePath: string
|
||||||
corsOrigin: string
|
corsOrigin: string
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
import type { ServerConfig } from './config'
|
import type { ServerConfig } from './config'
|
||||||
import type { Db } from './db'
|
import type { Db } from './db'
|
||||||
|
|
||||||
export type AppBindings = {
|
export interface AppBindings {
|
||||||
Variables: {
|
Variables: {
|
||||||
db: Db
|
db: Db
|
||||||
config: ServerConfig
|
config: ServerConfig
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ import {
|
|||||||
import { randomId } from '../security/crypto'
|
import { randomId } from '../security/crypto'
|
||||||
import { deleteSecret, saveSecret } from '../security/keyring'
|
import { deleteSecret, saveSecret } from '../security/keyring'
|
||||||
|
|
||||||
export type StoredSbiPasskeySecret = {
|
export interface StoredSbiPasskeySecret {
|
||||||
credential: PlaintextStoredWebAuthnCredential
|
credential: PlaintextStoredWebAuthnCredential
|
||||||
tradePassword?: string
|
tradePassword?: string
|
||||||
deviceId?: string
|
deviceId?: string
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ const requireAuthenticated = (auth: AuthContext) => {
|
|||||||
|
|
||||||
const ORDER_SUBMIT_TICKET_TTL_MS = 10 * 60 * 1000
|
const ORDER_SUBMIT_TICKET_TTL_MS = 10 * 60 * 1000
|
||||||
|
|
||||||
type OrderSubmitTicket = {
|
interface OrderSubmitTicket {
|
||||||
passkeyId: string
|
passkeyId: string
|
||||||
estimateMethod: RpcMethod
|
estimateMethod: RpcMethod
|
||||||
submitMethod: RpcMethod
|
submitMethod: RpcMethod
|
||||||
|
|||||||
@@ -11,14 +11,14 @@ import {
|
|||||||
import { invokeSbiMethod, isRpcMethod, isTradingMethod, RPC_METHODS } from './methods'
|
import { invokeSbiMethod, isRpcMethod, isTradingMethod, RPC_METHODS } from './methods'
|
||||||
import { connectSbi } from './sbi-session'
|
import { connectSbi } from './sbi-session'
|
||||||
|
|
||||||
type JsonRpcRequest = {
|
interface JsonRpcRequest {
|
||||||
jsonrpc?: '2.0'
|
jsonrpc?: '2.0'
|
||||||
id?: string | number | null
|
id?: string | number | null
|
||||||
method?: string
|
method?: string
|
||||||
params?: unknown
|
params?: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
type RpcSocketState = {
|
interface RpcSocketState {
|
||||||
client?: SbiClientMethods
|
client?: SbiClientMethods
|
||||||
sbiPasskeyId?: string
|
sbiPasskeyId?: string
|
||||||
apiKeyId?: string
|
apiKeyId?: string
|
||||||
@@ -26,7 +26,7 @@ type RpcSocketState = {
|
|||||||
boardPollingSubscriptions: Map<string, AbortController>
|
boardPollingSubscriptions: Map<string, AbortController>
|
||||||
}
|
}
|
||||||
|
|
||||||
type BoardPollingParams = {
|
interface BoardPollingParams {
|
||||||
issueCode: string
|
issueCode: string
|
||||||
market: MarketCode
|
market: MarketCode
|
||||||
intervalSeconds?: number
|
intervalSeconds?: number
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import type { Db } from '../db'
|
|||||||
import { apiKeys } from '../db/schema'
|
import { apiKeys } from '../db/schema'
|
||||||
import { randomId, randomToken, sha256 } from './crypto'
|
import { randomId, randomToken, sha256 } from './crypto'
|
||||||
|
|
||||||
export type ApiKeySettings = {
|
export interface ApiKeySettings {
|
||||||
maxTradesPerHour?: number | null
|
maxTradesPerHour?: number | null
|
||||||
maxTradesPer6Hours?: number | null
|
maxTradesPer6Hours?: number | null
|
||||||
maxTradesPerDay?: number | null
|
maxTradesPerDay?: number | null
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import type { RpcMethod } from '../rpc/methods'
|
|||||||
|
|
||||||
type WindowName = '1h' | '3h' | '1d'
|
type WindowName = '1h' | '3h' | '1d'
|
||||||
|
|
||||||
type TradeLimitInput = {
|
interface TradeLimitInput {
|
||||||
apiKeyId: string
|
apiKeyId: string
|
||||||
params: unknown
|
params: unknown
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "@repo/tsconfig/tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"types": ["bun"],
|
"types": ["bun"],
|
||||||
"rootDir": "src",
|
"rootDir": "src",
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
"vue-router": "^5.1.0"
|
"vue-router": "^5.1.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@tailwindcss/vite": "^4.3.1",
|
"@tailwindcss/vite": "^4.3.1",
|
||||||
"@types/d3": "^7.4.3",
|
"@types/d3": "^7.4.3",
|
||||||
"@vitejs/plugin-vue": "^6.0.7",
|
"@vitejs/plugin-vue": "^6.0.7",
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
export type AuthStatus = {
|
export interface AuthStatus {
|
||||||
configured: boolean
|
configured: boolean
|
||||||
authenticated: boolean
|
authenticated: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ApiKey = {
|
export interface ApiKey {
|
||||||
id: string
|
id: string
|
||||||
label: string
|
label: string
|
||||||
maxTradesPerHour?: number | null
|
maxTradesPerHour?: number | null
|
||||||
@@ -30,7 +30,7 @@ export type ApiKeySettings = Pick<
|
|||||||
| 'scopes'
|
| 'scopes'
|
||||||
>
|
>
|
||||||
|
|
||||||
export type SbiPasskey = {
|
export interface SbiPasskey {
|
||||||
id: string
|
id: string
|
||||||
label: string
|
label: string
|
||||||
createdAt: string
|
createdAt: string
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ArrowLeftRight, History, Settings, WalletCards } from 'lucide-vue-next'
|
|||||||
import type { Component } from 'vue'
|
import type { Component } from 'vue'
|
||||||
import type { RouteName } from '../router'
|
import type { RouteName } from '../router'
|
||||||
|
|
||||||
export type PageMeta = {
|
export interface PageMeta {
|
||||||
title: string
|
title: string
|
||||||
icon: Component
|
icon: Component
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ import { ref } from 'vue'
|
|||||||
import type { ApiKeySettings } from '../../api'
|
import type { ApiKeySettings } from '../../api'
|
||||||
import { defaultApiKeyPolicy } from '../auth/api-key-policy'
|
import { defaultApiKeyPolicy } from '../auth/api-key-policy'
|
||||||
|
|
||||||
export type OAuthApprovalState = {
|
export interface OAuthApprovalState {
|
||||||
active: boolean
|
active: boolean
|
||||||
clientId: string
|
clientId: string
|
||||||
clientName: string
|
clientName: string
|
||||||
|
|||||||
@@ -45,19 +45,19 @@ import { currency, currencyForMarket } from '../../utils/format'
|
|||||||
import RealtimePriceChart from './RealtimePriceChart.vue'
|
import RealtimePriceChart from './RealtimePriceChart.vue'
|
||||||
|
|
||||||
type StockInfoTab = 'detail' | 'holding'
|
type StockInfoTab = 'detail' | 'holding'
|
||||||
type CashOrderAccountTypeOption = {
|
interface CashOrderAccountTypeOption {
|
||||||
label: string
|
label: string
|
||||||
value: CashOrderAccountType
|
value: CashOrderAccountType
|
||||||
}
|
}
|
||||||
type CashOrderMarketOption = {
|
interface CashOrderMarketOption {
|
||||||
label: string
|
label: string
|
||||||
value: CashOrderMarket
|
value: CashOrderMarket
|
||||||
}
|
}
|
||||||
type CashOrderTermOption = {
|
interface CashOrderTermOption {
|
||||||
label: string
|
label: string
|
||||||
value: CashOrderTerm
|
value: CashOrderTerm
|
||||||
}
|
}
|
||||||
type CashOrderDateOption = {
|
interface CashOrderDateOption {
|
||||||
label: string
|
label: string
|
||||||
value: string
|
value: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ import type {
|
|||||||
import { currency } from '../../utils/format'
|
import { currency } from '../../utils/format'
|
||||||
|
|
||||||
export type RecordLike = Record<string, unknown>
|
export type RecordLike = Record<string, unknown>
|
||||||
type IssueLike = {
|
interface IssueLike {
|
||||||
code: string
|
code: string
|
||||||
market: string
|
market: string
|
||||||
name: string
|
name: string
|
||||||
|
|||||||
@@ -54,27 +54,27 @@ import {
|
|||||||
type RecordLike,
|
type RecordLike,
|
||||||
} from './trading-data'
|
} from './trading-data'
|
||||||
|
|
||||||
type RpcResolver = {
|
interface RpcResolver {
|
||||||
resolve: (value: unknown) => void
|
resolve: (value: unknown) => void
|
||||||
reject: (reason: Error) => void
|
reject: (reason: Error) => void
|
||||||
}
|
}
|
||||||
|
|
||||||
type CashOrderTermOption = {
|
interface CashOrderTermOption {
|
||||||
label: string
|
label: string
|
||||||
value: CashOrderTerm
|
value: CashOrderTerm
|
||||||
}
|
}
|
||||||
|
|
||||||
type CashOrderAccountTypeOption = {
|
interface CashOrderAccountTypeOption {
|
||||||
label: string
|
label: string
|
||||||
value: CashOrderAccountType
|
value: CashOrderAccountType
|
||||||
}
|
}
|
||||||
|
|
||||||
type CashOrderMarketOption = {
|
interface CashOrderMarketOption {
|
||||||
label: string
|
label: string
|
||||||
value: CashOrderMarket
|
value: CashOrderMarket
|
||||||
}
|
}
|
||||||
|
|
||||||
type CashOrderDateOption = {
|
interface CashOrderDateOption {
|
||||||
label: string
|
label: string
|
||||||
value: string
|
value: string
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -27,13 +27,13 @@ export type CashOrderTriggerZone = 'above' | 'below'
|
|||||||
export type ChartMode = 'line' | 'box'
|
export type ChartMode = 'line' | 'box'
|
||||||
export type ChartRange = '1D' | '3D' | '3M' | '1Y' | 'ALL'
|
export type ChartRange = '1D' | '3D' | '3M' | '1Y' | 'ALL'
|
||||||
|
|
||||||
export type RpcMessage = {
|
export interface RpcMessage {
|
||||||
id: number
|
id: number
|
||||||
method: string
|
method: string
|
||||||
params?: unknown
|
params?: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderPreview = {
|
export interface OrderPreview {
|
||||||
issue: {
|
issue: {
|
||||||
code: string
|
code: string
|
||||||
market: string
|
market: string
|
||||||
@@ -50,7 +50,7 @@ export type OrderPreview = {
|
|||||||
message?: string
|
message?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type JsonRpcResponse = {
|
export interface JsonRpcResponse {
|
||||||
id?: number
|
id?: number
|
||||||
method?: string
|
method?: string
|
||||||
params?: unknown
|
params?: unknown
|
||||||
@@ -60,7 +60,7 @@ export type JsonRpcResponse = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type RealtimePricePoint = {
|
export interface RealtimePricePoint {
|
||||||
at: string
|
at: string
|
||||||
price: number
|
price: number
|
||||||
open?: number
|
open?: number
|
||||||
@@ -70,12 +70,12 @@ export type RealtimePricePoint = {
|
|||||||
volume?: number | null
|
volume?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ChartNotice = {
|
export interface ChartNotice {
|
||||||
title: string
|
title: string
|
||||||
detail?: string
|
detail?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MarketIndex = {
|
export interface MarketIndex {
|
||||||
code?: string
|
code?: string
|
||||||
name: string
|
name: string
|
||||||
value: number | null
|
value: number | null
|
||||||
@@ -88,7 +88,7 @@ export type MarketIndex = {
|
|||||||
timestamp?: string
|
timestamp?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Stock = {
|
export interface Stock {
|
||||||
code: string
|
code: string
|
||||||
name: string
|
name: string
|
||||||
symbol: string
|
symbol: string
|
||||||
@@ -115,7 +115,7 @@ export type Stock = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderRow = {
|
export interface OrderRow {
|
||||||
id: string
|
id: string
|
||||||
code: string
|
code: string
|
||||||
date: string
|
date: string
|
||||||
@@ -143,7 +143,7 @@ export type OrderDetail = OrderRow & {
|
|||||||
accountInformation?: string
|
accountInformation?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TradeRecordRow = {
|
export interface TradeRecordRow {
|
||||||
id: string
|
id: string
|
||||||
code: string
|
code: string
|
||||||
stock: string
|
stock: string
|
||||||
@@ -158,7 +158,7 @@ export type TradeRecordRow = {
|
|||||||
settlementCurrencyCode?: string
|
settlementCurrencyCode?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Position = {
|
export interface Position {
|
||||||
code: string
|
code: string
|
||||||
name: string
|
name: string
|
||||||
market: string
|
market: string
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "@repo/tsconfig/tsconfig.json",
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
"lib": ["ESNext", "DOM", "DOM.Iterable"],
|
||||||
"types": ["vite/client"],
|
"types": ["vite/client"],
|
||||||
|
|||||||
@@ -5,6 +5,7 @@
|
|||||||
"": {
|
"": {
|
||||||
"name": "csbi",
|
"name": "csbi",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
"vite-plus": "^0.1.24",
|
"vite-plus": "^0.1.24",
|
||||||
},
|
},
|
||||||
@@ -19,6 +20,7 @@
|
|||||||
"hono": "^4.8.3",
|
"hono": "^4.8.3",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
"typescript": "^5",
|
"typescript": "^5",
|
||||||
},
|
},
|
||||||
@@ -36,6 +38,7 @@
|
|||||||
"zod": "^4.4.3",
|
"zod": "^4.4.3",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
"drizzle-kit": "^0.31.1",
|
"drizzle-kit": "^0.31.1",
|
||||||
"typescript": "^5",
|
"typescript": "^5",
|
||||||
@@ -54,6 +57,7 @@
|
|||||||
"vue-router": "^5.1.0",
|
"vue-router": "^5.1.0",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@tailwindcss/vite": "^4.3.1",
|
"@tailwindcss/vite": "^4.3.1",
|
||||||
"@types/d3": "^7.4.3",
|
"@types/d3": "^7.4.3",
|
||||||
"@vitejs/plugin-vue": "^6.0.7",
|
"@vitejs/plugin-vue": "^6.0.7",
|
||||||
@@ -68,6 +72,7 @@
|
|||||||
"iconv-lite": "^0.7.2",
|
"iconv-lite": "^0.7.2",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
@@ -77,13 +82,14 @@
|
|||||||
"packages/mnie-cli": {
|
"packages/mnie-cli": {
|
||||||
"name": "@repo/mnie-cli",
|
"name": "@repo/mnie-cli",
|
||||||
"bin": {
|
"bin": {
|
||||||
"mnie": "./src/index.ts",
|
"mnie": "./dist/index.mjs",
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@napi-rs/keyring": "^1.2.0",
|
"@napi-rs/keyring": "^1.2.0",
|
||||||
"@repo/mnie-sdk": "workspace:*",
|
"@repo/mnie-sdk": "workspace:*",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
@@ -96,6 +102,7 @@
|
|||||||
"@repo/mnie-types": "workspace:*",
|
"@repo/mnie-types": "workspace:*",
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
@@ -105,12 +112,17 @@
|
|||||||
"packages/mnie-types": {
|
"packages/mnie-types": {
|
||||||
"name": "@repo/mnie-types",
|
"name": "@repo/mnie-types",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
"typescript": "^5",
|
"typescript": "^5",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
"packages/tsconfig": {
|
||||||
|
"name": "@repo/tsconfig",
|
||||||
|
"version": "0.0.0",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
"packages": {
|
"packages": {
|
||||||
"@babel/generator": ["@babel/[email protected]", "", { "dependencies": { "@babel/parser": "^8.0.0", "@babel/types": "^8.0.0", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "@types/jsesc": "^2.5.0", "jsesc": "^3.0.2" } }, "sha512-NT9NrVwJsbSV6Y2FSstWa71EETOnzrjkL5/wX3D2mYHtKM+qvqB1DvR4D0Setb/gDBsHzRICifwEWMO8CnTF6g=="],
|
"@babel/generator": ["@babel/[email protected]", "", { "dependencies": { "@babel/parser": "^8.0.0", "@babel/types": "^8.0.0", "@jridgewell/gen-mapping": "^0.3.12", "@jridgewell/trace-mapping": "^0.3.28", "@types/jsesc": "^2.5.0", "jsesc": "^3.0.2" } }, "sha512-NT9NrVwJsbSV6Y2FSstWa71EETOnzrjkL5/wX3D2mYHtKM+qvqB1DvR4D0Setb/gDBsHzRICifwEWMO8CnTF6g=="],
|
||||||
@@ -371,6 +383,8 @@
|
|||||||
|
|
||||||
"@repo/mnie-ui": ["@repo/mnie-ui@workspace:apps/mnie-ui"],
|
"@repo/mnie-ui": ["@repo/mnie-ui@workspace:apps/mnie-ui"],
|
||||||
|
|
||||||
|
"@repo/tsconfig": ["@repo/tsconfig@workspace:packages/tsconfig"],
|
||||||
|
|
||||||
"@rolldown/binding-android-arm64": ["@rolldown/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw=="],
|
"@rolldown/binding-android-arm64": ["@rolldown/[email protected]", "", { "os": "android", "cpu": "arm64" }, "sha512-454rs7jHngixp/NMxd5srYD57OnzSlZ/eFTETjORQHLwJG1lRtmNOJcBerZlfu4GjKqeq8aCCIQrMdHyhI51Hw=="],
|
||||||
|
|
||||||
"@rolldown/binding-darwin-arm64": ["@rolldown/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA=="],
|
"@rolldown/binding-darwin-arm64": ["@rolldown/[email protected]", "", { "os": "darwin", "cpu": "arm64" }, "sha512-PcAhP+ynjURNyy8SKGl5DQP94aGuB/7JrXJb/t7P+hanXvQVMWzUvRRhBAcg/lNRadBhoUPqSoP4xw5tR/KBEA=="],
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
"typecheck": "vp run typecheck:all"
|
"typecheck": "vp run typecheck:all"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest",
|
"@types/bun": "latest",
|
||||||
"vite-plus": "^0.1.24"
|
"vite-plus": "^0.1.24"
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -20,6 +20,7 @@
|
|||||||
"iconv-lite": "^0.7.2"
|
"iconv-lite": "^0.7.2"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest"
|
"@types/bun": "latest"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -99,7 +99,7 @@ export const SBI_SERVER_ERROR_MESSAGES: Record<string, string> = {
|
|||||||
E_0083: 'An error occurred. Wait a while and try again.',
|
E_0083: 'An error occurred. Wait a while and try again.',
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiServerErrorOptions = {
|
export interface SbiServerErrorOptions {
|
||||||
code: string
|
code: string
|
||||||
status?: string
|
status?: string
|
||||||
serverMessage?: string
|
serverMessage?: string
|
||||||
|
|||||||
@@ -125,7 +125,7 @@ const CHART_DEFAULT_UNITS = {
|
|||||||
} as const satisfies Record<ChartPeriod, number>
|
} as const satisfies Record<ChartPeriod, number>
|
||||||
const CHART_MINUTE_UNITS = new Set([1, 5, 10, 15])
|
const CHART_MINUTE_UNITS = new Set([1, 5, 10, 15])
|
||||||
|
|
||||||
type MtsHeader = {
|
interface MtsHeader {
|
||||||
sessionId: string
|
sessionId: string
|
||||||
trCode: string
|
trCode: string
|
||||||
resultCode: string
|
resultCode: string
|
||||||
@@ -134,7 +134,7 @@ type MtsHeader = {
|
|||||||
maintenance: string
|
maintenance: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type MtsResponse = {
|
interface MtsResponse {
|
||||||
status: number
|
status: number
|
||||||
requestUrl: string
|
requestUrl: string
|
||||||
header: MtsHeader
|
header: MtsHeader
|
||||||
@@ -142,14 +142,14 @@ type MtsResponse = {
|
|||||||
text: string
|
text: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type FixedField = {
|
interface FixedField {
|
||||||
width: number
|
width: number
|
||||||
value?: string | number | null
|
value?: string | number | null
|
||||||
align?: 'left' | 'right'
|
align?: 'left' | 'right'
|
||||||
pad?: string
|
pad?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type OrderPreviewInput = {
|
interface OrderPreviewInput {
|
||||||
issueCode: string
|
issueCode: string
|
||||||
market?: MarketCode
|
market?: MarketCode
|
||||||
side: TradeSide
|
side: TradeSide
|
||||||
@@ -157,7 +157,7 @@ type OrderPreviewInput = {
|
|||||||
price?: number
|
price?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
type CashPreOrderInfo = {
|
interface CashPreOrderInfo {
|
||||||
issueCode?: string
|
issueCode?: string
|
||||||
market?: string
|
market?: string
|
||||||
issueName?: string
|
issueName?: string
|
||||||
@@ -170,7 +170,7 @@ const cashCorrectionPreviewInput = {
|
|||||||
|
|
||||||
type TradeAuthenticationStatus = 'success' | 'needDial' | 'excessivelyRequested' | 'unexpected'
|
type TradeAuthenticationStatus = 'success' | 'needDial' | 'excessivelyRequested' | 'unexpected'
|
||||||
|
|
||||||
type TradeAuthenticationInfo = {
|
interface TradeAuthenticationInfo {
|
||||||
status: TradeAuthenticationStatus
|
status: TradeAuthenticationStatus
|
||||||
statusCode: string
|
statusCode: string
|
||||||
telNo?: string
|
telNo?: string
|
||||||
@@ -258,7 +258,7 @@ const publicDomesticMarket = (market: string | undefined, methodName: string) =>
|
|||||||
return publicMarket
|
return publicMarket
|
||||||
}
|
}
|
||||||
|
|
||||||
type IzanagiIssueSearchItem = {
|
interface IzanagiIssueSearchItem {
|
||||||
stockName?: string | null
|
stockName?: string | null
|
||||||
stockCode?: string | null
|
stockCode?: string | null
|
||||||
mkt?: string | null
|
mkt?: string | null
|
||||||
@@ -269,7 +269,7 @@ type IzanagiIssueSearchItem = {
|
|||||||
hitString?: string | null
|
hitString?: string | null
|
||||||
}
|
}
|
||||||
|
|
||||||
type IzanagiIssueSearchResponse = {
|
interface IzanagiIssueSearchResponse {
|
||||||
status?: string | null
|
status?: string | null
|
||||||
stocks?: IzanagiIssueSearchItem[] | null
|
stocks?: IzanagiIssueSearchItem[] | null
|
||||||
}
|
}
|
||||||
@@ -4100,7 +4100,7 @@ const isCashPreOrderInput = (
|
|||||||
options: StockOrderPreOrderInput,
|
options: StockOrderPreOrderInput,
|
||||||
): options is CashOrderOptions | CashOrderPreOrderOptions => 'kind' in options
|
): options is CashOrderOptions | CashOrderPreOrderOptions => 'kind' in options
|
||||||
|
|
||||||
type AppStockOrderTrinOptions = {
|
interface AppStockOrderTrinOptions {
|
||||||
issueCode: string
|
issueCode: string
|
||||||
market: string
|
market: string
|
||||||
quantity: number
|
quantity: number
|
||||||
@@ -4122,7 +4122,7 @@ type AppStockOrderTrinOptions = {
|
|||||||
methodName: string
|
methodName: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type OmitConfirmationOption = {
|
interface OmitConfirmationOption {
|
||||||
omitConfirmation?: boolean
|
omitConfirmation?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -24,24 +24,24 @@ import type {
|
|||||||
} from '../types'
|
} from '../types'
|
||||||
import type { SbiClientMethods } from '../methods/types'
|
import type { SbiClientMethods } from '../methods/types'
|
||||||
|
|
||||||
type PasskeyLoginStart = {
|
interface PasskeyLoginStart {
|
||||||
url: string
|
url: string
|
||||||
privateKeyPem: string
|
privateKeyPem: string
|
||||||
publicKey: string
|
publicKey: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type PasskeyAccessToken = {
|
interface PasskeyAccessToken {
|
||||||
callbackUrl: string
|
callbackUrl: string
|
||||||
accessToken: string
|
accessToken: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type CredentialRequest = {
|
interface CredentialRequest {
|
||||||
challenge: string
|
challenge: string
|
||||||
rpId: string
|
rpId: string
|
||||||
csrfToken?: string
|
csrfToken?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type SbiEndpointConfig = {
|
interface SbiEndpointConfig {
|
||||||
authBaseUrl: string
|
authBaseUrl: string
|
||||||
mtsBaseUrl: string
|
mtsBaseUrl: string
|
||||||
izanagiBaseUrl?: string
|
izanagiBaseUrl?: string
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export type WebAuthnUserVerification = 'required' | 'preferred' | 'discouraged'
|
|||||||
|
|
||||||
export type WebAuthnTransport = 'ble' | 'hybrid' | 'internal' | 'nfc' | 'usb'
|
export type WebAuthnTransport = 'ble' | 'hybrid' | 'internal' | 'nfc' | 'usb'
|
||||||
|
|
||||||
export type WebAuthnJwk = {
|
export interface WebAuthnJwk {
|
||||||
kty: string
|
kty: string
|
||||||
crv?: string
|
crv?: string
|
||||||
x?: string
|
x?: string
|
||||||
@@ -17,7 +17,7 @@ export type WebAuthnJwk = {
|
|||||||
[key: string]: unknown
|
[key: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StoredWebAuthnCredentialSecret = {
|
export interface StoredWebAuthnCredentialSecret {
|
||||||
privateKey: {
|
privateKey: {
|
||||||
format: 'jwk'
|
format: 'jwk'
|
||||||
jwk: WebAuthnJwk
|
jwk: WebAuthnJwk
|
||||||
@@ -29,7 +29,7 @@ export type StoredWebAuthnCredentialSecret = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StoredWebAuthnCredential = {
|
export interface StoredWebAuthnCredential {
|
||||||
version: 1
|
version: 1
|
||||||
kind: 'webauthn-credential'
|
kind: 'webauthn-credential'
|
||||||
provider: 'sbi-sec'
|
provider: 'sbi-sec'
|
||||||
@@ -76,7 +76,7 @@ export type PlaintextStoredWebAuthnCredential = Omit<StoredWebAuthnCredential, '
|
|||||||
secretPlaintext: StoredWebAuthnCredentialSecret
|
secretPlaintext: StoredWebAuthnCredentialSecret
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PasskeyLoginResponse = {
|
export interface PasskeyLoginResponse {
|
||||||
type: 'passkey-login-response'
|
type: 'passkey-login-response'
|
||||||
requestUrl: string
|
requestUrl: string
|
||||||
status: number
|
status: number
|
||||||
@@ -90,7 +90,7 @@ export type PasskeyLoginResponse = {
|
|||||||
} | null
|
} | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ForeignStockEndpointConfig = {
|
export interface ForeignStockEndpointConfig {
|
||||||
baseUrl?: string
|
baseUrl?: string
|
||||||
restUrl: string
|
restUrl: string
|
||||||
graphqlBffUrl: string
|
graphqlBffUrl: string
|
||||||
@@ -98,7 +98,7 @@ export type ForeignStockEndpointConfig = {
|
|||||||
userAgent?: string
|
userAgent?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ForeignStockSession = {
|
export interface ForeignStockSession {
|
||||||
endpoints: ForeignStockEndpointConfig
|
endpoints: ForeignStockEndpointConfig
|
||||||
ssoToken?: string
|
ssoToken?: string
|
||||||
sessionId?: string
|
sessionId?: string
|
||||||
@@ -108,14 +108,14 @@ export type ForeignStockSession = {
|
|||||||
loginAuthenticated?: boolean
|
loginAuthenticated?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MainSiteAuthCache = {
|
export interface MainSiteAuthCache {
|
||||||
baseUrl: string
|
baseUrl: string
|
||||||
assetsUrl: string
|
assetsUrl: string
|
||||||
cookieHeader: string
|
cookieHeader: string
|
||||||
authenticatedAt: string
|
authenticatedAt: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MainSiteSession = {
|
export interface MainSiteSession {
|
||||||
baseUrl?: string
|
baseUrl?: string
|
||||||
etGatePath?: string
|
etGatePath?: string
|
||||||
assetsValuationsPath?: string
|
assetsValuationsPath?: string
|
||||||
@@ -127,7 +127,7 @@ export type MainSiteSession = {
|
|||||||
authPromise?: Promise<MainSiteAuthCache>
|
authPromise?: Promise<MainSiteAuthCache>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiSession = {
|
export interface SbiSession {
|
||||||
mtsBaseUrl: string
|
mtsBaseUrl: string
|
||||||
izanagiBaseUrl?: string
|
izanagiBaseUrl?: string
|
||||||
foreignStock?: ForeignStockSession
|
foreignStock?: ForeignStockSession
|
||||||
@@ -139,7 +139,7 @@ export type SbiSession = {
|
|||||||
tradeAuthentication?: SbiTradeAuthenticationOptions
|
tradeAuthentication?: SbiTradeAuthenticationOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
export type LoginWithPasskeyOptions = {
|
export interface LoginWithPasskeyOptions {
|
||||||
passkeyCredential: PlaintextStoredWebAuthnCredential
|
passkeyCredential: PlaintextStoredWebAuthnCredential
|
||||||
authBaseUrl?: string
|
authBaseUrl?: string
|
||||||
mtsBaseUrl?: string
|
mtsBaseUrl?: string
|
||||||
@@ -159,13 +159,13 @@ export type LoginWithPasskeyOptions = {
|
|||||||
mainSiteExchangeOrderCompletePath?: string
|
mainSiteExchangeOrderCompletePath?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiClientOptions = {
|
export interface SbiClientOptions {
|
||||||
tradePassword?: string
|
tradePassword?: string
|
||||||
deviceId?: string
|
deviceId?: string
|
||||||
tradeAuthentication?: SbiTradeAuthenticationOptions
|
tradeAuthentication?: SbiTradeAuthenticationOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiTradeAuthenticationRequest = {
|
export interface SbiTradeAuthenticationRequest {
|
||||||
type: 'phone'
|
type: 'phone'
|
||||||
telNo?: string
|
telNo?: string
|
||||||
phoneNo?: string
|
phoneNo?: string
|
||||||
@@ -173,7 +173,7 @@ export type SbiTradeAuthenticationRequest = {
|
|||||||
authLimitTime?: string
|
authLimitTime?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiTradeAuthenticationOptions = {
|
export interface SbiTradeAuthenticationOptions {
|
||||||
onRequired?: (request: SbiTradeAuthenticationRequest) => void | Promise<void>
|
onRequired?: (request: SbiTradeAuthenticationRequest) => void | Promise<void>
|
||||||
confirmAttempts?: number
|
confirmAttempts?: number
|
||||||
confirmIntervalMs?: number
|
confirmIntervalMs?: number
|
||||||
@@ -189,24 +189,24 @@ export type WatchlistId = string
|
|||||||
export type PositionId = string
|
export type PositionId = string
|
||||||
export type ThemeId = string
|
export type ThemeId = string
|
||||||
|
|
||||||
export type CurrencyAmount = {
|
export interface CurrencyAmount {
|
||||||
value: number | null
|
value: number | null
|
||||||
text: string
|
text: string
|
||||||
currency: 'JPY' | 'USD'
|
currency: 'JPY' | 'USD'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PercentValue = {
|
export interface PercentValue {
|
||||||
value: number | null
|
value: number | null
|
||||||
text: string
|
text: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SignedTextValue = {
|
export interface SignedTextValue {
|
||||||
value: number | null
|
value: number | null
|
||||||
text: string
|
text: string
|
||||||
sign?: 'positive' | 'negative' | 'zero'
|
sign?: 'positive' | 'negative' | 'zero'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AccountAssetsValuationSummary = {
|
export interface AccountAssetsValuationSummary {
|
||||||
assetsErrorType: unknown
|
assetsErrorType: unknown
|
||||||
valuation: number | null
|
valuation: number | null
|
||||||
netChange: number | null
|
netChange: number | null
|
||||||
@@ -223,7 +223,7 @@ export type AccountAssetsValuationDetail = AccountAssetsValuationSummary & {
|
|||||||
compositionRatio: number | null
|
compositionRatio: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AccountAssetsValuations = {
|
export interface AccountAssetsValuations {
|
||||||
fetchedAt: string
|
fetchedAt: string
|
||||||
summary: AccountAssetsValuationSummary
|
summary: AccountAssetsValuationSummary
|
||||||
summaryWithoutDeposit: AccountAssetsValuationSummary
|
summaryWithoutDeposit: AccountAssetsValuationSummary
|
||||||
@@ -276,7 +276,7 @@ export type IsaAccountType =
|
|||||||
| 'nisaTradePermitted'
|
| 'nisaTradePermitted'
|
||||||
| 'unknown'
|
| 'unknown'
|
||||||
|
|
||||||
export type IssueRef = {
|
export interface IssueRef {
|
||||||
code: IssueCode
|
code: IssueCode
|
||||||
market?: MarketCode
|
market?: MarketCode
|
||||||
name?: string
|
name?: string
|
||||||
@@ -292,7 +292,7 @@ export type IssueSearchItem = IssueRef & {
|
|||||||
|
|
||||||
export type IssueSearchStatus = 'success' | 'searchError' | 'tooManyResults' | 'unknown'
|
export type IssueSearchStatus = 'success' | 'searchError' | 'tooManyResults' | 'unknown'
|
||||||
|
|
||||||
export type IssueSearchResult = {
|
export interface IssueSearchResult {
|
||||||
status?: string
|
status?: string
|
||||||
statusText: IssueSearchStatus
|
statusText: IssueSearchStatus
|
||||||
issues: IssueSearchItem[]
|
issues: IssueSearchItem[]
|
||||||
@@ -300,7 +300,7 @@ export type IssueSearchResult = {
|
|||||||
|
|
||||||
export type ChartPeriod = 'minute' | 'day' | 'week' | 'month'
|
export type ChartPeriod = 'minute' | 'day' | 'week' | 'month'
|
||||||
|
|
||||||
export type ChartPrice = {
|
export interface ChartPrice {
|
||||||
dateTime: string
|
dateTime: string
|
||||||
open: CurrencyAmount
|
open: CurrencyAmount
|
||||||
high: CurrencyAmount
|
high: CurrencyAmount
|
||||||
@@ -309,7 +309,7 @@ export type ChartPrice = {
|
|||||||
volume?: number | null
|
volume?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IssueChart = {
|
export interface IssueChart {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
period: ChartPeriod
|
period: ChartPeriod
|
||||||
unit: number
|
unit: number
|
||||||
@@ -322,13 +322,13 @@ export type IssueChart = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SessionInfo = {
|
export interface SessionInfo {
|
||||||
sessionId: string
|
sessionId: string
|
||||||
loginType: LoginType
|
loginType: LoginType
|
||||||
resultCode: string
|
resultCode: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AccountProfile = {
|
export interface AccountProfile {
|
||||||
session: SessionInfo
|
session: SessionInfo
|
||||||
branchCode?: string
|
branchCode?: string
|
||||||
butenCode?: string
|
butenCode?: string
|
||||||
@@ -391,7 +391,7 @@ export type AccountProfile = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type BuyingPower = {
|
export interface BuyingPower {
|
||||||
cashBuyingPower?: CurrencyAmount
|
cashBuyingPower?: CurrencyAmount
|
||||||
marginBuyingPower?: CurrencyAmount
|
marginBuyingPower?: CurrencyAmount
|
||||||
withdrawableAmount?: CurrencyAmount
|
withdrawableAmount?: CurrencyAmount
|
||||||
@@ -403,7 +403,7 @@ export type BuyingPower = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CollateralRatioRecord = {
|
export interface CollateralRatioRecord {
|
||||||
marginRequirements?: CurrencyAmount
|
marginRequirements?: CurrencyAmount
|
||||||
referenceMarginRequirements?: CurrencyAmount
|
referenceMarginRequirements?: CurrencyAmount
|
||||||
collateralRatioCash?: CurrencyAmount
|
collateralRatioCash?: CurrencyAmount
|
||||||
@@ -420,7 +420,7 @@ export type CollateralRatioRecord = {
|
|||||||
minimumCollateral?: CurrencyAmount
|
minimumCollateral?: CurrencyAmount
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CashPosition = {
|
export interface CashPosition {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
accountType?: AccountType
|
accountType?: AccountType
|
||||||
depositType?: DepositType
|
depositType?: DepositType
|
||||||
@@ -449,7 +449,7 @@ export type CashPosition = {
|
|||||||
accountInformation?: string
|
accountInformation?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CashPositionList = {
|
export interface CashPositionList {
|
||||||
positions: CashPosition[]
|
positions: CashPosition[]
|
||||||
index?: number
|
index?: number
|
||||||
totalCount?: number
|
totalCount?: number
|
||||||
@@ -461,7 +461,7 @@ export type CashPositionList = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MarginPosition = {
|
export interface MarginPosition {
|
||||||
id?: PositionId
|
id?: PositionId
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
side: MarginTradeSide
|
side: MarginTradeSide
|
||||||
@@ -503,7 +503,7 @@ export type MarginPosition = {
|
|||||||
bargainMarket?: string
|
bargainMarket?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MarginPositionList = {
|
export interface MarginPositionList {
|
||||||
positions: MarginPosition[]
|
positions: MarginPosition[]
|
||||||
index?: number
|
index?: number
|
||||||
totalCount?: number
|
totalCount?: number
|
||||||
@@ -515,7 +515,7 @@ export type MarginPositionList = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProfitLossSummary = {
|
export interface ProfitLossSummary {
|
||||||
cash?: SignedTextValue
|
cash?: SignedTextValue
|
||||||
margin?: SignedTextValue
|
margin?: SignedTextValue
|
||||||
total?: SignedTextValue
|
total?: SignedTextValue
|
||||||
@@ -523,7 +523,7 @@ export type ProfitLossSummary = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Quote = {
|
export interface Quote {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
price?: CurrencyAmount
|
price?: CurrencyAmount
|
||||||
change?: SignedTextValue
|
change?: SignedTextValue
|
||||||
@@ -539,12 +539,12 @@ export type Quote = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type BoardPriceLevel = {
|
export interface BoardPriceLevel {
|
||||||
price: CurrencyAmount
|
price: CurrencyAmount
|
||||||
quantity?: number | null
|
quantity?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Board = {
|
export interface Board {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
bids: BoardPriceLevel[]
|
bids: BoardPriceLevel[]
|
||||||
asks: BoardPriceLevel[]
|
asks: BoardPriceLevel[]
|
||||||
@@ -552,7 +552,7 @@ export type Board = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MarketIndex = {
|
export interface MarketIndex {
|
||||||
code?: string
|
code?: string
|
||||||
categoryCode?: string
|
categoryCode?: string
|
||||||
name: string
|
name: string
|
||||||
@@ -568,13 +568,13 @@ export type MarketIndex = {
|
|||||||
previousClose?: CurrencyAmount
|
previousClose?: CurrencyAmount
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DomesticMarket = {
|
export interface DomesticMarket {
|
||||||
status?: string
|
status?: string
|
||||||
indexes: MarketIndex[]
|
indexes: MarketIndex[]
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type RankingItem = {
|
export interface RankingItem {
|
||||||
rank: number
|
rank: number
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
value?: number | string | null
|
value?: number | string | null
|
||||||
@@ -585,14 +585,14 @@ export type RankingItem = {
|
|||||||
colorFlag?: string
|
colorFlag?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Ranking = {
|
export interface Ranking {
|
||||||
items: RankingItem[]
|
items: RankingItem[]
|
||||||
category?: string
|
category?: string
|
||||||
updatedAt?: string
|
updatedAt?: string
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NewsItem = {
|
export interface NewsItem {
|
||||||
id?: string
|
id?: string
|
||||||
title: string
|
title: string
|
||||||
source?: string
|
source?: string
|
||||||
@@ -606,26 +606,26 @@ export type NewsItem = {
|
|||||||
pnac?: string
|
pnac?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NewsList = {
|
export interface NewsList {
|
||||||
items: NewsItem[]
|
items: NewsItem[]
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type WatchlistItem = {
|
export interface WatchlistItem {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
sortOrder?: number
|
sortOrder?: number
|
||||||
memo?: string
|
memo?: string
|
||||||
quote?: Quote
|
quote?: Quote
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Watchlist = {
|
export interface Watchlist {
|
||||||
id: WatchlistId
|
id: WatchlistId
|
||||||
name: string
|
name: string
|
||||||
items: WatchlistItem[]
|
items: WatchlistItem[]
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Order = {
|
export interface Order {
|
||||||
id: OrderId
|
id: OrderId
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
side: TradeSide
|
side: TradeSide
|
||||||
@@ -655,13 +655,13 @@ export type Order = {
|
|||||||
correctable?: boolean
|
correctable?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderList = {
|
export interface OrderList {
|
||||||
orders: Order[]
|
orders: Order[]
|
||||||
hasMore?: boolean
|
hasMore?: boolean
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TradeRecord = {
|
export interface TradeRecord {
|
||||||
id: string
|
id: string
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
tradeRecordTypeCode?: string
|
tradeRecordTypeCode?: string
|
||||||
@@ -678,13 +678,13 @@ export type TradeRecord = {
|
|||||||
marginCloseLimitType?: string
|
marginCloseLimitType?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TradeRecordList = {
|
export interface TradeRecordList {
|
||||||
records: TradeRecord[]
|
records: TradeRecord[]
|
||||||
hasMore?: boolean
|
hasMore?: boolean
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderCorrectionPreOrderDetail = {
|
export interface OrderCorrectionPreOrderDetail {
|
||||||
exchangeName?: string
|
exchangeName?: string
|
||||||
marketLoanKbn?: string
|
marketLoanKbn?: string
|
||||||
marketIppanLoanKbn?: string
|
marketIppanLoanKbn?: string
|
||||||
@@ -697,7 +697,7 @@ export type OrderCorrectionPreOrderDetail = {
|
|||||||
volumeText?: string
|
volumeText?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderCorrectionPreOrder = {
|
export interface OrderCorrectionPreOrder {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
tradeTitle?: string
|
tradeTitle?: string
|
||||||
buyingPowerTotal?: CurrencyAmount
|
buyingPowerTotal?: CurrencyAmount
|
||||||
@@ -753,7 +753,7 @@ export type OrderCorrectionPreOrder = {
|
|||||||
exchangeList?: string
|
exchangeList?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderPreview = {
|
export interface OrderPreview {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
side: TradeSide
|
side: TradeSide
|
||||||
quantity?: number
|
quantity?: number
|
||||||
@@ -768,12 +768,12 @@ export type OrderPreview = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockOrderPreOrderPriceStep = {
|
export interface StockOrderPreOrderPriceStep {
|
||||||
from?: CurrencyAmount
|
from?: CurrencyAmount
|
||||||
to?: CurrencyAmount
|
to?: CurrencyAmount
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockOrderPreOrderPaymentLimit = {
|
export interface StockOrderPreOrderPaymentLimit {
|
||||||
text?: string
|
text?: string
|
||||||
code?: string
|
code?: string
|
||||||
}
|
}
|
||||||
@@ -787,7 +787,7 @@ export type StockOrderPreOrderMarginTradeType =
|
|||||||
| 'day'
|
| 'day'
|
||||||
| 'hyper'
|
| 'hyper'
|
||||||
|
|
||||||
export type StockOrderPreOrder = {
|
export interface StockOrderPreOrder {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
tradeTitle?: string
|
tradeTitle?: string
|
||||||
buyingPowerTotal?: CurrencyAmount
|
buyingPowerTotal?: CurrencyAmount
|
||||||
@@ -850,7 +850,7 @@ export type StockOrderPreOrder = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderReceipt = {
|
export interface OrderReceipt {
|
||||||
accepted: boolean
|
accepted: boolean
|
||||||
orderId?: OrderId
|
orderId?: OrderId
|
||||||
acceptedAt?: string
|
acceptedAt?: string
|
||||||
@@ -863,7 +863,7 @@ export type ExchangeSpecificMethod = 'foreign' | 'domestic'
|
|||||||
export type ExchangeAccountKind = 'GENERAL' | 'JR_NISA'
|
export type ExchangeAccountKind = 'GENERAL' | 'JR_NISA'
|
||||||
export type ExchangeSellMethod = 'SELL_PART' | 'SELL_ALL'
|
export type ExchangeSellMethod = 'SELL_PART' | 'SELL_ALL'
|
||||||
|
|
||||||
export type ExchangeOrderPreview = {
|
export interface ExchangeOrderPreview {
|
||||||
currencyCode: string
|
currencyCode: string
|
||||||
currencyName?: string
|
currencyName?: string
|
||||||
side: ExchangeOrderSide
|
side: ExchangeOrderSide
|
||||||
@@ -882,7 +882,7 @@ export type ExchangeOrderPreview = {
|
|||||||
csrfToken: string
|
csrfToken: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ExchangeOrderReceipt = {
|
export interface ExchangeOrderReceipt {
|
||||||
accepted: boolean
|
accepted: boolean
|
||||||
currencyCode?: string
|
currencyCode?: string
|
||||||
side?: ExchangeOrderSide
|
side?: ExchangeOrderSide
|
||||||
@@ -891,7 +891,7 @@ export type ExchangeOrderReceipt = {
|
|||||||
rawTitle?: string
|
rawTitle?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ExchangeRateInfo = {
|
export interface ExchangeRateInfo {
|
||||||
currencyCode: string
|
currencyCode: string
|
||||||
side: ExchangeOrderSide
|
side: ExchangeOrderSide
|
||||||
referenceExchangeRate?: string
|
referenceExchangeRate?: string
|
||||||
@@ -910,7 +910,7 @@ export type ExchangeRateInfo = {
|
|||||||
raw: Record<string, unknown>
|
raw: Record<string, unknown>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThemeInvestment = {
|
export interface ThemeInvestment {
|
||||||
id: ThemeId
|
id: ThemeId
|
||||||
name: string
|
name: string
|
||||||
issues: ThemeInvestmentIssue[]
|
issues: ThemeInvestmentIssue[]
|
||||||
@@ -933,7 +933,7 @@ export type ThemeInvestmentIssue = IssueRef & {
|
|||||||
tradeTime?: string
|
tradeTime?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThemeInvestmentList = {
|
export interface ThemeInvestmentList {
|
||||||
themes: ThemeInvestment[]
|
themes: ThemeInvestment[]
|
||||||
buyingPowerTotal?: CurrencyAmount
|
buyingPowerTotal?: CurrencyAmount
|
||||||
isaBuyLimit?: CurrencyAmount
|
isaBuyLimit?: CurrencyAmount
|
||||||
@@ -944,7 +944,7 @@ export type ThemeInvestmentList = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiMethodError = {
|
export interface SbiMethodError {
|
||||||
status?: string
|
status?: string
|
||||||
code?: string
|
code?: string
|
||||||
message?: string
|
message?: string
|
||||||
|
|||||||
@@ -1,29 +1,4 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"extends": "@repo/tsconfig/tsconfig.json",
|
||||||
// Environment setup & latest features
|
"include": ["src/**/*.ts"]
|
||||||
"lib": ["ESNext"],
|
|
||||||
"target": "ESNext",
|
|
||||||
"module": "Preserve",
|
|
||||||
"moduleDetection": "force",
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
"allowJs": true,
|
|
||||||
|
|
||||||
// Bundler mode
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
"verbatimModuleSyntax": true,
|
|
||||||
"noEmit": true,
|
|
||||||
|
|
||||||
// Best practices
|
|
||||||
"strict": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"noUncheckedIndexedAccess": true,
|
|
||||||
"noImplicitOverride": true,
|
|
||||||
|
|
||||||
// Some stricter flags (disabled by default)
|
|
||||||
"noUnusedLocals": false,
|
|
||||||
"noUnusedParameters": false,
|
|
||||||
"noPropertyAccessFromIndexSignature": false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@
|
|||||||
"@repo/mnie-sdk": "workspace:*"
|
"@repo/mnie-sdk": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest"
|
"@types/bun": "latest"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -7,14 +7,14 @@ import { homedir } from 'node:os'
|
|||||||
import { dirname, join } from 'node:path'
|
import { dirname, join } from 'node:path'
|
||||||
import { createMnieClient } from '@repo/mnie-sdk'
|
import { createMnieClient } from '@repo/mnie-sdk'
|
||||||
|
|
||||||
type Profile = {
|
interface Profile {
|
||||||
origin: string
|
origin: string
|
||||||
apiKeyStorage: 'file' | 'keyring'
|
apiKeyStorage: 'file' | 'keyring'
|
||||||
apiKey?: string
|
apiKey?: string
|
||||||
keyringAccount?: string
|
keyringAccount?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
type ProfilesFile = {
|
interface ProfilesFile {
|
||||||
defaultProfile?: string
|
defaultProfile?: string
|
||||||
profiles: Record<string, Profile>
|
profiles: Record<string, Profile>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "@repo/tsconfig/tsconfig.json",
|
||||||
"include": ["src/**/*.ts"]
|
"include": ["src/**/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "@repo/mnie-sdk",
|
"name": "mnie",
|
||||||
"private": true,
|
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"module": "./dist/index.mjs",
|
"module": "./dist/index.mjs",
|
||||||
"types": "./src/index.ts",
|
"types": "./src/index.ts",
|
||||||
@@ -19,6 +18,7 @@
|
|||||||
"@repo/mnie-types": "workspace:*"
|
"@repo/mnie-types": "workspace:*"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest"
|
"@types/bun": "latest"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -1,12 +1,12 @@
|
|||||||
import type { SbiClientMethods } from '@repo/mnie-types'
|
import type { SbiClientMethods } from '@repo/mnie-types'
|
||||||
|
|
||||||
export type MnieSdkOptions = {
|
export interface MnieSdkOptions {
|
||||||
origin: string
|
origin: string
|
||||||
apiKey: string
|
apiKey: string
|
||||||
WebSocket?: typeof WebSocket
|
WebSocket?: typeof WebSocket
|
||||||
}
|
}
|
||||||
|
|
||||||
export type JsonRpcError = {
|
export interface JsonRpcError {
|
||||||
code: number
|
code: number
|
||||||
message: string
|
message: string
|
||||||
}
|
}
|
||||||
@@ -17,14 +17,14 @@ export type MnieClient = SbiClientMethods & {
|
|||||||
close(): void
|
close(): void
|
||||||
}
|
}
|
||||||
|
|
||||||
type JsonRpcResponse = {
|
interface JsonRpcResponse {
|
||||||
jsonrpc?: '2.0'
|
jsonrpc?: '2.0'
|
||||||
id?: string | number | null
|
id?: string | number | null
|
||||||
result?: unknown
|
result?: unknown
|
||||||
error?: JsonRpcError
|
error?: JsonRpcError
|
||||||
}
|
}
|
||||||
|
|
||||||
type PendingCall = {
|
interface PendingCall {
|
||||||
resolve: (value: unknown) => void
|
resolve: (value: unknown) => void
|
||||||
reject: (error: Error) => void
|
reject: (error: Error) => void
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "@repo/tsconfig/tsconfig.json",
|
||||||
"include": ["src/**/*.ts"]
|
"include": ["src/**/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,7 @@
|
|||||||
"typecheck": "tsc"
|
"typecheck": "tsc"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
|
"@repo/tsconfig": "workspace:*",
|
||||||
"@types/bun": "latest"
|
"@types/bun": "latest"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
"peerDependencies": {
|
||||||
|
|||||||
@@ -42,21 +42,21 @@ import type {
|
|||||||
Watchlist,
|
Watchlist,
|
||||||
} from './types'
|
} from './types'
|
||||||
|
|
||||||
export type PagingOptions = {
|
export interface PagingOptions {
|
||||||
/** Start index for the result list. Defaults to the first item when omitted. */
|
/** Start index for the result list. Defaults to the first item when omitted. */
|
||||||
index?: number
|
index?: number
|
||||||
/** Maximum number of items to fetch. Uses the implementation default when omitted. */
|
/** Maximum number of items to fetch. Uses the implementation default when omitted. */
|
||||||
limit?: number
|
limit?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DateRangeOptions = {
|
export interface DateRangeOptions {
|
||||||
/** Start date for the inquiry range. */
|
/** Start date for the inquiry range. */
|
||||||
from?: string
|
from?: string
|
||||||
/** End date for the inquiry range. */
|
/** End date for the inquiry range. */
|
||||||
to?: string
|
to?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IssueOptions = {
|
export interface IssueOptions {
|
||||||
/** Issue code to request. */
|
/** Issue code to request. */
|
||||||
issueCode: IssueCode
|
issueCode: IssueCode
|
||||||
/** Market code to request. */
|
/** Market code to request. */
|
||||||
@@ -79,7 +79,7 @@ export type IssueChartOptions = IssueOptions & {
|
|||||||
count?: number
|
count?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IssueSearchOptions = {
|
export interface IssueSearchOptions {
|
||||||
/** Search text, such as an issue code, name, or keyword. */
|
/** Search text, such as an issue code, name, or keyword. */
|
||||||
query: string
|
query: string
|
||||||
/** Market code to search. */
|
/** Market code to search. */
|
||||||
@@ -118,7 +118,7 @@ export type OrderInquiryOptions = PagingOptions &
|
|||||||
status?: OrderStatus
|
status?: OrderStatus
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderDetailOptions = {
|
export interface OrderDetailOptions {
|
||||||
/** Order number shown in order inquiry. */
|
/** Order number shown in order inquiry. */
|
||||||
orderNumber?: string
|
orderNumber?: string
|
||||||
/** Order ID from order inquiry. For US stocks this is often `orderSubNo`. */
|
/** Order ID from order inquiry. For US stocks this is often `orderSubNo`. */
|
||||||
@@ -149,7 +149,7 @@ export type BoardOptions = IssueOptions & {
|
|||||||
| 'marginCloseSell'
|
| 'marginCloseSell'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockOrderBaseOptions = {
|
export interface StockOrderBaseOptions {
|
||||||
/** Issue code to order. */
|
/** Issue code to order. */
|
||||||
issueCode: IssueCode
|
issueCode: IssueCode
|
||||||
/** Market code to order on. */
|
/** Market code to order on. */
|
||||||
@@ -185,7 +185,7 @@ export type CashOrderTriggerZone = 'above' | 'below'
|
|||||||
|
|
||||||
export type CashOrderMethod = 'normal' | 'stop' | 'oco'
|
export type CashOrderMethod = 'normal' | 'stop' | 'oco'
|
||||||
|
|
||||||
export type StockOrderMarginPosition = {
|
export interface StockOrderMarginPosition {
|
||||||
/** Open trade date from the margin position record, in yyyyMMdd or yyyy-MM-dd format. */
|
/** Open trade date from the margin position record, in yyyyMMdd or yyyy-MM-dd format. */
|
||||||
openTradeDate: string
|
openTradeDate: string
|
||||||
/** Open price from the margin position record. Raw strings are accepted to preserve APK values. */
|
/** Open price from the margin position record. Raw strings are accepted to preserve APK values. */
|
||||||
@@ -284,7 +284,7 @@ export type MarginClosePositionOrder =
|
|||||||
|
|
||||||
export type ActualDeliveryKind = 'genbiki' | 'genwatashi'
|
export type ActualDeliveryKind = 'genbiki' | 'genwatashi'
|
||||||
|
|
||||||
export type ActualDeliveryOrderOptions = {
|
export interface ActualDeliveryOrderOptions {
|
||||||
/** Issue code to deliver. */
|
/** Issue code to deliver. */
|
||||||
issueCode: IssueCode
|
issueCode: IssueCode
|
||||||
/** Market code for the issue. */
|
/** Market code for the issue. */
|
||||||
@@ -339,7 +339,7 @@ export type PlaceActualDeliveryOrderOptions = ActualDeliveryOrderOptions & {
|
|||||||
allowTrading?: true
|
allowTrading?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderCorrectionOptions = {
|
export interface OrderCorrectionOptions {
|
||||||
/** Order number shown in order inquiry. Required by the mobile pre-correction route. */
|
/** Order number shown in order inquiry. Required by the mobile pre-correction route. */
|
||||||
orderNumber?: string
|
orderNumber?: string
|
||||||
/** Order ID to correct. */
|
/** Order ID to correct. */
|
||||||
@@ -397,7 +397,7 @@ export type PlaceOrderCorrectionOptions = OrderCorrectionOptions & {
|
|||||||
allowTrading?: true
|
allowTrading?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderCancelOptions = {
|
export interface OrderCancelOptions {
|
||||||
/** Order number shown in order inquiry. */
|
/** Order number shown in order inquiry. */
|
||||||
orderNumber: string
|
orderNumber: string
|
||||||
/** Original order ID shown in order inquiry. */
|
/** Original order ID shown in order inquiry. */
|
||||||
@@ -419,7 +419,7 @@ export type PlaceOrderCancelOptions = OrderCancelOptions & {
|
|||||||
allowTrading?: true
|
allowTrading?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ExchangeOrderOptions = {
|
export interface ExchangeOrderOptions {
|
||||||
/** Currency code, such as USD. */
|
/** Currency code, such as USD. */
|
||||||
currencyCode: string
|
currencyCode: string
|
||||||
/** Buy or sell the foreign currency. */
|
/** Buy or sell the foreign currency. */
|
||||||
@@ -438,7 +438,7 @@ export type ExchangeOrderOptions = {
|
|||||||
tradePassword?: string
|
tradePassword?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ExchangeRateOptions = {
|
export interface ExchangeRateOptions {
|
||||||
/** Currency code, such as USD. */
|
/** Currency code, such as USD. */
|
||||||
currencyCode: string
|
currencyCode: string
|
||||||
/** Buy or sell the foreign currency. */
|
/** Buy or sell the foreign currency. */
|
||||||
@@ -513,7 +513,7 @@ export type PlaceIfdOrderOptions = IfdOrderOptions & {
|
|||||||
allowTrading?: true
|
allowTrading?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThemeInvestmentOrderOptions = {
|
export interface ThemeInvestmentOrderOptions {
|
||||||
/** Theme ID for the theme investment order. */
|
/** Theme ID for the theme investment order. */
|
||||||
themeId: ThemeId
|
themeId: ThemeId
|
||||||
/** Theme set year/month (`theme_set_yyyymm`) from the mobile APK handoff. */
|
/** Theme set year/month (`theme_set_yyyymm`) from the mobile APK handoff. */
|
||||||
@@ -532,21 +532,21 @@ export type ThemeInvestmentOrderOptions = {
|
|||||||
amount?: number
|
amount?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThemeInvestmentOrderComponent = {
|
export interface ThemeInvestmentOrderComponent {
|
||||||
/** Component stock issue code. */
|
/** Component stock issue code. */
|
||||||
issueCode: IssueCode
|
issueCode: IssueCode
|
||||||
/** Component order quantity. */
|
/** Component order quantity. */
|
||||||
quantity: number | string
|
quantity: number | string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThemeInvestmentPreOrderComponent = {
|
export interface ThemeInvestmentPreOrderComponent {
|
||||||
/** Component stock issue code selected by the mobile theme investment flow. */
|
/** Component stock issue code selected by the mobile theme investment flow. */
|
||||||
issueCode: IssueCode
|
issueCode: IssueCode
|
||||||
/** Component order quantity from the mobile handoff, when already selected. */
|
/** Component order quantity from the mobile handoff, when already selected. */
|
||||||
quantity?: number | string
|
quantity?: number | string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThemeInvestmentPreOrderOptions = {
|
export interface ThemeInvestmentPreOrderOptions {
|
||||||
/** Theme ID for the theme investment order target. */
|
/** Theme ID for the theme investment order target. */
|
||||||
themeId: ThemeId
|
themeId: ThemeId
|
||||||
/** Theme name from the mobile theme investment flow, when available. */
|
/** Theme name from the mobile theme investment flow, when available. */
|
||||||
@@ -562,12 +562,12 @@ export type PlaceThemeInvestmentOrderOptions = ThemeInvestmentOrderOptions & {
|
|||||||
allowTrading?: true
|
allowTrading?: true
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AccountPowerOptions = {
|
export interface AccountPowerOptions {
|
||||||
/** Fetches margin-account collateral details. Disable this for accounts without margin trading. */
|
/** Fetches margin-account collateral details. Disable this for accounts without margin trading. */
|
||||||
includeMarginAccount?: boolean
|
includeMarginAccount?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProfitLossOptions = {
|
export interface ProfitLossOptions {
|
||||||
/** Market to fetch profit/loss for. Omit for domestic cash/margin summary. */
|
/** Market to fetch profit/loss for. Omit for domestic cash/margin summary. */
|
||||||
market?: MarketCode
|
market?: MarketCode
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ export type WebAuthnUserVerification = 'required' | 'preferred' | 'discouraged'
|
|||||||
|
|
||||||
export type WebAuthnTransport = 'ble' | 'hybrid' | 'internal' | 'nfc' | 'usb'
|
export type WebAuthnTransport = 'ble' | 'hybrid' | 'internal' | 'nfc' | 'usb'
|
||||||
|
|
||||||
export type WebAuthnJwk = {
|
export interface WebAuthnJwk {
|
||||||
kty: string
|
kty: string
|
||||||
crv?: string
|
crv?: string
|
||||||
x?: string
|
x?: string
|
||||||
@@ -17,7 +17,7 @@ export type WebAuthnJwk = {
|
|||||||
[key: string]: unknown
|
[key: string]: unknown
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StoredWebAuthnCredentialSecret = {
|
export interface StoredWebAuthnCredentialSecret {
|
||||||
privateKey: {
|
privateKey: {
|
||||||
format: 'jwk'
|
format: 'jwk'
|
||||||
jwk: WebAuthnJwk
|
jwk: WebAuthnJwk
|
||||||
@@ -29,7 +29,7 @@ export type StoredWebAuthnCredentialSecret = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StoredWebAuthnCredential = {
|
export interface StoredWebAuthnCredential {
|
||||||
version: 1
|
version: 1
|
||||||
kind: 'webauthn-credential'
|
kind: 'webauthn-credential'
|
||||||
provider: 'sbi-sec'
|
provider: 'sbi-sec'
|
||||||
@@ -76,7 +76,7 @@ export type PlaintextStoredWebAuthnCredential = Omit<StoredWebAuthnCredential, '
|
|||||||
secretPlaintext: StoredWebAuthnCredentialSecret
|
secretPlaintext: StoredWebAuthnCredentialSecret
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PasskeyLoginResponse = {
|
export interface PasskeyLoginResponse {
|
||||||
type: 'passkey-login-response'
|
type: 'passkey-login-response'
|
||||||
requestUrl: string
|
requestUrl: string
|
||||||
status: number
|
status: number
|
||||||
@@ -90,7 +90,7 @@ export type PasskeyLoginResponse = {
|
|||||||
} | null
|
} | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ForeignStockEndpointConfig = {
|
export interface ForeignStockEndpointConfig {
|
||||||
baseUrl?: string
|
baseUrl?: string
|
||||||
restUrl: string
|
restUrl: string
|
||||||
graphqlBffUrl: string
|
graphqlBffUrl: string
|
||||||
@@ -98,7 +98,7 @@ export type ForeignStockEndpointConfig = {
|
|||||||
userAgent?: string
|
userAgent?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ForeignStockSession = {
|
export interface ForeignStockSession {
|
||||||
endpoints: ForeignStockEndpointConfig
|
endpoints: ForeignStockEndpointConfig
|
||||||
ssoToken?: string
|
ssoToken?: string
|
||||||
sessionId?: string
|
sessionId?: string
|
||||||
@@ -108,14 +108,14 @@ export type ForeignStockSession = {
|
|||||||
loginAuthenticated?: boolean
|
loginAuthenticated?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MainSiteAuthCache = {
|
export interface MainSiteAuthCache {
|
||||||
baseUrl: string
|
baseUrl: string
|
||||||
assetsUrl: string
|
assetsUrl: string
|
||||||
cookieHeader: string
|
cookieHeader: string
|
||||||
authenticatedAt: string
|
authenticatedAt: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MainSiteSession = {
|
export interface MainSiteSession {
|
||||||
baseUrl?: string
|
baseUrl?: string
|
||||||
etGatePath?: string
|
etGatePath?: string
|
||||||
assetsValuationsPath?: string
|
assetsValuationsPath?: string
|
||||||
@@ -127,7 +127,7 @@ export type MainSiteSession = {
|
|||||||
authPromise?: Promise<MainSiteAuthCache>
|
authPromise?: Promise<MainSiteAuthCache>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiSession = {
|
export interface SbiSession {
|
||||||
mtsBaseUrl: string
|
mtsBaseUrl: string
|
||||||
izanagiBaseUrl?: string
|
izanagiBaseUrl?: string
|
||||||
foreignStock?: ForeignStockSession
|
foreignStock?: ForeignStockSession
|
||||||
@@ -139,7 +139,7 @@ export type SbiSession = {
|
|||||||
tradeAuthentication?: SbiTradeAuthenticationOptions
|
tradeAuthentication?: SbiTradeAuthenticationOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
export type LoginWithPasskeyOptions = {
|
export interface LoginWithPasskeyOptions {
|
||||||
passkeyCredential: PlaintextStoredWebAuthnCredential
|
passkeyCredential: PlaintextStoredWebAuthnCredential
|
||||||
authBaseUrl?: string
|
authBaseUrl?: string
|
||||||
mtsBaseUrl?: string
|
mtsBaseUrl?: string
|
||||||
@@ -159,13 +159,13 @@ export type LoginWithPasskeyOptions = {
|
|||||||
mainSiteExchangeOrderCompletePath?: string
|
mainSiteExchangeOrderCompletePath?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiClientOptions = {
|
export interface SbiClientOptions {
|
||||||
tradePassword?: string
|
tradePassword?: string
|
||||||
deviceId?: string
|
deviceId?: string
|
||||||
tradeAuthentication?: SbiTradeAuthenticationOptions
|
tradeAuthentication?: SbiTradeAuthenticationOptions
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiTradeAuthenticationRequest = {
|
export interface SbiTradeAuthenticationRequest {
|
||||||
type: 'phone'
|
type: 'phone'
|
||||||
telNo?: string
|
telNo?: string
|
||||||
phoneNo?: string
|
phoneNo?: string
|
||||||
@@ -173,7 +173,7 @@ export type SbiTradeAuthenticationRequest = {
|
|||||||
authLimitTime?: string
|
authLimitTime?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiTradeAuthenticationOptions = {
|
export interface SbiTradeAuthenticationOptions {
|
||||||
onRequired?: (request: SbiTradeAuthenticationRequest) => void | Promise<void>
|
onRequired?: (request: SbiTradeAuthenticationRequest) => void | Promise<void>
|
||||||
confirmAttempts?: number
|
confirmAttempts?: number
|
||||||
confirmIntervalMs?: number
|
confirmIntervalMs?: number
|
||||||
@@ -189,24 +189,24 @@ export type WatchlistId = string
|
|||||||
export type PositionId = string
|
export type PositionId = string
|
||||||
export type ThemeId = string
|
export type ThemeId = string
|
||||||
|
|
||||||
export type CurrencyAmount = {
|
export interface CurrencyAmount {
|
||||||
value: number | null
|
value: number | null
|
||||||
text: string
|
text: string
|
||||||
currency: 'JPY' | 'USD'
|
currency: 'JPY' | 'USD'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type PercentValue = {
|
export interface PercentValue {
|
||||||
value: number | null
|
value: number | null
|
||||||
text: string
|
text: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SignedTextValue = {
|
export interface SignedTextValue {
|
||||||
value: number | null
|
value: number | null
|
||||||
text: string
|
text: string
|
||||||
sign?: 'positive' | 'negative' | 'zero'
|
sign?: 'positive' | 'negative' | 'zero'
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AccountAssetsValuationSummary = {
|
export interface AccountAssetsValuationSummary {
|
||||||
assetsErrorType: unknown
|
assetsErrorType: unknown
|
||||||
valuation: number | null
|
valuation: number | null
|
||||||
netChange: number | null
|
netChange: number | null
|
||||||
@@ -223,7 +223,7 @@ export type AccountAssetsValuationDetail = AccountAssetsValuationSummary & {
|
|||||||
compositionRatio: number | null
|
compositionRatio: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AccountAssetsValuations = {
|
export interface AccountAssetsValuations {
|
||||||
fetchedAt: string
|
fetchedAt: string
|
||||||
summary: AccountAssetsValuationSummary
|
summary: AccountAssetsValuationSummary
|
||||||
summaryWithoutDeposit: AccountAssetsValuationSummary
|
summaryWithoutDeposit: AccountAssetsValuationSummary
|
||||||
@@ -276,7 +276,7 @@ export type IsaAccountType =
|
|||||||
| 'nisaTradePermitted'
|
| 'nisaTradePermitted'
|
||||||
| 'unknown'
|
| 'unknown'
|
||||||
|
|
||||||
export type IssueRef = {
|
export interface IssueRef {
|
||||||
code: IssueCode
|
code: IssueCode
|
||||||
market?: MarketCode
|
market?: MarketCode
|
||||||
name?: string
|
name?: string
|
||||||
@@ -292,7 +292,7 @@ export type IssueSearchItem = IssueRef & {
|
|||||||
|
|
||||||
export type IssueSearchStatus = 'success' | 'searchError' | 'tooManyResults' | 'unknown'
|
export type IssueSearchStatus = 'success' | 'searchError' | 'tooManyResults' | 'unknown'
|
||||||
|
|
||||||
export type IssueSearchResult = {
|
export interface IssueSearchResult {
|
||||||
status?: string
|
status?: string
|
||||||
statusText: IssueSearchStatus
|
statusText: IssueSearchStatus
|
||||||
issues: IssueSearchItem[]
|
issues: IssueSearchItem[]
|
||||||
@@ -300,7 +300,7 @@ export type IssueSearchResult = {
|
|||||||
|
|
||||||
export type ChartPeriod = 'minute' | 'day' | 'week' | 'month'
|
export type ChartPeriod = 'minute' | 'day' | 'week' | 'month'
|
||||||
|
|
||||||
export type ChartPrice = {
|
export interface ChartPrice {
|
||||||
dateTime: string
|
dateTime: string
|
||||||
open: CurrencyAmount
|
open: CurrencyAmount
|
||||||
high: CurrencyAmount
|
high: CurrencyAmount
|
||||||
@@ -309,7 +309,7 @@ export type ChartPrice = {
|
|||||||
volume?: number | null
|
volume?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type IssueChart = {
|
export interface IssueChart {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
period: ChartPeriod
|
period: ChartPeriod
|
||||||
unit: number
|
unit: number
|
||||||
@@ -322,13 +322,13 @@ export type IssueChart = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SessionInfo = {
|
export interface SessionInfo {
|
||||||
sessionId: string
|
sessionId: string
|
||||||
loginType: LoginType
|
loginType: LoginType
|
||||||
resultCode: string
|
resultCode: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type AccountProfile = {
|
export interface AccountProfile {
|
||||||
session: SessionInfo
|
session: SessionInfo
|
||||||
branchCode?: string
|
branchCode?: string
|
||||||
butenCode?: string
|
butenCode?: string
|
||||||
@@ -391,7 +391,7 @@ export type AccountProfile = {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export type BuyingPower = {
|
export interface BuyingPower {
|
||||||
cashBuyingPower?: CurrencyAmount
|
cashBuyingPower?: CurrencyAmount
|
||||||
marginBuyingPower?: CurrencyAmount
|
marginBuyingPower?: CurrencyAmount
|
||||||
withdrawableAmount?: CurrencyAmount
|
withdrawableAmount?: CurrencyAmount
|
||||||
@@ -403,7 +403,7 @@ export type BuyingPower = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CollateralRatioRecord = {
|
export interface CollateralRatioRecord {
|
||||||
marginRequirements?: CurrencyAmount
|
marginRequirements?: CurrencyAmount
|
||||||
referenceMarginRequirements?: CurrencyAmount
|
referenceMarginRequirements?: CurrencyAmount
|
||||||
collateralRatioCash?: CurrencyAmount
|
collateralRatioCash?: CurrencyAmount
|
||||||
@@ -420,7 +420,7 @@ export type CollateralRatioRecord = {
|
|||||||
minimumCollateral?: CurrencyAmount
|
minimumCollateral?: CurrencyAmount
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CashPosition = {
|
export interface CashPosition {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
accountType?: AccountType
|
accountType?: AccountType
|
||||||
depositType?: DepositType
|
depositType?: DepositType
|
||||||
@@ -449,7 +449,7 @@ export type CashPosition = {
|
|||||||
accountInformation?: string
|
accountInformation?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type CashPositionList = {
|
export interface CashPositionList {
|
||||||
positions: CashPosition[]
|
positions: CashPosition[]
|
||||||
index?: number
|
index?: number
|
||||||
totalCount?: number
|
totalCount?: number
|
||||||
@@ -461,7 +461,7 @@ export type CashPositionList = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MarginPosition = {
|
export interface MarginPosition {
|
||||||
id?: PositionId
|
id?: PositionId
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
side: MarginTradeSide
|
side: MarginTradeSide
|
||||||
@@ -503,7 +503,7 @@ export type MarginPosition = {
|
|||||||
bargainMarket?: string
|
bargainMarket?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MarginPositionList = {
|
export interface MarginPositionList {
|
||||||
positions: MarginPosition[]
|
positions: MarginPosition[]
|
||||||
index?: number
|
index?: number
|
||||||
totalCount?: number
|
totalCount?: number
|
||||||
@@ -515,7 +515,7 @@ export type MarginPositionList = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ProfitLossSummary = {
|
export interface ProfitLossSummary {
|
||||||
cash?: SignedTextValue
|
cash?: SignedTextValue
|
||||||
margin?: SignedTextValue
|
margin?: SignedTextValue
|
||||||
total?: SignedTextValue
|
total?: SignedTextValue
|
||||||
@@ -523,7 +523,7 @@ export type ProfitLossSummary = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Quote = {
|
export interface Quote {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
price?: CurrencyAmount
|
price?: CurrencyAmount
|
||||||
change?: SignedTextValue
|
change?: SignedTextValue
|
||||||
@@ -539,12 +539,12 @@ export type Quote = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type BoardPriceLevel = {
|
export interface BoardPriceLevel {
|
||||||
price: CurrencyAmount
|
price: CurrencyAmount
|
||||||
quantity?: number | null
|
quantity?: number | null
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Board = {
|
export interface Board {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
bids: BoardPriceLevel[]
|
bids: BoardPriceLevel[]
|
||||||
asks: BoardPriceLevel[]
|
asks: BoardPriceLevel[]
|
||||||
@@ -552,7 +552,7 @@ export type Board = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type MarketIndex = {
|
export interface MarketIndex {
|
||||||
code?: string
|
code?: string
|
||||||
categoryCode?: string
|
categoryCode?: string
|
||||||
name: string
|
name: string
|
||||||
@@ -568,13 +568,13 @@ export type MarketIndex = {
|
|||||||
previousClose?: CurrencyAmount
|
previousClose?: CurrencyAmount
|
||||||
}
|
}
|
||||||
|
|
||||||
export type DomesticMarket = {
|
export interface DomesticMarket {
|
||||||
status?: string
|
status?: string
|
||||||
indexes: MarketIndex[]
|
indexes: MarketIndex[]
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type RankingItem = {
|
export interface RankingItem {
|
||||||
rank: number
|
rank: number
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
value?: number | string | null
|
value?: number | string | null
|
||||||
@@ -585,14 +585,14 @@ export type RankingItem = {
|
|||||||
colorFlag?: string
|
colorFlag?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Ranking = {
|
export interface Ranking {
|
||||||
items: RankingItem[]
|
items: RankingItem[]
|
||||||
category?: string
|
category?: string
|
||||||
updatedAt?: string
|
updatedAt?: string
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NewsItem = {
|
export interface NewsItem {
|
||||||
id?: string
|
id?: string
|
||||||
title: string
|
title: string
|
||||||
source?: string
|
source?: string
|
||||||
@@ -606,26 +606,26 @@ export type NewsItem = {
|
|||||||
pnac?: string
|
pnac?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type NewsList = {
|
export interface NewsList {
|
||||||
items: NewsItem[]
|
items: NewsItem[]
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type WatchlistItem = {
|
export interface WatchlistItem {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
sortOrder?: number
|
sortOrder?: number
|
||||||
memo?: string
|
memo?: string
|
||||||
quote?: Quote
|
quote?: Quote
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Watchlist = {
|
export interface Watchlist {
|
||||||
id: WatchlistId
|
id: WatchlistId
|
||||||
name: string
|
name: string
|
||||||
items: WatchlistItem[]
|
items: WatchlistItem[]
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type Order = {
|
export interface Order {
|
||||||
id: OrderId
|
id: OrderId
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
side: TradeSide
|
side: TradeSide
|
||||||
@@ -655,13 +655,13 @@ export type Order = {
|
|||||||
correctable?: boolean
|
correctable?: boolean
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderList = {
|
export interface OrderList {
|
||||||
orders: Order[]
|
orders: Order[]
|
||||||
hasMore?: boolean
|
hasMore?: boolean
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TradeRecord = {
|
export interface TradeRecord {
|
||||||
id: string
|
id: string
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
tradeRecordTypeCode?: string
|
tradeRecordTypeCode?: string
|
||||||
@@ -678,13 +678,13 @@ export type TradeRecord = {
|
|||||||
marginCloseLimitType?: string
|
marginCloseLimitType?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type TradeRecordList = {
|
export interface TradeRecordList {
|
||||||
records: TradeRecord[]
|
records: TradeRecord[]
|
||||||
hasMore?: boolean
|
hasMore?: boolean
|
||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderCorrectionPreOrderDetail = {
|
export interface OrderCorrectionPreOrderDetail {
|
||||||
exchangeName?: string
|
exchangeName?: string
|
||||||
marketLoanKbn?: string
|
marketLoanKbn?: string
|
||||||
marketIppanLoanKbn?: string
|
marketIppanLoanKbn?: string
|
||||||
@@ -697,7 +697,7 @@ export type OrderCorrectionPreOrderDetail = {
|
|||||||
volumeText?: string
|
volumeText?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderCorrectionPreOrder = {
|
export interface OrderCorrectionPreOrder {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
tradeTitle?: string
|
tradeTitle?: string
|
||||||
buyingPowerTotal?: CurrencyAmount
|
buyingPowerTotal?: CurrencyAmount
|
||||||
@@ -753,7 +753,7 @@ export type OrderCorrectionPreOrder = {
|
|||||||
exchangeList?: string
|
exchangeList?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderPreview = {
|
export interface OrderPreview {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
side: TradeSide
|
side: TradeSide
|
||||||
quantity?: number
|
quantity?: number
|
||||||
@@ -768,12 +768,12 @@ export type OrderPreview = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockOrderPreOrderPriceStep = {
|
export interface StockOrderPreOrderPriceStep {
|
||||||
from?: CurrencyAmount
|
from?: CurrencyAmount
|
||||||
to?: CurrencyAmount
|
to?: CurrencyAmount
|
||||||
}
|
}
|
||||||
|
|
||||||
export type StockOrderPreOrderPaymentLimit = {
|
export interface StockOrderPreOrderPaymentLimit {
|
||||||
text?: string
|
text?: string
|
||||||
code?: string
|
code?: string
|
||||||
}
|
}
|
||||||
@@ -787,7 +787,7 @@ export type StockOrderPreOrderMarginTradeType =
|
|||||||
| 'day'
|
| 'day'
|
||||||
| 'hyper'
|
| 'hyper'
|
||||||
|
|
||||||
export type StockOrderPreOrder = {
|
export interface StockOrderPreOrder {
|
||||||
issue: IssueRef
|
issue: IssueRef
|
||||||
tradeTitle?: string
|
tradeTitle?: string
|
||||||
buyingPowerTotal?: CurrencyAmount
|
buyingPowerTotal?: CurrencyAmount
|
||||||
@@ -850,7 +850,7 @@ export type StockOrderPreOrder = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type OrderReceipt = {
|
export interface OrderReceipt {
|
||||||
accepted: boolean
|
accepted: boolean
|
||||||
orderId?: OrderId
|
orderId?: OrderId
|
||||||
acceptedAt?: string
|
acceptedAt?: string
|
||||||
@@ -863,7 +863,7 @@ export type ExchangeSpecificMethod = 'foreign' | 'domestic'
|
|||||||
export type ExchangeAccountKind = 'GENERAL' | 'JR_NISA'
|
export type ExchangeAccountKind = 'GENERAL' | 'JR_NISA'
|
||||||
export type ExchangeSellMethod = 'SELL_PART' | 'SELL_ALL'
|
export type ExchangeSellMethod = 'SELL_PART' | 'SELL_ALL'
|
||||||
|
|
||||||
export type ExchangeOrderPreview = {
|
export interface ExchangeOrderPreview {
|
||||||
currencyCode: string
|
currencyCode: string
|
||||||
currencyName?: string
|
currencyName?: string
|
||||||
side: ExchangeOrderSide
|
side: ExchangeOrderSide
|
||||||
@@ -882,7 +882,7 @@ export type ExchangeOrderPreview = {
|
|||||||
csrfToken: string
|
csrfToken: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ExchangeOrderReceipt = {
|
export interface ExchangeOrderReceipt {
|
||||||
accepted: boolean
|
accepted: boolean
|
||||||
currencyCode?: string
|
currencyCode?: string
|
||||||
side?: ExchangeOrderSide
|
side?: ExchangeOrderSide
|
||||||
@@ -891,7 +891,7 @@ export type ExchangeOrderReceipt = {
|
|||||||
rawTitle?: string
|
rawTitle?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ExchangeRateInfo = {
|
export interface ExchangeRateInfo {
|
||||||
currencyCode: string
|
currencyCode: string
|
||||||
side: ExchangeOrderSide
|
side: ExchangeOrderSide
|
||||||
referenceExchangeRate?: string
|
referenceExchangeRate?: string
|
||||||
@@ -910,7 +910,7 @@ export type ExchangeRateInfo = {
|
|||||||
raw: Record<string, unknown>
|
raw: Record<string, unknown>
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThemeInvestment = {
|
export interface ThemeInvestment {
|
||||||
id: ThemeId
|
id: ThemeId
|
||||||
name: string
|
name: string
|
||||||
issues: ThemeInvestmentIssue[]
|
issues: ThemeInvestmentIssue[]
|
||||||
@@ -933,7 +933,7 @@ export type ThemeInvestmentIssue = IssueRef & {
|
|||||||
tradeTime?: string
|
tradeTime?: string
|
||||||
}
|
}
|
||||||
|
|
||||||
export type ThemeInvestmentList = {
|
export interface ThemeInvestmentList {
|
||||||
themes: ThemeInvestment[]
|
themes: ThemeInvestment[]
|
||||||
buyingPowerTotal?: CurrencyAmount
|
buyingPowerTotal?: CurrencyAmount
|
||||||
isaBuyLimit?: CurrencyAmount
|
isaBuyLimit?: CurrencyAmount
|
||||||
@@ -944,7 +944,7 @@ export type ThemeInvestmentList = {
|
|||||||
error?: SbiMethodError
|
error?: SbiMethodError
|
||||||
}
|
}
|
||||||
|
|
||||||
export type SbiMethodError = {
|
export interface SbiMethodError {
|
||||||
status?: string
|
status?: string
|
||||||
code?: string
|
code?: string
|
||||||
message?: string
|
message?: string
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
{
|
{
|
||||||
"extends": "../../tsconfig.json",
|
"extends": "@repo/tsconfig/tsconfig.json",
|
||||||
"include": ["src/**/*.ts"]
|
"include": ["src/**/*.ts"]
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"name": "@repo/tsconfig",
|
||||||
|
"version": "0.0.0",
|
||||||
|
"private": true,
|
||||||
|
"files": [
|
||||||
|
"tsconfig.json"
|
||||||
|
],
|
||||||
|
"exports": {
|
||||||
|
"./tsconfig.json": "./tsconfig.json"
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,22 @@
|
|||||||
|
{
|
||||||
|
"compilerOptions": {
|
||||||
|
"lib": ["ESNext"],
|
||||||
|
"target": "ESNext",
|
||||||
|
"module": "Preserve",
|
||||||
|
"moduleDetection": "force",
|
||||||
|
"jsx": "react-jsx",
|
||||||
|
"allowJs": true,
|
||||||
|
"moduleResolution": "bundler",
|
||||||
|
"allowImportingTsExtensions": true,
|
||||||
|
"verbatimModuleSyntax": true,
|
||||||
|
"noEmit": true,
|
||||||
|
"strict": true,
|
||||||
|
"skipLibCheck": true,
|
||||||
|
"noFallthroughCasesInSwitch": true,
|
||||||
|
"noUncheckedIndexedAccess": true,
|
||||||
|
"noImplicitOverride": true,
|
||||||
|
"noUnusedLocals": false,
|
||||||
|
"noUnusedParameters": false,
|
||||||
|
"noPropertyAccessFromIndexSignature": false
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'
|
import { mkdirSync, readdirSync, readFileSync, statSync, writeFileSync } from 'node:fs'
|
||||||
import { join, relative } from 'node:path'
|
import { join, relative } from 'node:path'
|
||||||
|
|
||||||
type ApiClass = {
|
interface ApiClass {
|
||||||
file: string
|
file: string
|
||||||
packageName: string | null
|
packageName: string | null
|
||||||
className: string | null
|
className: string | null
|
||||||
@@ -15,7 +15,7 @@ type ApiClass = {
|
|||||||
responseReads: Array<{ line: number; setter: string | null; width: number }>
|
responseReads: Array<{ line: number; setter: string | null; width: number }>
|
||||||
}
|
}
|
||||||
|
|
||||||
type Finding = {
|
interface Finding {
|
||||||
generatedAt: string
|
generatedAt: string
|
||||||
input: {
|
input: {
|
||||||
jadx: string
|
jadx: string
|
||||||
|
|||||||
+1
-27
@@ -1,29 +1,3 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"extends": "@repo/tsconfig/tsconfig.json"
|
||||||
// Environment setup & latest features
|
|
||||||
"lib": ["ESNext"],
|
|
||||||
"target": "ESNext",
|
|
||||||
"module": "Preserve",
|
|
||||||
"moduleDetection": "force",
|
|
||||||
"jsx": "react-jsx",
|
|
||||||
"allowJs": true,
|
|
||||||
|
|
||||||
// Bundler mode
|
|
||||||
"moduleResolution": "bundler",
|
|
||||||
"allowImportingTsExtensions": true,
|
|
||||||
"verbatimModuleSyntax": true,
|
|
||||||
"noEmit": true,
|
|
||||||
|
|
||||||
// Best practices
|
|
||||||
"strict": true,
|
|
||||||
"skipLibCheck": true,
|
|
||||||
"noFallthroughCasesInSwitch": true,
|
|
||||||
"noUncheckedIndexedAccess": true,
|
|
||||||
"noImplicitOverride": true,
|
|
||||||
|
|
||||||
// Some stricter flags (disabled by default)
|
|
||||||
"noUnusedLocals": false,
|
|
||||||
"noUnusedParameters": false,
|
|
||||||
"noPropertyAccessFromIndexSignature": false
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user