@getpara/react-sdk 2.0.0-alpha.33 → 2.0.0-alpha.34
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/{chunk-3GWWZKX7.js → chunk-MMUBH76A.js} +22 -1
- package/dist/evm/actions/getViemAccount.d.ts +22 -0
- package/dist/evm/actions/getViemAccount.js +20 -0
- package/dist/evm/actions/getViemClient.d.ts +7659 -0
- package/dist/evm/actions/getViemClient.js +25 -0
- package/dist/evm/actions/index.d.ts +2 -0
- package/dist/evm/actions/index.js +3 -0
- package/dist/evm/hooks/index.d.ts +2 -0
- package/dist/evm/hooks/index.js +3 -0
- package/dist/evm/hooks/useViemAccount.d.ts +26 -0
- package/dist/evm/hooks/useViemAccount.js +32 -0
- package/dist/evm/hooks/useViemClient.d.ts +7663 -0
- package/dist/evm/hooks/useViemClient.js +30 -0
- package/dist/evm/index.d.ts +2 -0
- package/dist/evm/index.js +3 -0
- package/dist/index.js +1 -1
- package/dist/provider/ParaProvider.js +1 -1
- package/package.json +11 -7
|
@@ -30,9 +30,30 @@ var __objRest = (source, exclude) => {
|
|
|
30
30
|
}
|
|
31
31
|
return target;
|
|
32
32
|
};
|
|
33
|
+
var __async = (__this, __arguments, generator) => {
|
|
34
|
+
return new Promise((resolve, reject) => {
|
|
35
|
+
var fulfilled = (value) => {
|
|
36
|
+
try {
|
|
37
|
+
step(generator.next(value));
|
|
38
|
+
} catch (e) {
|
|
39
|
+
reject(e);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
var rejected = (value) => {
|
|
43
|
+
try {
|
|
44
|
+
step(generator.throw(value));
|
|
45
|
+
} catch (e) {
|
|
46
|
+
reject(e);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected);
|
|
50
|
+
step((generator = generator.apply(__this, __arguments)).next());
|
|
51
|
+
});
|
|
52
|
+
};
|
|
33
53
|
|
|
34
54
|
export {
|
|
35
55
|
__spreadValues,
|
|
36
56
|
__spreadProps,
|
|
37
|
-
__objRest
|
|
57
|
+
__objRest,
|
|
58
|
+
__async
|
|
38
59
|
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import ParaWeb from '@getpara/react-sdk-lite';
|
|
2
|
+
export declare const getViemAccount: ({ para, address }: {
|
|
3
|
+
para: ParaWeb;
|
|
4
|
+
address?: `0x${string}`;
|
|
5
|
+
}) => Promise<{
|
|
6
|
+
address: import("abitype").Address;
|
|
7
|
+
nonceManager?: import("viem").NonceManager | undefined;
|
|
8
|
+
sign?: ((parameters: {
|
|
9
|
+
hash: import("viem").Hash;
|
|
10
|
+
}) => Promise<import("viem").Hex>) | undefined | undefined;
|
|
11
|
+
signAuthorization?: ((parameters: import("viem/_types/types/authorization").AuthorizationRequest) => Promise<import("viem/accounts").SignAuthorizationReturnType>) | undefined | undefined;
|
|
12
|
+
signMessage: ({ message }: {
|
|
13
|
+
message: import("viem").SignableMessage;
|
|
14
|
+
}) => Promise<import("viem").Hex>;
|
|
15
|
+
signTransaction: <serializer extends import("viem").SerializeTransactionFn<import("viem").TransactionSerializable> = import("viem").SerializeTransactionFn<import("viem").TransactionSerializable>, transaction extends Parameters<serializer>[0] = Parameters<serializer>[0]>(transaction: transaction, options?: {
|
|
16
|
+
serializer?: serializer | undefined;
|
|
17
|
+
} | undefined) => Promise<import("viem").IsNarrowable<import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>>, import("viem").Hex> extends true ? import("viem").TransactionSerialized<import("viem").GetTransactionType<transaction>> : import("viem").Hex>;
|
|
18
|
+
signTypedData: <const typedData extends import("abitype").TypedData | Record<string, unknown>, primaryType extends keyof typedData | "EIP712Domain" = keyof typedData>(parameters: import("viem").TypedDataDefinition<typedData, primaryType>) => Promise<import("viem").Hex>;
|
|
19
|
+
publicKey: import("viem").Hex;
|
|
20
|
+
source: string;
|
|
21
|
+
type: "local";
|
|
22
|
+
} | null>;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import {
|
|
3
|
+
__async
|
|
4
|
+
} from "../../chunk-MMUBH76A.js";
|
|
5
|
+
import { createParaAccount } from "@getpara/viem-v2-integration";
|
|
6
|
+
const getViemAccount = (_0) => __async(void 0, [_0], function* ({ para, address }) {
|
|
7
|
+
if (para.getWalletsByType("EVM").length === 0) {
|
|
8
|
+
return null;
|
|
9
|
+
}
|
|
10
|
+
if (address) {
|
|
11
|
+
const wallet = para.findWallet(address);
|
|
12
|
+
if (wallet == null ? void 0 : wallet.isExternal) {
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
return yield createParaAccount(para, address);
|
|
17
|
+
});
|
|
18
|
+
export {
|
|
19
|
+
getViemAccount
|
|
20
|
+
};
|