@rozoai/intent-pay 0.1.21-beta.7 → 0.1.21-beta.9
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/build/hooks/useDaimoPay.d.ts +1 -1
- package/build/package.json.js +4 -4
- package/build/provider/DaimoPayProvider.d.ts +1 -1
- package/build/provider/StellarContextProvider.d.ts +9 -6
- package/build/src/components/DaimoPayButton/index.js +7 -2
- package/build/src/components/DaimoPayButton/index.js.map +1 -1
- package/build/src/components/Pages/Confirmation/index.js +2 -2
- package/build/src/components/Pages/Confirmation/index.js.map +1 -1
- package/build/src/components/Pages/Solana/PayWithSolanaToken/index.js +2 -2
- package/build/src/components/Pages/Solana/PayWithSolanaToken/index.js.map +1 -1
- package/build/src/components/Pages/Stellar/ConnectStellar/index.js +7 -12
- package/build/src/components/Pages/Stellar/ConnectStellar/index.js.map +1 -1
- package/build/src/components/Pages/Stellar/PayWithStellarToken/index.js +6 -5
- package/build/src/components/Pages/Stellar/PayWithStellarToken/index.js.map +1 -1
- package/build/src/components/Pages/WaitingDepositAddress/index.js +1 -1
- package/build/src/components/Pages/WaitingDepositAddress/index.js.map +1 -1
- package/build/src/hooks/useDaimoPay.js +3 -2
- package/build/src/hooks/useDaimoPay.js.map +1 -1
- package/build/src/hooks/usePaymentState.js +2 -2
- package/build/src/hooks/usePaymentState.js.map +1 -1
- package/build/src/provider/DaimoPayProvider.js +1 -1
- package/build/src/provider/DaimoPayProvider.js.map +1 -1
- package/build/src/provider/StellarContextProvider.js +67 -113
- package/build/src/provider/StellarContextProvider.js.map +1 -1
- package/build/src/utils/index.js +1 -11
- package/build/src/utils/index.js.map +1 -1
- package/build/src/utils/stellar/singleton-import.js +34 -79
- package/build/src/utils/stellar/singleton-import.js.map +1 -1
- package/build/utils/stellar/index.d.ts +2 -3
- package/build/utils/stellar/singleton-import.d.ts +9 -9
- package/package.json +4 -4
|
@@ -1,84 +1,39 @@
|
|
|
1
|
-
import '@reown/appkit/networks';
|
|
2
|
-
import { WalletConnectModule, WalletConnectAllowedMethods } from './walletconnect.module.js';
|
|
3
|
-
|
|
4
1
|
/**
|
|
5
|
-
*
|
|
6
|
-
*
|
|
2
|
+
* Initialises StellarWalletsKit (v2 static class) exactly once.
|
|
3
|
+
*
|
|
4
|
+
* In v2 the kit is a static singleton by design — there is no instance to
|
|
5
|
+
* store. Calling StellarWalletsKit.init() a second time is a no-op (the kit
|
|
6
|
+
* guards against double-init internally), so this helper is safe to call from
|
|
7
|
+
* multiple places.
|
|
7
8
|
*/
|
|
8
|
-
async function
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"<RozoPayProvider stellarKit={stellarKit}>\n" +
|
|
36
|
-
" {children}\n" +
|
|
37
|
-
"</RozoPayProvider>");
|
|
38
|
-
}
|
|
39
|
-
// Start loading
|
|
40
|
-
const loadingPromise = (async () => {
|
|
41
|
-
try {
|
|
42
|
-
const module = await import('@creit.tech/stellar-wallets-kit');
|
|
43
|
-
const { StellarWalletsKit, WalletNetwork, allowAllModules } = module;
|
|
44
|
-
const newKit = new StellarWalletsKit({
|
|
45
|
-
network: config?.network || WalletNetwork.PUBLIC,
|
|
46
|
-
selectedWalletId: config?.selectedWalletId || "freighter",
|
|
47
|
-
modules: config?.modules || [
|
|
48
|
-
...allowAllModules(),
|
|
49
|
-
new WalletConnectModule({
|
|
50
|
-
url: "https://rozo.ai",
|
|
51
|
-
projectId: "7440dd8acf85933ffcc775ec6675d4a9",
|
|
52
|
-
method: WalletConnectAllowedMethods.SIGN_AND_SUBMIT,
|
|
53
|
-
description: `Visa Layer for Stablecoins`,
|
|
54
|
-
name: "Rozo",
|
|
55
|
-
icons: ["https://rozo.ai/rozo-logo.png"],
|
|
56
|
-
network: WalletNetwork.PUBLIC,
|
|
57
|
-
}),
|
|
58
|
-
],
|
|
59
|
-
});
|
|
60
|
-
// Store globally
|
|
61
|
-
if (typeof window !== "undefined") {
|
|
62
|
-
globalThis.__ROZO_STELLAR_KIT_INSTANCE__ = newKit;
|
|
63
|
-
}
|
|
64
|
-
config?.log?.("[Rozo] StellarWalletsKit initialized successfully");
|
|
65
|
-
return newKit;
|
|
66
|
-
}
|
|
67
|
-
catch (error) {
|
|
68
|
-
config?.log?.(`[Rozo] Failed to initialize StellarWalletsKit: ${error}`);
|
|
69
|
-
throw error;
|
|
70
|
-
}
|
|
71
|
-
finally {
|
|
72
|
-
if (typeof window !== "undefined") {
|
|
73
|
-
globalThis.__ROZO_STELLAR_KIT_LOADING__ = undefined;
|
|
74
|
-
}
|
|
75
|
-
}
|
|
76
|
-
})();
|
|
77
|
-
if (typeof window !== "undefined") {
|
|
78
|
-
globalThis.__ROZO_STELLAR_KIT_LOADING__ = loadingPromise;
|
|
79
|
-
}
|
|
80
|
-
return loadingPromise;
|
|
9
|
+
async function initStellarKit(config) {
|
|
10
|
+
if (typeof window === "undefined")
|
|
11
|
+
return;
|
|
12
|
+
const { StellarWalletsKit } = await import('@creit.tech/stellar-wallets-kit/sdk');
|
|
13
|
+
// Networks lives on the root export, not /sdk
|
|
14
|
+
const { Networks } = await import('@creit.tech/stellar-wallets-kit');
|
|
15
|
+
const { defaultModules } = await import('@creit.tech/stellar-wallets-kit/modules/utils');
|
|
16
|
+
const { WalletConnectModule, WalletConnectTargetChain } = await import('@creit.tech/stellar-wallets-kit/modules/wallet-connect');
|
|
17
|
+
const modules = config?.modules ?? [
|
|
18
|
+
...defaultModules(),
|
|
19
|
+
new WalletConnectModule({
|
|
20
|
+
projectId: "7440dd8acf85933ffcc775ec6675d4a9",
|
|
21
|
+
metadata: {
|
|
22
|
+
name: "Rozo",
|
|
23
|
+
description: "Visa Layer for Stablecoins",
|
|
24
|
+
icons: ["https://rozo.ai/rozo-logo.png"],
|
|
25
|
+
url: "https://rozo.ai",
|
|
26
|
+
},
|
|
27
|
+
allowedChains: [WalletConnectTargetChain.PUBLIC],
|
|
28
|
+
}),
|
|
29
|
+
];
|
|
30
|
+
StellarWalletsKit.init({
|
|
31
|
+
network: config?.network ?? Networks.PUBLIC,
|
|
32
|
+
selectedWalletId: config?.selectedWalletId,
|
|
33
|
+
modules,
|
|
34
|
+
});
|
|
35
|
+
config?.log?.("[Rozo] StellarWalletsKit v2 initialised");
|
|
81
36
|
}
|
|
82
37
|
|
|
83
|
-
export {
|
|
38
|
+
export { initStellarKit };
|
|
84
39
|
//# sourceMappingURL=singleton-import.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"singleton-import.js","sources":["../../../../src/utils/stellar/singleton-import.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"singleton-import.js","sources":["../../../../src/utils/stellar/singleton-import.ts"],"sourcesContent":[null],"names":[],"mappings":"AAAA;;;;;;;AAOG;AACI,eAAe,cAAc,CAAC,MAQpC,EAAA;IACC,IAAI,OAAO,MAAM,KAAK,WAAW;QAAE,OAAO;IAE1C,MAAM,EAAE,iBAAiB,EAAE,GACzB,MAAM,OAAO,qCAAqC,CAAC,CAAC;;IAEtD,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,OAAO,iCAAiC,CAAC,CAAC;IACrE,MAAM,EAAE,cAAc,EAAE,GACtB,MAAM,OAAO,+CAA+C,CAAC,CAAC;IAChE,MAAM,EAAE,mBAAmB,EAAE,wBAAwB,EAAE,GACrD,MAAM,OAAO,wDAAwD,CAAC,CAAC;AAEzE,IAAA,MAAM,OAAO,GAAG,MAAM,EAAE,OAAO,IAAI;AACjC,QAAA,GAAG,cAAc,EAAE;AACnB,QAAA,IAAI,mBAAmB,CAAC;AACtB,YAAA,SAAS,EAAE,kCAAkC;AAC7C,YAAA,QAAQ,EAAE;AACR,gBAAA,IAAI,EAAE,MAAM;AACZ,gBAAA,WAAW,EAAE,4BAA4B;gBACzC,KAAK,EAAE,CAAC,+BAA+B,CAAC;AACxC,gBAAA,GAAG,EAAE,iBAAiB;AACvB,aAAA;AACD,YAAA,aAAa,EAAE,CAAC,wBAAwB,CAAC,MAAM,CAAC;SACjD,CAAC;KACH,CAAC;IAEF,iBAAiB,CAAC,IAAI,CAAC;AACrB,QAAA,OAAO,EAAE,MAAM,EAAE,OAAO,IAAI,QAAQ,CAAC,MAAM;QAC3C,gBAAgB,EAAE,MAAM,EAAE,gBAAgB;QAC1C,OAAO;AACR,KAAA,CAAC,CAAC;AAEH,IAAA,MAAM,EAAE,GAAG,GAAG,yCAAyC,CAAC,CAAC;AAC3D;;;;"}
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
export * from "./types";
|
|
2
|
-
export * from "./walletconnect.module";
|
|
3
2
|
export { defineStellarChain, isStellarChain, STELLAR_NETWORKS } from "./types";
|
|
4
3
|
export type { StellarChainConfig } from "./types";
|
|
5
|
-
export {
|
|
6
|
-
export type {
|
|
4
|
+
export { WalletConnectModule, WalletConnectTargetChain, } from "@creit.tech/stellar-wallets-kit/modules/wallet-connect";
|
|
5
|
+
export type { TWalletConnectModuleParams } from "@creit.tech/stellar-wallets-kit/modules/wallet-connect";
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import type { StellarWalletsKit } from "@creit.tech/stellar-wallets-kit";
|
|
2
|
-
declare global {
|
|
3
|
-
let __ROZO_STELLAR_KIT_INSTANCE__: StellarWalletsKit | undefined;
|
|
4
|
-
let __ROZO_STELLAR_KIT_LOADING__: Promise<StellarWalletsKit> | undefined;
|
|
5
|
-
}
|
|
6
1
|
/**
|
|
7
|
-
*
|
|
8
|
-
*
|
|
2
|
+
* Initialises StellarWalletsKit (v2 static class) exactly once.
|
|
3
|
+
*
|
|
4
|
+
* In v2 the kit is a static singleton by design — there is no instance to
|
|
5
|
+
* store. Calling StellarWalletsKit.init() a second time is a no-op (the kit
|
|
6
|
+
* guards against double-init internally), so this helper is safe to call from
|
|
7
|
+
* multiple places.
|
|
9
8
|
*/
|
|
10
|
-
export declare function
|
|
9
|
+
export declare function initStellarKit(config?: {
|
|
11
10
|
log?: (msg: string) => void;
|
|
11
|
+
/** Pass a `Networks` enum value from `@creit.tech/stellar-wallets-kit`. Defaults to `Networks.PUBLIC`. */
|
|
12
12
|
network?: any;
|
|
13
13
|
selectedWalletId?: string;
|
|
14
14
|
modules?: any[];
|
|
15
|
-
}): Promise<
|
|
15
|
+
}): Promise<void>;
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rozoai/intent-pay",
|
|
3
3
|
"private": false,
|
|
4
|
-
"version": "0.1.21-beta.
|
|
4
|
+
"version": "0.1.21-beta.9",
|
|
5
5
|
"author": "RozoAI",
|
|
6
6
|
"homepage": "https://github.com/RozoAI/intent-pay",
|
|
7
7
|
"license": "BSD-2-Clause",
|
|
@@ -39,7 +39,7 @@
|
|
|
39
39
|
"@reown/appkit": "^1.7.0",
|
|
40
40
|
"@rollup/plugin-image": "^3.0.3",
|
|
41
41
|
"@rollup/plugin-typescript": "^12.1.2",
|
|
42
|
-
"@rozoai/intent-common": "0.1.14-beta.
|
|
42
|
+
"@rozoai/intent-common": "0.1.14-beta.3",
|
|
43
43
|
"@solana/spl-token": "^0.4.14",
|
|
44
44
|
"@solana/wallet-adapter-base": "^0.9.27",
|
|
45
45
|
"@solana/wallet-adapter-react": "^0.15.39",
|
|
@@ -60,8 +60,8 @@
|
|
|
60
60
|
"styled-components": "^5.3.5"
|
|
61
61
|
},
|
|
62
62
|
"peerDependencies": {
|
|
63
|
-
"@creit.tech/stellar-wallets-kit": "^
|
|
64
|
-
"@stellar/stellar-sdk": "^
|
|
63
|
+
"@creit.tech/stellar-wallets-kit": "^2.2.0",
|
|
64
|
+
"@stellar/stellar-sdk": "^15.1.0",
|
|
65
65
|
"@tanstack/react-query": ">=5.0.0",
|
|
66
66
|
"react": "18.x || 19.x",
|
|
67
67
|
"react-dom": "18.x || 19.x",
|