tempo.ts 0.0.2 → 0.0.4

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.
Files changed (41) hide show
  1. package/dist/ox/TokenRole.d.ts +1 -1
  2. package/dist/ox/TokenRole.d.ts.map +1 -1
  3. package/dist/viem/abis.d.ts +763 -1454
  4. package/dist/viem/abis.d.ts.map +1 -1
  5. package/dist/viem/abis.js +486 -1224
  6. package/dist/viem/abis.js.map +1 -1
  7. package/dist/viem/actions/amm.d.ts +630 -715
  8. package/dist/viem/actions/amm.d.ts.map +1 -1
  9. package/dist/viem/actions/amm.js +15 -3
  10. package/dist/viem/actions/amm.js.map +1 -1
  11. package/dist/viem/actions/fee.d.ts +65 -418
  12. package/dist/viem/actions/fee.d.ts.map +1 -1
  13. package/dist/viem/actions/fee.js +5 -1
  14. package/dist/viem/actions/fee.js.map +1 -1
  15. package/dist/viem/actions/policy.d.ts +365 -593
  16. package/dist/viem/actions/policy.d.ts.map +1 -1
  17. package/dist/viem/actions/policy.js +29 -8
  18. package/dist/viem/actions/policy.js.map +1 -1
  19. package/dist/viem/actions/token.d.ts +4768 -7384
  20. package/dist/viem/actions/token.d.ts.map +1 -1
  21. package/dist/viem/actions/token.js +129 -20
  22. package/dist/viem/actions/token.js.map +1 -1
  23. package/dist/viem/decorator.d.ts +23 -0
  24. package/dist/viem/decorator.d.ts.map +1 -1
  25. package/dist/viem/decorator.js +1 -0
  26. package/dist/viem/decorator.js.map +1 -1
  27. package/dist/viem/types.d.ts +2 -2
  28. package/dist/viem/types.d.ts.map +1 -1
  29. package/package.json +4 -4
  30. package/src/ox/TokenRole.test.ts +0 -4
  31. package/src/ox/TokenRole.ts +1 -1
  32. package/src/viem/abis.ts +495 -1234
  33. package/src/viem/actions/amm.ts +15 -7
  34. package/src/viem/actions/fee.ts +5 -5
  35. package/src/viem/actions/policy.ts +29 -16
  36. package/src/viem/actions/token.test.ts +190 -0
  37. package/src/viem/actions/token.ts +166 -47
  38. package/src/viem/client.test.ts +1 -0
  39. package/src/viem/decorator.bench-d.ts +1 -1
  40. package/src/viem/decorator.ts +26 -0
  41. package/src/viem/types.ts +3 -2
@@ -7,5 +7,5 @@ test('decorator', () => {
7
7
  createClient({
8
8
  transport: http('https://cloudflare-eth.com'),
9
9
  }).extend(decorator())
10
- attest.instantiations([27597, 'instantiations'])
10
+ attest.instantiations([26939, 'instantiations'])
11
11
  })
@@ -1099,6 +1099,31 @@ export type Decorator<
1099
1099
  getMetadata: (
1100
1100
  parameters: tokenActions.getMetadata.Parameters,
1101
1101
  ) => Promise<tokenActions.getMetadata.ReturnValue>
1102
+ /**
1103
+ * Checks if an account has a specific role for a TIP20 token.
1104
+ *
1105
+ * @example
1106
+ * ```ts
1107
+ * import { createTempoClient } from 'tempo.ts/viem'
1108
+ * import { privateKeyToAccount } from 'viem/accounts'
1109
+ *
1110
+ * const client = createTempoClient({
1111
+ * account: privateKeyToAccount('0x...')
1112
+ * })
1113
+ *
1114
+ * const hasRole = await client.token.hasRole({
1115
+ * token: '0x...',
1116
+ * role: 'issuer',
1117
+ * })
1118
+ * ```
1119
+ *
1120
+ * @param client - Client.
1121
+ * @param parameters - Parameters.
1122
+ * @returns Whether the account has the role.
1123
+ */
1124
+ hasRole: (
1125
+ parameters: tokenActions.hasRole.Parameters<account>,
1126
+ ) => Promise<tokenActions.hasRole.ReturnValue>
1102
1127
  /**
1103
1128
  * Grants a role for a TIP20 token.
1104
1129
  *
@@ -1866,6 +1891,7 @@ export function decorator() {
1866
1891
  getBalance: (parameters) => tokenActions.getBalance(client, parameters),
1867
1892
  getMetadata: (parameters) =>
1868
1893
  tokenActions.getMetadata(client, parameters),
1894
+ hasRole: (parameters) => tokenActions.hasRole(client, parameters),
1869
1895
  grantRoles: (parameters) => tokenActions.grantRoles(client, parameters),
1870
1896
  grantRolesSync: (parameters) =>
1871
1897
  tokenActions.grantRolesSync(client, parameters),
package/src/viem/types.ts CHANGED
@@ -3,7 +3,7 @@ import type {
3
3
  Address,
4
4
  Chain,
5
5
  ReadContractParameters as viem_ReadContractParameters,
6
- WriteContractParameters as viem_WriteContractParameters,
6
+ WriteContractSyncParameters as viem_WriteContractSyncParameters,
7
7
  } from 'viem'
8
8
  import type {
9
9
  IsUndefined,
@@ -44,12 +44,13 @@ export type WriteParameters<
44
44
  chain extends Chain | undefined = Chain | undefined,
45
45
  account extends Account | undefined = Account | undefined,
46
46
  > = UnionPick<
47
- viem_WriteContractParameters<never, never, never, chain, account>,
47
+ viem_WriteContractSyncParameters<never, never, never, chain, account>,
48
48
  | 'account'
49
49
  | 'chain'
50
50
  | 'gas'
51
51
  | 'maxFeePerGas'
52
52
  | 'maxPriorityFeePerGas'
53
53
  | 'nonce'
54
+ | 'throwOnReceiptRevert'
54
55
  > &
55
56
  UnionPick<TransactionRequestFeeToken, 'feePayer' | 'feeToken'>