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.
- package/dist/ox/TokenRole.d.ts +1 -1
- package/dist/ox/TokenRole.d.ts.map +1 -1
- package/dist/viem/abis.d.ts +763 -1454
- package/dist/viem/abis.d.ts.map +1 -1
- package/dist/viem/abis.js +486 -1224
- package/dist/viem/abis.js.map +1 -1
- package/dist/viem/actions/amm.d.ts +630 -715
- package/dist/viem/actions/amm.d.ts.map +1 -1
- package/dist/viem/actions/amm.js +15 -3
- package/dist/viem/actions/amm.js.map +1 -1
- package/dist/viem/actions/fee.d.ts +65 -418
- package/dist/viem/actions/fee.d.ts.map +1 -1
- package/dist/viem/actions/fee.js +5 -1
- package/dist/viem/actions/fee.js.map +1 -1
- package/dist/viem/actions/policy.d.ts +365 -593
- package/dist/viem/actions/policy.d.ts.map +1 -1
- package/dist/viem/actions/policy.js +29 -8
- package/dist/viem/actions/policy.js.map +1 -1
- package/dist/viem/actions/token.d.ts +4768 -7384
- package/dist/viem/actions/token.d.ts.map +1 -1
- package/dist/viem/actions/token.js +129 -20
- package/dist/viem/actions/token.js.map +1 -1
- package/dist/viem/decorator.d.ts +23 -0
- package/dist/viem/decorator.d.ts.map +1 -1
- package/dist/viem/decorator.js +1 -0
- package/dist/viem/decorator.js.map +1 -1
- package/dist/viem/types.d.ts +2 -2
- package/dist/viem/types.d.ts.map +1 -1
- package/package.json +4 -4
- package/src/ox/TokenRole.test.ts +0 -4
- package/src/ox/TokenRole.ts +1 -1
- package/src/viem/abis.ts +495 -1234
- package/src/viem/actions/amm.ts +15 -7
- package/src/viem/actions/fee.ts +5 -5
- package/src/viem/actions/policy.ts +29 -16
- package/src/viem/actions/token.test.ts +190 -0
- package/src/viem/actions/token.ts +166 -47
- package/src/viem/client.test.ts +1 -0
- package/src/viem/decorator.bench-d.ts +1 -1
- package/src/viem/decorator.ts +26 -0
- package/src/viem/types.ts +3 -2
package/src/viem/decorator.ts
CHANGED
|
@@ -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
|
-
|
|
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
|
-
|
|
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'>
|