@digitalworld/digital-world-sdk 16.0.0 → 16.0.1
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/README.md +5 -5
- package/dist/digital-world-sdk-axios.js +52 -47
- package/dist/digital-world-sdk-axios.js.map +1 -1
- package/dist/digital-world-sdk-axios.min.js +1 -1
- package/dist/digital-world-sdk-axios.min.js.map +1 -1
- package/dist/digital-world-sdk.js +52 -47
- package/dist/digital-world-sdk.js.map +1 -1
- package/dist/digital-world-sdk.min.js +6 -6
- package/dist/digital-world-sdk.min.js.map +1 -1
- package/lib/axios/cjs/base/contract.js +2 -2
- package/lib/axios/cjs/base/contract.js.map +1 -1
- package/lib/axios/cjs/base/invocation.js.map +1 -1
- package/lib/axios/cjs/base/numbers/sc_int.js +1 -1
- package/lib/axios/cjs/base/numbers/sc_int.js.map +1 -1
- package/lib/axios/cjs/base/operation.js +1 -1
- package/lib/axios/cjs/base/operation.js.map +1 -1
- package/lib/axios/cjs/base/operations/invoke_host_function.js +2 -2
- package/lib/axios/cjs/base/operations/invoke_host_function.js.map +1 -1
- package/lib/axios/cjs/base/operations/revoke_sponsorship.js.map +1 -1
- package/lib/axios/cjs/bindings/config.js +4 -4
- package/lib/axios/cjs/bindings/config.js.map +1 -1
- package/lib/axios/cjs/bindings/generator.js +4 -4
- package/lib/axios/cjs/bindings/generator.js.map +1 -1
- package/lib/axios/cjs/bindings/types.js.map +1 -1
- package/lib/axios/cjs/bindings/utils.js +2 -2
- package/lib/axios/cjs/bindings/utils.js.map +1 -1
- package/lib/axios/cjs/bindings/wasm_fetcher.js +2 -2
- package/lib/axios/cjs/bindings/wasm_fetcher.js.map +1 -1
- package/lib/axios/cjs/contract/assembled_transaction.js.map +1 -1
- package/lib/axios/cjs/contract/spec.js +1 -1
- package/lib/axios/cjs/contract/spec.js.map +1 -1
- package/lib/axios/cjs/contract/types.js.map +1 -1
- package/lib/axios/cjs/gateway/gateway_axios_client.js +1 -1
- package/lib/axios/cjs/gateway/server_api.js.map +1 -1
- package/lib/axios/cjs/rpc/api.js.map +1 -1
- package/lib/axios/cjs/rpc/axios.js +1 -1
- package/lib/axios/cjs/rpc/server.js +32 -27
- package/lib/axios/cjs/rpc/server.js.map +1 -1
- package/lib/axios/cjs/webauth/utils.js.map +1 -1
- package/lib/axios/esm/base/contract.d.ts +4 -4
- package/lib/axios/esm/base/contract.js +2 -2
- package/lib/axios/esm/base/contract.js.map +1 -1
- package/lib/axios/esm/base/invocation.d.ts +2 -2
- package/lib/axios/esm/base/invocation.js.map +1 -1
- package/lib/axios/esm/base/numbers/sc_int.d.ts +2 -2
- package/lib/axios/esm/base/numbers/sc_int.js +1 -1
- package/lib/axios/esm/base/numbers/sc_int.js.map +1 -1
- package/lib/axios/esm/base/operation.d.ts +2 -2
- package/lib/axios/esm/base/operation.js +2 -2
- package/lib/axios/esm/base/operation.js.map +1 -1
- package/lib/axios/esm/base/operations/index.d.ts +1 -1
- package/lib/axios/esm/base/operations/invoke_host_function.d.ts +5 -5
- package/lib/axios/esm/base/operations/invoke_host_function.js +2 -2
- package/lib/axios/esm/base/operations/invoke_host_function.js.map +1 -1
- package/lib/axios/esm/base/operations/revoke_sponsorship.d.ts +1 -1
- package/lib/axios/esm/base/operations/revoke_sponsorship.js.map +1 -1
- package/lib/axios/esm/base/operations/types.d.ts +2 -2
- package/lib/axios/esm/bindings/config.js +4 -4
- package/lib/axios/esm/bindings/config.js.map +1 -1
- package/lib/axios/esm/bindings/generator.d.ts +7 -7
- package/lib/axios/esm/bindings/generator.js +4 -4
- package/lib/axios/esm/bindings/generator.js.map +1 -1
- package/lib/axios/esm/bindings/types.d.ts +1 -1
- package/lib/axios/esm/bindings/types.js.map +1 -1
- package/lib/axios/esm/bindings/utils.d.ts +4 -4
- package/lib/axios/esm/bindings/utils.js +2 -2
- package/lib/axios/esm/bindings/utils.js.map +1 -1
- package/lib/axios/esm/bindings/wasm_fetcher.js +2 -2
- package/lib/axios/esm/bindings/wasm_fetcher.js.map +1 -1
- package/lib/axios/esm/contract/assembled_transaction.d.ts +1 -1
- package/lib/axios/esm/contract/assembled_transaction.js.map +1 -1
- package/lib/axios/esm/contract/spec.js +1 -1
- package/lib/axios/esm/contract/spec.js.map +1 -1
- package/lib/axios/esm/contract/types.d.ts +2 -2
- package/lib/axios/esm/contract/types.js.map +1 -1
- package/lib/axios/esm/gateway/gateway_axios_client.js +1 -1
- package/lib/axios/esm/gateway/server_api.d.ts +2 -2
- package/lib/axios/esm/gateway/server_api.js.map +1 -1
- package/lib/axios/esm/rpc/api.d.ts +1 -1
- package/lib/axios/esm/rpc/api.js.map +1 -1
- package/lib/axios/esm/rpc/axios.js +1 -1
- package/lib/axios/esm/rpc/browser.d.ts +1 -1
- package/lib/axios/esm/rpc/server.d.ts +26 -26
- package/lib/axios/esm/rpc/server.js +32 -27
- package/lib/axios/esm/rpc/server.js.map +1 -1
- package/lib/axios/esm/webauth/utils.d.ts +2 -2
- package/lib/axios/esm/webauth/utils.js.map +1 -1
- package/lib/cjs/base/contract.js +2 -2
- package/lib/cjs/base/contract.js.map +1 -1
- package/lib/cjs/base/invocation.js.map +1 -1
- package/lib/cjs/base/numbers/sc_int.js +1 -1
- package/lib/cjs/base/numbers/sc_int.js.map +1 -1
- package/lib/cjs/base/operation.js +1 -1
- package/lib/cjs/base/operation.js.map +1 -1
- package/lib/cjs/base/operations/invoke_host_function.js +2 -2
- package/lib/cjs/base/operations/invoke_host_function.js.map +1 -1
- package/lib/cjs/base/operations/revoke_sponsorship.js.map +1 -1
- package/lib/cjs/bindings/config.js +4 -4
- package/lib/cjs/bindings/config.js.map +1 -1
- package/lib/cjs/bindings/generator.js +4 -4
- package/lib/cjs/bindings/generator.js.map +1 -1
- package/lib/cjs/bindings/types.js.map +1 -1
- package/lib/cjs/bindings/utils.js +2 -2
- package/lib/cjs/bindings/utils.js.map +1 -1
- package/lib/cjs/bindings/wasm_fetcher.js +2 -2
- package/lib/cjs/bindings/wasm_fetcher.js.map +1 -1
- package/lib/cjs/contract/assembled_transaction.js.map +1 -1
- package/lib/cjs/contract/spec.js +1 -1
- package/lib/cjs/contract/spec.js.map +1 -1
- package/lib/cjs/contract/types.js.map +1 -1
- package/lib/cjs/gateway/gateway_axios_client.js +1 -1
- package/lib/cjs/gateway/server_api.js.map +1 -1
- package/lib/cjs/rpc/api.js.map +1 -1
- package/lib/cjs/rpc/axios.js +1 -1
- package/lib/cjs/rpc/server.js +32 -27
- package/lib/cjs/rpc/server.js.map +1 -1
- package/lib/cjs/webauth/utils.js.map +1 -1
- package/lib/esm/base/contract.d.ts +4 -4
- package/lib/esm/base/contract.js +2 -2
- package/lib/esm/base/contract.js.map +1 -1
- package/lib/esm/base/invocation.d.ts +2 -2
- package/lib/esm/base/invocation.js.map +1 -1
- package/lib/esm/base/numbers/sc_int.d.ts +2 -2
- package/lib/esm/base/numbers/sc_int.js +1 -1
- package/lib/esm/base/numbers/sc_int.js.map +1 -1
- package/lib/esm/base/operation.d.ts +2 -2
- package/lib/esm/base/operation.js +2 -2
- package/lib/esm/base/operation.js.map +1 -1
- package/lib/esm/base/operations/index.d.ts +1 -1
- package/lib/esm/base/operations/invoke_host_function.d.ts +5 -5
- package/lib/esm/base/operations/invoke_host_function.js +2 -2
- package/lib/esm/base/operations/invoke_host_function.js.map +1 -1
- package/lib/esm/base/operations/revoke_sponsorship.d.ts +1 -1
- package/lib/esm/base/operations/revoke_sponsorship.js.map +1 -1
- package/lib/esm/base/operations/types.d.ts +2 -2
- package/lib/esm/bindings/config.js +4 -4
- package/lib/esm/bindings/config.js.map +1 -1
- package/lib/esm/bindings/generator.d.ts +7 -7
- package/lib/esm/bindings/generator.js +4 -4
- package/lib/esm/bindings/generator.js.map +1 -1
- package/lib/esm/bindings/types.d.ts +1 -1
- package/lib/esm/bindings/types.js.map +1 -1
- package/lib/esm/bindings/utils.d.ts +4 -4
- package/lib/esm/bindings/utils.js +2 -2
- package/lib/esm/bindings/utils.js.map +1 -1
- package/lib/esm/bindings/wasm_fetcher.js +2 -2
- package/lib/esm/bindings/wasm_fetcher.js.map +1 -1
- package/lib/esm/contract/assembled_transaction.d.ts +1 -1
- package/lib/esm/contract/assembled_transaction.js.map +1 -1
- package/lib/esm/contract/spec.js +1 -1
- package/lib/esm/contract/spec.js.map +1 -1
- package/lib/esm/contract/types.d.ts +2 -2
- package/lib/esm/contract/types.js.map +1 -1
- package/lib/esm/gateway/gateway_axios_client.js +1 -1
- package/lib/esm/gateway/server_api.d.ts +2 -2
- package/lib/esm/gateway/server_api.js.map +1 -1
- package/lib/esm/rpc/api.d.ts +1 -1
- package/lib/esm/rpc/api.js.map +1 -1
- package/lib/esm/rpc/axios.js +1 -1
- package/lib/esm/rpc/browser.d.ts +1 -1
- package/lib/esm/rpc/server.d.ts +26 -26
- package/lib/esm/rpc/server.js +32 -27
- package/lib/esm/rpc/server.js.map +1 -1
- package/lib/esm/webauth/utils.d.ts +2 -2
- package/lib/esm/webauth/utils.js.map +1 -1
- package/package.json +41 -39
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation.js","sources":["../../../src/base/operation.ts"],"sourcesContent":["import { Asset } from \"./asset.js\";\nimport { LiquidityPoolAsset } from \"./liquidity_pool_asset.js\";\nimport { Claimant } from \"./claimant.js\";\nimport { StrKey } from \"./strkey.js\";\nimport { LiquidityPoolId } from \"./liquidity_pool_id.js\";\nimport xdr from \"./xdr.js\";\n\nimport { trimEnd } from \"./util/util.js\";\nimport { encodeMuxedAccountToAddress } from \"./util/decode_encode_muxed_account.js\";\n\nimport * as ops from \"./operations/index.js\";\nimport type {\n OperationRecord,\n OperationType as _OperationType,\n BaseOperation as _BaseOperation,\n CreateAccountResult,\n PaymentResult,\n PathPaymentStrictReceiveResult,\n PathPaymentStrictSendResult,\n CreatePassiveSellOfferResult,\n ManageSellOfferResult,\n ManageBuyOfferResult,\n SetOptionsResult,\n ChangeTrustResult,\n AllowTrustResult,\n AccountMergeResult,\n InflationResult,\n ManageDataResult,\n BumpSequenceResult,\n CreateClaimableBalanceResult,\n ClaimClaimableBalanceResult,\n BeginSponsoringFutureReservesResult,\n EndSponsoringFutureReservesResult,\n RevokeAccountSponsorshipResult,\n RevokeTrustlineSponsorshipResult,\n RevokeOfferSponsorshipResult,\n RevokeDataSponsorshipResult,\n RevokeClaimableBalanceSponsorshipResult,\n RevokeLiquidityPoolSponsorshipResult,\n RevokeSignerSponsorshipResult,\n ClawbackResult,\n ClawbackClaimableBalanceResult,\n SetTrustLineFlagsResult,\n LiquidityPoolDepositResult,\n LiquidityPoolWithdrawResult,\n InvokeHostFunctionResult,\n ExtendFootprintTTLResult,\n RestoreFootprintResult,\n Signer,\n} from \"./operations/types.js\";\nimport { fromXDRAmount, fromXDRPrice } from \"./util/operations.js\";\n\n/**\n * When set using `{@link Operation.setOptions}` option, requires the issuing\n * account to give other accounts permission before they can hold the issuing\n * account’s credit.\n *\n * @see [Account flags](https://docs.digitalworld.global/docs/glossary/accounts/#flags)\n */\nexport const AuthRequiredFlag = 1 << 0;\n/**\n * When set using `{@link Operation.setOptions}` option, allows the issuing\n * account to revoke its credit held by other accounts.\n *\n * @see [Account flags](https://docs.digitalworld.global/docs/glossary/accounts/#flags)\n */\nexport const AuthRevocableFlag = 1 << 1;\n/**\n * When set using `{@link Operation.setOptions}` option, then none of the\n * authorization flags can be set and the account can never be deleted.\n *\n * @see [Account flags](https://docs.digitalworld.global/docs/glossary/accounts/#flags)\n */\nexport const AuthImmutableFlag = 1 << 2;\n\n/**\n * When set using `{@link Operation.setOptions}` option, then any trustlines\n * created by this account can have a ClawbackOp operation submitted for the\n * corresponding asset.\n *\n * @see [Account flags](https://docs.digitalworld.global/docs/glossary/accounts/#flags)\n */\nexport const AuthClawbackEnabledFlag = 1 << 3;\n\n/**\n * `Operation` class represents\n * [operations](https://docs.digitalworld.global/docs/glossary/operations/) in\n * Digital World Network.\n *\n * Use one of static methods to create operations:\n * * `{@link Operation.createAccount}`\n * * `{@link Operation.payment}`\n * * `{@link Operation.pathPaymentStrictReceive}`\n * * `{@link Operation.pathPaymentStrictSend}`\n * * `{@link Operation.manageSellOffer}`\n * * `{@link Operation.manageBuyOffer}`\n * * `{@link Operation.createPassiveSellOffer}`\n * * `{@link Operation.setOptions}`\n * * `{@link Operation.changeTrust}`\n * * `{@link Operation.allowTrust}`\n * * `{@link Operation.accountMerge}`\n * * `{@link Operation.inflation}`\n * * `{@link Operation.manageData}`\n * * `{@link Operation.bumpSequence}`\n * * `{@link Operation.createClaimableBalance}`\n * * `{@link Operation.claimClaimableBalance}`\n * * `{@link Operation.beginSponsoringFutureReserves}`\n * * `{@link Operation.endSponsoringFutureReserves}`\n * * `{@link Operation.revokeAccountSponsorship}`\n * * `{@link Operation.revokeTrustlineSponsorship}`\n * * `{@link Operation.revokeOfferSponsorship}`\n * * `{@link Operation.revokeDataSponsorship}`\n * * `{@link Operation.revokeClaimableBalanceSponsorship}`\n * * `{@link Operation.revokeLiquidityPoolSponsorship}`\n * * `{@link Operation.revokeSignerSponsorship}`\n * * `{@link Operation.clawback}`\n * * `{@link Operation.clawbackClaimableBalance}`\n * * `{@link Operation.setTrustLineFlags}`\n * * `{@link Operation.liquidityPoolDeposit}`\n * * `{@link Operation.liquidityPoolWithdraw}`\n * * `{@link Operation.invokeHostFunction}`, which has the following additional\n * \"pseudo-operations\" that make building host functions easier:\n * - `{@link Operation.createStellarAssetContract}`\n * - `{@link Operation.invokeContractFunction}`\n * - `{@link Operation.createCustomContract}`\n * - `{@link Operation.uploadContractWasm}`\n * * `{@link Operation.extendFootprintTtlOp}`\n * * `{@link Operation.restoreFootprint}`\n *\n */\nexport class Operation {\n /**\n * Deconstructs the raw XDR operation object into the structured object that\n * was used to create the operation (i.e. the `opts` parameter to most ops).\n *\n * @param operation - An XDR Operation.\n */\n\n static fromXDRObject<T extends OperationRecord = OperationRecord>(\n operation: xdr.Operation<T>,\n ): T {\n const result: Record<string, unknown> = {};\n const sourceAccount = operation.sourceAccount();\n\n if (sourceAccount) {\n result.source = encodeMuxedAccountToAddress(sourceAccount);\n }\n\n const attrs: any = operation.body().value();\n const operationName: string = operation.body().switch().name;\n\n switch (operationName) {\n case \"createAccount\": {\n result.type = \"createAccount\";\n result.destination = accountIdtoAddress(attrs.destination());\n result.startingBalance = fromXDRAmount(attrs.startingBalance());\n break;\n }\n case \"payment\": {\n result.type = \"payment\";\n result.destination = encodeMuxedAccountToAddress(attrs.destination());\n result.asset = Asset.fromOperation(attrs.asset());\n result.amount = fromXDRAmount(attrs.amount());\n break;\n }\n case \"pathPaymentStrictReceive\": {\n result.type = \"pathPaymentStrictReceive\";\n result.sendAsset = Asset.fromOperation(attrs.sendAsset());\n result.sendMax = fromXDRAmount(attrs.sendMax());\n result.destination = encodeMuxedAccountToAddress(attrs.destination());\n result.destAsset = Asset.fromOperation(attrs.destAsset());\n result.destAmount = fromXDRAmount(attrs.destAmount());\n result.path = [];\n\n const path = attrs.path();\n\n Object.keys(path).forEach((pathKey) => {\n (result.path as Asset[]).push(Asset.fromOperation(path[pathKey]));\n });\n break;\n }\n case \"pathPaymentStrictSend\": {\n result.type = \"pathPaymentStrictSend\";\n result.sendAsset = Asset.fromOperation(attrs.sendAsset());\n result.sendAmount = fromXDRAmount(attrs.sendAmount());\n result.destination = encodeMuxedAccountToAddress(attrs.destination());\n result.destAsset = Asset.fromOperation(attrs.destAsset());\n result.destMin = fromXDRAmount(attrs.destMin());\n result.path = [];\n\n const path = attrs.path();\n\n Object.keys(path).forEach((pathKey) => {\n (result.path as Asset[]).push(Asset.fromOperation(path[pathKey]));\n });\n break;\n }\n case \"changeTrust\": {\n result.type = \"changeTrust\";\n\n switch (attrs.line().switch()) {\n case xdr.AssetType.assetTypePoolShare():\n result.line = LiquidityPoolAsset.fromOperation(attrs.line());\n break;\n default:\n result.line = Asset.fromOperation(attrs.line());\n break;\n }\n\n result.limit = fromXDRAmount(attrs.limit());\n break;\n }\n case \"allowTrust\": {\n result.type = \"allowTrust\";\n result.trustor = accountIdtoAddress(attrs.trustor());\n result.assetCode = attrs.asset().value().toString();\n result.assetCode = trimEnd(result.assetCode as string, \"\\0\");\n result.authorize = attrs.authorize();\n break;\n }\n case \"setOptions\": {\n result.type = \"setOptions\";\n\n if (attrs.inflationDest()) {\n result.inflationDest = accountIdtoAddress(attrs.inflationDest());\n }\n\n result.clearFlags = attrs.clearFlags();\n result.setFlags = attrs.setFlags();\n result.masterWeight = attrs.masterWeight();\n result.lowThreshold = attrs.lowThreshold();\n result.medThreshold = attrs.medThreshold();\n result.highThreshold = attrs.highThreshold();\n // home_domain is checked by iscntrl in stellar-core\n result.homeDomain =\n attrs.homeDomain() !== undefined\n ? attrs.homeDomain().toString(\"ascii\")\n : undefined;\n\n if (attrs.signer()) {\n const signer: Record<string, unknown> = {};\n const arm = attrs.signer().key().arm();\n\n if (arm === \"ed25519\") {\n signer.ed25519PublicKey = accountIdtoAddress(attrs.signer().key());\n } else if (arm === \"preAuthTx\") {\n signer.preAuthTx = attrs.signer().key().preAuthTx();\n } else if (arm === \"hashX\") {\n signer.sha256Hash = attrs.signer().key().hashX();\n } else if (arm === \"ed25519SignedPayload\") {\n const signedPayload = attrs.signer().key().ed25519SignedPayload();\n signer.ed25519SignedPayload = StrKey.encodeSignedPayload(\n signedPayload.toXDR(),\n );\n }\n\n signer.weight = attrs.signer().weight();\n result.signer = signer;\n }\n break;\n }\n // the next case intentionally falls through!\n case \"manageOffer\":\n case \"manageSellOffer\": {\n result.type = \"manageSellOffer\";\n result.selling = Asset.fromOperation(attrs.selling());\n result.buying = Asset.fromOperation(attrs.buying());\n result.amount = fromXDRAmount(attrs.amount());\n result.price = fromXDRPrice(attrs.price());\n result.offerId = attrs.offerId().toString();\n break;\n }\n case \"manageBuyOffer\": {\n result.type = \"manageBuyOffer\";\n result.selling = Asset.fromOperation(attrs.selling());\n result.buying = Asset.fromOperation(attrs.buying());\n result.buyAmount = fromXDRAmount(attrs.buyAmount());\n result.price = fromXDRPrice(attrs.price());\n result.offerId = attrs.offerId().toString();\n break;\n }\n // the next case intentionally falls through!\n case \"createPassiveOffer\":\n case \"createPassiveSellOffer\": {\n result.type = \"createPassiveSellOffer\";\n result.selling = Asset.fromOperation(attrs.selling());\n result.buying = Asset.fromOperation(attrs.buying());\n result.amount = fromXDRAmount(attrs.amount());\n result.price = fromXDRPrice(attrs.price());\n break;\n }\n case \"accountMerge\": {\n result.type = \"accountMerge\";\n result.destination = encodeMuxedAccountToAddress(attrs);\n break;\n }\n case \"manageData\": {\n result.type = \"manageData\";\n // manage_data.name is checked by iscntrl in stellar-core\n result.name = attrs.dataName().toString(\"ascii\");\n result.value = attrs.dataValue();\n break;\n }\n case \"inflation\": {\n result.type = \"inflation\";\n break;\n }\n case \"bumpSequence\": {\n result.type = \"bumpSequence\";\n result.bumpTo = attrs.bumpTo().toString();\n break;\n }\n case \"createClaimableBalance\": {\n result.type = \"createClaimableBalance\";\n result.asset = Asset.fromOperation(attrs.asset());\n result.amount = fromXDRAmount(attrs.amount());\n result.claimants = [];\n\n attrs.claimants().forEach((claimant: xdr.Claimant) => {\n (result.claimants as Claimant[]).push(Claimant.fromXDR(claimant));\n });\n break;\n }\n case \"claimClaimableBalance\": {\n result.type = \"claimClaimableBalance\";\n result.balanceId = attrs.toXDR(\"hex\");\n break;\n }\n case \"beginSponsoringFutureReserves\": {\n result.type = \"beginSponsoringFutureReserves\";\n result.sponsoredId = accountIdtoAddress(attrs.sponsoredId());\n break;\n }\n case \"endSponsoringFutureReserves\": {\n result.type = \"endSponsoringFutureReserves\";\n break;\n }\n case \"revokeSponsorship\": {\n extractRevokeSponshipDetails(attrs, result);\n break;\n }\n case \"clawback\": {\n result.type = \"clawback\";\n result.amount = fromXDRAmount(attrs.amount());\n result.from = encodeMuxedAccountToAddress(attrs.from());\n result.asset = Asset.fromOperation(attrs.asset());\n break;\n }\n case \"clawbackClaimableBalance\": {\n result.type = \"clawbackClaimableBalance\";\n result.balanceId = attrs.toXDR(\"hex\");\n break;\n }\n case \"setTrustLineFlags\": {\n result.type = \"setTrustLineFlags\";\n result.asset = Asset.fromOperation(attrs.asset());\n result.trustor = accountIdtoAddress(attrs.trustor());\n\n // Convert from the integer-bitwised flag into a sensible object that\n // indicates true/false for each flag that's on/off.\n const clears = attrs.clearFlags();\n const sets = attrs.setFlags();\n\n const mapping: Record<string, xdr.TrustLineFlags> = {\n authorized: xdr.TrustLineFlags.authorizedFlag(),\n authorizedToMaintainLiabilities:\n xdr.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),\n clawbackEnabled: xdr.TrustLineFlags.trustlineClawbackEnabledFlag(),\n };\n\n const getFlagValue = (key: string) => {\n const bit = mapping[key]?.value ?? 0;\n\n if (sets & bit) {\n return true;\n }\n\n if (clears & bit) {\n return false;\n }\n\n return undefined;\n };\n\n const flags: Record<string, boolean | undefined> = {};\n\n Object.keys(mapping).forEach((flagName) => {\n flags[flagName] = getFlagValue(flagName);\n });\n\n result.flags = flags;\n\n break;\n }\n case \"liquidityPoolDeposit\": {\n result.type = \"liquidityPoolDeposit\";\n result.liquidityPoolId = attrs.liquidityPoolId().toString(\"hex\");\n result.maxAmountA = fromXDRAmount(attrs.maxAmountA());\n result.maxAmountB = fromXDRAmount(attrs.maxAmountB());\n result.minPrice = fromXDRPrice(attrs.minPrice());\n result.maxPrice = fromXDRPrice(attrs.maxPrice());\n break;\n }\n case \"liquidityPoolWithdraw\": {\n result.type = \"liquidityPoolWithdraw\";\n result.liquidityPoolId = attrs.liquidityPoolId().toString(\"hex\");\n result.amount = fromXDRAmount(attrs.amount());\n result.minAmountA = fromXDRAmount(attrs.minAmountA());\n result.minAmountB = fromXDRAmount(attrs.minAmountB());\n break;\n }\n case \"invokeHostFunction\": {\n result.type = \"invokeHostFunction\";\n result.func = attrs.hostFunction();\n result.auth = attrs.auth() ?? [];\n break;\n }\n case \"extendFootprintTtl\": {\n result.type = \"extendFootprintTtl\";\n result.extendTo = attrs.extendTo();\n break;\n }\n case \"restoreFootprint\": {\n result.type = \"restoreFootprint\";\n break;\n }\n default: {\n throw new Error(`Unknown operation: ${operationName}`);\n }\n }\n\n return result as unknown as T;\n }\n\n // Attach all imported operations as static methods on the Operation class\n static accountMerge = ops.accountMerge;\n static allowTrust = ops.allowTrust;\n static bumpSequence = ops.bumpSequence;\n static changeTrust = ops.changeTrust;\n static createAccount = ops.createAccount;\n static createClaimableBalance = ops.createClaimableBalance;\n static claimClaimableBalance = ops.claimClaimableBalance;\n static clawbackClaimableBalance = ops.clawbackClaimableBalance;\n static createPassiveSellOffer = ops.createPassiveSellOffer;\n static inflation = ops.inflation;\n static manageData = ops.manageData;\n static manageSellOffer = ops.manageSellOffer;\n static manageBuyOffer = ops.manageBuyOffer;\n static pathPaymentStrictReceive = ops.pathPaymentStrictReceive;\n static pathPaymentStrictSend = ops.pathPaymentStrictSend;\n static payment = ops.payment;\n static setOptions = ops.setOptions;\n static beginSponsoringFutureReserves = ops.beginSponsoringFutureReserves;\n static endSponsoringFutureReserves = ops.endSponsoringFutureReserves;\n static revokeAccountSponsorship = ops.revokeAccountSponsorship;\n static revokeTrustlineSponsorship = ops.revokeTrustlineSponsorship;\n static revokeOfferSponsorship = ops.revokeOfferSponsorship;\n static revokeDataSponsorship = ops.revokeDataSponsorship;\n static revokeClaimableBalanceSponsorship =\n ops.revokeClaimableBalanceSponsorship;\n static revokeLiquidityPoolSponsorship = ops.revokeLiquidityPoolSponsorship;\n static revokeSignerSponsorship = ops.revokeSignerSponsorship;\n static clawback = ops.clawback;\n static setTrustLineFlags = ops.setTrustLineFlags;\n static liquidityPoolDeposit = ops.liquidityPoolDeposit;\n static liquidityPoolWithdraw = ops.liquidityPoolWithdraw;\n static invokeHostFunction = ops.invokeHostFunction;\n static extendFootprintTtl = ops.extendFootprintTtl;\n static restoreFootprint = ops.restoreFootprint;\n\n // These are not `xdr.Operation`s directly, but proxies for common\n // versions of `Operation.invokeHostFunction`\n static createStellarAssetContract = ops.createStellarAssetContract;\n static invokeContractFunction = ops.invokeContractFunction;\n static createCustomContract = ops.createCustomContract;\n static uploadContractWasm = ops.uploadContractWasm;\n}\n\nfunction extractRevokeSponshipDetails(\n attrs: any,\n result: Record<string, unknown>,\n) {\n switch (attrs.switch().name) {\n case \"revokeSponsorshipLedgerEntry\": {\n const ledgerKey = attrs.ledgerKey();\n\n switch (ledgerKey.switch().name) {\n case xdr.LedgerEntryType.account().name: {\n result.type = \"revokeAccountSponsorship\";\n result.account = accountIdtoAddress(ledgerKey.account().accountId());\n break;\n }\n case xdr.LedgerEntryType.trustline().name: {\n result.type = \"revokeTrustlineSponsorship\";\n result.account = accountIdtoAddress(\n ledgerKey.trustLine().accountId(),\n );\n const xdrAsset = ledgerKey.trustLine().asset();\n switch (xdrAsset.switch()) {\n case xdr.AssetType.assetTypePoolShare():\n result.asset = LiquidityPoolId.fromOperation(xdrAsset);\n break;\n default:\n result.asset = Asset.fromOperation(xdrAsset);\n break;\n }\n break;\n }\n case xdr.LedgerEntryType.offer().name: {\n result.type = \"revokeOfferSponsorship\";\n result.seller = accountIdtoAddress(ledgerKey.offer().sellerId());\n result.offerId = ledgerKey.offer().offerId().toString();\n break;\n }\n case xdr.LedgerEntryType.data().name: {\n result.type = \"revokeDataSponsorship\";\n result.account = accountIdtoAddress(ledgerKey.data().accountId());\n result.name = ledgerKey.data().dataName().toString(\"ascii\");\n break;\n }\n case xdr.LedgerEntryType.claimableBalance().name: {\n result.type = \"revokeClaimableBalanceSponsorship\";\n result.balanceId = ledgerKey\n .claimableBalance()\n .balanceId()\n .toXDR(\"hex\");\n break;\n }\n case xdr.LedgerEntryType.liquidityPool().name: {\n result.type = \"revokeLiquidityPoolSponsorship\";\n result.liquidityPoolId = ledgerKey\n .liquidityPool()\n .liquidityPoolId()\n .toString(\"hex\");\n break;\n }\n default: {\n throw new Error(`Unknown ledgerKey: ${attrs.switch().name}`);\n }\n }\n break;\n }\n case \"revokeSponsorshipSigner\": {\n result.type = \"revokeSignerSponsorship\";\n result.account = accountIdtoAddress(attrs.signer().accountId());\n result.signer = convertXDRSignerKeyToObject(attrs.signer().signerKey());\n break;\n }\n default: {\n throw new Error(`Unknown revokeSponsorship: ${attrs.switch().name}`);\n }\n }\n}\n\nfunction convertXDRSignerKeyToObject(\n signerKey: xdr.SignerKey,\n): Record<string, unknown> {\n const attrs: Record<string, unknown> = {};\n\n switch (signerKey.switch().name) {\n case xdr.SignerKeyType.signerKeyTypeEd25519().name: {\n attrs.ed25519PublicKey = StrKey.encodeEd25519PublicKey(\n signerKey.ed25519(),\n );\n break;\n }\n case xdr.SignerKeyType.signerKeyTypePreAuthTx().name: {\n attrs.preAuthTx = signerKey.preAuthTx().toString(\"hex\");\n break;\n }\n case xdr.SignerKeyType.signerKeyTypeHashX().name: {\n attrs.sha256Hash = signerKey.hashX().toString(\"hex\");\n break;\n }\n case xdr.SignerKeyType.signerKeyTypeEd25519SignedPayload().name: {\n const signedPayload = signerKey.ed25519SignedPayload();\n\n attrs.ed25519SignedPayload = StrKey.encodeSignedPayload(\n signedPayload.toXDR(),\n );\n break;\n }\n default: {\n throw new Error(`Unknown signerKey: ${signerKey.switch().name}`);\n }\n }\n\n return attrs;\n}\n\nfunction accountIdtoAddress(accountId: xdr.AccountId): string {\n return StrKey.encodeEd25519PublicKey(accountId.ed25519());\n}\n\n// Namespace merged with the Operation class to expose operation result types as\n// `Operation.CreateAccount`, `Operation.Payment`, etc. — matching the public API\n// declared in types/index.d.ts.\n// The static methods (e.g. Operation.createAccount) are defined on the class above.\n\nexport namespace Operation {\n export type BaseOperation<T extends _OperationType = _OperationType> =\n _BaseOperation<T>;\n export type CreateAccount = CreateAccountResult;\n export type Payment = PaymentResult;\n export type PathPaymentStrictReceive = PathPaymentStrictReceiveResult;\n export type PathPaymentStrictSend = PathPaymentStrictSendResult;\n export type CreatePassiveSellOffer = CreatePassiveSellOfferResult;\n export type ManageSellOffer = ManageSellOfferResult;\n export type ManageBuyOffer = ManageBuyOfferResult;\n export type SetOptions = SetOptionsResult<Signer>;\n export type ChangeTrust = ChangeTrustResult;\n export type AllowTrust = AllowTrustResult;\n export type AccountMerge = AccountMergeResult;\n export type Inflation = InflationResult;\n export type ManageData = ManageDataResult;\n export type BumpSequence = BumpSequenceResult;\n export type CreateClaimableBalance = CreateClaimableBalanceResult;\n export type ClaimClaimableBalance = ClaimClaimableBalanceResult;\n export type BeginSponsoringFutureReserves =\n BeginSponsoringFutureReservesResult;\n export type EndSponsoringFutureReserves = EndSponsoringFutureReservesResult;\n export type RevokeAccountSponsorship = RevokeAccountSponsorshipResult;\n export type RevokeTrustlineSponsorship = RevokeTrustlineSponsorshipResult;\n export type RevokeOfferSponsorship = RevokeOfferSponsorshipResult;\n export type RevokeDataSponsorship = RevokeDataSponsorshipResult;\n export type RevokeClaimableBalanceSponsorship =\n RevokeClaimableBalanceSponsorshipResult;\n export type RevokeLiquidityPoolSponsorship =\n RevokeLiquidityPoolSponsorshipResult;\n export type RevokeSignerSponsorship = RevokeSignerSponsorshipResult;\n export type Clawback = ClawbackResult;\n export type ClawbackClaimableBalance = ClawbackClaimableBalanceResult;\n export type SetTrustLineFlags = SetTrustLineFlagsResult;\n export type LiquidityPoolDeposit = LiquidityPoolDepositResult;\n export type LiquidityPoolWithdraw = LiquidityPoolWithdrawResult;\n export type InvokeHostFunction = InvokeHostFunctionResult;\n export type ExtendFootprintTTL = ExtendFootprintTTLResult;\n export type RestoreFootprint = RestoreFootprintResult;\n}\n"],"names":["encodeMuxedAccountToAddress","fromXDRAmount","Asset","xdr","LiquidityPoolAsset","trimEnd","StrKey","fromXDRPrice","claimant","Claimant","ops.accountMerge","ops.allowTrust","ops.bumpSequence","ops.changeTrust","ops.createAccount","ops.createClaimableBalance","ops.claimClaimableBalance","ops.clawbackClaimableBalance","ops.createPassiveSellOffer","ops.inflation","ops.manageData","ops.manageSellOffer","ops.manageBuyOffer","ops.pathPaymentStrictReceive","ops.pathPaymentStrictSend","ops.payment","ops.setOptions","ops.beginSponsoringFutureReserves","ops.endSponsoringFutureReserves","ops.revokeAccountSponsorship","ops.revokeTrustlineSponsorship","ops.revokeOfferSponsorship","ops.revokeDataSponsorship","ops.revokeClaimableBalanceSponsorship","ops.revokeLiquidityPoolSponsorship","ops.revokeSignerSponsorship","ops.clawback","ops.setTrustLineFlags","ops.liquidityPoolDeposit","ops.liquidityPoolWithdraw","ops.invokeHostFunction","ops.extendFootprintTtl","ops.restoreFootprint","ops.createStellarAssetContract","ops.invokeContractFunction","ops.createCustomContract","ops.uploadContractWasm","LiquidityPoolId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DO,MAAM,mBAAmB,CAAA,IAAK;AAO9B,MAAM,oBAAoB,CAAA,IAAK;AAO/B,MAAM,oBAAoB,CAAA,IAAK;AAS/B,MAAM,0BAA0B,CAAA,IAAK;AAgDrC,MAAM,SAAA,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQrB,OAAO,cACL,SAAA,EACG;AACH,IAAA,MAAM,SAAkC,EAAC;AACzC,IAAA,MAAM,aAAA,GAAgB,UAAU,aAAA,EAAc;AAE9C,IAAA,IAAI,aAAA,EAAe;AACjB,MAAA,MAAA,CAAO,MAAA,GAASA,wDAA4B,aAAa,CAAA;AAAA,IAC3D;AAEA,IAAA,MAAM,KAAA,GAAa,SAAA,CAAU,IAAA,EAAK,CAAE,KAAA,EAAM;AAC1C,IAAA,MAAM,aAAA,GAAwB,SAAA,CAAU,IAAA,EAAK,CAAE,QAAO,CAAE,IAAA;AAExD,IAAA,QAAQ,aAAA;AAAe,MACrB,KAAK,eAAA,EAAiB;AACpB,QAAA,MAAA,CAAO,IAAA,GAAO,eAAA;AACd,QAAA,MAAA,CAAO,WAAA,GAAc,kBAAA,CAAmB,KAAA,CAAM,WAAA,EAAa,CAAA;AAC3D,QAAA,MAAA,CAAO,eAAA,GAAkBC,wBAAA,CAAc,KAAA,CAAM,eAAA,EAAiB,CAAA;AAC9D,QAAA;AAAA,MACF;AAAA,MACA,KAAK,SAAA,EAAW;AACd,QAAA,MAAA,CA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AAA;AAC1D;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"operation.js","sources":["../../../src/base/operation.ts"],"sourcesContent":["import { Asset } from \"./asset.js\";\nimport { LiquidityPoolAsset } from \"./liquidity_pool_asset.js\";\nimport { Claimant } from \"./claimant.js\";\nimport { StrKey } from \"./strkey.js\";\nimport { LiquidityPoolId } from \"./liquidity_pool_id.js\";\nimport xdr from \"./xdr.js\";\n\nimport { trimEnd } from \"./util/util.js\";\nimport { encodeMuxedAccountToAddress } from \"./util/decode_encode_muxed_account.js\";\n\nimport * as ops from \"./operations/index.js\";\nimport type {\n OperationRecord,\n OperationType as _OperationType,\n BaseOperation as _BaseOperation,\n CreateAccountResult,\n PaymentResult,\n PathPaymentStrictReceiveResult,\n PathPaymentStrictSendResult,\n CreatePassiveSellOfferResult,\n ManageSellOfferResult,\n ManageBuyOfferResult,\n SetOptionsResult,\n ChangeTrustResult,\n AllowTrustResult,\n AccountMergeResult,\n InflationResult,\n ManageDataResult,\n BumpSequenceResult,\n CreateClaimableBalanceResult,\n ClaimClaimableBalanceResult,\n BeginSponsoringFutureReservesResult,\n EndSponsoringFutureReservesResult,\n RevokeAccountSponsorshipResult,\n RevokeTrustlineSponsorshipResult,\n RevokeOfferSponsorshipResult,\n RevokeDataSponsorshipResult,\n RevokeClaimableBalanceSponsorshipResult,\n RevokeLiquidityPoolSponsorshipResult,\n RevokeSignerSponsorshipResult,\n ClawbackResult,\n ClawbackClaimableBalanceResult,\n SetTrustLineFlagsResult,\n LiquidityPoolDepositResult,\n LiquidityPoolWithdrawResult,\n InvokeHostFunctionResult,\n ExtendFootprintTTLResult,\n RestoreFootprintResult,\n Signer,\n} from \"./operations/types.js\";\nimport { fromXDRAmount, fromXDRPrice } from \"./util/operations.js\";\n\n/**\n * When set using `{@link Operation.setOptions}` option, requires the issuing\n * account to give other accounts permission before they can hold the issuing\n * account’s credit.\n *\n * @see [Account flags](https://docs.digitalworld.global/docs/glossary/accounts/#flags)\n */\nexport const AuthRequiredFlag = 1 << 0;\n/**\n * When set using `{@link Operation.setOptions}` option, allows the issuing\n * account to revoke its credit held by other accounts.\n *\n * @see [Account flags](https://docs.digitalworld.global/docs/glossary/accounts/#flags)\n */\nexport const AuthRevocableFlag = 1 << 1;\n/**\n * When set using `{@link Operation.setOptions}` option, then none of the\n * authorization flags can be set and the account can never be deleted.\n *\n * @see [Account flags](https://docs.digitalworld.global/docs/glossary/accounts/#flags)\n */\nexport const AuthImmutableFlag = 1 << 2;\n\n/**\n * When set using `{@link Operation.setOptions}` option, then any trustlines\n * created by this account can have a ClawbackOp operation submitted for the\n * corresponding asset.\n *\n * @see [Account flags](https://docs.digitalworld.global/docs/glossary/accounts/#flags)\n */\nexport const AuthClawbackEnabledFlag = 1 << 3;\n\n/**\n * `Operation` class represents\n * [operations](https://docs.digitalworld.global/docs/glossary/operations/) in\n * Digital World Network.\n *\n * Use one of static methods to create operations:\n * * `{@link Operation.createAccount}`\n * * `{@link Operation.payment}`\n * * `{@link Operation.pathPaymentStrictReceive}`\n * * `{@link Operation.pathPaymentStrictSend}`\n * * `{@link Operation.manageSellOffer}`\n * * `{@link Operation.manageBuyOffer}`\n * * `{@link Operation.createPassiveSellOffer}`\n * * `{@link Operation.setOptions}`\n * * `{@link Operation.changeTrust}`\n * * `{@link Operation.allowTrust}`\n * * `{@link Operation.accountMerge}`\n * * `{@link Operation.inflation}`\n * * `{@link Operation.manageData}`\n * * `{@link Operation.bumpSequence}`\n * * `{@link Operation.createClaimableBalance}`\n * * `{@link Operation.claimClaimableBalance}`\n * * `{@link Operation.beginSponsoringFutureReserves}`\n * * `{@link Operation.endSponsoringFutureReserves}`\n * * `{@link Operation.revokeAccountSponsorship}`\n * * `{@link Operation.revokeTrustlineSponsorship}`\n * * `{@link Operation.revokeOfferSponsorship}`\n * * `{@link Operation.revokeDataSponsorship}`\n * * `{@link Operation.revokeClaimableBalanceSponsorship}`\n * * `{@link Operation.revokeLiquidityPoolSponsorship}`\n * * `{@link Operation.revokeSignerSponsorship}`\n * * `{@link Operation.clawback}`\n * * `{@link Operation.clawbackClaimableBalance}`\n * * `{@link Operation.setTrustLineFlags}`\n * * `{@link Operation.liquidityPoolDeposit}`\n * * `{@link Operation.liquidityPoolWithdraw}`\n * * `{@link Operation.invokeHostFunction}`, which has the following additional\n * \"pseudo-operations\" that make building host functions easier:\n * - `{@link Operation.createDigitalWorldAssetContract}`\n * - `{@link Operation.invokeContractFunction}`\n * - `{@link Operation.createCustomContract}`\n * - `{@link Operation.uploadContractWasm}`\n * * `{@link Operation.extendFootprintTtlOp}`\n * * `{@link Operation.restoreFootprint}`\n *\n */\nexport class Operation {\n /**\n * Deconstructs the raw XDR operation object into the structured object that\n * was used to create the operation (i.e. the `opts` parameter to most ops).\n *\n * @param operation - An XDR Operation.\n */\n\n static fromXDRObject<T extends OperationRecord = OperationRecord>(\n operation: xdr.Operation<T>,\n ): T {\n const result: Record<string, unknown> = {};\n const sourceAccount = operation.sourceAccount();\n\n if (sourceAccount) {\n result.source = encodeMuxedAccountToAddress(sourceAccount);\n }\n\n const attrs: any = operation.body().value();\n const operationName: string = operation.body().switch().name;\n\n switch (operationName) {\n case \"createAccount\": {\n result.type = \"createAccount\";\n result.destination = accountIdtoAddress(attrs.destination());\n result.startingBalance = fromXDRAmount(attrs.startingBalance());\n break;\n }\n case \"payment\": {\n result.type = \"payment\";\n result.destination = encodeMuxedAccountToAddress(attrs.destination());\n result.asset = Asset.fromOperation(attrs.asset());\n result.amount = fromXDRAmount(attrs.amount());\n break;\n }\n case \"pathPaymentStrictReceive\": {\n result.type = \"pathPaymentStrictReceive\";\n result.sendAsset = Asset.fromOperation(attrs.sendAsset());\n result.sendMax = fromXDRAmount(attrs.sendMax());\n result.destination = encodeMuxedAccountToAddress(attrs.destination());\n result.destAsset = Asset.fromOperation(attrs.destAsset());\n result.destAmount = fromXDRAmount(attrs.destAmount());\n result.path = [];\n\n const path = attrs.path();\n\n Object.keys(path).forEach((pathKey) => {\n (result.path as Asset[]).push(Asset.fromOperation(path[pathKey]));\n });\n break;\n }\n case \"pathPaymentStrictSend\": {\n result.type = \"pathPaymentStrictSend\";\n result.sendAsset = Asset.fromOperation(attrs.sendAsset());\n result.sendAmount = fromXDRAmount(attrs.sendAmount());\n result.destination = encodeMuxedAccountToAddress(attrs.destination());\n result.destAsset = Asset.fromOperation(attrs.destAsset());\n result.destMin = fromXDRAmount(attrs.destMin());\n result.path = [];\n\n const path = attrs.path();\n\n Object.keys(path).forEach((pathKey) => {\n (result.path as Asset[]).push(Asset.fromOperation(path[pathKey]));\n });\n break;\n }\n case \"changeTrust\": {\n result.type = \"changeTrust\";\n\n switch (attrs.line().switch()) {\n case xdr.AssetType.assetTypePoolShare():\n result.line = LiquidityPoolAsset.fromOperation(attrs.line());\n break;\n default:\n result.line = Asset.fromOperation(attrs.line());\n break;\n }\n\n result.limit = fromXDRAmount(attrs.limit());\n break;\n }\n case \"allowTrust\": {\n result.type = \"allowTrust\";\n result.trustor = accountIdtoAddress(attrs.trustor());\n result.assetCode = attrs.asset().value().toString();\n result.assetCode = trimEnd(result.assetCode as string, \"\\0\");\n result.authorize = attrs.authorize();\n break;\n }\n case \"setOptions\": {\n result.type = \"setOptions\";\n\n if (attrs.inflationDest()) {\n result.inflationDest = accountIdtoAddress(attrs.inflationDest());\n }\n\n result.clearFlags = attrs.clearFlags();\n result.setFlags = attrs.setFlags();\n result.masterWeight = attrs.masterWeight();\n result.lowThreshold = attrs.lowThreshold();\n result.medThreshold = attrs.medThreshold();\n result.highThreshold = attrs.highThreshold();\n // home_domain is checked by iscntrl in stellar-core\n result.homeDomain =\n attrs.homeDomain() !== undefined\n ? attrs.homeDomain().toString(\"ascii\")\n : undefined;\n\n if (attrs.signer()) {\n const signer: Record<string, unknown> = {};\n const arm = attrs.signer().key().arm();\n\n if (arm === \"ed25519\") {\n signer.ed25519PublicKey = accountIdtoAddress(attrs.signer().key());\n } else if (arm === \"preAuthTx\") {\n signer.preAuthTx = attrs.signer().key().preAuthTx();\n } else if (arm === \"hashX\") {\n signer.sha256Hash = attrs.signer().key().hashX();\n } else if (arm === \"ed25519SignedPayload\") {\n const signedPayload = attrs.signer().key().ed25519SignedPayload();\n signer.ed25519SignedPayload = StrKey.encodeSignedPayload(\n signedPayload.toXDR(),\n );\n }\n\n signer.weight = attrs.signer().weight();\n result.signer = signer;\n }\n break;\n }\n // the next case intentionally falls through!\n case \"manageOffer\":\n case \"manageSellOffer\": {\n result.type = \"manageSellOffer\";\n result.selling = Asset.fromOperation(attrs.selling());\n result.buying = Asset.fromOperation(attrs.buying());\n result.amount = fromXDRAmount(attrs.amount());\n result.price = fromXDRPrice(attrs.price());\n result.offerId = attrs.offerId().toString();\n break;\n }\n case \"manageBuyOffer\": {\n result.type = \"manageBuyOffer\";\n result.selling = Asset.fromOperation(attrs.selling());\n result.buying = Asset.fromOperation(attrs.buying());\n result.buyAmount = fromXDRAmount(attrs.buyAmount());\n result.price = fromXDRPrice(attrs.price());\n result.offerId = attrs.offerId().toString();\n break;\n }\n // the next case intentionally falls through!\n case \"createPassiveOffer\":\n case \"createPassiveSellOffer\": {\n result.type = \"createPassiveSellOffer\";\n result.selling = Asset.fromOperation(attrs.selling());\n result.buying = Asset.fromOperation(attrs.buying());\n result.amount = fromXDRAmount(attrs.amount());\n result.price = fromXDRPrice(attrs.price());\n break;\n }\n case \"accountMerge\": {\n result.type = \"accountMerge\";\n result.destination = encodeMuxedAccountToAddress(attrs);\n break;\n }\n case \"manageData\": {\n result.type = \"manageData\";\n // manage_data.name is checked by iscntrl in stellar-core\n result.name = attrs.dataName().toString(\"ascii\");\n result.value = attrs.dataValue();\n break;\n }\n case \"inflation\": {\n result.type = \"inflation\";\n break;\n }\n case \"bumpSequence\": {\n result.type = \"bumpSequence\";\n result.bumpTo = attrs.bumpTo().toString();\n break;\n }\n case \"createClaimableBalance\": {\n result.type = \"createClaimableBalance\";\n result.asset = Asset.fromOperation(attrs.asset());\n result.amount = fromXDRAmount(attrs.amount());\n result.claimants = [];\n\n attrs.claimants().forEach((claimant: xdr.Claimant) => {\n (result.claimants as Claimant[]).push(Claimant.fromXDR(claimant));\n });\n break;\n }\n case \"claimClaimableBalance\": {\n result.type = \"claimClaimableBalance\";\n result.balanceId = attrs.toXDR(\"hex\");\n break;\n }\n case \"beginSponsoringFutureReserves\": {\n result.type = \"beginSponsoringFutureReserves\";\n result.sponsoredId = accountIdtoAddress(attrs.sponsoredId());\n break;\n }\n case \"endSponsoringFutureReserves\": {\n result.type = \"endSponsoringFutureReserves\";\n break;\n }\n case \"revokeSponsorship\": {\n extractRevokeSponshipDetails(attrs, result);\n break;\n }\n case \"clawback\": {\n result.type = \"clawback\";\n result.amount = fromXDRAmount(attrs.amount());\n result.from = encodeMuxedAccountToAddress(attrs.from());\n result.asset = Asset.fromOperation(attrs.asset());\n break;\n }\n case \"clawbackClaimableBalance\": {\n result.type = \"clawbackClaimableBalance\";\n result.balanceId = attrs.toXDR(\"hex\");\n break;\n }\n case \"setTrustLineFlags\": {\n result.type = \"setTrustLineFlags\";\n result.asset = Asset.fromOperation(attrs.asset());\n result.trustor = accountIdtoAddress(attrs.trustor());\n\n // Convert from the integer-bitwised flag into a sensible object that\n // indicates true/false for each flag that's on/off.\n const clears = attrs.clearFlags();\n const sets = attrs.setFlags();\n\n const mapping: Record<string, xdr.TrustLineFlags> = {\n authorized: xdr.TrustLineFlags.authorizedFlag(),\n authorizedToMaintainLiabilities:\n xdr.TrustLineFlags.authorizedToMaintainLiabilitiesFlag(),\n clawbackEnabled: xdr.TrustLineFlags.trustlineClawbackEnabledFlag(),\n };\n\n const getFlagValue = (key: string) => {\n const bit = mapping[key]?.value ?? 0;\n\n if (sets & bit) {\n return true;\n }\n\n if (clears & bit) {\n return false;\n }\n\n return undefined;\n };\n\n const flags: Record<string, boolean | undefined> = {};\n\n Object.keys(mapping).forEach((flagName) => {\n flags[flagName] = getFlagValue(flagName);\n });\n\n result.flags = flags;\n\n break;\n }\n case \"liquidityPoolDeposit\": {\n result.type = \"liquidityPoolDeposit\";\n result.liquidityPoolId = attrs.liquidityPoolId().toString(\"hex\");\n result.maxAmountA = fromXDRAmount(attrs.maxAmountA());\n result.maxAmountB = fromXDRAmount(attrs.maxAmountB());\n result.minPrice = fromXDRPrice(attrs.minPrice());\n result.maxPrice = fromXDRPrice(attrs.maxPrice());\n break;\n }\n case \"liquidityPoolWithdraw\": {\n result.type = \"liquidityPoolWithdraw\";\n result.liquidityPoolId = attrs.liquidityPoolId().toString(\"hex\");\n result.amount = fromXDRAmount(attrs.amount());\n result.minAmountA = fromXDRAmount(attrs.minAmountA());\n result.minAmountB = fromXDRAmount(attrs.minAmountB());\n break;\n }\n case \"invokeHostFunction\": {\n result.type = \"invokeHostFunction\";\n result.func = attrs.hostFunction();\n result.auth = attrs.auth() ?? [];\n break;\n }\n case \"extendFootprintTtl\": {\n result.type = \"extendFootprintTtl\";\n result.extendTo = attrs.extendTo();\n break;\n }\n case \"restoreFootprint\": {\n result.type = \"restoreFootprint\";\n break;\n }\n default: {\n throw new Error(`Unknown operation: ${operationName}`);\n }\n }\n\n return result as unknown as T;\n }\n\n // Attach all imported operations as static methods on the Operation class\n static accountMerge = ops.accountMerge;\n static allowTrust = ops.allowTrust;\n static bumpSequence = ops.bumpSequence;\n static changeTrust = ops.changeTrust;\n static createAccount = ops.createAccount;\n static createClaimableBalance = ops.createClaimableBalance;\n static claimClaimableBalance = ops.claimClaimableBalance;\n static clawbackClaimableBalance = ops.clawbackClaimableBalance;\n static createPassiveSellOffer = ops.createPassiveSellOffer;\n static inflation = ops.inflation;\n static manageData = ops.manageData;\n static manageSellOffer = ops.manageSellOffer;\n static manageBuyOffer = ops.manageBuyOffer;\n static pathPaymentStrictReceive = ops.pathPaymentStrictReceive;\n static pathPaymentStrictSend = ops.pathPaymentStrictSend;\n static payment = ops.payment;\n static setOptions = ops.setOptions;\n static beginSponsoringFutureReserves = ops.beginSponsoringFutureReserves;\n static endSponsoringFutureReserves = ops.endSponsoringFutureReserves;\n static revokeAccountSponsorship = ops.revokeAccountSponsorship;\n static revokeTrustlineSponsorship = ops.revokeTrustlineSponsorship;\n static revokeOfferSponsorship = ops.revokeOfferSponsorship;\n static revokeDataSponsorship = ops.revokeDataSponsorship;\n static revokeClaimableBalanceSponsorship =\n ops.revokeClaimableBalanceSponsorship;\n static revokeLiquidityPoolSponsorship = ops.revokeLiquidityPoolSponsorship;\n static revokeSignerSponsorship = ops.revokeSignerSponsorship;\n static clawback = ops.clawback;\n static setTrustLineFlags = ops.setTrustLineFlags;\n static liquidityPoolDeposit = ops.liquidityPoolDeposit;\n static liquidityPoolWithdraw = ops.liquidityPoolWithdraw;\n static invokeHostFunction = ops.invokeHostFunction;\n static extendFootprintTtl = ops.extendFootprintTtl;\n static restoreFootprint = ops.restoreFootprint;\n\n // These are not `xdr.Operation`s directly, but proxies for common\n // versions of `Operation.invokeHostFunction`\n static createDigitalWorldAssetContract = ops.createDigitalWorldAssetContract;\n static invokeContractFunction = ops.invokeContractFunction;\n static createCustomContract = ops.createCustomContract;\n static uploadContractWasm = ops.uploadContractWasm;\n}\n\nfunction extractRevokeSponshipDetails(\n attrs: any,\n result: Record<string, unknown>,\n) {\n switch (attrs.switch().name) {\n case \"revokeSponsorshipLedgerEntry\": {\n const ledgerKey = attrs.ledgerKey();\n\n switch (ledgerKey.switch().name) {\n case xdr.LedgerEntryType.account().name: {\n result.type = \"revokeAccountSponsorship\";\n result.account = accountIdtoAddress(ledgerKey.account().accountId());\n break;\n }\n case xdr.LedgerEntryType.trustline().name: {\n result.type = \"revokeTrustlineSponsorship\";\n result.account = accountIdtoAddress(\n ledgerKey.trustLine().accountId(),\n );\n const xdrAsset = ledgerKey.trustLine().asset();\n switch (xdrAsset.switch()) {\n case xdr.AssetType.assetTypePoolShare():\n result.asset = LiquidityPoolId.fromOperation(xdrAsset);\n break;\n default:\n result.asset = Asset.fromOperation(xdrAsset);\n break;\n }\n break;\n }\n case xdr.LedgerEntryType.offer().name: {\n result.type = \"revokeOfferSponsorship\";\n result.seller = accountIdtoAddress(ledgerKey.offer().sellerId());\n result.offerId = ledgerKey.offer().offerId().toString();\n break;\n }\n case xdr.LedgerEntryType.data().name: {\n result.type = \"revokeDataSponsorship\";\n result.account = accountIdtoAddress(ledgerKey.data().accountId());\n result.name = ledgerKey.data().dataName().toString(\"ascii\");\n break;\n }\n case xdr.LedgerEntryType.claimableBalance().name: {\n result.type = \"revokeClaimableBalanceSponsorship\";\n result.balanceId = ledgerKey\n .claimableBalance()\n .balanceId()\n .toXDR(\"hex\");\n break;\n }\n case xdr.LedgerEntryType.liquidityPool().name: {\n result.type = \"revokeLiquidityPoolSponsorship\";\n result.liquidityPoolId = ledgerKey\n .liquidityPool()\n .liquidityPoolId()\n .toString(\"hex\");\n break;\n }\n default: {\n throw new Error(`Unknown ledgerKey: ${attrs.switch().name}`);\n }\n }\n break;\n }\n case \"revokeSponsorshipSigner\": {\n result.type = \"revokeSignerSponsorship\";\n result.account = accountIdtoAddress(attrs.signer().accountId());\n result.signer = convertXDRSignerKeyToObject(attrs.signer().signerKey());\n break;\n }\n default: {\n throw new Error(`Unknown revokeSponsorship: ${attrs.switch().name}`);\n }\n }\n}\n\nfunction convertXDRSignerKeyToObject(\n signerKey: xdr.SignerKey,\n): Record<string, unknown> {\n const attrs: Record<string, unknown> = {};\n\n switch (signerKey.switch().name) {\n case xdr.SignerKeyType.signerKeyTypeEd25519().name: {\n attrs.ed25519PublicKey = StrKey.encodeEd25519PublicKey(\n signerKey.ed25519(),\n );\n break;\n }\n case xdr.SignerKeyType.signerKeyTypePreAuthTx().name: {\n attrs.preAuthTx = signerKey.preAuthTx().toString(\"hex\");\n break;\n }\n case xdr.SignerKeyType.signerKeyTypeHashX().name: {\n attrs.sha256Hash = signerKey.hashX().toString(\"hex\");\n break;\n }\n case xdr.SignerKeyType.signerKeyTypeEd25519SignedPayload().name: {\n const signedPayload = signerKey.ed25519SignedPayload();\n\n attrs.ed25519SignedPayload = StrKey.encodeSignedPayload(\n signedPayload.toXDR(),\n );\n break;\n }\n default: {\n throw new Error(`Unknown signerKey: ${signerKey.switch().name}`);\n }\n }\n\n return attrs;\n}\n\nfunction accountIdtoAddress(accountId: xdr.AccountId): string {\n return StrKey.encodeEd25519PublicKey(accountId.ed25519());\n}\n\n// Namespace merged with the Operation class to expose operation result types as\n// `Operation.CreateAccount`, `Operation.Payment`, etc. — matching the public API\n// declared in types/index.d.ts.\n// The static methods (e.g. Operation.createAccount) are defined on the class above.\n\nexport namespace Operation {\n export type BaseOperation<T extends _OperationType = _OperationType> =\n _BaseOperation<T>;\n export type CreateAccount = CreateAccountResult;\n export type Payment = PaymentResult;\n export type PathPaymentStrictReceive = PathPaymentStrictReceiveResult;\n export type PathPaymentStrictSend = PathPaymentStrictSendResult;\n export type CreatePassiveSellOffer = CreatePassiveSellOfferResult;\n export type ManageSellOffer = ManageSellOfferResult;\n export type ManageBuyOffer = ManageBuyOfferResult;\n export type SetOptions = SetOptionsResult<Signer>;\n export type ChangeTrust = ChangeTrustResult;\n export type AllowTrust = AllowTrustResult;\n export type AccountMerge = AccountMergeResult;\n export type Inflation = InflationResult;\n export type ManageData = ManageDataResult;\n export type BumpSequence = BumpSequenceResult;\n export type CreateClaimableBalance = CreateClaimableBalanceResult;\n export type ClaimClaimableBalance = ClaimClaimableBalanceResult;\n export type BeginSponsoringFutureReserves =\n BeginSponsoringFutureReservesResult;\n export type EndSponsoringFutureReserves = EndSponsoringFutureReservesResult;\n export type RevokeAccountSponsorship = RevokeAccountSponsorshipResult;\n export type RevokeTrustlineSponsorship = RevokeTrustlineSponsorshipResult;\n export type RevokeOfferSponsorship = RevokeOfferSponsorshipResult;\n export type RevokeDataSponsorship = RevokeDataSponsorshipResult;\n export type RevokeClaimableBalanceSponsorship =\n RevokeClaimableBalanceSponsorshipResult;\n export type RevokeLiquidityPoolSponsorship =\n RevokeLiquidityPoolSponsorshipResult;\n export type RevokeSignerSponsorship = RevokeSignerSponsorshipResult;\n export type Clawback = ClawbackResult;\n export type ClawbackClaimableBalance = ClawbackClaimableBalanceResult;\n export type SetTrustLineFlags = SetTrustLineFlagsResult;\n export type LiquidityPoolDeposit = LiquidityPoolDepositResult;\n export type LiquidityPoolWithdraw = LiquidityPoolWithdrawResult;\n export type InvokeHostFunction = InvokeHostFunctionResult;\n export type ExtendFootprintTTL = ExtendFootprintTTLResult;\n export type RestoreFootprint = RestoreFootprintResult;\n}\n"],"names":["encodeMuxedAccountToAddress","fromXDRAmount","Asset","xdr","LiquidityPoolAsset","trimEnd","StrKey","fromXDRPrice","claimant","Claimant","ops.accountMerge","ops.allowTrust","ops.bumpSequence","ops.changeTrust","ops.createAccount","ops.createClaimableBalance","ops.claimClaimableBalance","ops.clawbackClaimableBalance","ops.createPassiveSellOffer","ops.inflation","ops.manageData","ops.manageSellOffer","ops.manageBuyOffer","ops.pathPaymentStrictReceive","ops.pathPaymentStrictSend","ops.payment","ops.setOptions","ops.beginSponsoringFutureReserves","ops.endSponsoringFutureReserves","ops.revokeAccountSponsorship","ops.revokeTrustlineSponsorship","ops.revokeOfferSponsorship","ops.revokeDataSponsorship","ops.revokeClaimableBalanceSponsorship","ops.revokeLiquidityPoolSponsorship","ops.revokeSignerSponsorship","ops.clawback","ops.setTrustLineFlags","ops.liquidityPoolDeposit","ops.liquidityPoolWithdraw","ops.invokeHostFunction","ops.extendFootprintTtl","ops.restoreFootprint","ops.createDigitalWorldAssetContract","ops.invokeContractFunction","ops.createCustomContract","ops.uploadContractWasm","LiquidityPoolId"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2DO,MAAM,mBAAmB,CAAA,IAAK;AAO9B,MAAM,oBAAoB,CAAA,IAAK;AAO/B,MAAM,oBAAoB,CAAA,IAAK;AAS/B,MAAM,0BAA0B,CAAA,IAAK;AAgDrC,MAAM,SAAA,CAAU;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQrB,OAAO,cACL,SAAA,EACG;AACH,IAAA,MAAM,SAAkC,EAAC;AACzC,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GAAqB,IAAA,EAAM;AAChD,MAAA,KAAA,CAAM,UAAA,GAAa,SAAA,CAAU,KAAA,EAAM,CAAE,SAAS,KAAK,CAAA;AACnD,MAAA;AAAA,IACF;AAAA,IACA,KAAKA,sBAAA,CAAI,aAAA,CAAc,iCAAA,GAAoC,IAAA,EAAM;AAC/D,MAAA,MAAM,aAAA,GAAgB,UAAU,oBAAA,EAAqB;AAErD,MAAA,KAAA,CAAM,uBAAuBG,aAAA,CAAO,mBAAA;AAAA,QAClC,cAAc,KAAA;AAAM,OACtB;AACA,MAAA;AAAA,IACF;AAAA,IACA,SAAS;AACP,MAAA,MAAM,IAAI,KAAA,CAAM,CAAA,mBAAA,EAAsB,UAAU,MAAA,EAAO,CAAE,IAAI,CAAA,CAAE,CAAA;AAAA,IACjE;AAAA;AAGF,EAAA,OAAO,KAAA;AACT;AAEA,SAAS,mBAAmB,SAAA,EAAkC;AAC5D,EAAA,OAAOA,aAAA,CAAO,sBAAA,CAAuB,SAAA,CAAU,OAAA,EAAS,CAAA;AAC1D;;;;;;;;"}
|
|
@@ -91,7 +91,7 @@ function createCustomContract(opts) {
|
|
|
91
91
|
...opts.auth !== void 0 && { auth: opts.auth }
|
|
92
92
|
});
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function createDigitalWorldAssetContract(opts) {
|
|
95
95
|
let asset$1 = opts.asset;
|
|
96
96
|
if (typeof asset$1 === "string") {
|
|
97
97
|
const parts = asset$1.split(":");
|
|
@@ -136,7 +136,7 @@ function getSalty() {
|
|
|
136
136
|
}
|
|
137
137
|
|
|
138
138
|
exports.createCustomContract = createCustomContract;
|
|
139
|
-
exports.
|
|
139
|
+
exports.createDigitalWorldAssetContract = createDigitalWorldAssetContract;
|
|
140
140
|
exports.invokeContractFunction = invokeContractFunction;
|
|
141
141
|
exports.invokeHostFunction = invokeHostFunction;
|
|
142
142
|
exports.uploadContractWasm = uploadContractWasm;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invoke_host_function.js","sources":["../../../../src/base/operations/invoke_host_function.ts"],"sourcesContent":["import xdr from \"../xdr.js\";\n\nimport { Keypair } from \"../keypair.js\";\nimport { Address } from \"../address.js\";\nimport { Asset } from \"../asset.js\";\nimport {\n CreateCustomContractOpts,\n CreateStellarAssetContractOpts,\n InvokeContractFunctionOpts,\n InvokeHostFunctionOpts,\n InvokeHostFunctionResult,\n OperationAttributes,\n UploadContractWasmOpts,\n} from \"./types.js\";\nimport { setSourceAccount } from \"../util/operations.js\";\n\n/**\n * Invokes a single smart contract host function.\n *\n *\n * @param opts - options object\n * - `func`: host function to execute (with its wrapped parameters)\n * - `auth`: list outlining the tree of authorizations required for the call\n * - `source`: an optional source account\n *\n * @see https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#function\n * @see Operation.invokeContractFunction\n * @see Operation.createCustomContract\n * @see Operation.createStellarAssetContract\n * @see Operation.uploadContractWasm\n * @see Contract.call\n */\nexport function invokeHostFunction(\n opts: InvokeHostFunctionOpts,\n): xdr.Operation<InvokeHostFunctionResult> {\n if (!opts.func) {\n throw new TypeError(\n `host function invocation ('func') required (got ${JSON.stringify(opts)})`,\n );\n }\n\n if (\n opts.func.switch().value ===\n xdr.HostFunctionType.hostFunctionTypeInvokeContract().value\n ) {\n // Ensure that there are no claimable balance or liquidity pool IDs in the\n // invocation because those are not allowed.\n opts.func\n .invokeContract()\n .args()\n .forEach((arg) => {\n let scv: Address;\n try {\n scv = Address.fromScVal(arg);\n } catch {\n // swallow non-Address errors\n return;\n }\n\n switch (scv.type) {\n case \"claimableBalance\":\n case \"liquidityPool\":\n throw new TypeError(\n `claimable balances and liquidity pools cannot be arguments to invokeHostFunction`,\n );\n default:\n }\n });\n }\n\n const invokeHostFunctionOp = new xdr.InvokeHostFunctionOp({\n hostFunction: opts.func,\n auth: opts.auth || [],\n });\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.invokeHostFunction(invokeHostFunctionOp),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Returns an operation that invokes a contract function.\n *\n *\n * @param opts - the set of parameters\n * - `contract`: a strkey-fied contract address (`C...`)\n * - `function`: the name of the contract fn to invoke\n * - `args`: parameters to pass to the function invocation\n * - `auth`: an optional list outlining the tree of authorizations required for the call\n * - `source`: an optional source account\n *\n * @see Operation.invokeHostFunction\n * @see Contract.call\n * @see Address\n */\nexport function invokeContractFunction(\n opts: InvokeContractFunctionOpts,\n): xdr.Operation<InvokeHostFunctionResult> {\n const c = new Address(opts.contract);\n\n if (c.type !== \"contract\") {\n throw new TypeError(\n `expected contract strkey instance, got ${c.toString()}`,\n );\n }\n\n return invokeHostFunction({\n func: xdr.HostFunction.hostFunctionTypeInvokeContract(\n new xdr.InvokeContractArgs({\n contractAddress: c.toScAddress(),\n functionName: opts.function,\n args: opts.args,\n }),\n ),\n ...(opts.source !== undefined && { source: opts.source }),\n ...(opts.auth !== undefined && { auth: opts.auth }),\n });\n}\n\n/**\n * Returns an operation that creates a custom WASM contract and atomically\n * invokes its constructor.\n *\n *\n * @param opts - the set of parameters\n * - `address`: the contract uploader address\n * - `wasmHash`: the SHA-256 hash of the contract WASM you're uploading\n * - `constructorArgs`: the optional parameters to pass to the constructor\n * - `salt`: an optional, 32-byte salt to distinguish deployment instances\n * - `auth`: an optional list outlining the tree of authorizations required for the call\n * - `source`: an optional source account\n *\n * @see https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#function\n */\nexport function createCustomContract(\n opts: CreateCustomContractOpts,\n): xdr.Operation<InvokeHostFunctionResult> {\n const salt = Buffer.from(opts.salt || getSalty());\n\n if (!opts.wasmHash || opts.wasmHash.length !== 32) {\n throw new TypeError(\n `expected hash(contract WASM) in 'opts.wasmHash', got ${String(opts.wasmHash)}`,\n );\n }\n\n if (salt.length !== 32) {\n throw new TypeError(\n `expected 32-byte salt in 'opts.salt', got ${String(opts.salt)}`,\n );\n }\n\n return invokeHostFunction({\n func: xdr.HostFunction.hostFunctionTypeCreateContractV2(\n new xdr.CreateContractArgsV2({\n executable: xdr.ContractExecutable.contractExecutableWasm(\n Buffer.from(opts.wasmHash),\n ),\n contractIdPreimage:\n xdr.ContractIdPreimage.contractIdPreimageFromAddress(\n new xdr.ContractIdPreimageFromAddress({\n address: opts.address.toScAddress(),\n salt,\n }),\n ),\n constructorArgs: opts.constructorArgs ?? [],\n }),\n ),\n ...(opts.source !== undefined && { source: opts.source }),\n ...(opts.auth !== undefined && { auth: opts.auth }),\n });\n}\n\n/**\n * Returns an operation that wraps a Stellar asset into a token contract.\n *\n *\n * @param opts - the set of parameters\n * - `asset`: the Stellar asset to wrap, either as an {@link Asset} object or in canonical form (SEP-11, `code:issuer`)\n * - `auth`: an optional list outlining the tree of authorizations required for the upload\n * - `source`: an optional source account\n *\n * @see https://stellar.org/protocol/sep-11#alphanum4-alphanum12\n * @see https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions\n * @see https://soroban.stellar.org/docs/advanced-tutorials/stellar-asset-contract\n * @see Operation.invokeHostFunction\n */\nexport function createStellarAssetContract(\n opts: CreateStellarAssetContractOpts,\n): xdr.Operation<InvokeHostFunctionResult> {\n let asset = opts.asset;\n\n if (typeof asset === \"string\") {\n const parts = asset.split(\":\");\n const code = parts[0];\n if (code === undefined) {\n throw new TypeError(\n `expected Asset in 'opts.asset', got ${String(opts.asset)}`,\n );\n }\n asset = new Asset(code, parts[1]); // handles 'xlm' by default\n }\n\n if (!(asset instanceof Asset)) {\n throw new TypeError(\n `expected Asset in 'opts.asset', got ${String(opts.asset)}`,\n );\n }\n\n return invokeHostFunction({\n func: xdr.HostFunction.hostFunctionTypeCreateContract(\n new xdr.CreateContractArgs({\n executable: xdr.ContractExecutable.contractExecutableStellarAsset(),\n contractIdPreimage: xdr.ContractIdPreimage.contractIdPreimageFromAsset(\n asset.toXDRObject(),\n ),\n }),\n ),\n auth: opts.auth || [],\n ...(opts.source !== undefined && { source: opts.source }),\n });\n}\n\n/**\n * Returns an operation that uploads WASM for a contract.\n *\n *\n * @param opts - the set of parameters\n * - `wasm`: a WASM blob to upload to the ledger\n * - `auth`: an optional list outlining the tree of authorizations required for the upload\n * - `source`: an optional source account\n *\n * @see https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#function\n */\nexport function uploadContractWasm(\n opts: UploadContractWasmOpts,\n): xdr.Operation<InvokeHostFunctionResult> {\n return invokeHostFunction({\n func: xdr.HostFunction.hostFunctionTypeUploadContractWasm(\n Buffer.from(opts.wasm), // coalesce so we can drop `Buffer` someday\n ),\n auth: opts.auth || [],\n ...(opts.source !== undefined && { source: opts.source }),\n });\n}\n\n/* Returns a random 256-bit \"salt\" value. */\nfunction getSalty(): Buffer {\n return Keypair.random().xdrPublicKey().value(); // ed25519 is 256 bits, too\n}\n"],"names":["xdr","Address","setSourceAccount","Buffer","asset","Asset","Keypair"],"mappings":";;;;;;;;;AAgCO,SAAS,mBACd,IAAA,EACyC;AACzC,EAAA,IAAI,CAAC,KAAK,IAAA,EAAM;AACd,IAAA,MAAM,IAAI,SAAA;AAAA,MACR,CAAA,gDAAA,EAAmD,IAAA,CAAK,SAAA,CAAU,IAAI,CAAC,CAAA,CAAA;AAAA,KACzE;AAAA,EACF;AAEA,EAAA,IACE,IAAA,CAAK,KAAK,MAAA,EAAO,CAAE,UACnBA,sBAAA,CAAI,gBAAA,CAAiB,8BAAA,EAA+B,CAAE,KAAA,EACtD;AAGA,IAAA,IAAA,CAAK,KACF,cAAA,EAAe,CACf,MAAK,CACL,OAAA,CAAQ,CAAC,GAAA,KAAQ;AAChB,MAAA,IAAI,GAAA;AACJ,MAAA,IAAI;AACF,QAAA,GAAA,GAAMC,eAAA,CAAQ,UAAU,GAAG,CAAA;AAAA,MAC7B,CAAA,CAAA,MAAQ;AAEN,QAAA;AAAA,MACF;AAEA,MAAA,QAAQ,IAAI,IAAA;AAAM,QAChB,KAAK,kBAAA;A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AAMJ,uBAAI,YAAA,CAAa,kCAAA;AAAA,MACrBG,aAAA,CAAO,IAAA,CAAK,IAAA,CAAK,IAAI;AAAA;AAAA,KACvB;AAAA,IACA,IAAA,EAAM,IAAA,CAAK,IAAA,IAAQ,EAAC;AAAA,IACpB,GAAI,IAAA,CAAK,MAAA,KAAW,UAAa,EAAE,MAAA,EAAQ,KAAK,MAAA;AAAO,GACxD,CAAA;AACH;AAGA,SAAS,QAAA,GAAmB;AAC1B,EAAA,OAAOG,eAAA,CAAQ,MAAA,EAAO,CAAE,YAAA,GAAe,KAAA,EAAM;AAC/C;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"invoke_host_function.js","sources":["../../../../src/base/operations/invoke_host_function.ts"],"sourcesContent":["import xdr from \"../xdr.js\";\n\nimport { Keypair } from \"../keypair.js\";\nimport { Address } from \"../address.js\";\nimport { Asset } from \"../asset.js\";\nimport {\n CreateCustomContractOpts,\n CreateDigitalWorldAssetContractOpts,\n InvokeContractFunctionOpts,\n InvokeHostFunctionOpts,\n InvokeHostFunctionResult,\n OperationAttributes,\n UploadContractWasmOpts,\n} from \"./types.js\";\nimport { setSourceAccount } from \"../util/operations.js\";\n\n/**\n * Invokes a single smart contract host function.\n *\n *\n * @param opts - options object\n * - `func`: host function to execute (with its wrapped parameters)\n * - `auth`: list outlining the tree of authorizations required for the call\n * - `source`: an optional source account\n *\n * @see https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#function\n * @see Operation.invokeContractFunction\n * @see Operation.createCustomContract\n * @see Operation.createDigitalWorldAssetContract\n * @see Operation.uploadContractWasm\n * @see Contract.call\n */\nexport function invokeHostFunction(\n opts: InvokeHostFunctionOpts,\n): xdr.Operation<InvokeHostFunctionResult> {\n if (!opts.func) {\n throw new TypeError(\n `host function invocation ('func') required (got ${JSON.stringify(opts)})`,\n );\n }\n\n if (\n opts.func.switch().value ===\n xdr.HostFunctionType.hostFunctionTypeInvokeContract().value\n ) {\n // Ensure that there are no claimable balance or liquidity pool IDs in the\n // invocation because those are not allowed.\n opts.func\n .invokeContract()\n .args()\n .forEach((arg) => {\n let scv: Address;\n try {\n scv = Address.fromScVal(arg);\n } catch {\n // swallow non-Address errors\n return;\n }\n\n switch (scv.type) {\n case \"claimableBalance\":\n case \"liquidityPool\":\n throw new TypeError(\n `claimable balances and liquidity pools cannot be arguments to invokeHostFunction`,\n );\n default:\n }\n });\n }\n\n const invokeHostFunctionOp = new xdr.InvokeHostFunctionOp({\n hostFunction: opts.func,\n auth: opts.auth || [],\n });\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.invokeHostFunction(invokeHostFunctionOp),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Returns an operation that invokes a contract function.\n *\n *\n * @param opts - the set of parameters\n * - `contract`: a strkey-fied contract address (`C...`)\n * - `function`: the name of the contract fn to invoke\n * - `args`: parameters to pass to the function invocation\n * - `auth`: an optional list outlining the tree of authorizations required for the call\n * - `source`: an optional source account\n *\n * @see Operation.invokeHostFunction\n * @see Contract.call\n * @see Address\n */\nexport function invokeContractFunction(\n opts: InvokeContractFunctionOpts,\n): xdr.Operation<InvokeHostFunctionResult> {\n const c = new Address(opts.contract);\n\n if (c.type !== \"contract\") {\n throw new TypeError(\n `expected contract strkey instance, got ${c.toString()}`,\n );\n }\n\n return invokeHostFunction({\n func: xdr.HostFunction.hostFunctionTypeInvokeContract(\n new xdr.InvokeContractArgs({\n contractAddress: c.toScAddress(),\n functionName: opts.function,\n args: opts.args,\n }),\n ),\n ...(opts.source !== undefined && { source: opts.source }),\n ...(opts.auth !== undefined && { auth: opts.auth }),\n });\n}\n\n/**\n * Returns an operation that creates a custom WASM contract and atomically\n * invokes its constructor.\n *\n *\n * @param opts - the set of parameters\n * - `address`: the contract uploader address\n * - `wasmHash`: the SHA-256 hash of the contract WASM you're uploading\n * - `constructorArgs`: the optional parameters to pass to the constructor\n * - `salt`: an optional, 32-byte salt to distinguish deployment instances\n * - `auth`: an optional list outlining the tree of authorizations required for the call\n * - `source`: an optional source account\n *\n * @see https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#function\n */\nexport function createCustomContract(\n opts: CreateCustomContractOpts,\n): xdr.Operation<InvokeHostFunctionResult> {\n const salt = Buffer.from(opts.salt || getSalty());\n\n if (!opts.wasmHash || opts.wasmHash.length !== 32) {\n throw new TypeError(\n `expected hash(contract WASM) in 'opts.wasmHash', got ${String(opts.wasmHash)}`,\n );\n }\n\n if (salt.length !== 32) {\n throw new TypeError(\n `expected 32-byte salt in 'opts.salt', got ${String(opts.salt)}`,\n );\n }\n\n return invokeHostFunction({\n func: xdr.HostFunction.hostFunctionTypeCreateContractV2(\n new xdr.CreateContractArgsV2({\n executable: xdr.ContractExecutable.contractExecutableWasm(\n Buffer.from(opts.wasmHash),\n ),\n contractIdPreimage:\n xdr.ContractIdPreimage.contractIdPreimageFromAddress(\n new xdr.ContractIdPreimageFromAddress({\n address: opts.address.toScAddress(),\n salt,\n }),\n ),\n constructorArgs: opts.constructorArgs ?? [],\n }),\n ),\n ...(opts.source !== undefined && { source: opts.source }),\n ...(opts.auth !== undefined && { auth: opts.auth }),\n });\n}\n\n/**\n * Returns an operation that wraps a Digital World asset into a token contract.\n *\n *\n * @param opts - the set of parameters\n * - `asset`: the Digital World asset to wrap, either as an {@link Asset} object or in canonical form (SEP-11, `code:issuer`)\n * - `auth`: an optional list outlining the tree of authorizations required for the upload\n * - `source`: an optional source account\n *\n * @see https://stellar.org/protocol/sep-11#alphanum4-alphanum12\n * @see https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions\n * @see https://soroban.stellar.org/docs/advanced-tutorials/stellar-asset-contract\n * @see Operation.invokeHostFunction\n */\nexport function createDigitalWorldAssetContract(\n opts: CreateDigitalWorldAssetContractOpts,\n): xdr.Operation<InvokeHostFunctionResult> {\n let asset = opts.asset;\n\n if (typeof asset === \"string\") {\n const parts = asset.split(\":\");\n const code = parts[0];\n if (code === undefined) {\n throw new TypeError(\n `expected Asset in 'opts.asset', got ${String(opts.asset)}`,\n );\n }\n asset = new Asset(code, parts[1]); // handles 'xlm' by default\n }\n\n if (!(asset instanceof Asset)) {\n throw new TypeError(\n `expected Asset in 'opts.asset', got ${String(opts.asset)}`,\n );\n }\n\n return invokeHostFunction({\n func: xdr.HostFunction.hostFunctionTypeCreateContract(\n new xdr.CreateContractArgs({\n executable: xdr.ContractExecutable.contractExecutableStellarAsset(),\n contractIdPreimage: xdr.ContractIdPreimage.contractIdPreimageFromAsset(\n asset.toXDRObject(),\n ),\n }),\n ),\n auth: opts.auth || [],\n ...(opts.source !== undefined && { source: opts.source }),\n });\n}\n\n/**\n * Returns an operation that uploads WASM for a contract.\n *\n *\n * @param opts - the set of parameters\n * - `wasm`: a WASM blob to upload to the ledger\n * - `auth`: an optional list outlining the tree of authorizations required for the upload\n * - `source`: an optional source account\n *\n * @see https://soroban.stellar.org/docs/fundamentals-and-concepts/invoking-contracts-with-transactions#function\n */\nexport function uploadContractWasm(\n opts: UploadContractWasmOpts,\n): xdr.Operation<InvokeHostFunctionResult> {\n return invokeHostFunction({\n func: xdr.HostFunction.hostFunctionTypeUploadContractWasm(\n Buffer.from(opts.wasm), // coalesce so we can drop `Buffer` someday\n ),\n auth: opts.auth || [],\n ...(opts.source !== undefined && { source: opts.source }),\n });\n}\n\n/* Returns a random 256-bit \"salt\" value. */\nfunction getSalty(): Buffer {\n return Keypair.random().xdrPublicKey().value(); // ed25519 is 256 bits, too\n}\n"],"names":["xdr","Address","setSourceAccount","Buffer","asset","Asset","Keypair"],"mappings":";;;;;;;;;AAgCO,SAAS,mBACd,IAAA,EACyC;AACzC,EAAA,IAAI,CAAC,KAAK,IAAA,EAAM;AACd,IAAA,MAAM,IAAI,SAAA;AAAA,MACR,CAAA,gDAAA,EAAmD,IAAA,CAAK,SAAA,CAAU,IAAI,CAAC,CAAA,CAAA;AAAA,KACzE;AAAA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AA,CAAmB;AAAA,QACzB,UAAA,EAAYA,sBAAA,CAAI,kBAAA,CAAmB,8BAAA,EAA+B;AAAA,QAClE,kBAAA,EAAoBA,uBAAI,kBAAA,CAAmB,2BAAA;AAAA,UACzCI,QAAM,WAAA;AAAY;AACpB,OACD;AAAA,KACH;AAAA,IACA,IAAA,EAAM,IAAA,CAAK,IAAA,IAAQ,EAAC;AAAA,IACpB,GAAI,IAAA,CAAK,MAAA,KAAW,UAAa,EAAE,MAAA,EAAQ,KAAK,MAAA;AAAO,GACxD,CAAA;AACH;AAaO,SAAS,mBACd,IAAA,EACyC;AACzC,EAAA,OAAO,kBAAA,CAAmB;AAAA,IACxB,IAAA,EAAMJ,uBAAI,YAAA,CAAa,kCAAA;AAAA,MACrBG,aAAA,CAAO,IAAA,CAAK,IAAA,CAAK,IAAI;AAAA;AAAA,KACvB;AAAA,IACA,IAAA,EAAM,IAAA,CAAK,IAAA,IAAQ,EAAC;AAAA,IACpB,GAAI,IAAA,CAAK,MAAA,KAAW,UAAa,EAAE,MAAA,EAAQ,KAAK,MAAA;AAAO,GACxD,CAAA;AACH;AAGA,SAAS,QAAA,GAAmB;AAC1B,EAAA,OAAOG,eAAA,CAAQ,MAAA,EAAO,CAAE,YAAA,GAAe,KAAA,EAAM;AAC/C;;;;;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"revoke_sponsorship.js","sources":["../../../../src/base/operations/revoke_sponsorship.ts"],"sourcesContent":["import xdr from \"../xdr.js\";\nimport { StrKey } from \"../strkey.js\";\nimport { Keypair } from \"../keypair.js\";\nimport { Asset } from \"../asset.js\";\nimport { LiquidityPoolId } from \"../liquidity_pool_id.js\";\nimport {\n RevokeAccountSponsorshipOpts,\n RevokeAccountSponsorshipResult,\n RevokeTrustlineSponsorshipOpts,\n RevokeTrustlineSponsorshipResult,\n RevokeOfferSponsorshipOpts,\n RevokeOfferSponsorshipResult,\n RevokeDataSponsorshipOpts,\n RevokeDataSponsorshipResult,\n RevokeClaimableBalanceSponsorshipOpts,\n RevokeClaimableBalanceSponsorshipResult,\n RevokeLiquidityPoolSponsorshipOpts,\n RevokeLiquidityPoolSponsorshipResult,\n RevokeSignerSponsorshipOpts,\n RevokeSignerSponsorshipResult,\n OperationAttributes,\n} from \"./types.js\";\nimport { setSourceAccount } from \"../util/operations.js\";\n\n/**\n * Create a \"revoke sponsorship\" operation for an account.\n *\n * @param opts - Options object\n * - `account`: The sponsored account ID.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeAccountSponsorship({\n * account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'\n * });\n * ```\n */\nexport function revokeAccountSponsorship(\n opts: RevokeAccountSponsorshipOpts = {} as RevokeAccountSponsorshipOpts,\n): xdr.Operation<RevokeAccountSponsorshipResult> {\n if (!StrKey.isValidEd25519PublicKey(opts.account)) {\n throw new Error(\"account is invalid\");\n }\n\n const ledgerKey = xdr.LedgerKey.account(\n new xdr.LedgerKeyAccount({\n accountId: Keypair.fromPublicKey(opts.account).xdrAccountId(),\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Create a \"revoke sponsorship\" operation for a trustline.\n *\n * @param opts - Options object\n * - `account`: The account ID which owns the trustline.\n * - `asset`: The trustline asset.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeTrustlineSponsorship({\n * account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',\n * asset: new StellarBase.LiquidityPoolId(\n * 'USDUSD',\n * 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'\n * )\n * });\n * ```\n */\nexport function revokeTrustlineSponsorship(\n opts: RevokeTrustlineSponsorshipOpts = {} as RevokeTrustlineSponsorshipOpts,\n): xdr.Operation<RevokeTrustlineSponsorshipResult> {\n if (!StrKey.isValidEd25519PublicKey(opts.account)) {\n throw new Error(\"account is invalid\");\n }\n\n let asset: xdr.TrustLineAsset;\n\n if (opts.asset instanceof Asset) {\n asset = opts.asset.toTrustLineXDRObject();\n } else if (opts.asset instanceof LiquidityPoolId) {\n asset = opts.asset.toXDRObject();\n } else {\n throw new TypeError(\"asset must be an Asset or LiquidityPoolId\");\n }\n\n const ledgerKey = xdr.LedgerKey.trustline(\n new xdr.LedgerKeyTrustLine({\n accountId: Keypair.fromPublicKey(opts.account).xdrAccountId(),\n asset,\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Create a \"revoke sponsorship\" operation for an offer.\n *\n * @param opts - Options object\n * - `seller`: The account ID which created the offer.\n * - `offerId`: The offer ID.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeOfferSponsorship({\n * seller: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',\n * offerId: '1234'\n * });\n * ```\n */\nexport function revokeOfferSponsorship(\n opts: RevokeOfferSponsorshipOpts = {} as RevokeOfferSponsorshipOpts,\n): xdr.Operation<RevokeOfferSponsorshipResult> {\n if (!StrKey.isValidEd25519PublicKey(opts.seller)) {\n throw new Error(\"seller is invalid\");\n }\n\n if (typeof opts.offerId !== \"string\") {\n throw new Error(\"offerId is invalid\");\n }\n\n const ledgerKey = xdr.LedgerKey.offer(\n new xdr.LedgerKeyOffer({\n sellerId: Keypair.fromPublicKey(opts.seller).xdrAccountId(),\n offerId: xdr.Int64.fromString(opts.offerId),\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Create a \"revoke sponsorship\" operation for a data entry.\n *\n * @param opts - Options object\n * - `account`: The account ID which owns the data entry.\n * - `name`: The name of the data entry.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeDataSponsorship({\n * account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',\n * name: 'foo'\n * });\n * ```\n */\nexport function revokeDataSponsorship(\n opts: RevokeDataSponsorshipOpts = {} as RevokeDataSponsorshipOpts,\n): xdr.Operation<RevokeDataSponsorshipResult> {\n if (!StrKey.isValidEd25519PublicKey(opts.account)) {\n throw new Error(\"account is invalid\");\n }\n\n if (typeof opts.name !== \"string\" || opts.name.length > 64) {\n throw new Error(\"name must be a string, up to 64 characters\");\n }\n\n const ledgerKey = xdr.LedgerKey.data(\n new xdr.LedgerKeyData({\n accountId: Keypair.fromPublicKey(opts.account).xdrAccountId(),\n dataName: opts.name,\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Create a \"revoke sponsorship\" operation for a claimable balance.\n *\n * @param opts - Options object\n * - `balanceId`: The sponsored claimable balance ID.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeClaimableBalanceSponsorship({\n * balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be',\n * });\n * ```\n */\nexport function revokeClaimableBalanceSponsorship(\n opts: RevokeClaimableBalanceSponsorshipOpts = {} as RevokeClaimableBalanceSponsorshipOpts,\n): xdr.Operation<RevokeClaimableBalanceSponsorshipResult> {\n if (typeof opts.balanceId !== \"string\") {\n throw new Error(\"balanceId is invalid\");\n }\n\n const ledgerKey = xdr.LedgerKey.claimableBalance(\n new xdr.LedgerKeyClaimableBalance({\n balanceId: xdr.ClaimableBalanceId.fromXDR(opts.balanceId, \"hex\"),\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Creates a \"revoke sponsorship\" operation for a liquidity pool.\n *\n * @param opts - Options object.\n * - `liquidityPoolId`: The sponsored liquidity pool ID in 'hex' string.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeLiquidityPoolSponsorship({\n * liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7',\n * });\n * ```\n */\nexport function revokeLiquidityPoolSponsorship(\n opts: RevokeLiquidityPoolSponsorshipOpts = {} as RevokeLiquidityPoolSponsorshipOpts,\n): xdr.Operation<RevokeLiquidityPoolSponsorshipResult> {\n if (typeof opts.liquidityPoolId !== \"string\") {\n throw new Error(\"liquidityPoolId is invalid\");\n }\n\n const ledgerKey = xdr.LedgerKey.liquidityPool(\n new xdr.LedgerKeyLiquidityPool({\n liquidityPoolId: Buffer.from(\n opts.liquidityPoolId,\n \"hex\",\n ) as unknown as xdr.PoolId,\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Create a \"revoke sponsorship\" operation for a signer.\n *\n * @param opts - Options object\n * - `account`: The account ID where the signer sponsorship is being removed from.\n * - `signer`: The signer whose sponsorship is being removed. Exactly one of the following must be set:\n * - `signer.ed25519PublicKey`: (optional) The ed25519 public key of the signer.\n * - `signer.sha256Hash`: (optional) sha256 hash (Buffer or hex string).\n * - `signer.preAuthTx`: (optional) Hash (Buffer or hex string) of transaction.\n * - `signer.ed25519SignedPayload`: (optional) Signed payload signer (StrKey P... address).\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeSignerSponsorship({\n * account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',\n * signer: {\n * ed25519PublicKey: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'\n * }\n * })\n * ```\n */\nexport function revokeSignerSponsorship(\n opts: RevokeSignerSponsorshipOpts = {} as RevokeSignerSponsorshipOpts,\n): xdr.Operation<RevokeSignerSponsorshipResult> {\n if (!StrKey.isValidEd25519PublicKey(opts.account)) {\n throw new Error(\"account is invalid\");\n }\n\n let key: xdr.SignerKey;\n\n if (opts.signer.ed25519PublicKey) {\n if (!StrKey.isValidEd25519PublicKey(opts.signer.ed25519PublicKey)) {\n throw new Error(\"signer.ed25519PublicKey is invalid.\");\n }\n const rawKey = StrKey.decodeEd25519PublicKey(opts.signer.ed25519PublicKey);\n key = xdr.SignerKey.signerKeyTypeEd25519(rawKey);\n } else if (opts.signer.preAuthTx) {\n let buffer: Buffer;\n\n if (typeof opts.signer.preAuthTx === \"string\") {\n buffer = Buffer.from(opts.signer.preAuthTx, \"hex\");\n } else {\n buffer = opts.signer.preAuthTx;\n }\n\n if (!(Buffer.isBuffer(buffer) && buffer.length === 32)) {\n throw new Error(\"signer.preAuthTx must be 32 bytes Buffer.\");\n }\n\n key = xdr.SignerKey.signerKeyTypePreAuthTx(buffer);\n } else if (opts.signer.sha256Hash) {\n let buffer: Buffer;\n\n if (typeof opts.signer.sha256Hash === \"string\") {\n buffer = Buffer.from(opts.signer.sha256Hash, \"hex\");\n } else {\n buffer = opts.signer.sha256Hash;\n }\n\n if (!(Buffer.isBuffer(buffer) && buffer.length === 32)) {\n throw new Error(\"signer.sha256Hash must be 32 bytes Buffer.\");\n }\n\n key = xdr.SignerKey.signerKeyTypeHashX(buffer);\n } else if (opts.signer.ed25519SignedPayload) {\n if (!StrKey.isValidSignedPayload(opts.signer.ed25519SignedPayload)) {\n throw new Error(\"signer.ed25519SignedPayload is invalid.\");\n }\n\n const rawPayload = StrKey.decodeSignedPayload(\n opts.signer.ed25519SignedPayload,\n );\n\n const signedPayloadXdr =\n xdr.SignerKeyEd25519SignedPayload.fromXDR(rawPayload);\n\n key = xdr.SignerKey.signerKeyTypeEd25519SignedPayload(signedPayloadXdr);\n } else {\n throw new Error(\"signer is invalid\");\n }\n\n const signer = new xdr.RevokeSponsorshipOpSigner({\n accountId: Keypair.fromPublicKey(opts.account).xdrAccountId(),\n signerKey: key,\n });\n\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipSigner(signer);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n"],"names":["StrKey","xdr","Keypair","setSourceAccount","asset","Asset","LiquidityPoolId","Buffer","buffer"],"mappings":";;;;;;;;;;AAsCO,SAAS,wBAAA,CACd,IAAA,GAAqC,EAAC,EACS;AAC/C,EAAA,IAAI,CAACA,aAAA,CAAO,uBAAA,CAAwB,IAAA,CAAK,OAAO,CAAA,EAAG;AACjD,IAAA,MAAM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a;AAAA,IAC5D,SAAA,EAAW;AAAA,GACZ,CAAA;AAED,EAAA,MAAM,EAAA,GAAKD,sBAAA,CAAI,mBAAA,CAAoB,uBAAA,CAAwB,MAAM,CAAA;AAEjE,EAAA,MAAM,YAAA,GAAoC;AAAA,IACxC,aAAA,EAAe,IAAA;AAAA,IACf,IAAA,EAAMA,sBAAA,CAAI,aAAA,CAAc,iBAAA,CAAkB,EAAE;AAAA,GAC9C;AACA,EAAAE,2BAAA,CAAiB,cAAc,IAAI,CAAA;AAEnC,EAAA,OAAO,IAAIF,sBAAA,CAAI,SAAA,CAAU,YAAY,CAAA;AACvC;;;;;;;;;;"}
|
|
1
|
+
{"version":3,"file":"revoke_sponsorship.js","sources":["../../../../src/base/operations/revoke_sponsorship.ts"],"sourcesContent":["import xdr from \"../xdr.js\";\nimport { StrKey } from \"../strkey.js\";\nimport { Keypair } from \"../keypair.js\";\nimport { Asset } from \"../asset.js\";\nimport { LiquidityPoolId } from \"../liquidity_pool_id.js\";\nimport {\n RevokeAccountSponsorshipOpts,\n RevokeAccountSponsorshipResult,\n RevokeTrustlineSponsorshipOpts,\n RevokeTrustlineSponsorshipResult,\n RevokeOfferSponsorshipOpts,\n RevokeOfferSponsorshipResult,\n RevokeDataSponsorshipOpts,\n RevokeDataSponsorshipResult,\n RevokeClaimableBalanceSponsorshipOpts,\n RevokeClaimableBalanceSponsorshipResult,\n RevokeLiquidityPoolSponsorshipOpts,\n RevokeLiquidityPoolSponsorshipResult,\n RevokeSignerSponsorshipOpts,\n RevokeSignerSponsorshipResult,\n OperationAttributes,\n} from \"./types.js\";\nimport { setSourceAccount } from \"../util/operations.js\";\n\n/**\n * Create a \"revoke sponsorship\" operation for an account.\n *\n * @param opts - Options object\n * - `account`: The sponsored account ID.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeAccountSponsorship({\n * account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'\n * });\n * ```\n */\nexport function revokeAccountSponsorship(\n opts: RevokeAccountSponsorshipOpts = {} as RevokeAccountSponsorshipOpts,\n): xdr.Operation<RevokeAccountSponsorshipResult> {\n if (!StrKey.isValidEd25519PublicKey(opts.account)) {\n throw new Error(\"account is invalid\");\n }\n\n const ledgerKey = xdr.LedgerKey.account(\n new xdr.LedgerKeyAccount({\n accountId: Keypair.fromPublicKey(opts.account).xdrAccountId(),\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Create a \"revoke sponsorship\" operation for a trustline.\n *\n * @param opts - Options object\n * - `account`: The account ID which owns the trustline.\n * - `asset`: The trustline asset.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeTrustlineSponsorship({\n * account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',\n * asset: new DigitalWorldBase.LiquidityPoolId(\n * 'USDUSD',\n * 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7'\n * )\n * });\n * ```\n */\nexport function revokeTrustlineSponsorship(\n opts: RevokeTrustlineSponsorshipOpts = {} as RevokeTrustlineSponsorshipOpts,\n): xdr.Operation<RevokeTrustlineSponsorshipResult> {\n if (!StrKey.isValidEd25519PublicKey(opts.account)) {\n throw new Error(\"account is invalid\");\n }\n\n let asset: xdr.TrustLineAsset;\n\n if (opts.asset instanceof Asset) {\n asset = opts.asset.toTrustLineXDRObject();\n } else if (opts.asset instanceof LiquidityPoolId) {\n asset = opts.asset.toXDRObject();\n } else {\n throw new TypeError(\"asset must be an Asset or LiquidityPoolId\");\n }\n\n const ledgerKey = xdr.LedgerKey.trustline(\n new xdr.LedgerKeyTrustLine({\n accountId: Keypair.fromPublicKey(opts.account).xdrAccountId(),\n asset,\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Create a \"revoke sponsorship\" operation for an offer.\n *\n * @param opts - Options object\n * - `seller`: The account ID which created the offer.\n * - `offerId`: The offer ID.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeOfferSponsorship({\n * seller: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',\n * offerId: '1234'\n * });\n * ```\n */\nexport function revokeOfferSponsorship(\n opts: RevokeOfferSponsorshipOpts = {} as RevokeOfferSponsorshipOpts,\n): xdr.Operation<RevokeOfferSponsorshipResult> {\n if (!StrKey.isValidEd25519PublicKey(opts.seller)) {\n throw new Error(\"seller is invalid\");\n }\n\n if (typeof opts.offerId !== \"string\") {\n throw new Error(\"offerId is invalid\");\n }\n\n const ledgerKey = xdr.LedgerKey.offer(\n new xdr.LedgerKeyOffer({\n sellerId: Keypair.fromPublicKey(opts.seller).xdrAccountId(),\n offerId: xdr.Int64.fromString(opts.offerId),\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Create a \"revoke sponsorship\" operation for a data entry.\n *\n * @param opts - Options object\n * - `account`: The account ID which owns the data entry.\n * - `name`: The name of the data entry.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeDataSponsorship({\n * account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',\n * name: 'foo'\n * });\n * ```\n */\nexport function revokeDataSponsorship(\n opts: RevokeDataSponsorshipOpts = {} as RevokeDataSponsorshipOpts,\n): xdr.Operation<RevokeDataSponsorshipResult> {\n if (!StrKey.isValidEd25519PublicKey(opts.account)) {\n throw new Error(\"account is invalid\");\n }\n\n if (typeof opts.name !== \"string\" || opts.name.length > 64) {\n throw new Error(\"name must be a string, up to 64 characters\");\n }\n\n const ledgerKey = xdr.LedgerKey.data(\n new xdr.LedgerKeyData({\n accountId: Keypair.fromPublicKey(opts.account).xdrAccountId(),\n dataName: opts.name,\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Create a \"revoke sponsorship\" operation for a claimable balance.\n *\n * @param opts - Options object\n * - `balanceId`: The sponsored claimable balance ID.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeClaimableBalanceSponsorship({\n * balanceId: '00000000da0d57da7d4850e7fc10d2a9d0ebc731f7afb40574c03395b17d49149b91f5be',\n * });\n * ```\n */\nexport function revokeClaimableBalanceSponsorship(\n opts: RevokeClaimableBalanceSponsorshipOpts = {} as RevokeClaimableBalanceSponsorshipOpts,\n): xdr.Operation<RevokeClaimableBalanceSponsorshipResult> {\n if (typeof opts.balanceId !== \"string\") {\n throw new Error(\"balanceId is invalid\");\n }\n\n const ledgerKey = xdr.LedgerKey.claimableBalance(\n new xdr.LedgerKeyClaimableBalance({\n balanceId: xdr.ClaimableBalanceId.fromXDR(opts.balanceId, \"hex\"),\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Creates a \"revoke sponsorship\" operation for a liquidity pool.\n *\n * @param opts - Options object.\n * - `liquidityPoolId`: The sponsored liquidity pool ID in 'hex' string.\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeLiquidityPoolSponsorship({\n * liquidityPoolId: 'dd7b1ab831c273310ddbec6f97870aa83c2fbd78ce22aded37ecbf4f3380fac7',\n * });\n * ```\n */\nexport function revokeLiquidityPoolSponsorship(\n opts: RevokeLiquidityPoolSponsorshipOpts = {} as RevokeLiquidityPoolSponsorshipOpts,\n): xdr.Operation<RevokeLiquidityPoolSponsorshipResult> {\n if (typeof opts.liquidityPoolId !== \"string\") {\n throw new Error(\"liquidityPoolId is invalid\");\n }\n\n const ledgerKey = xdr.LedgerKey.liquidityPool(\n new xdr.LedgerKeyLiquidityPool({\n liquidityPoolId: Buffer.from(\n opts.liquidityPoolId,\n \"hex\",\n ) as unknown as xdr.PoolId,\n }),\n );\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipLedgerEntry(ledgerKey);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n\n/**\n * Create a \"revoke sponsorship\" operation for a signer.\n *\n * @param opts - Options object\n * - `account`: The account ID where the signer sponsorship is being removed from.\n * - `signer`: The signer whose sponsorship is being removed. Exactly one of the following must be set:\n * - `signer.ed25519PublicKey`: (optional) The ed25519 public key of the signer.\n * - `signer.sha256Hash`: (optional) sha256 hash (Buffer or hex string).\n * - `signer.preAuthTx`: (optional) Hash (Buffer or hex string) of transaction.\n * - `signer.ed25519SignedPayload`: (optional) Signed payload signer (StrKey P... address).\n * - `source`: The source account for the operation. Defaults to the transaction's source account.\n *\n * @example\n * ```ts\n * const op = Operation.revokeSignerSponsorship({\n * account: 'GDGU5OAPHNPU5UCLE5RDJHG7PXZFQYWKCFOEXSXNMR6KRQRI5T6XXCD7',\n * signer: {\n * ed25519PublicKey: 'GCEZWKCA5VLDNRLN3RPRJMRZOX3Z6G5CHCGSNFHEYVXM3XOJMDS674JZ'\n * }\n * })\n * ```\n */\nexport function revokeSignerSponsorship(\n opts: RevokeSignerSponsorshipOpts = {} as RevokeSignerSponsorshipOpts,\n): xdr.Operation<RevokeSignerSponsorshipResult> {\n if (!StrKey.isValidEd25519PublicKey(opts.account)) {\n throw new Error(\"account is invalid\");\n }\n\n let key: xdr.SignerKey;\n\n if (opts.signer.ed25519PublicKey) {\n if (!StrKey.isValidEd25519PublicKey(opts.signer.ed25519PublicKey)) {\n throw new Error(\"signer.ed25519PublicKey is invalid.\");\n }\n const rawKey = StrKey.decodeEd25519PublicKey(opts.signer.ed25519PublicKey);\n key = xdr.SignerKey.signerKeyTypeEd25519(rawKey);\n } else if (opts.signer.preAuthTx) {\n let buffer: Buffer;\n\n if (typeof opts.signer.preAuthTx === \"string\") {\n buffer = Buffer.from(opts.signer.preAuthTx, \"hex\");\n } else {\n buffer = opts.signer.preAuthTx;\n }\n\n if (!(Buffer.isBuffer(buffer) && buffer.length === 32)) {\n throw new Error(\"signer.preAuthTx must be 32 bytes Buffer.\");\n }\n\n key = xdr.SignerKey.signerKeyTypePreAuthTx(buffer);\n } else if (opts.signer.sha256Hash) {\n let buffer: Buffer;\n\n if (typeof opts.signer.sha256Hash === \"string\") {\n buffer = Buffer.from(opts.signer.sha256Hash, \"hex\");\n } else {\n buffer = opts.signer.sha256Hash;\n }\n\n if (!(Buffer.isBuffer(buffer) && buffer.length === 32)) {\n throw new Error(\"signer.sha256Hash must be 32 bytes Buffer.\");\n }\n\n key = xdr.SignerKey.signerKeyTypeHashX(buffer);\n } else if (opts.signer.ed25519SignedPayload) {\n if (!StrKey.isValidSignedPayload(opts.signer.ed25519SignedPayload)) {\n throw new Error(\"signer.ed25519SignedPayload is invalid.\");\n }\n\n const rawPayload = StrKey.decodeSignedPayload(\n opts.signer.ed25519SignedPayload,\n );\n\n const signedPayloadXdr =\n xdr.SignerKeyEd25519SignedPayload.fromXDR(rawPayload);\n\n key = xdr.SignerKey.signerKeyTypeEd25519SignedPayload(signedPayloadXdr);\n } else {\n throw new Error(\"signer is invalid\");\n }\n\n const signer = new xdr.RevokeSponsorshipOpSigner({\n accountId: Keypair.fromPublicKey(opts.account).xdrAccountId(),\n signerKey: key,\n });\n\n const op = xdr.RevokeSponsorshipOp.revokeSponsorshipSigner(signer);\n\n const opAttributes: OperationAttributes = {\n sourceAccount: null,\n body: xdr.OperationBody.revokeSponsorship(op),\n };\n setSourceAccount(opAttributes, opts);\n\n return new xdr.Operation(opAttributes);\n}\n"],"names":["StrKey","xdr","Keypair","setSourceAccount","asset","Asset","LiquidityPoolId","Buffer","buffer"],"mappings":";;;;;;;;;;AAsCO,SAAS,wBAAA,CACd,IAAA,GAAqC,EAAC,EACS;AAC/C,EAAA,IAAI,CAACA,aAAA,CAAO,uBAAA,CAAwB,IAAA,CAAK,OAAO,CAAA,EAAG;AACjD,IAAA,MAAM,IAAI,MAAM,oBAAoB,CAAA;AAAA,EACtC;AAEA,EAAA,MAAM,SAAA,GAAYC,uBAAI,SAAA,CAAU,OAAA;AAAA,IAC9B,IAAIA,uBAAI,gBAAA,CAAiB;AAAA,MACvB,WAAWC,eAAA,CAAQ,aAAA,CAAc,IAAA,CAAK,OAAO,EAAE,YAAA;AAAa,KAC7D;AAAA,GACH;AACA,EAAA,MAAM,EAAA,GAAKD,sBAAA,CAAI,mBAAA,CAAoB,4BAAA,CAA6B,SAAS,CAAA;AAEzE,EAAA,MAAM,YAAA,GAAoC;AAAA,IACxC,aAAA,EAAe,IAAA;AAAA,IACf,IAAA,EAAMA,sBAAA,CAAI,a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7 @@ class ConfigGenerator {
|
|
|
20
20
|
const generatedPackageJson = {
|
|
21
21
|
name: contractName.toLowerCase().replace(/[^a-z0-9-]/g, "-"),
|
|
22
22
|
version: "0.0.1",
|
|
23
|
-
description: `Generated TypeScript bindings for ${contractName}
|
|
23
|
+
description: `Generated TypeScript bindings for ${contractName} Digital World contract`,
|
|
24
24
|
type: "module",
|
|
25
25
|
main: "dist/index.js",
|
|
26
26
|
types: "dist/index.d.ts",
|
|
@@ -28,7 +28,7 @@ class ConfigGenerator {
|
|
|
28
28
|
build: "tsc"
|
|
29
29
|
},
|
|
30
30
|
dependencies: {
|
|
31
|
-
"@stellar/stellar-sdk": `^${"16.0.
|
|
31
|
+
"@stellar/stellar-sdk": `^${"16.0.1"}`,
|
|
32
32
|
buffer: "6.0.3"
|
|
33
33
|
},
|
|
34
34
|
devDependencies: {
|
|
@@ -92,7 +92,7 @@ class ConfigGenerator {
|
|
|
92
92
|
const readme = [
|
|
93
93
|
`# ${contractName} Contract Bindings`,
|
|
94
94
|
"",
|
|
95
|
-
`TypeScript bindings for the ${contractName}
|
|
95
|
+
`TypeScript bindings for the ${contractName} Digital World smart contract.`,
|
|
96
96
|
"",
|
|
97
97
|
"## Installation",
|
|
98
98
|
"",
|
|
@@ -129,7 +129,7 @@ class ConfigGenerator {
|
|
|
129
129
|
"- `tsconfig.json` - TypeScript configuration",
|
|
130
130
|
"- `package.json` - NPM package configuration",
|
|
131
131
|
"",
|
|
132
|
-
"This package was generated using the
|
|
132
|
+
"This package was generated using the Digital World JS SDK contract binding generator."
|
|
133
133
|
].join("\n");
|
|
134
134
|
return readme;
|
|
135
135
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sources":["../../../src/bindings/config.ts"],"sourcesContent":["// The SDK version is baked in at build time via babel-plugin-transform-define.\n// Previously this was `import packageJson from \"../../package.json\"`, which\n// failed at runtime in deeper build outputs (e.g. lib/axios) because the\n// relative path `../../package.json` resolved into the output tree rather\n// than the project root.\n\ndeclare const __PACKAGE_VERSION__: string;\n\nexport interface ConfigGenerateOptions {\n contractName: string;\n}\n\nexport interface Configs {\n packageJson: string;\n tsConfig: string;\n gitignore: string;\n readme: string;\n}\n\n/**\n * Generates a complete TypeScript project structure with contract bindings\n */\nexport class ConfigGenerator {\n /**\n * Generate the complete TypeScript project\n */\n generate(options: ConfigGenerateOptions): Configs {\n const { contractName } = options;\n\n // Generate all project files\n return {\n packageJson: this.generatePackageJson(contractName),\n tsConfig: this.generateTsConfig(),\n gitignore: this.generateGitignore(),\n readme: this.generateReadme(contractName),\n };\n }\n\n /**\n * Generate package.json\n */\n private generatePackageJson(contractName: string): string {\n const generatedPackageJson = {\n name: contractName.toLowerCase().replace(/[^a-z0-9-]/g, \"-\"),\n version: \"0.0.1\",\n description: `Generated TypeScript bindings for ${contractName}
|
|
1
|
+
{"version":3,"file":"config.js","sources":["../../../src/bindings/config.ts"],"sourcesContent":["// The SDK version is baked in at build time via babel-plugin-transform-define.\n// Previously this was `import packageJson from \"../../package.json\"`, which\n// failed at runtime in deeper build outputs (e.g. lib/axios) because the\n// relative path `../../package.json` resolved into the output tree rather\n// than the project root.\n\ndeclare const __PACKAGE_VERSION__: string;\n\nexport interface ConfigGenerateOptions {\n contractName: string;\n}\n\nexport interface Configs {\n packageJson: string;\n tsConfig: string;\n gitignore: string;\n readme: string;\n}\n\n/**\n * Generates a complete TypeScript project structure with contract bindings\n */\nexport class ConfigGenerator {\n /**\n * Generate the complete TypeScript project\n */\n generate(options: ConfigGenerateOptions): Configs {\n const { contractName } = options;\n\n // Generate all project files\n return {\n packageJson: this.generatePackageJson(contractName),\n tsConfig: this.generateTsConfig(),\n gitignore: this.generateGitignore(),\n readme: this.generateReadme(contractName),\n };\n }\n\n /**\n * Generate package.json\n */\n private generatePackageJson(contractName: string): string {\n const generatedPackageJson = {\n name: contractName.toLowerCase().replace(/[^a-z0-9-]/g, \"-\"),\n version: \"0.0.1\",\n description: `Generated TypeScript bindings for ${contractName} Digital World contract`,\n type: \"module\",\n main: \"dist/index.js\",\n types: \"dist/index.d.ts\",\n scripts: {\n build: \"tsc\",\n },\n dependencies: {\n \"@stellar/stellar-sdk\": `^${__PACKAGE_VERSION__}`,\n buffer: \"6.0.3\",\n },\n devDependencies: {\n typescript: \"^5.6.3\",\n },\n };\n\n return JSON.stringify(generatedPackageJson, null, 2);\n }\n\n /**\n * Generate tsconfig.json\n */\n private generateTsConfig(): string {\n const tsConfig = {\n compilerOptions: {\n target: \"ESNext\",\n module: \"NodeNext\",\n moduleResolution: \"nodenext\",\n declaration: true,\n outDir: \"./dist\",\n strictNullChecks: true,\n skipLibCheck: true,\n },\n include: [\"src/*\"],\n };\n\n return JSON.stringify(tsConfig, null, 2);\n }\n\n /**\n * Generate .gitignore\n */\n private generateGitignore(): string {\n const gitignore = [\n \"# Dependencies\",\n \"node_modules/\",\n \"\",\n \"# Build outputs\",\n \"dist/\",\n \"*.tgz\",\n \"\",\n \"# IDE\",\n \".vscode/\",\n \".idea/\",\n \"\",\n \"# OS\",\n \".DS_Store\",\n \"Thumbs.db\",\n \"\",\n \"# Logs\",\n \"*.log\",\n \"npm-debug.log*\",\n \"\",\n \"# Runtime data\",\n \"*.pid\",\n \"*.seed\",\n ].join(\"\\n\");\n\n return gitignore;\n }\n\n /**\n * Generate README.md\n */\n private generateReadme(contractName: string): string {\n const readme = [\n `# ${contractName} Contract Bindings`,\n \"\",\n `TypeScript bindings for the ${contractName} Digital World smart contract.`,\n \"\",\n \"## Installation\",\n \"\",\n \"```bash\",\n \"npm install\",\n \"```\",\n \"\",\n \"## Build\",\n \"\",\n \"```bash\",\n \"npm run build\",\n \"```\",\n \"\",\n \"## Usage\",\n \"\",\n \"```typescript\",\n 'import { Client } from \"./src\";',\n \"\",\n \"const client = new Client({\",\n ' contractId: \"YOUR_CONTRACT_ID\",',\n ' rpcUrl: \"https://soroban-testnet.stellar.org:443\",',\n ' networkPassphrase: \"Test SDF Network ; September 2015\",',\n \"});\",\n \"\",\n \"// Call contract methods\",\n \"// const result = await client.methodName();\",\n \"```\",\n \"\",\n \"## Generated Files\",\n \"\",\n \"- `src/index.ts` - Entry point exporting the Client\",\n \"- `src/types.ts` - Type definitions for contract structs, enums, and unions\",\n \"- `src/contract.ts` - Client implementation\",\n \"- `tsconfig.json` - TypeScript configuration\",\n \"- `package.json` - NPM package configuration\",\n \"\",\n \"This package was generated using the Digital World JS SDK contract binding generator.\",\n ].join(\"\\n\");\n\n return readme;\n }\n}\n"],"names":[],"mappings":";;AAsBO,MAAM,eAAA,CAAgB;AAAA;AAAA;AAAA;AAAA,EAI3B,SAAS,OAAA,EAAyC;AAChD,IAAA,MAAM,EAAE,cAAa,GAAI,OAAA;AAGzB,IAAA,OAAO;AAAA,MACL,WAAA,EAAa,IAAA,CAAK,mBAAA,CAAoB,YAAY,CAAA;AAAA,MAClD,QAAA,EAAU,KAAK,gBAAA,EAAiB;AAAA,MAChC,SAAA,EAAW,KAAK,iBAAA,EAAkB;AAAA,MAClC,MAAA,EAAQ,IAAA,CAAK,cAAA,CAAe,YAAY;AAAA,KAC1C;AAAA,EACF;AAAA;AAAA;AAAA;AAAA,EAKQ,oBAAoB,YAAA,EAA8B;AACxD,IAAA,MAAM,oBAAA,GAAuB;AAAA,MAC3B,MAAM,YAAA,CAAa,WAAA,EAAY,CAAE,OAAA,CAAQ,eAAe,GAAG,CAAA;AAAA,MAC3D,OAAA,EAAS,OAAA;AAAA,MACT,WAAA,EAAa,qCAAqC,YAAY,CAAA,uBAAA,CAAA;AAAA,MAC9D,IAAA,EAAM,QAAA;AAAA,MACN,IAAA,EAAM,eAAA;AAAA,MACN,KAAA,EAAO,iBAAA;AAAA,MACP,OAAA,EAAS;AAAA,QACP,KAAA,EAAO;AAAA,OACT;AAAA,MACA,YAAA,EAAc;AAAA,QACZ,sBAAA,EAAwB,IAAI,QAAmB,CAAA,CAAA;AAAA,QAC/C,MAAA,EAAQ;AAAA,OACV;AAAA,MACA,eAAA,EAAiB;AAAA,Q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AAA;AAAA,MACA,+BAA+B,YAAY,CAAA,8BAAA,CAAA;AAAA,MAC3C,EAAA;AAAA,MACA,iBAAA;AAAA,MACA,EAAA;AAAA,MACA,SAAA;AAAA,MACA,aAAA;AAAA,MACA,KAAA;AAAA,MACA,EAAA;AAAA,MACA,UAAA;AAAA,MACA,EAAA;AAAA,MACA,SAAA;AAAA,MACA,eAAA;AAAA,MACA,KAAA;AAAA,MACA,EAAA;AAAA,MACA,UAAA;AAAA,MACA,EAAA;AAAA,MACA,eAAA;AAAA,MACA,iCAAA;AAAA,MACA,EAAA;AAAA,MACA,6BAAA;AAAA,MACA,mCAAA;AAAA,MACA,sDAAA;AAAA,MACA,2DAAA;AAAA,MACA,KAAA;AAAA,MACA,EAAA;AAAA,MACA,0BAAA;AAAA,MACA,8CAAA;AAAA,MACA,KAAA;AAAA,MACA,EAAA;AAAA,MACA,oBAAA;AAAA,MACA,EAAA;AAAA,MACA,qDAAA;AAAA,MACA,6EAAA;AAAA,MACA,6CAAA;AAAA,MACA,8CAAA;AAAA,MACA,8CAAA;AAAA,MACA,EAAA;AAAA,MACA;AAAA,KACF,CAAE,KAAK,IAAI,CAAA;AAEX,IAAA,OAAO,MAAA;AAAA,EACT;AACF;;;;"}
|
|
@@ -80,12 +80,12 @@ class BindingGenerator {
|
|
|
80
80
|
/**
|
|
81
81
|
* Creates a BindingGenerator by fetching WASM from the network using its hash.
|
|
82
82
|
*
|
|
83
|
-
* Retrieves the WASM bytecode from
|
|
83
|
+
* Retrieves the WASM bytecode from Digital World RPC using the WASM hash,
|
|
84
84
|
* then parses the contract specification from it. Useful when you know
|
|
85
85
|
* the hash of an installed WASM but don't have the binary locally.
|
|
86
86
|
*
|
|
87
87
|
* @param wasmHash - The hex-encoded hash of the installed WASM blob
|
|
88
|
-
* @param rpcServer - The
|
|
88
|
+
* @param rpcServer - The Digital World RPC server instance
|
|
89
89
|
* @returns A Promise resolving to a new BindingGenerator instance
|
|
90
90
|
* @throws If the WASM cannot be fetched or doesn't contain a valid spec
|
|
91
91
|
*
|
|
@@ -109,11 +109,11 @@ class BindingGenerator {
|
|
|
109
109
|
* Creates a BindingGenerator by fetching contract info from a deployed contract ID.
|
|
110
110
|
*
|
|
111
111
|
* Retrieves the contract's WASM from the network using the contract ID,
|
|
112
|
-
* then parses the specification. If the contract is a
|
|
112
|
+
* then parses the specification. If the contract is a Digital World Asset Contract (SAC),
|
|
113
113
|
* returns a generator with the standard SAC specification.
|
|
114
114
|
*
|
|
115
115
|
* @param contractId - The contract ID (C... address) of the deployed contract
|
|
116
|
-
* @param rpcServer - The
|
|
116
|
+
* @param rpcServer - The Digital World RPC server instance
|
|
117
117
|
* @returns A Promise resolving to a new BindingGenerator instance
|
|
118
118
|
* @throws If the contract cannot be found or fetched
|
|
119
119
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generator.js","sources":["../../../src/bindings/generator.ts"],"sourcesContent":["import { Spec } from \"../contract/index.js\";\nimport { ConfigGenerator } from \"./config.js\";\nimport { TypeGenerator } from \"./types.js\";\nimport { ClientGenerator } from \"./client.js\";\nimport { specFromWasm } from \"../contract/wasm_spec_parser.js\";\nimport { fetchFromContractId, fetchFromWasmHash } from \"./wasm_fetcher.js\";\nimport { SAC_SPEC } from \"./sac-spec.js\";\nimport { Server } from \"../rpc/index.js\";\n\n/**\n * Options for generating TypeScript bindings.\n */\nexport type GenerateOptions = {\n /**\n * The name used for the generated package and client class.\n * Should be in kebab-case (e.g., \"my-contract\").\n */\n contractName: string;\n};\n\n/**\n * The output of the binding generation process.\n *\n * Contains all generated TypeScript source files and configuration files\n * needed to create a standalone npm package for interacting with a Stellar contract.\n */\nexport type GeneratedBindings = {\n /** The index.ts barrel export file that re-exports Client and types */\n index: string;\n /** The types.ts file containing TypeScript interfaces for contract structs, enums, and unions */\n types: string;\n /** The client.ts file containing the generated Client class with typed methods */\n client: string;\n /** The package.json for the generated npm package */\n packageJson: string;\n /** The tsconfig.json for TypeScript compilation */\n tsConfig: string;\n /** The README.md with usage documentation */\n readme: string;\n /** The .gitignore file for the generated package */\n gitignore: string;\n};\n\n/**\n * Generates TypeScript bindings for Stellar smart contracts.\n *\n * This class creates fully-typed TypeScript client code from a contract's specification,\n * allowing developers to interact with Stellar smart contracts with full IDE support\n * and compile-time type checking.\n *\n * @example\n * ```ts\n * // Create from a local WASM file\n * const wasmBuffer = fs.readFileSync(\"./my_contract.wasm\");\n * const generator = await BindingGenerator.fromWasm(wasmBuffer);\n * const bindings = generator.generate({ contractName: \"my-contract\" });\n * ```\n *\n * @example\n * ```ts\n * // Create from a contract deployed on the network\n * const generator = await BindingGenerator.fromContractId(\n * \"CABC...XYZ\",\n * \"https://soroban-testnet.stellar.org\",\n * Networks.TESTNET\n * );\n * const bindings = generator.generate({ contractName: \"my-contract\" });\n * ```\n *\n * @example\n * ```ts\n * // Create from a Spec object directly\n * const spec = new Spec(specEntries);\n * const generator = BindingGenerator.fromSpec(spec);\n * const bindings = generator.generate({ contractName: \"my-contract\" });\n * ```\n */\nexport class BindingGenerator {\n private spec: Spec;\n\n /**\n * Private constructor - use static factory methods instead.\n *\n * @param spec - The parsed contract specification\n */\n private constructor(spec: Spec) {\n this.spec = spec;\n }\n\n /**\n * Creates a BindingGenerator from an existing Spec object.\n *\n * Use this when you already have a parsed contract specification,\n * such as from manually constructed spec entries or from another source.\n *\n * @param spec - The contract specification containing function and type definitions\n * @returns A new BindingGenerator instance\n *\n * @example\n * ```ts\n * const spec = new Spec(specEntries);\n * const generator = BindingGenerator.fromSpec(spec);\n * ```\n */\n static fromSpec(spec: Spec): BindingGenerator {\n return new BindingGenerator(spec);\n }\n\n /**\n * Creates a BindingGenerator from a WASM binary buffer.\n *\n * Parses the contract specification directly from the WASM file's custom section.\n * This is the most common method when working with locally compiled contracts.\n *\n * @param wasmBuffer - The raw WASM binary as a Buffer\n * @returns A Promise resolving to a new BindingGenerator instance\n * @throws If the WASM file doesn't contain a valid contract spec\n *\n * @example\n * ```ts\n * const wasmBuffer = fs.readFileSync(\"./target/wasm32-unknown-unknown/release/my_contract.wasm\");\n * const generator = await BindingGenerator.fromWasm(wasmBuffer);\n * ```\n */\n static fromWasm(wasmBuffer: Buffer): BindingGenerator {\n const spec = new Spec(specFromWasm(wasmBuffer));\n return new BindingGenerator(spec);\n }\n\n /**\n * Creates a BindingGenerator by fetching WASM from the network using its hash.\n *\n * Retrieves the WASM bytecode from Stellar RPC using the WASM hash,\n * then parses the contract specification from it. Useful when you know\n * the hash of an installed WASM but don't have the binary locally.\n *\n * @param wasmHash - The hex-encoded hash of the installed WASM blob\n * @param rpcServer - The Stellar RPC server instance\n * @returns A Promise resolving to a new BindingGenerator instance\n * @throws If the WASM cannot be fetched or doesn't contain a valid spec\n *\n * @example\n * ```ts\n * const generator = await BindingGenerator.fromWasmHash(\n * \"a1b2c3...xyz\",\n * \"https://soroban-testnet.stellar.org\",\n * Networks.TESTNET\n * );\n * ```\n */\n static async fromWasmHash(\n wasmHash: string,\n rpcServer: Server,\n ): Promise<BindingGenerator> {\n const wasm = await fetchFromWasmHash(wasmHash, rpcServer);\n if (wasm.type !== \"wasm\") {\n throw new Error(\"Fetched contract is not of type 'wasm'\");\n }\n return BindingGenerator.fromWasm(wasm.wasmBytes);\n }\n\n /**\n * Creates a BindingGenerator by fetching contract info from a deployed contract ID.\n *\n * Retrieves the contract's WASM from the network using the contract ID,\n * then parses the specification. If the contract is a Stellar Asset Contract (SAC),\n * returns a generator with the standard SAC specification.\n *\n * @param contractId - The contract ID (C... address) of the deployed contract\n * @param rpcServer - The Stellar RPC server instance\n * @returns A Promise resolving to a new BindingGenerator instance\n * @throws If the contract cannot be found or fetched\n *\n * @example\n * ```ts\n * const generator = await BindingGenerator.fromContractId(\n * \"CABC123...XYZ\",\n * rpcServer\n * );\n * ```\n */\n static async fromContractId(\n contractId: string,\n rpcServer: Server,\n ): Promise<BindingGenerator> {\n const result = await fetchFromContractId(contractId, rpcServer);\n if (result.type === \"wasm\") {\n return BindingGenerator.fromWasm(result.wasmBytes);\n }\n // Stellar Asset Contract\n const spec = new Spec(SAC_SPEC);\n return BindingGenerator.fromSpec(spec);\n }\n\n /**\n * Generates TypeScript bindings for the contract.\n *\n * Produces all the files needed for a standalone npm package:\n * - `client.ts`: A typed Client class with methods for each contract function\n * - `types.ts`: TypeScript interfaces for all contract types (structs, enums, unions)\n * - `index.ts`: Barrel export file\n * - `package.json`, `tsconfig.json`, `README.md`, `.gitignore`: Package configuration\n *\n * The generated code does not write to disk - use the returned strings\n * to write files as needed.\n *\n * @param options - Configuration options for generation\n * - `contractName`: Required. The name for the generated package (kebab-case recommended)\n * @returns An object containing all generated file contents as strings\n * @throws If contractName is missing or empty\n *\n * @example\n * ```ts\n * const bindings = generator.generate({\n * contractName: \"my-token\",\n * contractAddress: \"CABC...XYZ\",\n * rpcUrl: \"https://soroban-testnet.stellar.org\",\n * networkPassphrase: Networks.TESTNET\n * });\n *\n * // Write files to disk\n * fs.writeFileSync(\"./src/client.ts\", bindings.client);\n * fs.writeFileSync(\"./src/types.ts\", bindings.types);\n * ```\n */\n generate(options: GenerateOptions): GeneratedBindings {\n this.validateOptions(options);\n\n const typeGenerator = new TypeGenerator(this.spec);\n const clientGenerator = new ClientGenerator(this.spec);\n\n const types = typeGenerator.generate();\n const client = clientGenerator.generate();\n\n let index = `export { Client } from \"./client.js\";`;\n if (types.trim() !== \"\") {\n index = index.concat(`\\nexport * from \"./types.js\";`);\n }\n\n // Generate config files\n const configGenerator = new ConfigGenerator();\n const { packageJson, tsConfig, readme, gitignore } =\n configGenerator.generate(options);\n\n return {\n index,\n types,\n client,\n packageJson,\n tsConfig,\n readme,\n gitignore,\n };\n }\n\n /**\n * Validates that required generation options are provided.\n *\n * @param options - The options to validate\n * @throws If contractName is missing or empty\n */\n private validateOptions(options: GenerateOptions): void {\n if (!options.contractName || options.contractName.trim() === \"\") {\n throw new Error(\"contractName is required and cannot be empty\");\n }\n }\n}\n"],"names":["spec","Spec","specFromWasm","fetchFromWasmHash","fetchF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AAE,aAAa,QAAA,EAAU,MAAA,EAAQ,WAAU,GAC/C,eAAA,CAAgB,SAAS,OAAO,CAAA;AAElC,IAAA,OAAO;AAAA,MACL,KAAA;AAAA,aACAF,OAAA;AAAA,cACAC,QAAA;AAAA,MACA,WAAA;AAAA,MACA,QAAA;AAAA,MACA,MAAA;AAAA,MACA;AAAA,KACF;AAAA,EACF;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQQ,gBAAgB,OAAA,EAAgC;AACtD,IAAA,IAAI,CAAC,OAAA,CAAQ,YAAA,IAAgB,QAAQ,YAAA,CAAa,IAAA,OAAW,EAAA,EAAI;AAC/D,MAAA,MAAM,IAAI,MAAM,8CAA8C,CAAA;AAAA,IAChE;AAAA,EACF;AACF;;;;"}
|
|
1
|
+
{"version":3,"file":"generator.js","sources":["../../../src/bindings/generator.ts"],"sourcesContent":["import { Spec } from \"../contract/index.js\";\nimport { ConfigGenerator } from \"./config.js\";\nimport { TypeGenerator } from \"./types.js\";\nimport { ClientGenerator } from \"./client.js\";\nimport { specFromWasm } from \"../contract/wasm_spec_parser.js\";\nimport { fetchFromContractId, fetchFromWasmHash } from \"./wasm_fetcher.js\";\nimport { SAC_SPEC } from \"./sac-spec.js\";\nimport { Server } from \"../rpc/index.js\";\n\n/**\n * Options for generating TypeScript bindings.\n */\nexport type GenerateOptions = {\n /**\n * The name used for the generated package and client class.\n * Should be in kebab-case (e.g., \"my-contract\").\n */\n contractName: string;\n};\n\n/**\n * The output of the binding generation process.\n *\n * Contains all generated TypeScript source files and configuration files\n * needed to create a standalone npm package for interacting with a Digital World contract.\n */\nexport type GeneratedBindings = {\n /** The index.ts barrel export file that re-exports Client and types */\n index: string;\n /** The types.ts file containing TypeScript interfaces for contract structs, enums, and unions */\n types: string;\n /** The client.ts file containing the generated Client class with typed methods */\n client: string;\n /** The package.json for the generated npm package */\n packageJson: string;\n /** The tsconfig.json for TypeScript compilation */\n tsConfig: string;\n /** The README.md with usage documentation */\n readme: string;\n /** The .gitignore file for the generated package */\n gitignore: string;\n};\n\n/**\n * Generates TypeScript bindings for Digital World smart contracts.\n *\n * This class creates fully-typed TypeScript client code from a contract's specification,\n * allowing developers to interact with Digital World smart contracts with full IDE support\n * and compile-time type checking.\n *\n * @example\n * ```ts\n * // Create from a local WASM file\n * const wasmBuffer = fs.readFileSync(\"./my_contract.wasm\");\n * const generator = await BindingGenerator.fromWasm(wasmBuffer);\n * const bindings = generator.generate({ contractName: \"my-contract\" });\n * ```\n *\n * @example\n * ```ts\n * // Create from a contract deployed on the network\n * const generator = await BindingGenerator.fromContractId(\n * \"CABC...XYZ\",\n * \"https://soroban-testnet.stellar.org\",\n * Networks.TESTNET\n * );\n * const bindings = generator.generate({ contractName: \"my-contract\" });\n * ```\n *\n * @example\n * ```ts\n * // Create from a Spec object directly\n * const spec = new Spec(specEntries);\n * const generator = BindingGenerator.fromSpec(spec);\n * const bindings = generator.generate({ contractName: \"my-contract\" });\n * ```\n */\nexport class BindingGenerator {\n private spec: Spec;\n\n /**\n * Private constructor - use static factory methods instead.\n *\n * @param spec - The parsed contract specification\n */\n private constructor(spec: Spec) {\n this.spec = spec;\n }\n\n /**\n * Creates a BindingGenerator from an existing Spec object.\n *\n * Use this when you already have a parsed contract specification,\n * such as from manually constructed spec entries or from another source.\n *\n * @param spec - The contract specification containing function and type definitions\n * @returns A new BindingGenerator instance\n *\n * @example\n * ```ts\n * const spec = new Spec(specEntries);\n * const generator = BindingGenerator.fromSpec(spec);\n * ```\n */\n static fromSpec(spec: Spec): BindingGenerator {\n return new BindingGenerator(spec);\n }\n\n /**\n * Creates a BindingGenerator from a WASM binary buffer.\n *\n * Parses the contract specification directly from the WASM file's custom section.\n * This is the most common method when working with locally compiled contracts.\n *\n * @param wasmBuffer - The raw WASM binary as a Buffer\n * @returns A Promise resolving to a new BindingGenerator instance\n * @throws If the WASM file doesn't contain a valid contract spec\n *\n * @example\n * ```ts\n * const wasmBuffer = fs.readFileSync(\"./target/wasm32-unknown-unknown/release/my_contract.wasm\");\n * const generator = await BindingGenerator.fromWasm(wasmBuffer);\n * ```\n */\n static fromWasm(wasmBuffer: Buffer): BindingGenerator {\n const spec = new Spec(specFromWasm(wasmBuffer));\n return new BindingGenerator(spec);\n }\n\n /**\n * Creates a BindingGenerator by fetching WASM from the network using its hash.\n *\n * Retrieves the WASM bytecode from Digital World RPC using the WASM hash,\n * then parses the contract specification from it. Useful when you know\n * the hash of an installed WASM but don't have the binary locally.\n *\n * @param wasmHash - The hex-encoded hash of the installed WASM blob\n * @param rpcServer - The Digital World RPC server instance\n * @returns A Promise resolving to a new BindingGenerator instance\n * @throws If the WASM cannot be fetched or doesn't contain a valid spec\n *\n * @example\n * ```ts\n * const generator = await BindingGenerator.fromWasmHash(\n * \"a1b2c3...xyz\",\n * \"https://soroban-testnet.stellar.org\",\n * Networks.TESTNET\n * );\n * ```\n */\n static async fromWasmHash(\n wasmHash: string,\n rpcServer: Server,\n ): Promise<BindingGenerator> {\n const wasm = await fetchFromWasmHash(wasmHash, rpcServer);\n if (wasm.type !== \"wasm\") {\n throw new Error(\"Fetched contract is not of type 'wasm'\");\n }\n return BindingGenerator.fromWasm(wasm.wasmBytes);\n }\n\n /**\n * Creates a BindingGenerator by fetching contract info from a deployed contract ID.\n *\n * Retrieves the contract's WASM from the network using the contract ID,\n * then parses the specification. If the contract is a Digital World Asset Contract (SAC),\n * returns a generator with the standard SAC specification.\n *\n * @param contractId - The contract ID (C... address) of the deployed contract\n * @param rpcServer - The Digital World RPC server instance\n * @returns A Promise resolving to a new BindingGenerator instance\n * @throws If the contract cannot be found or fetched\n *\n * @example\n * ```ts\n * const generator = await BindingGenerator.fromContractId(\n * \"CABC123...XYZ\",\n * rpcServer\n * );\n * ```\n */\n static async fromContractId(\n contractId: string,\n rpcServer: Server,\n ): Promise<BindingGenerator> {\n const result = await fetchFromContractId(contractId, rpcServer);\n if (result.type === \"wasm\") {\n return BindingGenerator.fromWasm(result.wasmBytes);\n }\n // Digital World Asset Contract\n const spec = new Spec(SAC_SPEC);\n return BindingGenerator.fromSpec(spec);\n }\n\n /**\n * Generates TypeScript bindings for the contract.\n *\n * Produces all the files needed for a standalone npm package:\n * - `client.ts`: A typed Client class with methods for each contract function\n * - `types.ts`: TypeScript interfaces for all contract types (structs, enums, unions)\n * - `index.ts`: Barrel export file\n * - `package.json`, `tsconfig.json`, `README.md`, `.gitignore`: Package configuration\n *\n * The generated code does not write to disk - use the returned strings\n * to write files as needed.\n *\n * @param options - Configuration options for generation\n * - `contractName`: Required. The name for the generated package (kebab-case recommended)\n * @returns An object containing all generated file contents as strings\n * @throws If contractName is missing or empty\n *\n * @example\n * ```ts\n * const bindings = generator.generate({\n * contractName: \"my-token\",\n * contractAddress: \"CABC...XYZ\",\n * rpcUrl: \"https://soroban-testnet.stellar.org\",\n * networkPassphrase: Networks.TESTNET\n * });\n *\n * // Write files to disk\n * fs.writeFileSync(\"./src/client.ts\", bindings.client);\n * fs.writeFileSync(\"./src/types.ts\", bindings.types);\n * ```\n */\n generate(options: GenerateOptions): GeneratedBindings {\n this.validateOptions(options);\n\n const typeGenerator = new TypeGenerator(this.spec);\n const clientGenerator = new ClientGenerator(this.spec);\n\n const types = typeGenerator.generate();\n const client = clientGenerator.generate();\n\n let index = `export { Client } from \"./client.js\";`;\n if (types.trim() !== \"\") {\n index = index.concat(`\\nexport * from \"./types.js\";`);\n }\n\n // Generate config files\n const configGenerator = new ConfigGenerator();\n const { packageJson, tsConfig, readme, gitignore } =\n configGenerator.generate(options);\n\n return {\n index,\n types,\n client,\n packageJson,\n tsConfig,\n readme,\n gitignore,\n };\n }\n\n /**\n * Validates that required generation options are provided.\n *\n * @param options - The options to validate\n * @throws If contractName is missing or empty\n */\n private validateOptions(options: GenerateOptions): void {\n if (!options.contractName || options.contractName.trim() === \"\") {\n throw new Error(\"contractName is required and cannot be empty\");\n }\n }\n}\n"],"names":["spec","Spec","specFromWasm","fetchFromWasmHash","fetchFromContractId","SAC_SPEC","TypeGenerator","ClientG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