-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8 from ebceu4/updates
Updates
- Loading branch information
Showing
5 changed files
with
101 additions
and
12 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { TransactionType, Tx } from './transactions' | ||
import { SeedTypes } from "./generic"; | ||
import { issue } from "./transactions/issue"; | ||
import { transfer } from "./transactions/transfer"; | ||
import { reissue } from "./transactions/reissue"; | ||
import { burn } from "./transactions/burn"; | ||
import { lease } from "./transactions/lease"; | ||
import { cancelLease } from "./transactions/cancel-lease"; | ||
import { data } from "./transactions/data"; | ||
import { massTransfer } from "./transactions/mass-transfer"; | ||
import { alias } from "./transactions/alias"; | ||
import { setScript } from "./transactions/set-script"; | ||
|
||
export function signTx(seed: SeedTypes, tx: Tx): Tx { | ||
switch (tx.type) { | ||
case TransactionType.Issue: | ||
return issue(seed, tx); | ||
case TransactionType.Transfer: | ||
return transfer(seed, tx); | ||
case TransactionType.Reissue: | ||
return reissue(seed, tx); | ||
case TransactionType.Burn: | ||
return burn(seed, tx); | ||
case TransactionType.Lease: | ||
return lease(seed, tx); | ||
case TransactionType.CancelLease: | ||
return cancelLease(seed, tx); | ||
case TransactionType.Alias: | ||
return alias(seed, tx); | ||
case TransactionType.MassTransfer: | ||
return massTransfer(seed, tx); | ||
case TransactionType.Data: | ||
return data(seed, tx); | ||
case TransactionType.SetScript: | ||
return setScript(seed, tx); | ||
default: | ||
throw new Error(`Unknown tx type: ${tx!.type}`) | ||
} | ||
} |
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