-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Crystalin
committed
Aug 1, 2022
1 parent
3d9e96c
commit b352c24
Showing
16 changed files
with
294 additions
and
202 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
|
||
import { authorizedChains } from "../methods/utils"; | ||
import { TxWrapperArgs } from "./types"; | ||
|
||
export const commonWrapperArgs: {[Property in keyof TxWrapperArgs]: any} = { | ||
sudo: { | ||
describe: "activates sudo mode", | ||
type: "boolean" as "boolean", | ||
default: false, | ||
demandOption: false, | ||
}, | ||
"proxied-account": { | ||
describe: "address of the proxied account", | ||
type: "string" as "string", | ||
}, | ||
"proxy-type": { | ||
describe: "Type of proxy", | ||
type: "string" as "string", | ||
}, | ||
}; | ||
|
||
export const commonNetworkArgs = { | ||
network: { | ||
describe: "the network on which you want to send the tx", | ||
type: "string" as "string", | ||
choices: authorizedChains, | ||
demandOption: true, | ||
}, | ||
ws: { | ||
describe: "websocket address of the endpoint on which to connect", | ||
type: "string" as "string", | ||
demandOption: true, | ||
} | ||
} | ||
|
||
export const commonArgs = { | ||
...commonWrapperArgs, | ||
...commonNetworkArgs | ||
} |
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,59 @@ | ||
// Command Args | ||
export interface SignArgs extends SignPromptArgs { | ||
message?: string; | ||
} | ||
export interface SignPromptArgs { | ||
type?: string; | ||
"private-key"?: string; | ||
derivePath: string; | ||
} | ||
export interface VerifyArgs { | ||
message?: string; | ||
signature?: string; | ||
"public-key"?: string; | ||
type?: string; | ||
} | ||
export interface SendTxArgs { | ||
ws?: string; | ||
"tx-data"?: string; | ||
} | ||
|
||
export interface CreateAndSendArgs { | ||
address?: string; | ||
tx?: string; | ||
params?: string; | ||
nonce?: number; | ||
immortality: boolean; | ||
} | ||
export interface VoteCouncilArgs { | ||
address?: string; | ||
} | ||
|
||
export type TxParam = boolean | string | number | { [key: string]: any }; | ||
|
||
|
||
// Methods args | ||
export interface TxArgs { | ||
nonce?: number; | ||
tx: string; | ||
params: TxParam[]; | ||
address: string; | ||
immortality?: boolean; | ||
} | ||
|
||
export interface TxWrapperArgs { | ||
sudo?: boolean; | ||
"proxied-account"?: string; | ||
"proxy-type"?: "Any" | string; | ||
} | ||
|
||
export interface NetworkArgs { | ||
ws?: string; | ||
network?: string; | ||
} | ||
|
||
export type NetworkType = "ethereum" | "sr25519"; | ||
|
||
export interface Vote { | ||
yes: boolean; | ||
} |
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
Oops, something went wrong.