-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[WIP] Feature/dca cron job methods #31
Open
bathord
wants to merge
27
commits into
master
Choose a base branch
from
feature/dca-cron-job-methods
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
27 commits
Select commit
Hold shift + click to select a range
56ce444
Create getActiveDCAsFieldsByPackage()
bathord d851ad7
Create DCATimescaleToMillisecondsMap
bathord 60ca91e
Create getMillisecondsByDcaEveryParams()
bathord 178ac28
Create DCAObjectFields type
bathord ca99681
Add DCAObjectFields to StorageValue, upd StorageProperty & GetCachePa…
bathord 1255968
Create & use type guard for DCAObjectFields
bathord 616989a
Add return type
bathord a645882
Upd setCache & getCache to work with properties without provider
bathord ebd3533
Add isDcaTrading as possible StorageProperty
bathord 9554d0a
Create type guard for isDcaTrading
bathord 5545a59
Fix getFromStorage methods to print entire value data
bathord 80b8db2
Create methods to get & store isDcaTrading storage field
bathord b8d0ace
Merge branch 'example/trade-dcas' into feature/dca-cron-job-methods
bathord f368a3f
Merge branch 'example/trade-dcas' into feature/dca-cron-job-methods
bathord 2e7649c
Export Ed25519Keypair from mysten
bathord 4b6cb5d
Merge branch 'example/trade-dcas' into feature/dca-cron-job-methods
bathord 2b2bbc0
Merge branch 'master' into feature/dca-cron-job-methods
bathord 325f568
Merge branch 'example/trade-dcas' into feature/dca-cron-job-methods
bathord 2c9710a
Merge branch 'master' into feature/dca-cron-job-methods
bathord 8d82e47
Merge branch 'example/trade-dcas' into feature/dca-cron-job-methods
bathord 2c2b925
Export FeeManager from index
bathord 957dd58
Merge branch 'master' into feature/dca-cron-job-methods
bathord 5659a87
Add comments & TODO in RedisStorage
bathord 05fc745
Upd isValidDCAFields() to receive unknown
bathord d35ec69
Remove deplicating type guard & use isValidDCAFields()
bathord 80cf617
Create isValidDCAFieldsArray type guard
bathord e09714e
Use isValidDCAFieldsArray in isStorageValue type guard
bathord File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
/* eslint-disable require-jsdoc */ | ||
|
||
import { Storage, StorageProperty, StorageValue } from "../types"; | ||
import { isDcaIsTradingField } from "./typeguards"; | ||
|
||
export async function getIsDcaTradingCache({ storage }: { storage: Storage }): Promise<boolean> { | ||
let isDcaTrading = false; | ||
|
||
const isDcaTradingCache: StorageValue = await storage.getCache({ property: StorageProperty.IsDCATrading }); | ||
|
||
if (isDcaIsTradingField(isDcaTradingCache?.value)) { | ||
isDcaTrading = isDcaTradingCache.value; | ||
} else if (isDcaTradingCache === null) { | ||
console.warn("[getIsDcaTradingCache] Received empty isDcaTrading from strorage, isDcaTrading === null"); | ||
} else { | ||
const stringifiedIsDcaTrading: string = JSON.stringify(isDcaTradingCache.value); | ||
throw new Error( | ||
"[getIsDcaTradingCache] isDcaTrading from storage is not boolean or null. " + | ||
`Value from storage: ${stringifiedIsDcaTrading}`, | ||
); | ||
} | ||
|
||
return isDcaTrading; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
let's fix this