기밀 지급 모델

Blockchain App Builder의 향상된 버전에는 기밀 모드에 대한 추가 방법을 생성하는 모델 속성이 포함되어 있습니다.

확장된 토큰 분류법 프레임워크 표준을 사용하는 토큰에 대한 사양 파일에 confidential: true 매개변수를 포함하는 경우 Blockchain App Builder는 자동으로 생성된 표준 및 SDK 메소드의 다음 수정된 버전을 포함하여 기밀 모드에서 사용할 체인코드를 생성합니다(TypeScript만 해당).

기밀 지급 및 기밀 도매 중앙 은행 디지털 통화(CBDC) 시나리오에 대한 자세한 내용은 대외비 지급이 포함된 도매 중앙 은행 디지털 통화를 참조하십시오.

기밀 체인 코드에 대해 수정된 TypeScript 메소드

확장된 토큰 분류법 프레임워크 표준을 사용하는 토큰에 대한 사양 파일에 confidential: true 매개변수를 포함하는 경우 Blockchain App Builder는 자동으로 생성된 표준 메소드의 수정된 버전 및 추가 메소드를 생성합니다.

isTokenAdmin
이 메소드는 함수 호출자가 Token Admin인 경우 부울 값 true를 반환하고, 그렇지 않은 경우 false를 반환합니다. Token Admin, Token Auditor, Org Admin 또는 Org Auditor는 블록체인 네트워크의 다른 사용자로부터 이 기능을 호출할 수 있다. 다른 사용자는 자신의 계정에서만 이 메소드를 호출할 수 있습니다.
@GetMethod()
 @Validator(yup.string(), yup.string())
 public async isTokenAdmin(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.isUserTokenAdmin", "TOKEN", { org_id });
    return await this.Ctx.Auth.isUserTokenAdmin(org_id, user_id);
 }
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환값:
  • 이 메소드는 호출자가 Token Admin인 경우 true를 반환하고, 그렇지 않은 경우 false를 반환합니다.
addTokenAdmin
이 메소드는 사용자를 체인코드의 Token Admin로 추가합니다. 이 메소드는 체인 코드의 Token Admin에 의해서만 호출될 수 있습니다. user_id 값은 공공 원장에 저장되므로 user_id 값에 개인 식별 정보(PII)를 사용하지 마십시오.
@Validator(yup.string(), yup.string())
  public async addTokenAdmin(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.addTokenAdmin", "TOKEN");
    await this.Ctx.Model.createEvent(EVENT_NAME.ADD_TOKEN_ADMIN, { org_id, user_id });
    return await this.Ctx.Admin.addTokenAdmin(org_id, user_id);
  }
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환값:
  • 성공 시 체인 코드의 Token Admin로 추가된 사용자의 세부정보를 포함하는 메시지입니다.
반환 값 예제:
{
  "msg": "Successfully added Token Admin (Org_Id: CentralBank, User_Id: cb1)"
}
removeTokenAdmin
이 메소드는 사용자를 체인코드의 Token Admin로 제거합니다. 이 메소드는 체인 코드의 Token Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.string())
  public async removeTokenAdmin(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.removeTokenAdmin", "TOKEN");
    await this.Ctx.Model.createEvent(EVENT_NAME.REMOVE_TOKEN_ADMIN, { org_id, user_id });
    return await this.Ctx.Admin.removeTokenAdmin(org_id, user_id);
  }
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환값:
  • 성공 시 체인 코드의 Token Admin로 제거된 사용자의 세부정보를 포함하는 메시지입니다.
반환 값 예제:
{"msg": "Successfully removed Admin (Org_Id: Org1MSP, User_Id: User1)"}
addOrgAdmin
이 메소드는 사용자를 조직의 Org Admin로 추가합니다. 이 메소드는 체인 코드의 Token Admin 또는 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다. user_id 값은 공공 원장에 저장되므로 user_id 값에 개인 식별 정보(PII)를 사용하지 마십시오.
@Validator(yup.string(), yup.string())
  public async addOrgAdmin(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.addOrgAdmin", "TOKEN", { org_id });
    await this.Ctx.Model.createEvent(EVENT_NAME.ADD_ORG_ADMIN, { org_id, user_id });
    return await this.Ctx.Admin.addOrgAdmin(org_id, user_id);
  }
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환값:
  • 성공 시 조직의 Org Admin로 추가된 사용자의 세부정보를 포함하는 메시지입니다.
반환 값 예제:
{
    "msg": "Successfully added Org Admin (Org_Id: Org1MSP, User_Id: orgAdmin)"
}
removeOrgAdmin
이 방법은 조직의 Org Admin인 사용자를 제거합니다. 이 메소드는 체인 코드의 Token Admin 또는 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.string())
  public async removeOrgAdmin(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.removeOrgAdmin", "TOKEN", { org_id });
    await this.Ctx.Model.createEvent(EVENT_NAME.REMOVE_ORG_ADMIN, { org_id, user_id });
    return await this.Ctx.Admin.removeOrgAdmin(org_id, user_id);
  }
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환값:
  • 성공 시 조직의 Org Admin로 제거된 사용자의 세부정보를 포함하는 메시지입니다.
반환 값 예제:
{
  "msg": "Successfully removed Org Admin (Org_Id Org1MSP User_Id orgAdmin)"
}
addTokenAuditor
이 메소드는 사용자를 체인코드의 Token Auditor로 추가합니다. 이 메소드는 체인 코드의 Token Admin에 의해서만 호출될 수 있습니다. user_id 값은 공공 원장에 저장되므로 user_id 값에 개인 식별 정보(PII)를 사용하지 마십시오.
@Validator(yup.string(), yup.string())
  public async addTokenAuditor(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.addTokenAuditor", "TOKEN");
    await this.Ctx.Model.createEvent(EVENT_NAME.ADD_TOKEN_AUDITOR, { org_id, user_id });
    return await this.Ctx.Admin.addTokenAuditor(org_id, user_id);
  }
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환 값 예제:
{
  "msg": "Successfully added Token Auditor (Org_Id: CentralBank, User_Id: cb_admin_demo)"
}
removeTokenAuditor
이 메소드는 사용자를 체인코드의 Token Auditor로 제거합니다. 이 메소드는 체인 코드의 Token Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.string())
  public async removeTokenAuditor(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.removeTokenAuditor", "TOKEN");
    await this.Ctx.Model.createEvent(EVENT_NAME.REMOVE_TOKEN_AUDITOR, { org_id, user_id });
    return await this.Ctx.Admin.removeTokenAuditor(org_id, user_id);
  }
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환 값 예제:
{
           "msg": "Successfully removed Token Auditor (Org_Id: CB, User_Id: cb)"
       }
addOrgAuditor
이 메소드는 사용자를 체인코드의 Org Auditor로 추가합니다. 이 메소드는 체인코드의 Token Admin 또는 Org Admin에 의해서만 호출될 수 있습니다. user_id 값은 공공 원장에 저장되므로 user_id 값에 개인 식별 정보(PII)를 사용하지 마십시오.
@Validator(yup.string(), yup.string())
  public async addOrgAuditor(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.addOrgAuditor", "TOKEN", { org_id });
    await this.Ctx.Model.createEvent(EVENT_NAME.ADD_ORG_AUDITOR, { org_id, user_id });
    return await this.Ctx.Admin.addOrgAuditor(org_id, user_id);
  }
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환값:
  • 성공 시 체인 코드의 Org Auditor로 추가된 사용자의 세부정보를 포함하는 메시지입니다.
반환 값 예제:
{
           "msg": "Successfully added Org Auditor (Org_Id: CentralBank, User_Id: cb_admin_demo)"
       }
removeOrgAuditor
이 메소드는 사용자를 체인코드의 Org Auditor로 제거합니다. 이 메소드는 체인코드의 Token Admin 또는 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.string())
  public async removeOrgAuditor(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ADMIN.removeOrgAuditor", "TOKEN", { org_id });
    await this.Ctx.Model.createEvent(EVENT_NAME.REMOVE_ORG_AUDITOR, { org_id, user_id });
    return await this.Ctx.Admin.removeOrgAuditor(org_id, user_id);
  }
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환 값 예제:
{
           "msg": "Successfully removed Org Auditor (Org_Id: CB, User_Id: cb)"
       }
createAccount
이 메소드는 지정된 사용자 및 토큰의 계정을 만듭니다. 언제든지 토큰을 가질 사용자에 대해 계정을 만들어야 합니다. 계정은 잔액, 보류 중인 잔액 및 트랜잭션 기록을 추적합니다. 계정 ID는 자산 유형과 토큰 ID를 연결한 다음 조직 ID와 사용자 ID의 연결을 통해 SHA-256 해시를 생성하여 구성됩니다. 이 메소드는 Token Admin 또는 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(),yup.string(), yup.string(), yup.object().nullable())
  public async createAccount(org_id: string, user_id: string, token_type: string, dailyLimits?: DailyLimits) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.createAccount", "TOKEN", { org_id });
    await this.Ctx.Model.createEvent(EVENT_NAME.CREATE_ACCOUNT, { org_id, user_id, token_type, dailyLimits });
    return await this.Ctx.Account.createAccount(org_id, user_id, token_type, dailyLimits);
  }
매개변수:
  • org_id – 계정을 만들 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다. ID는 영숫자로 시작해야 하며 문자, 숫자 및 밑줄(_), 마침표(.), @ 기호 및 하이픈(-)과 같은 특수 문자를 포함할 수 있습니다.
  • user_id – 사용자의 사용자 이름 또는 전자메일 ID입니다. ID는 영숫자로 시작해야 하며 문자, 숫자 및 밑줄(_), 마침표(.), @ 기호 및 하이픈(-)과 같은 특수 문자를 포함할 수 있습니다.
  • token_type: string – 토큰의 유형으로, fungible여야 합니다.
  • daily_limits: DailyLimits – 다음 유형의 JSON 객체입니다.
    {
         "max_daily_amount": 100000
         "max_daily_transactions": 10000
     }
    예제에서 max_daily_amount 값은 매일 트랜잭션할 수 있는 최대 토큰 수이고 max_daily_transactions 값은 매일 완료할 수 있는 최대 트랜잭션 수입니다.
반환 값 예제:
{
    "bapAccountVersion": 0,
    "assetType": "oaccount",
    "account_id": "oaccount~b53cb2c19c92d1d5c8cb9f6e988e7761c34e03e014e6c4b889565fc0abf46c8a",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "",
    "token_name": "",
    "balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_burn_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
}
associateTokenToAccount
이 방법은 대체 가능한 토큰을 계정에 연결합니다. 이 메소드는 체인 코드의 Token Admin 또는 관련 조직의 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.string(), yup.string().optional())
  public async associateTokenToAccount(account_id: string, token_id: string, custom_account_id?: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.associateToken", "TOKEN", { account_id });
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.ASSOCIATE_TOKEN_TO_ACCOUNT, { account_id, token_asset }, token_asset);
    return await this.Ctx.Account.associateToken(account_id, token_id, custom_account_id);
  }
매개변수:
  • account_id: string – 계정의 ID입니다.
  • token_id: string – 토큰 ID입니다.
  • custom_account_id: string – 기밀 모드의 경우 계정의 은행 계정 ID, 고유한 임의 영숫자 식별자입니다. 기본적으로 길이는 14자입니다.
반환값:
  • 성공 시 업데이트된 계정의 JSON 객체입니다. bapAccountVersion 매개변수는 내부용으로 계정 객체에 정의됩니다.
반환 값 예제:
{
    "bapAccountVersion": 0,
    "assetType": "oaccount",
    "account_id": "oaccount~b53cb2c19c92d1d5c8cb9f6e988e7761c34e03e014e6c4b889565fc0abf46c8a",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "USD",
    "token_name": "cbdc",
    "balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_burn_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "application_groups": [
        "CENTRAL_BANK_USERS"
    ]
}
getAllAccounts
이 방법은 모든 계정 목록을 반환합니다. 이 메소드는 Token Admin 또는 Token Auditor에 의해서만 호출될 수 있습니다. 이 방법은 Berkeley DB SQL 리치 쿼리를 사용하며 원격 Oracle Blockchain Platform 네트워크에 연결된 경우에만 호출할 수 있습니다.
@GetMethod()
  @Validator()
  public async getAllAccounts() {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAllAccounts", "TOKEN");
    return await this.Ctx.Account.getAllAccounts();
  }
매개변수:
  • 없음
반환 값 예제:
[
    {
        "key": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
        "valueJson": {
            "bapAccountVersion": 3,
            "assetType": "oaccount",
            "account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "028a27c752e9b518d156e61da6589e723b179b6d7351dc34ec92bbb27b783ed1dc",
            "onhold_balance": "02d53a7eda9484bda7252212714f647b70d32663cfa416f93f488ef6b6bc8fb2eb",
            "onhold_burn_balance": "02d53a7eda9484bda7252212714f647b70d32663cfa416f93f488ef6b6bc8fb2eb",
            "application_groups": [
                "application_groups value"
            ]
        }
    },
    {
        "key": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
        "valueJson": {
            "bapAccountVersion": 0,
            "assetType": "oaccount",
            "account_id": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "onhold_balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "onhold_burn_balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "application_groups": [
                "application_groups value"
            ]
        }
    }
]
getAllOrgAccounts
이 메소드는 지정된 조직에 속하는 모든 토큰 계정 목록을 반환합니다. 이 메소드는 Token Admin 또는 Token Auditor 또는 지정된 조직의 Org Admin 또는 Org Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getAllOrgAccounts(org_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAllOrgAccounts", "TOKEN", { org_id });
    return await this.Ctx.Account.getAllOrgAccounts(org_id);
  }
매개변수:
  • org_id: string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
반환값:
  • 성공 시 지정된 조직에 대한 모든 계정 목록이 표시됩니다.
반환 값 예제:
[
    {
        "key": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
        "valueJson": {
            "bapAccountVersion": 2,
            "assetType": "oaccount",
            "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "18",
            "onhold_balance": "0",
            "onhold_burn_balance": "0",
            "application_groups": [
                "application_groups value"
            ],
            "user_id": "cb",
            "custom_account_id": "1234567jh"
        }
    },
    {
        "key": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
        "valueJson": {
            "bapAccountVersion": 1,
            "assetType": "oaccount",
            "account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "22",
            "onhold_balance": "0",
            "onhold_burn_balance": "0",
            "application_groups": [
                "application_groups value"
            ],
            "user_id": "cb1",
            "custom_account_id": "1234567jh"
        }
    }
]
getAccountsByUser
이 메소드는 지정된 조직 ID 및 사용자 ID에 대한 모든 계정 ID 목록을 반환합니다. 이 메소드는 Token Admin 또는 Token Auditor, 지정된 조직의 Org Admin 또는 Org Auditor 또는 매개변수에 지정된 Account Owner에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getAccountsByUser(org_id: string, user_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountsByUser", "TOKEN", { org_id, user_id });
    return await this.Ctx.Account.getAccountsByUser(org_id, user_id);
  }
매개변수:
  • org_id string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환값:
  • 성공 시 계정 ID의 JSON 배열입니다.
반환 값 예제:
[
    {
        "bapAccountVersion": 2,
        "assetType": "oaccount",
        "user_id": "cb",
        "custom_account_id": "1234567jh",
        "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
        "org_id": "CentralBank",
        "token_type": "fungible",
        "token_id": "token",
        "token_name": "cbdc",
        "balance": "18",
        "onhold_balance": "0",
        "onhold_burn_balance": "0",
        "application_groups": [
            "application_groups value"
        ]
    }
]
getUserByAccountId
이 메소드는 지정된 계정에 대한 사용자 세부정보(org_iduser_id)를 반환합니다. 이 메소드는 Token Admin 또는 Token Auditor 또는 지정된 조직의 Org Admin 또는 Org Auditor에 의해 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getUserByAccountId(account_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getUserByAccountId", "TOKEN", { account_id });
    return await this.Ctx.Account.getUserByAccountId(account_id);
  }
매개변수:
  • account_id: string – 계정의 ID입니다.
반환값:
  • 성공 시 사용자 세부정보의 JSON 객체(org_id, token_iduser_id)입니다.
반환 값 예제:
{
    "token_id": "USD",
    "org_id": "CentralBank",
    "user_id": "cb_admin_demo",
    "custom_account_id": "10101234000123"
}
getAccount
이 메소드는 지정된 계정에 대한 세부 정보를 반환합니다. 이 메소드는 지정된 조직의 Token Admin 또는 Token Auditor, Org Admin 또는 Org Auditor 또는 계정의 AccountOwner에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getAccount(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccount", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountWithStatus(account_id);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
    "bapAccountVersion": 2,
    "assetType": "oaccount",
    "user_id": "cb",
    "custom_account_id": "1234567jh",
    "status": "active",
    "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "token",
    "token_name": "cbdc",
    "balance": "18",
    "onhold_balance": "0",
    "onhold_burn_balance": "0",
    "application_groups": [
        "application_groups value"
    ]
}
getAccountDetailsByCustomAccountId
이 메소드는 지정된 사용자정의 계정 ID에 대한 세부정보를 반환합니다. 이 메소드는 지정된 조직의 Token Admin 또는 Token Auditor 또는 Org Admin 또는 Org Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getAccountDetailsByCustomAccountId(custom_account_id: string, org_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountDetailsByCustomAccountId", "TOKEN", { org_id });
    return await this.Ctx.Account.getAccountDetailsByCustomAccountId(custom_account_id, org_id);
  }
