@4mica/sdk 0.5.0 → 0.5.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/README.md +251 -395
- package/package.json +36 -3
- package/.eslintrc.cjs +0 -29
- package/.github/workflows/ci.yml +0 -31
- package/.prettierignore +0 -3
- package/.prettierrc +0 -6
- package/eslint.config.mjs +0 -22
- package/src/abi/core4mica.json +0 -1605
- package/src/abi/erc20.json +0 -187
- package/src/auth.ts +0 -325
- package/src/bls.ts +0 -76
- package/src/client.ts +0 -347
- package/src/config.ts +0 -149
- package/src/contract.ts +0 -194
- package/src/errors.ts +0 -40
- package/src/guarantee.ts +0 -96
- package/src/index.ts +0 -12
- package/src/models.ts +0 -309
- package/src/rpc.ts +0 -225
- package/src/signing.ts +0 -330
- package/src/utils.ts +0 -75
- package/src/x402/index.ts +0 -192
- package/src/x402/models.ts +0 -94
- package/tests/auth.integration.test.ts +0 -97
- package/tests/auth.test.ts +0 -292
- package/tests/config.test.ts +0 -56
- package/tests/guarantee.test.ts +0 -26
- package/tests/rpc.test.ts +0 -76
- package/tests/signing.test.ts +0 -52
- package/tests/utils.test.ts +0 -35
- package/tests/x402.test.ts +0 -152
- package/tsconfig.build.json +0 -5
- package/tsconfig.json +0 -15
- package/vitest.config.ts +0 -12
package/package.json
CHANGED
|
@@ -1,18 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@4mica/sdk",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.2",
|
|
4
4
|
"description": "TypeScript SDK for interacting with the 4Mica payment network",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "https://github.com/4mica-Network/ts-sdk-4mica.git"
|
|
10
|
+
},
|
|
11
|
+
"homepage": "https://github.com/4mica-Network/ts-sdk-4mica#readme",
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/4mica-Network/ts-sdk-4mica/issues"
|
|
14
|
+
},
|
|
15
|
+
|
|
5
16
|
"main": "dist/index.js",
|
|
6
17
|
"types": "dist/index.d.ts",
|
|
18
|
+
|
|
19
|
+
"exports": {
|
|
20
|
+
".": {
|
|
21
|
+
"types": "./dist/index.d.ts",
|
|
22
|
+
"default": "./dist/index.js"
|
|
23
|
+
}
|
|
24
|
+
},
|
|
25
|
+
|
|
26
|
+
"files": ["dist"],
|
|
27
|
+
"sideEffects": false,
|
|
28
|
+
|
|
29
|
+
"engines": {
|
|
30
|
+
"node": ">=18"
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
"publishConfig": {
|
|
34
|
+
"access": "public"
|
|
35
|
+
},
|
|
36
|
+
|
|
37
|
+
"keywords": ["4mica", "payments", "payment-network", "blockchain", "sdk", "typescript", "ethers"],
|
|
38
|
+
|
|
7
39
|
"scripts": {
|
|
8
40
|
"build": "tsc -p tsconfig.build.json",
|
|
9
41
|
"test": "vitest run",
|
|
10
42
|
"lint": "eslint . --ext .ts",
|
|
11
43
|
"fmt": "prettier --check \"{src,tests}/**/*.{ts,js,json}\""
|
|
12
44
|
},
|
|
45
|
+
|
|
13
46
|
"dependencies": {
|
|
14
47
|
"ethers": "^6.16.0"
|
|
15
48
|
},
|
|
49
|
+
|
|
16
50
|
"devDependencies": {
|
|
17
51
|
"@eslint/js": "^9.39.2",
|
|
18
52
|
"@types/node": "^25.2.0",
|
|
@@ -26,6 +60,5 @@
|
|
|
26
60
|
"typescript": "^5.3.3",
|
|
27
61
|
"typescript-eslint": "^8.54.0",
|
|
28
62
|
"vitest": "^4.0.17"
|
|
29
|
-
}
|
|
30
|
-
"license": "MIT"
|
|
63
|
+
}
|
|
31
64
|
}
|
package/.eslintrc.cjs
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
module.exports = {
|
|
2
|
-
root: true,
|
|
3
|
-
env: {
|
|
4
|
-
es2020: true,
|
|
5
|
-
node: true,
|
|
6
|
-
},
|
|
7
|
-
parser: "@typescript-eslint/parser",
|
|
8
|
-
parserOptions: {
|
|
9
|
-
sourceType: "module",
|
|
10
|
-
ecmaVersion: 2020,
|
|
11
|
-
project: "./tsconfig.json",
|
|
12
|
-
},
|
|
13
|
-
plugins: ["@typescript-eslint"],
|
|
14
|
-
extends: [
|
|
15
|
-
"eslint:recommended",
|
|
16
|
-
"plugin:@typescript-eslint/recommended",
|
|
17
|
-
"eslint-config-prettier",
|
|
18
|
-
],
|
|
19
|
-
rules: {
|
|
20
|
-
"@typescript-eslint/no-explicit-any": "off",
|
|
21
|
-
"@typescript-eslint/explicit-module-boundary-types": "off",
|
|
22
|
-
"@typescript-eslint/no-unused-vars": [
|
|
23
|
-
"error",
|
|
24
|
-
{ argsIgnorePattern: "^_", varsIgnorePattern: "^_" },
|
|
25
|
-
],
|
|
26
|
-
"@typescript-eslint/no-var-requires": "off",
|
|
27
|
-
},
|
|
28
|
-
ignorePatterns: ["dist", "node_modules"],
|
|
29
|
-
};
|
package/.github/workflows/ci.yml
DELETED
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
name: CI
|
|
2
|
-
|
|
3
|
-
on:
|
|
4
|
-
push:
|
|
5
|
-
branches: [main]
|
|
6
|
-
pull_request:
|
|
7
|
-
|
|
8
|
-
jobs:
|
|
9
|
-
build:
|
|
10
|
-
runs-on: ubuntu-latest
|
|
11
|
-
steps:
|
|
12
|
-
- name: Checkout
|
|
13
|
-
uses: actions/checkout@v4
|
|
14
|
-
|
|
15
|
-
- name: Use Node.js 20
|
|
16
|
-
uses: actions/setup-node@v4
|
|
17
|
-
with:
|
|
18
|
-
node-version: 20
|
|
19
|
-
cache: npm
|
|
20
|
-
|
|
21
|
-
- name: Install dependencies
|
|
22
|
-
run: npm install
|
|
23
|
-
|
|
24
|
-
- name: Format check
|
|
25
|
-
run: npm run fmt
|
|
26
|
-
|
|
27
|
-
- name: Lint
|
|
28
|
-
run: npm run lint
|
|
29
|
-
|
|
30
|
-
- name: Test
|
|
31
|
-
run: npm test
|
package/.prettierignore
DELETED
package/.prettierrc
DELETED
package/eslint.config.mjs
DELETED
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import js from "@eslint/js";
|
|
2
|
-
import globals from "globals";
|
|
3
|
-
import tseslint from "typescript-eslint";
|
|
4
|
-
import pluginReact from "eslint-plugin-react";
|
|
5
|
-
import { defineConfig } from "eslint/config";
|
|
6
|
-
|
|
7
|
-
export default defineConfig([
|
|
8
|
-
{
|
|
9
|
-
ignores: ["dist/**", "coverage/**", "node_modules/**", "*.cjs"],
|
|
10
|
-
},
|
|
11
|
-
{
|
|
12
|
-
files: ["**/*.{js,mjs,cjs,ts,mts,cts,jsx,tsx}"],
|
|
13
|
-
plugins: { js },
|
|
14
|
-
extends: ["js/recommended"],
|
|
15
|
-
languageOptions: { globals: globals.browser },
|
|
16
|
-
},
|
|
17
|
-
tseslint.configs.recommended,
|
|
18
|
-
pluginReact.configs.flat.recommended,
|
|
19
|
-
{
|
|
20
|
-
settings: { react: { version: "detect" } },
|
|
21
|
-
},
|
|
22
|
-
]);
|