@zebec-network/exchange-card-sdk 1.1.4 → 1.1.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -21
- package/dist/constants.d.ts +4 -0
- package/dist/constants.js +6 -1
- package/dist/services/stellarService.js +1 -6
- package/package.json +58 -58
package/LICENSE
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
MIT License
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2024 Zebec Fintech Labs
|
|
4
|
-
|
|
5
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
-
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
-
in the Software without restriction, including without limitation the rights
|
|
8
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
-
furnished to do so, subject to the following conditions:
|
|
11
|
-
|
|
12
|
-
The above copyright notice and this permission notice shall be included in all
|
|
13
|
-
copies or substantial portions of the Software.
|
|
14
|
-
|
|
15
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
-
SOFTWARE.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Zebec Fintech Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/constants.d.ts
CHANGED
|
@@ -7,6 +7,10 @@ export declare const TON_RPC_URL: Record<"Production" | "Sandbox", string>;
|
|
|
7
7
|
export declare const DIGITALBITS_RPC_URL: Record<"Production" | "Sandbox", string>;
|
|
8
8
|
export declare const XDB_PASSPHRASE: Record<"Production" | "Sandbox", string>;
|
|
9
9
|
export declare const STELLAR_RPC_URL: Record<"Production" | "Sandbox", string>;
|
|
10
|
+
export declare const USDC_ISSUER: {
|
|
11
|
+
TESTNET: string;
|
|
12
|
+
MAINNET: string;
|
|
13
|
+
};
|
|
10
14
|
export declare const COUNTRIES_WITH_CCA3: readonly [{
|
|
11
15
|
readonly name: {
|
|
12
16
|
readonly common: "South Georgia";
|
package/dist/constants.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.PLATFORM_FEE = exports.COUNTRIES_WITH_CCA3 = exports.STELLAR_RPC_URL = exports.XDB_PASSPHRASE = exports.DIGITALBITS_RPC_URL = exports.TON_RPC_URL = exports.TAO_RPC_URL = exports.CARD_API_URL = exports.USDC_ADDRESS = exports.ZEBEC_CARD_ADDRESS = void 0;
|
|
3
|
+
exports.PLATFORM_FEE = exports.COUNTRIES_WITH_CCA3 = exports.USDC_ISSUER = exports.STELLAR_RPC_URL = exports.XDB_PASSPHRASE = exports.DIGITALBITS_RPC_URL = exports.TON_RPC_URL = exports.TAO_RPC_URL = exports.CARD_API_URL = exports.USDC_ADDRESS = exports.ZEBEC_CARD_ADDRESS = void 0;
|
|
4
4
|
const chains_1 = require("./chains");
|
|
5
5
|
exports.ZEBEC_CARD_ADDRESS = {
|
|
6
6
|
[chains_1.SupportedChain.Sepolia]: "0x00d90625CcaB01eA0e589DFd3C99972180CE609A",
|
|
@@ -52,6 +52,11 @@ exports.STELLAR_RPC_URL = {
|
|
|
52
52
|
Production: "https://stellar-mainnet.liquify.com/api=41EEWAH79Y5OCGI7/mainnet",
|
|
53
53
|
Sandbox: "https://horizon-testnet.stellar.org",
|
|
54
54
|
};
|
|
55
|
+
// Add USDC asset constants
|
|
56
|
+
exports.USDC_ISSUER = {
|
|
57
|
+
TESTNET: "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
|
|
58
|
+
MAINNET: "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
|
|
59
|
+
};
|
|
55
60
|
exports.COUNTRIES_WITH_CCA3 = [
|
|
56
61
|
{
|
|
57
62
|
name: {
|
|
@@ -4,11 +4,6 @@ exports.StellarService = void 0;
|
|
|
4
4
|
const stellar_sdk_1 = require("@stellar/stellar-sdk");
|
|
5
5
|
const constants_1 = require("../constants");
|
|
6
6
|
const apiHelpers_1 = require("../helpers/apiHelpers");
|
|
7
|
-
// Add USDC asset constants
|
|
8
|
-
const USDC_ISSUER = {
|
|
9
|
-
TESTNET: "GBBD47IF6LWK7P7MDEVSCWR7DPUWV3NY3DTQEVFL4NAT4AQH3ZLLFLA5",
|
|
10
|
-
MAINNET: "GA5ZSEJYB37JRC5AVCIA5MOP4RHTM335X2KGX3IHOJAPP5RE34K4KZVN",
|
|
11
|
-
};
|
|
12
7
|
class StellarService {
|
|
13
8
|
kit;
|
|
14
9
|
apiService;
|
|
@@ -124,7 +119,7 @@ class StellarService {
|
|
|
124
119
|
const fee = await this.server.fetchBaseFee();
|
|
125
120
|
const memo = stellar_sdk_1.Memo.id(vault.tag?.toString() || "");
|
|
126
121
|
// Create USDC asset object
|
|
127
|
-
const usdcAsset = new stellar_sdk_1.Asset("USDC", this.sandbox ? USDC_ISSUER.TESTNET : USDC_ISSUER.MAINNET);
|
|
122
|
+
const usdcAsset = new stellar_sdk_1.Asset("USDC", this.sandbox ? constants_1.USDC_ISSUER.TESTNET : constants_1.USDC_ISSUER.MAINNET);
|
|
128
123
|
// Check Wallet balance
|
|
129
124
|
const balance = await this.getTokenBalance(accountAddress.address, usdcAsset);
|
|
130
125
|
if (Number(balance) < Number(amount)) {
|
package/package.json
CHANGED
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "@zebec-network/exchange-card-sdk",
|
|
3
|
-
"version": "1.1.
|
|
4
|
-
"description": "An sdk for purchasing silver card in zebec",
|
|
5
|
-
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
7
|
-
"author": "Ashish Sapkota",
|
|
8
|
-
"license": "MIT",
|
|
9
|
-
"files": [
|
|
10
|
-
"dist"
|
|
11
|
-
],
|
|
12
|
-
"scripts": {
|
|
13
|
-
"build": "npm run clean && tsc",
|
|
14
|
-
"clean": "rimraf dist",
|
|
15
|
-
"format": "prettier --write .",
|
|
16
|
-
"test": "ts-mocha -p ./tsconfig.json -t 1000000",
|
|
17
|
-
"gen:typechain": "typechain --target ethers-v6 --out-dir \"src/artifacts/typechain-types\" \"src/artifacts/abi/*.json\""
|
|
18
|
-
},
|
|
19
|
-
"devDependencies": {
|
|
20
|
-
"@typechain/ethers-v6": "^0.5.1",
|
|
21
|
-
"@types/jsonwebtoken": "^9.0.7",
|
|
22
|
-
"@types/mocha": "^10.0.9",
|
|
23
|
-
"@types/node": "^22.7.9",
|
|
24
|
-
"dotenv": "^16.4.5",
|
|
25
|
-
"mocha": "^10.7.3",
|
|
26
|
-
"prettier": "^3.3.3",
|
|
27
|
-
"rimraf": "^6.0.1",
|
|
28
|
-
"ts-mocha": "^10.0.0",
|
|
29
|
-
"ts-node": "^10.9.2",
|
|
30
|
-
"typechain": "^8.3.2",
|
|
31
|
-
"typescript": "^5.6.3"
|
|
32
|
-
},
|
|
33
|
-
"dependencies": {
|
|
34
|
-
"@creit.tech/stellar-wallets-kit": "^1.7.1",
|
|
35
|
-
"@polkadot/api": "^14.3.1",
|
|
36
|
-
"@polkadot/types": "^14.3.1",
|
|
37
|
-
"@polkadot/util": "^13.2.3",
|
|
38
|
-
"@stellar/stellar-sdk": "^13.1.0",
|
|
39
|
-
"@tonconnect/sdk": "^3.0.6",
|
|
40
|
-
"axios": "^1.7.7",
|
|
41
|
-
"ethers": "^6.13.4",
|
|
42
|
-
"tonweb": "^0.0.66",
|
|
43
|
-
"xdb-digitalbits-sdk": "^8.2.2"
|
|
44
|
-
},
|
|
45
|
-
"repository": {
|
|
46
|
-
"type": "git",
|
|
47
|
-
"url": "git+https://github.com/Zebec-Fintech-Labs/zebec-card-minimal-sdk.git"
|
|
48
|
-
},
|
|
49
|
-
"homepage": "https://github.com/Zebec-Fintech-Labs/zebec-card-minimal-sdk.git#README",
|
|
50
|
-
"keywords": [
|
|
51
|
-
"zebec",
|
|
52
|
-
"zebec fintech",
|
|
53
|
-
"zebec instant card"
|
|
54
|
-
],
|
|
55
|
-
"publishConfig": {
|
|
56
|
-
"access": "public"
|
|
57
|
-
}
|
|
58
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "@zebec-network/exchange-card-sdk",
|
|
3
|
+
"version": "1.1.5",
|
|
4
|
+
"description": "An sdk for purchasing silver card in zebec",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"types": "dist/index.d.ts",
|
|
7
|
+
"author": "Ashish Sapkota",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"files": [
|
|
10
|
+
"dist"
|
|
11
|
+
],
|
|
12
|
+
"scripts": {
|
|
13
|
+
"build": "npm run clean && tsc",
|
|
14
|
+
"clean": "rimraf dist",
|
|
15
|
+
"format": "prettier --write .",
|
|
16
|
+
"test": "ts-mocha -p ./tsconfig.json -t 1000000",
|
|
17
|
+
"gen:typechain": "typechain --target ethers-v6 --out-dir \"src/artifacts/typechain-types\" \"src/artifacts/abi/*.json\""
|
|
18
|
+
},
|
|
19
|
+
"devDependencies": {
|
|
20
|
+
"@typechain/ethers-v6": "^0.5.1",
|
|
21
|
+
"@types/jsonwebtoken": "^9.0.7",
|
|
22
|
+
"@types/mocha": "^10.0.9",
|
|
23
|
+
"@types/node": "^22.7.9",
|
|
24
|
+
"dotenv": "^16.4.5",
|
|
25
|
+
"mocha": "^10.7.3",
|
|
26
|
+
"prettier": "^3.3.3",
|
|
27
|
+
"rimraf": "^6.0.1",
|
|
28
|
+
"ts-mocha": "^10.0.0",
|
|
29
|
+
"ts-node": "^10.9.2",
|
|
30
|
+
"typechain": "^8.3.2",
|
|
31
|
+
"typescript": "^5.6.3"
|
|
32
|
+
},
|
|
33
|
+
"dependencies": {
|
|
34
|
+
"@creit.tech/stellar-wallets-kit": "^1.7.1",
|
|
35
|
+
"@polkadot/api": "^14.3.1",
|
|
36
|
+
"@polkadot/types": "^14.3.1",
|
|
37
|
+
"@polkadot/util": "^13.2.3",
|
|
38
|
+
"@stellar/stellar-sdk": "^13.1.0",
|
|
39
|
+
"@tonconnect/sdk": "^3.0.6",
|
|
40
|
+
"axios": "^1.7.7",
|
|
41
|
+
"ethers": "^6.13.4",
|
|
42
|
+
"tonweb": "^0.0.66",
|
|
43
|
+
"xdb-digitalbits-sdk": "^8.2.2"
|
|
44
|
+
},
|
|
45
|
+
"repository": {
|
|
46
|
+
"type": "git",
|
|
47
|
+
"url": "git+https://github.com/Zebec-Fintech-Labs/zebec-card-minimal-sdk.git"
|
|
48
|
+
},
|
|
49
|
+
"homepage": "https://github.com/Zebec-Fintech-Labs/zebec-card-minimal-sdk.git#README",
|
|
50
|
+
"keywords": [
|
|
51
|
+
"zebec",
|
|
52
|
+
"zebec fintech",
|
|
53
|
+
"zebec instant card"
|
|
54
|
+
],
|
|
55
|
+
"publishConfig": {
|
|
56
|
+
"access": "public"
|
|
57
|
+
}
|
|
58
|
+
}
|