Skip to content

Commit

Permalink
chore: ws_types.did import
Browse files Browse the repository at this point in the history
  • Loading branch information
ilbertt committed Aug 9, 2023
1 parent a9e5df4 commit dbc476e
Show file tree
Hide file tree
Showing 2 changed files with 87 additions and 81 deletions.
82 changes: 1 addition & 81 deletions tests/test_canister/src/test_canister/test_canister.did
Original file line number Diff line number Diff line change
@@ -1,84 +1,4 @@
type ClientPublicKey = blob;

type DirectClientMessage = record {
client_key : ClientPublicKey;
message : blob;
};

type RelayedClientMessage = record {
content : blob;
sig : blob;
};

type CanisterIncomingMessage = variant {
DirectlyFromClient : DirectClientMessage;
RelayedByGateway : RelayedClientMessage;
IcWebSocketEstablished : ClientPublicKey;
};

type CanisterOutputMessage = record {
client_key : ClientPublicKey;
key : text;
val : blob;
};

type CanisterOutputCertifiedMessages = record {
messages : vec CanisterOutputMessage;
cert : blob;
tree : blob;
};

type CanisterWsRegisterArguments = record {
client_key : ClientPublicKey;
};

type CanisterWsRegisterResult = variant {
Ok : null;
Err : text;
};

type CanisterWsOpenArguments = record {
msg : blob;
sig : blob;
};

type CanisterWsOpenResultValue = record {
client_key : ClientPublicKey;
canister_id : principal;
nonce : nat64;
};

type CanisterWsOpenResult = variant {
Ok : CanisterWsOpenResultValue;
Err : text;
};

type CanisterWsCloseArguments = record {
client_key : ClientPublicKey;
};

type CanisterWsCloseResult = variant {
Ok : null;
Err : text;
};

type CanisterWsMessageArguments = record {
msg : CanisterIncomingMessage;
};

type CanisterWsMessageResult = variant {
Ok : null;
Err : text;
};

type CanisterWsGetMessagesArguments = record {
nonce : nat64;
};

type CanisterWsGetMessagesResult = variant {
Ok : CanisterOutputCertifiedMessages;
Err : text;
};
import "./ws_types.did";

type CanisterWsSendResult = variant {
Ok : null;
Expand Down
86 changes: 86 additions & 0 deletions tests/test_canister/src/test_canister/ws_types.did
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
type ClientPublicKey = blob;

type DirectClientMessage = record {
client_key : ClientPublicKey;
message : blob;
};

type RelayedClientMessage = record {
content : blob;
sig : blob;
};

type GatewayStatusMessage = record {
status_index : nat64;
};

type CanisterIncomingMessage = variant {
DirectlyFromClient : DirectClientMessage;
RelayedByGateway : RelayedClientMessage;
IcWebSocketEstablished : ClientPublicKey;
IcWebSocketGatewayStatus : GatewayStatusMessage;
};

type CanisterOutputMessage = record {
client_key : ClientPublicKey;
key : text;
val : blob;
};

type CanisterOutputCertifiedMessages = record {
messages : vec CanisterOutputMessage;
cert : blob;
tree : blob;
};

type CanisterWsRegisterArguments = record {
client_key : ClientPublicKey;
};

type CanisterWsRegisterResult = variant {
Ok : null;
Err : text;
};

type CanisterWsOpenArguments = record {
msg : blob;
sig : blob;
};

type CanisterWsOpenResultValue = record {
client_key : ClientPublicKey;
canister_id : principal;
nonce : nat64;
};

type CanisterWsOpenResult = variant {
Ok : CanisterWsOpenResultValue;
Err : text;
};

type CanisterWsCloseArguments = record {
client_key : ClientPublicKey;
};

type CanisterWsCloseResult = variant {
Ok : null;
Err : text;
};

type CanisterWsMessageArguments = record {
msg : CanisterIncomingMessage;
};

type CanisterWsMessageResult = variant {
Ok : null;
Err : text;
};

type CanisterWsGetMessagesArguments = record {
nonce : nat64;
};

type CanisterWsGetMessagesResult = variant {
Ok : CanisterOutputCertifiedMessages;
Err : text;
};

0 comments on commit dbc476e

Please sign in to comment.