@dynamic-labs-sdk/stellar 0.0.0 → 1.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +21 -0
- package/dist/StellarNetworkProvider.types.d.ts +8 -0
- package/dist/StellarNetworkProvider.types.d.ts.map +1 -0
- package/dist/StellarProvider.types.d.ts +74 -0
- package/dist/StellarProvider.types.d.ts.map +1 -0
- package/dist/StellarWalletAccount.types.d.ts +8 -0
- package/dist/StellarWalletAccount.types.d.ts.map +1 -0
- package/dist/StellarWalletProvider.types.d.ts +12 -0
- package/dist/StellarWalletProvider.types.d.ts.map +1 -0
- package/dist/errors/FetchStellarBalanceError/FetchStellarBalanceError.d.ts +9 -0
- package/dist/errors/FetchStellarBalanceError/FetchStellarBalanceError.d.ts.map +1 -0
- package/dist/errors/FetchStellarBalanceError/index.d.ts +2 -0
- package/dist/errors/FetchStellarBalanceError/index.d.ts.map +1 -0
- package/dist/errors/NotStellarProviderError/NotStellarProviderError.d.ts +8 -0
- package/dist/errors/NotStellarProviderError/NotStellarProviderError.d.ts.map +1 -0
- package/dist/errors/NotStellarProviderError/index.d.ts +2 -0
- package/dist/errors/NotStellarProviderError/index.d.ts.map +1 -0
- package/dist/exports/index.d.ts +5 -0
- package/dist/exports/index.d.ts.map +1 -0
- package/dist/index.cjs +44 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.esm.js +43 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/isStellarNetworkProvider/index.d.ts +2 -0
- package/dist/isStellarNetworkProvider/index.d.ts.map +1 -0
- package/dist/isStellarNetworkProvider/isStellarNetworkProvider.d.ts +11 -0
- package/dist/isStellarNetworkProvider/isStellarNetworkProvider.d.ts.map +1 -0
- package/dist/isStellarWalletAccount/index.d.ts +2 -0
- package/dist/isStellarWalletAccount/index.d.ts.map +1 -0
- package/dist/isStellarWalletAccount/isStellarWalletAccount.d.ts +11 -0
- package/dist/isStellarWalletAccount/isStellarWalletAccount.d.ts.map +1 -0
- package/dist/isStellarWalletProvider/index.d.ts +2 -0
- package/dist/isStellarWalletProvider/index.d.ts.map +1 -0
- package/dist/isStellarWalletProvider/isStellarWalletProvider.d.ts +11 -0
- package/dist/isStellarWalletProvider/isStellarWalletProvider.d.ts.map +1 -0
- package/dist/tsconfig.lib.tsbuildinfo +1 -0
- package/dist/utils/constants.d.ts +17 -0
- package/dist/utils/constants.d.ts.map +1 -0
- package/dist/utils/createStellarNetworkProvider/createStellarNetworkProvider.d.ts +10 -0
- package/dist/utils/createStellarNetworkProvider/createStellarNetworkProvider.d.ts.map +1 -0
- package/dist/utils/createStellarNetworkProvider/index.d.ts +2 -0
- package/dist/utils/createStellarNetworkProvider/index.d.ts.map +1 -0
- package/dist/utils/fetchStellarBalance/fetchStellarBalance.d.ts +17 -0
- package/dist/utils/fetchStellarBalance/fetchStellarBalance.d.ts.map +1 -0
- package/dist/utils/fetchStellarBalance/index.d.ts +2 -0
- package/dist/utils/fetchStellarBalance/index.d.ts.map +1 -0
- package/dist/utils/getNetworkPassphrase/getNetworkPassphrase.d.ts +11 -0
- package/dist/utils/getNetworkPassphrase/getNetworkPassphrase.d.ts.map +1 -0
- package/dist/utils/getNetworkPassphrase/index.d.ts +2 -0
- package/dist/utils/getNetworkPassphrase/index.d.ts.map +1 -0
- package/dist/utils/normalizeNetworkName/index.d.ts +2 -0
- package/dist/utils/normalizeNetworkName/index.d.ts.map +1 -0
- package/dist/utils/normalizeNetworkName/normalizeNetworkName.d.ts +21 -0
- package/dist/utils/normalizeNetworkName/normalizeNetworkName.d.ts.map +1 -0
- package/package.json +40 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Stellar network passphrase for mainnet
|
|
3
|
+
*/
|
|
4
|
+
export declare const STELLAR_PUBLIC_NETWORK_PASSPHRASE = "Public Global Stellar Network ; September 2015";
|
|
5
|
+
/**
|
|
6
|
+
* Stellar network passphrase for testnet
|
|
7
|
+
*/
|
|
8
|
+
export declare const STELLAR_TESTNET_NETWORK_PASSPHRASE = "Test SDF Network ; September 2015";
|
|
9
|
+
/**
|
|
10
|
+
* Stellar network passphrase for futurenet
|
|
11
|
+
*/
|
|
12
|
+
export declare const STELLAR_FUTURENET_NETWORK_PASSPHRASE = "Test SDF Future Network ; October 2022";
|
|
13
|
+
/**
|
|
14
|
+
* Number of stroops per XLM (1 XLM = 10,000,000 stroops)
|
|
15
|
+
*/
|
|
16
|
+
export declare const STROOPS_PER_XLM = 10000000;
|
|
17
|
+
//# sourceMappingURL=constants.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/utils/constants.ts"],"names":[],"mappings":"AAAA;;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"}
|
|
@@ -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 @@
|
|
|
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 @@
|
|
|
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,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Gets the network passphrase for a given network name.
|
|
3
|
+
*
|
|
4
|
+
* @param network - The network name ('PUBLIC', 'TESTNET', or 'FUTURENET')
|
|
5
|
+
* @returns The network passphrase
|
|
6
|
+
* @notInstrumented
|
|
7
|
+
*/
|
|
8
|
+
export declare const getNetworkPassphrase: ({ network, }: {
|
|
9
|
+
network: string | undefined;
|
|
10
|
+
}) => string;
|
|
11
|
+
//# sourceMappingURL=getNetworkPassphrase.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getNetworkPassphrase.d.ts","sourceRoot":"","sources":["../../../src/utils/getNetworkPassphrase/getNetworkPassphrase.ts"],"names":[],"mappings":"AAEA;;;;;;GAMG;AACH,eAAO,MAAM,oBAAoB,iBAE9B;IACD,OAAO,EAAE,MAAM,GAAG,SAAS,CAAC;CAC7B,KAAG,MAUH,CAAC"}
|
|
@@ -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 @@
|
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1 +1,40 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"name": "@dynamic-labs-sdk/stellar",
|
|
3
|
+
"version": "1.14.0",
|
|
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.1046",
|
|
24
|
+
"@dynamic-labs-sdk/assert-package-version": "1.14.0",
|
|
25
|
+
"@dynamic-labs-sdk/client": "1.14.0"
|
|
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
|
+
}
|