Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(station): requestor can cancel pending requests #426

Merged
merged 2 commits into from
Nov 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions apps/wallet/src/generated/station/station.did
Original file line number Diff line number Diff line change
Expand Up @@ -1106,6 +1106,23 @@ type CreateRequestResult = variant {
Err : Error;
};

// The input type for canceling a request.
type CancelRequestInput = record {
// The request id to cancel.
request_id : UUID;
// The reason for canceling the request.
reason : opt text;
};

// The result type for canceling a request.
type CancelRequestResult = variant {
Ok : record {
// The request that was canceled.
request : Request;
};
Err : Error;
};

type ListRequestsOperationType = variant {
// A new transfer of funds from a given account.
Transfer : opt UUID;
Expand Down Expand Up @@ -2708,6 +2725,13 @@ service : (opt SystemInstall) -> {
//
// The request will be created and the caller will be added as the requester.
create_request : (input : CreateRequestInput) -> (CreateRequestResult);
// Cancel a request if the request is in a cancelable state.
//
// Cancelable conditions:
//
// - The request is in the `Created` state.
// - The caller is the requester of the request.
cancel_request : (input : CancelRequestInput) -> (CancelRequestResult);
// Get the list of requests.
//
// Only requests that the caller has access to will be returned.
Expand Down
7 changes: 7 additions & 0 deletions apps/wallet/src/generated/station/station.did.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,12 @@ export interface CallExternalCanisterResourceTarget {
'execution_method' : ExecutionMethodResourceTarget,
'validation_method' : ValidationMethodResourceTarget,
}
export interface CancelRequestInput {
'request_id' : UUID,
'reason' : [] | [string],
}
export type CancelRequestResult = { 'Ok' : { 'request' : Request } } |
{ 'Err' : Error };
export interface CanisterExecutionAndValidationMethodPair {
'execution_method' : string,
'validation_method' : ValidationMethodResourceTarget,
Expand Down Expand Up @@ -1259,6 +1265,7 @@ export interface WasmModuleExtraChunks {
'extra_chunks_key' : string,
}
export interface _SERVICE {
'cancel_request' : ActorMethod<[CancelRequestInput], CancelRequestResult>,
'canister_status' : ActorMethod<[CanisterStatusInput], CanisterStatusResult>,
'capabilities' : ActorMethod<[], CapabilitiesResult>,
'create_request' : ActorMethod<[CreateRequestInput], CreateRequestResult>,
Expand Down
Loading
Loading