@xmtp/content-type-wallet-send-calls 1.0.0 → 2.0.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 CHANGED
@@ -1,5 +1,10 @@
1
1
  # Wallet Send Calls content type
2
2
 
3
+ This package provides an XMTP content type to support wallet transactions using the `wallet_sendCalls` RPC specification from [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792).
4
+
5
+ > **Open for feedback**
6
+ > You are welcome to provide feedback on this implementation by commenting on [XIP-59: Trigger on-chain calls via wallet_sendCalls](https://community.xmtp.org/t/xip-59-trigger-on-chain-calls-via-wallet-sendcalls/889).
7
+
3
8
  ## Install the package
4
9
 
5
10
  ```bash
@@ -15,7 +20,7 @@ pnpm i @xmtp/content-type-wallet-send-calls
15
20
 
16
21
  ## Create a transaction request
17
22
 
18
- With XMTP, a transaction request is represented using `wallet_sendCalls` RPC specification from [EIP-5792](https://eips.ethereum.org/EIPS/eip-5792) with additional metadata for display:
23
+ With XMTP, a transaction request is represented using `wallet_sendCalls` with additional metadata for display:
19
24
 
20
25
  ```tsx
21
26
  const walletSendCalls: WalletSendCallsParams = {
@@ -83,19 +88,4 @@ const walletSendCalls: WalletSendCallsParams = message.content;
83
88
 
84
89
  Run `yarn dev` to build the content type and watch for changes, which will trigger a rebuild.
85
90
 
86
- ## Testing
87
-
88
- Before running unit tests, start the required Docker container at the root of this repository. For more info, see [Running tests](../../README.md#running-tests).
89
-
90
- ## Useful commands
91
-
92
- - `yarn build`: Builds the content type
93
- - `yarn clean`: Removes `node_modules`, `dist`, and `.turbo` folders
94
- - `yarn dev`: Builds the content type and watches for changes, which will trigger a rebuild
95
- - `yarn format`: Runs Prettier format and write changes
96
- - `yarn format:check`: Runs Prettier format check
97
- - `yarn lint`: Runs ESLint
98
- - `yarn test:setup`: Starts a necessary Docker container for testing
99
- - `yarn test:teardown`: Stops Docker container for testing
100
- - `yarn test`: Runs all unit tests
101
- - `yarn typecheck`: Runs `tsc`
91
+ For more information on contributing to this repository, see our [contributing guidelines](../../CONTRIBUTING.md).
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/WalletSendCalls.ts"],"sourcesContent":[null],"names":["ContentTypeWalletSendCalls","ContentTypeId","authorityId","typeId","versionMajor","versionMinor","WalletSendCallsCodec","contentType","encode","content","type","parameters","TextEncoder","JSON","stringify","decode","encodedContent","uint8Array","parse","TextDecoder","fallback","shouldPush"],"mappings":"8DAOa,MAAAA,EAA6B,IAAIC,EAAc,CAC1DC,YAAa,WACbC,OAAQ,kBACRC,aAAc,EACdC,aAAc,UAoBHC,EAGX,eAAIC,GACF,OAAOP,EAGT,MAAAQ,CAAOC,GAML,MALgB,CACdC,KAAMV,EACNW,WAAY,CAAE,EACdF,SAAS,IAAIG,aAAcJ,OAAOK,KAAKC,UAAUL,KAKrD,MAAAM,CAAOC,GACL,MAAMC,EAAaD,EAAeP,QAIlC,OAHwBI,KAAKK,OAC3B,IAAIC,aAAcJ,OAAOE,IAK7B,QAAAG,CAASX,GACP,MAAO,oCAAoCI,KAAKC,UAAUL,KAG5D,UAAAY,GACE,OAAO"}
1
+ {"version":3,"file":"index.js","sources":["../../src/WalletSendCalls.ts"],"sourcesContent":[null],"names":["ContentTypeWalletSendCalls","ContentTypeId","authorityId","typeId","versionMajor","versionMinor","WalletSendCallsCodec","contentType","encode","content","type","parameters","TextEncoder","JSON","stringify","decode","encodedContent","uint8Array","parse","TextDecoder","fallback","shouldPush"],"mappings":"8DAMa,MAAAA,EAA6B,IAAIC,EAAc,CAC1DC,YAAa,WACbC,OAAQ,kBACRC,aAAc,EACdC,aAAc,UAoBHC,EAGX,eAAIC,GACF,OAAOP,EAGT,MAAAQ,CAAOC,GAML,MALgB,CACdC,KAAMV,EACNW,WAAY,CAAE,EACdF,SAAS,IAAIG,aAAcJ,OAAOK,KAAKC,UAAUL,KAKrD,MAAAM,CAAOC,GACL,MAAMC,EAAaD,EAAeP,QAIlC,OAHwBI,KAAKK,OAC3B,IAAIC,aAAcJ,OAAOE,IAK7B,QAAAG,CAASX,GACP,MAAO,oCAAoCI,KAAKC,UAAUL,KAG5D,UAAAY,GACE,OAAO"}
package/dist/index.d.ts CHANGED
@@ -6,16 +6,16 @@ type WalletSendCallsParams = {
6
6
  chainId: `0x${string}`;
7
7
  from: `0x${string}`;
8
8
  calls: {
9
- to?: `0x${string}` | undefined;
10
- data?: `0x${string}` | undefined;
11
- value?: `0x${string}` | undefined;
12
- gas?: `0x${string}` | undefined;
9
+ to?: `0x${string}`;
10
+ data?: `0x${string}`;
11
+ value?: `0x${string}`;
12
+ gas?: `0x${string}`;
13
13
  metadata?: {
14
14
  description: string;
15
15
  transactionType: string;
16
- } & Record<string, any>;
16
+ } & Record<string, string>;
17
17
  }[];
18
- capabilities?: Record<string, any> | undefined;
18
+ capabilities?: Record<string, string>;
19
19
  };
20
20
  declare class WalletSendCallsCodec implements ContentCodec<WalletSendCallsParams> {
21
21
  get contentType(): ContentTypeId;
package/dist/index.js CHANGED
@@ -1,6 +1,5 @@
1
1
  import { ContentTypeId } from '@xmtp/content-type-primitives';
2
2
 
3
- /* eslint-disable @typescript-eslint/no-explicit-any */
4
3
  const ContentTypeWalletSendCalls = new ContentTypeId({
5
4
  authorityId: "xmtp.org",
6
5
  typeId: "walletSendCalls",
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../src/WalletSendCalls.ts"],"sourcesContent":[null],"names":[],"mappings":";;AAAA;AAOa,MAAA,0BAA0B,GAAG,IAAI,aAAa,CAAC;AAC1D,IAAA,WAAW,EAAE,UAAU;AACvB,IAAA,MAAM,EAAE,iBAAiB;AACzB,IAAA,YAAY,EAAE,CAAC;AACf,IAAA,YAAY,EAAE,CAAC;AAChB,CAAA;MAmBY,oBAAoB,CAAA;AAG/B,IAAA,IAAI,WAAW,GAAA;AACb,QAAA,OAAO,0BAA0B;;AAGnC,IAAA,MAAM,CAAC,OAA8B,EAAA;AACnC,QA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8B,EAAA;AACnC,QAAA,MAAM,UAAU,GAAG,cAAc,CAAC,OAAO;AACzC,QAAA,MAAM,eAAe,GAAG,IAAI,CAAC,KAAK,CAChC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,UAAU,CAAC,CACZ;AAC1B,QAAA,OAAO,eAAe;;AAGxB,IAAA,QAAQ,CAAC,OAA8B,EAAA;QACrC,OAAO,CAAA,iCAAA,EAAoC,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,EAAE;;IAGtE,UAAU,GAAA;AACR,QAAA,OAAO,IAAI;;AAEd;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xmtp/content-type-wallet-send-calls",
3
- "version": "1.0.0",
3
+ "version": "2.0.0",
4
4
  "description": "An XMTP content type to support sending transactions to wallet for execution",
5
5
  "keywords": [
6
6
  "xmtp",
@@ -63,20 +63,19 @@
63
63
  ]
64
64
  },
65
65
  "dependencies": {
66
- "@xmtp/content-type-primitives": "^2.0.1"
66
+ "@xmtp/content-type-primitives": "^2.0.2"
67
67
  },
68
68
  "devDependencies": {
69
69
  "@rollup/plugin-terser": "^0.4.4",
70
70
  "@rollup/plugin-typescript": "^12.1.2",
71
- "@types/node": "^22.13.10",
71
+ "@types/node": "^22.15.23",
72
72
  "@xmtp/node-sdk": "workspace:^",
73
73
  "rimraf": "^6.0.1",
74
- "rollup": "^4.36.0",
74
+ "rollup": "^4.41.1",
75
75
  "rollup-plugin-dts": "^6.1.1",
76
- "rollup-plugin-filesize": "^10.0.0",
77
- "typescript": "^5.8.2",
78
- "vite": "^6.2.2",
79
- "vitest": "^3.0.9"
76
+ "typescript": "^5.8.3",
77
+ "vite": "^6.3.5",
78
+ "vitest": "^3.1.4"
80
79
  },
81
80
  "publishConfig": {
82
81
  "access": "public",
@@ -1,4 +1,3 @@
1
- /* eslint-disable @typescript-eslint/no-explicit-any */
2
1
  import {
3
2
  ContentTypeId,
4
3
  type ContentCodec,
@@ -17,16 +16,16 @@ export type WalletSendCallsParams = {
17
16
  chainId: `0x${string}`; // Hex chain id
18
17
  from: `0x${string}`;
19
18
  calls: {
20
- to?: `0x${string}` | undefined;
21
- data?: `0x${string}` | undefined;
22
- value?: `0x${string}` | undefined; // Hex value
23
- gas?: `0x${string}` | undefined;
19
+ to?: `0x${string}`;
20
+ data?: `0x${string}`;
21
+ value?: `0x${string}`; // Hex value
22
+ gas?: `0x${string}`;
24
23
  metadata?: {
25
24
  description: string;
26
25
  transactionType: string;
27
- } & Record<string, any>;
26
+ } & Record<string, string>;
28
27
  }[];
29
- capabilities?: Record<string, any> | undefined;
28
+ capabilities?: Record<string, string>;
30
29
  };
31
30
 
32
31
  export class WalletSendCallsCodec