@dynamic-labs-sdk/stellar 0.0.0 → 1.16.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.
Files changed (115) hide show
  1. package/README.md +21 -0
  2. package/dist/StellarNetworkProvider.types.d.ts +8 -0
  3. package/dist/StellarNetworkProvider.types.d.ts.map +1 -0
  4. package/dist/StellarProvider.types.d.ts +83 -0
  5. package/dist/StellarProvider.types.d.ts.map +1 -0
  6. package/dist/StellarWalletAccount.types.d.ts +8 -0
  7. package/dist/StellarWalletAccount.types.d.ts.map +1 -0
  8. package/dist/StellarWalletProvider.types.d.ts +12 -0
  9. package/dist/StellarWalletProvider.types.d.ts.map +1 -0
  10. package/dist/addStellarExtension/addStellarExtension.d.ts +11 -0
  11. package/dist/addStellarExtension/addStellarExtension.d.ts.map +1 -0
  12. package/dist/addStellarExtension/index.d.ts +2 -0
  13. package/dist/addStellarExtension/index.d.ts.map +1 -0
  14. package/dist/errors/FetchStellarBalanceError/FetchStellarBalanceError.d.ts +9 -0
  15. package/dist/errors/FetchStellarBalanceError/FetchStellarBalanceError.d.ts.map +1 -0
  16. package/dist/errors/FetchStellarBalanceError/index.d.ts +2 -0
  17. package/dist/errors/FetchStellarBalanceError/index.d.ts.map +1 -0
  18. package/dist/errors/NotOneKeyProviderError/NotOneKeyProviderError.d.ts +5 -0
  19. package/dist/errors/NotOneKeyProviderError/NotOneKeyProviderError.d.ts.map +1 -0
  20. package/dist/errors/NotOneKeyProviderError/index.d.ts +2 -0
  21. package/dist/errors/NotOneKeyProviderError/index.d.ts.map +1 -0
  22. package/dist/errors/NotStellarProviderError/NotStellarProviderError.d.ts +8 -0
  23. package/dist/errors/NotStellarProviderError/NotStellarProviderError.d.ts.map +1 -0
  24. package/dist/errors/NotStellarProviderError/index.d.ts +2 -0
  25. package/dist/errors/NotStellarProviderError/index.d.ts.map +1 -0
  26. package/dist/exports/index.d.ts +7 -0
  27. package/dist/exports/index.d.ts.map +1 -0
  28. package/dist/index.cjs +767 -0
  29. package/dist/index.cjs.map +1 -0
  30. package/dist/index.esm.js +764 -0
  31. package/dist/index.esm.js.map +1 -0
  32. package/dist/injected/addStellarInjectedWalletsExtension/addStellarInjectedWalletsExtension.d.ts +16 -0
  33. package/dist/injected/addStellarInjectedWalletsExtension/addStellarInjectedWalletsExtension.d.ts.map +1 -0
  34. package/dist/injected/addStellarInjectedWalletsExtension/index.d.ts +2 -0
  35. package/dist/injected/addStellarInjectedWalletsExtension/index.d.ts.map +1 -0
  36. package/dist/injected/utils/createFreighterProvider/createFreighterProvider.d.ts +9 -0
  37. package/dist/injected/utils/createFreighterProvider/createFreighterProvider.d.ts.map +1 -0
  38. package/dist/injected/utils/createFreighterProvider/index.d.ts +2 -0
  39. package/dist/injected/utils/createFreighterProvider/index.d.ts.map +1 -0
  40. package/dist/injected/utils/createLobstrProvider/createLobstrProvider.d.ts +9 -0
  41. package/dist/injected/utils/createLobstrProvider/createLobstrProvider.d.ts.map +1 -0
  42. package/dist/injected/utils/createLobstrProvider/index.d.ts +2 -0
  43. package/dist/injected/utils/createLobstrProvider/index.d.ts.map +1 -0
  44. package/dist/injected/utils/createOneKeyProvider/createOneKeyProvider.d.ts +9 -0
  45. package/dist/injected/utils/createOneKeyProvider/createOneKeyProvider.d.ts.map +1 -0
  46. package/dist/injected/utils/createOneKeyProvider/index.d.ts +2 -0
  47. package/dist/injected/utils/createOneKeyProvider/index.d.ts.map +1 -0
  48. package/dist/injected/utils/createWalletProviderFromStellarProvider/createWalletProviderFromStellarProvider.d.ts +23 -0
  49. package/dist/injected/utils/createWalletProviderFromStellarProvider/createWalletProviderFromStellarProvider.d.ts.map +1 -0
  50. package/dist/injected/utils/createWalletProviderFromStellarProvider/index.d.ts +2 -0
  51. package/dist/injected/utils/createWalletProviderFromStellarProvider/index.d.ts.map +1 -0
  52. package/dist/injected/utils/getOneKeyStellarProvider/getOneKeyStellarProvider.d.ts +37 -0
  53. package/dist/injected/utils/getOneKeyStellarProvider/getOneKeyStellarProvider.d.ts.map +1 -0
  54. package/dist/injected/utils/getOneKeyStellarProvider/index.d.ts +2 -0
  55. package/dist/injected/utils/getOneKeyStellarProvider/index.d.ts.map +1 -0
  56. package/dist/isStellarNetworkProvider/index.d.ts +2 -0
  57. package/dist/isStellarNetworkProvider/index.d.ts.map +1 -0
  58. package/dist/isStellarNetworkProvider/isStellarNetworkProvider.d.ts +11 -0
  59. package/dist/isStellarNetworkProvider/isStellarNetworkProvider.d.ts.map +1 -0
  60. package/dist/isStellarWalletAccount/index.d.ts +2 -0
  61. package/dist/isStellarWalletAccount/index.d.ts.map +1 -0
  62. package/dist/isStellarWalletAccount/isStellarWalletAccount.d.ts +11 -0
  63. package/dist/isStellarWalletAccount/isStellarWalletAccount.d.ts.map +1 -0
  64. package/dist/isStellarWalletProvider/index.d.ts +2 -0
  65. package/dist/isStellarWalletProvider/index.d.ts.map +1 -0
  66. package/dist/isStellarWalletProvider/isStellarWalletProvider.d.ts +11 -0
  67. package/dist/isStellarWalletProvider/isStellarWalletProvider.d.ts.map +1 -0
  68. package/dist/registerStellarNetworkProviderBuilder/index.d.ts +2 -0
  69. package/dist/registerStellarNetworkProviderBuilder/index.d.ts.map +1 -0
  70. package/dist/registerStellarNetworkProviderBuilder/registerStellarNetworkProviderBuilder.d.ts +9 -0
  71. package/dist/registerStellarNetworkProviderBuilder/registerStellarNetworkProviderBuilder.d.ts.map +1 -0
  72. package/dist/signTransaction/index.d.ts +2 -0
  73. package/dist/signTransaction/index.d.ts.map +1 -0
  74. package/dist/signTransaction/signTransaction.d.ts +19 -0
  75. package/dist/signTransaction/signTransaction.d.ts.map +1 -0
  76. package/dist/tsconfig.lib.tsbuildinfo +1 -0
  77. package/dist/utils/buildPaymentTransaction/buildPaymentTransaction.d.ts +22 -0
  78. package/dist/utils/buildPaymentTransaction/buildPaymentTransaction.d.ts.map +1 -0
  79. package/dist/utils/buildPaymentTransaction/index.d.ts +2 -0
  80. package/dist/utils/buildPaymentTransaction/index.d.ts.map +1 -0
  81. package/dist/utils/checkTrustline/checkTrustline.d.ts +17 -0
  82. package/dist/utils/checkTrustline/checkTrustline.d.ts.map +1 -0
  83. package/dist/utils/checkTrustline/index.d.ts +2 -0
  84. package/dist/utils/checkTrustline/index.d.ts.map +1 -0
  85. package/dist/utils/constants.d.ts +29 -0
  86. package/dist/utils/constants.d.ts.map +1 -0
  87. package/dist/utils/createPaymentAsset/createPaymentAsset.d.ts +15 -0
  88. package/dist/utils/createPaymentAsset/createPaymentAsset.d.ts.map +1 -0
  89. package/dist/utils/createPaymentAsset/index.d.ts +2 -0
  90. package/dist/utils/createPaymentAsset/index.d.ts.map +1 -0
  91. package/dist/utils/createStellarNetworkProvider/createStellarNetworkProvider.d.ts +10 -0
  92. package/dist/utils/createStellarNetworkProvider/createStellarNetworkProvider.d.ts.map +1 -0
  93. package/dist/utils/createStellarNetworkProvider/index.d.ts +2 -0
  94. package/dist/utils/createStellarNetworkProvider/index.d.ts.map +1 -0
  95. package/dist/utils/fetchStellarBalance/fetchStellarBalance.d.ts +17 -0
  96. package/dist/utils/fetchStellarBalance/fetchStellarBalance.d.ts.map +1 -0
  97. package/dist/utils/fetchStellarBalance/index.d.ts +2 -0
  98. package/dist/utils/fetchStellarBalance/index.d.ts.map +1 -0
  99. package/dist/utils/getNetworkPassphrase/getNetworkPassphrase.d.ts +13 -0
  100. package/dist/utils/getNetworkPassphrase/getNetworkPassphrase.d.ts.map +1 -0
  101. package/dist/utils/getNetworkPassphrase/index.d.ts +2 -0
  102. package/dist/utils/getNetworkPassphrase/index.d.ts.map +1 -0
  103. package/dist/utils/getStellarNetworkId/getStellarNetworkId.d.ts +22 -0
  104. package/dist/utils/getStellarNetworkId/getStellarNetworkId.d.ts.map +1 -0
  105. package/dist/utils/getStellarNetworkId/index.d.ts +2 -0
  106. package/dist/utils/getStellarNetworkId/index.d.ts.map +1 -0
  107. package/dist/utils/normalizeNetworkName/index.d.ts +2 -0
  108. package/dist/utils/normalizeNetworkName/index.d.ts.map +1 -0
  109. package/dist/utils/normalizeNetworkName/normalizeNetworkName.d.ts +21 -0
  110. package/dist/utils/normalizeNetworkName/normalizeNetworkName.d.ts.map +1 -0
  111. package/dist/utils/stellarTransferAmount/index.d.ts +2 -0
  112. package/dist/utils/stellarTransferAmount/index.d.ts.map +1 -0
  113. package/dist/utils/stellarTransferAmount/stellarTransferAmount.d.ts +22 -0
  114. package/dist/utils/stellarTransferAmount/stellarTransferAmount.d.ts.map +1 -0
  115. package/package.json +40 -1
