トークン・タクソノミ・フレームワークの拡張機能
ブロックチェーン・アプリケーション・ビルダーの拡張バージョンには、拡張トークン・タクソノミ・フレームワーク標準に関連する新機能が含まれています。
日次トランザクション限度
アカウントが毎日完了できるトランザクションの数、および処理可能なトークンの数を制限できます。createAccount
メソッドへのmax_daily_amount
およびmax_daily_transactions
入力パラメータによって、この動作が制御されます。これらのパラメータはオプションです。
アカウントの日次トランザクション制限を設定しないと、より高いスループットを実現できます。
-
createAccount (TypeScript)
@Validator(yup.string(), yup.string(), yup.string(), yup.object().nullable()) public async createAccount(org_id: string, user_id: string, token_type: string, daily_limits: DailyLimits) { await this.Ctx.Auth.checkAuthorization("ACCOUNT.createAccount", "TOKEN", { org_id }); return await this.Ctx.Account.createAccount(org_id, user_id, token_type, daily_limits); }
-
CreateAccount (Go)
func (t *Controller) CreateAccount(org_id string, user_id string, token_type string, daily_limits ...account.AccountDailyLimits) (interface{}, error) { auth, err := t.Ctx.Auth.CheckAuthorization("Account.CreateAccount", "TOKEN", map[string]string{"org_id": org_id}) if err != nil && !auth { return nil, fmt.Errorf("error in authorizing the caller %s", err.Error()) } return t.Ctx.Account.CreateAccount(org_id, user_id, token_type, daily_limits...) }
ミントとバーニングの承認要件
トークンをミントまたはバーナー・ロールを持つユーザーがトークンを直接ミントまたはバーニングするのではなく、承認者にリクエストを送信するように、トークンのミントおよびバーニングの承認を設定できます。承認者は、トークンをミントまたは書き込むリクエストを受け入れるか拒否できます。ミントおよび書込みの承認を有効にするには、mint_approval_required
およびburn_approval_required
パラメータを使用します。次に、次の例に示すように、mint_approver_role_name
およびburn_approval_role_name
の値も指定する必要があります。
behavior: # Token behaviors
- divisible:
decimal: 2
- mintable:
max_mint_quantity: 1000
mint_approval_required: true
- transferable
- burnable
burn_approval_required: true
- holdable
- roles:
minter_role_name: minter
notary_role_name: notary
mint_approver_role_name: minter_notary
burn_approver_role_name: burner_notary
次のメソッドは、ミント・トークンおよびバーン・トークンの承認のリクエスト、受入れおよび拒否をサポートします。TypeScript承認のMintおよびBurningメソッド
-
requestMint
- このメソッドは、minterがリクエストを送信して、指定した量のトークンを作成するためにminter notaryに送信できます。
-
approveMint
- このメソッドは、ミント・リクエストを承認するために、ミント・ノータリーからコールできます。
-
rejectMint
- このメソッドは、ミント・リクエストを拒否するために、ミント・ノータリーによってコールできます。
-
requestBurn
- このメソッドは、バーナーがコールして、指定された量のトークンを破棄する要求をバーナー公証に送信できます。
-
approveBurn
- バーナー公証人がこのメソッドを呼び出して、書き込み要求を承認できます。
-
rejectBurn
- バーナー公証人がこのメソッドを呼び出して、書き込み要求を拒否できます。
承認をミントおよびバーニングするためのGoメソッド
-
RequestMint
- このメソッドは、minterがリクエストを送信して、指定した量のトークンを作成するためにminter notaryに送信できます。
-
ApproveMint
- このメソッドは、ミント・リクエストを承認するために、ミント・ノータリーからコールできます。
-
RejectMint
- このメソッドは、ミント・リクエストを拒否するために、ミント・ノータリーによってコールできます。
-
RequestBurn
- このメソッドは、バーナーがコールして、指定された量のトークンを破棄する要求をバーナー公証に送信できます。
-
ApproveBurn
- バーナー公証人がこのメソッドを呼び出して、書き込み要求を承認できます。
-
RejectBurn
- バーナー公証人がこのメソッドを呼び出して、書き込み要求を拒否できます。
リッチ履歴データベースからのトランザクション履歴のフェッチ
データをリッチ履歴データベースに同期し、チェーンコードAPIコールを使用してデータをフェッチできます。TypeScriptおよびGoに示されている次のメソッドは、リッチ履歴データベースからトランザクション履歴をフェッチします。これらの方法を使用する前に、卸売CBDCのOracle Databaseビュー定義の説明に従って、Oracle REST Data Services (ORDS)およびOAuthを有効にしてOracle Autonomous Databaseを実行する必要があります。-
getAccountTransactionHistoryWithFiltersFromRichHistDB (TypeScript)
@GetMethod() @Validator(yup.string(), yup.string(), yup.string(), yup.string(), yup.string(), yup.object().nullable()) public async getAccountTransactionHistoryWithFiltersFromRichHistDB(token_id: string, org_id: string, user_id: string, custom_endpoint: string, bearer_token: string, filters?: Filters) { const account_id = await this.Ctx.Account.generateAccountId(token_id, org_id, user_id); await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountTransactionHistoryWithFilters", "TOKEN", { account_id }); return await this.Ctx.Account.getAccountTrxHistoryWithFiltersFromRichHistDB(account_id, org_id, user_id.toLowerCase(), custom_endpoint, bearer_token, filters); }
-
GetAccountTransactionHistoryWithFiltersFromRichHistDB (Go)
func (t *Controller) GetAccountTransactionHistoryWithFiltersFromRichHistDB(token_id string, org_id string, user_id string, custom_endPoint string, bearer_token string, filters ...account.AccountHistoryFilters) (interface{}, error) { account_id, err := t.Ctx.Account.GenerateAccountId(token_id, org_id, user_id) if err != nil { return nil, err } auth, err := t.Ctx.Auth.CheckAuthorization("Account.GetAccountTransactionHistoryWithFilters", "TOKEN", map[string]string{"account_id": account_id}) if err != nil && !auth { return nil, fmt.Errorf("error in authorizing the caller %s", err.Error()) } // sample format of filter: []string{"3", "", "2022-01-16T15:16:36+00:00", "2022-01-17T15:16:36+00:00"} transactionArray, err := t.Ctx.Account.GetAccountTransactionHistoryWithFiltersFromRichHistDB(account_id, org_id, user_id, custom_endPoint, bearer_token, filters...) return transactionArray, err }
トランザクション・オブジェクトのカテゴリおよび摘要属性
- カテゴリおよび説明属性は、コントローラ・ファイルの
transferTokens
、holdTokens
、issueTokens
、requestMint
、requestBurn
、burnTokens
およびrejectBurn
メソッドに含める必要があります。対応するSDKメソッドには、カテゴリおよび説明属性も含める必要があります。 - カテゴリおよび説明属性の入力は、次の例に示すように、
info_details
という名前のJSONオブジェクトの形式になります。{ "category" : "category input", "description" : "description input" }
info_details
フィールドはオプションです。必要に応じて、カテゴリまたは摘要のみを渡すことができます。transferTokens
、holdTokens
、executeHold
、releaseHold
、requestMint
、approveMint
、rejectMint
、requestBurn
、approveBurn
およびrejectBurn
のトランザクションに関連するGETメソッドは、カテゴリ属性および説明属性が存在する場合、ペイロード・レスポンスに含める必要があります。- カテゴリ・フィールドは20文字に制限されており、摘要フィールドは250文字に制限されています。
TypeScript変更された入力を持つメソッド
ブロックチェーン・アプリケーション・ビルダーの拡張バージョンを使用する場合、次のメソッドはオプションのカテゴリおよび説明属性をサポートします。
変更された入力のあるGoメソッド
ブロックチェーン・アプリケーション・ビルダーの拡張バージョンを使用する場合、次のメソッドはオプションのカテゴリおよび説明属性をサポートします。
変更された出力を含むTypeScriptメソッド
次のメソッドは、ブロックチェーン・アプリケーション・ビルダーの拡張バージョンを使用すると、関連する組織およびユーザーIDを返します。