-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
11 changed files
with
220 additions
and
32 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
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,34 @@ | ||
import { grpc } from '@improbable-eng/grpc-web' | ||
import { | ||
DeepPartial, | ||
QueryAllFilesRequest, | ||
QueryAllFilesResponse, | ||
QueryAllPubkeysRequest, QueryAllPubkeysResponse, | ||
QueryDecryptRequest, | ||
QueryDecryptResponse, | ||
QueryEncryptRequest, | ||
QueryEncryptResponse, | ||
QueryFileRequest, | ||
QueryFileResponse, | ||
QueryParamsRequest, | ||
QueryParamsResponse, | ||
QueryPubkeyRequest, | ||
QueryPubkeyResponse | ||
} from '@/postgen/canine_chain/filetree/query' | ||
|
||
export default interface IQueryFileTree { | ||
/** Parameters queries the parameters of the module. */ | ||
queryParams(request: DeepPartial<QueryParamsRequest>, metadata?: grpc.Metadata): Promise<QueryParamsResponse>; | ||
/** Queries a list of Encrypt items. */ | ||
queryEncrypt(request: DeepPartial<QueryEncryptRequest>, metadata?: grpc.Metadata): Promise<QueryEncryptResponse>; | ||
/** Queries a list of Decrypt items. */ | ||
queryDecrypt(request: DeepPartial<QueryDecryptRequest>, metadata?: grpc.Metadata): Promise<QueryDecryptResponse>; | ||
/** Queries a Files by index. */ | ||
queryFiles(request: DeepPartial<QueryFileRequest>, metadata?: grpc.Metadata): Promise<QueryFileResponse>; | ||
/** Queries a list of Files items. */ | ||
queryFilesAll(request: DeepPartial<QueryAllFilesRequest>, metadata?: grpc.Metadata): Promise<QueryAllFilesResponse>; | ||
/** Queries a Pubkey by index. */ | ||
queryPubkey(request: DeepPartial<QueryPubkeyRequest>, metadata?: grpc.Metadata): Promise<QueryPubkeyResponse>; | ||
/** Queries a list of Pubkey items. */ | ||
queryPubkeyAll(request: DeepPartial<QueryAllPubkeysRequest>, metadata?: grpc.Metadata): Promise<QueryAllPubkeysResponse>; | ||
} |
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,52 @@ | ||
import IQueryFileTree from '@/interfaces/classes/IQueryFileTree' | ||
import { | ||
DeepPartial, | ||
GrpcWebImpl, | ||
Query, | ||
QueryAllFilesRequest, QueryAllFilesResponse, | ||
QueryAllPubkeysRequest, QueryAllPubkeysResponse, | ||
QueryClientImpl, | ||
QueryDecryptRequest, QueryDecryptResponse, | ||
QueryEncryptRequest, QueryEncryptResponse, | ||
QueryFileRequest, QueryFileResponse, | ||
QueryParamsRequest, QueryParamsResponse, | ||
QueryPubkeyRequest, QueryPubkeyResponse | ||
} from '@/postgen/canine_chain/filetree/query' | ||
import { grpc } from '@improbable-eng/grpc-web' | ||
|
||
export default class QueryFileTree implements IQueryFileTree { | ||
private readonly queryClient: Query | ||
|
||
constructor (rpc: GrpcWebImpl) { | ||
this.queryClient = new QueryClientImpl(rpc) | ||
} | ||
|
||
/** Parameters queries the parameters of the module. */ | ||
queryParams(request: DeepPartial<QueryParamsRequest>, metadata?: grpc.Metadata): Promise<QueryParamsResponse> { | ||
return this.queryClient.Params(request, metadata) | ||
} | ||
/** Queries a list of Encrypt items. */ | ||
queryEncrypt(request: DeepPartial<QueryEncryptRequest>, metadata?: grpc.Metadata): Promise<QueryEncryptResponse> { | ||
return this.queryClient.Encrypt(request, metadata) | ||
} | ||
/** Queries a list of Decrypt items. */ | ||
queryDecrypt(request: DeepPartial<QueryDecryptRequest>, metadata?: grpc.Metadata): Promise<QueryDecryptResponse> { | ||
return this.queryClient.Decrypt(request, metadata) | ||
} | ||
/** Queries a Files by index. */ | ||
queryFiles(request: DeepPartial<QueryFileRequest>, metadata?: grpc.Metadata): Promise<QueryFileResponse> { | ||
return this.queryClient.Files(request, metadata) | ||
} | ||
/** Queries a list of Files items. */ | ||
queryFilesAll(request: DeepPartial<QueryAllFilesRequest>, metadata?: grpc.Metadata): Promise<QueryAllFilesResponse> { | ||
return this.queryClient.FilesAll(request, metadata) | ||
} | ||
/** Queries a Pubkey by index. */ | ||
queryPubkey(request: DeepPartial<QueryPubkeyRequest>, metadata?: grpc.Metadata): Promise<QueryPubkeyResponse> { | ||
return this.queryClient.Pubkey(request, metadata) | ||
} | ||
/** Queries a list of Pubkey items. */ | ||
queryPubkeyAll(request: DeepPartial<QueryAllPubkeysRequest>, metadata?: grpc.Metadata): Promise<QueryAllPubkeysResponse> { | ||
return this.queryClient.PubkeyAll(request, metadata) | ||
} | ||
} |
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,81 @@ | ||
import { | ||
MsgAddEditors, | ||
MsgAddViewers, | ||
MsgChangeOwner, | ||
MsgDeleteFile, | ||
MsgMakeRoot, | ||
MsgPostFile, | ||
MsgPostkey, | ||
MsgRemoveEditors, | ||
MsgRemoveViewers, | ||
MsgResetEditors, | ||
MsgResetViewers | ||
} from '@/postgen/canine_chain/filetree/tx' | ||
import { EncodeObject } from '@cosmjs/proto-signing' | ||
import ITypeTuple from '@/interfaces/ITypeTuple' | ||
|
||
const fileTreeTypes: ITypeTuple = { | ||
postFile: ['/canine_chain.filetree.MsgPostFile', MsgPostFile], | ||
addViewers: ['/canine_chain.filetree.MsgAddViewers', MsgAddViewers], | ||
postkey: ['/canine_chain.filetree.MsgPostkey', MsgPostkey], | ||
deleteFile: ['/canine_chain.filetree.MsgDeleteFile', MsgDeleteFile], | ||
removeViewers: ['/canine_chain.filetree.MsgRemoveViewers', MsgRemoveViewers], | ||
makeRoot: ['/canine_chain.filetree.MsgMakeRoot', MsgMakeRoot], | ||
addEditors: ['/canine_chain.filetree.MsgAddEditors', MsgAddEditors], | ||
removeEditors: ['/canine_chain.filetree.MsgRemoveEditors', MsgRemoveEditors], | ||
resetEditors: ['/canine_chain.filetree.MsgResetEditors', MsgResetEditors], | ||
resetViewers: ['/canine_chain.filetree.MsgResetViewers', MsgResetViewers], | ||
changeOwner: ['/canine_chain.filetree.MsgChangeOwner', MsgChangeOwner] | ||
} | ||
|
||
export default fileTreeTypes | ||
|
||
export interface ITxFileTree { | ||
msgPostFile (data: MsgPostFile): EncodeObject | ||
msgAddViewers (data: MsgAddViewers): EncodeObject | ||
msgPostkey (data: MsgPostkey): EncodeObject | ||
msgDeleteFile (data: MsgDeleteFile): EncodeObject | ||
msgRemoveViewers (data: MsgRemoveViewers): EncodeObject | ||
msgMakeRoot (data: MsgMakeRoot): EncodeObject | ||
msgAddEditors (data: MsgAddEditors): EncodeObject | ||
msgRemoveEditors (data: MsgRemoveEditors): EncodeObject | ||
msgResetEditors (data: MsgResetEditors): EncodeObject | ||
msgResetViewers (data: MsgResetViewers): EncodeObject | ||
msgChangeOwner (data: MsgChangeOwner): EncodeObject | ||
} | ||
|
||
export class TxFileTree implements ITxFileTree { | ||
msgPostFile (data: MsgPostFile): EncodeObject { | ||
return { typeUrl: fileTreeTypes.postFile[0], value: fileTreeTypes.postFile[1].fromPartial( data ) } | ||
} | ||
msgAddViewers (data: MsgAddViewers): EncodeObject { | ||
return { typeUrl: fileTreeTypes.addViewers[0], value: fileTreeTypes.addViewers[1].fromPartial( data ) } | ||
} | ||
msgPostkey (data: MsgPostkey): EncodeObject { | ||
return { typeUrl: fileTreeTypes.postkey[0], value: fileTreeTypes.postkey[1].fromPartial( data ) } | ||
} | ||
msgDeleteFile (data: MsgDeleteFile): EncodeObject { | ||
return { typeUrl: fileTreeTypes.deleteFile[0], value: fileTreeTypes.deleteFile[1].fromPartial( data ) } | ||
} | ||
msgRemoveViewers (data: MsgRemoveViewers): EncodeObject { | ||
return { typeUrl: fileTreeTypes.removeViewers[0], value: fileTreeTypes.removeViewers[1].fromPartial( data ) } | ||
} | ||
msgMakeRoot (data: MsgMakeRoot): EncodeObject { | ||
return { typeUrl: fileTreeTypes.makeRoot[0], value: fileTreeTypes.makeRoot[1].fromPartial( data ) } | ||
} | ||
msgAddEditors (data: MsgAddEditors): EncodeObject { | ||
return { typeUrl: fileTreeTypes.addEditors[0], value: fileTreeTypes.addEditors[1].fromPartial( data ) } | ||
} | ||
msgRemoveEditors (data: MsgRemoveEditors): EncodeObject { | ||
return { typeUrl: fileTreeTypes.removeEditors[0], value: fileTreeTypes.removeEditors[1].fromPartial( data ) } | ||
} | ||
msgResetEditors (data: MsgResetEditors): EncodeObject { | ||
return { typeUrl: fileTreeTypes.resetEditors[0], value: fileTreeTypes.resetEditors[1].fromPartial( data ) } | ||
} | ||
msgResetViewers (data: MsgResetViewers): EncodeObject { | ||
return { typeUrl: fileTreeTypes.resetViewers[0], value: fileTreeTypes.resetViewers[1].fromPartial( data ) } | ||
} | ||
msgChangeOwner (data: MsgChangeOwner): EncodeObject { | ||
return { typeUrl: fileTreeTypes.changeOwner[0], value: fileTreeTypes.changeOwner[1].fromPartial( 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
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