@xstoicunicornx/payjoin_test 0.1.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 +28 -0
- package/dist/generated/payjoin.d.ts +6189 -0
- package/dist/generated/payjoin.d.ts.map +1 -0
- package/dist/generated/payjoin.js +13273 -0
- package/dist/generated/payjoin.js.map +1 -0
- package/dist/generated/wasm-bindgen/index.d.ts +1067 -0
- package/dist/generated/wasm-bindgen/index.js +6068 -0
- package/dist/generated/wasm-bindgen/index_bg.wasm +0 -0
- package/dist/generated/wasm-bindgen/index_bg.wasm.d.ts +1019 -0
- package/dist/index.d.ts +8 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +23 -0
- package/dist/index.js.map +1 -0
- package/dist/index.web.js +26 -0
- package/package.json +39 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * as payjoin from "./generated/payjoin.js";
|
|
2
|
+
import * as payjoin from "./generated/payjoin.js";
|
|
3
|
+
export declare function uniffiInitAsync(): Promise<void>;
|
|
4
|
+
declare const _default: {
|
|
5
|
+
payjoin: typeof payjoin;
|
|
6
|
+
};
|
|
7
|
+
export default _default;
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAKlD,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAIlD,wBAAsB,eAAe,kBAYpC;;;;AAGD,wBAEE"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
// Export the generated bindings to the app.
|
|
2
|
+
export * as payjoin from "./generated/payjoin.js";
|
|
3
|
+
// Now import the bindings so we can:
|
|
4
|
+
// - initialize them
|
|
5
|
+
// - export them as namespaced objects as the default export.
|
|
6
|
+
import * as payjoin from "./generated/payjoin.js";
|
|
7
|
+
let initialized = false;
|
|
8
|
+
export async function uniffiInitAsync() {
|
|
9
|
+
if (initialized)
|
|
10
|
+
return;
|
|
11
|
+
// Await WASM loading
|
|
12
|
+
await import("./generated/wasm-bindgen/index.js");
|
|
13
|
+
// Initialize the generated bindings: mostly checksums, but also callbacks.
|
|
14
|
+
// - the boolean flag ensures this loads exactly once, even if the JS code
|
|
15
|
+
// is reloaded (e.g. during development with metro).
|
|
16
|
+
payjoin.default.initialize();
|
|
17
|
+
initialized = true;
|
|
18
|
+
}
|
|
19
|
+
// Export the crates as individually namespaced objects.
|
|
20
|
+
export default {
|
|
21
|
+
payjoin,
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,4CAA4C;AAC5C,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAElD,qCAAqC;AACrC,oBAAoB;AACpB,6DAA6D;AAC7D,OAAO,KAAK,OAAO,MAAM,wBAAwB,CAAC;AAElD,IAAI,WAAW,GAAG,KAAK,CAAC;AAExB,MAAM,CAAC,KAAK,UAAU,eAAe;IACjC,IAAI,WAAW;QAAE,OAAO;IAExB,qBAAqB;IACrB,MAAM,MAAM,CAAC,mCAAmC,CAAC,CAAC;IAElD,2EAA2E;IAC3E,0EAA0E;IAC1E,sDAAsD;IACtD,OAAO,CAAC,OAAO,CAAC,UAAU,EAAE,CAAC;IAE7B,WAAW,GAAG,IAAI,CAAC;AACvB,CAAC;AAED,wDAAwD;AACxD,eAAe;IACX,OAAO;CACV,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Generated by uniffi-bindgen-react-native
|
|
2
|
+
// Export the generated bindings to the app.
|
|
3
|
+
export * from './../src/generated/payjoin';
|
|
4
|
+
|
|
5
|
+
// Now import the bindings so we can:
|
|
6
|
+
// - intialize them
|
|
7
|
+
// - export them as namespaced objects as the default export.
|
|
8
|
+
import * as payjoin from './../src/generated/payjoin';
|
|
9
|
+
|
|
10
|
+
import initAsync from './../src/generated/wasm-bindgen/index.js';
|
|
11
|
+
import wasmPath from './../src/generated/wasm-bindgen/index_bg.wasm';
|
|
12
|
+
|
|
13
|
+
export async function uniffiInitAsync() {
|
|
14
|
+
await initAsync({ module_or_path: wasmPath })
|
|
15
|
+
|
|
16
|
+
// Initialize the generated bindings: mostly checksums, but also callbacks.
|
|
17
|
+
// - the boolean flag ensures this loads exactly once, even if the JS code
|
|
18
|
+
// is reloaded (e.g. during development with metro).
|
|
19
|
+
payjoin.default.initialize();
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// Export the crates as individually namespaced objects.
|
|
23
|
+
export default {
|
|
24
|
+
payjoin,
|
|
25
|
+
};
|
|
26
|
+
|
package/package.json
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@xstoicunicornx/payjoin_test",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "JavaScript/WASM bindings for rust-payjoin",
|
|
5
|
+
"main": "dist/index.js",
|
|
6
|
+
"module": "dist/index.js",
|
|
7
|
+
"types": "dist/index.d.ts",
|
|
8
|
+
"browser": "dist/index.web.js",
|
|
9
|
+
"scripts": {
|
|
10
|
+
"ubrn:web": "ubrn build web --and-generate",
|
|
11
|
+
"compile": "tsc",
|
|
12
|
+
"copy-wasm": "mkdir -p dist/generated && cp -r src/generated/wasm-bindgen dist/generated/",
|
|
13
|
+
"fix-imports": "node scripts/fix-imports.js",
|
|
14
|
+
"build": "npm run ubrn:web && npm run compile && npm run copy-wasm && npm run fix-imports",
|
|
15
|
+
"build:test-utils": "cd test-utils && npm install && npx @napi-rs/cli build",
|
|
16
|
+
"clean": "rm -rf rust_modules dist src/generated",
|
|
17
|
+
"test": "tsx --test test/unit.test.ts test/integration.test.ts"
|
|
18
|
+
},
|
|
19
|
+
"files": [
|
|
20
|
+
"dist/**/*"
|
|
21
|
+
],
|
|
22
|
+
"keywords": [
|
|
23
|
+
"payjoin",
|
|
24
|
+
"bitcoin",
|
|
25
|
+
"wasm",
|
|
26
|
+
"rust"
|
|
27
|
+
],
|
|
28
|
+
"devDependencies": {
|
|
29
|
+
"prettier": "^3.6.2",
|
|
30
|
+
"tsx": "^4.20.6",
|
|
31
|
+
"typescript": "^5.9.3",
|
|
32
|
+
"uniffi-bindgen-react-native": "github:spacebear21/uniffi-bindgen-react-native#update-uniffi-0.30-wasm"
|
|
33
|
+
},
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "https://github.com/payjoin/rust-payjoin.git",
|
|
37
|
+
"directory": "payjoin-ffi/javascript"
|
|
38
|
+
}
|
|
39
|
+
}
|