@@ -0,0 +1,22 @@
1
+ import { type Asset, type Horizon, type Transaction } from '@stellar/stellar-sdk';
2
+ type BuildPaymentTransactionParams = {
3
+ amount: string;
4
+ asset: Asset;
5
+ networkPassphrase: string;
6
+ recipient: string;
7
+ sourceAccount: Horizon.AccountResponse;
8
+ };
9
+ /**
10
+ * Builds a Stellar payment transaction sending `amount` of `asset` from the
11
+ * source account to the recipient.
12
+ *
13
+ * @param amount - Amount to send, as a decimal string in the asset's units.
14
+ * @param asset - The asset to send (native or custom).
15
+ * @param networkPassphrase - The network passphrase to sign against.
16
+ * @param recipient - The destination account address.
17
+ * @param sourceAccount - The sender's account loaded from Horizon.
18
+ * @notInstrumented
19
+ */
20
+ export declare const buildPaymentTransaction: ({ amount, asset, networkPassphrase, recipient, sourceAccount, }: BuildPaymentTransactionParams) => Transaction;
21
+ export {};
22
+ //# sourceMappingURL=buildPaymentTransaction.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"buildPaymentTransaction.d.ts","sourceRoot":"","sources":["../../../src/utils/buildPaymentTransaction/buildPaymentTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,KAAK,EAEV,KAAK,OAAO,EAEZ,KAAK,WAAW,EAEjB,MAAM,sBAAsB,CAAC;AAI9B,KAAK,6BAA6B,GAAG;IACnC,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,KAAK,CAAC;IACb,iBAAiB,EAAE,MAAM,CAAC;IAC1B,SAAS,EAAE,MAAM,CAAC;IAClB,aAAa,EAAE,OAAO,CAAC,eAAe,CAAC;CACxC,CAAC;AAEF;;;;;;;;;;GAUG;AACH,eAAO,MAAM,uBAAuB,oEAMjC,6BAA6B,KAAG,WAavB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { buildPaymentTransaction } from './buildPaymentTransaction';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/buildPaymentTransaction/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,uBAAuB,EAAE,MAAM,2BAA2B,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { Asset, Horizon } from '@stellar/stellar-sdk';
2
+ type CheckTrustlineParams = {
3
+ account: Horizon.AccountResponse;
4
+ asset: Asset;
5
+ };
6
+ /**
7
+ * Returns whether an account can receive the given asset. The native asset
8
+ * (XLM) never needs a trustline; non-native assets require a matching
9
+ * credit balance (trustline) on the account.
10
+ *
11
+ * @param account - The destination account loaded from Horizon.
12
+ * @param asset - The asset being sent.
13
+ * @notInstrumented
14
+ */
15
+ export declare const checkTrustline: ({ account, asset, }: CheckTrustlineParams) => boolean;
16
+ export {};
17
+ //# sourceMappingURL=checkTrustline.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"checkTrustline.d.ts","sourceRoot":"","sources":["../../../src/utils/checkTrustline/checkTrustline.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAE3D,KAAK,oBAAoB,GAAG;IAC1B,OAAO,EAAE,OAAO,CAAC,eAAe,CAAC;IACjC,KAAK,EAAE,KAAK,CAAC;CACd,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,wBAGxB,oBAAoB,KAAG,OAezB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { checkTrustline } from './checkTrustline';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/checkTrustline/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
@@ -0,0 +1,29 @@
1
+ import type { StellarNetworkName } from '../StellarProvider.types';
2
+ /**
3
+ * Stellar network passphrase for mainnet
4
+ */
5
+ export declare const STELLAR_PUBLIC_NETWORK_PASSPHRASE = "Public Global Stellar Network ; September 2015";
6
+ /**
7
+ * Stellar network passphrase for testnet
8
+ */
9
+ export declare const STELLAR_TESTNET_NETWORK_PASSPHRASE = "Test SDF Network ; September 2015";
10
+ /**
11
+ * Stellar network passphrase for futurenet
12
+ */
13
+ export declare const STELLAR_FUTURENET_NETWORK_PASSPHRASE = "Test SDF Future Network ; October 2022";
14
+ /**
15
+ * Number of stroops per XLM (1 XLM = 10,000,000 stroops)
16
+ */
17
+ export declare const STROOPS_PER_XLM = 10000000;
18
+ /**
19
+ * Network passphrase keyed by Stellar network name. The SDK's network
20
+ * identifier (chain ID) is the SHA-256 hash of these passphrases.
21
+ */
22
+ export declare const STELLAR_PASSPHRASE_BY_NAME: Record<StellarNetworkName, string>;
23
+ /**
24
+ * Public Horizon server URL keyed by Stellar network name. Transaction
25
+ * submission must target a write-capable Horizon server (not an arbitrary RPC
26
+ * URL, which returns 405 on POST /transactions).
27
+ */
28
+ export declare const STELLAR_HORIZON_URL_BY_NAME: Record<StellarNetworkName, string>;
29
+ //# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAEnE;;GAEG;AACH,eAAO,MAAM,iCAAiC,mDACI,CAAC;AAEnD;;GAEG;AACH,eAAO,MAAM,kCAAkC,sCACV,CAAC;AAEtC;;GAEG;AACH,eAAO,MAAM,oCAAoC,2CACP,CAAC;AAE3C;;GAEG;AACH,eAAO,MAAM,eAAe,WAAM,CAAC;AAEnC;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAIzE,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,2BAA2B,EAAE,MAAM,CAAC,kBAAkB,EAAE,MAAM,CAI1E,CAAC"}
@@ -0,0 +1,15 @@
1
+ import { Asset } from '@stellar/stellar-sdk';
2
+ type CreatePaymentAssetParams = {
3
+ code: string;
4
+ issuer: string;
5
+ };
6
+ /**
7
+ * Creates a Stellar Asset for a payment operation. Returns the native asset
8
+ * (XLM) when no code/issuer is provided, otherwise a custom asset.
9
+ *
10
+ * @param asset - Optional `{ code, issuer }` for a non-native asset.
11
+ * @notInstrumented
12
+ */
13
+ export declare const createPaymentAsset: (asset?: CreatePaymentAssetParams) => Asset;
14
+ export {};
15
+ //# sourceMappingURL=createPaymentAsset.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createPaymentAsset.d.ts","sourceRoot":"","sources":["../../../src/utils/createPaymentAsset/createPaymentAsset.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAE7C,KAAK,wBAAwB,GAAG;IAC9B,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF;;;;;;GAMG;AACH,eAAO,MAAM,kBAAkB,WAAY,wBAAwB,KAAG,KACR,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createPaymentAsset } from './createPaymentAsset';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/createPaymentAsset/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { NetworkData } from '@dynamic-labs-sdk/client';
2
+ import type { StellarNetworkProvider } from '../../StellarNetworkProvider.types';
3
+ /**
4
+ * Creates a Stellar network provider from network data.
5
+ *
6
+ * @param networkData - The network data for the Stellar network.
7
+ * @notInstrumented
8
+ */
9
+ export declare const createStellarNetworkProvider: (networkData: NetworkData) => StellarNetworkProvider;
10
+ //# sourceMappingURL=createStellarNetworkProvider.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"createStellarNetworkProvider.d.ts","sourceRoot":"","sources":["../../../src/utils/createStellarNetworkProvider/createStellarNetworkProvider.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAG5D,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,oCAAoC,CAAC;AAGjF;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,gBAC1B,WAAW,KACvB,sBASD,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { createStellarNetworkProvider } from './createStellarNetworkProvider';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/createStellarNetworkProvider/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,4BAA4B,EAAE,MAAM,gCAAgC,CAAC"}
@@ -0,0 +1,17 @@
1
+ import type { NetworkData } from '@dynamic-labs-sdk/client';
2
+ type FetchStellarBalanceParams = {
3
+ address: string;
4
+ networkData: NetworkData;
5
+ };
6
+ /**
7
+ * Fetches the native XLM balance for an address from Horizon.
8
+ * Returns '0' when the account has no native balance, and throws a
9
+ * FetchStellarBalanceError when the balance cannot be retrieved.
10
+ *
11
+ * @param address - The Stellar public key.
12
+ * @param networkData - Network data carrying the Horizon RPC URL.
13
+ * @notInstrumented
14
+ */
15
+ export declare const fetchStellarBalance: ({ address, networkData, }: FetchStellarBalanceParams) => Promise<string>;
16
+ export {};
17
+ //# sourceMappingURL=fetchStellarBalance.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetchStellarBalance.d.ts","sourceRoot":"","sources":["../../../src/utils/fetchStellarBalance/fetchStellarBalance.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAC;AAI5D,KAAK,yBAAyB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;IAChB,WAAW,EAAE,WAAW,CAAC;CAC1B,CAAC;AAEF;;;;;;;;GAQG;AACH,eAAO,MAAM,mBAAmB,8BAG7B,yBAAyB,KAAG,OAAO,CAAC,MAAM,CAsB5C,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { fetchStellarBalance } from './fetchStellarBalance';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/fetchStellarBalance/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,13 @@
1
+ /**
2
+ * Gets the network passphrase for a given Dynamic Stellar network id (the
3
+ * SHA-256 hash of a network passphrase). Defaults to the public network when
4
+ * the id is unknown.
5
+ *
6
+ * @param networkId - The network id (hex SHA-256 hash of the passphrase).
7
+ * @returns The matching network passphrase.
8
+ * @notInstrumented
9
+ */
10
+ export declare const getNetworkPassphrase: ({ networkId, }: {
11
+ networkId: string | undefined;
12
+ }) => string;
13
+ //# sourceMappingURL=getNetworkPassphrase.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getNetworkPassphrase.d.ts","sourceRoot":"","sources":["../../../src/utils/getNetworkPassphrase/getNetworkPassphrase.ts"],"names":[],"mappings":"AAMA;;;;;;;;GAQG;AACH,eAAO,MAAM,oBAAoB,mBAE9B;IACD,SAAS,EAAE,MAAM,GAAG,SAAS,CAAC;CAC/B,KAAG,MAGoC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getNetworkPassphrase } from './getNetworkPassphrase';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/getNetworkPassphrase/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,22 @@
1
+ type GetStellarNetworkIdParams = {
2
+ network: string;
3
+ };
4
+ /**
5
+ * Maps a wallet-reported Stellar network (name or passphrase) to its Dynamic
6
+ * network identifier: the hex-encoded SHA-256 hash of the network passphrase
7
+ * (Stellar's canonical Network ID), which is how the backend identifies the
8
+ * network.
9
+ *
10
+ * @param network - Raw network value reported by the wallet.
11
+ * @returns The hex SHA-256 hash of the network passphrase.
12
+ *
13
+ * @example
14
+ * ```typescript
15
+ * // pubnet -> 7ac33997544e3175d266bd022439b22cdb16508c01163f26e5cb2a3e1045a979
16
+ * getStellarNetworkId({ network: 'PUBLIC' });
17
+ * ```
18
+ * @notInstrumented
19
+ */
20
+ export declare const getStellarNetworkId: ({ network, }: GetStellarNetworkIdParams) => string;
21
+ export {};
22
+ //# sourceMappingURL=getStellarNetworkId.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"getStellarNetworkId.d.ts","sourceRoot":"","sources":["../../../src/utils/getStellarNetworkId/getStellarNetworkId.ts"],"names":[],"mappings":"AAMA,KAAK,yBAAyB,GAAG;IAC/B,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,mBAAmB,iBAE7B,yBAAyB,KAAG,MAK9B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { getStellarNetworkId } from './getStellarNetworkId';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/getStellarNetworkId/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { normalizeNetworkName } from './normalizeNetworkName';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/normalizeNetworkName/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC"}
@@ -0,0 +1,21 @@
1
+ import type { StellarNetworkName } from '../../StellarProvider.types';
2
+ type NormalizeNetworkNameParams = {
3
+ network: string;
4
+ };
5
+ /**
6
+ * Normalize network name to standard format
7
+ *
8
+ * @param network - Raw network name from wallet
9
+ * @returns Normalized network name (PUBLIC, TESTNET, or FUTURENET)
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * normalizeNetworkName({ network: 'mainnet' }) // 'PUBLIC'
14
+ * normalizeNetworkName({ network: 'testnet' }) // 'TESTNET'
15
+ * normalizeNetworkName({ network: 'Test SDF Network ; September 2015' }) // 'TESTNET'
16
+ * ```
17
+ * @notInstrumented
18
+ */
19
+ export declare const normalizeNetworkName: ({ network, }: NormalizeNetworkNameParams) => StellarNetworkName;
20
+ export {};
21
+ //# sourceMappingURL=normalizeNetworkName.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"normalizeNetworkName.d.ts","sourceRoot":"","sources":["../../../src/utils/normalizeNetworkName/normalizeNetworkName.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,6BAA6B,CAAC;AAEtE,KAAK,0BAA0B,GAAG;IAChC,OAAO,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF;;;;;;;;;;;;;GAaG;AACH,eAAO,MAAM,oBAAoB,iBAE9B,0BAA0B,KAAG,kBAoB/B,CAAC"}
@@ -0,0 +1,2 @@
1
+ export { stellarTransferAmount } from './stellarTransferAmount';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/utils/stellarTransferAmount/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC"}
@@ -0,0 +1,22 @@
1
+ import { type DynamicClient } from '@dynamic-labs-sdk/client';
2
+ import { type TransferAmountParams } from '@dynamic-labs-sdk/client/core';
3
+ /**
4
+ * Transfers native XLM or a custom Stellar asset from a wallet account.
5
+ *
6
+ * A custom asset is identified by `token.address` in the form `CODE:ISSUER`
7
+ * (or `CODE-ISSUER`). Amounts are decimal strings in the asset's display
8
+ * units. The destination account must exist, and for non-native assets it must
9
+ * already hold a trustline for the asset.
10
+ *
11
+ * @param amount - Amount to send, as a decimal string (e.g. "1.5").
12
+ * @param recipient - Destination Stellar account address.
13
+ * @param token - Optional non-native asset (`address: "CODE:ISSUER"`).
14
+ * @param walletAccount - The Stellar wallet account to send from.
15
+ * @param client - The Dynamic client instance.
16
+ * @returns The submitted transaction hash.
17
+ * @notInstrumented
18
+ */
19
+ export declare const stellarTransferAmount: ({ amount, recipient, token, walletAccount }: TransferAmountParams, client: DynamicClient) => Promise<{
20
+ transactionHash: string;
21
+ }>;
22
+ //# sourceMappingURL=stellarTransferAmount.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stellarTransferAmount.d.ts","sourceRoot":"","sources":["../../../src/utils/stellarTransferAmount/stellarTransferAmount.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,KAAK,aAAa,EAGnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,EACL,KAAK,oBAAoB,EAE1B,MAAM,+BAA+B,CAAC;AAYvC;;;;;;;;;;;;;;;GAeG;AACH,eAAO,MAAM,qBAAqB,gDACa,oBAAoB,UACzD,aAAa,KACpB,OAAO,CAAC;IAAE,eAAe,EAAE,MAAM,CAAA;CAAE,CA2ErC,CAAC"}
package/package.json CHANGED
@@ -1 +1,40 @@
1
- { "name": "@dynamic-labs-sdk/stellar", "version": "0.0.0" }
1
+ {
2
+ "name": "@dynamic-labs-sdk/stellar",
3
+ "version": "1.16.1",
4
+ "type": "module",
5
+ "main": "./dist/index.cjs.js",
6
+ "module": "./dist/index.esm.js",
7
+ "types": "./dist/exports/index.d.ts",
8
+ "files": [
9
+ "dist"
10
+ ],
11
+ "exports": {
12
+ "./package.json": "./package.json",
13
+ ".": {
14
+ "types": "./dist/exports/index.d.ts",
15
+ "import": "./dist/index.esm.js",
16
+ "default": "./dist/index.cjs.js"
17
+ }
18
+ },
19
+ "dependencies": {
20
+ "@stellar/stellar-sdk": "14.4.3",
21
+ "@stellar/freighter-api": "6.0.1",
22
+ "@lobstrco/signer-extension-api": "2.0.0",
23
+ "@dynamic-labs/sdk-api-core": "0.0.1058",
24
+ "@dynamic-labs-sdk/client": "1.16.1",
25
+ "@dynamic-labs-sdk/assert-package-version": "1.16.1"
26
+ },
27
+ "devDependencies": {
28
+ "eventemitter3": "5.0.1",
29
+ "vitest": "4.1.6"
30
+ },
31
+ "scripts": {
32
+ "build": "rm -rf dist && tsdown && pnpm exec tsc --emitDeclarationOnly -p ./tsconfig.lib.json",
33
+ "lint": "eslint .",
34
+ "lint:fix": "eslint . --fix",
35
+ "test": "vitest run",
36
+ "test:watch": "vitest",
37
+ "test-with-coverage": "vitest run --coverage",
38
+ "check-versions": "pnpm --filter @tools/sync-package-versions run sync --check-only --package-filter stellar"
39
+ }
40
+ }