@rozoai/intent-common 0.1.9 → 0.1.10
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/dist/format.d.ts +6 -0
- package/dist/format.js +11 -0
- package/dist/format.js.map +1 -1
- package/dist/rozoPay.d.ts +2 -2
- package/package.json +3 -3
package/dist/format.d.ts
CHANGED
|
@@ -17,6 +17,12 @@ export declare function generateEVMDeepLink({ amountUnits, chainId, recipientAdd
|
|
|
17
17
|
recipientAddress: string;
|
|
18
18
|
amountUnits: string;
|
|
19
19
|
}): string;
|
|
20
|
+
export declare function generateSolanaDeepLink({ amountUnits, recipientAddress, tokenAddress, memo, }: {
|
|
21
|
+
tokenAddress: string;
|
|
22
|
+
recipientAddress: string;
|
|
23
|
+
amountUnits: string;
|
|
24
|
+
memo?: string | null;
|
|
25
|
+
}): string;
|
|
20
26
|
export declare function generateIntentTitle({ toChainId, toTokenAddress, preferredChainId, preferredTokenAddress, }: {
|
|
21
27
|
toChainId: number;
|
|
22
28
|
toTokenAddress: string;
|
package/dist/format.js
CHANGED
|
@@ -4,6 +4,7 @@ exports.getAddressContraction = getAddressContraction;
|
|
|
4
4
|
exports.dateToUnix = dateToUnix;
|
|
5
5
|
exports.unixToDate = unixToDate;
|
|
6
6
|
exports.generateEVMDeepLink = generateEVMDeepLink;
|
|
7
|
+
exports.generateSolanaDeepLink = generateSolanaDeepLink;
|
|
7
8
|
exports.generateIntentTitle = generateIntentTitle;
|
|
8
9
|
const chain_1 = require("./chain");
|
|
9
10
|
const token_1 = require("./token");
|
|
@@ -29,6 +30,16 @@ function unixToDate(unix) {
|
|
|
29
30
|
function generateEVMDeepLink({ amountUnits, chainId, recipientAddress, tokenAddress, }) {
|
|
30
31
|
return `ethereum:${tokenAddress}@${chainId}/transfer?address=${recipientAddress}&uint256=${amountUnits}`;
|
|
31
32
|
}
|
|
33
|
+
function generateSolanaDeepLink({ amountUnits, recipientAddress, tokenAddress, memo, }) {
|
|
34
|
+
const params = [
|
|
35
|
+
amountUnits ? `amount=${encodeURIComponent(amountUnits)}` : null,
|
|
36
|
+
tokenAddress ? `spl-token=${encodeURIComponent(tokenAddress)}` : null,
|
|
37
|
+
memo ? `memo=${encodeURIComponent(memo)}` : null,
|
|
38
|
+
]
|
|
39
|
+
.filter(Boolean)
|
|
40
|
+
.join("&");
|
|
41
|
+
return `solana:${encodeURIComponent(recipientAddress)}${params ? "?" + params : ""}`;
|
|
42
|
+
}
|
|
32
43
|
function generateIntentTitle({ toChainId, toTokenAddress, preferredChainId, preferredTokenAddress, }) {
|
|
33
44
|
const toChainName = (0, chain_1.getChainName)(toChainId);
|
|
34
45
|
const preferredChainName = (0, chain_1.getChainName)(preferredChainId);
|
package/dist/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":";;AAWA,sDAEC;AAGD,gCAEC;AAGD,gCAEC;AAED,kDAYC;AAED,kDAyBC;
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":";;AAWA,sDAEC;AAGD,gCAEC;AAGD,gCAEC;AAED,kDAYC;AAED,wDAoBC;AAED,kDAyBC;AAtFD,mCAAuC;AACvC,mCAAwC;AAExC;;;;;;;GAOG;AACH,SAAgB,qBAAqB,CAAC,OAAe,EAAE,MAAM,GAAG,CAAC;IAC/D,OAAO,OAAO,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,GAAG,MAAM,CAAC,GAAG,GAAG,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,MAAM,CAAC,CAAC;AACrE,CAAC;AAED,oDAAoD;AACpD,SAAgB,UAAU,CAAC,CAAO;IAChC,OAAO,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,oDAAoD;AACpD,SAAgB,UAAU,CAAC,IAAY;IACrC,OAA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Ac,EAAE,CAAC;QAChC,OAAO,KAAK,CAAC;IACf,CAAC;IAED,IAAI,OAAO,CAAC,OAAO,KAAK,cAAc,CAAC,OAAO,EAAE,CAAC;QAC/C,OAAO,YAAY,cAAc,CAAC,MAAM,KAAK,kBAAkB,GAAG,CAAC;IACrE,CAAC;IAED,OAAO,YAAY,cAAc,CAAC,MAAM,KAAK,kBAAkB,QAAQ,OAAO,CAAC,MAAM,KAAK,WAAW,GAAG,CAAC;AAC3G,CAAC"}
|
package/dist/rozoPay.d.ts
CHANGED
|
@@ -122,6 +122,7 @@ export declare const zRozoPayOrderMetadata: z.ZodObject<{
|
|
|
122
122
|
price?: string | undefined;
|
|
123
123
|
priceDetails?: string | undefined;
|
|
124
124
|
}[];
|
|
125
|
+
memo?: string | undefined;
|
|
125
126
|
style?: {
|
|
126
127
|
background?: string | undefined;
|
|
127
128
|
} | undefined;
|
|
@@ -135,7 +136,6 @@ export declare const zRozoPayOrderMetadata: z.ZodObject<{
|
|
|
135
136
|
evmChains?: number[] | undefined;
|
|
136
137
|
paymentOptions?: string[] | undefined;
|
|
137
138
|
} | undefined;
|
|
138
|
-
memo?: string | undefined;
|
|
139
139
|
customDeeplinkUrl?: string | undefined;
|
|
140
140
|
}, {
|
|
141
141
|
intent: string;
|
|
@@ -146,6 +146,7 @@ export declare const zRozoPayOrderMetadata: z.ZodObject<{
|
|
|
146
146
|
price?: string | undefined;
|
|
147
147
|
priceDetails?: string | undefined;
|
|
148
148
|
}[];
|
|
149
|
+
memo?: string | undefined;
|
|
149
150
|
style?: {
|
|
150
151
|
background?: string | undefined;
|
|
151
152
|
} | undefined;
|
|
@@ -159,7 +160,6 @@ export declare const zRozoPayOrderMetadata: z.ZodObject<{
|
|
|
159
160
|
evmChains?: number[] | undefined;
|
|
160
161
|
paymentOptions?: string[] | undefined;
|
|
161
162
|
} | undefined;
|
|
162
|
-
memo?: string | undefined;
|
|
163
163
|
customDeeplinkUrl?: string | undefined;
|
|
164
164
|
}>;
|
|
165
165
|
export type RozoPayOrderMetadata = z.infer<typeof zRozoPayOrderMetadata>;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rozoai/intent-common",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.10",
|
|
4
4
|
"description": "Intent Pay shared types and utilities",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -23,9 +23,9 @@
|
|
|
23
23
|
"dependencies": {
|
|
24
24
|
"@scure/base": "^1.2.4",
|
|
25
25
|
"@solana/web3.js": "^1.98.4",
|
|
26
|
-
"@stellar/stellar-sdk": "^14.
|
|
26
|
+
"@stellar/stellar-sdk": "^14.4.3",
|
|
27
27
|
"viem": "^2.23.2",
|
|
28
|
-
"zod": "^3.
|
|
28
|
+
"zod": "^3.25.76"
|
|
29
29
|
},
|
|
30
30
|
"publishConfig": {
|
|
31
31
|
"access": "public"
|