@@ -23,62 +23,125 @@ Actions SDK lets you choose which assets, markets, chains, protocols, and provid
2323 Let Actions SDK know which Wallet Provider you've chosen:
2424
2525 <Tabs >
26- <Tab title = " Privy" >
27- ``` typescript title="actions.ts"
28- import type { WalletConfig } from " @eth-optimism/actions-sdk" ;
29-
30- const walletConfig: WalletConfig = {
31- hostedWalletConfig: {
32- provider: {
33- type: " privy" ,
34- },
35- },
36- smartWalletConfig: {
37- provider: {
38- type: " default" ,
39- attributionSuffix: " actions" ,
40- },
41- },
42- };
43- ```
26+ <Tab title = " Frontend" >
27+ Select a wallet provider:
28+
29+ <Tabs >
30+ <Tab title = " Privy" >
31+ ``` typescript title="actions.ts"
32+ const walletConfig = {
33+ hostedWalletConfig: {
34+ provider: {
35+ type: " privy" as const ,
36+ },
37+ },
38+ smartWalletConfig: {
39+ provider: {
40+ type: " default" as const ,
41+ attributionSuffix: " actions" ,
42+ },
43+ },
44+ };
45+ ```
46+ </Tab >
47+ <Tab title = " Turnkey" >
48+ ``` typescript title="actions.ts"
49+ const walletConfig = {
50+ hostedWalletConfig: {
51+ provider: {
52+ type: " turnkey" as const ,
53+ },
54+ },
55+ smartWalletConfig: {
56+ provider: {
57+ type: " default" as const ,
58+ attributionSuffix: " actions" ,
59+ },
60+ },
61+ };
62+ ```
63+ </Tab >
64+ <Tab title = " Dynamic" >
65+ ``` typescript title="actions.ts"
66+ const walletConfig = {
67+ hostedWalletConfig: {
68+ provider: {
69+ type: " dynamic" as const ,
70+ },
71+ },
72+ smartWalletConfig: {
73+ provider: {
74+ type: " default" as const ,
75+ attributionSuffix: " actions" ,
76+ },
77+ },
78+ };
79+ ```
80+ </Tab >
81+ </Tabs >
4482 </Tab >
45- <Tab title = " Turnkey" >
46- ``` typescript title="actions.ts"
47- import type { WalletConfig } from " @eth-optimism/actions-sdk" ;
48-
49- const walletConfig: WalletConfig = {
50- hostedWalletConfig: {
51- provider: {
52- type: " turnkey" ,
53- },
54- },
55- smartWalletConfig: {
56- provider: {
57- type: " default" ,
58- attributionSuffix: " actions" ,
59- },
60- },
61- };
62- ```
63- </Tab >
64- <Tab title = " Dynamic" >
65- ``` typescript title="actions.ts"
66- import type { WalletConfig } from " @eth-optimism/actions-sdk" ;
67-
68- const walletConfig: WalletConfig = {
69- hostedWalletConfig: {
70- provider: {
71- type: " dynamic" ,
72- },
73- },
74- smartWalletConfig: {
75- provider: {
76- type: " default" ,
77- attributionSuffix: " actions" ,
78- },
79- },
80- };
81- ```
83+
84+ <Tab title = " Backend" >
85+ Select a wallet provider:
86+
87+ <Tabs >
88+ <Tab title = " Privy" >
89+ ``` typescript title="actions.ts"
90+ import { PrivyClient } from ' @privy-io/node'
91+
92+ const privyClient = new PrivyClient (
93+ process .env .PRIVY_APP_ID ,
94+ process .env .PRIVY_APP_SECRET ,
95+ )
96+
97+ const walletConfig = {
98+ hostedWalletConfig: {
99+ provider: {
100+ type: " privy" as const ,
101+ config: {
102+ privyClient ,
103+ },
104+ },
105+ },
106+ smartWalletConfig: {
107+ provider: {
108+ type: " default" as const ,
109+ attributionSuffix: " actions" ,
110+ },
111+ },
112+ };
113+ ```
114+ </Tab >
115+ <Tab title = " Turnkey" >
116+ ``` typescript title="actions.ts"
117+ import { Turnkey } from ' @turnkey/sdk-server'
118+
119+ const turnkeyClient = new Turnkey ({
120+ apiBaseUrl: ' https://api.turnkey.com' ,
121+ apiPublicKey: process .env .TURNKEY_API_KEY ,
122+ apiPrivateKey: process .env .TURNKEY_API_SECRET ,
123+ defaultOrganizationId: process .env .TURNKEY_ORGANIZATION_ID ,
124+ })
125+
126+ const walletConfig = {
127+ hostedWalletConfig: {
128+ provider: {
129+ type: " turnkey" as const ,
130+ config: {
131+ client: turnkeyClient .apiClient (),
132+ },
133+ },
134+ },
135+ smartWalletConfig: {
136+ provider: {
137+ type: " default" as const ,
138+ attributionSuffix: " actions" ,
139+ },
140+ },
141+ };
142+ ```
143+ </Tab >
144+ </Tabs >
82145 </Tab >
83146 </Tabs >
84147
0 commit comments