Skip to content

Commit

Permalink
refactor: generate did
Browse files Browse the repository at this point in the history
  • Loading branch information
agustinustheo committed Aug 15, 2024
1 parent 2b00d43 commit 6043df3
Show file tree
Hide file tree
Showing 3 changed files with 30 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .maintain/script/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,14 @@ This CLI tool is designed to interact with the ICSI (ICP Sub-Account Indexer) ca
## Installation

1. Clone the repository:

```
git clone <repository-url>
cd <project-directory>
```

2. Install dependencies:

```
npm install
```
Expand Down Expand Up @@ -54,16 +56,19 @@ node index.js --cli <method_name> [arguments]
#### Available Commands:

1. Add a subaccount:

```
node index.js --cli add_subaccount
```

2. Set webhook URL:

```
node index.js --cli set_webhook_url https://example.com/webhook
```

3. Other available methods:

- get_account_identifier_transactions
- query_blocks
- get_network
Expand All @@ -85,6 +90,7 @@ node index.js --cli <method_name> [arguments]
- get_webhook_url

Example usage:

```
node index.js --cli get_network
```
Expand Down Expand Up @@ -117,4 +123,4 @@ Contributions to improve the CLI tool are welcome. Please follow these steps:

## License

This project is licensed under the MIT License - see the [LICENSE](../../LICENSE) file for details.
This project is licensed under the MIT License - see the [LICENSE](../../LICENSE) file for details.
8 changes: 8 additions & 0 deletions src/icp_subaccount_indexer/icp_subaccount_indexer.did
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ type Approve = record {
type Burn = record { from : blob; amount : E8s; spender : opt blob };
type E8s = record { e8s : nat64 };
type Error = record { message : text };
type HttpHeader = record { value : text; name : text };
type HttpResponse = record {
status : nat;
body : blob;
headers : vec HttpHeader;
};
type Mint = record { to : blob; amount : E8s };
type Network = variant { Mainnet; Local };
type Operation = variant {
Expand Down Expand Up @@ -46,6 +52,7 @@ type Transfer = record {
amount : E8s;
spender : opt blob;
};
type TransformArgs = record { context : blob; response : HttpResponse };
service : (Network, nat64, nat32, text, text) -> {
add_subaccount : () -> (Result);
canister_status : () -> (Result_1) query;
Expand All @@ -69,4 +76,5 @@ service : (Network, nat64, nat32, text, text) -> {
single_sweep : (text) -> (Result_9);
sweep : () -> (Result_9);
sweep_subaccount : (text, float64) -> (Result_8);
transform : (TransformArgs) -> (HttpResponse) query;
}
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,15 @@ export interface E8s {
export interface Error {
message: string;
}
export interface HttpHeader {
value: string;
name: string;
}
export interface HttpResponse {
status: bigint;
body: Uint8Array | number[];
headers: Array<HttpHeader>;
}
export interface Mint {
to: Uint8Array | number[];
amount: E8s;
Expand Down Expand Up @@ -65,6 +74,10 @@ export interface Transfer {
amount: E8s;
spender: [] | [Uint8Array | number[]];
}
export interface TransformArgs {
context: Uint8Array | number[];
response: HttpResponse;
}
export interface _SERVICE {
add_subaccount: ActorMethod<[], Result>;
canister_status: ActorMethod<[], Result_1>;
Expand All @@ -87,6 +100,8 @@ export interface _SERVICE {
set_webhook_url: ActorMethod<[string], Result>;
single_sweep: ActorMethod<[string], Result_9>;
sweep: ActorMethod<[], Result_9>;
sweep_subaccount: ActorMethod<[string, number], Result_8>;
transform: ActorMethod<[TransformArgs], HttpResponse>;
}
export declare const idlFactory: IDL.InterfaceFactory;
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];

0 comments on commit 6043df3

Please sign in to comment.