File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ import { BigNumber } from 'ethers'
99import { FallbackableOverrides } from '../../common/utils/execute'
1010import { devClients } from './clients/devClients'
1111
12- type ApproveIfNeeded = ( factoryOptions : {
12+ export type ApproveIfNeeded = ( factoryOptions : {
1313 readonly provider : Provider
1414 readonly requiredAmount : string
1515 readonly from : string
@@ -24,6 +24,10 @@ type ApproveIfNeeded = (factoryOptions: {
2424 readonly waitOrSkip : ( ) => Promise < TransactionResponse >
2525} >
2626
27+ export type ApproveIfNeededResult = {
28+ readonly approveIfNeeded : ReturnType < ApproveIfNeeded >
29+ }
30+
2731export const approveIfNeeded : ApproveIfNeeded =
2832 ( factoryOptions ) => async ( options ) => {
2933 const [ l1 , l2 ] = await devClients ( factoryOptions . provider )
Original file line number Diff line number Diff line change 11import { FallbackableOverrides } from '../common/utils/execute'
22import { Provider } from '@ethersproject/abstract-provider'
33import { lockupClients } from './common/clients/lockupClients'
4- import { approveIfNeeded as _approveIfNeeded } from './common/approveIfNeeded'
4+ import {
5+ approveIfNeeded as _approveIfNeeded ,
6+ ApproveIfNeededResult ,
7+ } from './common/approveIfNeeded'
58import { UndefinedOr } from '@devprotocol/util-ts'
69
710type PositionsCreate = ( options : {
@@ -10,11 +13,7 @@ type PositionsCreate = (options: {
1013 readonly destination : string
1114 readonly amount : string
1215 readonly overrides ?: FallbackableOverrides
13- } ) => Promise <
14- UndefinedOr < {
15- readonly approveIfNeeded : ReturnType < typeof _approveIfNeeded >
16- } >
17- >
16+ } ) => Promise < UndefinedOr < ApproveIfNeededResult > >
1817
1918export const positionsCreate : PositionsCreate = async ( options ) => {
2019 const [ l1 , l2 ] = await lockupClients ( options . provider )
Original file line number Diff line number Diff line change 1- import { TransactionResponse } from '@ethersproject/abstract-provider'
21import { FallbackableOverrides } from '../common/utils/execute'
32import { Provider } from '@ethersproject/abstract-provider'
43import { UndefinedOr } from '@devprotocol/util-ts'
4+ import { ApproveIfNeededResult } from './common/approveIfNeeded'
55
66type PositionsUpdate = ( options : {
77 readonly provider : Provider
88 readonly positionId : number
99 readonly additionalAmount : string
1010 readonly overrides ?: FallbackableOverrides
11- } ) => Promise < UndefinedOr < TransactionResponse > >
11+ } ) => Promise < UndefinedOr < ApproveIfNeededResult > >
Original file line number Diff line number Diff line change 1+ import { Provider } from '@ethersproject/abstract-provider'
2+ import { UndefinedOr } from '@devprotocol/util-ts'
3+
4+ type Asset = {
5+ readonly market : string
6+ readonly marketSlug ?: string
7+ readonly id : string
8+ }
9+
10+ type PropertiesAssets = ( options : {
11+ readonly provider : Provider
12+ readonly destination ?: string
13+ } ) => Promise < UndefinedOr < readonly Asset [ ] > >
Original file line number Diff line number Diff line change 1+ import { FallbackableOverrides } from '../common/utils/execute'
2+ import { Provider , TransactionResponse } from '@ethersproject/abstract-provider'
3+ import { UndefinedOr } from '@devprotocol/util-ts'
4+
5+ type PropertiesAuthenticate = ( options : {
6+ readonly provider : Provider
7+ readonly destination : string
8+ readonly authentication : {
9+ readonly market : string
10+ readonly options : readonly string [ ]
11+ }
12+ readonly overrides ?: FallbackableOverrides
13+ } ) => Promise <
14+ UndefinedOr <
15+ TransactionResponse & {
16+ readonly wait : ( ) => Promise < TransactionResponse >
17+ }
18+ >
19+ >
Original file line number Diff line number Diff line change 1+ import { TransactionResponse } from '@ethersproject/abstract-provider'
2+ import { FallbackableOverrides } from '../common/utils/execute'
3+ import { Provider } from '@ethersproject/abstract-provider'
4+ import { UndefinedOr } from '@devprotocol/util-ts'
5+
6+ type PropertiesCreate = ( options : {
7+ readonly provider : Provider
8+ readonly name : string
9+ readonly symbol : string
10+ readonly author : string
11+ readonly overrides ?: FallbackableOverrides
12+ } ) => Promise < UndefinedOr < TransactionResponse > >
Original file line number Diff line number Diff line change 1+ import { FallbackableOverrides } from '../common/utils/execute'
2+ import { Provider , TransactionResponse } from '@ethersproject/abstract-provider'
3+ import { UndefinedOr } from '@devprotocol/util-ts'
4+
5+ type PropertiesCreateToAuthenticate = ( options : {
6+ readonly provider : Provider
7+ readonly name : string
8+ readonly symbol : string
9+ readonly author : string
10+ readonly authentication : {
11+ readonly market : string
12+ readonly options : readonly string [ ]
13+ readonly overrides ?: FallbackableOverrides
14+ }
15+ readonly overrides ?: FallbackableOverrides
16+ } ) => Promise <
17+ UndefinedOr <
18+ TransactionResponse & {
19+ readonly wait : ( ) => Promise < TransactionResponse >
20+ }
21+ >
22+ >
Original file line number Diff line number Diff line change 1+ import { FallbackableOverrides } from '../common/utils/execute'
2+ import { Provider , TransactionResponse } from '@ethersproject/abstract-provider'
3+ import { UndefinedOr } from '@devprotocol/util-ts'
4+
5+ type PropertiesDeauthenticate = ( options : {
6+ readonly provider : Provider
7+ readonly destination : string
8+ readonly authentication : {
9+ readonly market : string
10+ readonly id : string
11+ }
12+ readonly overrides ?: FallbackableOverrides
13+ } ) => Promise < UndefinedOr < TransactionResponse > >
Original file line number Diff line number Diff line change 1+ import { Provider } from '@ethersproject/abstract-provider'
2+ import { UndefinedOr } from '@devprotocol/util-ts'
3+
4+ type PropertiesList = ( options : {
5+ readonly provider : Provider
6+ readonly user ?: string
7+ } ) => Promise < UndefinedOr < readonly string [ ] > >
You can’t perform that action at this time.
0 commit comments