매개변수:
  • custom_account_id: string – 계정의 은행 계정 ID로, 고유한 임의의 영숫자 식별자입니다.
  • org_id: string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
반환 값 예제:
[
    {
        "bapAccountVersion": 0,
        "assetType": "oaccount",
        "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
        "org_id": "CentralBank",
        "token_type": "fungible",
        "token_id": "USD",
        "token_name": "cbdc",
        "balance": "0",
        "onhold_balance": "0",
        "onhold_burn_balance": "0",
        "application_groups": [
            "SYSTEM_ADMINS"
        ],
        "user_id": "cb_admin_demo",
        "custom_account_id": "10101234000123"
    }
]
getAccountTransactionHistory
이 방법은 지정된 계정에 대한 계정 트랜잭션 기록 세부정보의 배열을 반환합니다. 이 메소드는 지정된 조직의 Token Admin 또는 Token Auditor, Org Admin 또는 Org Auditor 또는 계정의 AccountOwner에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getAccountTransactionHistory(account_id: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountTransactionHistory", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountTransactionHistory(account_id, account.org_id);
  }
매개변수:
  • account_id: string – 계정의 고유 ID입니다.
반환 값 예제:
[
    {
        "transaction_id": "otransaction~4514aa229ebcc4d2fedcaa47c4301615e30c4a9bae45cf0256a5b80d75b3697a",
        "transacted_amount": 1000,
        "timestamp": "2025-08-25T13:20:50.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 21000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~1982f73495060e0eef4d78282a91c41e27e8c95572739b0677a1e404a0d20aa9",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:12:43.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~fedd714cf1509f7517819d7cd4c0921d0b2f5d1ff6a25dcb08ab411defd6b5f3",
        "transacted_amount": 2000,
        "timestamp": "2025-08-21T05:23:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~f33b47234f3ee0b636962c8c31c01d06523b789ca16b3b342d5080b71268bcc3",
        "transacted_amount": 1000,
        "timestamp": "2025-08-21T05:23:07.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~cf934527149bc24f62a8ddeeea7f74a19a0f84d8f161535a771be49d2520d5b3",
        "transacted_amount": 10000,
        "timestamp": "2025-08-13T06:12:41.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~f5c0e11ca61d9adc843658929e6de2a738ad586304f9e020f75bf4aac5e42a2c",
        "transacted_amount": 10000,
        "timestamp": "2025-08-13T06:12:04.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~862aa9d9e877d3ea209b87299ab5b12c13ed5ce43d1cf1b934043c1dd02f58f6",
        "transacted_amount": 50000,
        "timestamp": "2025-08-12T21:04:22.000Z",
        "token_id": "USD",
        "category": "transfer",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transaction_type": "DEBIT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~8a74c6d87ca74a613aab9db5d40386f8d5b534f9800503af8ca27e8946d7616d",
        "transacted_amount": 40000,
        "timestamp": "2025-08-12T21:01:27.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REJECT_MINT",
        "balance": 60000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~28ac66ba33f7ad0648448964b2b74525c9e3f0c9908c7a0484690b9baa56c2db",
        "transacted_amount": 30000,
        "timestamp": "2025-08-12T21:01:16.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 60000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~7e32ad8f365ff59814e112f27602f30ab599fb9c1638784496c66a61a6277c22",
        "transacted_amount": 20000,
        "timestamp": "2025-08-12T21:01:05.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 30000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~1477050bb9e55f4f471872b31fce0d2097f5d5e57d89a842070df5e36d7ab0da",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:01:03.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~0e76c6931b7ee134e967e847d9730b867a0fd191d39697d83d36dd15745c02e3",
        "transacted_amount": 40000,
        "timestamp": "2025-08-12T21:00:20.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~07bbf9c190694371626da59ded5d87434d26f612891e13bb15bdd28f6086e760",
        "transacted_amount": 30000,
        "timestamp": "2025-08-12T21:00:01.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~8721175c6cbbce17b6c4bb6a444e475d07f52352dfd0d990679f342215153513",
        "transacted_amount": 20000,
        "timestamp": "2025-08-12T20:59:41.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~dc24c24d43a6525e807a39edcf8c6a2b6ccb81f0d755958f509509687eacee84",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T20:59:13.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~396e6ca5a11a9609632d0864026409d46a708fb95e3e21b39fa5f3fb78f90872",
        "transacted_amount": 0,
        "timestamp": "2025-08-12T20:43:20.000Z",
        "token_id": "",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "CREATE_ACCOUNT",
        "balance": 0,
        "onhold_balance": 0
    }
]
getAccountTransactionHistoryWithFilters
이 메소드는 지정된 사용자 및 토큰에 대한 필터링된 계정 트랜잭션 기록 세부정보 배열을 반환합니다. 이 메소드는 지정된 조직의 Token Admin 또는 Token Auditor, Org Admin 또는 Org Auditor 또는 계정의 AccountOwner에 의해서만 호출될 수 있습니다. 이 방법은 원격 Oracle Blockchain Platform 네트워크에 연결된 경우에만 호출할 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.object().nullable())
  public async getAccountTransactionHistoryWithFilters(account_id: string, filters?: Filters) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountTransactionHistoryWithFilters", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountTransactionHistoryWithFilters(account_id, account.org_id, filters);
  }
매개변수:
  • account_id: string – 계정의 고유 ID입니다.
  • filters: string – 선택적 매개변수입니다. 비어 있으면 모든 레코드가 반환됩니다. PageSize 속성은 반환할 레코드 수를 결정합니다. PageSize가 0이면 기본 페이지 크기는 20입니다. Bookmark 속성은 반환할 레코드의 시작 인덱스를 결정합니다. 자세한 내용은 Hyperledger Fabric 설명서를 참조하십시오. StartTimeEndTime 등록 정보는 RFC-3339 형식으로 지정해야 합니다.
반환 값 예제:
[
           {
               "transaction_id": "otransaction~ccc2c2e89ab7887af4fdad3dc9918ea057a8aa834a0ed8d0f23271049f084952",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:22:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 18,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
               "transacted_amount": 22,
               "timestamp": "2025-08-20T23:21:45.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "to_account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
               "to_org_id": "Org1",
               "to_user_id": "cb1",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "from_org_id": "Org1",
               "from_user_id": "cb",
               "from_custom_account_id": "1234567jh",
               "transacted_account": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
               "transaction_type": "DEBIT",
               "balance": 8,
               "onhold_balance": 0,
               "transacted_org_id": "Org1",
               "transacted_user_id": "cb1",
               "transacted_custom_account_id": "1234567jh"
           },
           {
               "transaction_id": "otransaction~3212811cd7c0ff265434f5921b93621cc5b0e0450b07c52b42ad9d8ce73cf063",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:18:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 30,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~af2a1b0d56778e4ff5f4dda4e81bbcbf02c0592416ee2f105ff0b764e515fd0a",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:17:29.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 20,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~6c0452a58f13db93f1c308d60eab1fde6c911921b350c0bbbe0ce7dab394721d",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:04:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 10,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~df98e24a3b90661b54b54289b600b13a1051c922db0a4d20e3705a9820ae9c20",
               "transacted_amount": 0,
               "timestamp": "2025-08-20T22:55:09.000Z",
               "category": "",
               "description": "",
               "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "from_org_id": "Org1",
               "from_user_id": "cb",
               "from_custom_account_id": "1234567jh",
               "transacted_account": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "transaction_type": "CREATE_ACCOUNT",
               "balance": 0,
               "onhold_balance": 0,
               "transacted_org_id": "Org1",
               "transacted_user_id": "cb",
               "transacted_custom_account_id": "1234567jh"
           }
       ]
getAccountTransactionHistoryWithFiltersFromRichHistDB
이 메소드는 풍부한 기록 데이터베이스에서 트랜잭션 기록을 패치(fetch)합니다. 이 메소드는 지정된 조직의 Token Admin 또는 Token Auditor, Org Admin 또는 Org Auditor 또는 계정의 AccountOwner에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.string(), yup.object().nullable())
  public async getAccountTransactionHistoryWithFiltersFromRichHistDB(account_id: string, custom_endpoint: string, bearer_token: string, filters?: Filters) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountTransactionHistoryWithFiltersFromRichHistDB", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountTrxHistoryWithFiltersFromRichHistDB(account_id, account.org_id, custom_endpoint, bearer_token, filters);
  }
매개변수:
  • account_id: string – 계정의 고유 ID입니다.
  • custom_endpoint – 풍부한 내역 데이터베이스의 RESTful 서비스 끝점입니다.
  • bearer_token – RESTful 서비스 끝점에 대한 액세스 권한 부여 토큰입니다.
  • filters: string – 선택적 매개변수입니다. 비어 있으면 모든 레코드가 반환됩니다. PageSize 속성은 반환할 레코드 수를 결정합니다. PageSize가 0이면 기본 페이지 크기는 20입니다. Bookmark 속성은 반환할 레코드의 시작 인덱스를 결정합니다. 자세한 내용은 Hyperledger Fabric 설명서를 참조하십시오. StartTimeEndTime 등록 정보는 RFC-3339 형식으로 지정해야 합니다.
반환 값 예제:
[
    {
        "transaction_id": "otransaction~3140569a4ecb3c3f141cc2468fe21276640b7fd79013d951d9104b79072d8f9c",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:16:55.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "transfer",
        "balance": 26800,
        "onhold_balance": 300
    },
    {
        "transaction_id": "otransaction~2b75b3e8531a651f07c2d048d8546ad70ac49c66f0b82ed7626c1739090842ce",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:16:06.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~e26f11da",
        "category": "transfer",
        "balance": 26800,
        "onhold_balance": 500
    },
    {
        "transaction_id": "otransaction~9e7bf14cf96c5f90170da9455b1318687785e936192f60b7cbeb1c8bfabc41d2",
        "transacted_amount": 100,
        "timestamp": "2025-08-21T06:57:19.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 26900,
        "onhold_balance": 400
    },
    {
        "transaction_id": "otransaction~b3901b4754920a9c75e36069dc55024ad505e4c127f334eedf65ef6703dc6b86",
        "transacted_amount": 200,
        "timestamp": "2025-08-21T05:39:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~77b75873",
        "category": "issuance",
        "balance": 26800,
        "onhold_balance": 400
    },
    {
        "transaction_id": "otransaction~d55c9dfc9feacb353544b5d8b2ae694162ade3890bcaaf715503fd1d6a73cd1a",
        "transacted_amount": 200,
        "timestamp": "2025-08-21T05:39:01.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~81d7c4ac",
        "category": "transfer",
        "balance": 27000,
        "onhold_balance": 200
    },
    {
        "transaction_id": "otransaction~751eaedbe4311edd5d17cae53d283caf397d0cb09f18d57a5e3fe61266875ff9",
        "transacted_amount": 200,
        "timestamp": "2025-08-13T09:59:22.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "transacted_org_id": "org2",
        "transacted_user_id": "fi2_org_officer_demo",
        "transacted_custom_account_id": "30300617202404",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "from_org_id": "org2",
        "from_user_id": "fi2_org_officer_demo",
        "from_custom_account_id": "30300617202404",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 27200,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~70155a8f4e388cc9395dbd03bedaf5a878705f5ad02302c8e9163218a5c3875a",
        "transacted_amount": 1000,
        "timestamp": "2025-08-13T06:22:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 27000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~e595f3f0cc03fa5f58a546b8abbfaf155592e492f850581db2b8fed9a529c9e2",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:09:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "transacted_org_id": "org2",
        "transacted_user_id": "fi2_org_officer_demo",
        "transacted_custom_account_id": "30300617202404",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "issuance",
        "balance": 26000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~da92402859d87ae3069722d8e39cb0da448e9a5f67468233ee9b1fe7a4ebeef8",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:09:17.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "issuance",
        "balance": 26000,
        "onhold_balance": 10000
    },
    {
        "transaction_id": "otransaction~6915145aaf09fbf4d96456febddc2aa87b48c08ddd8ff17a6bab5d310f67bb36",
        "transacted_amount": 1000,
        "timestamp": "2025-08-12T21:07:11.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 26000,
        "onhold_balance": 20000
    },
    {
        "transaction_id": "otransaction~244d7172d1dc90a142e1f22204c76614c7eea814b3d61f33016b786f1b347784",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:05:39.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~ed815e20",
        "category": "issuance",
        "balance": 25000,
        "onhold_balance": 20000
    },
    {
        "transaction_id": "otransaction~c63ec37966264493bde6fa666527b9cca11695c15611c32e89af49a2246f13f6",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:05:20.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~12d87129",
        "category": "issuance",
        "balance": 35000,
        "onhold_balance": 10000
    },
    {
        "transaction_id": "otransaction~5112f576c94c2d23c342479bfa37e34612414b3258a64b43cf51b920f4ff5868",
        "transacted_amount": 5000,
        "timestamp": "2025-08-12T21:05:02.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_retirer_demo",
        "to_custom_account_id": "10109999006543",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "DEBIT",
        "category": "burn",
        "balance": 45000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~862aa9d9e877d3ea209b87299ab5b12c13ed5ce43d1cf1b934043c1dd02f58f6",
        "transacted_amount": 50000,
        "timestamp": "2025-08-12T21:04:22.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 50000,
        "onhold_balance": 0
    }
]
getOrgAccountsTransactionHistoryWithFiltersFromRichHistDB
이 메소드는 지정된 조직에 대한 풍부한 기록 데이터베이스에서 트랜잭션 기록을 인출합니다. 이 메소드는 지정된 조직의 Token Admin 또는 Token Auditor, Org Admin 또는 Org Auditor 또는 계정의 AccountOwner에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.string(), yup.object().nullable())
  public async getOrgAccountsTransactionHistoryWithFiltersFromRichHistDB(org_id: string, custom_endpoint: string, bearer_token: string, filters?: Filters) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getOrgAccountsTransactionHistoryWithFiltersFromRichHistDB", "TOKEN", { org_id });
    return await this.Ctx.Account.getOrgAccountsTrxHistoryWithFiltersFromRichHistDB(org_id, custom_endpoint, bearer_token, filters);
  }
매개변수:
  • org_id: string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
  • custom_endpoint – 풍부한 내역 데이터베이스의 RESTful 서비스 끝점입니다.
  • bearer_token – RESTful 서비스 끝점에 대한 액세스 권한 부여 토큰입니다.
  • filters: string – 선택적 매개변수입니다. 비어 있으면 모든 레코드가 반환됩니다. PageSize 속성은 반환할 레코드 수를 결정합니다. PageSize가 0이면 기본 페이지 크기는 20입니다. Bookmark 속성은 반환할 레코드의 시작 인덱스를 결정합니다. 자세한 내용은 Hyperledger Fabric 설명서를 참고하세요. StartTimeEndTime 등록 정보는 RFC-3339 형식으로 지정해야 합니다.
반환 값 예제:
[
    {
        "transaction_id": "otransaction~4793f3907eefce2f9fca7ef107405b0f116efb3afbf83fa0e61fe763690c8235",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:47:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~2ac01689",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user1_demo",
        "transacted_custom_account_id": "20200198765432",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "CREDIT",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user2_demo",
        "transacted_custom_account_id": "20200211112222",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "EXECUTEHOLD",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~32137cd7e16c560f4d96d0f8999f6a267c1e95be2f5b11ef0541e574a6cd7275",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:16:55.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "transaction_type": "CREDIT",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~67844e07c06ab4c3d94d8ff36173b9dbcc2f1b9c99f4e7070f1097fd89f3f514",
        "transacted_amount": 10,
        "timestamp": "2025-08-21T08:49:40.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user1_demo",
        "transacted_custom_account_id": "20200198765432",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~b6e4925b",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~b7c97d737fb978651c9132276ab677c0bcf795b9db13d0d39cba5243615c7389",
        "transacted_amount": 10,
        "timestamp": "2025-08-21T08:46:09.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user1_demo",
        "to_custom_account_id": "20200198765432",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~4fbbb846",
        "category": "transfer"
    }
]
getAllAccountsTransactionHistoryWithFiltersFromRichHistDB
이 메소드는 모든 조직에 대한 풍부한 내역 데이터베이스에서 트랜잭션 내역을 인출합니다. 이 메소드는 Token Admin 또는 Token Auditor를 통해서만 호출할 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.object().nullable())
  public async getAllAccountsTransactionHistoryWithFiltersFromRichHistDB(custom_endpoint: string, bearer_token: string, filters?: Filters) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAllAccountsTransactionHistoryWithFiltersFromRichHistDB", "TOKEN");
    return await this.Ctx.Account.getAllAccountsTrxHistoryWithFiltersFromRichHistDB(custom_endpoint, bearer_token, filters);
  }
매개변수:
  • custom_endpoint – 풍부한 내역 데이터베이스의 RESTful 서비스 끝점입니다.
  • bearer_token – RESTful 서비스 끝점에 대한 액세스 권한 부여 토큰입니다.
  • filters: string – 선택적 매개변수입니다. 비어 있으면 모든 레코드가 반환됩니다. PageSize 속성은 반환할 레코드 수를 결정합니다. PageSize가 0이면 기본 페이지 크기는 20입니다. Bookmark 속성은 반환할 레코드의 시작 인덱스를 결정합니다. 자세한 내용은 Hyperledger Fabric 설명서를 참조하십시오. StartTimeEndTime 등록 정보는 RFC-3339 형식으로 지정해야 합니다.
