-
Notifications
You must be signed in to change notification settings - Fork 14
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
1 parent
dff3b51
commit 81dd6bc
Showing
23 changed files
with
1,382 additions
and
2,183 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
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,55 @@ | ||
import { ApiRequest } from "../../ApiRequest"; | ||
import { ApiPrimitiveJson, RequestParams } from "../../ApiPrimitive"; | ||
import { SIGN_DATA } from "../../../constants/cmds"; | ||
import { DataDescriptor } from "../../../utils/types/DataDescriptor"; | ||
import { SignData } from "../../../utils/types/SignData"; | ||
|
||
export type signDataArgs = { | ||
address?: string; | ||
filename?: string; | ||
message?: string; | ||
messagehex?: string; | ||
messsagebase64?: string; | ||
datahash?: string; | ||
vdxfdata?: string; | ||
mmrdata?: Array<DataDescriptor | SignData>; | ||
mmrsalt?: Array<string>; | ||
mmrhashtype?: string; | ||
priormmr?: Array<string>; | ||
vdxfkeys?: Array<string>; | ||
vdxfkeynames?: Array<string>; | ||
boundhahses?: Array<string>; | ||
hashtype?: string; | ||
signature?: string; | ||
encrypttoaddress?: string; | ||
createmmr?: boolean; | ||
} | ||
|
||
export class SignDataRequest extends ApiRequest { | ||
data: signDataArgs; | ||
|
||
constructor(chain: string, signableItems: signDataArgs) { | ||
super(chain, SIGN_DATA); | ||
this.data = signableItems; | ||
} | ||
|
||
getParams(): RequestParams { | ||
const params = [this.data]; | ||
|
||
return params.filter((x) => x != null); | ||
} | ||
|
||
static fromJson(object: ApiPrimitiveJson): SignDataRequest { | ||
return new SignDataRequest( | ||
object.chain as string, | ||
object.data as signDataArgs | ||
); | ||
} | ||
|
||
toJson(): ApiPrimitiveJson { | ||
return { | ||
chain: this.chain, | ||
data: this.data, | ||
}; | ||
} | ||
} |
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 @@ | ||
import { ApiResponse } from "../../ApiResponse"; | ||
import { Signature } from "../../../utils/types/Signature"; | ||
import { mmrDescriptorParameters } from "../../../utils/types/MmrDescriptor"; | ||
import { DataDescriptor } from "../../../utils/types/DataDescriptor"; | ||
|
||
export class SignDataResponse extends ApiResponse { | ||
result: { | ||
mmrdescriptor_encrypted: mmrDescriptorParameters; | ||
mmrdescriptor: mmrDescriptorParameters; | ||
signature: string; | ||
signaturedata_encrypted: DataDescriptor; | ||
signaturedata_ssk: string; | ||
signaturedata: Signature; | ||
system: string; | ||
systemid: string; | ||
hashtype: string; | ||
mmrhashtype: string; | ||
hash: string; | ||
identity: string; | ||
canonicalname: string; | ||
address: string; | ||
signatureheight: number; | ||
}; | ||
} |
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.