@getpara/aa-porto 2.16.0 → 2.17.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/dist/action.d.ts +1 -1
- package/dist/action.js +11 -5
- package/dist/types.d.ts +1 -1
- package/package.json +3 -3
package/dist/action.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { SmartAccount7702 } from '@getpara/viem-v2-integration';
|
|
1
|
+
import type { SmartAccount7702 } from '@getpara/viem-v2-integration/aa';
|
|
2
2
|
import type { CreatePortoSmartAccountParams } from './types.js';
|
|
3
3
|
export type { CreatePortoSmartAccountParams } from './types.js';
|
|
4
4
|
/**
|
package/dist/action.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Account, Key, RelayActions } from "porto/viem";
|
|
2
2
|
import { createClient, createPublicClient, http } from "viem";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import { isExternalWallet, resolveSigner } from "@getpara/viem-v2-integration/aa";
|
|
4
|
+
import { SmartAccountError, wrapProviderError } from "@getpara/viem-v2-integration/aa";
|
|
5
5
|
const PORTO_RELAY_RPC = "https://rpc.porto.sh";
|
|
6
6
|
const PORTO_POLL_MAX_ATTEMPTS = 30;
|
|
7
7
|
const PORTO_POLL_INTERVAL_MS = 2e3;
|
|
@@ -30,9 +30,15 @@ async function sendCallsViaRelay(portoClient, portoAccount, adminKey, calls, mer
|
|
|
30
30
|
}
|
|
31
31
|
async function createPortoSmartAccount(params) {
|
|
32
32
|
const { para, chain, merchantUrl, feeToken } = params;
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
33
|
+
if (isExternalWallet(params.signer)) {
|
|
34
|
+
throw new SmartAccountError({
|
|
35
|
+
code: "INVALID_CONFIG",
|
|
36
|
+
message: "Porto is 7702-only and does not support external wallets. External wallets cannot produce the raw signAuthorization required by EIP-7702. Use an embedded Para wallet.",
|
|
37
|
+
provider: "PORTO"
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
const viemAccount = resolveSigner(para, params);
|
|
41
|
+
if (!viemAccount) return null;
|
|
36
42
|
const portoClient = createClient({
|
|
37
43
|
chain,
|
|
38
44
|
transport: http(PORTO_RELAY_RPC)
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { ChainBasedSmartAccountConfig, CreateSmartAccountParams } from '@getpara/viem-v2-integration';
|
|
1
|
+
import type { ChainBasedSmartAccountConfig, CreateSmartAccountParams } from '@getpara/viem-v2-integration/aa';
|
|
2
2
|
/**
|
|
3
3
|
* Configuration for Porto smart account.
|
|
4
4
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@getpara/aa-porto",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.17.0",
|
|
4
4
|
"description": "Porto smart account integration for Para",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
"test": "vitest run --coverage"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@getpara/viem-v2-integration": "2.
|
|
25
|
+
"@getpara/viem-v2-integration": "2.17.0",
|
|
26
26
|
"porto": "^0.2.37"
|
|
27
27
|
},
|
|
28
28
|
"peerDependencies": {
|
|
@@ -34,5 +34,5 @@
|
|
|
34
34
|
"publishConfig": {
|
|
35
35
|
"access": "public"
|
|
36
36
|
},
|
|
37
|
-
"gitHead": "
|
|
37
|
+
"gitHead": "3ed1f835b97ae720f1ac747611296e3b86f61138"
|
|
38
38
|
}
|