-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[language/examples] Vesting Contract
- Loading branch information
Showing
15 changed files
with
727 additions
and
314 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,29 @@ | ||
import * as t from "io-ts/lib/index.js"; | ||
import { ApplicableInputs } from "./applicables/index.js"; | ||
export { toInput } from "./applicables/canDeposit.js"; | ||
import { isNone, none } from "fp-ts/lib/Option.js"; | ||
export * as Deposit from "./applicables/canDeposit.js"; | ||
export * as Choice from "./applicables/canChoose.js"; | ||
export * as Notify from "./applicables/canNotify.js"; | ||
|
||
export type Next = t.TypeOf<typeof Next>; | ||
export const Next = t.type({ | ||
can_reduce: t.boolean, | ||
applicable_inputs: ApplicableInputs, | ||
}); | ||
|
||
export const emptyApplicables = (next: Next) => { | ||
return ( | ||
next.applicable_inputs.choices.length === 0 && | ||
next.applicable_inputs.deposits.length === 0 && | ||
isNone(next.applicable_inputs.notify) | ||
); | ||
}; | ||
|
||
export const noNext: Next = { | ||
can_reduce: false, | ||
applicable_inputs: { | ||
deposits: [], | ||
choices: [], | ||
notify: none, | ||
}, | ||
}; |
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 |
---|---|---|
@@ -1,2 +1,3 @@ | ||
export * as SwapADAToken from "./swaps/swap-token-token.js"; | ||
export { oneNotifyTrue } from "./contract-one-notify.js"; | ||
export * as Vesting from "./vesting.js"; |
Oops, something went wrong.