반환 값 예제:
[
    {
        "transaction_id": "otransaction~62eb436be7c29fc2ed9cae221e874d9a31b163fa10374e7da09bf5e09a96c3ff",
        "transacted_amount": 10000,
        "timestamp": "2025-08-25T13:57:58.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "DEBIT",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~62eb436be7c29fc2ed9cae221e874d9a31b163fa10374e7da09bf5e09a96c3ff",
        "transacted_amount": 10000,
        "timestamp": "2025-08-25T13:57:58.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "CREDIT",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~c628fb7738222ed969295ccc8d21b4be95d96e3aada4f14570f7820a7051b5f7",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:51:18.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "RELEASEHOLD",
        "holding_id": "ohold~cbdc~USD~77b75873"
    },
    {
        "transaction_id": "otransaction~af2cc8e43ecb4c5520d90a8d7955b5a47623a29b13eef47e31c16eb48cc0adec",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:50:45.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "REJECT_BURN",
        "holding_id": "ohold~cbdc~USD~8d34",
        "description": "Burn",
        "to_account": ""
    },
    {
        "transaction_id": "otransaction~182b99bb2ed753994a8c638ab9b08c3a4e73ac8159a3173a2a1f56b651d2eeac",
        "transacted_amount": 2000,
        "timestamp": "2025-08-25T13:50:19.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "to_org_id": "CentralBank",
        "to_user_id": "cb__creator_demo",
        "to_custom_account_id": "10105678004567",
        "transaction_type": "REJECT_MINT",
        "holding_id": "ohold~cbdc~USD~89ce",
        "description": "Minting 2000 tokens",
        "from_account": ""
    },
    {
        "transaction_id": "otransaction~4793f3907eefce2f9fca7ef107405b0f116efb3afbf83fa0e61fe763690c8235",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:47:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~2ac01689",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user2_demo",
        "transacted_custom_account_id": "20200211112222",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "EXECUTEHOLD",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    }
]
getAccountBalance
이 방법은 지정된 계정에 대한 현재 잔액을 반환합니다. 이 메소드는 지정된 조직의 Token Admin 또는 Token Auditor, Org Admin 또는 Org Auditor 또는 계정의 AccountOwner에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getAccountBalance(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountBalance", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountBalance(account_id);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환값:
  • 성공 시 현재 계정 잔액의 JSON 표현입니다.
반환 값 예제:
{
    "msg": "Current Balance is: 100",
    "user_balance": 100
}
deleteHistoricalTransactions
이 방법은 상태 데이터베이스에서 이전 트랜잭션을 삭제합니다. 이 메소드는 Token Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.date())
  public async deleteHistoricalTransactions(time_to_expiration: Date) {
    await this.Ctx.Auth.checkAuthorization("TRANSACTION.deleteTransactions", "TOKEN");
    await this.Ctx.Model.createEvent(EVENT_NAME.DELETE_HISTORICAL_TRANSACTIONS, { time_to_expiration });
    return await this.Ctx.Transaction.deleteTransactions(time_to_expiration);
  }
매개변수:
  • time_to_expiration Date – 트랜잭션 삭제 시기를 나타내는 시간 기록입니다. 지정된 시간보다 오래된 트랜잭션 자산이 삭제됩니다.
반환 값 예제:
{
    "msg": "Successfully deleted transaction older than date: Thu Aug 19 2025 11:19:36 GMT+0000 (Coordinated Universal Time).",
    "transactions": [
           "otransaction~ec3366dd48b4ce2838f820f2f138648e6e55a07226713e59b411ff31b0d21058"
     ]
}
getTransactionById
이 메소드는 Transaction 자산의 내역을 반환합니다. 이 메소드는 Token Admin 또는 Token Auditor, 지정된 조직의 Org Admin 또는 Org Auditor 또는 트랜잭션 참가자(발신자, 수신자 또는 공증인)에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getTransactionById(transaction_id: string) {
    await this.Ctx.Auth.checkAuthorization("TRANSACTION.getTransactionById", "TOKEN", { transaction_id });
    return await this.Ctx.Transaction.getTransactionById(transaction_id);
  }
매개변수:
  • transaction_id string – 거래 자산의 ID입니다.
반환값:
  • 성공 시 트랜잭션에 대한 기록의 JSON 배열입니다.
