swaply-sdk-ts 0.0.1 → 0.0.2
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/.gitignore +175 -0
- package/dist/eslint.config.js +135 -0
- package/dist/src/apiClient.js +68 -0
- package/dist/src/approvals.js +28 -0
- package/dist/src/index.js +3 -0
- package/dist/src/types.js +32 -0
- package/package.json +5 -2
- package/src/apiClient.ts +0 -2
- package/src/types.ts +32 -0
- package/tsconfig.json +2 -3
package/.gitignore
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
# Based on https://raw.githubusercontent.com/github/gitignore/main/Node.gitignore
|
|
2
|
+
|
|
3
|
+
# Logs
|
|
4
|
+
|
|
5
|
+
logs
|
|
6
|
+
_.log
|
|
7
|
+
npm-debug.log_
|
|
8
|
+
yarn-debug.log*
|
|
9
|
+
yarn-error.log*
|
|
10
|
+
lerna-debug.log*
|
|
11
|
+
.pnpm-debug.log*
|
|
12
|
+
|
|
13
|
+
# Caches
|
|
14
|
+
|
|
15
|
+
.cache
|
|
16
|
+
|
|
17
|
+
# Diagnostic reports (https://nodejs.org/api/report.html)
|
|
18
|
+
|
|
19
|
+
report.[0-9]_.[0-9]_.[0-9]_.[0-9]_.json
|
|
20
|
+
|
|
21
|
+
# Runtime data
|
|
22
|
+
|
|
23
|
+
pids
|
|
24
|
+
_.pid
|
|
25
|
+
_.seed
|
|
26
|
+
*.pid.lock
|
|
27
|
+
|
|
28
|
+
# Directory for instrumented libs generated by jscoverage/JSCover
|
|
29
|
+
|
|
30
|
+
lib-cov
|
|
31
|
+
|
|
32
|
+
# Coverage directory used by tools like istanbul
|
|
33
|
+
|
|
34
|
+
coverage
|
|
35
|
+
*.lcov
|
|
36
|
+
|
|
37
|
+
# nyc test coverage
|
|
38
|
+
|
|
39
|
+
.nyc_output
|
|
40
|
+
|
|
41
|
+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
|
|
42
|
+
|
|
43
|
+
.grunt
|
|
44
|
+
|
|
45
|
+
# Bower dependency directory (https://bower.io/)
|
|
46
|
+
|
|
47
|
+
bower_components
|
|
48
|
+
|
|
49
|
+
# node-waf configuration
|
|
50
|
+
|
|
51
|
+
.lock-wscript
|
|
52
|
+
|
|
53
|
+
# Compiled binary addons (https://nodejs.org/api/addons.html)
|
|
54
|
+
|
|
55
|
+
build/Release
|
|
56
|
+
|
|
57
|
+
# Dependency directories
|
|
58
|
+
|
|
59
|
+
node_modules/
|
|
60
|
+
jspm_packages/
|
|
61
|
+
|
|
62
|
+
# Snowpack dependency directory (https://snowpack.dev/)
|
|
63
|
+
|
|
64
|
+
web_modules/
|
|
65
|
+
|
|
66
|
+
# TypeScript cache
|
|
67
|
+
|
|
68
|
+
*.tsbuildinfo
|
|
69
|
+
|
|
70
|
+
# Optional npm cache directory
|
|
71
|
+
|
|
72
|
+
.npm
|
|
73
|
+
|
|
74
|
+
# Optional eslint cache
|
|
75
|
+
|
|
76
|
+
.eslintcache
|
|
77
|
+
|
|
78
|
+
# Optional stylelint cache
|
|
79
|
+
|
|
80
|
+
.stylelintcache
|
|
81
|
+
|
|
82
|
+
# Microbundle cache
|
|
83
|
+
|
|
84
|
+
.rpt2_cache/
|
|
85
|
+
.rts2_cache_cjs/
|
|
86
|
+
.rts2_cache_es/
|
|
87
|
+
.rts2_cache_umd/
|
|
88
|
+
|
|
89
|
+
# Optional REPL history
|
|
90
|
+
|
|
91
|
+
.node_repl_history
|
|
92
|
+
|
|
93
|
+
# Output of 'npm pack'
|
|
94
|
+
|
|
95
|
+
*.tgz
|
|
96
|
+
|
|
97
|
+
# Yarn Integrity file
|
|
98
|
+
|
|
99
|
+
.yarn-integrity
|
|
100
|
+
|
|
101
|
+
# dotenv environment variable files
|
|
102
|
+
|
|
103
|
+
.env
|
|
104
|
+
.env.development.local
|
|
105
|
+
.env.test.local
|
|
106
|
+
.env.production.local
|
|
107
|
+
.env.local
|
|
108
|
+
|
|
109
|
+
# parcel-bundler cache (https://parceljs.org/)
|
|
110
|
+
|
|
111
|
+
.parcel-cache
|
|
112
|
+
|
|
113
|
+
# Next.js build output
|
|
114
|
+
|
|
115
|
+
.next
|
|
116
|
+
out
|
|
117
|
+
|
|
118
|
+
# Nuxt.js build / generate output
|
|
119
|
+
|
|
120
|
+
.nuxt
|
|
121
|
+
dist
|
|
122
|
+
|
|
123
|
+
# Gatsby files
|
|
124
|
+
|
|
125
|
+
# Comment in the public line in if your project uses Gatsby and not Next.js
|
|
126
|
+
|
|
127
|
+
# https://nextjs.org/blog/next-9-1#public-directory-support
|
|
128
|
+
|
|
129
|
+
# public
|
|
130
|
+
|
|
131
|
+
# vuepress build output
|
|
132
|
+
|
|
133
|
+
.vuepress/dist
|
|
134
|
+
|
|
135
|
+
# vuepress v2.x temp and cache directory
|
|
136
|
+
|
|
137
|
+
.temp
|
|
138
|
+
|
|
139
|
+
# Docusaurus cache and generated files
|
|
140
|
+
|
|
141
|
+
.docusaurus
|
|
142
|
+
|
|
143
|
+
# Serverless directories
|
|
144
|
+
|
|
145
|
+
.serverless/
|
|
146
|
+
|
|
147
|
+
# FuseBox cache
|
|
148
|
+
|
|
149
|
+
.fusebox/
|
|
150
|
+
|
|
151
|
+
# DynamoDB Local files
|
|
152
|
+
|
|
153
|
+
.dynamodb/
|
|
154
|
+
|
|
155
|
+
# TernJS port file
|
|
156
|
+
|
|
157
|
+
.tern-port
|
|
158
|
+
|
|
159
|
+
# Stores VSCode versions used for testing VSCode extensions
|
|
160
|
+
|
|
161
|
+
.vscode-test
|
|
162
|
+
|
|
163
|
+
# yarn v2
|
|
164
|
+
|
|
165
|
+
.yarn/cache
|
|
166
|
+
.yarn/unplugged
|
|
167
|
+
.yarn/build-state.yml
|
|
168
|
+
.yarn/install-state.gz
|
|
169
|
+
.pnp.*
|
|
170
|
+
|
|
171
|
+
# IntelliJ based IDEs
|
|
172
|
+
.idea
|
|
173
|
+
|
|
174
|
+
# Finder (MacOS) folder config
|
|
175
|
+
.DS_Store
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import tsPlugin from '@typescript-eslint/eslint-plugin';
|
|
2
|
+
import prettier from 'eslint-plugin-prettier';
|
|
3
|
+
import simpleImportSort from 'eslint-plugin-simple-import-sort';
|
|
4
|
+
import unicorn from 'eslint-plugin-unicorn';
|
|
5
|
+
import unusedImports from 'eslint-plugin-unused-imports';
|
|
6
|
+
import globals from 'globals';
|
|
7
|
+
import tseslint from 'typescript-eslint';
|
|
8
|
+
export default tseslint.config({
|
|
9
|
+
ignores: ['dist', 'node_modules', 'src/tests'],
|
|
10
|
+
}, {
|
|
11
|
+
files: ['**/*.{ts,tsx}'],
|
|
12
|
+
languageOptions: {
|
|
13
|
+
ecmaVersion: 2020,
|
|
14
|
+
sourceType: 'module',
|
|
15
|
+
parser: tseslint.parser,
|
|
16
|
+
parserOptions: {
|
|
17
|
+
project: './tsconfig.json',
|
|
18
|
+
},
|
|
19
|
+
globals: globals.browser,
|
|
20
|
+
},
|
|
21
|
+
plugins: {
|
|
22
|
+
'@typescript-eslint': tsPlugin,
|
|
23
|
+
prettier,
|
|
24
|
+
unicorn,
|
|
25
|
+
'simple-import-sort': simpleImportSort,
|
|
26
|
+
'unused-imports': unusedImports,
|
|
27
|
+
},
|
|
28
|
+
rules: {
|
|
29
|
+
...tsPlugin.configs.recommended.rules,
|
|
30
|
+
...unicorn.configs.recommended.rules,
|
|
31
|
+
'prettier/prettier': ['warn', { tabWidth: 4, singleQuote: true }],
|
|
32
|
+
'import/order': 'off',
|
|
33
|
+
'sort-imports': 'off',
|
|
34
|
+
'simple-import-sort/imports': [
|
|
35
|
+
'error',
|
|
36
|
+
{
|
|
37
|
+
groups: [
|
|
38
|
+
[String.raw `^\u0000`], // side effects
|
|
39
|
+
['^node:'],
|
|
40
|
+
[String.raw `^@?(?!app|api|components|static|store|images)[\w-]`], // external
|
|
41
|
+
['^@components/', '^@app/', '^@api/', '^@store/', '^@/'], // internal
|
|
42
|
+
['^@static/', '^@images/'], // assets
|
|
43
|
+
[
|
|
44
|
+
String.raw `^\.\.(?!/?$)`,
|
|
45
|
+
String.raw `^\./(?=.*/)`,
|
|
46
|
+
String.raw `^\.(?!/?$)`,
|
|
47
|
+
String.raw `^\./?$`,
|
|
48
|
+
], // local
|
|
49
|
+
[String.raw `^.+\.s?css$`], // styles
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
],
|
|
53
|
+
'simple-import-sort/exports': 'error',
|
|
54
|
+
'unused-imports/no-unused-imports': 'error',
|
|
55
|
+
'unused-imports/no-unused-vars': [
|
|
56
|
+
'warn',
|
|
57
|
+
{
|
|
58
|
+
vars: 'all',
|
|
59
|
+
varsIgnorePattern: '^_',
|
|
60
|
+
args: 'after-used',
|
|
61
|
+
argsIgnorePattern: '^_',
|
|
62
|
+
},
|
|
63
|
+
],
|
|
64
|
+
'@typescript-eslint/naming-convention': [
|
|
65
|
+
'warn',
|
|
66
|
+
{
|
|
67
|
+
selector: 'variable',
|
|
68
|
+
format: ['camelCase', 'PascalCase', 'UPPER_CASE'],
|
|
69
|
+
leadingUnderscore: 'allow',
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
selector: 'function',
|
|
73
|
+
format: ['camelCase', 'PascalCase'],
|
|
74
|
+
},
|
|
75
|
+
],
|
|
76
|
+
semi: ['warn', 'always'],
|
|
77
|
+
'no-console': 'error',
|
|
78
|
+
'padding-line-between-statements': [
|
|
79
|
+
'warn',
|
|
80
|
+
{ blankLine: 'always', prev: '*', next: 'return' },
|
|
81
|
+
],
|
|
82
|
+
'spaced-comment': ['error', 'always', { markers: ['/'] }],
|
|
83
|
+
'@typescript-eslint/no-misused-new': 'error',
|
|
84
|
+
'consistent-return': 'off',
|
|
85
|
+
'guard-for-in': 'error',
|
|
86
|
+
'no-constructor-return': 'error',
|
|
87
|
+
'no-else-return': 'error',
|
|
88
|
+
'no-eval': 'error',
|
|
89
|
+
'no-extend-native': 'error',
|
|
90
|
+
'no-extra-bind': 'error',
|
|
91
|
+
'no-floating-decimal': 'error',
|
|
92
|
+
'no-implicit-globals': 'error',
|
|
93
|
+
'no-new': 'error',
|
|
94
|
+
'no-script-url': 'error',
|
|
95
|
+
'max-depth': ['error', 3],
|
|
96
|
+
'max-nested-callbacks': ['error', 3],
|
|
97
|
+
'new-cap': 'error',
|
|
98
|
+
'no-multi-assign': 'error',
|
|
99
|
+
'no-multiple-empty-lines': 'error',
|
|
100
|
+
'no-nested-ternary': 'error',
|
|
101
|
+
'no-trailing-spaces': 'error',
|
|
102
|
+
'no-underscore-dangle': 'error',
|
|
103
|
+
'no-whitespace-before-property': 'error',
|
|
104
|
+
'object-curly-spacing': ['error', 'always'],
|
|
105
|
+
'operator-assignment': ['error', 'always'],
|
|
106
|
+
'padded-blocks': ['error', 'never'],
|
|
107
|
+
'semi-spacing': 'error',
|
|
108
|
+
'semi-style': ['error', 'last'],
|
|
109
|
+
'space-before-blocks': 'error',
|
|
110
|
+
'space-in-parens': ['error', 'never'],
|
|
111
|
+
'space-unary-ops': 'error',
|
|
112
|
+
'switch-colon-spacing': 'error',
|
|
113
|
+
'array-bracket-spacing': ['error', 'never'],
|
|
114
|
+
'block-spacing': 'error',
|
|
115
|
+
camelcase: 'off',
|
|
116
|
+
'unicorn/prefer-switch': ['error', { minimumCases: 3 }],
|
|
117
|
+
'unicorn/filename-case': 'off',
|
|
118
|
+
'unicorn/prefer-query-selector': 'off',
|
|
119
|
+
'unicorn/prevent-abbreviations': 'off',
|
|
120
|
+
'unicorn/no-null': 'off',
|
|
121
|
+
'unicorn/consistent-function-scoping': 'off',
|
|
122
|
+
'unicorn/prefer-logical-operator-over-ternary': 'off',
|
|
123
|
+
'unicorn/no-static-only-class': 'off',
|
|
124
|
+
'unicorn/prefer-ternary': 'off',
|
|
125
|
+
'unicorn/prefer-global-this': 'off',
|
|
126
|
+
'unicorn/no-negated-condition': 'off',
|
|
127
|
+
'unicorn/prefer-spread': 'off',
|
|
128
|
+
'@typescript-eslint/no-unused-expressions': 'off',
|
|
129
|
+
'@typescript-eslint/no-explicit-any': 'off',
|
|
130
|
+
'unicorn/prefer-string-replace-all': 'off',
|
|
131
|
+
'@typescript-eslint/no-duplicate-enum-values': 'off',
|
|
132
|
+
'@typescript-eslint/no-unused-vars': 'off',
|
|
133
|
+
'react-hooks/exhaustive-deps': 'off',
|
|
134
|
+
},
|
|
135
|
+
});
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import axios from 'axios';
|
|
2
|
+
export class SwaplyApiClient {
|
|
3
|
+
client;
|
|
4
|
+
constructor(apiUrl, apiKey, config) {
|
|
5
|
+
this.client = axios.create({
|
|
6
|
+
baseURL: apiUrl,
|
|
7
|
+
headers: {
|
|
8
|
+
'x-api-key': apiKey,
|
|
9
|
+
},
|
|
10
|
+
...config,
|
|
11
|
+
});
|
|
12
|
+
}
|
|
13
|
+
async getQuote(sourceChain, sourceToken, destChain, destToken, amount, slippageBps, swapType, retailUserId = null) {
|
|
14
|
+
const response = await this.client.post('/quotes/best', {
|
|
15
|
+
source_chain: sourceChain,
|
|
16
|
+
source_token: sourceToken,
|
|
17
|
+
dest_chain: destChain,
|
|
18
|
+
dest_token: destToken,
|
|
19
|
+
amount,
|
|
20
|
+
slippage_bps: slippageBps.toString(),
|
|
21
|
+
swap_type: swapType,
|
|
22
|
+
retail_user_id: retailUserId,
|
|
23
|
+
});
|
|
24
|
+
return response.data;
|
|
25
|
+
}
|
|
26
|
+
async createIntent(quoteId, userSourcePublicKey, userSourceAddress, userDestinationAddress, refundAddress) {
|
|
27
|
+
const response = await this.client.post('/intents/create', {
|
|
28
|
+
quote_id: quoteId,
|
|
29
|
+
user_source_public_key: userSourcePublicKey,
|
|
30
|
+
user_source_address: userSourceAddress,
|
|
31
|
+
user_destination_address: userDestinationAddress,
|
|
32
|
+
refund_address: refundAddress,
|
|
33
|
+
});
|
|
34
|
+
return response.data;
|
|
35
|
+
}
|
|
36
|
+
async addApproval(signedData, intentId) {
|
|
37
|
+
await this.client.post(`/intents/${intentId}/approvals`, signedData);
|
|
38
|
+
}
|
|
39
|
+
async getIntentStatus(intentId) {
|
|
40
|
+
const response = await this.client.get(`/intents/${intentId}/status`);
|
|
41
|
+
return response.data.status;
|
|
42
|
+
}
|
|
43
|
+
async listRetailUserHistory(walletAddressOrRetailId) {
|
|
44
|
+
const response = await this.client.get(`/history/${walletAddressOrRetailId}`);
|
|
45
|
+
return response.data;
|
|
46
|
+
}
|
|
47
|
+
async getSwapByIntentId(intentId) {
|
|
48
|
+
const response = await this.client.get(`/swaps/intents/${intentId}`);
|
|
49
|
+
return response.data;
|
|
50
|
+
}
|
|
51
|
+
async listNetworks(token) {
|
|
52
|
+
const endpoint = token ? `/networks?token=${token}` : '/networks';
|
|
53
|
+
const response = await this.client.get(endpoint);
|
|
54
|
+
return response.data;
|
|
55
|
+
}
|
|
56
|
+
async listTokens(limit = 20, offset = 0, q, networkId) {
|
|
57
|
+
let endpoint = `/tokens?limit=${limit}&offset=${offset}`;
|
|
58
|
+
if (q) {
|
|
59
|
+
endpoint += `&q=${q}`;
|
|
60
|
+
}
|
|
61
|
+
if (networkId) {
|
|
62
|
+
endpoint += `&network_id=${networkId}`;
|
|
63
|
+
}
|
|
64
|
+
const response = await this.client.get(endpoint);
|
|
65
|
+
return response.data;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
export default SwaplyApiClient;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { SwapType } from './types';
|
|
2
|
+
export const signPermit2Approval = async (permit2Approval, quote, userAddress, signTypedData) => {
|
|
3
|
+
const permit2Data = permit2Approval.additional_data;
|
|
4
|
+
const domain = {
|
|
5
|
+
name: permit2Data.domain.name,
|
|
6
|
+
chainId: permit2Data.domain.chain_id,
|
|
7
|
+
verifyingContract: permit2Data.domain.verifying_contract,
|
|
8
|
+
};
|
|
9
|
+
const witness = permit2Data.witness;
|
|
10
|
+
const message = {
|
|
11
|
+
permitted: {
|
|
12
|
+
token: quote.source_token,
|
|
13
|
+
amount: BigInt(quote.source_amount_lots),
|
|
14
|
+
},
|
|
15
|
+
spender: permit2Approval.escrow_contract_address,
|
|
16
|
+
nonce: permit2Approval.nonce,
|
|
17
|
+
deadline: permit2Approval.deadline,
|
|
18
|
+
witness,
|
|
19
|
+
};
|
|
20
|
+
const signature = await signTypedData({
|
|
21
|
+
domain,
|
|
22
|
+
types: permit2Data.types,
|
|
23
|
+
primaryType: 'PermitWitnessTransferFrom',
|
|
24
|
+
message,
|
|
25
|
+
account: userAddress,
|
|
26
|
+
});
|
|
27
|
+
return signature;
|
|
28
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
export var SwapType;
|
|
2
|
+
(function (SwapType) {
|
|
3
|
+
SwapType["Standard"] = "Standard";
|
|
4
|
+
SwapType["Optimized"] = "Optimized";
|
|
5
|
+
})(SwapType || (SwapType = {}));
|
|
6
|
+
export var IntentStatus;
|
|
7
|
+
(function (IntentStatus) {
|
|
8
|
+
IntentStatus["Initiated"] = "Initiated";
|
|
9
|
+
IntentStatus["ApprovalAdded"] = "ApprovalAdded";
|
|
10
|
+
IntentStatus["Accepted"] = "Accepted";
|
|
11
|
+
IntentStatus["Declined"] = "Declined";
|
|
12
|
+
IntentStatus["DeclinedDueToKytCheck"] = "DeclinedDueToKytCheck";
|
|
13
|
+
IntentStatus["UserDeposited"] = "UserDeposited";
|
|
14
|
+
IntentStatus["KycRequested"] = "KycRequested";
|
|
15
|
+
IntentStatus["Fulfilled"] = "Fulfilled";
|
|
16
|
+
IntentStatus["Expired"] = "Expired";
|
|
17
|
+
IntentStatus["RefundRequested"] = "RefundRequested";
|
|
18
|
+
IntentStatus["Refunded"] = "Refunded";
|
|
19
|
+
})(IntentStatus || (IntentStatus = {}));
|
|
20
|
+
export var NetworkType;
|
|
21
|
+
(function (NetworkType) {
|
|
22
|
+
NetworkType["EVM"] = "EVM";
|
|
23
|
+
NetworkType["TRON"] = "TRON";
|
|
24
|
+
NetworkType["BITCOIN"] = "BITCOIN";
|
|
25
|
+
NetworkType["SOLANA"] = "SOLANA";
|
|
26
|
+
})(NetworkType || (NetworkType = {}));
|
|
27
|
+
/**
|
|
28
|
+
* API Error Codes
|
|
29
|
+
*/
|
|
30
|
+
export const API_ERROR_CODES = {
|
|
31
|
+
INSUFFICIENT_ALLOWANCE: 25,
|
|
32
|
+
};
|
package/package.json
CHANGED
package/src/apiClient.ts
CHANGED
|
@@ -14,10 +14,8 @@ import type {
|
|
|
14
14
|
|
|
15
15
|
export class SwaplyApiClient {
|
|
16
16
|
private client: AxiosInstance;
|
|
17
|
-
private apiUrl: string;
|
|
18
17
|
|
|
19
18
|
constructor(apiUrl: string, apiKey: string, config?: AxiosRequestConfig) {
|
|
20
|
-
this.apiUrl = apiUrl;
|
|
21
19
|
this.client = axios.create({
|
|
22
20
|
baseURL: apiUrl,
|
|
23
21
|
headers: {
|
package/src/types.ts
CHANGED
|
@@ -152,3 +152,35 @@ export interface Token {
|
|
|
152
152
|
icon_url: string;
|
|
153
153
|
wrapped_token_address: string | null;
|
|
154
154
|
}
|
|
155
|
+
|
|
156
|
+
export type ApiEntity =
|
|
157
|
+
| 'Approval'
|
|
158
|
+
| 'Intent'
|
|
159
|
+
| 'Network'
|
|
160
|
+
| 'Quote'
|
|
161
|
+
| 'Resolver'
|
|
162
|
+
| 'SupportedToken'
|
|
163
|
+
| 'Swap'
|
|
164
|
+
| 'Token'
|
|
165
|
+
| 'UserNonce'
|
|
166
|
+
| 'Transaction'
|
|
167
|
+
| 'TransactionReceipt'
|
|
168
|
+
| 'InternalEvent'
|
|
169
|
+
| 'BlockchainEvent'
|
|
170
|
+
| 'WatcherRequest'
|
|
171
|
+
| 'Webhooks'
|
|
172
|
+
| 'Affiliate'
|
|
173
|
+
| 'Other';
|
|
174
|
+
|
|
175
|
+
export interface ApiError {
|
|
176
|
+
code: number;
|
|
177
|
+
entity: ApiEntity;
|
|
178
|
+
message: string;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
/**
|
|
182
|
+
* API Error Codes
|
|
183
|
+
*/
|
|
184
|
+
export const API_ERROR_CODES = {
|
|
185
|
+
INSUFFICIENT_ALLOWANCE: 25,
|
|
186
|
+
} as const;
|
package/tsconfig.json
CHANGED
|
@@ -7,12 +7,11 @@
|
|
|
7
7
|
"moduleDetection": "force",
|
|
8
8
|
"jsx": "react-jsx",
|
|
9
9
|
"allowJs": true,
|
|
10
|
+
"outDir": "./dist",
|
|
10
11
|
|
|
11
12
|
// Bundler mode
|
|
12
13
|
"moduleResolution": "bundler",
|
|
13
|
-
"allowImportingTsExtensions": true,
|
|
14
14
|
"verbatimModuleSyntax": true,
|
|
15
|
-
"noEmit": true,
|
|
16
15
|
|
|
17
16
|
// Best practices
|
|
18
17
|
"strict": true,
|
|
@@ -24,5 +23,5 @@
|
|
|
24
23
|
"noUnusedParameters": false,
|
|
25
24
|
"noPropertyAccessFromIndexSignature": false,
|
|
26
25
|
},
|
|
27
|
-
"include": ["src", "eslint.config.ts"],
|
|
26
|
+
"include": ["src/*", "eslint.config.ts"],
|
|
28
27
|
}
|