xrpjson 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +183 -0
- package/dist/errors.d.ts +20 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +27 -0
- package/dist/errors.js.map +1 -0
- package/dist/fp/factories/account-delete.d.ts +33 -0
- package/dist/fp/factories/account-delete.d.ts.map +1 -0
- package/dist/fp/factories/account-delete.js +138 -0
- package/dist/fp/factories/account-delete.js.map +1 -0
- package/dist/fp/factories/account-set.d.ts +31 -0
- package/dist/fp/factories/account-set.d.ts.map +1 -0
- package/dist/fp/factories/account-set.js +44 -0
- package/dist/fp/factories/account-set.js.map +1 -0
- package/dist/fp/factories/amm-bid.d.ts +134 -0
- package/dist/fp/factories/amm-bid.d.ts.map +1 -0
- package/dist/fp/factories/amm-bid.js +82 -0
- package/dist/fp/factories/amm-bid.js.map +1 -0
- package/dist/fp/factories/amm-clawback.d.ts +166 -0
- package/dist/fp/factories/amm-clawback.d.ts.map +1 -0
- package/dist/fp/factories/amm-clawback.js +143 -0
- package/dist/fp/factories/amm-clawback.js.map +1 -0
- package/dist/fp/factories/amm-create.d.ts +91 -0
- package/dist/fp/factories/amm-create.d.ts.map +1 -0
- package/dist/fp/factories/amm-create.js +140 -0
- package/dist/fp/factories/amm-create.js.map +1 -0
- package/dist/fp/factories/amm-delete.d.ts +84 -0
- package/dist/fp/factories/amm-delete.d.ts.map +1 -0
- package/dist/fp/factories/amm-delete.js +36 -0
- package/dist/fp/factories/amm-delete.js.map +1 -0
- package/dist/fp/factories/amm-deposit.d.ts +109 -0
- package/dist/fp/factories/amm-deposit.d.ts.map +1 -0
- package/dist/fp/factories/amm-deposit.js +68 -0
- package/dist/fp/factories/amm-deposit.js.map +1 -0
- package/dist/fp/factories/amm-vote.d.ts +87 -0
- package/dist/fp/factories/amm-vote.d.ts.map +1 -0
- package/dist/fp/factories/amm-vote.js +53 -0
- package/dist/fp/factories/amm-vote.js.map +1 -0
- package/dist/fp/factories/amm-withdraw.d.ts +131 -0
- package/dist/fp/factories/amm-withdraw.d.ts.map +1 -0
- package/dist/fp/factories/amm-withdraw.js +147 -0
- package/dist/fp/factories/amm-withdraw.js.map +1 -0
- package/dist/fp/factories/batch.d.ts +133 -0
- package/dist/fp/factories/batch.d.ts.map +1 -0
- package/dist/fp/factories/batch.js +264 -0
- package/dist/fp/factories/batch.js.map +1 -0
- package/dist/fp/factories/check-cancel.d.ts +22 -0
- package/dist/fp/factories/check-cancel.d.ts.map +1 -0
- package/dist/fp/factories/check-cancel.js +119 -0
- package/dist/fp/factories/check-cancel.js.map +1 -0
- package/dist/fp/factories/check-cash.d.ts +84 -0
- package/dist/fp/factories/check-cash.d.ts.map +1 -0
- package/dist/fp/factories/check-cash.js +95 -0
- package/dist/fp/factories/check-cash.js.map +1 -0
- package/dist/fp/factories/check-create.d.ts +82 -0
- package/dist/fp/factories/check-create.d.ts.map +1 -0
- package/dist/fp/factories/check-create.js +101 -0
- package/dist/fp/factories/check-create.js.map +1 -0
- package/dist/fp/factories/clawback.d.ts +160 -0
- package/dist/fp/factories/clawback.d.ts.map +1 -0
- package/dist/fp/factories/clawback.js +111 -0
- package/dist/fp/factories/clawback.js.map +1 -0
- package/dist/fp/factories/confidential-mpt-clawback.d.ts +24 -0
- package/dist/fp/factories/confidential-mpt-clawback.d.ts.map +1 -0
- package/dist/fp/factories/confidential-mpt-clawback.js +200 -0
- package/dist/fp/factories/confidential-mpt-clawback.js.map +1 -0
- package/dist/fp/factories/confidential-mpt-convert-back.d.ts +32 -0
- package/dist/fp/factories/confidential-mpt-convert-back.d.ts.map +1 -0
- package/dist/fp/factories/confidential-mpt-convert-back.js +203 -0
- package/dist/fp/factories/confidential-mpt-convert-back.js.map +1 -0
- package/dist/fp/factories/confidential-mpt-convert.d.ts +32 -0
- package/dist/fp/factories/confidential-mpt-convert.d.ts.map +1 -0
- package/dist/fp/factories/confidential-mpt-convert.js +209 -0
- package/dist/fp/factories/confidential-mpt-convert.js.map +1 -0
- package/dist/fp/factories/confidential-mpt-merge-inbox.d.ts +18 -0
- package/dist/fp/factories/confidential-mpt-merge-inbox.d.ts.map +1 -0
- package/dist/fp/factories/confidential-mpt-merge-inbox.js +130 -0
- package/dist/fp/factories/confidential-mpt-merge-inbox.js.map +1 -0
- package/dist/fp/factories/confidential-mpt-send.d.ts +38 -0
- package/dist/fp/factories/confidential-mpt-send.d.ts.map +1 -0
- package/dist/fp/factories/confidential-mpt-send.js +254 -0
- package/dist/fp/factories/confidential-mpt-send.js.map +1 -0
- package/dist/fp/factories/credential-accept.d.ts +23 -0
- package/dist/fp/factories/credential-accept.d.ts.map +1 -0
- package/dist/fp/factories/credential-accept.js +135 -0
- package/dist/fp/factories/credential-accept.js.map +1 -0
- package/dist/fp/factories/credential-create.d.ts +24 -0
- package/dist/fp/factories/credential-create.d.ts.map +1 -0
- package/dist/fp/factories/credential-create.js +204 -0
- package/dist/fp/factories/credential-create.js.map +1 -0
- package/dist/fp/factories/credential-delete.d.ts +33 -0
- package/dist/fp/factories/credential-delete.d.ts.map +1 -0
- package/dist/fp/factories/credential-delete.js +167 -0
- package/dist/fp/factories/credential-delete.js.map +1 -0
- package/dist/fp/factories/delegate-set.d.ts +52 -0
- package/dist/fp/factories/delegate-set.d.ts.map +1 -0
- package/dist/fp/factories/delegate-set.js +190 -0
- package/dist/fp/factories/delegate-set.js.map +1 -0
- package/dist/fp/factories/deposit-preauth.d.ts +183 -0
- package/dist/fp/factories/deposit-preauth.d.ts.map +1 -0
- package/dist/fp/factories/deposit-preauth.js +159 -0
- package/dist/fp/factories/deposit-preauth.js.map +1 -0
- package/dist/fp/factories/did-delete.d.ts +22 -0
- package/dist/fp/factories/did-delete.d.ts.map +1 -0
- package/dist/fp/factories/did-delete.js +126 -0
- package/dist/fp/factories/did-delete.js.map +1 -0
- package/dist/fp/factories/did-set.d.ts +68 -0
- package/dist/fp/factories/did-set.d.ts.map +1 -0
- package/dist/fp/factories/did-set.js +178 -0
- package/dist/fp/factories/did-set.js.map +1 -0
- package/dist/fp/factories/escrow-cancel.d.ts +28 -0
- package/dist/fp/factories/escrow-cancel.d.ts.map +1 -0
- package/dist/fp/factories/escrow-cancel.js +127 -0
- package/dist/fp/factories/escrow-cancel.js.map +1 -0
- package/dist/fp/factories/escrow-create.d.ts +103 -0
- package/dist/fp/factories/escrow-create.d.ts.map +1 -0
- package/dist/fp/factories/escrow-create.js +133 -0
- package/dist/fp/factories/escrow-create.js.map +1 -0
- package/dist/fp/factories/escrow-finish.d.ts +39 -0
- package/dist/fp/factories/escrow-finish.d.ts.map +1 -0
- package/dist/fp/factories/escrow-finish.js +173 -0
- package/dist/fp/factories/escrow-finish.js.map +1 -0
- package/dist/fp/factories/ledger-state-fix.d.ts +31 -0
- package/dist/fp/factories/ledger-state-fix.d.ts.map +1 -0
- package/dist/fp/factories/ledger-state-fix.js +163 -0
- package/dist/fp/factories/ledger-state-fix.js.map +1 -0
- package/dist/fp/factories/loan-broker-cover-clawback.d.ts +106 -0
- package/dist/fp/factories/loan-broker-cover-clawback.d.ts.map +1 -0
- package/dist/fp/factories/loan-broker-cover-clawback.js +122 -0
- package/dist/fp/factories/loan-broker-cover-clawback.js.map +1 -0
- package/dist/fp/factories/loan-broker-cover-deposit.d.ts +65 -0
- package/dist/fp/factories/loan-broker-cover-deposit.d.ts.map +1 -0
- package/dist/fp/factories/loan-broker-cover-deposit.js +81 -0
- package/dist/fp/factories/loan-broker-cover-deposit.js.map +1 -0
- package/dist/fp/factories/loan-broker-cover-withdraw.d.ts +96 -0
- package/dist/fp/factories/loan-broker-cover-withdraw.d.ts.map +1 -0
- package/dist/fp/factories/loan-broker-cover-withdraw.js +116 -0
- package/dist/fp/factories/loan-broker-cover-withdraw.js.map +1 -0
- package/dist/fp/factories/loan-broker-delete.d.ts +20 -0
- package/dist/fp/factories/loan-broker-delete.d.ts.map +1 -0
- package/dist/fp/factories/loan-broker-delete.js +94 -0
- package/dist/fp/factories/loan-broker-delete.js.map +1 -0
- package/dist/fp/factories/loan-broker-set.d.ts +108 -0
- package/dist/fp/factories/loan-broker-set.d.ts.map +1 -0
- package/dist/fp/factories/loan-broker-set.js +133 -0
- package/dist/fp/factories/loan-broker-set.js.map +1 -0
- package/dist/fp/factories/loan-delete.d.ts +18 -0
- package/dist/fp/factories/loan-delete.d.ts.map +1 -0
- package/dist/fp/factories/loan-delete.js +95 -0
- package/dist/fp/factories/loan-delete.js.map +1 -0
- package/dist/fp/factories/loan-manage.d.ts +72 -0
- package/dist/fp/factories/loan-manage.d.ts.map +1 -0
- package/dist/fp/factories/loan-manage.js +79 -0
- package/dist/fp/factories/loan-manage.js.map +1 -0
- package/dist/fp/factories/loan-pay.d.ts +70 -0
- package/dist/fp/factories/loan-pay.d.ts.map +1 -0
- package/dist/fp/factories/loan-pay.js +115 -0
- package/dist/fp/factories/loan-pay.js.map +1 -0
- package/dist/fp/factories/loan-set.d.ts +67 -0
- package/dist/fp/factories/loan-set.d.ts.map +1 -0
- package/dist/fp/factories/loan-set.js +102 -0
- package/dist/fp/factories/loan-set.js.map +1 -0
- package/dist/fp/factories/mptoken-authorize.d.ts +83 -0
- package/dist/fp/factories/mptoken-authorize.d.ts.map +1 -0
- package/dist/fp/factories/mptoken-authorize.js +63 -0
- package/dist/fp/factories/mptoken-authorize.js.map +1 -0
- package/dist/fp/factories/mptoken-issuance-create.d.ts +71 -0
- package/dist/fp/factories/mptoken-issuance-create.d.ts.map +1 -0
- package/dist/fp/factories/mptoken-issuance-create.js +135 -0
- package/dist/fp/factories/mptoken-issuance-create.js.map +1 -0
- package/dist/fp/factories/mptoken-issuance-destroy.d.ts +32 -0
- package/dist/fp/factories/mptoken-issuance-destroy.d.ts.map +1 -0
- package/dist/fp/factories/mptoken-issuance-destroy.js +105 -0
- package/dist/fp/factories/mptoken-issuance-destroy.js.map +1 -0
- package/dist/fp/factories/mptoken-issuance-set.d.ts +196 -0
- package/dist/fp/factories/mptoken-issuance-set.d.ts.map +1 -0
- package/dist/fp/factories/mptoken-issuance-set.js +333 -0
- package/dist/fp/factories/mptoken-issuance-set.js.map +1 -0
- package/dist/fp/factories/nftoken-accept-offer.d.ts +108 -0
- package/dist/fp/factories/nftoken-accept-offer.d.ts.map +1 -0
- package/dist/fp/factories/nftoken-accept-offer.js +105 -0
- package/dist/fp/factories/nftoken-accept-offer.js.map +1 -0
- package/dist/fp/factories/nftoken-burn.d.ts +27 -0
- package/dist/fp/factories/nftoken-burn.d.ts.map +1 -0
- package/dist/fp/factories/nftoken-burn.js +125 -0
- package/dist/fp/factories/nftoken-burn.js.map +1 -0
- package/dist/fp/factories/nftoken-cancel-offer.d.ts +19 -0
- package/dist/fp/factories/nftoken-cancel-offer.d.ts.map +1 -0
- package/dist/fp/factories/nftoken-cancel-offer.js +143 -0
- package/dist/fp/factories/nftoken-cancel-offer.js.map +1 -0
- package/dist/fp/factories/nftoken-create-offer.d.ts +159 -0
- package/dist/fp/factories/nftoken-create-offer.d.ts.map +1 -0
- package/dist/fp/factories/nftoken-create-offer.js +212 -0
- package/dist/fp/factories/nftoken-create-offer.js.map +1 -0
- package/dist/fp/factories/nftoken-mint.d.ts +155 -0
- package/dist/fp/factories/nftoken-mint.d.ts.map +1 -0
- package/dist/fp/factories/nftoken-mint.js +165 -0
- package/dist/fp/factories/nftoken-mint.js.map +1 -0
- package/dist/fp/factories/nftoken-modify.d.ts +28 -0
- package/dist/fp/factories/nftoken-modify.d.ts.map +1 -0
- package/dist/fp/factories/nftoken-modify.js +209 -0
- package/dist/fp/factories/nftoken-modify.js.map +1 -0
- package/dist/fp/factories/offer-cancel.d.ts +21 -0
- package/dist/fp/factories/offer-cancel.d.ts.map +1 -0
- package/dist/fp/factories/offer-cancel.js +99 -0
- package/dist/fp/factories/offer-cancel.js.map +1 -0
- package/dist/fp/factories/offer-create.d.ts +125 -0
- package/dist/fp/factories/offer-create.d.ts.map +1 -0
- package/dist/fp/factories/offer-create.js +230 -0
- package/dist/fp/factories/offer-create.js.map +1 -0
- package/dist/fp/factories/oracle-delete.d.ts +21 -0
- package/dist/fp/factories/oracle-delete.d.ts.map +1 -0
- package/dist/fp/factories/oracle-delete.js +101 -0
- package/dist/fp/factories/oracle-delete.js.map +1 -0
- package/dist/fp/factories/oracle-set.d.ts +40 -0
- package/dist/fp/factories/oracle-set.d.ts.map +1 -0
- package/dist/fp/factories/oracle-set.js +257 -0
- package/dist/fp/factories/oracle-set.js.map +1 -0
- package/dist/fp/factories/payment-channel-claim.d.ts +153 -0
- package/dist/fp/factories/payment-channel-claim.d.ts.map +1 -0
- package/dist/fp/factories/payment-channel-claim.js +118 -0
- package/dist/fp/factories/payment-channel-claim.js.map +1 -0
- package/dist/fp/factories/payment-channel-create.d.ts +30 -0
- package/dist/fp/factories/payment-channel-create.d.ts.map +1 -0
- package/dist/fp/factories/payment-channel-create.js +172 -0
- package/dist/fp/factories/payment-channel-create.js.map +1 -0
- package/dist/fp/factories/payment-channel-fund.d.ts +25 -0
- package/dist/fp/factories/payment-channel-fund.d.ts.map +1 -0
- package/dist/fp/factories/payment-channel-fund.js +142 -0
- package/dist/fp/factories/payment-channel-fund.js.map +1 -0
- package/dist/fp/factories/payment.d.ts +65 -0
- package/dist/fp/factories/payment.d.ts.map +1 -0
- package/dist/fp/factories/payment.js +48 -0
- package/dist/fp/factories/payment.js.map +1 -0
- package/dist/fp/factories/permissioned-domain-delete.d.ts +18 -0
- package/dist/fp/factories/permissioned-domain-delete.d.ts.map +1 -0
- package/dist/fp/factories/permissioned-domain-delete.js +88 -0
- package/dist/fp/factories/permissioned-domain-delete.js.map +1 -0
- package/dist/fp/factories/permissioned-domain-set.d.ts +118 -0
- package/dist/fp/factories/permissioned-domain-set.d.ts.map +1 -0
- package/dist/fp/factories/permissioned-domain-set.js +100 -0
- package/dist/fp/factories/permissioned-domain-set.js.map +1 -0
- package/dist/fp/factories/set-regular-key.d.ts +30 -0
- package/dist/fp/factories/set-regular-key.d.ts.map +1 -0
- package/dist/fp/factories/set-regular-key.js +81 -0
- package/dist/fp/factories/set-regular-key.js.map +1 -0
- package/dist/fp/factories/signer-list-set.d.ts +61 -0
- package/dist/fp/factories/signer-list-set.d.ts.map +1 -0
- package/dist/fp/factories/signer-list-set.js +250 -0
- package/dist/fp/factories/signer-list-set.js.map +1 -0
- package/dist/fp/factories/sponsorship-set.d.ts +148 -0
- package/dist/fp/factories/sponsorship-set.d.ts.map +1 -0
- package/dist/fp/factories/sponsorship-set.js +201 -0
- package/dist/fp/factories/sponsorship-set.js.map +1 -0
- package/dist/fp/factories/sponsorship-transfer.d.ts +173 -0
- package/dist/fp/factories/sponsorship-transfer.d.ts.map +1 -0
- package/dist/fp/factories/sponsorship-transfer.js +195 -0
- package/dist/fp/factories/sponsorship-transfer.js.map +1 -0
- package/dist/fp/factories/ticket-create.d.ts +20 -0
- package/dist/fp/factories/ticket-create.d.ts.map +1 -0
- package/dist/fp/factories/ticket-create.js +120 -0
- package/dist/fp/factories/ticket-create.js.map +1 -0
- package/dist/fp/factories/trust-set.d.ts +100 -0
- package/dist/fp/factories/trust-set.d.ts.map +1 -0
- package/dist/fp/factories/trust-set.js +111 -0
- package/dist/fp/factories/trust-set.js.map +1 -0
- package/dist/fp/factories/vault-clawback.d.ts +83 -0
- package/dist/fp/factories/vault-clawback.d.ts.map +1 -0
- package/dist/fp/factories/vault-clawback.js +91 -0
- package/dist/fp/factories/vault-clawback.js.map +1 -0
- package/dist/fp/factories/vault-create.d.ts +51 -0
- package/dist/fp/factories/vault-create.d.ts.map +1 -0
- package/dist/fp/factories/vault-create.js +141 -0
- package/dist/fp/factories/vault-create.js.map +1 -0
- package/dist/fp/factories/vault-delete.d.ts +20 -0
- package/dist/fp/factories/vault-delete.d.ts.map +1 -0
- package/dist/fp/factories/vault-delete.js +103 -0
- package/dist/fp/factories/vault-delete.js.map +1 -0
- package/dist/fp/factories/vault-deposit.d.ts +56 -0
- package/dist/fp/factories/vault-deposit.d.ts.map +1 -0
- package/dist/fp/factories/vault-deposit.js +85 -0
- package/dist/fp/factories/vault-deposit.js.map +1 -0
- package/dist/fp/factories/vault-set.d.ts +32 -0
- package/dist/fp/factories/vault-set.d.ts.map +1 -0
- package/dist/fp/factories/vault-set.js +135 -0
- package/dist/fp/factories/vault-set.js.map +1 -0
- package/dist/fp/factories/vault-withdraw.d.ts +82 -0
- package/dist/fp/factories/vault-withdraw.d.ts.map +1 -0
- package/dist/fp/factories/vault-withdraw.js +122 -0
- package/dist/fp/factories/vault-withdraw.js.map +1 -0
- package/dist/fp/factories/xchain-account-create-commit.d.ts +180 -0
- package/dist/fp/factories/xchain-account-create-commit.d.ts.map +1 -0
- package/dist/fp/factories/xchain-account-create-commit.js +99 -0
- package/dist/fp/factories/xchain-account-create-commit.js.map +1 -0
- package/dist/fp/factories/xchain-add-account-create-attestation.d.ts +213 -0
- package/dist/fp/factories/xchain-add-account-create-attestation.d.ts.map +1 -0
- package/dist/fp/factories/xchain-add-account-create-attestation.js +95 -0
- package/dist/fp/factories/xchain-add-account-create-attestation.js.map +1 -0
- package/dist/fp/factories/xchain-add-claim-attestation.d.ts +206 -0
- package/dist/fp/factories/xchain-add-claim-attestation.d.ts.map +1 -0
- package/dist/fp/factories/xchain-add-claim-attestation.js +97 -0
- package/dist/fp/factories/xchain-add-claim-attestation.js.map +1 -0
- package/dist/fp/factories/xchain-claim.d.ts +187 -0
- package/dist/fp/factories/xchain-claim.d.ts.map +1 -0
- package/dist/fp/factories/xchain-claim.js +140 -0
- package/dist/fp/factories/xchain-claim.js.map +1 -0
- package/dist/fp/factories/xchain-commit.d.ts +168 -0
- package/dist/fp/factories/xchain-commit.d.ts.map +1 -0
- package/dist/fp/factories/xchain-commit.js +137 -0
- package/dist/fp/factories/xchain-commit.js.map +1 -0
- package/dist/fp/factories/xchain-create-bridge.d.ts +206 -0
- package/dist/fp/factories/xchain-create-bridge.d.ts.map +1 -0
- package/dist/fp/factories/xchain-create-bridge.js +100 -0
- package/dist/fp/factories/xchain-create-bridge.js.map +1 -0
- package/dist/fp/factories/xchain-create-claim-id.d.ts +199 -0
- package/dist/fp/factories/xchain-create-claim-id.d.ts.map +1 -0
- package/dist/fp/factories/xchain-create-claim-id.js +78 -0
- package/dist/fp/factories/xchain-create-claim-id.js.map +1 -0
- package/dist/fp/factories/xchain-modify-bridge.d.ts +198 -0
- package/dist/fp/factories/xchain-modify-bridge.d.ts.map +1 -0
- package/dist/fp/factories/xchain-modify-bridge.js +102 -0
- package/dist/fp/factories/xchain-modify-bridge.js.map +1 -0
- package/dist/fp/index.d.ts +124 -0
- package/dist/fp/index.d.ts.map +1 -0
- package/dist/fp/index.js +152 -0
- package/dist/fp/index.js.map +1 -0
- package/dist/fp/shape.d.ts +34 -0
- package/dist/fp/shape.d.ts.map +1 -0
- package/dist/fp/shape.js +80 -0
- package/dist/fp/shape.js.map +1 -0
- package/dist/types/amounts.d.ts +49 -0
- package/dist/types/amounts.d.ts.map +1 -0
- package/dist/types/amounts.js +8 -0
- package/dist/types/amounts.js.map +1 -0
- package/dist/types/base.d.ts +103 -0
- package/dist/types/base.d.ts.map +1 -0
- package/dist/types/base.js +2 -0
- package/dist/types/base.js.map +1 -0
- package/dist/types/common.d.ts +163 -0
- package/dist/types/common.d.ts.map +1 -0
- package/dist/types/common.js +5 -0
- package/dist/types/common.js.map +1 -0
- package/dist/types/flags.d.ts +317 -0
- package/dist/types/flags.d.ts.map +1 -0
- package/dist/types/flags.js +253 -0
- package/dist/types/flags.js.map +1 -0
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/transaction-types.d.ts +7 -0
- package/dist/types/transaction-types.d.ts.map +1 -0
- package/dist/types/transaction-types.js +2 -0
- package/dist/types/transaction-types.js.map +1 -0
- package/dist/validation/base.d.ts +8 -0
- package/dist/validation/base.d.ts.map +1 -0
- package/dist/validation/base.js +79 -0
- package/dist/validation/base.js.map +1 -0
- package/dist/validation/helpers.d.ts +42 -0
- package/dist/validation/helpers.d.ts.map +1 -0
- package/dist/validation/helpers.js +154 -0
- package/dist/validation/helpers.js.map +1 -0
- package/dist/validation/index.d.ts +3 -0
- package/dist/validation/index.d.ts.map +1 -0
- package/dist/validation/index.js +3 -0
- package/dist/validation/index.js.map +1 -0
- package/package.json +67 -0
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Functional DelegateSet factory — frozen-object style.
|
|
3
|
+
*
|
|
4
|
+
* Authorizes another account (the `Authorize` field) to issue a set of
|
|
5
|
+
* transaction types on behalf of the sender. Validation happens at
|
|
6
|
+
* construction; there is no way to construct an invalid tx.
|
|
7
|
+
*
|
|
8
|
+
* import { delegateSet } from 'xrplt/fp';
|
|
9
|
+
* const tx = delegateSet({
|
|
10
|
+
* Account,
|
|
11
|
+
* Authorize: OTHER_ACCOUNT,
|
|
12
|
+
* Permissions: [
|
|
13
|
+
* { Permission: { PermissionValue: 'Payment' } },
|
|
14
|
+
* ],
|
|
15
|
+
* });
|
|
16
|
+
* const j = tx.toJSON();
|
|
17
|
+
* const tx2 = tx.with({ Fee: '12', Sequence: 42 });
|
|
18
|
+
*
|
|
19
|
+
* @see https://xrpl.org/docs/references/protocol/transactions/types/delegateSet
|
|
20
|
+
* @see xrpl.js `dist/npm/models/transactions/delegateSet.ts`
|
|
21
|
+
* (validateDelegateSet — source of every guard below).
|
|
22
|
+
*
|
|
23
|
+
* ## Divergences
|
|
24
|
+
*
|
|
25
|
+
* The factory implements the canonical XRPL DelegateSet shape from
|
|
26
|
+
* xrpl.js / XLS-85d, which is a strict superset of the current class
|
|
27
|
+
* API at `src/transactions/delegate-set.ts`. The class is a placeholder
|
|
28
|
+
* skeleton — it accepts a single `Delegate` field and does not model
|
|
29
|
+
* the `Permissions` array at all. Concretely:
|
|
30
|
+
*
|
|
31
|
+
* 1. **Field rename: `Delegate` → `Authorize`.** The class
|
|
32
|
+
* `src/transactions/delegate-set.ts` exposes `Delegate: string` as
|
|
33
|
+
* its sole body field. Canonical xrpl.js names the field
|
|
34
|
+
* `Authorize: Account` (`node_modules/xrpl/src/models/transactions/
|
|
35
|
+
* delegateSet.ts:36-48`). The factory follows xrpl.js / XLS-85d
|
|
36
|
+
* and uses `Authorize`. Any caller passing `Delegate` will not
|
|
37
|
+
* see it on the wire — the fp output goes through
|
|
38
|
+
* `ripple-binary-codec` which would silently drop the unknown
|
|
39
|
+
* field. Source: xrpl.js `DelegateSet` interface (Authorize field).
|
|
40
|
+
*
|
|
41
|
+
* 2. **`Permissions` array is required.** xrpl.js requires
|
|
42
|
+
* `validateRequiredField(tx, 'Permissions', Array.isArray)`
|
|
43
|
+
* (xrpl.js `validateDelegateSet.ts:68`). The class does not model
|
|
44
|
+
* `Permissions` at all. Without it the tx is malformed and rippled
|
|
45
|
+
* rejects with `temMALFORMED`. Source: xrpl.js
|
|
46
|
+
* `validateDelegateSet.ts:68`; ripple-binary-codec
|
|
47
|
+
* `definitions.json` `DelegateSet: Permissions [ required ]`.
|
|
48
|
+
*
|
|
49
|
+
* 3. **`Permissions` length cap is 10.** xrpl.js enforces
|
|
50
|
+
* `permissions.length > PERMISSIONS_MAX_LENGTH`
|
|
51
|
+
* (`PERMISSIONS_MAX_LENGTH = 10`) and rejects longer arrays
|
|
52
|
+
* (xrpl.js `validateDelegateSet.ts:72-76`). The factory mirrors
|
|
53
|
+
* this with a `ValidationError` at construction.
|
|
54
|
+
*
|
|
55
|
+
* 4. **Each `Permission` element must have exactly `{ Permission: {
|
|
56
|
+
* PermissionValue: string } }` shape.** xrpl.js rejects:
|
|
57
|
+
* null elements, more than one outer key, missing `Permission`,
|
|
58
|
+
* more than one key under `Permission`, missing `PermissionValue`,
|
|
59
|
+
* non-string `PermissionValue` (xrpl.js `validateDelegateSet.ts:
|
|
60
|
+
* 79-99`). The factory runs the same shape checks at
|
|
61
|
+
* construction. The class does not model `Permissions` so cannot
|
|
62
|
+
* reason about its shape at all.
|
|
63
|
+
*
|
|
64
|
+
* 5. **`PermissionValue` must not be a non-delegatable transaction.**
|
|
65
|
+
* xrpl.js maintains `NON_DELEGABLE_TRANSACTIONS = { AccountSet,
|
|
66
|
+
* SetRegularKey, SignerListSet, DelegateSet, AccountDelete, Batch,
|
|
67
|
+
* EnableAmendment, SetFee, UNLModify }` (xrpl.js
|
|
68
|
+
* `validateDelegateSet.ts:12-25, 102-104`) and rejects any
|
|
69
|
+
* `PermissionValue` in that set. The factory encodes the same set
|
|
70
|
+
* and rejects at construction. Self-delegation via `DelegateSet`
|
|
71
|
+
* is therefore blocked preclaim, matching rippled's behaviour.
|
|
72
|
+
*
|
|
73
|
+
* 6. **`Authorize` must differ from `Account`.** xrpl.js throws
|
|
74
|
+
* `'DelegateSet: Authorize and Account must be different.'`
|
|
75
|
+
* (xrpl.js `validateDelegateSet.ts:62-66`). The class does not
|
|
76
|
+
* check this — `delegateSet({ Account: A, Delegate: A })` would
|
|
77
|
+
* pass the class's `isAccount(this.Delegate)` check.
|
|
78
|
+
*
|
|
79
|
+
* 7. **No duplicate `PermissionValue`s.** xrpl.js maintains a Set
|
|
80
|
+
* while iterating and throws if
|
|
81
|
+
* `permissions.length !== permissionValueSet.size`
|
|
82
|
+
* (`validateDelegateSet.ts:107-111`). The factory mirrors this.
|
|
83
|
+
*
|
|
84
|
+
* 8. **`Account` is validated as a classic/X-address via
|
|
85
|
+
* `isAccount`, not just as a non-empty string.** The class
|
|
86
|
+
* delegates `Account` to the base class's
|
|
87
|
+
* `validateBaseTransaction`, which only requires
|
|
88
|
+
* `typeof Account === 'string'` (`src/validation/base.ts:42-49`).
|
|
89
|
+
* The factory is consistent with all other MPT/Loan/Vault
|
|
90
|
+
* factories.
|
|
91
|
+
*/
|
|
92
|
+
import { isAccount, isString } from '../../validation/helpers.js';
|
|
93
|
+
import { ValidationError } from '../../errors.js';
|
|
94
|
+
import { buildFrozenTx, mergeForWith, require } from '../shape.js';
|
|
95
|
+
// ─── Spec constants ──────────────────────────────────────────────────
|
|
96
|
+
/**
|
|
97
|
+
* Maximum number of `Permission` entries in a single DelegateSet
|
|
98
|
+
* transaction. Mirrors xrpl.js `PERMISSIONS_MAX_LENGTH`.
|
|
99
|
+
*/
|
|
100
|
+
const PERMISSIONS_MAX_LENGTH = 10;
|
|
101
|
+
/**
|
|
102
|
+
* Transactions that cannot be delegated, per XLS-85d / xrpl.js
|
|
103
|
+
* `NON_DELEGABLE_TRANSACTIONS`. Self-delegation is included so a user
|
|
104
|
+
* cannot grant themselves rights they already have by definition.
|
|
105
|
+
*/
|
|
106
|
+
const NON_DELEGABLE_TRANSACTIONS = new Set([
|
|
107
|
+
'AccountSet',
|
|
108
|
+
'SetRegularKey',
|
|
109
|
+
'SignerListSet',
|
|
110
|
+
'DelegateSet',
|
|
111
|
+
'AccountDelete',
|
|
112
|
+
'Batch',
|
|
113
|
+
// Pseudo transactions:
|
|
114
|
+
'EnableAmendment',
|
|
115
|
+
'SetFee',
|
|
116
|
+
'UNLModify',
|
|
117
|
+
]);
|
|
118
|
+
// ─── Factory ─────────────────────────────────────────────────────────
|
|
119
|
+
/**
|
|
120
|
+
* Build a frozen DelegateSet. Throws `ValidationError` on construction
|
|
121
|
+
* if any required field is missing or malformed.
|
|
122
|
+
*
|
|
123
|
+
* The class-based equivalent validates lazily (caller must invoke
|
|
124
|
+
* `.validate()`); this functional version validates at construction.
|
|
125
|
+
* There is no way to build an invalid tx — `with()` re-runs the
|
|
126
|
+
* factory, so overrides are re-validated too.
|
|
127
|
+
*/
|
|
128
|
+
export function delegateSet(props) {
|
|
129
|
+
// ── Account ── required, must be a valid XRPL classic/X-address.
|
|
130
|
+
require(props.Account, 'DelegateSet: missing or invalid Account', isAccount);
|
|
131
|
+
// ── Authorize ── required, must be a valid XRPL account AND must
|
|
132
|
+
// not equal Account (no self-delegation).
|
|
133
|
+
require(props.Authorize, 'DelegateSet: missing or invalid Authorize', isAccount);
|
|
134
|
+
if (props.Authorize === props.Account) {
|
|
135
|
+
throw new ValidationError('DelegateSet: Authorize and Account must be different');
|
|
136
|
+
}
|
|
137
|
+
// ── Permissions ── required, must be an array.
|
|
138
|
+
if (!Array.isArray(props.Permissions)) {
|
|
139
|
+
throw new ValidationError('DelegateSet: missing or invalid Permissions (array required)');
|
|
140
|
+
}
|
|
141
|
+
if (props.Permissions.length > PERMISSIONS_MAX_LENGTH) {
|
|
142
|
+
throw new ValidationError(`DelegateSet: Permissions array length cannot be greater than ${PERMISSIONS_MAX_LENGTH} (actual: ${props.Permissions.length})`);
|
|
143
|
+
}
|
|
144
|
+
// ── Permissions ── shape + non-delegatable + duplicate checks.
|
|
145
|
+
const seen = new Set();
|
|
146
|
+
for (const permission of props.Permissions) {
|
|
147
|
+
if (permission == null ||
|
|
148
|
+
typeof permission !== 'object' ||
|
|
149
|
+
Object.keys(permission).length !== 1 ||
|
|
150
|
+
permission.Permission == null ||
|
|
151
|
+
typeof permission.Permission !== 'object' ||
|
|
152
|
+
Object.keys(permission.Permission).length !== 1) {
|
|
153
|
+
throw new ValidationError('DelegateSet: Permissions array element is malformed (expected { Permission: { PermissionValue: string } })');
|
|
154
|
+
}
|
|
155
|
+
const permissionValue = permission.Permission.PermissionValue;
|
|
156
|
+
if (permissionValue === undefined || permissionValue === null) {
|
|
157
|
+
throw new ValidationError('DelegateSet: PermissionValue must be defined');
|
|
158
|
+
}
|
|
159
|
+
if (!isString(permissionValue)) {
|
|
160
|
+
throw new ValidationError('DelegateSet: PermissionValue must be a string');
|
|
161
|
+
}
|
|
162
|
+
if (NON_DELEGABLE_TRANSACTIONS.has(permissionValue)) {
|
|
163
|
+
throw new ValidationError(`DelegateSet: PermissionValue contains a non-delegatable transaction ${permissionValue}`);
|
|
164
|
+
}
|
|
165
|
+
if (seen.has(permissionValue)) {
|
|
166
|
+
throw new ValidationError(`DelegateSet: Permissions array cannot contain duplicate values (${permissionValue})`);
|
|
167
|
+
}
|
|
168
|
+
seen.add(permissionValue);
|
|
169
|
+
}
|
|
170
|
+
return buildFrozenTx('DelegateSet', props, {
|
|
171
|
+
validate() {
|
|
172
|
+
// Validated at construction.
|
|
173
|
+
},
|
|
174
|
+
toJSON() {
|
|
175
|
+
const json = {};
|
|
176
|
+
for (const k of Object.keys(this)) {
|
|
177
|
+
if (k === 'validate' || k === 'toJSON' || k === 'with')
|
|
178
|
+
continue;
|
|
179
|
+
const v = this[k];
|
|
180
|
+
if (v !== undefined)
|
|
181
|
+
json[k] = v;
|
|
182
|
+
}
|
|
183
|
+
return json;
|
|
184
|
+
},
|
|
185
|
+
with(overrides) {
|
|
186
|
+
return delegateSet(mergeForWith(this, overrides));
|
|
187
|
+
},
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
//# sourceMappingURL=delegate-set.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delegate-set.js","sourceRoot":"","sources":["../../../src/fp/factories/delegate-set.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0FG;AACH,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEnE,wEAAwE;AAExE;;;GAGG;AACH,MAAM,sBAAsB,GAAG,EAAE,CAAC;AAElC;;;;GAIG;AACH,MAAM,0BAA0B,GAAwB,IAAI,GAAG,CAAC;IAC9D,YAAY;IACZ,eAAe;IACf,eAAe;IACf,aAAa;IACb,eAAe;IACf,OAAO;IACP,uBAAuB;IACvB,iBAAiB;IACjB,QAAQ;IACR,WAAW;CACZ,CAAC,CAAC;AAiDH,wEAAwE;AAExE;;;;;;;;GAQG;AACH,MAAM,UAAU,WAAW,CAAC,KAAuB;IACjD,kEAAkE;IAClE,OAAO,CACL,K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+
*
|
|
4
|
+
* Grant or revoke preauthorization for another account (or a set of
|
|
5
|
+
* credentials) to deliver payments to the sender. Preauthorization is
|
|
6
|
+
* only meaningful when the sender has [Deposit Authorization][depauth]
|
|
7
|
+
* enabled, but the tx can be submitted ahead of time so the switch
|
|
8
|
+
* is seamless.
|
|
9
|
+
*
|
|
10
|
+
* import { depositPreauth } from 'xrplt/fp';
|
|
11
|
+
* const tx = depositPreauth({
|
|
12
|
+
* Account,
|
|
13
|
+
* Authorize: OTHER_ACCOUNT,
|
|
14
|
+
* });
|
|
15
|
+
* tx.validate(); // no-op — already validated at construction
|
|
16
|
+
* const j = tx.toJSON();
|
|
17
|
+
* const tx2 = tx.with({ Fee: '12', Sequence: 42 });
|
|
18
|
+
*
|
|
19
|
+
* Four mutually exclusive "payload" fields are supported by the
|
|
20
|
+
* binary codec: exactly one of `Authorize`, `Unauthorize`,
|
|
21
|
+
* `AuthorizeCredentials`, or `UnauthorizeCredentials` MUST be
|
|
22
|
+
* supplied. Per XRPL.org: "You must provide exactly one of …"
|
|
23
|
+
*
|
|
24
|
+
* @see https://xrpl.org/docs/references/protocol/transactions/types/depositpreauth
|
|
25
|
+
* @see XLS-9d (DepositPreauth amendment)
|
|
26
|
+
* @see XLS-70 (Credentials — adds the credential preauth fields)
|
|
27
|
+
* @see xrpl.js `packages/xrpl/src/models/transactions/DepositPreauth.ts`
|
|
28
|
+
* (`validateDepositPreauth` and `validateSingleAuthorizationFieldProvided`
|
|
29
|
+
* — source of every guard below except the X-address `Account`
|
|
30
|
+
* equality check, which is slightly more permissive here).
|
|
31
|
+
*
|
|
32
|
+
* ## Divergences
|
|
33
|
+
*
|
|
34
|
+
* The factory implements the canonical XRPL DepositPreauth shape from
|
|
35
|
+
* xrpl.js / XLS-9d / XLS-70 / XRPL.org, which is a strict superset of
|
|
36
|
+
* the validation the class API performs. The class at
|
|
37
|
+
* `src/transactions/deposit-preauth.ts` is a pre-Credentials
|
|
38
|
+
* placeholder — it only models the two single-account fields
|
|
39
|
+
* (`Authorize` / `Unauthorize`) and the "exactly one of two" rule.
|
|
40
|
+
* Concretely:
|
|
41
|
+
*
|
|
42
|
+
* 1. **Validation is eager, not lazy.** The class lets callers
|
|
43
|
+
* construct a tx without immediately validating it; the factory
|
|
44
|
+
* runs every guard at construction so an invalid `DepositPreauth`
|
|
45
|
+
* is a type error (the call throws). There is no way to construct
|
|
46
|
+
* an invalid frozen tx. Source: class `validate()` only runs when
|
|
47
|
+
* explicitly called (`src/transactions/deposit-preauth.ts:36-50`);
|
|
48
|
+
* the factory mirrors the xrpl.js guard sequence
|
|
49
|
+
* (`DepositPreauth.ts:63-86`) at construction time.
|
|
50
|
+
*
|
|
51
|
+
* 2. **`Account` is validated as a classic/X-address via
|
|
52
|
+
* `isAccount`, not just as a non-empty string.** The class
|
|
53
|
+
* delegates `Account` to the base class, which only requires
|
|
54
|
+
* `typeof Account === 'string'`. The factory enforces the format
|
|
55
|
+
* regex at construction, matching the rest of the M4 fp family
|
|
56
|
+
* (delegateSet, setRegularKey, didSet, payment, etc.).
|
|
57
|
+
*
|
|
58
|
+
* 3. **"Exactly one of four" instead of "exactly one of two".**
|
|
59
|
+
* The class enforces the rule on two fields
|
|
60
|
+
* (`src/transactions/deposit-preauth.ts:38-43`):
|
|
61
|
+
* `Authorize XOR Unauthorize`. XRPL.org and xrpl.js both require
|
|
62
|
+
* EXACTLY ONE of `Authorize`, `Unauthorize`,
|
|
63
|
+
* `AuthorizeCredentials`, `UnauthorizeCredentials`. The factory
|
|
64
|
+
* enforces the 4-way XOR per xrpl.js
|
|
65
|
+
* `validateSingleAuthorizationFieldProvided`
|
|
66
|
+
* (`DepositPreauth.ts:88-104`) and XRPL.org
|
|
67
|
+
* `depositpreauth.md:66` "You must provide exactly one of …".
|
|
68
|
+
* Source: xrpl.js `DepositPreauth.ts:88-104`; XRPL.org
|
|
69
|
+
* `depositpreauth.md:66`.
|
|
70
|
+
*
|
|
71
|
+
* 4. **`AuthorizeCredentials` and `UnauthorizeCredentials` are
|
|
72
|
+
* modelled (XLS-70).** The class does not declare these fields
|
|
73
|
+
* at all. The binary codec accepts them (per
|
|
74
|
+
* `ripple-binary-codec definitions.json` DepositPreauth
|
|
75
|
+
* definition), but the class refuses them via TypeScript.
|
|
76
|
+
* Without these fields a caller cannot preauthorize or
|
|
77
|
+
* unauthorize a credential — a common workflow under the
|
|
78
|
+
* Credentials amendment. The factory exposes both. Source:
|
|
79
|
+
* xrpl.js `DepositPreauth.ts:33-38`; XRPL.org
|
|
80
|
+
* `depositpreauth.md:36-53` (the Credential preauthorization
|
|
81
|
+
* JSON example); XLS-70 §3.
|
|
82
|
+
*
|
|
83
|
+
* 5. **`Account` cannot equal `Authorize` or `Unauthorize`
|
|
84
|
+
* (`temCANNOT_PREAUTH_SELF`).** xrpl.js rejects this via
|
|
85
|
+
* `validateAuthorizationField` and `areAddressesEqual`
|
|
86
|
+
* (`DepositPreauth.ts:41-55`); XRPL.org documents the resulting
|
|
87
|
+
* error code `temCANNOT_PREAUTH_SELF` ("You cannot preauthorize
|
|
88
|
+
* yourself") at `depositpreauth.md:91`. The class does NOT check
|
|
89
|
+
* this — the class validator only requires `isAccount(...)` and
|
|
90
|
+
* does not compare against `Account`. The factory rejects
|
|
91
|
+
* self-preauth at construction. Source: xrpl.js
|
|
92
|
+
* `DepositPreauth.ts:41-55`; XRPL.org `depositpreauth.md:91`.
|
|
93
|
+
*
|
|
94
|
+
* 6. **`AuthorizeCredentials` / `UnauthorizeCredentials` list
|
|
95
|
+
* validation.** xrpl.js calls `validateCredentialsList`
|
|
96
|
+
* (`DepositPreauth.ts:71-85`) with `MAX_AUTHORIZED_CREDENTIALS =
|
|
97
|
+
* 8`. The factory mirrors this: the list must be a non-empty
|
|
98
|
+
* array, length ≤ 8, each entry must be a valid
|
|
99
|
+
* `AuthorizeCredential` object form (NOT a string credential
|
|
100
|
+
* ID), and there must be no duplicate (Issuer, CredentialType)
|
|
101
|
+
* pairs. The class has no equivalent field, so the class has no
|
|
102
|
+
* equivalent rule. Source: xrpl.js
|
|
103
|
+
* `DepositPreauth.ts:71-85`; xrpl.js `common.ts:28,1106-1148`;
|
|
104
|
+
* XRPL.org `depositpreauth.md:71-78` (per-entry field table).
|
|
105
|
+
*
|
|
106
|
+
* 7. **Per-credential validation: `CredentialType` must be non-empty
|
|
107
|
+
* hex (Blob) ≤ 64 bytes; `Issuer` must be a valid XRPL account.**
|
|
108
|
+
* xrpl.js's `validateCredentialsList` calls `isAuthorizeCredential`
|
|
109
|
+
* which only checks object shape + string types
|
|
110
|
+
* (`common.ts:179-191`); it does NOT enforce hex validity on
|
|
111
|
+
* `CredentialType` or address format on `Issuer`. The factory
|
|
112
|
+
* adds these checks so a malformed credential surfaces at
|
|
113
|
+
* construction rather than at the binary codec layer
|
|
114
|
+
* (`CredentialType` is `Blob` per XRPL.org
|
|
115
|
+
* `depositpreauth.md:78`, and `Issuer` is `AccountID` per
|
|
116
|
+
* `depositpreauth.md:77`). Source: xrpl.js `common.ts:179-191`;
|
|
117
|
+
* XRPL.org `depositpreauth.md:71-78`; XLS-70 §2.1.3 (64-byte
|
|
118
|
+
* CredentialType cap).
|
|
119
|
+
*/
|
|
120
|
+
import type { AuthorizeCredential } from '../../types/common.js';
|
|
121
|
+
/**
|
|
122
|
+
* Props for the `DepositPreauth` factory.
|
|
123
|
+
*
|
|
124
|
+
* Four mutually exclusive "payload" fields are supported by the
|
|
125
|
+
* binary codec. Exactly one of them MUST be supplied (per XRPL.org
|
|
126
|
+
* and xrpl.js `validateSingleAuthorizationFieldProvided`).
|
|
127
|
+
*/
|
|
128
|
+
export interface DepositPreauthProps {
|
|
129
|
+
/**
|
|
130
|
+
* The unique address of the transaction sender. The owner of the
|
|
131
|
+
* deposit-authorization slot. Required, must be a valid XRPL
|
|
132
|
+
* classic or X-address.
|
|
133
|
+
*/
|
|
134
|
+
Account: string;
|
|
135
|
+
/**
|
|
136
|
+
* An account to preauthorize (grant the right to deliver payments
|
|
137
|
+
* to `Account`). Must differ from `Account` (`temCANNOT_PREAUTH_SELF`).
|
|
138
|
+
* Mutually exclusive with `Unauthorize`, `AuthorizeCredentials`,
|
|
139
|
+
* `UnauthorizeCredentials`.
|
|
140
|
+
*/
|
|
141
|
+
Authorize?: string | undefined;
|
|
142
|
+
/**
|
|
143
|
+
* An account whose preauthorization should be revoked. Must differ
|
|
144
|
+
* from `Account`. Mutually exclusive with the other three payload
|
|
145
|
+
* fields.
|
|
146
|
+
*/
|
|
147
|
+
Unauthorize?: string | undefined;
|
|
148
|
+
/**
|
|
149
|
+
* A list of credentials to preauthorize (XLS-70). 1–8 unique
|
|
150
|
+
* `AuthorizeCredential` entries. Mutually exclusive with the other
|
|
151
|
+
* three payload fields.
|
|
152
|
+
*/
|
|
153
|
+
AuthorizeCredentials?: AuthorizeCredential[] | undefined;
|
|
154
|
+
/**
|
|
155
|
+
* A list of credentials whose preauthorization should be revoked
|
|
156
|
+
* (XLS-70). 1–8 unique `AuthorizeCredential` entries. Mutually
|
|
157
|
+
* exclusive with the other three payload fields.
|
|
158
|
+
*/
|
|
159
|
+
UnauthorizeCredentials?: AuthorizeCredential[] | undefined;
|
|
160
|
+
/**
|
|
161
|
+
* Bit-flags for this transaction. DepositPreauth defines no
|
|
162
|
+
* transaction-specific flags; only the universal
|
|
163
|
+
* `tfFullyCanonicalSig` (0x80000000) is meaningful.
|
|
164
|
+
*/
|
|
165
|
+
Flags?: number | undefined;
|
|
166
|
+
/** Fee in XRP (drops), base-10 integer string. */
|
|
167
|
+
Fee?: string | undefined;
|
|
168
|
+
/** Account sequence number. */
|
|
169
|
+
Sequence?: number | undefined;
|
|
170
|
+
}
|
|
171
|
+
export interface DepositPreauth extends Readonly<DepositPreauthProps> {
|
|
172
|
+
readonly TransactionType: 'DepositPreauth';
|
|
173
|
+
validate(): void;
|
|
174
|
+
toJSON(): Record<string, unknown>;
|
|
175
|
+
with(overrides: Partial<DepositPreauthProps>): DepositPreauth;
|
|
176
|
+
}
|
|
177
|
+
/**
|
|
178
|
+
* Build a frozen DepositPreauth. Throws `ValidationError` on
|
|
179
|
+
* construction if any required field is missing, malformed, or if
|
|
180
|
+
* the mutually-exclusive-payload rule is violated.
|
|
181
|
+
*/
|
|
182
|
+
export declare function depositPreauth(props: DepositPreauthProps): DepositPreauth;
|
|
183
|
+
//# sourceMappingURL=deposit-preauth.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deposit-preauth.d.ts","sourceRoot":"","sources":["../../../src/fp/factories/deposit-preauth.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsHG;AACH,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AA2BjE;;;;;;GAMG;AACH,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,EAAE,MAAM,CAAC;IAEhB;;;;;OAKG;IACH,SAAS,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAE/B;;;;OAIG;IACH,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAEjC;;;;OAIG;IACH,oBAAoB,CAAC,EAAE,mBAAmB,EAAE,GAAG,SAAS,CAAC;IAEzD;;;;OAIG;IACH,sBAAsB,CAAC,EAAE,mBAAmB,EAAE,GAAG,SAAS,CAAC;IAE3D;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,cACf,SAAQ,QAAQ,CAAC,mBAAmB,CAAC;IACrC,QAAQ,CAAC,eAAe,EAAE,gBAAgB,CAAC;IAC3C,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,CAAC,GAAG,cAAc,CAAC;CAC/D;AAuGD;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,mBAAmB,GAAG,cAAc,CA6GzE"}
|
|
@@ -0,0 +1,159 @@
|
|
|
1
|
+
import { isAccount, isAuthorizeCredential, isHex, isString, } from '../../validation/helpers.js';
|
|
2
|
+
import { ValidationError } from '../../errors.js';
|
|
3
|
+
import { buildFrozenTx, mergeForWith, require } from '../shape.js';
|
|
4
|
+
// ─── Spec constants ──────────────────────────────────────────────────
|
|
5
|
+
/**
|
|
6
|
+
* Maximum number of credentials accepted in `AuthorizeCredentials` /
|
|
7
|
+
* `UnauthorizeCredentials`. Mirrors xrpl.js `MAX_AUTHORIZED_CREDENTIALS`.
|
|
8
|
+
* Source: xrpl.js `common.ts:28`.
|
|
9
|
+
*/
|
|
10
|
+
const MAX_AUTHORIZED_CREDENTIALS = 8;
|
|
11
|
+
/**
|
|
12
|
+
* `CredentialType` is a hex-encoded Blob capped at 64 bytes per
|
|
13
|
+
* XLS-0070 §2.1.3.
|
|
14
|
+
*/
|
|
15
|
+
const MAX_CREDENTIAL_TYPE_BYTES = 64;
|
|
16
|
+
// ─── Helpers ─────────────────────────────────────────────────────────
|
|
17
|
+
/**
|
|
18
|
+
* Validate a single `AuthorizeCredential.CredentialType` payload per
|
|
19
|
+
* XLS-0070 §2.1.3: hex string, non-empty, even length, ≤ 64 bytes.
|
|
20
|
+
*/
|
|
21
|
+
function validateCredentialType(txType, path, value) {
|
|
22
|
+
if (!isString(value)) {
|
|
23
|
+
throw new ValidationError(`${txType}: ${path}.Credential.CredentialType must be a hex string`);
|
|
24
|
+
}
|
|
25
|
+
if (value.length === 0) {
|
|
26
|
+
throw new ValidationError(`${txType}: ${path}.Credential.CredentialType must not be empty`);
|
|
27
|
+
}
|
|
28
|
+
if (!isHex(value)) {
|
|
29
|
+
throw new ValidationError(`${txType}: ${path}.Credential.CredentialType must be a hex string`);
|
|
30
|
+
}
|
|
31
|
+
if (value.length % 2 !== 0) {
|
|
32
|
+
throw new ValidationError(`${txType}: ${path}.Credential.CredentialType must be a hex string with an even number of characters`);
|
|
33
|
+
}
|
|
34
|
+
const bytes = value.length / 2;
|
|
35
|
+
if (bytes > MAX_CREDENTIAL_TYPE_BYTES) {
|
|
36
|
+
throw new ValidationError(`${txType}: ${path}.Credential.CredentialType exceeds ${MAX_CREDENTIAL_TYPE_BYTES} bytes (actual: ${bytes})`);
|
|
37
|
+
}
|
|
38
|
+
return value;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Validate a credentials list (`AuthorizeCredentials` or
|
|
42
|
+
* `UnauthorizeCredentials`). Mirrors xrpl.js `validateCredentialsList`
|
|
43
|
+
* for DepositPreauth (object-form, not string-IDs; cap 8; no dupes),
|
|
44
|
+
* plus stricter per-element validation (hex CredentialType, valid
|
|
45
|
+
* Issuer address).
|
|
46
|
+
*/
|
|
47
|
+
function validateCredentialsArray(txType, fieldName, list) {
|
|
48
|
+
if (!Array.isArray(list)) {
|
|
49
|
+
throw new ValidationError(`${txType}: ${fieldName} must be an array`);
|
|
50
|
+
}
|
|
51
|
+
if (list.length === 0) {
|
|
52
|
+
throw new ValidationError(`${txType}: ${fieldName} cannot be an empty array`);
|
|
53
|
+
}
|
|
54
|
+
if (list.length > MAX_AUTHORIZED_CREDENTIALS) {
|
|
55
|
+
throw new ValidationError(`${txType}: ${fieldName} length cannot exceed ${MAX_AUTHORIZED_CREDENTIALS} elements (actual: ${list.length})`);
|
|
56
|
+
}
|
|
57
|
+
const seen = new Set();
|
|
58
|
+
list.forEach((credential, idx) => {
|
|
59
|
+
if (!isAuthorizeCredential(credential)) {
|
|
60
|
+
throw new ValidationError(`${txType}: ${fieldName}[${idx}] is not a valid AuthorizeCredential object`);
|
|
61
|
+
}
|
|
62
|
+
const credObj = credential.Credential;
|
|
63
|
+
// ── Issuer must be a valid XRPL account (XRPL.org says
|
|
64
|
+
// AccountID; class has no equivalent field so no precedent).
|
|
65
|
+
if (!isAccount(credObj.Issuer)) {
|
|
66
|
+
throw new ValidationError(`${txType}: ${fieldName}[${idx}].Credential.Issuer must be a valid XRPL address`);
|
|
67
|
+
}
|
|
68
|
+
// ── CredentialType must be a non-empty hex Blob ≤ 64 bytes.
|
|
69
|
+
validateCredentialType(txType, `${fieldName}[${idx}]`, credObj.CredentialType);
|
|
70
|
+
// ── No duplicate (Issuer, CredentialType) pairs (XLS-0070).
|
|
71
|
+
const key = `${credObj.Issuer}-${credObj.CredentialType}`;
|
|
72
|
+
if (seen.has(key)) {
|
|
73
|
+
throw new ValidationError(`${txType}: ${fieldName} cannot contain duplicate elements`);
|
|
74
|
+
}
|
|
75
|
+
seen.add(key);
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
// ─── Factory ─────────────────────────────────────────────────────────
|
|
79
|
+
/**
|
|
80
|
+
* Build a frozen DepositPreauth. Throws `ValidationError` on
|
|
81
|
+
* construction if any required field is missing, malformed, or if
|
|
82
|
+
* the mutually-exclusive-payload rule is violated.
|
|
83
|
+
*/
|
|
84
|
+
export function depositPreauth(props) {
|
|
85
|
+
// ── Account ── required, must be a valid XRPL classic/X-address.
|
|
86
|
+
require(props.Account, 'DepositPreauth: missing or invalid Account', isAccount);
|
|
87
|
+
// ── "Exactly one of four" payload XOR ──
|
|
88
|
+
// xrpl.js `validateSingleAuthorizationFieldProvided`
|
|
89
|
+
// (`DepositPreauth.ts:88-104`) and XRPL.org
|
|
90
|
+
// `depositpreauth.md:66`.
|
|
91
|
+
const hasAuth = props.Authorize !== undefined;
|
|
92
|
+
const hasUnauth = props.Unauthorize !== undefined;
|
|
93
|
+
const hasAuthCreds = props.AuthorizeCredentials !== undefined;
|
|
94
|
+
const hasUnauthCreds = props.UnauthorizeCredentials !== undefined;
|
|
95
|
+
const payloadCount = Number(hasAuth) +
|
|
96
|
+
Number(hasUnauth) +
|
|
97
|
+
Number(hasAuthCreds) +
|
|
98
|
+
Number(hasUnauthCreds);
|
|
99
|
+
if (payloadCount !== 1) {
|
|
100
|
+
throw new ValidationError('DepositPreauth: requires exactly one of Authorize, Unauthorize, AuthorizeCredentials, or UnauthorizeCredentials');
|
|
101
|
+
}
|
|
102
|
+
// ── Authorize ── if present, must be a valid account and must not
|
|
103
|
+
// equal Account (`temCANNOT_PREAUTH_SELF`).
|
|
104
|
+
if (hasAuth) {
|
|
105
|
+
if (!isString(props.Authorize)) {
|
|
106
|
+
throw new ValidationError('DepositPreauth: Authorize must be a string');
|
|
107
|
+
}
|
|
108
|
+
if (!isAccount(props.Authorize)) {
|
|
109
|
+
throw new ValidationError('DepositPreauth: Authorize must be a valid XRPL address');
|
|
110
|
+
}
|
|
111
|
+
if (props.Authorize === props.Account) {
|
|
112
|
+
throw new ValidationError('DepositPreauth: Account cannot preauthorize itself (temCANNOT_PREAUTH_SELF)');
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
// ── Unauthorize ── if present, must be a valid account and must
|
|
116
|
+
// not equal Account (symmetric `temCANNOT_PREAUTH_SELF` rule
|
|
117
|
+
// via xrpl.js `validateAuthorizationField`).
|
|
118
|
+
if (hasUnauth) {
|
|
119
|
+
if (!isString(props.Unauthorize)) {
|
|
120
|
+
throw new ValidationError('DepositPreauth: Unauthorize must be a string');
|
|
121
|
+
}
|
|
122
|
+
if (!isAccount(props.Unauthorize)) {
|
|
123
|
+
throw new ValidationError('DepositPreauth: Unauthorize must be a valid XRPL address');
|
|
124
|
+
}
|
|
125
|
+
if (props.Unauthorize === props.Account) {
|
|
126
|
+
throw new ValidationError('DepositPreauth: Account cannot unauthorize itself (temCANNOT_PREAUTH_SELF)');
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
// ── AuthorizeCredentials ── if present, must be a valid 1..8
|
|
130
|
+
// list of unique AuthorizeCredential objects.
|
|
131
|
+
if (hasAuthCreds) {
|
|
132
|
+
validateCredentialsArray('DepositPreauth', 'AuthorizeCredentials', props.AuthorizeCredentials);
|
|
133
|
+
}
|
|
134
|
+
// ── UnauthorizeCredentials ── if present, must be a valid 1..8
|
|
135
|
+
// list of unique AuthorizeCredential objects.
|
|
136
|
+
if (hasUnauthCreds) {
|
|
137
|
+
validateCredentialsArray('DepositPreauth', 'UnauthorizeCredentials', props.UnauthorizeCredentials);
|
|
138
|
+
}
|
|
139
|
+
return buildFrozenTx('DepositPreauth', props, {
|
|
140
|
+
validate() {
|
|
141
|
+
// Validated at construction.
|
|
142
|
+
},
|
|
143
|
+
toJSON() {
|
|
144
|
+
const json = {};
|
|
145
|
+
for (const k of Object.keys(this)) {
|
|
146
|
+
if (k === 'validate' || k === 'toJSON' || k === 'with')
|
|
147
|
+
continue;
|
|
148
|
+
const v = this[k];
|
|
149
|
+
if (v !== undefined)
|
|
150
|
+
json[k] = v;
|
|
151
|
+
}
|
|
152
|
+
return json;
|
|
153
|
+
},
|
|
154
|
+
with(overrides) {
|
|
155
|
+
return depositPreauth(mergeForWith(this, overrides));
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
//# sourceMappingURL=deposit-preauth.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deposit-preauth.js","sourceRoot":"","sources":["../../../src/fp/factories/deposit-preauth.ts"],"names":[],"mappings":"AAwHA,OAAO,EACL,SAAS,EACT,qBAAqB,EACrB,KAAK,EACL,QAAQ,GACT,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEnE,wEAAwE;AAExE;;;;GAIG;AACH,MAAM,0BAA0B,GAAG,CAAC,CAAC;AAErC;;;GAGG;AACH,MAAM,yBAAyB,GAAG,EAAE,C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I,EAAE,SAAS,CAAC,CAAC,CAAC;QACvD,CAAC;KACF,CACF,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface DIDDeleteProps {
|
|
2
|
+
/** The unique address of the transaction sender. Must own a DID. */
|
|
3
|
+
Account: string;
|
|
4
|
+
/**
|
|
5
|
+
* Optional bit-flags. DIDDelete defines no per-tx flags; only the
|
|
6
|
+
* two global flags `tfFullyCanonicalSig` (0x80000000) and
|
|
7
|
+
* `tfInnerBatchTxn` (0x40000000) are valid.
|
|
8
|
+
*/
|
|
9
|
+
Flags?: number | undefined;
|
|
10
|
+
/** Fee in XRP (drops), base-10 integer string. */
|
|
11
|
+
Fee?: string | undefined;
|
|
12
|
+
/** Account sequence number. */
|
|
13
|
+
Sequence?: number | undefined;
|
|
14
|
+
}
|
|
15
|
+
export interface DIDDelete extends Readonly<DIDDeleteProps> {
|
|
16
|
+
readonly TransactionType: 'DIDDelete';
|
|
17
|
+
validate(): void;
|
|
18
|
+
toJSON(): Record<string, unknown>;
|
|
19
|
+
with(overrides: Partial<DIDDeleteProps>): DIDDelete;
|
|
20
|
+
}
|
|
21
|
+
export declare function didDelete(props: DIDDeleteProps): DIDDelete;
|
|
22
|
+
//# sourceMappingURL=did-delete.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"did-delete.d.ts","sourceRoot":"","sources":["../../../src/fp/factories/did-delete.ts"],"names":[],"mappings":"AA6FA,MAAM,WAAW,cAAc;IAC7B,oEAAoE;IACpE,OAAO,EAAE,MAAM,CAAC;IAChB;;;;OAIG;IACH,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAC3B,kDAAkD;IAClD,GAAG,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzB,+BAA+B;IAC/B,QAAQ,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B;AAED,MAAM,WAAW,SAAU,SAAQ,QAAQ,CAAC,cAAc,CAAC;IACzD,QAAQ,CAAC,eAAe,EAAE,WAAW,CAAC;IACtC,QAAQ,IAAI,IAAI,CAAC;IACjB,MAAM,IAAI,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,IAAI,CAAC,SAAS,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,SAAS,CAAC;CACrD;AAID,wBAAgB,SAAS,CAAC,KAAK,EAAE,cAAc,GAAG,SAAS,CA6C1D"}
|