@rozoai/intent-common 0.0.25 → 0.0.26

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 CHANGED
@@ -11,3 +11,9 @@ export declare function getAddressContraction(address: string, length?: number):
11
11
  export declare function dateToUnix(d: Date): number;
12
12
  /** Convert a UNIX timestamp to a JS Date object. */
13
13
  export declare function unixToDate(unix: number): Date;
14
+ export declare function generateEVMDeepLink({ amountUnits, chainId, recipientAddress, tokenAddress, }: {
15
+ tokenAddress: string;
16
+ chainId: number;
17
+ recipientAddress: string;
18
+ amountUnits: string;
19
+ }): string;
package/dist/format.js CHANGED
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getAddressContraction = getAddressContraction;
4
4
  exports.dateToUnix = dateToUnix;
5
5
  exports.unixToDate = unixToDate;
6
+ exports.generateEVMDeepLink = generateEVMDeepLink;
6
7
  /**
7
8
  * Contract an Ethereum address to a shorter string.
8
9
  *
@@ -22,4 +23,7 @@ function dateToUnix(d) {
22
23
  function unixToDate(unix) {
23
24
  return new Date(unix * 1000);
24
25
  }
26
+ function generateEVMDeepLink({ amountUnits, chainId, recipientAddress, tokenAddress, }) {
27
+ return `ethereum:${tokenAddress}@${chainId}/transfer?address=${recipientAddress}&uint256=${amountUnits}`;
28
+ }
25
29
  //# sourceMappingURL=format.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":";;AAQA,sDAEC;AAGD,gCAEC;AAGD,gCAEC;AApBD;;;;;;;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,OAAO,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AAC/B,CAAC"}
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../src/format.ts"],"names":[],"mappings":";;AAQA,sDAEC;AAGD,gCAEC;AAGD,gCAEC;AAED,kDAYC;AAlCD;;;;;;;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,OAAO,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,CAAC;AAC/B,CAAC;AAED,SAAgB,mBAAmB,CAAC,EAClC,WAAW,EACX,OAAO,EACP,gBAAgB,EAChB,YAAY,GAMb;IACC,OAAO,YAAY,YAAY,IAAI,OAAO,qBAAqB,gBAAgB,YAAY,WAAW,EAAE,CAAC;AAC3G,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rozoai/intent-common",
3
- "version": "0.0.25",
3
+ "version": "0.0.26",
4
4
  "description": "Intent Pay shared types and utilities",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/format.ts CHANGED
@@ -19,3 +19,17 @@ export function dateToUnix(d: Date): number {
19
19
  export function unixToDate(unix: number): Date {
20
20
  return new Date(unix * 1000);
21
21
  }
22
+
23
+ export function generateEVMDeepLink({
24
+ amountUnits,
25
+ chainId,
26
+ recipientAddress,
27
+ tokenAddress,
28
+ }: {
29
+ tokenAddress: string;
30
+ chainId: number;
31
+ recipientAddress: string;
32
+ amountUnits: string;
33
+ }): string {
34
+ return `ethereum:${tokenAddress}@${chainId}/transfer?address=${recipientAddress}&uint256=${amountUnits}`;
35
+ }