@instadapp/avocado-base 0.0.0-dev.991c44c → 0.0.0-dev.9dbd5b5

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.
@@ -53,6 +53,9 @@ provide('tokens', props.tokens);
53
53
  {{ chainIdToName(metadata.chainId) }}
54
54
  </div>
55
55
  </div>
56
+ <div v-if="metadata.type === 'transaction-builder'" class="self-start capitalize flex gap-3">
57
+ Transaction Builder ({{ metadata?.actionCount }} actions)
58
+ </div>
56
59
  <div v-if="metadata.type === 'instadapp-pro'" class="self-start capitalize flex gap-3">
57
60
  Instadapp Pro |
58
61
  {{ metadata?.castDetails }}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@instadapp/avocado-base",
3
- "version": "0.0.0-dev.991c44c",
3
+ "version": "0.0.0-dev.9dbd5b5",
4
4
  "type": "module",
5
5
  "main": "./nuxt.config.ts",
6
6
  "types": "global.d.ts",
package/utils/metadata.ts CHANGED
@@ -58,7 +58,7 @@ const actionMetadataTypes: Record<MetadataTypes, string[]> = {
58
58
  import: ["bytes32 protocol", "uint256 valueInUsd"],
59
59
  auth: ["address address", "uint256 chainId", "bool remove"],
60
60
  deploy: [],
61
- "transaction-builder": [],
61
+ "transaction-builder": ["bytes32 actionCount"],
62
62
  permit2: [
63
63
  "address token",
64
64
  "address spender",
@@ -177,10 +177,18 @@ export const encodeDeployMetadata = (single = true) => {
177
177
  return single ? encodeMultipleActions(data) : data;
178
178
  };
179
179
 
180
- export const encodeTransactionBuilderMetadata = (single = true) => {
180
+ export const encodeTransactionBuilderMetadata = (
181
+ actionCount: string,
182
+ single = true
183
+ ) => {
184
+ const encodedData = ethers.utils.defaultAbiCoder.encode(
185
+ actionMetadataTypes["transaction-builder"],
186
+ [actionCount]
187
+ );
188
+
181
189
  const data = encodeMetadata({
182
190
  type: MetadataEnums["transaction-builder"],
183
- encodedData: "0x",
191
+ encodedData,
184
192
  });
185
193
 
186
194
  return single ? encodeMultipleActions(data) : data;
@@ -470,6 +478,7 @@ const typesPayload: IPayload = {
470
478
  }),
471
479
  "transaction-builder": (data, type) => ({
472
480
  type,
481
+ actionCount: data.actionCount ? toBN(data.actionCount).toNumber() : 0,
473
482
  }),
474
483
  permit2: (data, type) => ({
475
484
  type,