-
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
4 changed files
with
106 additions
and
1 deletion.
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,27 @@ | ||
type GameItem = record { | ||
tag : vec text; | ||
is_delete : bool; | ||
desc : text; | ||
name : text; | ||
banner : vec text; | ||
follow : nat64; | ||
avatar : text; | ||
}; | ||
type Result = variant { Ok; Err : text }; | ||
type Result_1 = variant { Ok : UserInfo; Err : text }; | ||
type UserBaseInfo = record { name : text; avatar : text }; | ||
type UserInfo = record { name : text; follow : vec nat64; avatar : text }; | ||
service : { | ||
add_owner : (principal) -> (); | ||
cancel_follow : (nat64) -> (Result); | ||
create_game : (GameItem) -> (); | ||
delete_owner : (principal) -> (); | ||
follow : (nat64) -> (Result); | ||
get_game : (nat64) -> (opt GameItem) query; | ||
get_game_list : () -> (vec record { nat64; GameItem }) query; | ||
get_owner : () -> (vec principal) query; | ||
get_user_info : () -> (Result_1) query; | ||
set_heat : (nat64, nat64) -> (Result); | ||
set_user_info : (UserBaseInfo) -> (); | ||
update_game : (nat64, GameItem) -> (Result); | ||
}; |
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,36 @@ | ||
export const idlFactory = ({ IDL }) => { | ||
const Result = IDL.Variant({ Ok: IDL.Null, Err: IDL.Text }); | ||
const GameItem = IDL.Record({ | ||
tag: IDL.Vec(IDL.Text), | ||
is_delete: IDL.Bool, | ||
desc: IDL.Text, | ||
name: IDL.Text, | ||
banner: IDL.Vec(IDL.Text), | ||
follow: IDL.Nat64, | ||
avatar: IDL.Text, | ||
}); | ||
const UserInfo = IDL.Record({ | ||
name: IDL.Text, | ||
follow: IDL.Vec(IDL.Nat64), | ||
avatar: IDL.Text, | ||
}); | ||
const Result_1 = IDL.Variant({ Ok: UserInfo, Err: IDL.Text }); | ||
const UserBaseInfo = IDL.Record({ name: IDL.Text, avatar: IDL.Text }); | ||
return IDL.Service({ | ||
add_owner: IDL.Func([IDL.Principal], [], []), | ||
cancel_follow: IDL.Func([IDL.Nat64], [Result], []), | ||
create_game: IDL.Func([GameItem], [], []), | ||
delete_owner: IDL.Func([IDL.Principal], [], []), | ||
follow: IDL.Func([IDL.Nat64], [Result], []), | ||
get_game: IDL.Func([IDL.Nat64], [IDL.Opt(GameItem)], ['query']), | ||
get_game_list: IDL.Func([], [IDL.Vec(IDL.Tuple(IDL.Nat64, GameItem))], ['query']), | ||
get_owner: IDL.Func([], [IDL.Vec(IDL.Principal)], ['query']), | ||
get_user_info: IDL.Func([], [Result_1], ['query']), | ||
set_heat: IDL.Func([IDL.Nat64, IDL.Nat64], [Result], []), | ||
set_user_info: IDL.Func([UserBaseInfo], [], []), | ||
update_game: IDL.Func([IDL.Nat64, GameItem], [Result], []), | ||
}); | ||
}; | ||
export const init = ({ IDL }) => { | ||
return []; | ||
}; |
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,35 @@ | ||
import type { Principal } from '@dfinity/agent'; | ||
export interface GameItem { | ||
tag: Array<string>; | ||
is_delete: boolean; | ||
desc: string; | ||
name: string; | ||
banner: Array<string>; | ||
follow: bigint; | ||
avatar: string; | ||
} | ||
export type Result = { Ok: null } | { Err: string }; | ||
export type Result_1 = { Ok: UserInfo } | { Err: string }; | ||
export interface UserBaseInfo { | ||
name: string; | ||
avatar: string; | ||
} | ||
export interface UserInfo { | ||
name: string; | ||
follow: Array<bigint>; | ||
avatar: string; | ||
} | ||
export default interface _SERVICE { | ||
add_owner: (arg_0: Principal) => Promise<undefined>; | ||
cancel_follow: (arg_0: bigint) => Promise<Result>; | ||
create_game: (arg_0: GameItem) => Promise<undefined>; | ||
delete_owner: (arg_0: Principal) => Promise<undefined>; | ||
follow: (arg_0: bigint) => Promise<Result>; | ||
get_game: (arg_0: bigint) => Promise<[] | [GameItem]>; | ||
get_game_list: () => Promise<Array<[bigint, GameItem]>>; | ||
get_owner: () => Promise<Array<Principal>>; | ||
get_user_info: () => Promise<Result_1>; | ||
set_heat: (arg_0: bigint, arg_1: bigint) => Promise<Result>; | ||
set_user_info: (arg_0: UserBaseInfo) => Promise<undefined>; | ||
update_game: (arg_0: bigint, arg_1: GameItem) => Promise<Result>; | ||
} |