passkey-kit 0.0.1

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.
@@ -0,0 +1,54 @@
1
+ # passkey-kit-sdk JS
2
+
3
+ JS library for interacting with [Soroban](https://soroban.stellar.org/) smart contract `passkey-kit-sdk` via Soroban RPC.
4
+
5
+ This library was automatically generated by Soroban CLI using a command similar to:
6
+
7
+ ```bash
8
+ soroban contract bindings ts \
9
+ --rpc-url https://soroban-testnet.stellar.org \
10
+ --network-passphrase "Test SDF Network ; September 2015" \
11
+ --contract-id CDSGG7BSWYWQMTY5KTZVDTC34ZESMZ75ZGSTTVHS4NIKCF4PM3GDJ4G3 \
12
+ --output-dir ./path/to/passkey-kit-sdk
13
+ ```
14
+
15
+ The network passphrase and contract ID are exported from [index.ts](./src/index.ts) in the `networks` constant. If you are the one who generated this library and you know that this contract is also deployed to other networks, feel free to update `networks` with other valid options. This will help your contract consumers use this library more easily.
16
+
17
+ # To publish or not to publish
18
+
19
+ This library is suitable for publishing to NPM. You can publish it to NPM using the `npm publish` command.
20
+
21
+ But you don't need to publish this library to NPM to use it. You can add it to your project's `package.json` using a file path:
22
+
23
+ ```json
24
+ "dependencies": {
25
+ "passkey-kit-sdk": "./path/to/this/folder"
26
+ }
27
+ ```
28
+
29
+ However, we've actually encountered [frustration](https://github.com/stellar/soroban-example-dapp/pull/117#discussion_r1232873560) using local libraries with NPM in this way. Though it seems a bit messy, we suggest generating the library directly to your `node_modules` folder automatically after each install by using a `postinstall` script. We've had the least trouble with this approach. NPM will automatically remove what it sees as erroneous directories during the `install` step, and then regenerate them when it gets to your `postinstall` step, which will keep the library up-to-date with your contract.
30
+
31
+ ```json
32
+ "scripts": {
33
+ "postinstall": "soroban contract bindings ts --rpc-url https://soroban-testnet.stellar.org --network-passphrase \"Test SDF Network ; September 2015\" --id CDSGG7BSWYWQMTY5KTZVDTC34ZESMZ75ZGSTTVHS4NIKCF4PM3GDJ4G3 --name passkey-kit-sdk"
34
+ }
35
+ ```
36
+
37
+ Obviously you need to adjust the above command based on the actual command you used to generate the library.
38
+
39
+ # Use it
40
+
41
+ Now that you have your library up-to-date and added to your project, you can import it in a file and see inline documentation for all of its exported methods:
42
+
43
+ ```js
44
+ import { Contract, networks } from "passkey-kit-sdk"
45
+
46
+ const contract = new Contract({
47
+ ...networks.futurenet, // for example; check which networks this library exports
48
+ rpcUrl: '...', // use your own, or find one for testing at https://soroban.stellar.org/docs/reference/rpc#public-rpc-providers
49
+ })
50
+
51
+ contract.|
52
+ ```
53
+
54
+ As long as your editor is configured to show JavaScript/TypeScript documentation, you can pause your typing at that `|` to get a list of all exports and inline-documentation for each. It exports a separate [async](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function) function for each method in the smart contract, with documentation for each generated from the comments the contract's author included in the original source code.
@@ -0,0 +1,357 @@
1
+ {
2
+ "name": "passkey-kit-sdk",
3
+ "version": "0.0.0",
4
+ "lockfileVersion": 3,
5
+ "requires": true,
6
+ "packages": {
7
+ "": {
8
+ "name": "passkey-kit-sdk",
9
+ "version": "0.0.0",
10
+ "dependencies": {
11
+ "@stellar/freighter-api": "2.0.0",
12
+ "@stellar/stellar-sdk": "12.0.0-rc.3",
13
+ "buffer": "6.0.3"
14
+ },
15
+ "devDependencies": {
16
+ "typescript": "5.3.3"
17
+ }
18
+ },
19
+ "node_modules/@stellar/freighter-api": {
20
+ "version": "2.0.0",
21
+ "resolved": "https://registry.npmjs.org/@stellar/freighter-api/-/freighter-api-2.0.0.tgz",
22
+ "integrity": "sha512-j/R7MLPL8S3QhwOEdAxSl7MgWBTXWlOXQKQyXR8mPk1JMKKR4tF8e4U+Fs9TPQH0HZoYqfVDvLOOUrTMMY058Q==",
23
+ "license": "Apache-2.0"
24
+ },
25
+ "node_modules/@stellar/js-xdr": {
26
+ "version": "3.1.1",
27
+ "resolved": "https://registry.npmjs.org/@stellar/js-xdr/-/js-xdr-3.1.1.tgz",
28
+ "integrity": "sha512-3gnPjAz78htgqsNEDkEsKHKosV2BF2iZkoHCNxpmZwUxiPsw+2VaXMed8RRMe0rGk3d5GZe7RrSba8zV80J3Ag==",
29
+ "license": "Apache-2.0"
30
+ },
31
+ "node_modules/@stellar/stellar-base": {
32
+ "version": "12.0.0",
33
+ "resolved": "https://registry.npmjs.org/@stellar/stellar-base/-/stellar-base-12.0.0.tgz",
34
+ "integrity": "sha512-uGpahDFFXbE39myOmBnEZSjVys4yUkQ/ASNuYENGyS8MNdfA0TS7DPWkiO6t17P+rW+FRV1zmumJtjRHwxxMdw==",
35
+ "license": "Apache-2.0",
36
+ "dependencies": {
37
+ "@stellar/js-xdr": "^3.1.1",
38
+ "base32.js": "^0.1.0",
39
+ "bignumber.js": "^9.1.2",
40
+ "buffer": "^6.0.3",
41
+ "sha.js": "^2.3.6",
42
+ "tweetnacl": "^1.0.3"
43
+ },
44
+ "optionalDependencies": {
45
+ "sodium-native": "^4.1.1"
46
+ }
47
+ },
48
+ "node_modules/@stellar/stellar-sdk": {
49
+ "version": "12.0.0-rc.3",
50
+ "resolved": "https://registry.npmjs.org/@stellar/stellar-sdk/-/stellar-sdk-12.0.0-rc.3.tgz",
51
+ "integrity": "sha512-FYO+F8VokXjP3Mu+OQtK0GrJWWvwf1+DL3n3aOi6M5H6EwJ6bp/yAOtfnClx6vqzzvpMbWveYABn8U9QNpcHww==",
52
+ "license": "Apache-2.0",
53
+ "dependencies": {
54
+ "@stellar/stellar-base": "^12.0.0-rc.1",
55
+ "axios": "^1.6.8",
56
+ "bignumber.js": "^9.1.2",
57
+ "eventsource": "^2.0.2",
58
+ "randombytes": "^2.1.0",
59
+ "toml": "^3.0.0",
60
+ "urijs": "^1.19.1"
61
+ }
62
+ },
63
+ "node_modules/asynckit": {
64
+ "version": "0.4.0",
65
+ "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz",
66
+ "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==",
67
+ "license": "MIT"
68
+ },
69
+ "node_modules/axios": {
70
+ "version": "1.7.2",
71
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.2.tgz",
72
+ "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==",
73
+ "license": "MIT",
74
+ "dependencies": {
75
+ "follow-redirects": "^1.15.6",
76
+ "form-data": "^4.0.0",
77
+ "proxy-from-env": "^1.1.0"
78
+ }
79
+ },
80
+ "node_modules/base32.js": {
81
+ "version": "0.1.0",
82
+ "resolved": "https://registry.npmjs.org/base32.js/-/base32.js-0.1.0.tgz",
83
+ "integrity": "sha512-n3TkB02ixgBOhTvANakDb4xaMXnYUVkNoRFJjQflcqMQhyEKxEHdj3E6N8t8sUQ0mjH/3/JxzlXuz3ul/J90pQ==",
84
+ "license": "MIT",
85
+ "engines": {
86
+ "node": ">=0.12.0"
87
+ }
88
+ },
89
+ "node_modules/base64-js": {
90
+ "version": "1.5.1",
91
+ "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz",
92
+ "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==",
93
+ "funding": [
94
+ {
95
+ "type": "github",
96
+ "url": "https://github.com/sponsors/feross"
97
+ },
98
+ {
99
+ "type": "patreon",
100
+ "url": "https://www.patreon.com/feross"
101
+ },
102
+ {
103
+ "type": "consulting",
104
+ "url": "https://feross.org/support"
105
+ }
106
+ ],
107
+ "license": "MIT"
108
+ },
109
+ "node_modules/bignumber.js": {
110
+ "version": "9.1.2",
111
+ "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz",
112
+ "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==",
113
+ "license": "MIT",
114
+ "engines": {
115
+ "node": "*"
116
+ }
117
+ },
118
+ "node_modules/buffer": {
119
+ "version": "6.0.3",
120
+ "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz",
121
+ "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==",
122
+ "funding": [
123
+ {
124
+ "type": "github",
125
+ "url": "https://github.com/sponsors/feross"
126
+ },
127
+ {
128
+ "type": "patreon",
129
+ "url": "https://www.patreon.com/feross"
130
+ },
131
+ {
132
+ "type": "consulting",
133
+ "url": "https://feross.org/support"
134
+ }
135
+ ],
136
+ "license": "MIT",
137
+ "dependencies": {
138
+ "base64-js": "^1.3.1",
139
+ "ieee754": "^1.2.1"
140
+ }
141
+ },
142
+ "node_modules/combined-stream": {
143
+ "version": "1.0.8",
144
+ "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz",
145
+ "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==",
146
+ "license": "MIT",
147
+ "dependencies": {
148
+ "delayed-stream": "~1.0.0"
149
+ },
150
+ "engines": {
151
+ "node": ">= 0.8"
152
+ }
153
+ },
154
+ "node_modules/delayed-stream": {
155
+ "version": "1.0.0",
156
+ "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz",
157
+ "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==",
158
+ "license": "MIT",
159
+ "engines": {
160
+ "node": ">=0.4.0"
161
+ }
162
+ },
163
+ "node_modules/eventsource": {
164
+ "version": "2.0.2",
165
+ "resolved": "https://registry.npmjs.org/eventsource/-/eventsource-2.0.2.tgz",
166
+ "integrity": "sha512-IzUmBGPR3+oUG9dUeXynyNmf91/3zUSJg1lCktzKw47OXuhco54U3r9B7O4XX+Rb1Itm9OZ2b0RkTs10bICOxA==",
167
+ "license": "MIT",
168
+ "engines": {
169
+ "node": ">=12.0.0"
170
+ }
171
+ },
172
+ "node_modules/follow-redirects": {
173
+ "version": "1.15.6",
174
+ "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz",
175
+ "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==",
176
+ "funding": [
177
+ {
178
+ "type": "individual",
179
+ "url": "https://github.com/sponsors/RubenVerborgh"
180
+ }
181
+ ],
182
+ "license": "MIT",
183
+ "engines": {
184
+ "node": ">=4.0"
185
+ },
186
+ "peerDependenciesMeta": {
187
+ "debug": {
188
+ "optional": true
189
+ }
190
+ }
191
+ },
192
+ "node_modules/form-data": {
193
+ "version": "4.0.0",
194
+ "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz",
195
+ "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==",
196
+ "license": "MIT",
197
+ "dependencies": {
198
+ "asynckit": "^0.4.0",
199
+ "combined-stream": "^1.0.8",
200
+ "mime-types": "^2.1.12"
201
+ },
202
+ "engines": {
203
+ "node": ">= 6"
204
+ }
205
+ },
206
+ "node_modules/ieee754": {
207
+ "version": "1.2.1",
208
+ "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz",
209
+ "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==",
210
+ "funding": [
211
+ {
212
+ "type": "github",
213
+ "url": "https://github.com/sponsors/feross"
214
+ },
215
+ {
216
+ "type": "patreon",
217
+ "url": "https://www.patreon.com/feross"
218
+ },
219
+ {
220
+ "type": "consulting",
221
+ "url": "https://feross.org/support"
222
+ }
223
+ ],
224
+ "license": "BSD-3-Clause"
225
+ },
226
+ "node_modules/inherits": {
227
+ "version": "2.0.4",
228
+ "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz",
229
+ "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==",
230
+ "license": "ISC"
231
+ },
232
+ "node_modules/mime-db": {
233
+ "version": "1.52.0",
234
+ "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz",
235
+ "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==",
236
+ "license": "MIT",
237
+ "engines": {
238
+ "node": ">= 0.6"
239
+ }
240
+ },
241
+ "node_modules/mime-types": {
242
+ "version": "2.1.35",
243
+ "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz",
244
+ "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==",
245
+ "license": "MIT",
246
+ "dependencies": {
247
+ "mime-db": "1.52.0"
248
+ },
249
+ "engines": {
250
+ "node": ">= 0.6"
251
+ }
252
+ },
253
+ "node_modules/node-gyp-build": {
254
+ "version": "4.8.1",
255
+ "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.1.tgz",
256
+ "integrity": "sha512-OSs33Z9yWr148JZcbZd5WiAXhh/n9z8TxQcdMhIOlpN9AhWpLfvVFO73+m77bBABQMaY9XSvIa+qk0jlI7Gcaw==",
257
+ "license": "MIT",
258
+ "optional": true,
259
+ "bin": {
260
+ "node-gyp-build": "bin.js",
261
+ "node-gyp-build-optional": "optional.js",
262
+ "node-gyp-build-test": "build-test.js"
263
+ }
264
+ },
265
+ "node_modules/proxy-from-env": {
266
+ "version": "1.1.0",
267
+ "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz",
268
+ "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==",
269
+ "license": "MIT"
270
+ },
271
+ "node_modules/randombytes": {
272
+ "version": "2.1.0",
273
+ "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz",
274
+ "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==",
275
+ "license": "MIT",
276
+ "dependencies": {
277
+ "safe-buffer": "^5.1.0"
278
+ }
279
+ },
280
+ "node_modules/safe-buffer": {
281
+ "version": "5.2.1",
282
+ "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz",
283
+ "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==",
284
+ "funding": [
285
+ {
286
+ "type": "github",
287
+ "url": "https://github.com/sponsors/feross"
288
+ },
289
+ {
290
+ "type": "patreon",
291
+ "url": "https://www.patreon.com/feross"
292
+ },
293
+ {
294
+ "type": "consulting",
295
+ "url": "https://feross.org/support"
296
+ }
297
+ ],
298
+ "license": "MIT"
299
+ },
300
+ "node_modules/sha.js": {
301
+ "version": "2.4.11",
302
+ "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz",
303
+ "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==",
304
+ "license": "(MIT AND BSD-3-Clause)",
305
+ "dependencies": {
306
+ "inherits": "^2.0.1",
307
+ "safe-buffer": "^5.0.1"
308
+ },
309
+ "bin": {
310
+ "sha.js": "bin.js"
311
+ }
312
+ },
313
+ "node_modules/sodium-native": {
314
+ "version": "4.1.1",
315
+ "resolved": "https://registry.npmjs.org/sodium-native/-/sodium-native-4.1.1.tgz",
316
+ "integrity": "sha512-LXkAfRd4FHtkQS4X6g+nRcVaN7mWVNepV06phIsC6+IZFvGh1voW5TNQiQp2twVaMf05gZqQjuS+uWLM6gHhNQ==",
317
+ "hasInstallScript": true,
318
+ "license": "MIT",
319
+ "optional": true,
320
+ "dependencies": {
321
+ "node-gyp-build": "^4.8.0"
322
+ }
323
+ },
324
+ "node_modules/toml": {
325
+ "version": "3.0.0",
326
+ "resolved": "https://registry.npmjs.org/toml/-/toml-3.0.0.tgz",
327
+ "integrity": "sha512-y/mWCZinnvxjTKYhJ+pYxwD0mRLVvOtdS2Awbgxln6iEnt4rk0yBxeSBHkGJcPucRiG0e55mwWp+g/05rsrd6w==",
328
+ "license": "MIT"
329
+ },
330
+ "node_modules/tweetnacl": {
331
+ "version": "1.0.3",
332
+ "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz",
333
+ "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==",
334
+ "license": "Unlicense"
335
+ },
336
+ "node_modules/typescript": {
337
+ "version": "5.3.3",
338
+ "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.3.3.tgz",
339
+ "integrity": "sha512-pXWcraxM0uxAS+tN0AG/BF2TyqmHO014Z070UsJ+pFvYuRSq8KH8DmWpnbXe0pEPDHXZV3FcAbJkijJ5oNEnWw==",
340
+ "dev": true,
341
+ "license": "Apache-2.0",
342
+ "bin": {
343
+ "tsc": "bin/tsc",
344
+ "tsserver": "bin/tsserver"
345
+ },
346
+ "engines": {
347
+ "node": ">=14.17"
348
+ }
349
+ },
350
+ "node_modules/urijs": {
351
+ "version": "1.19.11",
352
+ "resolved": "https://registry.npmjs.org/urijs/-/urijs-1.19.11.tgz",
353
+ "integrity": "sha512-HXgFDgDommxn5/bIv0cnQZsPhHDA90NPHD6+c/v21U5+Sx5hoP8+dP9IZXBU1gIfvdRfhG8cel9QNPeionfcCQ==",
354
+ "license": "MIT"
355
+ }
356
+ }
357
+ }
@@ -0,0 +1,18 @@
1
+ {
2
+ "version": "0.0.0",
3
+ "name": "passkey-kit-sdk",
4
+ "type": "module",
5
+ "exports": "./dist/index.js",
6
+ "typings": "dist/index.d.ts",
7
+ "scripts": {
8
+ "build": "tsc"
9
+ },
10
+ "dependencies": {
11
+ "@stellar/freighter-api": "2.0.0",
12
+ "buffer": "6.0.3",
13
+ "@stellar/stellar-sdk": "12.0.0-rc.3"
14
+ },
15
+ "devDependencies": {
16
+ "typescript": "5.3.3"
17
+ }
18
+ }
@@ -0,0 +1,183 @@
1
+ import { Buffer } from "buffer";
2
+ import { Address } from '@stellar/stellar-sdk';
3
+ import {
4
+ AssembledTransaction,
5
+ Client as ContractClient,
6
+ ClientOptions as ContractClientOptions,
7
+ Result,
8
+ Spec as ContractSpec,
9
+ } from '@stellar/stellar-sdk/contract';
10
+ import type {
11
+ u32,
12
+ i32,
13
+ u64,
14
+ i64,
15
+ u128,
16
+ i128,
17
+ u256,
18
+ i256,
19
+ Option,
20
+ Typepoint,
21
+ Duration,
22
+ } from '@stellar/stellar-sdk/contract';
23
+ export * from '@stellar/stellar-sdk'
24
+ export * as contract from '@stellar/stellar-sdk/contract'
25
+ export * as rpc from '@stellar/stellar-sdk/rpc'
26
+
27
+ if (typeof window !== 'undefined') {
28
+ //@ts-ignore Buffer exists
29
+ window.Buffer = window.Buffer || Buffer;
30
+ }
31
+
32
+
33
+ export const networks = {
34
+ testnet: {
35
+ networkPassphrase: "Test SDF Network ; September 2015",
36
+ contractId: "CDSGG7BSWYWQMTY5KTZVDTC34ZESMZ75ZGSTTVHS4NIKCF4PM3GDJ4G3",
37
+ }
38
+ } as const
39
+
40
+ export const Errors = {
41
+ 1: {message:""},
42
+ 2: {message:""},
43
+ 3: {message:""},
44
+ 4: {message:""},
45
+ 5: {message:""},
46
+ 6: {message:""},
47
+ 7: {message:""},
48
+ 8: {message:""},
49
+ 9: {message:""},
50
+ 10: {message:""}
51
+ }
52
+
53
+ export interface Signature {
54
+ authenticator_data: Buffer;
55
+ client_data_json: Buffer;
56
+ id: Buffer;
57
+ signature: Buffer;
58
+ }
59
+
60
+
61
+ export interface Client {
62
+ /**
63
+ * Construct and simulate a extend_ttl transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
64
+ */
65
+ extend_ttl: (options?: {
66
+ /**
67
+ * The fee to pay for the transaction. Default: BASE_FEE
68
+ */
69
+ fee?: number;
70
+
71
+ /**
72
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
73
+ */
74
+ timeoutInSeconds?: number;
75
+
76
+ /**
77
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
78
+ */
79
+ simulate?: boolean;
80
+ }) => Promise<AssembledTransaction<null>>
81
+
82
+ /**
83
+ * Construct and simulate a init transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
84
+ */
85
+ init: ({id, pk, factory}: {id: Buffer, pk: Buffer, factory: string}, options?: {
86
+ /**
87
+ * The fee to pay for the transaction. Default: BASE_FEE
88
+ */
89
+ fee?: number;
90
+
91
+ /**
92
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
93
+ */
94
+ timeoutInSeconds?: number;
95
+
96
+ /**
97
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
98
+ */
99
+ simulate?: boolean;
100
+ }) => Promise<AssembledTransaction<Result<void>>>
101
+
102
+ /**
103
+ * Construct and simulate a resudo transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
104
+ */
105
+ resudo: ({id}: {id: Buffer}, options?: {
106
+ /**
107
+ * The fee to pay for the transaction. Default: BASE_FEE
108
+ */
109
+ fee?: number;
110
+
111
+ /**
112
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
113
+ */
114
+ timeoutInSeconds?: number;
115
+
116
+ /**
117
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
118
+ */
119
+ simulate?: boolean;
120
+ }) => Promise<AssembledTransaction<Result<void>>>
121
+
122
+ /**
123
+ * Construct and simulate a rm_sig transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
124
+ */
125
+ rm_sig: ({id}: {id: Buffer}, options?: {
126
+ /**
127
+ * The fee to pay for the transaction. Default: BASE_FEE
128
+ */
129
+ fee?: number;
130
+
131
+ /**
132
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
133
+ */
134
+ timeoutInSeconds?: number;
135
+
136
+ /**
137
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
138
+ */
139
+ simulate?: boolean;
140
+ }) => Promise<AssembledTransaction<Result<void>>>
141
+
142
+ /**
143
+ * Construct and simulate a add_sig transaction. Returns an `AssembledTransaction` object which will have a `result` field containing the result of the simulation. If this transaction changes contract state, you will need to call `signAndSend()` on the returned object.
144
+ */
145
+ add_sig: ({id, pk}: {id: Buffer, pk: Buffer}, options?: {
146
+ /**
147
+ * The fee to pay for the transaction. Default: BASE_FEE
148
+ */
149
+ fee?: number;
150
+
151
+ /**
152
+ * The maximum amount of time to wait for the transaction to complete. Default: DEFAULT_TIMEOUT
153
+ */
154
+ timeoutInSeconds?: number;
155
+
156
+ /**
157
+ * Whether to automatically simulate the transaction when constructing the AssembledTransaction. Default: true
158
+ */
159
+ simulate?: boolean;
160
+ }) => Promise<AssembledTransaction<Result<void>>>
161
+ }
162
+ export class Client extends ContractClient {
163
+ constructor(public readonly options: ContractClientOptions) {
164
+ super(
165
+ new ContractSpec([ "AAAABAAAAAAAAAAAAAAABUVycm9yAAAAAAAACgAAAAAAAAAJTm90SW5pdGVkAAAAAAAAAQAAAAAAAAAITm90Rm91bmQAAAACAAAAAAAAAAxOb3RQZXJtaXR0ZWQAAAADAAAAAAAAAA1BbHJlYWR5SW5pdGVkAAAAAAAABAAAAAAAAAAOSnNvblBhcnNlRXJyb3IAAAAAAAUAAAAAAAAADkludmFsaWRDb250ZXh0AAAAAAAGAAAAAAAAACBDbGllbnREYXRhSnNvbkNoYWxsZW5nZUluY29ycmVjdAAAAAcAAAAAAAAAF1NlY3AyNTZyMVB1YmxpY0tleVBhcnNlAAAAAAgAAAAAAAAAF1NlY3AyNTZyMVNpZ25hdHVyZVBhcnNlAAAAAAkAAAAAAAAAFVNlY3AyNTZyMVZlcmlmeUZhaWxlZAAAAAAAAAo=",
166
+ "AAAAAAAAAAAAAAAKZXh0ZW5kX3R0bAAAAAAAAAAAAAA=",
167
+ "AAAAAAAAAAAAAAAEaW5pdAAAAAMAAAAAAAAAAmlkAAAAAAAOAAAAAAAAAAJwawAAAAAD7gAAAEEAAAAAAAAAB2ZhY3RvcnkAAAAAEwAAAAEAAAPpAAAD7QAAAAAAAAAD",
168
+ "AAAAAAAAAAAAAAAGcmVzdWRvAAAAAAABAAAAAAAAAAJpZAAAAAAADgAAAAEAAAPpAAAD7QAAAAAAAAAD",
169
+ "AAAAAAAAAAAAAAAGcm1fc2lnAAAAAAABAAAAAAAAAAJpZAAAAAAADgAAAAEAAAPpAAAD7QAAAAAAAAAD",
170
+ "AAAAAAAAAAAAAAAHYWRkX3NpZwAAAAACAAAAAAAAAAJpZAAAAAAADgAAAAAAAAACcGsAAAAAA+4AAABBAAAAAQAAA+kAAAPtAAAAAAAAAAM=",
171
+ "AAAAAQAAAAAAAAAAAAAACVNpZ25hdHVyZQAAAAAAAAQAAAAAAAAAEmF1dGhlbnRpY2F0b3JfZGF0YQAAAAAADgAAAAAAAAAQY2xpZW50X2RhdGFfanNvbgAAAA4AAAAAAAAAAmlkAAAAAAAOAAAAAAAAAAlzaWduYXR1cmUAAAAAAAPuAAAAQA==",
172
+ "AAAAAAAAAAAAAAAMX19jaGVja19hdXRoAAAAAwAAAAAAAAARc2lnbmF0dXJlX3BheWxvYWQAAAAAAAPuAAAAIAAAAAAAAAAJc2lnbmF0dXJlAAAAAAAH0AAAAAlTaWduYXR1cmUAAAAAAAAAAAAADWF1dGhfY29udGV4dHMAAAAAAAPqAAAH0AAAAAdDb250ZXh0AAAAAAEAAAPpAAAD7QAAAAAAAAAD" ]),
173
+ options
174
+ )
175
+ }
176
+ public readonly fromJSON = {
177
+ extend_ttl: this.txFromJSON<null>,
178
+ init: this.txFromJSON<Result<void>>,
179
+ resudo: this.txFromJSON<Result<void>>,
180
+ rm_sig: this.txFromJSON<Result<void>>,
181
+ add_sig: this.txFromJSON<Result<void>>,
182
+ }
183
+ }