From de81da3df74ca358114a0c405c025088e135fb4c Mon Sep 17 00:00:00 2001 From: F-OBrien Date: Sat, 14 Sep 2024 12:13:03 +0100 Subject: [PATCH 1/2] =?UTF-8?q?fix:=20=F0=9F=90=9B=20re-add=20runtime=20ap?= =?UTF-8?q?i=20versions=20required=20for=206.x.=20chains?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/runtime/6.x.ts | 328 ------------------------------------------- src/runtime/index.ts | 237 ++++++++++++++++++++++++++++++- 2 files changed, 236 insertions(+), 329 deletions(-) delete mode 100644 src/runtime/6.x.ts diff --git a/src/runtime/6.x.ts b/src/runtime/6.x.ts deleted file mode 100644 index 67ab9ba..0000000 --- a/src/runtime/6.x.ts +++ /dev/null @@ -1,328 +0,0 @@ -export default { - AssetApi: [ - { - methods: { - can_transfer_granular: { - description: - 'Checks whether a transaction with given parameters can take place or not. The result is granular meaning each check is run and returned regardless of outcome.', - params: [ - { - name: 'from_custodian', - type: 'Option', - }, - { - name: 'from_portfolio', - type: 'PortfolioId', - }, - { - name: 'to_custodian', - type: 'Option', - }, - { - name: 'to_portfolio', - type: 'PortfolioId', - }, - { - name: 'ticker', - type: 'Ticker', - }, - { - name: 'value', - type: 'Balance', - }, - ], - type: 'CanTransferGranularReturn', - }, - }, - version: 3, - }, - ], - GroupApi: [ - { - methods: { - get_cdd_valid_members: { - description: 'Get the CDD members', - params: [], - type: 'Vec', - }, - get_gc_valid_members: { - description: 'Get the GC members', - params: [], - type: 'Vec', - }, - }, - version: 1, - }, - ], - IdentityApi: [ - { - methods: { - is_identity_has_valid_cdd: { - description: 'use to tell whether the given did has valid cdd claim or not', - params: [ - { - name: 'did', - type: 'IdentityId', - }, - { - name: 'buffer_time', - type: 'Option', - }, - ], - type: 'CddStatus', - }, - get_asset_did: { - description: 'function is used to query the given ticker DID', - params: [ - { - name: 'ticker', - type: 'Ticker', - }, - ], - type: 'AssetDidResult', - }, - get_did_records: { - description: 'Used to get the did record values for a given DID', - params: [ - { - name: 'did', - type: 'IdentityId', - }, - ], - type: 'RpcDidRecords', - }, - get_did_status: { - description: 'Retrieve status of the DID', - params: [ - { - name: 'did', - type: 'Vec', - }, - ], - type: 'Vec', - }, - get_filtered_authorizations: { - description: - 'Retrieve authorizations data for a given signatory and filtered using the given authorization type', - params: [ - { - name: 'signatory', - type: 'Signatory', - }, - { - name: 'allow_expired', - type: 'bool', - }, - { - name: 'auth_type', - type: 'Option', - }, - ], - type: 'Vec', - }, - get_key_identity_data: { - description: 'Query relation between a signing key and a DID', - params: [ - { - name: 'acc', - type: 'AccountId', - }, - ], - type: 'Option', - }, - valid_cdd_claims: { - description: - 'Returns all valid IdentityClaim of type CustomerDueDiligence for the given target_identity', - params: [ - { - name: 'target_identity', - type: 'IdentityId', - }, - { - name: 'cdd_checker_leeway', - type: 'Option', - }, - ], - type: 'Vec', - }, - }, - version: 3, - }, - ], - NFTApi: [ - { - methods: { - validate_nft_transfer: { - description: - 'Verifies if and the sender and receiver are not the same, if both have valid balances, if the sender owns the nft, and if all compliance rules are being respected.', - params: [ - { - name: 'sender_portfolio', - type: 'PortfolioId', - }, - { - name: 'receiver_portfolio', - type: 'PortfolioId', - }, - { - name: 'nfts', - type: 'NFTs', - }, - ], - type: 'DispatchResult', - }, - }, - version: 1, - }, - ], - SettlementApi: [ - { - methods: { - get_execute_instruction_info: { - description: - 'Returns an ExecuteInstructionInfo instance containing the consumed weight and the number of tokens in the instruction.', - params: [ - { - name: 'instruction_id', - type: 'InstructionId', - }, - ], - type: 'ExecuteInstructionInfo', - }, - get_affirmation_count: { - description: - 'Returns an AffirmationCount instance containing the number of assets being sent/received from portfolios, and the number of off-chain assets in the instruction.', - params: [ - { - name: 'instruction_id', - type: 'InstructionId', - }, - { - name: 'portfolios', - type: 'Vec', - }, - ], - type: 'AffirmationCount', - }, - get_transfer_report: { - description: - "Returns a vector containing all errors for the transfer. An empty vec means there's no error.", - params: [ - { - name: 'leg', - type: 'Leg', - }, - { - name: 'skip_locked_check', - type: 'bool', - }, - ], - type: 'Vec', - }, - get_execute_instruction_report: { - description: - "Returns a vector containing all errors for the execution. An empty vec means there's no error.", - params: [ - { - name: 'instruction_id', - type: 'InstructionId', - }, - ], - type: 'Vec', - }, - }, - version: 1, - }, - ], - PipsApi: [ - { - methods: { - get_votes: { - description: 'Summary of votes of a proposal given by index', - params: [ - { - name: 'index', - type: 'PipId', - }, - ], - type: 'VoteCount', - }, - proposed_by: { - description: 'Retrieves proposal indices started by address', - params: [ - { - name: 'address', - type: 'AccountId', - }, - ], - type: 'Vec', - }, - voted_on: { - description: 'Retrieves proposal address indices voted on', - params: [ - { - name: 'address', - type: 'AccountId', - }, - ], - type: 'Vec', - }, - }, - version: 1, - }, - ], - ProtocolFeeApi: [ - { - methods: { - compute_fee: { - description: 'Gets the fee of a chargeable extrinsic operation', - params: [ - { - name: 'op', - type: 'ProtocolOp', - }, - ], - type: 'CappedFee', - }, - }, - version: 1, - }, - ], - StakingApi: [ - { - methods: { - get_curve: { - description: 'Retrieves curves parameters', - params: [], - type: 'Vec<(Perbill, Perbill)>', - }, - }, - version: 1, - }, - ], - ComplianceApi: [ - { - methods: { - compliance_report: { - description: 'Checks all compliance requirements for the given ticker.', - params: [ - { - name: 'ticker', - type: 'Ticker', - }, - { - name: 'sender_identity', - type: 'IdentityId', - }, - { - name: 'receiver_identity', - type: 'IdentityId', - }, - ], - type: 'Result', - }, - }, - version: 1, - }, - ], -}; diff --git a/src/runtime/index.ts b/src/runtime/index.ts index bfce3e2..2e0a8f2 100644 --- a/src/runtime/index.ts +++ b/src/runtime/index.ts @@ -1,3 +1,5 @@ +import { DefinitionsCall } from '@polkadot/types/types'; + export default { AssetApi: [ { @@ -32,6 +34,42 @@ export default { }, version: 4, }, + { + methods: { + can_transfer_granular: { + description: + 'Checks whether a transaction with given parameters can take place or not. The result is granular meaning each check is run and returned regardless of outcome.', + params: [ + { + name: 'from_custodian', + type: 'Option', + }, + { + name: 'from_portfolio', + type: 'PortfolioId', + }, + { + name: 'to_custodian', + type: 'Option', + }, + { + name: 'to_portfolio', + type: 'PortfolioId', + }, + { + name: 'ticker', + type: 'Ticker', + }, + { + name: 'value', + type: 'Balance', + }, + ], + type: 'CanTransferGranularReturn', + }, + }, + version: 3, + }, ], GroupApi: [ { @@ -134,6 +172,99 @@ export default { }, version: 4, }, + { + methods: { + is_identity_has_valid_cdd: { + description: 'use to tell whether the given did has valid cdd claim or not', + params: [ + { + name: 'did', + type: 'IdentityId', + }, + { + name: 'buffer_time', + type: 'Option', + }, + ], + type: 'CddStatus', + }, + get_asset_did: { + description: 'function is used to query the given ticker DID', + params: [ + { + name: 'ticker', + type: 'Ticker', + }, + ], + type: 'AssetDidResult', + }, + get_did_records: { + description: 'Used to get the did record values for a given DID', + params: [ + { + name: 'did', + type: 'IdentityId', + }, + ], + type: 'RpcDidRecords', + }, + get_did_status: { + description: 'Retrieve status of the DID', + params: [ + { + name: 'did', + type: 'Vec', + }, + ], + type: 'Vec', + }, + get_filtered_authorizations: { + description: + 'Retrieve authorizations data for a given signatory and filtered using the given authorization type', + params: [ + { + name: 'signatory', + type: 'Signatory', + }, + { + name: 'allow_expired', + type: 'bool', + }, + { + name: 'auth_type', + type: 'Option', + }, + ], + type: 'Vec', + }, + get_key_identity_data: { + description: 'Query relation between a signing key and a DID', + params: [ + { + name: 'acc', + type: 'AccountId', + }, + ], + type: 'Option', + }, + valid_cdd_claims: { + description: + 'Returns all valid IdentityClaim of type CustomerDueDiligence for the given target_identity', + params: [ + { + name: 'target_identity', + type: 'IdentityId', + }, + { + name: 'cdd_checker_leeway', + type: 'Option', + }, + ], + type: 'Vec', + }, + }, + version: 3, + }, ], NFTApi: [ { @@ -164,6 +295,30 @@ export default { }, version: 2, }, + { + methods: { + validate_nft_transfer: { + description: + 'Verifies if and the sender and receiver are not the same, if both have valid balances, if the sender owns the nft, and if all compliance rules are being respected.', + params: [ + { + name: 'sender_portfolio', + type: 'PortfolioId', + }, + { + name: 'receiver_portfolio', + type: 'PortfolioId', + }, + { + name: 'nfts', + type: 'NFTs', + }, + ], + type: 'DispatchResult', + }, + }, + version: 1, + }, ], SettlementApi: [ { @@ -223,6 +378,63 @@ export default { }, version: 2, }, + { + methods: { + get_execute_instruction_info: { + description: + 'Returns an ExecuteInstructionInfo instance containing the consumed weight and the number of tokens in the instruction.', + params: [ + { + name: 'instruction_id', + type: 'InstructionId', + }, + ], + type: 'ExecuteInstructionInfo', + }, + get_affirmation_count: { + description: + 'Returns an AffirmationCount instance containing the number of assets being sent/received from portfolios, and the number of off-chain assets in the instruction.', + params: [ + { + name: 'instruction_id', + type: 'InstructionId', + }, + { + name: 'portfolios', + type: 'Vec', + }, + ], + type: 'AffirmationCount', + }, + get_transfer_report: { + description: + "Returns a vector containing all errors for the transfer. An empty vec means there's no error.", + params: [ + { + name: 'leg', + type: 'Leg', + }, + { + name: 'skip_locked_check', + type: 'bool', + }, + ], + type: 'Vec', + }, + get_execute_instruction_report: { + description: + "Returns a vector containing all errors for the execution. An empty vec means there's no error.", + params: [ + { + name: 'instruction_id', + type: 'InstructionId', + }, + ], + type: 'Vec', + }, + }, + version: 1, + }, ], PipsApi: [ { @@ -314,5 +526,28 @@ export default { }, version: 2, }, + { + methods: { + compliance_report: { + description: 'Checks all compliance requirements for the given ticker.', + params: [ + { + name: 'ticker', + type: 'Ticker', + }, + { + name: 'sender_identity', + type: 'IdentityId', + }, + { + name: 'receiver_identity', + type: 'IdentityId', + }, + ], + type: 'Result', + }, + }, + version: 1, + }, ], -}; +} as DefinitionsCall; From b39af04ad679d3cc58620f2c9d4c6d8961a416b0 Mon Sep 17 00:00:00 2001 From: Eric Richardson Date: Sat, 14 Sep 2024 07:40:18 -0400 Subject: [PATCH 2/2] =?UTF-8?q?chore:=20=F0=9F=A4=96=20fix=20authenticate?= =?UTF-8?q?=20commit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/authenticate-commits.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/authenticate-commits.yml b/.github/workflows/authenticate-commits.yml index d068799..58b32d8 100644 --- a/.github/workflows/authenticate-commits.yml +++ b/.github/workflows/authenticate-commits.yml @@ -16,7 +16,7 @@ jobs: ALLOWED_SIGNERS: ${{ vars.MIDDLEWARE_ALLOWED_SIGNERS }} run: | mkdir -p ~/.ssh - echo $ALLOWED_SIGNERS > ~/.ssh/allowed_signers + echo "$ALLOWED_SIGNERS" > ~/.ssh/allowed_signers git config --global gpg.ssh.allowedSignersFile "~/.ssh/allowed_signers" - name: Validate commit signatures