Skip to content

Commit

Permalink
dev(auth): add Single- and RefreshTokenContext types
Browse files Browse the repository at this point in the history
  • Loading branch information
theborakompanioni committed Sep 23, 2023
1 parent 465c023 commit a244c19
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/libs/JmWalletApi.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,21 @@ type Vout = number
export type TxId = string
export type UtxoId = `${TxId}:${Vout}`

// for JM versions <0.9.11
export type SingleApiTokenContext = {
token: ApiToken
}

// for JM versions >=0.9.11
export type RefreshApiTokenContext = SingleApiTokenContext & {
token_type: string // "bearer"
expires_in: Seconds // 1800
scope: string
refresh_token: ApiToken
}

export type ApiTokenContext = SingleApiTokenContext | RefreshApiTokenContext

type WithWalletName = {
walletName: WalletName
}
Expand Down

0 comments on commit a244c19

Please sign in to comment.