@nokinc-flur/sdk 2.5.0 → 3.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/README.md +17 -17
- package/dist/index.cjs +3 -5305
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +15 -24
- package/dist/index.d.ts +15 -24
- package/dist/index.js +3 -5019
- package/dist/index.js.map +1 -1
- package/openapi/flur.openapi.json +167 -7
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# flur
|
|
1
|
+
# @nokinc-flur/sdk
|
|
2
2
|
|
|
3
|
-
Typed client
|
|
3
|
+
Typed Flur Wallet client aligned to the backend OpenAPI contract.
|
|
4
4
|
|
|
5
5
|
## Install (local dev)
|
|
6
6
|
|
|
@@ -74,7 +74,7 @@ const completed = await client.onboardingComplete({
|
|
|
74
74
|
code: '123456',
|
|
75
75
|
appInstanceId: 'app-instance-1',
|
|
76
76
|
});
|
|
77
|
-
// completed: {
|
|
77
|
+
// completed: { accessToken, refreshToken, userId, restricted, risk_reasons }
|
|
78
78
|
```
|
|
79
79
|
|
|
80
80
|
## Auth + device security methods
|
|
@@ -85,31 +85,31 @@ const registered = await client.registerDevice(
|
|
|
85
85
|
userId: completed.userId,
|
|
86
86
|
appInstanceId: 'app-instance-1',
|
|
87
87
|
platform: 'ios',
|
|
88
|
-
networkSignals: {
|
|
88
|
+
networkSignals: {},
|
|
89
89
|
},
|
|
90
|
-
{ accessToken: completed.
|
|
90
|
+
{ accessToken: completed.accessToken },
|
|
91
91
|
);
|
|
92
92
|
// { deviceId, fingerprintHash, driftScore, trustState, stepUpRequired }
|
|
93
93
|
|
|
94
94
|
const refreshed = await client.authRefresh({
|
|
95
95
|
userId: completed.userId,
|
|
96
|
-
refreshToken: completed.
|
|
96
|
+
refreshToken: completed.refreshToken,
|
|
97
97
|
appInstanceId: 'app-instance-1',
|
|
98
98
|
fingerprintHash: registered.fingerprintHash,
|
|
99
99
|
});
|
|
100
|
-
// { refreshToken, stepUpRequired }
|
|
100
|
+
// { accessToken, refreshToken, stepUpRequired }
|
|
101
101
|
|
|
102
102
|
await client.pinSet(
|
|
103
103
|
{ userId: completed.userId, pin: '123456' },
|
|
104
|
-
{ accessToken: completed.
|
|
104
|
+
{ accessToken: completed.accessToken },
|
|
105
105
|
);
|
|
106
106
|
await client.pinVerify(
|
|
107
107
|
{ userId: completed.userId, pin: '123456' },
|
|
108
|
-
{ accessToken: completed.
|
|
108
|
+
{ accessToken: completed.accessToken },
|
|
109
109
|
);
|
|
110
110
|
await client.authLogout(
|
|
111
111
|
{ userId: completed.userId, refreshToken: refreshed.refreshToken },
|
|
112
|
-
{ accessToken: refreshed.
|
|
112
|
+
{ accessToken: refreshed.accessToken },
|
|
113
113
|
);
|
|
114
114
|
```
|
|
115
115
|
|
|
@@ -123,7 +123,7 @@ await client.registerSendDeviceKey(
|
|
|
123
123
|
deviceId: registered.deviceId,
|
|
124
124
|
publicKey: '-----BEGIN PUBLIC KEY-----...',
|
|
125
125
|
},
|
|
126
|
-
{ accessToken: completed.
|
|
126
|
+
{ accessToken: completed.accessToken },
|
|
127
127
|
);
|
|
128
128
|
|
|
129
129
|
// Obtain challenge and verify signature to get short-lived send token
|
|
@@ -132,7 +132,7 @@ const challenge = await client.createSendChallenge(
|
|
|
132
132
|
userId: completed.userId,
|
|
133
133
|
deviceId: registered.deviceId,
|
|
134
134
|
},
|
|
135
|
-
{ accessToken: completed.
|
|
135
|
+
{ accessToken: completed.accessToken },
|
|
136
136
|
);
|
|
137
137
|
|
|
138
138
|
const send = await client.verifySendChallenge(
|
|
@@ -142,13 +142,13 @@ const send = await client.verifySendChallenge(
|
|
|
142
142
|
challengeId: challenge.challengeId,
|
|
143
143
|
signature: 'base64-signature',
|
|
144
144
|
},
|
|
145
|
-
{ accessToken: completed.
|
|
145
|
+
{ accessToken: completed.accessToken },
|
|
146
146
|
);
|
|
147
147
|
|
|
148
148
|
// Resolve recipient and create transfer
|
|
149
149
|
const recipient = await client.resolveRecipient(
|
|
150
150
|
{ identifier: '+14155550123' },
|
|
151
|
-
{ accessToken: completed.
|
|
151
|
+
{ accessToken: completed.accessToken },
|
|
152
152
|
);
|
|
153
153
|
|
|
154
154
|
await client.createTransfer(
|
|
@@ -159,16 +159,16 @@ await client.createTransfer(
|
|
|
159
159
|
sendAuthToken: send.sendAuthToken,
|
|
160
160
|
},
|
|
161
161
|
{
|
|
162
|
-
accessToken: completed.
|
|
162
|
+
accessToken: completed.accessToken,
|
|
163
163
|
deviceId: registered.deviceId,
|
|
164
164
|
idempotencyKey: crypto.randomUUID(),
|
|
165
165
|
},
|
|
166
166
|
);
|
|
167
167
|
|
|
168
168
|
// Account + transaction endpoints
|
|
169
|
-
await client.accountSummary({ accessToken: completed.
|
|
169
|
+
await client.accountSummary({ accessToken: completed.accessToken });
|
|
170
170
|
await client.listTransactions({
|
|
171
|
-
accessToken: completed.
|
|
171
|
+
accessToken: completed.accessToken,
|
|
172
172
|
limit: 20,
|
|
173
173
|
});
|
|
174
174
|
```
|