mppx 0.19.0 → 0.19.1
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/CHANGELOG.md +9 -0
- package/dist/Errors.d.ts +29 -0
- package/dist/Errors.js +27 -2
- package/dist/cli/cli.js +96 -96
- package/dist/cli/plugins/index.js +12 -12
- package/dist/extensions/identity/poppy/Constants.d.ts +26 -0
- package/dist/extensions/identity/poppy/Constants.js +26 -0
- package/dist/extensions/identity/poppy/Types.d.ts +19 -0
- package/dist/extensions/identity/poppy/Types.js +2 -0
- package/dist/extensions/identity/poppy/client/index.d.ts +69 -0
- package/dist/extensions/identity/poppy/client/index.js +81 -0
- package/dist/extensions/identity/poppy/index.d.ts +7 -0
- package/dist/extensions/identity/poppy/index.js +7 -0
- package/dist/extensions/identity/poppy/internal/Jws.d.ts +12 -0
- package/dist/extensions/identity/poppy/internal/Jws.js +78 -0
- package/dist/extensions/identity/poppy/server/index.d.ts +40 -0
- package/dist/extensions/identity/poppy/server/index.js +181 -0
- package/dist/identity/Headers.d.ts +1 -1
- package/dist/identity/Headers.js +1 -0
- package/dist/internal/version.d.ts +2 -2
- package/dist/internal/version.js +1 -1
- package/dist/tempo/client/Charge.js +7 -4
- package/dist/tempo/internal/simulation.d.ts +33 -0
- package/dist/tempo/internal/simulation.js +80 -0
- package/dist/tempo/server/internal/html.gen.js +1 -1
- package/dist/tempo/session/client/ChannelOps.js +5 -2
- package/package.json +5 -1
|
@@ -13,6 +13,7 @@ import { encodeFunctionData, isAddress } from 'viem';
|
|
|
13
13
|
import { prepareTransactionRequest, signTransaction } from 'viem/actions';
|
|
14
14
|
import { Transaction } from 'viem/tempo';
|
|
15
15
|
import * as Credential from '../../../Credential.js';
|
|
16
|
+
import * as Simulation from '../../internal/simulation.js';
|
|
16
17
|
import * as Channel from '../precompile/Channel.js';
|
|
17
18
|
import { escrowAbi } from '../precompile/escrow.abi.js';
|
|
18
19
|
import { tip20ChannelEscrow } from '../precompile/Protocol.js';
|
|
@@ -46,14 +47,16 @@ async function prepareTempoChannelTransaction(client, parameters) {
|
|
|
46
47
|
// viem's stable transaction request type does not yet expose Tempo's
|
|
47
48
|
// `calls`, `feePayer`, and `feeToken` fields together. Keep the cast at
|
|
48
49
|
// this boundary so session credential builders stay typed.
|
|
49
|
-
|
|
50
|
+
// Preparation estimates gas, which simulates the calls as the signing key, so a deposit the
|
|
51
|
+
// key's spending limit or the account's balance cannot cover fails here, before signing.
|
|
52
|
+
return Simulation.run({ account }, () => prepareTransactionRequest(client, {
|
|
50
53
|
account,
|
|
51
54
|
calls,
|
|
52
55
|
nonceKey: 'expiring',
|
|
53
56
|
...(feePayer ? { feePayer: true } : {}),
|
|
54
57
|
feeToken,
|
|
55
58
|
...(validAfter !== undefined ? { validAfter } : {}),
|
|
56
|
-
});
|
|
59
|
+
}));
|
|
57
60
|
}
|
|
58
61
|
async function signPreparedTempoTransaction(client, prepared) {
|
|
59
62
|
return (await signTransaction(client, prepared));
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "mppx",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "0.19.
|
|
4
|
+
"version": "0.19.1",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"homepage": "https://github.com/wevm/mppx#readme",
|
|
@@ -151,6 +151,10 @@
|
|
|
151
151
|
"types": "./dist/extensions/identity/link/index.d.ts",
|
|
152
152
|
"default": "./dist/extensions/identity/link/index.js"
|
|
153
153
|
},
|
|
154
|
+
"./extensions/identity/poppy": {
|
|
155
|
+
"types": "./dist/extensions/identity/poppy/index.d.ts",
|
|
156
|
+
"default": "./dist/extensions/identity/poppy/index.js"
|
|
157
|
+
},
|
|
154
158
|
"./extensions/identity/tempo": {
|
|
155
159
|
"types": "./dist/extensions/identity/tempo/index.d.ts",
|
|
156
160
|
"default": "./dist/extensions/identity/tempo/index.js"
|