@nokinc-flur/sdk 0.1.6 → 1.0.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/LICENSE +32 -21
- package/README.md +100 -69
- package/dist/index.cjs +2294 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1593 -0
- package/dist/index.d.ts +1313 -2
- package/dist/index.js +1472 -6
- package/dist/index.js.map +1 -0
- package/openapi/flur.openapi.json +234 -234
- package/package.json +34 -8
|
@@ -1,235 +1,235 @@
|
|
|
1
|
-
{
|
|
2
|
-
"openapi": "3.0.3",
|
|
3
|
-
"info": {
|
|
4
|
-
"title": "Flur API",
|
|
5
|
-
"version": "0.1.0"
|
|
6
|
-
},
|
|
7
|
-
"paths": {
|
|
8
|
-
"/health": {
|
|
9
|
-
"get": {
|
|
10
|
-
"responses": {
|
|
11
|
-
"200": {
|
|
12
|
-
"description": "OK",
|
|
13
|
-
"content": {
|
|
14
|
-
"application/json": {
|
|
15
|
-
"schema": {
|
|
16
|
-
"type": "object",
|
|
17
|
-
"properties": {
|
|
18
|
-
"ok": {
|
|
19
|
-
"type": "boolean"
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
"required": [
|
|
23
|
-
"ok"
|
|
24
|
-
]
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
},
|
|
32
|
-
"/welcome": {
|
|
33
|
-
"get": {
|
|
34
|
-
"responses": {
|
|
35
|
-
"200": {
|
|
36
|
-
"description": "OK",
|
|
37
|
-
"content": {
|
|
38
|
-
"application/json": {
|
|
39
|
-
"schema": {
|
|
40
|
-
"type": "object",
|
|
41
|
-
"properties": {
|
|
42
|
-
"message": {
|
|
43
|
-
"type": "string",
|
|
44
|
-
"example": "welcome to flur wallet. Today is 2026-02-07T19:09:53.238Z"
|
|
45
|
-
}
|
|
46
|
-
},
|
|
47
|
-
"required": [
|
|
48
|
-
"message"
|
|
49
|
-
]
|
|
50
|
-
}
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
},
|
|
57
|
-
"/v1/onboarding/start": {
|
|
58
|
-
"post": {
|
|
59
|
-
"requestBody": {
|
|
60
|
-
"required": true,
|
|
61
|
-
"content": {
|
|
62
|
-
"application/json": {
|
|
63
|
-
"schema": {
|
|
64
|
-
"type": "object",
|
|
65
|
-
"properties": {
|
|
66
|
-
"phoneE164": {
|
|
67
|
-
"type": "string"
|
|
68
|
-
}
|
|
69
|
-
},
|
|
70
|
-
"required": [
|
|
71
|
-
"phoneE164"
|
|
72
|
-
]
|
|
73
|
-
}
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
},
|
|
77
|
-
"responses": {
|
|
78
|
-
"200": {
|
|
79
|
-
"description": "Verification started",
|
|
80
|
-
"content": {
|
|
81
|
-
"application/json": {
|
|
82
|
-
"schema": {
|
|
83
|
-
"type": "object",
|
|
84
|
-
"properties": {
|
|
85
|
-
"requestId": {
|
|
86
|
-
"type": "string"
|
|
87
|
-
},
|
|
88
|
-
"checkUrl": {
|
|
89
|
-
"type": "string"
|
|
90
|
-
},
|
|
91
|
-
"expiresInSec": {
|
|
92
|
-
"type": "integer"
|
|
93
|
-
},
|
|
94
|
-
"fallback": {
|
|
95
|
-
"type": "string",
|
|
96
|
-
"enum": [
|
|
97
|
-
"SILENT_AUTH",
|
|
98
|
-
"OTP"
|
|
99
|
-
]
|
|
100
|
-
}
|
|
101
|
-
},
|
|
102
|
-
"required": [
|
|
103
|
-
"requestId",
|
|
104
|
-
"expiresInSec",
|
|
105
|
-
"fallback"
|
|
106
|
-
]
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
},
|
|
111
|
-
"400": {
|
|
112
|
-
"description": "Unable to start verification",
|
|
113
|
-
"content": {
|
|
114
|
-
"application/json": {
|
|
115
|
-
"schema": {
|
|
116
|
-
"type": "object",
|
|
117
|
-
"properties": {
|
|
118
|
-
"error": {
|
|
119
|
-
"type": "string"
|
|
120
|
-
}
|
|
121
|
-
},
|
|
122
|
-
"required": [
|
|
123
|
-
"error"
|
|
124
|
-
]
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
}
|
|
128
|
-
},
|
|
129
|
-
"429": {
|
|
130
|
-
"description": "Rate limited",
|
|
131
|
-
"content": {
|
|
132
|
-
"application/json": {
|
|
133
|
-
"schema": {
|
|
134
|
-
"type": "object",
|
|
135
|
-
"properties": {
|
|
136
|
-
"error": {
|
|
137
|
-
"type": "string"
|
|
138
|
-
}
|
|
139
|
-
},
|
|
140
|
-
"required": [
|
|
141
|
-
"error"
|
|
142
|
-
]
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
},
|
|
150
|
-
"/v1/onboarding/complete": {
|
|
151
|
-
"post": {
|
|
152
|
-
"requestBody": {
|
|
153
|
-
"required": true,
|
|
154
|
-
"content": {
|
|
155
|
-
"application/json": {
|
|
156
|
-
"schema": {
|
|
157
|
-
"type": "object",
|
|
158
|
-
"properties": {
|
|
159
|
-
"requestId": {
|
|
160
|
-
"type": "string"
|
|
161
|
-
},
|
|
162
|
-
"code": {
|
|
163
|
-
"type": "string"
|
|
164
|
-
}
|
|
165
|
-
},
|
|
166
|
-
"required": [
|
|
167
|
-
"requestId",
|
|
168
|
-
"code"
|
|
169
|
-
]
|
|
170
|
-
}
|
|
171
|
-
}
|
|
172
|
-
}
|
|
173
|
-
},
|
|
174
|
-
"responses": {
|
|
175
|
-
"200": {
|
|
176
|
-
"description": "Verification completed",
|
|
177
|
-
"content": {
|
|
178
|
-
"application/json": {
|
|
179
|
-
"schema": {
|
|
180
|
-
"type": "object",
|
|
181
|
-
"properties": {
|
|
182
|
-
"sessionToken": {
|
|
183
|
-
"type": "string"
|
|
184
|
-
},
|
|
185
|
-
"userId": {
|
|
186
|
-
"type": "string"
|
|
187
|
-
},
|
|
188
|
-
"restricted": {
|
|
189
|
-
"type": "boolean"
|
|
190
|
-
},
|
|
191
|
-
"risk_reasons": {
|
|
192
|
-
"type": "array",
|
|
193
|
-
"items": {
|
|
194
|
-
"type": "string",
|
|
195
|
-
"enum": [
|
|
196
|
-
"SIM_SWAP_RECENT",
|
|
197
|
-
"ROAMING",
|
|
198
|
-
"CARRIER_CHANGED"
|
|
199
|
-
]
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
},
|
|
203
|
-
"required": [
|
|
204
|
-
"sessionToken",
|
|
205
|
-
"userId",
|
|
206
|
-
"restricted",
|
|
207
|
-
"risk_reasons"
|
|
208
|
-
]
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
}
|
|
212
|
-
},
|
|
213
|
-
"400": {
|
|
214
|
-
"description": "Verification failed",
|
|
215
|
-
"content": {
|
|
216
|
-
"application/json": {
|
|
217
|
-
"schema": {
|
|
218
|
-
"type": "object",
|
|
219
|
-
"properties": {
|
|
220
|
-
"error": {
|
|
221
|
-
"type": "string"
|
|
222
|
-
}
|
|
223
|
-
},
|
|
224
|
-
"required": [
|
|
225
|
-
"error"
|
|
226
|
-
]
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
}
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
}
|
|
234
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"openapi": "3.0.3",
|
|
3
|
+
"info": {
|
|
4
|
+
"title": "Flur API",
|
|
5
|
+
"version": "0.1.0"
|
|
6
|
+
},
|
|
7
|
+
"paths": {
|
|
8
|
+
"/health": {
|
|
9
|
+
"get": {
|
|
10
|
+
"responses": {
|
|
11
|
+
"200": {
|
|
12
|
+
"description": "OK",
|
|
13
|
+
"content": {
|
|
14
|
+
"application/json": {
|
|
15
|
+
"schema": {
|
|
16
|
+
"type": "object",
|
|
17
|
+
"properties": {
|
|
18
|
+
"ok": {
|
|
19
|
+
"type": "boolean"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"required": [
|
|
23
|
+
"ok"
|
|
24
|
+
]
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
},
|
|
32
|
+
"/welcome": {
|
|
33
|
+
"get": {
|
|
34
|
+
"responses": {
|
|
35
|
+
"200": {
|
|
36
|
+
"description": "OK",
|
|
37
|
+
"content": {
|
|
38
|
+
"application/json": {
|
|
39
|
+
"schema": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"properties": {
|
|
42
|
+
"message": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"example": "welcome to flur wallet. Today is 2026-02-07T19:09:53.238Z"
|
|
45
|
+
}
|
|
46
|
+
},
|
|
47
|
+
"required": [
|
|
48
|
+
"message"
|
|
49
|
+
]
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"/v1/onboarding/start": {
|
|
58
|
+
"post": {
|
|
59
|
+
"requestBody": {
|
|
60
|
+
"required": true,
|
|
61
|
+
"content": {
|
|
62
|
+
"application/json": {
|
|
63
|
+
"schema": {
|
|
64
|
+
"type": "object",
|
|
65
|
+
"properties": {
|
|
66
|
+
"phoneE164": {
|
|
67
|
+
"type": "string"
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
"required": [
|
|
71
|
+
"phoneE164"
|
|
72
|
+
]
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
},
|
|
77
|
+
"responses": {
|
|
78
|
+
"200": {
|
|
79
|
+
"description": "Verification started",
|
|
80
|
+
"content": {
|
|
81
|
+
"application/json": {
|
|
82
|
+
"schema": {
|
|
83
|
+
"type": "object",
|
|
84
|
+
"properties": {
|
|
85
|
+
"requestId": {
|
|
86
|
+
"type": "string"
|
|
87
|
+
},
|
|
88
|
+
"checkUrl": {
|
|
89
|
+
"type": "string"
|
|
90
|
+
},
|
|
91
|
+
"expiresInSec": {
|
|
92
|
+
"type": "integer"
|
|
93
|
+
},
|
|
94
|
+
"fallback": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"enum": [
|
|
97
|
+
"SILENT_AUTH",
|
|
98
|
+
"OTP"
|
|
99
|
+
]
|
|
100
|
+
}
|
|
101
|
+
},
|
|
102
|
+
"required": [
|
|
103
|
+
"requestId",
|
|
104
|
+
"expiresInSec",
|
|
105
|
+
"fallback"
|
|
106
|
+
]
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
},
|
|
111
|
+
"400": {
|
|
112
|
+
"description": "Unable to start verification",
|
|
113
|
+
"content": {
|
|
114
|
+
"application/json": {
|
|
115
|
+
"schema": {
|
|
116
|
+
"type": "object",
|
|
117
|
+
"properties": {
|
|
118
|
+
"error": {
|
|
119
|
+
"type": "string"
|
|
120
|
+
}
|
|
121
|
+
},
|
|
122
|
+
"required": [
|
|
123
|
+
"error"
|
|
124
|
+
]
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"429": {
|
|
130
|
+
"description": "Rate limited",
|
|
131
|
+
"content": {
|
|
132
|
+
"application/json": {
|
|
133
|
+
"schema": {
|
|
134
|
+
"type": "object",
|
|
135
|
+
"properties": {
|
|
136
|
+
"error": {
|
|
137
|
+
"type": "string"
|
|
138
|
+
}
|
|
139
|
+
},
|
|
140
|
+
"required": [
|
|
141
|
+
"error"
|
|
142
|
+
]
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"/v1/onboarding/complete": {
|
|
151
|
+
"post": {
|
|
152
|
+
"requestBody": {
|
|
153
|
+
"required": true,
|
|
154
|
+
"content": {
|
|
155
|
+
"application/json": {
|
|
156
|
+
"schema": {
|
|
157
|
+
"type": "object",
|
|
158
|
+
"properties": {
|
|
159
|
+
"requestId": {
|
|
160
|
+
"type": "string"
|
|
161
|
+
},
|
|
162
|
+
"code": {
|
|
163
|
+
"type": "string"
|
|
164
|
+
}
|
|
165
|
+
},
|
|
166
|
+
"required": [
|
|
167
|
+
"requestId",
|
|
168
|
+
"code"
|
|
169
|
+
]
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
},
|
|
174
|
+
"responses": {
|
|
175
|
+
"200": {
|
|
176
|
+
"description": "Verification completed",
|
|
177
|
+
"content": {
|
|
178
|
+
"application/json": {
|
|
179
|
+
"schema": {
|
|
180
|
+
"type": "object",
|
|
181
|
+
"properties": {
|
|
182
|
+
"sessionToken": {
|
|
183
|
+
"type": "string"
|
|
184
|
+
},
|
|
185
|
+
"userId": {
|
|
186
|
+
"type": "string"
|
|
187
|
+
},
|
|
188
|
+
"restricted": {
|
|
189
|
+
"type": "boolean"
|
|
190
|
+
},
|
|
191
|
+
"risk_reasons": {
|
|
192
|
+
"type": "array",
|
|
193
|
+
"items": {
|
|
194
|
+
"type": "string",
|
|
195
|
+
"enum": [
|
|
196
|
+
"SIM_SWAP_RECENT",
|
|
197
|
+
"ROAMING",
|
|
198
|
+
"CARRIER_CHANGED"
|
|
199
|
+
]
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
"required": [
|
|
204
|
+
"sessionToken",
|
|
205
|
+
"userId",
|
|
206
|
+
"restricted",
|
|
207
|
+
"risk_reasons"
|
|
208
|
+
]
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
},
|
|
213
|
+
"400": {
|
|
214
|
+
"description": "Verification failed",
|
|
215
|
+
"content": {
|
|
216
|
+
"application/json": {
|
|
217
|
+
"schema": {
|
|
218
|
+
"type": "object",
|
|
219
|
+
"properties": {
|
|
220
|
+
"error": {
|
|
221
|
+
"type": "string"
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
"required": [
|
|
225
|
+
"error"
|
|
226
|
+
]
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
}
|
|
235
235
|
}
|
package/package.json
CHANGED
|
@@ -1,15 +1,24 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nokinc-flur/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"description": "Flur Wallet SDK (sprint 1 scaffold)",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "UNLICENSED",
|
|
6
|
+
"private": false,
|
|
6
7
|
"type": "module",
|
|
7
|
-
"
|
|
8
|
+
"packageManager": "pnpm@9.15.0",
|
|
9
|
+
"main": "dist/index.cjs",
|
|
10
|
+
"module": "dist/index.js",
|
|
8
11
|
"types": "dist/index.d.ts",
|
|
9
12
|
"exports": {
|
|
10
13
|
".": {
|
|
11
|
-
"
|
|
12
|
-
|
|
14
|
+
"import": {
|
|
15
|
+
"types": "./dist/index.d.ts",
|
|
16
|
+
"default": "./dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"require": {
|
|
19
|
+
"types": "./dist/index.d.cts",
|
|
20
|
+
"default": "./dist/index.cjs"
|
|
21
|
+
}
|
|
13
22
|
}
|
|
14
23
|
},
|
|
15
24
|
"files": [
|
|
@@ -22,17 +31,23 @@
|
|
|
22
31
|
"lint": "eslint .",
|
|
23
32
|
"typecheck": "tsc -p tsconfig.json --noEmit",
|
|
24
33
|
"test": "vitest run",
|
|
34
|
+
"test:vectors": "vitest run test/nqr/vectors.test.ts",
|
|
25
35
|
"test:contract": "vitest run test/e2e.health.test.ts test/e2e.send-money.test.ts",
|
|
26
36
|
"e2e:bootstrap": "node scripts/bootstrap-e2e-sendmoney.mjs",
|
|
27
|
-
"build": "tsup src/index.ts --format esm --dts",
|
|
37
|
+
"build": "tsup src/index.ts --format esm,cjs --dts --sourcemap",
|
|
38
|
+
"build:dev": "tsup src/index.ts --format esm,cjs --dts --sourcemap",
|
|
39
|
+
"build:prod": "tsup src/index.ts --format esm,cjs --dts --minify",
|
|
28
40
|
"gen": "openapi-typescript openapi/flur.openapi.json -o src/gen/openapi-types.ts",
|
|
29
41
|
"prod:release": "pwsh -NoProfile -ExecutionPolicy Bypass -File ./scripts/prod-build-publish-npm.ps1",
|
|
30
42
|
"prod:release:publish": "pwsh -NoProfile -ExecutionPolicy Bypass -File ./scripts/prod-build-publish-npm.ps1 -Publish",
|
|
31
43
|
"release:patch": "pwsh -NoProfile -ExecutionPolicy Bypass -File ./scripts/release.ps1 -Bump patch",
|
|
32
44
|
"release:minor": "pwsh -NoProfile -ExecutionPolicy Bypass -File ./scripts/release.ps1 -Bump minor",
|
|
33
|
-
"release:major": "pwsh -NoProfile -ExecutionPolicy Bypass -File ./scripts/release.ps1 -Bump major"
|
|
45
|
+
"release:major": "pwsh -NoProfile -ExecutionPolicy Bypass -File ./scripts/release.ps1 -Bump major",
|
|
46
|
+
"prepare": "husky"
|
|
34
47
|
},
|
|
35
48
|
"dependencies": {
|
|
49
|
+
"@noble/curves": "^1.9.7",
|
|
50
|
+
"@noble/hashes": "^1.8.0",
|
|
36
51
|
"zod": "^3.23.8"
|
|
37
52
|
},
|
|
38
53
|
"devDependencies": {
|
|
@@ -41,10 +56,21 @@
|
|
|
41
56
|
"@typescript-eslint/parser": "^7.7.1",
|
|
42
57
|
"eslint": "^8.57.0",
|
|
43
58
|
"eslint-config-prettier": "^9.1.0",
|
|
59
|
+
"husky": "^9.1.7",
|
|
60
|
+
"lint-staged": "^16.4.0",
|
|
44
61
|
"openapi-typescript": "^7.5.1",
|
|
45
62
|
"prettier": "^3.2.5",
|
|
46
63
|
"tsup": "^8.0.2",
|
|
47
|
-
"typescript": "
|
|
64
|
+
"typescript": "~5.5.4",
|
|
48
65
|
"vitest": "^1.5.0"
|
|
66
|
+
},
|
|
67
|
+
"lint-staged": {
|
|
68
|
+
"*.{ts,tsx}": [
|
|
69
|
+
"prettier --write",
|
|
70
|
+
"eslint --fix --max-warnings 0"
|
|
71
|
+
],
|
|
72
|
+
"*.{js,jsx,json,md,cjs,mjs}": [
|
|
73
|
+
"prettier --write"
|
|
74
|
+
]
|
|
49
75
|
}
|
|
50
76
|
}
|