-
Notifications
You must be signed in to change notification settings - Fork 1
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
102 changed files
with
1,245 additions
and
189 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
Binary file not shown.
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,88 @@ | ||
type TxId = nat; | ||
|
||
type Account = record { owner : principal; subaccount : opt blob }; | ||
|
||
type SubAccount = blob; | ||
|
||
type Transaction = record { | ||
kind : text; | ||
mint : opt record { | ||
amount : nat; | ||
to : Account; | ||
memo : opt blob; | ||
created_at_time : opt nat64; | ||
}; | ||
burn : opt record { | ||
amount : nat; | ||
from : Account; | ||
spender : opt Account; | ||
memo : opt blob; | ||
created_at_time : opt nat64; | ||
}; | ||
transfer : opt record { | ||
amount : nat; | ||
from : Account; | ||
to : Account; | ||
spender : opt Account; | ||
memo : opt blob; | ||
created_at_time : opt nat64; | ||
fee : opt nat; | ||
}; | ||
approve : opt record { | ||
amount : nat; | ||
from : Account; | ||
spender : opt Account; | ||
expected_allowance : opt nat; | ||
expires_at : opt nat64; | ||
memo : opt blob; | ||
created_at_time : opt nat64; | ||
fee : opt nat; | ||
}; | ||
timestamp : nat64; | ||
}; | ||
|
||
type GetAccountTransactionsArgs = record { | ||
account : Account; | ||
// The txid of the last transaction seen by the client. | ||
// If None then the results will start from the most recent | ||
// txid. | ||
start : opt TxId; | ||
// Maximum number of transactions to fetch. | ||
max_results : nat; | ||
}; | ||
|
||
type TransactionWithId = record { | ||
id : TxId; | ||
transaction : Transaction; | ||
}; | ||
|
||
type GetTransactions = record { | ||
transactions : vec TransactionWithId; | ||
// The txid of the oldest transaction the account has | ||
oldest_tx_id : opt TxId; | ||
}; | ||
|
||
type GetTransactionsErr = record { | ||
message : text; | ||
}; | ||
|
||
type GetTransactionsResult = variant { | ||
Ok : GetTransactions; | ||
Err : GetTransactionsErr; | ||
}; | ||
|
||
type ListSubaccountsArgs = record { | ||
owner: principal; | ||
start: opt SubAccount; | ||
}; | ||
|
||
// The initialization parameters of the Index canister. | ||
type InitArgs = record { | ||
ledger_id : principal; | ||
}; | ||
|
||
service : (InitArgs) -> { | ||
get_account_transactions : (GetAccountTransactionsArgs) -> (GetTransactionsResult); | ||
ledger_id : () -> (principal) query; | ||
list_subaccounts : (ListSubaccountsArgs) -> (vec SubAccount) query; | ||
} |
Oops, something went wrong.