반환 값 예제:
{
    "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
    "history": [
        {
            "trxId": "6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
            "timeStamp": "2025-08-20T23:21:45.000Z",
            "value": {
                "assetType": "otransaction",
                "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
                "token_id": "token",
                "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
                "to_account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
                "transaction_type": "TRANSFER",
                "amount": 22,
                "timestamp": "2025-08-20T23:21:45.000Z",
                "number_of_sub_transactions": 0,
                "holding_id": "",
                "sub_transaction": "false",
                "category": "category value",
                "description": "description value"
            }
        }
    ],
    "sub_transactions": []
}
getAccountStatus
이 메소드는 토큰 계정의 현재 상태를 가져옵니다. 이 메소드는 체인 코드의 Token Admin, 지정된 조직의 Org Admin 또는 토큰 계정 소유자가 호출할 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getAccountStatus(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT_STATUS.get", "TOKEN", { account_id });
    try {
      return await this.Ctx.AccountStatus.getAccountStatus(account_id);
    } catch (err) {
      return await this.Ctx.AccountStatus.getDefaultAccountStatus(account_id);
    }
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환값:
  • 성공 시 토큰 계정 상태에 대한 세부정보를 포함하는 메시지입니다.
반환 값 예제:
{
    "assetType": "oaccountStatus",
    "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
    "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
    "status": "active"
}
getAccountStatusHistory
이 방법은 계정 상태의 기록을 가져옵니다. 이 메소드는 체인 코드의 Token Admin, 지정된 조직의 Org Admin 또는 토큰 계정 소유자가 호출할 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getAccountStatusHistory(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT_STATUS.history", "TOKEN", { account_id });
    const status_id = await this.Ctx.AccountStatus.generateAccountStatusId(account_id);
    let account_status_history: any;
    try {
      account_status_history = await this.Ctx.AccountStatus.history(status_id);
    } catch (err) {
      return [];
    }
    return account_status_history;
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환값:
  • 성공 시 고객사 상태 내역의 세부 사항을 포함하는 메시지입니다.
반환 값 예제:
[
  {
    "trxId": "d5c6d6f601257ba9b6edaf5b7660f00adc13c37d5321b8f7d3a35afab2e93e63",
    "timeStamp": "2025-12-02T10:39:14.000Z",
    "value": {
      "assetType": "oaccountStatus",
      "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
      "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
      "status": "suspended"
    }
  },
  {
    "trxId": "e6c850cfa084dc20ad95fb2bb8165eef3a3bd62a0ac867cccee57c2003125183",
    "timeStamp": "2025-12-02T10:37:50.000Z",
    "value": {
      "assetType": "oaccountStatus",
      "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
      "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
      "status": "active"
    }
  }
]
activateAccount
이 메소드는 토큰 계정을 활성화합니다. 이 메소드는 체인 코드의 Token Admin 또는 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다. 삭제된 계정은 활성화할 수 없습니다.
@Validator(yup.string())
  public async activateAccount(account_id: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT_STATUS.activateAccount", "TOKEN", { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.ACTIVATE_ACCOUNT, { account_id }, token_asset);
    return await this.Ctx.Account.activateAccount(account_id);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환값:
  • 성공 시 지정된 토큰 계정에 대한 계정 상태 객체의 JSON 표현입니다.
반환 값 예제:
{
  "assetType": "oaccountStatus",
  "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
  "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
  "status": "active"
}
suspendAccount
이 메소드는 토큰 계정을 일시 중지합니다. 이 메소드는 체인 코드의 Token Admin 또는 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다. 계정이 일시 중지된 후에는 계정을 업데이트하는 작업을 완료할 수 없습니다. 삭제된 계정은 일시 중지할 수 없습니다.
@Validator(yup.string())
  public async suspendAccount(account_id: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT_STATUS.suspendAccount", "TOKEN", { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.SUSPEND_ACCOUNT, { account }, token_asset);
    return await this.Ctx.Account.suspendAccount(account_id);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환값:
  • 성공 시 지정된 토큰 계정에 대한 계정 상태 객체의 JSON 표현입니다.
반환 값 예제:
{
    "assetType": "oaccountStatus",
    "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
    "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
    "status": "suspended"
}
deleteAccount
이 방법은 토큰 계정을 삭제합니다. 이 메소드는 체인 코드의 Token Admin 또는 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다. 계정이 삭제된 후에는 계정을 업데이트하는 작업을 완료할 수 없습니다. 삭제된 계정이 최종 상태이므로 다른 상태로 변경할 수 없습니다. 계정을 삭제하려면 계정 잔액과 보류 잔액이 0이어야 합니다.
@Validator(yup.string())
  public async deleteAccount(account_id: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT_STATUS.deleteAccount", "TOKEN", { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.DELETE_ACCOUNT, { account_id }, token_asset);
    return await this.Ctx.Account.deleteAccount(account_id);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환값:
  • 성공 시 지정된 토큰 계정에 대한 계정 상태 객체의 JSON 표현입니다.
반환 값 예제:
{
  "assetType": "oaccountStatus",
  "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
  "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
  "status": "deleted"
}
setMaxDailyAmount
이 메소드는 지정된 계정에 대한 max_daily_amount 값을 설정합니다. 이 메소드는 체인 코드의 Token Admin 또는 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.string().optional())
  public async setMaxDailyAmount (account_id: string, max_daily_amount?: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization('ACCOUNT.setMaxDailyAmount', 'TOKEN', { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.SET_MAX_DAILY_AMOUNT, { account_id, max_daily_amount }, token_asset);
    return this.Ctx.Account.setMaxDailyAmount (account_id, max_daily_amount);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
  • max_daily_amount?: string – (옵션) 사용자가 매일 전송할 수 있는 최대 토큰 양입니다. 지정되지 않은 경우 사용자는 매일 모든 양의 토큰을 전송할 수 있습니다.
반환 값 예제:
{
           "msg": "Successfully set max daily amount for account id oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a to 1000000"
       }
setMaxDailyTransactionCount
이 메소드는 지정된 계정에 대한 max_daily_transactions 값을 설정합니다. 이 메소드는 체인 코드의 Token Admin 또는 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.string().optional())
  public async setMaxDailyTransactionCount (account_id: string, max_daily_transactions?: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization('ACCOUNT.setMaxDailyTransactionCount', 'TOKEN', { org_id: account.org_id });
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.SET_MAX_DAILY_TRANSACTION_COUNT, { account_id, max_daily_transactions}, token_asset);
    return this.Ctx.Account.setMaxDailyTransactionCount (account_id, max_daily_transactions);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
  • max_daily_transactions?: string – (옵션) 사용자가 매일 완료할 수 있는 최대 트랜잭션 수입니다. 지정되지 않은 경우 사용자는 매일 원하는 수의 트랜잭션을 완료할 수 있습니다.
반환 값 예제:
{
            "msg": "Successfully set max daily transactions for account id oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a to 100000"
        }
getMaxDailyAmount
이 메소드는 지정된 계정에 대한 max_daily_amount 값을 가져옵니다. 이 메소드는 체인 코드의 Token Admin 또는 Token Auditor 또는 지정된 조직의 Org Admin 또는 Org Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getMaxDailyAmount (account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization('ACCOUNT.getMaxDailyAmount', 'TOKEN', { account_id });
    return this.Ctx.Account.getMaxDailyAmount (account_id);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
           "max_daily_amount": "10000"
       }
getMaxDailyTransactionCount
이 메소드는 지정된 계정에 대한 max_daily_transactions 값을 가져옵니다. 이 메소드는 체인 코드의 Token Admin 또는 Token Auditor 또는 지정된 조직의 Org Admin 또는 Org Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getMaxDailyTransactionCount (account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization('ACCOUNT.getMaxDailyTransactionCount', 'TOKEN', { account_id });
    return this.Ctx.Account.getMaxDailyTransactionCount (account_id);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
           "max_daily_transactions": "100"
       }
consolidateRunningBalanceInTransactions
이 방법은 실행 중인 계정 잔액을 계산하여 거래 키/값 쌍에 업데이트된 값을 저장합니다. 일반적으로 시스템 관리자는 REST 프록시 스케줄러를 사용하여 이 메소드를 호출합니다. 이 메소드는 Token Admin 또는 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string())
  public async consolidateRunningBalanceInTransactions() {
    await this.Ctx.Auth.checkAuthorization("TRANSACTION.consolidateRunningBalanceInTransactions", "TOKEN");
    return this.Ctx.Transaction.consolidateRunningBalanceInTransactions(true);
  }
반환 값 예제:
{ msg: "Successfully updated account running balance for pending transactions."}
processSendersAndReceivers
이 방법은 조직간 이전 중에 생성된 발신자 및 수신자 키/값 쌍에 분산된 토큰 계정 잔액을 계산 및 업데이트한 다음 더 이상 사용되지 않는 발신자 및 수신자 키/값 쌍을 삭제합니다. 일반적으로 시스템 관리자는 REST 프록시 스케줄러를 사용하여 이 메소드를 호출합니다. 이 메소드는 Token Admin 또는 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string())
  public async processSendersAndReceivers() {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.processSendersAndReceivers", "TOKEN");
    return this.Ctx.Account.processSendersAndReceivers(true);
  }
반환 값 예제:
{ msg: "Successfully updated balance for accounts from pending receivers."}
addRole
이 메소드는 지정된 사용자 및 토큰에 롤을 추가합니다. 이 메소드는 체인 코드의 Token Admin 또는 지정된 롤을 보유한 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.string())
  public async addRole(account_id: string, role: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Auth.checkAuthorization("TOKEN.addRoleMember", "TOKEN", { token_id: account.token_id, org_id: account.org_id, role });
    await this.Ctx.Model.createEvent(EVENT_NAME.ADD_ROLE, { role, account_id }, token_asset);
    return await this.Ctx.Token.addRoleMember(role, account_id, token_asset);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
  • role: string – 지정된 사용자에 추가할 역할의 이름입니다. mintableburnable 동작은 사양 파일의 minter_role_nameburner_role_name 속성에 해당합니다. 마찬가지로 notary 역할은 사양 파일의 notary_role_name 속성에 해당합니다.
반환값:
  • 성공하면 계정 세부정보가 포함된 메시지가 표시됩니다.
반환 값 예제:
{
     "msg": "Successfully added role 'notary' to Account Id: oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8"
}
removeRole
이 방법은 지정된 사용자 및 토큰에서 역할을 제거합니다. 이 메소드는 체인 코드의 Token Admin 또는 지정된 롤을 보유한 지정된 조직의 Org Admin에 의해서만 호출될 수 있습니다.
@Validator(yup.string(), yup.string())
  public async removeRole(account_id: string, role: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Auth.checkAuthorization("TOKEN.removeRoleMember", "TOKEN", { token_id: account.token_id, org_id: account.org_id, role });
    await this.Ctx.Model.createEvent(EVENT_NAME.REMOVE_ROLE, { role, account_id }, token_asset);
    return await this.Ctx.Token.removeRoleMember(role, account_id, token_asset);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
  • role: string – 지정된 사용자로부터 제거할 역할의 이름입니다. mintableburnable 동작은 사양 파일의 minter_role_nameburner_role_name 속성에 해당합니다. 마찬가지로 notary 역할은 사양 파일의 notary_role_name 속성에 해당합니다.
반환값:
  • 성공하면 계정 세부정보가 포함된 메시지가 표시됩니다.
반환 값 예제:
{
   "msg": "Successfully removed role 'notary' from Account Id: oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8"
}
getAccountsByRole
이 메소드는 지정된 롤과 토큰에 대한 모든 계정 ID 목록을 반환합니다. 이 메소드는 Token Admin 또는 Token Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getAccountsByRole(token_id: string, role: string) {
    await this.Ctx.Auth.checkAuthorization("ROLE.getAccountsByRole", "TOKEN");
    return await this.Ctx.Role.getAccountsByRole(token_id, role);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • role: string – 검색할 역할의 이름입니다.
반환값:
  • 성공 시 계정 ID의 JSON 배열입니다.
반환 값 예제:
{
           "accounts": [
               "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75"
           ]
       }
getOrgAccountsByRole
이 메소드는 지정된 롤, 토큰 및 조직에 대한 모든 계정 ID 목록을 반환합니다. 이 메소드는 Token Admin 또는 Token Auditor 또는 지정된 조직의 Org Admin 또는 Org Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.string())
  public async getOrgAccountsByRole(token_id: string, role: string, org_id: string) {
    await this.Ctx.Auth.checkAuthorization("ROLE.getOrgAccountsByRole", "TOKEN", { org_id });
    return await this.Ctx.Role.getOrgAccountsByRole(token_id, role, org_id);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • role: string – 검색할 역할의 이름입니다.
  • org_id: string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
반환값:
  • 성공 시 계정 ID의 JSON 배열입니다.
반환 값 예제:
{
           "accounts": [
               "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75"
           ]
       }
getUsersByRole
이 메소드는 지정된 롤 및 토큰에 대한 모든 사용자 목록을 반환합니다. 이 메소드는 Token Admin 또는 Token Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getUsersByRole(token_id: string, role: string) {
    await this.Ctx.Auth.checkAuthorization("ROLE.getUsersByRole", "TOKEN");
    return await this.Ctx.Role.getUsersByRole(token_id, role);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • role: string – 검색할 역할의 이름입니다.
반환 값 예제:
{
          "users": [
              {
                  "token_id": "token",
                  "org_id": "CentralBank"
              }
          ]
      }
getOrgUsersByRole
이 메소드는 지정된 롤, 토큰 및 조직에 대한 모든 사용자 목록을 반환합니다. 이 메소드는 Token Admin 또는 Token Auditor 또는 지정된 조직의 Org Admin 또는 Org Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string(), yup.string())
  public async getOrgUsersByRole(token_id: string, role: string, org_id: string) {
    await this.Ctx.Auth.checkAuthorization("ROLE.getOrgUsersByRole", "TOKEN", { org_id });
    return await this.Ctx.Role.getOrgUsersByRole(token_id, role, org_id);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • role: string – 검색할 역할의 이름입니다.
  • org_id: string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
반환 값 예제:
{
           "users": [
               {
                   "token_id": "token",
                   "org_id": "CentralBank",
                   "user_id": "cb1",
                   "custom_account_id": "1234567jh"
               }
           ]
       }
isInRole
이 메소드는 사용자에게 지정된 롤이 있는지 여부를 나타내는 부울 값을 반환합니다. 이 메소드는 지정된 조직의 Token Admin 또는 Token Auditor, 계정의 AccountOwner 또는 Org Admin 또는 Org Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async isInRole(account_id: string, role: string) {
    const account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    const token_asset = await this.getTokenObject(account.token_id);
    await this.Ctx.Auth.checkAuthorization("TOKEN.isInRole", "TOKEN", { account_id });
    return { result: await this.Ctx.Token.isInRole(role, account_id, token_asset) };
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
  • role: string – 검색할 역할의 이름입니다.
반환값:
  • 성공 시 부울 결과의 JSON 문자열입니다.
반환 값 예제:
{
           "result": "true"
       }
getTotalMintedTokens
이 메소드는 지정된 토큰에 대해 민트된 토큰의 총 수를 반환합니다. 이 메소드는 Token Admin, Token Auditor, Org Admin 또는 Org Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getTotalMintedTokens(token_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Auth.checkAuthorization("TOKEN.getTotalMintedTokens", "TOKEN");
    const totalMintedTokens = await this.Ctx.Token.getTotalMintedTokens(token_asset);
    return {
      msg: `Total minted token for Token Id: ${token_id} is ${totalMintedTokens} tokens.`,
      quantity: totalMintedTokens,
    };
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
반환값:
  • 성공 시 총 토큰 수를 나타내는 JSON 문자열입니다.
반환 값 예제:
{
    "msg": "Total minted token for Token Id: USD is 910 tokens.",
    "quantity": 910
}
getNetTokens
이 메소드는 지정된 토큰에 대해 시스템에서 사용 가능한 총 순 토큰 수를 반환합니다. 순 토큰 합계는 토큰이 레코딩된 후 남은 토큰의 양입니다. 방정식 형식: net tokens = total minted tokens - total burned tokens. 토큰이 레코딩되지 않으면 순 토큰 수가 민트된 총 토큰 수와 같습니다. 이 메소드는 Token Admin, Token Auditor, Org Admin 또는 Org Auditor에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getNetTokens(token_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Auth.checkAuthorization("TOKEN.getNetTokens", "TOKEN");
    const netTokens = await this.Ctx.Token.getNetTokens(token_asset);
    return {
      msg: `Net supply of token for Token Id: ${token_id} is ${netTokens} tokens.`,
      quantity: netTokens,
    };
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
반환값:
  • 성공 시 순 토큰 수를 나타내는 JSON 문자열입니다.
반환 값 예제:
{
    "msg": "Net supply of token for Token Id: USD is 878 tokens.",
    "quantity": 878
}
requestMint
이 메서드는 광부가 지정된 양의 토큰을 만들기 위해 광부 공증에 요청을 보내기 위해 호출할 수 있습니다.
@Validator(
    yup.string(),
    yup.string(),
    yup.number().positive(),
    yup.date(),
    yup.object().nullable()
  )
  public async requestMint(
      operation_id: string,
      notary_account_id: string,
      quantity:number,
      time_to_expiration: Date,
      info_details ?: InfoDetails
  ) {
    const notary_account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(notary_account_id);
    const token_asset = await this.getTokenObject(notary_account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.REQUEST_MINT, { operation_id, notary_account_id, quantity, time_to_expiration, info_details }, token_asset);
    return await this.Ctx.Hold.hold(operation_id, null, notary_account_id, quantity, time_to_expiration, token_asset, HoldOperationType.MINT, info_details);
  }
매개변수:
  • operation_id: string – 민트 요청을 나타내는 고유한 작업 ID입니다.
  • notary_account_id: string – 요청을 처리할 광부 공증인의 고유 계정 ID입니다.
  • quantity: number – 민트할 토큰의 양입니다.
  • time_to_expiration – 민팅 요청이 만료되어 더 이상 유효하지 않은 시간입니다.
  • info_details: JSON – 요청의 범주(category) 및 설명(description)을 지정하는 객체입니다.

    Visual Studio Code와 CLI 또는 Postman 컬렉션을 사용하는 경우 info_details 매개변수를 다른 형식으로 지정합니다.

    Visual Studio 코드: { "category": "category value", "description": "description value" }

    CLI/Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

반환 값 예제:
{
           "msg": "AccountId oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41 has successfully submitted request to mint 200 tokens"
       }
approveMint
이 메서드는 민팅 요청을 승인하기 위해 광부 공증인이 호출할 수 있습니다.
@Validator(yup.string(), yup.string())
  public async approveMint(token_id: string, operation_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.APPROVE_MINT, { token_asset, operation_id }, token_asset);
    return await this.Ctx.Hold.executeHold(operation_id, token_asset, HoldOperationType.MINT);
  }
매개변수:
  • token_id: string – 민트할 토큰의 ID입니다.
  • operation_id: string – 민트 요청을 나타내는 고유한 작업 ID입니다.
반환 값 예제:
{
           "msg": "Successfully minted 1000 tokens to Account Id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41"
       }
rejectMint
이 메서드는 민팅 요청을 거부하기 위해 광부 공증인이 호출할 수 있습니다.
@Validator(yup.string(), yup.string())
  public async rejectMint(token_id: string, operation_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.REJECT_MINT, { token_asset, operation_id }, token_asset);
    return await this.Ctx.Hold.releaseHold(operation_id, token_asset, HoldOperationType.MINT);
  }
매개변수:
  • token_id: string – 민트할 토큰의 ID입니다.
  • operation_id: string – 민트 요청을 나타내는 고유한 작업 ID입니다.
반환 값 예제:
{
           "msg": "Successfully rejected mint request with Operation Id '89ce' to mint 2000 tokens of token id USD"
       }
issueTokens
이 메소드는 메소드의 호출자가 소유하는 토큰을 민트합니다.
@Validator(yup.string(), yup.number().positive(), yup.object().nullable())
  public async issueTokens(token_id: string, quantity: number, info_details?: InfoDetails) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.ISSUE_TOKENS, { quantity, token_asset, info_details }, token_asset);
    return await this.Ctx.Token.mint(quantity, token_asset, info_details);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • quantity – 민트할 토큰 수입니다.
  • info_details: JSON – 요청의 범주(category) 및 설명(description)을 지정하는 객체입니다.

    Visual Studio Code와 CLI 또는 Postman 컬렉션을 사용하는 경우 info_details 매개변수를 다른 형식으로 지정합니다.

    Visual Studio 코드: { "category": "category value", "description": "description value" }

    CLI/Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

반환 값 예제:
{
          "msg": "Successfully minted 1000 tokens to Account Id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41"
      }
transferTokens
이 방법은 호출자의 토큰을 지정된 계정으로 전송합니다.
@Validator(yup.string(), yup.number(), yup.object().nullable())
  public async transferTokens(to_account_id: string, quantity: number, info_details ?: InfoDetails) {
    if (quantity <= 0) {
      throw new Error("The quantity should be a positive number.")
    }
    const to_account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(to_account_id);
    const token_asset = await this.getTokenObject(to_account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.TRANSFER_TOKENS, { to_account_id, quantity, info_details }, token_asset);
    let isNotary = await this.Ctx.Token.checkNotary(to_account_id, token_asset);
    if(isNotary) {
      throw new Error(`To Account Id '${to_account_id}' can not have a notary role!`);
    }
    return await this.Ctx.Token.transfer(to_account_id, quantity, token_asset, info_details);
  }
매개변수:
  • to_account_id: string – 수신자(수취인)의 고유 계정 ID입니다.
  • quantity: number – 전송할 토큰 수입니다.
  • info_details: JSON – 요청의 범주(category) 및 설명(description)을 지정하는 객체입니다.

    Visual Studio Code와 CLI 또는 Postman 컬렉션을 사용하는 경우 info_details 매개변수를 다른 형식으로 지정합니다.

    Visual Studio 코드: { "category": "category value", "description": "description value" }

    CLI/Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

반환 값 예제:
{
          "msg": "Successfully transferred 10000 tokens from account id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41  to account id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a."
      }
getAccountOnHoldBalance
이 방법은 지정된 계정에 대한 현재 보류 잔액을 반환합니다. 이 메소드는 지정된 조직의 Token Admin 또는 Token Auditor, Org Admin 또는 Org Auditor 또는 계정의 AccountOwner에 의해서만 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getAccountOnHoldBalance(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getAccountOnHoldBalance", "TOKEN", { account_id });
    return await this.Ctx.Account.getAccountOnHoldBalance(account_id);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환값:
  • 성공 시 현재 보류 중인 잔액의 JSON 표현입니다.
반환 값 예제:
{
           "msg": "Total Holding Balance is: 0",
           "holding_balance": 0
       }
getOnHoldDetailsWithOperationId
이 메소드는 지정된 작업 ID 및 토큰에 대해 보류 중인 트랜잭션 세부정보를 반환합니다. 이 메소드는 체인코드의 Token Admin 또는 Token Auditor 또는 트랜잭션 참가자(발신자, 수신자, 공증)에 의해 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getOnHoldDetailsWithOperationId(token_id: string, operation_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getOnHoldDetailsWithOperationId", "TOKEN", { token_id, operation_id });
    return await this.Ctx.Hold.getOnHoldDetailsWithOperationId(token_id, operation_id);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • operation_id: string – 보류 작업을 식별하는 고유 ID입니다. 일반적으로 이 ID는 클라이언트 응용 프로그램에서 전달합니다.
반환 값 예제:
{
          "assetType": "ohold",
          "holding_id": "ohold~cbdc~token~hold1",
          "operation_id": "hold1",
          "token_name": "cbdc",
          "from_org_id": "CentralBank",
          "operation_type": "transfer",
          "status": "approved",
          "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
          "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
          "notary_account_id": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
          "token_id": "token",
          "quantity": "0",
          "time_to_expiration": "2029-01-04T00:00:00.000Z",
          "category": "category value",
          "description": "description value"
      }
getOnHoldIds
이 메소드는 지정된 계정에 대한 모든 보유 ID 목록을 반환합니다. 이 메소드는 체인 코드의 Token Admin 또는 Token Auditor, 지정된 조직의 Org Admin 또는 Org Auditor 또는 계정의 AccountOwner에 의해 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string())
  public async getOnHoldIds(account_id: string) {
    await this.Ctx.Account.getAccountWithTokenIdValidation(account_id);
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getOnHoldIds", "TOKEN", { account_id });
    return await this.Ctx.Account.getOnHoldIds(account_id);
  }
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환값:
  • 성공 시 보유 ID의 JSON 목록입니다.
반환 값 예제:
{
           "msg": "Holding Ids are: ",
           "holding_ids": ["ohold~cbdc~token~hold1"]
       }
getOnHoldBalanceWithOperationId
이 메소드는 지정된 작업 ID 및 토큰에 대해 보류 중인 잔액을 반환합니다. 이 메소드는 체인코드의 Token Admin 또는 Token Auditor 또는 트랜잭션 참가자(발신자, 수신자, 공증)에 의해 호출될 수 있습니다.
@GetMethod()
  @Validator(yup.string(), yup.string())
  public async getOnHoldBalanceWithOperationId(token_id: string, operation_id: string) {
    await this.Ctx.Auth.checkAuthorization("ACCOUNT.getOnHoldBalanceWithOperationId", "TOKEN", { token_id, operation_id });
    return await this.Ctx.Hold.getOnHoldBalanceWithOperationId(token_id, operation_id);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • operation_id: string – 보류 작업을 식별하는 고유 ID입니다. 일반적으로 이 ID는 클라이언트 응용 프로그램에서 전달합니다.
반환값:
  • 성공 시 보류 잔액을 나타내는 JSON 문자열입니다.
반환 값 예제:
{
           "msg": "Current Holding Balance of Operation 'hold1' for token 'token' is: 0",
           "holding_balance": 0
       }
holdTokens
이 메소드는 to_account_id 계정을 사용하여 호출자(토큰 소유자) 대신 보류를 생성합니다. 지정된 공증 계정은 보류를 완료하거나 해제할 책임이 있습니다. 보류가 생성되면 지급인의 지정된 토큰 잔액이 보류됩니다. 보류가 완료되거나 해제될 때까지 보류 잔액을 이전할 수 없습니다.
@Validator(
    yup.string(),
    yup.string(),
    yup.string(),
    yup.number().positive(),
    yup.date(),
    yup.object().nullable()
  )
  public async holdTokens(
    operation_id: string,
    to_account_id: string,
    notary_account_id: string,
    quantity: number,
    time_to_expiration: Date,
    info_details ?: InfoDetails,
  ) {
    const to_account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(to_account_id);
    await this.Ctx.Account.getAccountWithTokenIdValidation(notary_account_id);
    const token_asset = await this.getTokenObject(to_account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.HOLD_TOKENS, {
      operation_id,
      to_account_id,
      notary_account_id,
      quantity,
      time_to_expiration,
      info_details
    }, token_asset);
    return await this.Ctx.Hold.hold(operation_id, to_account_id, notary_account_id, quantity, time_to_expiration, token_asset, HoldOperationType.TRANSFER, info_details);
  }
매개변수:
  • operation_id: string – 보류 작업을 식별하는 고유 ID입니다. 일반적으로 이 ID는 클라이언트 응용 프로그램에서 전달합니다.
  • to_account_id: string – 수신자의 고유 계정 ID입니다.
  • notary_account_id: string – 공증인의 고유 계정 ID입니다.
  • quantity: number – 보류할 토큰 수입니다.
  • time_to_expiration – 보류가 만료되는 시간입니다. 영구 보류의 경우 0을 지정합니다. 그렇지 않으면 RFC-3339 형식을 사용합니다. 2021-06-02T12:46:06Z를 예를 들 수 있습니다.
  • info_details: JSON – 요청의 범주(category) 및 설명(description)을 지정하는 객체입니다.

    Visual Studio Code와 CLI 또는 Postman 컬렉션을 사용하는 경우 info_details 매개변수를 다른 형식으로 지정합니다.

    Visual Studio 코드: { "category": "category value", "description": "description value" }

    CLI/Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

반환 값 예제:
{
           "msg": "AccountId oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3 is successfully holding 100 tokens"
       }
executeHoldTokens
이 메소드는 토큰에 대한 보류를 완료합니다. 토큰 소유자가 이전에 보유한 토큰의 수량이 수신자에게 이전됩니다. quantity 값이 실제 보류 값보다 작은 경우 토큰의 원래 소유자가 나머지 금액을 다시 사용할 수 있습니다. 이 메소드는 지정된 작업 ID에 대해 notary 롤을 가진 AccountOwner ID로만 호출할 수 있습니다. 홀드는 공증인에 의해서만 완성될 수 있다.
@Validator(yup.string(), yup.string(), yup.number().positive())
  public async executeHoldTokens(token_id: string, operation_id: string, quantity: number) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.EXECUTE_HOLD_TOKENS, { token_asset, operation_id, quantity }, token_asset);
    return await this.Ctx.Hold.executeHold(operation_id, token_asset, HoldOperationType.TRANSFER, quantity);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • operation_id: string – 보류 작업을 식별하는 고유 ID입니다. 일반적으로 이 ID는 클라이언트 응용 프로그램에서 전달합니다.
  • quantity: number – 전송할 보류 중인 토큰 수입니다.
반환값:
  • 성공 시 발신자의 계정 ID 및 트랜잭션 수량을 포함하는 메시지입니다.
반환 값 예제:
{
           "msg": "Account Id: oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111 is successfully executed '10' tokens from Operation Id '454f4bf6'."
       }
releaseHoldTokens
이 방법은 토큰 보류를 해제합니다. 전송이 완료되지 않았으며 모든 보유 토큰을 원래 소유자가 다시 사용할 수 있습니다. 이 메소드는 지정된 시간 제한 내에 notary 롤이 있는 AccountOwner ID 또는 지정된 시간 제한 이후 지급인, 수취인 또는 공증인이 호출할 수 있습니다.
@Validator(yup.string(), yup.string())
  public async releaseHoldTokens(token_id: string, operation_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.RELEASE_HOLD_TOKENS, { token_asset, operation_id }, token_asset);
    return await this.Ctx.Hold.releaseHold(operation_id, token_asset, HoldOperationType.TRANSFER);
  }
매개변수:
  • token_id: string – 토큰 ID입니다.
  • operation_id: string – 보류 작업을 식별하는 고유 ID입니다. 일반적으로 이 ID는 클라이언트 응용 프로그램에서 전달합니다.
반환값:
  • 성공 시 보류가 해제되었음을 나타내는 메시지입니다.
반환 값 예제:
{
           "msg": "Successfully released '200' tokens from Operation Id '77b75873' to Account Id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a."
       }
requestBurn
이 메서드는 버너에 의해 호출되어 지정된 양의 토큰을 파괴하기 위해 버너 공증에 요청을 보낼 수 있습니다.
@Validator(
    yup.string(),
    yup.string(),
    yup.number().positive(),
    yup.date(),
    yup.object().nullable()
  )
  public async requestBurn(
      operation_id: string,
      notary_account_id: string,
      quantity:number,
      time_to_expiration: Date,
      info_details ?: InfoDetails,
  ) {
    const notary_account: FungibleAccount = await this.Ctx.Account.getAccountWithTokenIdValidation(notary_account_id);
    const token_asset = await this.getTokenObject(notary_account.token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.REQUEST_BURN, { operation_id, notary_account_id, quantity, time_to_expiration, info_details }, token_asset);
    return await this.Ctx.Hold.hold(operation_id, null, notary_account_id, quantity, time_to_expiration, token_asset, HoldOperationType.BURN, info_details);
  }
매개변수:
  • operation_id: string – 레코딩 요청을 나타내는 고유한 작업 ID입니다.
  • notary_account_id: string – 요청을 처리할 버너 공증인의 고유 계정 ID입니다.
  • quantity: number – 레코딩할 토큰의 양입니다.
  • time_to_expiration – 레코딩 요청이 만료되고 더 이상 유효하지 않은 시간입니다.
  • info_details: JSON – 요청의 범주(category) 및 설명(description)을 지정하는 객체입니다.

    Visual Studio Code와 CLI 또는 Postman 컬렉션을 사용하는 경우 info_details 매개변수를 다른 형식으로 지정합니다.

    Visual Studio 코드: { "category": "category value", "description": "description value" }

    CLI/Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

반환 값 예제:
{
           "msg": "AccountId oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98 has successfully submitted request to burn 100 tokens"
       }
approveBurn
이 메서드는 레코딩 요청을 승인하기 위해 버너 공증에 의해 호출 될 수 있습니다.
@Validator(yup.string(), yup.string())
  public async approveBurn(token_id: string, operation_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.APPROVE_BURN, { token_asset, operation_id }, token_asset);
    return await this.Ctx.Hold.executeHold(operation_id, token_asset, HoldOperationType.BURN);
  }
매개변수:
  • token_id: string – 레코딩할 토큰의 ID입니다.
  • operation_id: string – 레코딩 요청을 나타내는 고유한 작업 ID입니다.
반환 값 예제:
{
           "msg": "Successfully burned 200 tokens from account id: oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98"
       }
rejectBurn
이 메서드는 레코딩 요청을 거부하기 위해 버너 공증에 의해 호출 될 수 있습니다.
@Validator(yup.string(), yup.string())
  public async rejectBurn(token_id: string, operation_id: string) {
    const token_asset = await this.getTokenObject(token_id);
    await this.Ctx.Model.createEvent(EVENT_NAME.REJECT_BURN, { token_asset, operation_id }, token_asset);
    return await this.Ctx.Hold.releaseHold(operation_id, token_asset, HoldOperationType.BURN);
  }
매개변수:
  • token_id: string – 레코딩할 토큰의 ID입니다.
  • operation_id: string – 레코딩 요청을 나타내는 고유한 작업 ID입니다.
반환 값 예제:
{
           "msg": "Successfully rejected burn request with Operation Id '8d34' to burn 100 tokens of token id USD"
       }

TypeScript 조직간 이전 방법

조직간 이전에는 두 부분이 있습니다. 먼저 송신자로부터 금액을 차변 기입한 다음 수령인에게 금액을 대변 기입합니다. 다음 두 API는 Oracle Blockchain Platform REST 프록시의 2단계 커밋 API를 사용하여 기본 트랜잭션으로 함께 호출됩니다. 기밀 전송은 두 조직의 개인 데이터 수집이 서로 다르며 단일 트랜잭션에서 액세스할 수 없기 때문에 이러한 방식으로 수행됩니다.

두 트랜잭션은 모두 REST 프록시의 2단계 커밋 API를 사용하여 전송됩니다. 자세한 내용은 기본 트랜잭션 호출을 참조하십시오.

URL이 https://test-xyz-abc.blockchain.ocp.oraclecloud.com:7443/restproxy/api/v2/atomicTransactions와 유사한 Postman 모음에서 POST 요청을 만들 수 있습니다. 다음 헤더를 포함하여 모든 필수 헤더를 보내야 합니다.
- Content-Type: application/json
- Confidential-Transaction: true
요청 본문에 다음 요청에 표시된 대로 executeHoldTokensSenderexecuteHoldTokensReceiver 메소드를 포함시킵니다.
{
 "transactions": [
   {
        "chaincode": "<chaincode>",
        "args": [
            "executeHoldTokensSender"
        ],
        "timeout": 6000,
        "sync": true,
        "transientMap": {
            "args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
        },
        "endorsers" : <Sender's endorsers List>,
        "channel":"<channel name>"
   },
   {
        "chaincode": "<chaincode name>",
        "args": [
            "executeHoldTokensReceiver"
        ],
        "timeout": 6000,
        "sync": true,
        "transientMap": {
            "args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
        },
        "endorsers" : <Recipient endorsers List>,
        "channel":"<channelName>"
    }
 ],
 "isolationLevel": "readCommitted",
 "prepareTimeout": 10000,
 "copyInputsToTransientMap": true,
 "sync": true,
 "parallelPrepare": true
}
다음 예에서는 요청 본문을 보여줍니다.
{
 "transactions": [
   {
        "chaincode": "WholesaleCBDCConfidential",
        "args": [
            "executeHoldTokensSender"
        ],
        "timeout": 6000,
        "sync": true,
        "transientMap": {
            "args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
        },
        "endorsers" : ["org1-xyz-abc.blockchain.ocp.oraclecloud.com:20009", "org1-xyz-abc.blockchain.ocp.oraclecloud.com:20009"],
        "channel":"default"
   },
   {
        "chaincode": "WholesaleCBDCConfidential",
        "args": [
            "executeHoldTokensReceiver"
        ],
        "timeout": 6000,
        "sync": true,
        "transientMap": {
            "args": "[ \"bc-token-id value\",\"operation_id value\",\"quantity value\"]"
        },
        "endorsers" : ["org2-xyz-abc.blockchain.ocp.oraclecloud.com:20009", "org2-xyz-abc.blockchain.ocp.oraclecloud.com:20009"],
        "channel":"default"
    }
 ],
 "isolationLevel": "readCommitted",
 "prepareTimeout": 10000,
 "copyInputsToTransientMap": true,
 "sync": true,
 "parallelPrepare": true
}
executeHoldTokensSender
이 메소드는 지정된 작업 ID에 대해 공증인 롤을 가진 사용자만 호출할 수 있습니다. 이 방법은 조직 간 이전 승인의 첫 번째 부분입니다. 지정된 금액은 발신자의 계정에서 공제됩니다.
@ExcludeFromPostmanCollection()
  @Validator(yup.string(), yup.string(), yup.number().positive(), yup.string(), yup.string())
  public async executeHoldTokensSender(token_id: string, operation_id: string, quantity: number,  isolationLevel: string, globalIdInput:string) {
    if (!this.Ctx.Utils.isValidInterOrgTransferRequest()) {
      throw new Error("The request for the inter-org transfer is invalid.")
    }
    const globalTxId =  this.Ctx.Utils.extractGlobalTransactionId(globalIdInput);
    const token_asset = await this.getTokenObject(token_id);
    return await this.Ctx.Hold.executeHoldSender(operation_id, quantity, globalTxId, token_asset);
  }
매개변수:
  • token_id: string – 레코딩할 토큰의 ID입니다.
  • operation_id: string – 승인할 보류 요청을 나타내는 고유한 작업 ID입니다.
  • quantity: number – 전송할 보유 토큰의 양입니다.
  • isolationLevel: string – 원자 트랜잭션의 격리 수준으로, serializable 또는 readCommitted입니다.
  • globalIdInput: string
반환 값 예제:
{
      "msg":
        "Account Id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a is successfully executed '10' tokens from Operation Id 'hold1'."
    }
executeHoldTokensReceiver
이 메소드는 지정된 작업 ID에 대해 공증인 롤을 가진 사용자만 호출할 수 있습니다. 이 방법은 조직 간 이전 승인의 두 번째 부분입니다. 지정된 금액이 수령인 계정에 대변 기입됩니다.
@ExcludeFromPostmanCollection()
  @Validator(yup.string(), yup.string(), yup.number().positive(), yup.string(), yup.string())
  public async executeHoldTokensReceiver(token_id: string, operation_id: string, quantity: number,  isolationLevel: string, globalIdInput:string) {
    if (!this.Ctx.Utils.isValidInterOrgTransferRequest()) {
      throw new Error("The request for the inter-org transfer is invalid.")
    }
    const globalTxId =  this.Ctx.Utils.extractGlobalTransactionId(globalIdInput);
    const token_asset = await this.getTokenObject(token_id);
    return await this.Ctx.Hold.executeHoldReceiver(operation_id, quantity, globalTxId, token_asset);
  }
매개변수:
  • token_id: string – 레코딩할 토큰의 ID입니다.
  • operation_id: string – 승인할 보류 요청을 나타내는 고유한 작업 ID입니다.
  • quantity: number – 전송할 보유 토큰의 양입니다.
  • isolationLevel: string – 원자 트랜잭션의 격리 수준으로, serializable 또는 readCommitted입니다.
  • globalIdInput: string
반환 값 예제:
{
      "msg":
        "Account Id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a is successfully executed '10' tokens from Operation Id 'hold1, receiverId oreceiver~72d9bfcf-2c68-4c33-b8c3-fe3374983bf2'."
    }

기밀 체인 코드에 대해 수정된 TypeScript SDK 메소드

확장된 토큰 분류법 프레임워크 표준을 사용하는 토큰에 대한 사양 파일에 confidential: true 매개변수를 포함하는 경우 Blockchain App Builder는 표준 SDK 방법의 수정된 버전 및 추가 메소드를 생성합니다.

isUserTokenAdmin
이 메소드는 함수 호출자가 Token Admin인 경우 부울 값 true를 반환합니다. 그렇지 않으면 메소드가 false를 반환합니다.
Ctx.Auth.isUserTokenAdmin(org_id: string, user_id: string);
매개변수:
  • org_id – 현재 네트워크 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환 값 예제:
{
    "result": true
}
addTokenAdmin
이 메소드는 사용자를 토큰 체인코드의 Token Admin로 추가합니다. user_id 값은 공공 원장에 저장되므로 user_id 값에 개인 식별 정보(PII)를 사용하지 마십시오.
Ctx.Admin.addTokenAdmin(org_id: string, user_id: string);
매개변수:
  • user_id – 사용자의 사용자 이름 또는 전자메일 ID입니다.
  • org_id – 현재 네트워크 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
반환 값 예제:
{
  "msg": "Successfully added Token Admin (Org_Id: CentralBank, User_Id: cb1)"
}
removeTokenAdmin
이 메소드는 토큰 체인코드의 Token Admin인 사용자를 제거합니다.
Ctx.Admin.removeTokenAdmin(org_id: string, user_id: string);
매개변수:
  • user_id – 사용자의 사용자 이름 또는 전자메일 ID입니다.
  • org_id – 현재 네트워크 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
반환 값 예제:
{"msg": "Successfully removed Admin (Org_Id: Org1MSP, User_Id: User1)"}
getAllTokenAdmins
이 메소드는 체인 코드의 Token Admin인 모든 사용자 목록을 반환합니다.
Ctx.Admin.getAllTokenAdmins();
매개변수:
  • 없음
반환 값 예제:
{"admins":[{"org_id":"Org1MSP","user_id":"admin"}]}
addOrgAdmin
이 메소드는 사용자를 조직의 Org Admin로 추가합니다. user_id 값은 공공 원장에 저장되므로 user_id 값에 개인 식별 정보(PII)를 사용하지 마십시오.
 Ctx.Admin.addOrgAdmin(org_id: string, user_id: string);
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환 값 예제:
{
    "msg": "Successfully added Org Admin (Org_Id: Org1MSP, User_Id: orgAdmin)"
}
removeOrgAdmin
이 방법은 조직의 Org Admin인 사용자를 제거합니다.
Ctx.Admin.removeOrgAdmin(org_id: string, user_id: string);
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환 값 예제:
{
  "msg": "Successfully removed Org Admin (Org_Id Org1MSP User_Id orgAdmin)"
}
getAllOrgAdmins
이 메소드는 조직의 Org Admin인 모든 사용자 목록을 반환합니다.
Ctx.Admin.getAllOrgAdmins();
매개변수:
  • 없음
반환 값 예제:
{
    "admins": [
        {
            "org_id": "Org1MSP",
            "user_id": "orgadmin"
        },
        {
            "org_id": "Org1MSP",
            "user_id": "orgadmin1"
        },
        {
            "org_id": "Org1MSP",
            "user_id": "orgadmin2"
        }
    ]
}
addTokenAuditor
이 메소드는 사용자를 체인코드의 Token Auditor로 추가합니다. user_id 값은 공공 원장에 저장되므로 user_id 값에 개인 식별 정보(PII)를 사용하지 마십시오.
Ctx.Admin.addTokenAuditor(org_id: string, user_id: string);
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환값:
  • 성공 시 체인 코드의 Token Auditor로 추가된 사용자의 세부정보를 포함하는 메시지입니다.
반환 값 예제:
{
  "msg": "Successfully added Token Auditor (Org_Id: CentralBank, User_Id: cb_admin_demo)"
}
removeTokenAuditor
이 메소드는 사용자를 체인코드의 Token Auditor로 제거합니다.
Ctx.Admin.removeTokenAuditor(org_id: string, user_id: string);
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환 값 예제:
{
           "msg": "Successfully removed Token Auditor (Org_Id: CB, User_Id: cb)"
       }
getAllTokenAuditors
이 메소드는 체인 코드의 모든 Token Auditors를 반환합니다.
this.Ctx.Admin.getAllTokenAuditors();
addOrgAuditor
이 메소드는 사용자를 체인코드의 Org Auditor로 추가합니다.
Ctx.Admin.addOrgAuditor(org_id: string, user_id: string);
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환 값 예제:
{
           "msg": "Successfully added Org Auditor (Org_Id: CentralBank, User_Id: cb_admin_demo)"
       }
removeOrgAuditor
이 메소드는 사용자를 체인코드의 Org Auditor로 제거합니다.
this.Ctx.Admin.removeOrgAuditor(org_id: string, user_id: string);
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환 값 예제:
{
           "msg": "Successfully removed Org Auditor (Org_Id: CB, User_Id: cb)"
       }
getAllOrgAuditors
이 메소드는 체인 코드의 모든 Org Auditors를 반환합니다.
this.Ctx.Admin.getAllOrgAuditors()
getAllTokens
이 메소드는 상태 데이터베이스에 저장된 모든 토큰 자산을 반환합니다. 이 방법은 Berkeley DB SQL 리치 쿼리를 사용하며 원격 Oracle Blockchain Platform 네트워크에 연결된 경우에만 호출할 수 있습니다.
this.Ctx.Token.getAllTokens();
매개변수:
  • 없음
반환값:
  • 성공하면 모든 토큰 자산에 대한 약속을 반환합니다. 오류 발생 시 오류 메시지를 반환합니다.
getDecimals
이 메소드는 소수 토큰에 사용할 수 있는 소수 자릿수를 반환합니다. divisible 동작이 지정되지 않은 경우 기본값은 0입니다.
this.Ctx.Token.getDecimals(token_asset)
매개변수:
  • token_id: string – 토큰 ID입니다.
반환 값 예제:
1
history
이 메소드는 지정된 토큰에 대한 기록을 반환합니다.
Ctx.Token.history(tokenId: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
반환 값 예제:
[
    {
        "trxId": "0d75f09446a60088afb948c6aca046e261fddcd43df416076201cdc5565f1a35",
        "timeStamp": "2023-09-01T16:48:41.000Z",
        "value": {
            "assetType": "otoken",
            "token_id": "token",
            "token_name": "fiatmoneytok",
            "token_desc": "updatedDesc",
            "token_standard": "ttf+",
            "token_type": "fungible",
            "token_unit": "fractional",
            "behaviors": [
                "divisible",
                "mintable",
                "transferable",
                "burnable",
                "roles"
            ],
            "roles": {
                "minter_role_name": "minter"
            },
            "mintable": {
                "max_mint_quantity": 1000
            },
            "divisible": {
                "decimal": 2
            }
        }
    },
    {
        "trxId": "3666344878b043b65d5b821cc79c042ba52aec467618800df5cf14eac69f72fa",
        "timeStamp": "2023-08-31T20:24:55.000Z",
        "value": {
            "assetType": "otoken",
            "token_id": "token",
            "token_name": "fiatmoneytok",
            "token_standard": "ttf+",
            "token_type": "fungible",
            "token_unit": "fractional",
            "behaviors": [
                "divisible",
                "mintable",
                "transferable",
                "burnable",
                "roles"
            ],
            "roles": {
                "minter_role_name": "minter"
            },
            "mintable": {
                "max_mint_quantity": 1000
            },
            "divisible": {
                "decimal": 2
            }
        }
    }
]
getTokensByName
이 메소드는 지정된 이름을 가진 모든 토큰 자산을 반환합니다. 이 방법은 Berkeley DB SQL 리치 쿼리를 사용하며 원격 Oracle Blockchain Platform 네트워크에 연결된 경우에만 호출할 수 있습니다.
Ctx.Token.getTokensByName(token_name: string);
매개변수:
  • token_name: string – 모델의 Token_name 속성에 해당하는 토큰의 이름입니다. 값은 토큰의 클래스 이름입니다.
반환 값 예제:
[
 {
    "assetType": "otoken",
    "token_id": "digiCurr101",
    "token_name": "digicur",
    "token_desc": "Digital Currency equiv of dollar",
    "token_type": "fungible",
    "behaviors": [
        "divisible",
        "mintable",
        "transferable",
        "burnable",
        "roles"
    ],
    "roles": {
        "minter_role_name": "minter"
        "burner_role_name": "burner",
        "notary_role_name": "notary"
    },
    "mintable": {
        "max_mint_quantity": 2000
    },
    "divisible": {
        "decimal": 1
    },
    "currency_name": "DOLLAR",
    "token_to_currency_ratio": 1
 }
]
createAccount
이 메소드는 지정된 사용자 및 토큰의 계정을 만듭니다. 토큰이 있는 모든 사용자는 계정을 가져야 합니다.
Ctx.Account.createAccount(org_id: string, user_id: string, token_type: string, dailyLimits);
매개변수:
  • org_id: string – 현재 조직에 있는 사용자의 멤버쉽 서비스 공급자(MSP) ID입니다. ID는 영숫자로 시작해야 하며 문자, 숫자 및 밑줄(_), 마침표(.), @ 기호 및 하이픈(-)과 같은 특수 문자를 포함할 수 있습니다.
  • user_id: string – 사용자의 사용자 이름 또는 전자메일 ID입니다. ID는 영숫자로 시작해야 하며 문자, 숫자 및 밑줄(_), 마침표(.), @ 기호 및 하이픈(-)과 같은 특수 문자를 포함할 수 있습니다.
  • token_type: string – 토큰의 유형으로, fungible이어야 합니다.
  • daily_limits: DailyLimits – 다음 유형의 JSON 객체입니다.
    {
         "max_daily_amount": 100000
         "max_daily_transactions": 10000
     }
    예제에서 max_daily_amount 값은 매일 트랜잭션할 수 있는 최대 토큰 수이고 max_daily_transactions 값은 매일 완료할 수 있는 최대 트랜잭션 수입니다.
반환 값 예제:
{
    "bapAccountVersion": 0,
    "assetType": "oaccount",
    "account_id": "oaccount~b53cb2c19c92d1d5c8cb9f6e988e7761c34e03e014e6c4b889565fc0abf46c8a",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "",
    "token_name": "",
    "balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_burn_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6"
}
associateToken
이 방법은 대체 가능한 토큰을 계정에 연결합니다.
Ctx.Account.associateToken(account_id: string, token_id: string, custom_account_id?: string);
매개변수:
  • account_id: string – 계정의 ID입니다.
  • token_id: string – 토큰 ID입니다.
  • custom_account_id: string – 기밀 모드의 경우 계정의 은행 계정 ID, 고유한 임의 영숫자 식별자입니다. 기본적으로 길이는 14자입니다.
반환 값 예제:
{
    "bapAccountVersion": 0,
    "assetType": "oaccount",
    "account_id": "oaccount~b53cb2c19c92d1d5c8cb9f6e988e7761c34e03e014e6c4b889565fc0abf46c8a",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "USD",
    "token_name": "cbdc",
    "balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "onhold_burn_balance": "028b72742c8aa9a0395c828fe4f0e46226a3e40d4e731d0b994c8028c8b7bd4df6",
    "application_groups": [
        "CENTRAL_BANK_USERS"
    ]
}
getAllAccounts
이 방법은 모든 계정 목록을 반환합니다. 이 방법은 Berkeley DB SQL 리치 쿼리를 사용하며 원격 Oracle Blockchain Platform 네트워크에 연결된 경우에만 호출할 수 있습니다.
this.Ctx.Account.getAllAccounts();
매개변수:
  • 없음
반환 값 예제:
[
    {
        "key": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
        "valueJson": {
            "bapAccountVersion": 3,
            "assetType": "oaccount",
            "account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "028a27c752e9b518d156e61da6589e723b179b6d7351dc34ec92bbb27b783ed1dc",
            "onhold_balance": "02d53a7eda9484bda7252212714f647b70d32663cfa416f93f488ef6b6bc8fb2eb",
            "onhold_burn_balance": "02d53a7eda9484bda7252212714f647b70d32663cfa416f93f488ef6b6bc8fb2eb",
            "application_groups": [
                "application_groups value"
            ]
        }
    },
    {
        "key": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
        "valueJson": {
            "bapAccountVersion": 0,
            "assetType": "oaccount",
            "account_id": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "onhold_balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "onhold_burn_balance": "020da01cd57249c6470b6dd03c2ee4c49de58c71ccc64f2de1203e835967a0846d",
            "application_groups": [
                "application_groups value"
            ]
        }
    }
]
getAllOrgAccounts
이 메소드는 지정된 조직에 속하는 모든 토큰 계정 목록을 반환합니다.
Ctx.Account.getAllOrgAccounts(org_id: string);
매개변수:
  • org_id: string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
반환 값 예제:
[
    {
        "key": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
        "valueJson": {
            "bapAccountVersion": 2,
            "assetType": "oaccount",
            "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "18",
            "onhold_balance": "0",
            "onhold_burn_balance": "0",
            "application_groups": [
                "application_groups value"
            ],
            "user_id": "cb",
            "custom_account_id": "1234567jh"
        }
    },
    {
        "key": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
        "valueJson": {
            "bapAccountVersion": 1,
            "assetType": "oaccount",
            "account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
            "org_id": "CentralBank",
            "token_type": "fungible",
            "token_id": "token",
            "token_name": "cbdc",
            "balance": "22",
            "onhold_balance": "0",
            "onhold_burn_balance": "0",
            "application_groups": [
                "application_groups value"
            ],
            "user_id": "cb1",
            "custom_account_id": "1234567jh"
        }
    }
]
getAccountsByUser
이 메소드는 지정된 사용자 및 조직에 대한 모든 계정 ID 목록을 반환합니다.
Ctx.Account.getAccountsByUser(org_id: string, user_id: string);
매개변수:
  • org_id string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
  • user_id string – 사용자의 사용자 이름 또는 전자메일 ID입니다.
반환 값 예제:
[
    {
        "bapAccountVersion": 2,
        "assetType": "oaccount",
        "user_id": "cb",
        "custom_account_id": "1234567jh",
        "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
        "org_id": "CentralBank",
        "token_type": "fungible",
        "token_id": "token",
        "token_name": "cbdc",
        "balance": "18",
        "onhold_balance": "0",
        "onhold_burn_balance": "0",
        "application_groups": [
            "application_groups value"
        ]
    }
]
getUserByAccountId
이 메소드는 지정된 계정에 대한 사용자 세부 정보를 반환합니다.
this.Ctx.Account.getUserByAccountId(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
    "token_id": "USD",
    "org_id": "CentralBank",
    "user_id": "cb_admin_demo",
    "custom_account_id": "10101234000123"
}
getAccountWithStatus
이 메소드는 지정된 사용자 및 토큰에 대한 계정 세부정보를 반환합니다.
Ctx.Account.getAccountWithStatus(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
    "bapAccountVersion": 2,
    "assetType": "oaccount",
    "user_id": "cb",
    "custom_account_id": "1234567jh",
    "status": "active",
    "account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
    "org_id": "CentralBank",
    "token_type": "fungible",
    "token_id": "token",
    "token_name": "cbdc",
    "balance": "18",
    "onhold_balance": "0",
    "onhold_burn_balance": "0",
    "application_groups": [
        "application_groups value"
    ]
}
getAccountDetailsByCustomAccountId
이 메소드는 지정된 조직 및 계정 ID에 대한 모든 토큰 계정 세부정보를 반환합니다.
Ctx.Account.getAccountDetailsByCustomAccountId(custom_account_id: string, org_id: string)
매개변수:
  • custom_account_id: string – 계정의 은행 계정 ID로, 고유한 임의의 영숫자 식별자입니다.
  • org_id string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
반환 값 예제:
[
    {
        "bapAccountVersion": 0,
        "assetType": "oaccount",
        "account_id": "oaccount~c44ffac4c46718e9744cb0aae2016d26a87a5bef5e2d1c0d1abc7d8782f0ba61",
        "org_id": "CentralBank",
        "token_type": "fungible",
        "token_id": "USD",
        "token_name": "cbdc",
        "balance": "0",
        "onhold_balance": "0",
        "onhold_burn_balance": "0",
        "application_groups": [
            "SYSTEM_ADMINS"
        ],
        "user_id": "cb_admin_demo",
        "custom_account_id": "10101234000123"
    }
]
getAccountTransactionHistory
이 메소드는 지정된 계정에 대한 트랜잭션 기록 세부정보의 배열을 반환합니다.
Ctx.Account.getAccountTransactionHistory(account_id: string)
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
[
    {
        "transaction_id": "otransaction~4514aa229ebcc4d2fedcaa47c4301615e30c4a9bae45cf0256a5b80d75b3697a",
        "transacted_amount": 1000,
        "timestamp": "2025-08-25T13:20:50.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 21000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~1982f73495060e0eef4d78282a91c41e27e8c95572739b0677a1e404a0d20aa9",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:12:43.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~fedd714cf1509f7517819d7cd4c0921d0b2f5d1ff6a25dcb08ab411defd6b5f3",
        "transacted_amount": 2000,
        "timestamp": "2025-08-21T05:23:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~f33b47234f3ee0b636962c8c31c01d06523b789ca16b3b342d5080b71268bcc3",
        "transacted_amount": 1000,
        "timestamp": "2025-08-21T05:23:07.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~cf934527149bc24f62a8ddeeea7f74a19a0f84d8f161535a771be49d2520d5b3",
        "transacted_amount": 10000,
        "timestamp": "2025-08-13T06:12:41.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 20000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~f5c0e11ca61d9adc843658929e6de2a738ad586304f9e020f75bf4aac5e42a2c",
        "transacted_amount": 10000,
        "timestamp": "2025-08-13T06:12:04.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~862aa9d9e877d3ea209b87299ab5b12c13ed5ce43d1cf1b934043c1dd02f58f6",
        "transacted_amount": 50000,
        "timestamp": "2025-08-12T21:04:22.000Z",
        "token_id": "USD",
        "category": "transfer",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transaction_type": "DEBIT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~8a74c6d87ca74a613aab9db5d40386f8d5b534f9800503af8ca27e8946d7616d",
        "transacted_amount": 40000,
        "timestamp": "2025-08-12T21:01:27.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REJECT_MINT",
        "balance": 60000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~28ac66ba33f7ad0648448964b2b74525c9e3f0c9908c7a0484690b9baa56c2db",
        "transacted_amount": 30000,
        "timestamp": "2025-08-12T21:01:16.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 60000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~7e32ad8f365ff59814e112f27602f30ab599fb9c1638784496c66a61a6277c22",
        "transacted_amount": 20000,
        "timestamp": "2025-08-12T21:01:05.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 30000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~1477050bb9e55f4f471872b31fce0d2097f5d5e57d89a842070df5e36d7ab0da",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:01:03.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "APPROVE_MINT",
        "balance": 10000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~0e76c6931b7ee134e967e847d9730b867a0fd191d39697d83d36dd15745c02e3",
        "transacted_amount": 40000,
        "timestamp": "2025-08-12T21:00:20.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~07bbf9c190694371626da59ded5d87434d26f612891e13bb15bdd28f6086e760",
        "transacted_amount": 30000,
        "timestamp": "2025-08-12T21:00:01.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~8721175c6cbbce17b6c4bb6a444e475d07f52352dfd0d990679f342215153513",
        "transacted_amount": 20000,
        "timestamp": "2025-08-12T20:59:41.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~dc24c24d43a6525e807a39edcf8c6a2b6ccb81f0d755958f509509687eacee84",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T20:59:13.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "REQUEST_MINT",
        "balance": 0,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~396e6ca5a11a9609632d0864026409d46a708fb95e3e21b39fa5f3fb78f90872",
        "transacted_amount": 0,
        "timestamp": "2025-08-12T20:43:20.000Z",
        "token_id": "",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transaction_type": "CREATE_ACCOUNT",
        "balance": 0,
        "onhold_balance": 0
    }
]
getAccountTransactionHistoryWithFilters
이 메소드는 지정된 계정에 대한 트랜잭션 기록 세부정보의 배열을 반환합니다. 이 방법은 원격 Oracle Blockchain Platform 네트워크에 연결된 경우에만 호출할 수 있습니다.
Ctx.Account.getAccountTransactionHistoryWithFilters(account_id: string, org_id: string, filters);
매개변수:
  • account_id: string – 계정의 ID입니다.
  • org_id: string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
  • filters: string – 선택적 매개변수입니다. 비어 있으면 모든 레코드가 반환됩니다. PageSize 속성은 반환할 레코드 수를 결정합니다. PageSize가 0이면 기본 페이지 크기는 20입니다. Bookmark 속성은 반환할 레코드의 시작 인덱스를 결정합니다. 자세한 내용은 Hyperledger Fabric 설명서를 참고하세요. StartTimeEndTime 등록 정보는 RFC-3339 형식으로 지정해야 합니다.
반환 값 예제:
[
           {
               "transaction_id": "otransaction~ccc2c2e89ab7887af4fdad3dc9918ea057a8aa834a0ed8d0f23271049f084952",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:22:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 18,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
               "transacted_amount": 22,
               "timestamp": "2025-08-20T23:21:45.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "to_account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
               "to_org_id": "Org1",
               "to_user_id": "cb1",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "from_org_id": "Org1",
               "from_user_id": "cb",
               "from_custom_account_id": "1234567jh",
               "transacted_account": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
               "transaction_type": "DEBIT",
               "balance": 8,
               "onhold_balance": 0,
               "transacted_org_id": "Org1",
               "transacted_user_id": "cb1",
               "transacted_custom_account_id": "1234567jh"
           },
           {
               "transaction_id": "otransaction~3212811cd7c0ff265434f5921b93621cc5b0e0450b07c52b42ad9d8ce73cf063",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:18:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 30,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~af2a1b0d56778e4ff5f4dda4e81bbcbf02c0592416ee2f105ff0b764e515fd0a",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:17:29.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 20,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~6c0452a58f13db93f1c308d60eab1fde6c911921b350c0bbbe0ce7dab394721d",
               "transacted_amount": 10,
               "timestamp": "2025-08-20T23:04:53.000Z",
               "token_id": "token",
               "category": "category value",
               "description": "description value",
               "holding_id": "ohold~cbdc~token~hold1",
               "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "to_org_id": "Org1",
               "to_user_id": "cb",
               "to_custom_account_id": "1234567jh",
               "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "from_org_id": "CentralBank",
               "from_user_id": "Not Available",
               "from_custom_account_id": "Not Available",
               "transacted_account": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
               "transaction_type": "CREDIT",
               "balance": 10,
               "onhold_balance": 0,
               "transacted_org_id": "CentralBank",
               "transacted_user_id": "Not Available",
               "transacted_custom_account_id": "Not Available"
           },
           {
               "transaction_id": "otransaction~df98e24a3b90661b54b54289b600b13a1051c922db0a4d20e3705a9820ae9c20",
               "transacted_amount": 0,
               "timestamp": "2025-08-20T22:55:09.000Z",
               "category": "",
               "description": "",
               "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "from_org_id": "Org1",
               "from_user_id": "cb",
               "from_custom_account_id": "1234567jh",
               "transacted_account": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
               "transaction_type": "CREATE_ACCOUNT",
               "balance": 0,
               "onhold_balance": 0,
               "transacted_org_id": "Org1",
               "transacted_user_id": "cb",
               "transacted_custom_account_id": "1234567jh"
           }
       ]
getAccountTrxHistoryWithFiltersFromRichHistDB
이 메소드는 풍부한 기록 데이터베이스의 트랜잭션 기록 세부 정보 배열을 반환합니다.
Ctx.Account.getAccountTrxHistoryWithFiltersFromRichHistDB(account_id: string, org_id: string, custom_endpoint: string, bearer_token: string, filters);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
  • org_id: string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
  • custom_endpoint – 풍부한 내역 데이터베이스의 RESTful 서비스 끝점입니다.
  • bearer_token – RESTful 서비스 끝점에 대한 액세스 권한 부여 토큰입니다.
  • filters: string – 선택적 매개변수입니다. 비어 있으면 모든 레코드가 반환됩니다. PageSize 속성은 반환할 레코드 수를 결정합니다. PageSize가 0이면 기본 페이지 크기는 20입니다. Bookmark 속성은 반환할 레코드의 시작 인덱스를 결정합니다. 자세한 내용은 Hyperledger Fabric 설명서를 참조하십시오. StartTimeEndTime 등록 정보는 RFC-3339 형식으로 지정해야 합니다.
반환 값 예제:
[
    {
        "transaction_id": "otransaction~3140569a4ecb3c3f141cc2468fe21276640b7fd79013d951d9104b79072d8f9c",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:16:55.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "transfer",
        "balance": 26800,
        "onhold_balance": 300
    },
    {
        "transaction_id": "otransaction~2b75b3e8531a651f07c2d048d8546ad70ac49c66f0b82ed7626c1739090842ce",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:16:06.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~e26f11da",
        "category": "transfer",
        "balance": 26800,
        "onhold_balance": 500
    },
    {
        "transaction_id": "otransaction~9e7bf14cf96c5f90170da9455b1318687785e936192f60b7cbeb1c8bfabc41d2",
        "transacted_amount": 100,
        "timestamp": "2025-08-21T06:57:19.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 26900,
        "onhold_balance": 400
    },
    {
        "transaction_id": "otransaction~b3901b4754920a9c75e36069dc55024ad505e4c127f334eedf65ef6703dc6b86",
        "transacted_amount": 200,
        "timestamp": "2025-08-21T05:39:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~77b75873",
        "category": "issuance",
        "balance": 26800,
        "onhold_balance": 400
    },
    {
        "transaction_id": "otransaction~d55c9dfc9feacb353544b5d8b2ae694162ade3890bcaaf715503fd1d6a73cd1a",
        "transacted_amount": 200,
        "timestamp": "2025-08-21T05:39:01.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~81d7c4ac",
        "category": "transfer",
        "balance": 27000,
        "onhold_balance": 200
    },
    {
        "transaction_id": "otransaction~751eaedbe4311edd5d17cae53d283caf397d0cb09f18d57a5e3fe61266875ff9",
        "transacted_amount": 200,
        "timestamp": "2025-08-13T09:59:22.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "transacted_org_id": "org2",
        "transacted_user_id": "fi2_org_officer_demo",
        "transacted_custom_account_id": "30300617202404",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "from_org_id": "org2",
        "from_user_id": "fi2_org_officer_demo",
        "from_custom_account_id": "30300617202404",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 27200,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~70155a8f4e388cc9395dbd03bedaf5a878705f5ad02302c8e9163218a5c3875a",
        "transacted_amount": 1000,
        "timestamp": "2025-08-13T06:22:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 27000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~e595f3f0cc03fa5f58a546b8abbfaf155592e492f850581db2b8fed9a529c9e2",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:09:25.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "transacted_org_id": "org2",
        "transacted_user_id": "fi2_org_officer_demo",
        "transacted_custom_account_id": "30300617202404",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "issuance",
        "balance": 26000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~da92402859d87ae3069722d8e39cb0da448e9a5f67468233ee9b1fe7a4ebeef8",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:09:17.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "EXECUTEHOLD",
        "category": "issuance",
        "balance": 26000,
        "onhold_balance": 10000
    },
    {
        "transaction_id": "otransaction~6915145aaf09fbf4d96456febddc2aa87b48c08ddd8ff17a6bab5d310f67bb36",
        "transacted_amount": 1000,
        "timestamp": "2025-08-12T21:07:11.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 26000,
        "onhold_balance": 20000
    },
    {
        "transaction_id": "otransaction~244d7172d1dc90a142e1f22204c76614c7eea814b3d61f33016b786f1b347784",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:05:39.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~ed815e20",
        "category": "issuance",
        "balance": 25000,
        "onhold_balance": 20000
    },
    {
        "transaction_id": "otransaction~c63ec37966264493bde6fa666527b9cca11695c15611c32e89af49a2246f13f6",
        "transacted_amount": 10000,
        "timestamp": "2025-08-12T21:05:20.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~12d87129",
        "category": "issuance",
        "balance": 35000,
        "onhold_balance": 10000
    },
    {
        "transaction_id": "otransaction~5112f576c94c2d23c342479bfa37e34612414b3258a64b43cf51b920f4ff5868",
        "transacted_amount": 5000,
        "timestamp": "2025-08-12T21:05:02.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "to_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_retirer_demo",
        "to_custom_account_id": "10109999006543",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "DEBIT",
        "category": "burn",
        "balance": 45000,
        "onhold_balance": 0
    },
    {
        "transaction_id": "otransaction~862aa9d9e877d3ea209b87299ab5b12c13ed5ce43d1cf1b934043c1dd02f58f6",
        "transacted_amount": 50000,
        "timestamp": "2025-08-12T21:04:22.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "CREDIT",
        "category": "transfer",
        "balance": 50000,
        "onhold_balance": 0
    }
]
getOrgAccountsTrxHistoryWithFiltersFromRichHistDB
이 메소드는 서식 있는 내역 데이터베이스에서 지정된 조직에 대한 트랜잭션 내역 세부정보의 배열을 반환합니다.
Ctx.Account.getOrgAccountsTrxHistoryWithFiltersFromRichHistDB(org_id: string, custom_endpoint: string, bearer_token: string, filters);
매개변수:
  • org_id string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
  • custom_endpoint – 풍부한 내역 데이터베이스의 RESTful 서비스 끝점입니다.
  • bearer_token – RESTful 서비스 끝점에 대한 액세스 권한 부여 토큰입니다.
  • filters: string – 선택적 매개변수입니다. 비어 있으면 모든 레코드가 반환됩니다. PageSize 속성은 반환할 레코드 수를 결정합니다. PageSize가 0이면 기본 페이지 크기는 20입니다. Bookmark 속성은 반환할 레코드의 시작 인덱스를 결정합니다. 자세한 내용은 Hyperledger Fabric 설명서를 참고하세요. StartTimeEndTime 등록 정보는 RFC-3339 형식으로 지정해야 합니다.
반환 값 예제:
[
    {
        "transaction_id": "otransaction~4793f3907eefce2f9fca7ef107405b0f116efb3afbf83fa0e61fe763690c8235",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:47:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~2ac01689",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user1_demo",
        "transacted_custom_account_id": "20200198765432",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "CREDIT",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user2_demo",
        "transacted_custom_account_id": "20200211112222",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "EXECUTEHOLD",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~32137cd7e16c560f4d96d0f8999f6a267c1e95be2f5b11ef0541e574a6cd7275",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:16:55.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "to_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_officer_demo",
        "to_custom_account_id": "20200222221111",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "transaction_type": "CREDIT",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~67844e07c06ab4c3d94d8ff36173b9dbcc2f1b9c99f4e7070f1097fd89f3f514",
        "transacted_amount": 10,
        "timestamp": "2025-08-21T08:49:40.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user1_demo",
        "transacted_custom_account_id": "20200198765432",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~b6e4925b",
        "category": "transfer"
    },
    {
        "transaction_id": "otransaction~b7c97d737fb978651c9132276ab677c0bcf795b9db13d0d39cba5243615c7389",
        "transacted_amount": 10,
        "timestamp": "2025-08-21T08:46:09.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user1_demo",
        "to_custom_account_id": "20200198765432",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~4fbbb846",
        "category": "transfer"
    }
]
getAllAccountsTrxHistoryWithFiltersFromRichHistDB
이 메소드는 풍부한 기록 데이터베이스의 모든 조직에 대한 트랜잭션 기록 세부정보의 배열을 반환합니다.
Ctx.Account.getAllAccountsTrxHistoryWithFiltersFromRichHistDB(custom_endpoint: string, bearer_token: string, filters);
매개변수:
  • org_id string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
  • custom_endpoint – 풍부한 내역 데이터베이스의 RESTful 서비스 끝점입니다.
  • bearer_token – RESTful 서비스 끝점에 대한 액세스 권한 부여 토큰입니다.
  • filters: string – 선택적 매개변수입니다. 비어 있으면 모든 레코드가 반환됩니다. PageSize 속성은 반환할 레코드 수를 결정합니다. PageSize가 0이면 기본 페이지 크기는 20입니다. Bookmark 속성은 반환할 레코드의 시작 인덱스를 결정합니다. 자세한 내용은 Hyperledger Fabric 설명서를 참고하세요. StartTimeEndTime 등록 정보는 RFC-3339 형식으로 지정해야 합니다.
반환 값 예제:
[
    {
        "transaction_id": "otransaction~62eb436be7c29fc2ed9cae221e874d9a31b163fa10374e7da09bf5e09a96c3ff",
        "transacted_amount": 10000,
        "timestamp": "2025-08-25T13:57:58.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "DEBIT",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~62eb436be7c29fc2ed9cae221e874d9a31b163fa10374e7da09bf5e09a96c3ff",
        "transacted_amount": 10000,
        "timestamp": "2025-08-25T13:57:58.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "from_org_id": "CentralBank",
        "from_user_id": "cb__creator_demo",
        "from_custom_account_id": "10105678004567",
        "transaction_type": "CREDIT",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~c628fb7738222ed969295ccc8d21b4be95d96e3aada4f14570f7820a7051b5f7",
        "transacted_amount": 200,
        "timestamp": "2025-08-25T13:51:18.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_issuer_demo",
        "transacted_custom_account_id": "10109999001234",
        "to_account": "oaccount~3954f54a8bc7acdd0c3d0960104240f60d56c26c8a179430267359cd80ce3709",
        "to_org_id": "org2",
        "to_user_id": "fi2_org_officer_demo",
        "to_custom_account_id": "30300617202404",
        "from_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_issuer_demo",
        "from_custom_account_id": "10109999001234",
        "transaction_type": "RELEASEHOLD",
        "holding_id": "ohold~cbdc~USD~77b75873"
    },
    {
        "transaction_id": "otransaction~af2cc8e43ecb4c5520d90a8d7955b5a47623a29b13eef47e31c16eb48cc0adec",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:50:45.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb_retirer_demo",
        "transacted_custom_account_id": "10109999006543",
        "from_account": "oaccount~cea6080858337b1575d6a76ed0bd07a0eacd8871e3f2f7f793729a0e4b0e8e98",
        "from_org_id": "CentralBank",
        "from_user_id": "cb_retirer_demo",
        "from_custom_account_id": "10109999006543",
        "transaction_type": "REJECT_BURN",
        "holding_id": "ohold~cbdc~USD~8d34",
        "description": "Burn",
        "to_account": ""
    },
    {
        "transaction_id": "otransaction~182b99bb2ed753994a8c638ab9b08c3a4e73ac8159a3173a2a1f56b651d2eeac",
        "transacted_amount": 2000,
        "timestamp": "2025-08-25T13:50:19.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "transacted_org_id": "CentralBank",
        "transacted_user_id": "cb__creator_demo",
        "transacted_custom_account_id": "10105678004567",
        "to_account": "oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41",
        "to_org_id": "CentralBank",
        "to_user_id": "cb__creator_demo",
        "to_custom_account_id": "10105678004567",
        "transaction_type": "REJECT_MINT",
        "holding_id": "ohold~cbdc~USD~89ce",
        "description": "Minting 2000 tokens",
        "from_account": ""
    },
    {
        "transaction_id": "otransaction~4793f3907eefce2f9fca7ef107405b0f116efb3afbf83fa0e61fe763690c8235",
        "transacted_amount": 100,
        "timestamp": "2025-08-25T13:47:56.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_officer_demo",
        "transacted_custom_account_id": "20200222221111",
        "to_account": "oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a",
        "to_org_id": "CentralBank",
        "to_user_id": "cb_issuer_demo",
        "to_custom_account_id": "10109999001234",
        "from_account": "oaccount~76687c724ddbc2d6e6664d9618b2bf1c2a9fe10f84887462447e4caba6aaaff3",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_officer_demo",
        "from_custom_account_id": "20200222221111",
        "transaction_type": "ONHOLD",
        "holding_id": "ohold~cbdc~USD~2ac01689",
        "category": "issuance"
    },
    {
        "transaction_id": "otransaction~5177f7560d32838242a26ac74f2a90c6ff9b47aae0d0988f28d9b4cf7e27c097",
        "transacted_amount": 10,
        "timestamp": "2025-08-25T13:22:23.000Z",
        "token_id": "USD",
        "transacted_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "transacted_org_id": "Org1",
        "transacted_user_id": "fi1_org_user2_demo",
        "transacted_custom_account_id": "20200211112222",
        "to_account": "oaccount~d08ff55a040d5e5dcf406009bab1b3398e06c374356efb1bddbf2f17fc37f949",
        "to_org_id": "Org1",
        "to_user_id": "fi1_org_user2_demo",
        "to_custom_account_id": "20200211112222",
        "from_account": "oaccount~1e31495a0c149b08cb9d02bdcac5e83d88c0f1557d954dda12bb807d7f6fc111",
        "from_org_id": "Org1",
        "from_user_id": "fi1_org_user1_demo",
        "from_custom_account_id": "20200198765432",
        "transaction_type": "EXECUTEHOLD",
        "holding_id": "ohold~cbdc~USD~454f4bf6",
        "category": "transfer"
    }
]
getAccountBalance
이 방법은 지정된 계정에 대한 계정 잔액을 반환합니다.
Ctx.Account.getAccountBalance(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
    "msg": "Current Balance is: 100",
    "user_balance": 100
}
deleteTransactions
이 방법은 상태 데이터베이스에서 이전 트랜잭션을 삭제합니다.
Ctx.Transaction.deleteTransactions(time_to_expiration: Date);
매개변수:
  • time_to_expiration: Date – 트랜잭션 삭제 시기를 나타내는 시간 기록입니다. 지정된 시간보다 오래된 트랜잭션 자산이 삭제됩니다.
반환 값 예제:
{
    "msg": "Successfully deleted transaction older than date: Thu Aug 19 2025 11:19:36 GMT+0000 (Coordinated Universal Time).",
    "transactions": [
           "otransaction~ec3366dd48b4ce2838f820f2f138648e6e55a07226713e59b411ff31b0d21058"
     ]
}
getTransactionById
이 메소드는 Transaction 자산의 내역을 반환합니다.
Ctx.Transaction.getTransactionById(transaction_id: string);
매개변수:
  • transaction_id string – 거래 자산의 ID입니다.
반환 값 예제:
{
    "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
    "history": [
        {
            "trxId": "6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
            "timeStamp": "2025-08-20T23:21:45.000Z",
            "value": {
                "assetType": "otransaction",
                "transaction_id": "otransaction~6523597253e45b3c976aecdc54e2c6316d0a4f88ad5d7f3fff48c69213e4375a",
                "token_id": "token",
                "from_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
                "to_account_id": "oaccount~5e3b5a3306d7ca3f3e3fe7cc27b6ae547e94dba1c5af58a69a771d7a619b6a66",
                "transaction_type": "TRANSFER",
                "amount": 22,
                "timestamp": "2025-08-20T23:21:45.000Z",
                "number_of_sub_transactions": 0,
                "holding_id": "",
                "sub_transaction": "false",
                "category": "category value",
                "description": "description value"
            }
        }
    ],
    "sub_transactions": []
}
getAccountStatus
이 메소드는 토큰 계정의 현재 상태를 가져옵니다.
Ctx.AccountStatus.getAccountStatus(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
    "assetType": "oaccountStatus",
    "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
    "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
    "status": "active"
}
history (Account Status)
이 방법은 계정 상태의 기록을 가져옵니다.
Ctx.AccountStatus.history(status_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
[
  {
    "trxId": "d5c6d6f601257ba9b6edaf5b7660f00adc13c37d5321b8f7d3a35afab2e93e63",
    "timeStamp": "2025-12-02T10:39:14.000Z",
    "value": {
      "assetType": "oaccountStatus",
      "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
      "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
      "status": "suspended"
    }
  },
  {
    "trxId": "e6c850cfa084dc20ad95fb2bb8165eef3a3bd62a0ac867cccee57c2003125183",
    "timeStamp": "2025-12-02T10:37:50.000Z",
    "value": {
      "assetType": "oaccountStatus",
      "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
      "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
      "status": "active"
    }
  }
]
activateAccount
이 메소드는 토큰 계정을 활성화합니다. 삭제된 계정은 활성화할 수 없습니다.
Ctx.Account.activateAccount(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
  "assetType": "oaccountStatus",
  "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
  "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
  "status": "active"
}
suspendAccount
이 메소드는 토큰 계정을 일시 중지합니다. 계정이 일시 중지된 후에는 계정을 업데이트하는 작업을 완료할 수 없습니다. 삭제된 계정은 일시 중지할 수 없습니다.
Ctx.Account.suspendAccount(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
    "assetType": "oaccountStatus",
    "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
    "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
    "status": "suspended"
}
deleteAccount
이 방법은 토큰 계정을 삭제합니다. 계정이 삭제된 후에는 계정을 업데이트하는 작업을 완료할 수 없습니다. 삭제된 계정이 최종 상태이므로 다른 상태로 변경할 수 없습니다. 계정을 삭제하려면 계정 잔액과 보류 잔액이 0이어야 합니다.
Ctx.Account.deleteAccount(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
  "assetType": "oaccountStatus",
  "status_id": "oaccountStatus~5a0b0d8b1c6433af9fedfe0d9e6580e7cf6b6bb62a0de6267aaf79f79d5e96d7",
  "account_id": "oaccount~1c568151c4acbcd1bd265c766c677145760a61c47fc8a3ba681a4cfbe287f9c1",
  "status": "deleted"
}
setMaxDailyAmount
이 메소드는 지정된 계정에 대한 max_daily_amount 값을 설정합니다.
Ctx.Account.setMaxDailyAmount(account_id: string, max_daily_amount?: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
  • max_daily_amount?: string – (옵션) 사용자가 매일 전송할 수 있는 최대 토큰 양입니다. 지정되지 않은 경우 사용자는 매일 모든 양의 토큰을 전송할 수 있습니다.
반환 값 예제:
{
           "msg": "Successfully set max daily amount for account id oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a to 1000000"
       }
setMaxDailyTransactionCount
이 메소드는 지정된 계정에 대한 max_daily_transactions 값을 설정합니다.
Ctx.Account.setMaxDailyTransactionCount(account_id: string, max_daily_transactions?: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
  • max_daily_transactions?: string – (옵션) 사용자가 매일 완료할 수 있는 최대 트랜잭션 수입니다. 지정되지 않은 경우 사용자는 매일 원하는 수의 트랜잭션을 완료할 수 있습니다.
반환 값 예제:
{
            "msg": "Successfully set max daily transactions for account id oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a to 100000"
        }
getMaxDailyAmount
이 방법은 지정된 계정에 대한 max_daily_amount 값(매일 이전할 수 있는 최대 금액)을 가져옵니다.
Ctx.Account.getMaxDailyAmount(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
           "max_daily_amount": "10000"
       }
getMaxDailyTransactionCount
이 메소드는 지정된 계정에 대한 max_daily_transactions 값(하루에 허용되는 최대 트랜잭션 수)을 가져옵니다.
Ctx.Account.getMaxDailyTransactionCount(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
           "max_daily_transactions": "100"
       }
consolidateRunningBalanceInTransactions
이 방법은 실행 중인 계정 잔액을 계산하여 거래 키/값 쌍에 업데이트된 값을 저장합니다. 일반적으로 시스템 관리자는 REST 프록시 스케줄러를 사용하여 이 메소드를 호출합니다.
Ctx.Transaction.consolidateRunningBalanceInTransactions(save: boolean);
반환 값 예제:
{ msg: "Successfully updated account running balance for pending transactions."}
processSendersAndReceivers
이 방법은 조직간 이전 중에 생성된 발신자 및 수신자 키/값 쌍에 분산된 토큰 계정 잔액을 계산 및 업데이트한 다음 더 이상 사용되지 않는 발신자 및 수신자 키/값 쌍을 삭제합니다. 일반적으로 시스템 관리자는 REST 프록시 스케줄러를 사용하여 이 메소드를 호출합니다.
Ctx.Account.processSendersAndReceivers(save: boolean);
반환 값 예제:
{ msg: "Successfully updated balance for accounts from pending receivers."}
addRoleMember
이 방법은 지정된 계정에 역할을 추가합니다.
Ctx.Token.addRoleMember(role: string, account_id: string, token_asset);
매개변수:
  • account_id: number – 역할을 추가할 계정 ID입니다.
  • role: string – 지정된 사용자에 추가할 역할의 이름입니다.
  • token_asset: any – 매개변수로 전달된 토큰 자산입니다. 토큰 자산의 속성은 모델 파일에 설명되어 있습니다.
반환 값 예제:
{
     "msg": "Successfully added role 'notary' to Account Id: oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8"
}
removeRoleMember
이 방법은 지정된 계정에서 역할을 제거합니다.
Ctx.Token.removeRoleMember(role: string, account_id: string, token_asset);
매개변수:
  • account_id: number – 역할을 제거할 계정 ID입니다.
  • role: string – 지정된 사용자로부터 제거할 역할의 이름입니다.
  • token_asset: any – 매개변수로 전달된 토큰 자산입니다. 토큰 자산의 속성은 모델 파일에 설명되어 있습니다.
반환 값 예제:
{
   "msg": "Successfully removed role 'notary' from Account Id: oaccount~2eb5f8a9bc561f8f41a4ea3be9511958cc6684ef14f2337ca396efc301b627d8"
}
getAccountsByRole
이 메소드는 지정된 롤과 토큰에 대한 모든 계정 목록을 반환합니다.
Ctx.Role.getAccountsByRole(token_id: string, role: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
  • role: string – 검색할 역할의 이름입니다.
반환 값 예제:
{
           "accounts": [
               "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75"
           ]
       }
getOrgAccountsByRole
이 방법은 지정된 조직에서 지정된 역할을 가진 모든 고객사에 대한 정보를 반환합니다.
Ctx.Role.getOrgAccountsByRole(token_id: string, role: string, org_id: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
  • role: string – 확인할 역할의 이름입니다.
  • org_id: string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
반환 값 예제:
{
           "accounts": [
               "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75"
           ]
       }
getUsersByRole
이 메소드는 지정된 롤 및 토큰에 대한 모든 사용자 목록을 반환합니다.
Ctx.Role.getUsersByRole(token_id: string, role: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
  • role: string – 검색할 역할의 이름입니다.
반환 값 예제:
{
          "users": [
              {
                  "token_id": "token",
                  "org_id": "CentralBank"
              }
          ]
      }
getOrgUsersByRole
이 메소드는 지정된 조직에서 지정된 롤을 가진 모든 사용자에 대한 정보를 반환합니다.
 Ctx.Role.getOrgUsersByRole(token_id: string, role: string, org_id: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
  • role: string – 확인할 역할의 이름입니다.
  • org_id: string – 조직의 멤버쉽 서비스 제공자(MSP) ID입니다.
반환 값 예제:
{
           "users": [
               {
                   "token_id": "token",
                   "org_id": "CentralBank",
                   "user_id": "cb1",
                   "custom_account_id": "1234567jh"
               }
           ]
       }
isInRole
이 메소드는 사용자에게 지정된 롤이 있는지 여부를 나타냅니다.
Ctx.Token.isInRole(role: string, account_id: string, token_asset)
매개변수:
  • account_id: number – 토큰 계정의 고유 ID입니다.
  • role: string – 확인할 역할의 이름입니다.
  • token_asset: any – 매개변수로 전달된 토큰 자산입니다. 토큰 자산의 속성은 모델 파일에 설명되어 있습니다.
반환 값 예제:
{
           "result": "true"
       }
getTotalMintedTokens
이 메소드는 주조된 총 토큰 수를 반환합니다.
Ctx.Token.getTotalMintedTokens(token_asset);
매개변수:
  • token_asset: any – 매개변수로 전달된 토큰 자산입니다. 토큰 자산의 속성은 모델 파일에 설명되어 있습니다.
반환 값 예제:
{
    "msg": "Total minted token for Token Id: USD is 910 tokens.",
    "quantity": 910
}
getNetTokens
이 방법은 시스템에서 사용할 수 있는 토큰의 순 수량을 반환합니다. 순 토큰은 토큰이 레코딩된 후 남은 토큰의 양입니다. 방정식 형식: net tokens = total minted tokens - total burned tokens. 토큰이 레코딩되지 않으면 순 토큰 수가 민트된 총 토큰 수와 같습니다.
Ctx.Token.getNetTokens(token_asset);
매개변수:
  • token_asset: any – 매개변수로 전달된 토큰 자산입니다. 토큰 자산의 속성은 모델 파일에 설명되어 있습니다.
반환 값 예제:
{
    "msg": "Net supply of token for Token Id: USD is 878 tokens.",
    "quantity": 878
}
hold
이 방법은 Minter가 지정된 양의 토큰을 만들기 위해 Minter 공증인에게 요청을 보내는 데 사용됩니다. 지정된 공증 계정은 보류를 완료하거나 해제할 책임이 있습니다.
Ctx.Hold.hold(operation_id: string, to_account_id: string, notary_account_id: string, quantity: number, time_to_expiration: Date, token, type: HoldOperationType, info_details?: InfoDetails)
매개변수:
  • operation_id: string – 보류 작업을 식별하는 고유 ID입니다. 일반적으로 이 ID는 클라이언트 응용 프로그램에서 전달합니다.
  • to_account_id: string – 수신자 계정의 ID입니다.
  • notary__account_id: string – 공증 계정의 ID입니다.
  • quantity: number – 보류할 총 토큰 수입니다.
  • time_to_expiration: Date – 보류가 만료될 때까지의 기간입니다. 영구 보류의 경우 0을 지정합니다. 그렇지 않으면 RFC-3339 형식을 사용합니다. 예를 들면 다음과 같습니다. 2021-06-02T12
  • token: any – 매개변수로 전달된 토큰 자산입니다. 토큰 자산의 속성은 모델 파일에 설명되어 있습니다.
  • type: HoldOperationType – 요청할 보류 작업의 유형입니다. 세 가지 가능한 값인 MINT, BURN 또는 TRANSFER 중 하나여야 합니다.
  • info_details: JSON – 요청의 범주(category) 및 설명(description)을 지정하는 객체입니다.

    Visual Studio Code와 CLI 또는 Postman 컬렉션을 사용하는 경우 info_details 매개변수를 다른 형식으로 지정합니다.

    Visual Studio 코드: { "category": "category value", "description": "description value" }

    CLI/Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

반환 값 예제:
{
           "msg": "AccountId oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41 has successfully submitted request to mint 200 tokens"
       }
executeHold
Notaries는 이 메소드를 호출하여 보류 작업을 승인할 수 있습니다. 보류 작업은 민트, 레코딩 또는 전송의 세 가지 유형 중 하나일 수 있습니다.
Ctx.Hold. executeHold(operation_id: string, token, operation_type: HoldOperationType, quantity? :number)
매개변수:
  • operation_type: HoldOperationType – 승인할 보류 작업의 유형입니다. 세 가지 가능한 값인 MINT, BURN 또는 TRANSFER 중 하나여야 합니다.
  • quantity: number – (옵션) 전송 작업의 경우에만 수신자에게 전송하도록 승인된 금액입니다.
  • token: any – 매개변수로 전달된 토큰 자산입니다. 토큰 자산의 속성은 모델 파일에 설명되어 있습니다.
  • operation_id: string – 요청의 고유 ID입니다.
반환 값 예제:
{
           "msg": "Successfully minted 1000 tokens to Account Id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41"
       }
releaseHold
Notaries는 이 메소드를 호출하여 민트, 레코딩 또는 전송의 세 가지 유형 중 하나일 수 있는 보류 작업을 거부할 수 있습니다.
Ctx.Hold.releaseHold(operation_id: string, token, operation_type: HoldOperationType)
매개변수:
  • operation_type: HoldOperationType – 거부할 보류 작업의 유형입니다. 세 가지 가능한 값인 MINT, BURN 또는 TRANSFER 중 하나여야 합니다.
  • token: any – 매개변수로 전달된 토큰 자산입니다. 토큰 자산의 속성은 모델 파일에 설명되어 있습니다.
  • operation_id: string – 요청의 고유 ID입니다.
반환 값 예제:
{
           "msg": "Successfully rejected mint request with Operation Id '89ce' to mint 2000 tokens of token id USD"
       }
issueTokens
Minters는 이 메소드를 호출하여 지정된 양의 토큰을 생성할 수 있습니다.
this.Ctx.Token.mint(quantity, token_asset, info_details)
매개변수:
  • token_id: string – 토큰 ID입니다.
  • quantity – 민트할 토큰 수입니다.
  • info_details: JSON – 요청의 범주(category) 및 설명(description)을 지정하는 객체입니다.

    Visual Studio Code와 CLI 또는 Postman 컬렉션을 사용하는 경우 info_details 매개변수를 다른 형식으로 지정합니다.

    Visual Studio 코드: { "category": "category value", "description": "description value" }

    CLI/Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

반환 값 예제:
{
          "msg": "Successfully minted 1000 tokens to Account Id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41"
      }
transferTokens
이 방법은 호출자의 토큰을 지정된 계정으로 전송합니다. 메소드 호출자는 계정을 가져야 합니다. 수량은 사양 파일에서 divisible 동작의 decimal 매개변수에 의해 지정된 십진수 값 내에 있어야 합니다.
this.Ctx.Token.transfer(to_account_id: string, quantity, token_asset, info_details);
매개변수:
  • to_account_id: string – 수신자(수취인)의 계정 ID입니다.
  • quantity: number – 전송할 토큰 수입니다.
  • info_details: JSON – 요청의 범주(category) 및 설명(description)을 지정하는 객체입니다.

    Visual Studio Code와 CLI 또는 Postman 컬렉션을 사용하는 경우 info_details 매개변수를 다른 형식으로 지정합니다.

    Visual Studio 코드: { "category": "category value", "description": "description value" }

    CLI/Postman: "{\"category\":\"category value\",\"description\":\"description value\"}"

반환 값 예제:
{
          "msg": "Successfully transferred 10000 tokens from account id: oaccount~da6e14466a0ba9b48ebc18fa672addb92dffc371bf953c3229a95b2ff2d9cd41  to account id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a."
      }
getAccountOnHoldBalance
이 방법은 지정된 계정에 대한 보류 잔액을 반환합니다.
Ctx.Account.getAccountOnHoldBalance(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
           "msg": "Total Holding Balance is: 0",
           "holding_balance": 0
       }
getOnHoldDetailsWithOperationId
이 메소드는 지정된 작업 ID 및 토큰에 대해 보류 중인 트랜잭션 세부정보를 반환합니다.
Ctx.Hold.getOnHoldDetailsWithOperationId(token_id: string, operation_id: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
  • operation_id: string – 보류 작업을 식별하는 고유 ID입니다.
반환 값 예제:
{
          "assetType": "ohold",
          "holding_id": "ohold~cbdc~token~hold1",
          "operation_id": "hold1",
          "token_name": "cbdc",
          "from_org_id": "CentralBank",
          "operation_type": "transfer",
          "status": "approved",
          "from_account_id": "oaccount~5abb4155f4b245bb1732321e3174ac81999b03495b5c74f8e1f270bafbadef75",
          "to_account_id": "oaccount~22776ada3efff6aaf4c68c204c1f063b139adfa1bca79ed53199117c34036cfc",
          "notary_account_id": "oaccount~1da238c1491c919b151f777a615fb5779032c34b3ef3adeca6afe591bac10aaf",
          "token_id": "token",
          "quantity": "0",
          "time_to_expiration": "2029-01-04T00:00:00.000Z",
          "category": "category value",
          "description": "description value"
      }
getOnHoldIds
이 메소드는 지정된 계정에 대한 모든 보유 ID 목록을 반환합니다.
Ctx.Account.getOnHoldIds(account_id: string);
매개변수:
  • account_id: string – 토큰 계정의 고유 ID입니다.
반환 값 예제:
{
           "msg": "Holding Ids are: ",
           "holding_ids": ["ohold~cbdc~token~hold1"]
       }
getOnHoldBalanceWithOperationId
이 메소드는 지정된 작업 ID 및 토큰에 대해 보류 중인 잔액을 반환합니다. 이 메소드는 누구나 호출할 수 있습니다.
Ctx.Hold.getOnHoldBalanceWithOperationId(token_id: string, operation_id: string);
매개변수:
  • token_id: string – 토큰 ID입니다.
  • operation_id: string – 보류 작업을 식별하는 고유 ID입니다.
반환 값 예제:
{
           "msg": "Current Holding Balance of Operation 'hold1' for token 'token' is: 0",
           "holding_balance": 0
       }

TypeScript 조직 간 이전을 위한 SDK 방법

조직간 이전에는 두 부분이 있습니다. 먼저 송신자로부터 금액을 차변 기입한 다음 수령인에게 금액을 대변 기입합니다. 다음 두 API는 Oracle Blockchain Platform REST 프록시의 2단계 커밋 API를 사용하여 기본 트랜잭션으로 함께 호출됩니다. 기밀 전송은 두 조직의 개인 데이터 수집이 서로 다르며 단일 트랜잭션에서 액세스할 수 없기 때문에 이러한 방식으로 수행됩니다.

executeHoldTokensSender
이 메소드는 지정된 작업 ID에 대해 공증인 롤을 가진 사용자만 호출할 수 있습니다. 이 방법은 조직 간 이전 승인의 첫 번째 부분입니다. 지정된 금액은 발신자의 계정에서 공제됩니다.
Ctx.Hold.executeHoldSender(operation_id: string, quantity, globalTxId: string, token: any);
매개변수:
  • token: any – 매개변수로 전달된 토큰 자산입니다. 토큰 자산의 속성은 모델 파일에 설명되어 있습니다.
  • operation_id: string – 승인할 보류 요청을 나타내는 고유한 작업 ID입니다.
  • quantity: number – 전송할 보유 토큰의 양입니다.
  • globalTxid: string – 2단계 커밋 요청에 대해 REST 프록시가 생성한 전역 트랜잭션 ID로, 이 경우 조직간 이전에서 차변 및 대변 작업을 바인딩하는 공통 참조로 사용됩니다.
반환 값 예제:
{
      "msg":
        "Account Id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a is successfully executed '10' tokens from Operation Id 'hold1'."
    }
executeHoldTokensReceiver
이 메소드는 지정된 작업 ID에 대해 공증인 롤을 가진 사용자만 호출할 수 있습니다. 이 방법은 조직 간 이전 승인의 두 번째 부분입니다. 지정된 금액이 수령인 계정에 대변 기입됩니다.
Ctx.Hold.executeHoldReceiver(operation_id: string, quantity, globalTxId: string, token: any);
매개변수:
  • token: any – 매개변수로 전달된 토큰 자산입니다. 토큰 자산의 속성은 모델 파일에 설명되어 있습니다.
  • operation_id: string – 승인할 보류 요청을 나타내는 고유한 작업 ID입니다.
  • quantity: number – 전송할 보유 토큰의 양입니다.
  • globalTxid: string – 2단계 커밋 요청에 대해 REST 프록시가 생성한 전역 트랜잭션 ID로, 이 경우 조직간 이전에서 차변 및 대변 작업을 바인딩하는 공통 참조로 사용됩니다.
반환 값 예제:
{
      "msg":
        "Account Id: oaccount~68d67712f500e9dac8c314c19744003a993250271d960e9b0d25267bb18dfe9a is successfully executed '10' tokens from Operation Id 'hold1, receiverId oreceiver~72d9bfcf-2c68-4c33-b8c3-fe3374983bf2'."
    }