@tomo-inc/transaction-builder-sdk 0.0.1-alpha.0 → 0.0.1-alpha.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/package.json +10 -15
- package/project.json +52 -0
- package/{__tests__ → src/__tests__}/business.test.ts +2 -3
- package/tsconfig.json +25 -0
- package/tsup.config.ts +15 -0
package/package.json
CHANGED
|
@@ -1,35 +1,30 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tomo-inc/transaction-builder-sdk",
|
|
3
|
-
"version": "0.0.1-alpha.
|
|
3
|
+
"version": "0.0.1-alpha.2",
|
|
4
4
|
"author": "tomo.inc",
|
|
5
5
|
"private": false,
|
|
6
|
-
"main": "./dist/index.
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
7
|
"module": "./dist/index.mjs",
|
|
8
|
+
"browser": "./dist/index.js",
|
|
8
9
|
"types": "./dist/index.d.ts",
|
|
10
|
+
"type": "module",
|
|
9
11
|
"exports": {
|
|
10
12
|
".": {
|
|
11
13
|
"types": "./dist/index.d.ts",
|
|
12
14
|
"import": "./dist/index.mjs",
|
|
13
|
-
"require": "./dist/index.
|
|
15
|
+
"require": "./dist/index.cjs"
|
|
14
16
|
}
|
|
15
17
|
},
|
|
16
|
-
"scripts": {
|
|
17
|
-
"build": "tsup src/index.ts --format esm,cjs --dts --treeshake",
|
|
18
|
-
"dev": "tsup src/index.ts --format esm,cjs --watch --dts",
|
|
19
|
-
"lint": "eslint src/**/*.ts",
|
|
20
|
-
"test": "vitest run",
|
|
21
|
-
"test:watch": "vitest"
|
|
22
|
-
},
|
|
23
18
|
"dependencies": {
|
|
24
|
-
"@tomo-inc/tomo-api": "workspace:*",
|
|
25
19
|
"axios": "^1.11.0",
|
|
26
20
|
"viem": "^2.0.0",
|
|
27
21
|
"tronweb": "^6.0.3"
|
|
28
22
|
},
|
|
29
23
|
"devDependencies": {
|
|
30
|
-
"@
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
24
|
+
"@tomo-inc/tomo-api": "workspace:*",
|
|
25
|
+
"@types/node": "^20.11.19",
|
|
26
|
+
"tsup": "^8.3.5",
|
|
27
|
+
"typescript": "^5.3.3",
|
|
28
|
+
"vitest": "^3.0.8"
|
|
34
29
|
}
|
|
35
30
|
}
|
package/project.json
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "transaction-builder-sdk",
|
|
3
|
+
"sourceRoot": "packages/transaction-builder-sdk/src",
|
|
4
|
+
"projectType": "library",
|
|
5
|
+
"targets": {
|
|
6
|
+
"build": {
|
|
7
|
+
"executor": "nx:run-commands",
|
|
8
|
+
"outputs": ["{projectRoot}/dist"],
|
|
9
|
+
"options": {
|
|
10
|
+
"command": "tsup",
|
|
11
|
+
"cwd": "packages/transaction-builder-sdk"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"dev": {
|
|
15
|
+
"executor": "nx:run-commands",
|
|
16
|
+
"options": {
|
|
17
|
+
"command": "tsup --watch",
|
|
18
|
+
"cwd": "packages/transaction-builder-sdk"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"test": {
|
|
22
|
+
"executor": "nx:run-commands",
|
|
23
|
+
"outputs": ["{projectRoot}/coverage"],
|
|
24
|
+
"options": {
|
|
25
|
+
"command": "vitest run --typecheck=false src/__tests__/business.test.ts",
|
|
26
|
+
"cwd": "packages/transaction-builder-sdk"
|
|
27
|
+
}
|
|
28
|
+
},
|
|
29
|
+
"version:up": {
|
|
30
|
+
"executor": "nx:run-commands",
|
|
31
|
+
"options": {
|
|
32
|
+
"command": "npm version patch --no-git-tag-version",
|
|
33
|
+
"cwd": "packages/transaction-builder-sdk"
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
"lint": {
|
|
37
|
+
"executor": "nx:run-commands",
|
|
38
|
+
"options": {
|
|
39
|
+
"command": "eslint src/",
|
|
40
|
+
"cwd": "packages/transaction-builder-sdk"
|
|
41
|
+
}
|
|
42
|
+
},
|
|
43
|
+
"type-check": {
|
|
44
|
+
"executor": "nx:run-commands",
|
|
45
|
+
"options": {
|
|
46
|
+
"command": "tsc --noEmit",
|
|
47
|
+
"cwd": "packages/transaction-builder-sdk"
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
"tags": ["scope:transaction-builder", "type:library"]
|
|
52
|
+
}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
// __tests__/business.integration.test.ts
|
|
2
2
|
import { beforeEach, describe, expect, it, vi } from "vitest";
|
|
3
|
-
import { Business } from "../
|
|
4
|
-
import {
|
|
5
|
-
import { TransactionQuoteParams, TransactionQuoteResult, TransactionToken } from "../src/types/swap";
|
|
3
|
+
import { Business, Chain, TransactionQuoteParams, TransactionQuoteResult, TransactionToken } from "../";
|
|
4
|
+
import { IPlatformType } from "../types/chain";
|
|
6
5
|
|
|
7
6
|
describe("Business Integration", () => {
|
|
8
7
|
let business: Business;
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"extends": "../../tsconfig.base.json",
|
|
3
|
+
"compilerOptions": {
|
|
4
|
+
"outDir": "../../dist/packages/transaction-builder-sdk",
|
|
5
|
+
"declaration": true,
|
|
6
|
+
"declarationMap": true,
|
|
7
|
+
"sourceMap": true,
|
|
8
|
+
"skipLibCheck": true,
|
|
9
|
+
"moduleResolution": "node",
|
|
10
|
+
"types": [],
|
|
11
|
+
"allowSyntheticDefaultImports": true,
|
|
12
|
+
"esModuleInterop": true,
|
|
13
|
+
"module": "ESNext",
|
|
14
|
+
"target": "ES2022",
|
|
15
|
+
"lib": ["ES2022", "DOM"],
|
|
16
|
+
"strict": true,
|
|
17
|
+
"resolveJsonModule": true,
|
|
18
|
+
"baseUrl": ".",
|
|
19
|
+
"paths": {
|
|
20
|
+
"@/*": ["src/*"]
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
"include": ["src/**/*"],
|
|
24
|
+
"exclude": ["node_modules", "dist", "__tests__"]
|
|
25
|
+
}
|
package/tsup.config.ts
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { defineConfig } from "tsup";
|
|
2
|
+
|
|
3
|
+
export default defineConfig({
|
|
4
|
+
entry: ["src/index.ts"],
|
|
5
|
+
format: ["esm", "cjs"],
|
|
6
|
+
dts: true,
|
|
7
|
+
treeshake: true,
|
|
8
|
+
clean: true,
|
|
9
|
+
target: "es2022",
|
|
10
|
+
outExtension({ format }) {
|
|
11
|
+
return {
|
|
12
|
+
js: format === "esm" ? ".mjs" : ".js",
|
|
13
|
+
};
|
|
14
|
+
},
|
|
15
|
+
});
|