@account-kit/signer 4.35.0 → 4.36.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/esm/base.d.ts +2 -2
- package/dist/esm/base.js +22 -5
- package/dist/esm/base.js.map +1 -1
- package/dist/esm/client/base.d.ts +4 -292
- package/dist/esm/client/base.js.map +1 -1
- package/dist/esm/client/index.d.ts +14 -26
- package/dist/esm/client/index.js.map +1 -1
- package/dist/esm/client/types.js.map +1 -1
- package/dist/esm/errors.js.map +1 -1
- package/dist/esm/metrics.js.map +1 -1
- package/dist/esm/oauth.js.map +1 -1
- package/dist/esm/session/manager.d.ts +2 -2
- package/dist/esm/session/manager.js.map +1 -1
- package/dist/esm/signer.d.ts +25 -117
- package/dist/esm/signer.js.map +1 -1
- package/dist/esm/solanaSigner.js.map +1 -1
- package/dist/esm/version.d.ts +1 -1
- package/dist/esm/version.js +1 -1
- package/dist/esm/version.js.map +1 -1
- package/dist/types/base.d.ts +2 -2
- package/dist/types/base.d.ts.map +1 -1
- package/dist/types/client/base.d.ts +4 -292
- package/dist/types/client/base.d.ts.map +1 -1
- package/dist/types/client/index.d.ts +14 -26
- package/dist/types/client/index.d.ts.map +1 -1
- package/dist/types/session/manager.d.ts +2 -2
- package/dist/types/session/manager.d.ts.map +1 -1
- package/dist/types/signer.d.ts +25 -117
- package/dist/types/signer.d.ts.map +1 -1
- package/dist/types/utils/base64UrlEncode.d.ts.map +1 -1
- package/dist/types/version.d.ts +1 -1
- package/package.json +6 -8
- package/src/base.ts +75 -54
- package/src/client/base.ts +37 -38
- package/src/client/index.ts +10 -10
- package/src/client/types.ts +1 -1
- package/src/errors.ts +1 -1
- package/src/metrics.ts +1 -1
- package/src/oauth.ts +1 -1
- package/src/session/manager.ts +15 -12
- package/src/signer.ts +1 -1
- package/src/solanaSigner.ts +15 -15
- package/src/version.ts +1 -1
package/dist/esm/signer.d.ts
CHANGED
|
@@ -68,7 +68,6 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
|
|
|
68
68
|
client: z.ZodUnion<[z.ZodType<AlchemySignerWebClient, z.ZodTypeDef, AlchemySignerWebClient>, z.ZodObject<{
|
|
69
69
|
connection: z.ZodIntersection<z.ZodUnion<[z.ZodObject<{
|
|
70
70
|
rpcUrl: z.ZodOptional<z.ZodNever>;
|
|
71
|
-
/** @deprecated This option will be overriden by dashboard settings. Please use the dashboard settings instead. This option will be removed in a future release. */
|
|
72
71
|
apiKey: z.ZodString;
|
|
73
72
|
jwt: z.ZodOptional<z.ZodNever>;
|
|
74
73
|
}, "strip", z.ZodTypeAny, {
|
|
@@ -141,27 +140,21 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
|
|
|
141
140
|
apiKey: string;
|
|
142
141
|
rpcUrl?: undefined;
|
|
143
142
|
jwt?: undefined;
|
|
144
|
-
}
|
|
145
|
-
chainAgnosticUrl?: string | undefined;
|
|
146
|
-
}) | ({
|
|
143
|
+
} | {
|
|
147
144
|
jwt: string;
|
|
148
145
|
rpcUrl?: undefined;
|
|
149
146
|
apiKey?: undefined;
|
|
150
|
-
}
|
|
151
|
-
chainAgnosticUrl?: string | undefined;
|
|
152
|
-
}) | ({
|
|
147
|
+
} | {
|
|
153
148
|
rpcUrl: string;
|
|
154
149
|
apiKey?: undefined;
|
|
155
150
|
jwt?: undefined;
|
|
156
|
-
}
|
|
157
|
-
chainAgnosticUrl?: string | undefined;
|
|
158
|
-
}) | ({
|
|
151
|
+
} | {
|
|
159
152
|
rpcUrl: string;
|
|
160
153
|
jwt: string;
|
|
161
154
|
apiKey?: undefined;
|
|
162
|
-
} & {
|
|
155
|
+
}) & {
|
|
163
156
|
chainAgnosticUrl?: string | undefined;
|
|
164
|
-
}
|
|
157
|
+
};
|
|
165
158
|
iframeConfig: {
|
|
166
159
|
iframeElementId: string;
|
|
167
160
|
iframeContainerId: string;
|
|
@@ -175,27 +168,21 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
|
|
|
175
168
|
apiKey: string;
|
|
176
169
|
rpcUrl?: undefined;
|
|
177
170
|
jwt?: undefined;
|
|
178
|
-
}
|
|
179
|
-
chainAgnosticUrl?: string | undefined;
|
|
180
|
-
}) | ({
|
|
171
|
+
} | {
|
|
181
172
|
jwt: string;
|
|
182
173
|
rpcUrl?: undefined;
|
|
183
174
|
apiKey?: undefined;
|
|
184
|
-
}
|
|
185
|
-
chainAgnosticUrl?: string | undefined;
|
|
186
|
-
}) | ({
|
|
175
|
+
} | {
|
|
187
176
|
rpcUrl: string;
|
|
188
177
|
apiKey?: undefined;
|
|
189
178
|
jwt?: undefined;
|
|
190
|
-
}
|
|
191
|
-
chainAgnosticUrl?: string | undefined;
|
|
192
|
-
}) | ({
|
|
179
|
+
} | {
|
|
193
180
|
rpcUrl: string;
|
|
194
181
|
jwt: string;
|
|
195
182
|
apiKey?: undefined;
|
|
196
|
-
} & {
|
|
183
|
+
}) & {
|
|
197
184
|
chainAgnosticUrl?: string | undefined;
|
|
198
|
-
}
|
|
185
|
+
};
|
|
199
186
|
iframeConfig: {
|
|
200
187
|
iframeContainerId: string;
|
|
201
188
|
iframeElementId?: string | undefined;
|
|
@@ -205,13 +192,14 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
|
|
|
205
192
|
oauthCallbackUrl?: string | undefined;
|
|
206
193
|
enablePopupOauth?: boolean | undefined;
|
|
207
194
|
}>]>;
|
|
195
|
+
} & {
|
|
208
196
|
sessionConfig: z.ZodOptional<z.ZodObject<Omit<{
|
|
209
197
|
sessionKey: z.ZodDefault<z.ZodString>;
|
|
210
198
|
storage: z.ZodUnion<[z.ZodDefault<z.ZodEnum<["localStorage", "sessionStorage"]>>, z.ZodType<Storage, z.ZodTypeDef, Storage>]>;
|
|
211
199
|
expirationTimeMs: z.ZodDefault<z.ZodNumber>;
|
|
212
200
|
client: z.ZodType<import("./index.js").BaseSignerClient<unknown>, z.ZodTypeDef, import("./index.js").BaseSignerClient<unknown>>;
|
|
213
201
|
}, "client">, "strip", z.ZodTypeAny, {
|
|
214
|
-
storage:
|
|
202
|
+
storage: Storage | "localStorage" | "sessionStorage";
|
|
215
203
|
sessionKey: string;
|
|
216
204
|
expirationTimeMs: number;
|
|
217
205
|
}, {
|
|
@@ -220,66 +208,26 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
|
|
|
220
208
|
expirationTimeMs?: number | undefined;
|
|
221
209
|
}>>;
|
|
222
210
|
}, "strip", z.ZodTypeAny, {
|
|
223
|
-
client:
|
|
211
|
+
client: {
|
|
224
212
|
connection: ({
|
|
225
213
|
apiKey: string;
|
|
226
214
|
rpcUrl?: undefined;
|
|
227
215
|
jwt?: undefined;
|
|
228
|
-
}
|
|
229
|
-
chainAgnosticUrl?: string | undefined;
|
|
230
|
-
}) | ({
|
|
216
|
+
} | {
|
|
231
217
|
jwt: string;
|
|
232
218
|
rpcUrl?: undefined;
|
|
233
219
|
apiKey?: undefined;
|
|
234
|
-
}
|
|
235
|
-
chainAgnosticUrl?: string | undefined;
|
|
236
|
-
}) | ({
|
|
220
|
+
} | {
|
|
237
221
|
rpcUrl: string;
|
|
238
222
|
apiKey?: undefined;
|
|
239
223
|
jwt?: undefined;
|
|
240
|
-
}
|
|
241
|
-
chainAgnosticUrl?: string | undefined;
|
|
242
|
-
}) | ({
|
|
224
|
+
} | {
|
|
243
225
|
rpcUrl: string;
|
|
244
226
|
jwt: string;
|
|
245
227
|
apiKey?: undefined;
|
|
246
|
-
} & {
|
|
228
|
+
}) & {
|
|
247
229
|
chainAgnosticUrl?: string | undefined;
|
|
248
|
-
});
|
|
249
|
-
iframeConfig: {
|
|
250
|
-
iframeElementId: string;
|
|
251
|
-
iframeContainerId: string;
|
|
252
230
|
};
|
|
253
|
-
rootOrgId: string;
|
|
254
|
-
oauthCallbackUrl: string;
|
|
255
|
-
enablePopupOauth: boolean;
|
|
256
|
-
rpId?: string | undefined;
|
|
257
|
-
} | AlchemySignerWebClient) & ({
|
|
258
|
-
connection: ({
|
|
259
|
-
apiKey: string;
|
|
260
|
-
rpcUrl?: undefined;
|
|
261
|
-
jwt?: undefined;
|
|
262
|
-
} & {
|
|
263
|
-
chainAgnosticUrl?: string | undefined;
|
|
264
|
-
}) | ({
|
|
265
|
-
jwt: string;
|
|
266
|
-
rpcUrl?: undefined;
|
|
267
|
-
apiKey?: undefined;
|
|
268
|
-
} & {
|
|
269
|
-
chainAgnosticUrl?: string | undefined;
|
|
270
|
-
}) | ({
|
|
271
|
-
rpcUrl: string;
|
|
272
|
-
apiKey?: undefined;
|
|
273
|
-
jwt?: undefined;
|
|
274
|
-
} & {
|
|
275
|
-
chainAgnosticUrl?: string | undefined;
|
|
276
|
-
}) | ({
|
|
277
|
-
rpcUrl: string;
|
|
278
|
-
jwt: string;
|
|
279
|
-
apiKey?: undefined;
|
|
280
|
-
} & {
|
|
281
|
-
chainAgnosticUrl?: string | undefined;
|
|
282
|
-
});
|
|
283
231
|
iframeConfig: {
|
|
284
232
|
iframeElementId: string;
|
|
285
233
|
iframeContainerId: string;
|
|
@@ -288,73 +236,33 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
|
|
|
288
236
|
oauthCallbackUrl: string;
|
|
289
237
|
enablePopupOauth: boolean;
|
|
290
238
|
rpId?: string | undefined;
|
|
291
|
-
} | AlchemySignerWebClient
|
|
239
|
+
} | AlchemySignerWebClient;
|
|
292
240
|
sessionConfig?: {
|
|
293
|
-
storage:
|
|
241
|
+
storage: Storage | "localStorage" | "sessionStorage";
|
|
294
242
|
sessionKey: string;
|
|
295
243
|
expirationTimeMs: number;
|
|
296
244
|
} | undefined;
|
|
297
245
|
}, {
|
|
298
|
-
client:
|
|
246
|
+
client: {
|
|
299
247
|
connection: ({
|
|
300
248
|
apiKey: string;
|
|
301
249
|
rpcUrl?: undefined;
|
|
302
250
|
jwt?: undefined;
|
|
303
|
-
}
|
|
304
|
-
chainAgnosticUrl?: string | undefined;
|
|
305
|
-
}) | ({
|
|
251
|
+
} | {
|
|
306
252
|
jwt: string;
|
|
307
253
|
rpcUrl?: undefined;
|
|
308
254
|
apiKey?: undefined;
|
|
309
|
-
}
|
|
310
|
-
chainAgnosticUrl?: string | undefined;
|
|
311
|
-
}) | ({
|
|
255
|
+
} | {
|
|
312
256
|
rpcUrl: string;
|
|
313
257
|
apiKey?: undefined;
|
|
314
258
|
jwt?: undefined;
|
|
315
|
-
}
|
|
316
|
-
chainAgnosticUrl?: string | undefined;
|
|
317
|
-
}) | ({
|
|
259
|
+
} | {
|
|
318
260
|
rpcUrl: string;
|
|
319
261
|
jwt: string;
|
|
320
262
|
apiKey?: undefined;
|
|
321
|
-
} & {
|
|
263
|
+
}) & {
|
|
322
264
|
chainAgnosticUrl?: string | undefined;
|
|
323
|
-
});
|
|
324
|
-
iframeConfig: {
|
|
325
|
-
iframeContainerId: string;
|
|
326
|
-
iframeElementId?: string | undefined;
|
|
327
265
|
};
|
|
328
|
-
rpId?: string | undefined;
|
|
329
|
-
rootOrgId?: string | undefined;
|
|
330
|
-
oauthCallbackUrl?: string | undefined;
|
|
331
|
-
enablePopupOauth?: boolean | undefined;
|
|
332
|
-
} | AlchemySignerWebClient) & ({
|
|
333
|
-
connection: ({
|
|
334
|
-
apiKey: string;
|
|
335
|
-
rpcUrl?: undefined;
|
|
336
|
-
jwt?: undefined;
|
|
337
|
-
} & {
|
|
338
|
-
chainAgnosticUrl?: string | undefined;
|
|
339
|
-
}) | ({
|
|
340
|
-
jwt: string;
|
|
341
|
-
rpcUrl?: undefined;
|
|
342
|
-
apiKey?: undefined;
|
|
343
|
-
} & {
|
|
344
|
-
chainAgnosticUrl?: string | undefined;
|
|
345
|
-
}) | ({
|
|
346
|
-
rpcUrl: string;
|
|
347
|
-
apiKey?: undefined;
|
|
348
|
-
jwt?: undefined;
|
|
349
|
-
} & {
|
|
350
|
-
chainAgnosticUrl?: string | undefined;
|
|
351
|
-
}) | ({
|
|
352
|
-
rpcUrl: string;
|
|
353
|
-
jwt: string;
|
|
354
|
-
apiKey?: undefined;
|
|
355
|
-
} & {
|
|
356
|
-
chainAgnosticUrl?: string | undefined;
|
|
357
|
-
});
|
|
358
266
|
iframeConfig: {
|
|
359
267
|
iframeContainerId: string;
|
|
360
268
|
iframeElementId?: string | undefined;
|
|
@@ -363,7 +271,7 @@ export declare const AlchemySignerParamsSchema: z.ZodObject<{
|
|
|
363
271
|
rootOrgId?: string | undefined;
|
|
364
272
|
oauthCallbackUrl?: string | undefined;
|
|
365
273
|
enablePopupOauth?: boolean | undefined;
|
|
366
|
-
} | AlchemySignerWebClient
|
|
274
|
+
} | AlchemySignerWebClient;
|
|
367
275
|
sessionConfig?: {
|
|
368
276
|
storage?: Storage | "localStorage" | "sessionStorage" | undefined;
|
|
369
277
|
sessionKey?: string | undefined;
|
package/dist/esm/signer.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EACL,+BAA+B,EAC/B,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AA6ElE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC;SACN,MAAM,EAA0B;SAChC,EAAE,CAAC,+BAA+B,CAAC;CACvC,CAAC;KACD,MAAM,CAAC;IACN,aAAa,EAAE,0BAA0B,CAAC,IAAI,CAAC;QAC7C,MAAM,EAAE,IAAI;KACb,CAAC,CAAC,QAAQ,EAAE;CACd,CAAC,CAAC;AAIL;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,iBAAyC;IAE7E;;;;;;;;;;;;;;;;;;;;OAoBG;IAEH,YAAY,MAA2B;QACrC,MAAM,EAAE,aAAa,EAAE,GAAG,OAAO,EA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ChD,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC;QACvD,eAAe,KAAf,eAAe,GAAK,KAAK,IAAI,IAAI,EAAC;QAClC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACpB,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IACD,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,MAAgD,CAAC;AAC1D,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { BaseAlchemySigner } from \"./base.js\";\nimport {\n AlchemySignerClientParamsSchema,\n AlchemySignerWebClient,\n} from \"./client/index.js\";\nimport type {\n AuthLinkingPrompt,\n CredentialCreationOptionOverrides,\n VerifyMfaParams,\n} from \"./client/types.js\";\nimport { SessionManagerParamsSchema } from \"./session/manager.js\";\n\nexport type AuthParams =\n | {\n type: \"email\";\n email: string;\n /** @deprecated This option will be overriden by dashboard settings. Please use the dashboard settings instead. This option will be removed in a future release. */\n emailMode?: \"magicLink\" | \"otp\";\n redirectParams?: URLSearchParams;\n multiFactors?: VerifyMfaParams[];\n }\n | { type: \"email\"; bundle: string; orgId?: string; isNewUser?: boolean }\n | {\n type: \"passkey\";\n email: string;\n creationOpts?: CredentialCreationOptionOverrides;\n }\n | {\n type: \"passkey\";\n createNew: false;\n }\n | {\n type: \"passkey\";\n createNew: true;\n username: string;\n creationOpts?: CredentialCreationOptionOverrides;\n }\n | ({\n type: \"oauth\";\n scope?: string;\n claims?: string;\n otherParameters?: Record<string, string>;\n } & OauthProviderConfig &\n OauthRedirectConfig)\n | {\n type: \"oauthReturn\";\n bundle: string;\n orgId: string;\n idToken: string;\n isNewUser?: boolean;\n }\n | {\n type: \"otp\";\n otpCode: string;\n multiFactors?: VerifyMfaParams[];\n };\n\nexport type OauthProviderConfig =\n | {\n authProviderId: \"auth0\";\n isCustomProvider?: false;\n auth0Connection?: string;\n }\n | {\n authProviderId: KnownAuthProvider;\n isCustomProvider?: false;\n auth0Connection?: never;\n }\n | {\n authProviderId: string;\n isCustomProvider: true;\n auth0Connection?: never;\n };\n\nexport type OauthRedirectConfig =\n | { mode: \"redirect\"; redirectUrl: string }\n | { mode: \"popup\"; redirectUrl?: never };\n\nexport type KnownAuthProvider =\n | \"google\"\n | \"apple\"\n | \"facebook\"\n | \"twitch\"\n | \"auth0\";\n\nexport type OauthMode = \"redirect\" | \"popup\";\n\nexport const AlchemySignerParamsSchema = z\n .object({\n client: z\n .custom<AlchemySignerWebClient>()\n .or(AlchemySignerClientParamsSchema),\n })\n .extend({\n sessionConfig: SessionManagerParamsSchema.omit({\n client: true,\n }).optional(),\n });\n\nexport type AlchemySignerParams = z.input<typeof AlchemySignerParamsSchema>;\n\n/**\n * A SmartAccountSigner that can be used with any SmartContractAccount\n */\nexport class AlchemyWebSigner extends BaseAlchemySigner<AlchemySignerWebClient> {\n private static replaceStateFilterInstalled = false;\n /**\n * Initializes an instance with the provided Alchemy signer parameters after parsing them with a schema.\n *\n * @example\n * ```ts\n * import { AlchemyWebSigner } from \"@account-kit/signer\";\n *\n * const signer = new AlchemyWebSigner({\n * client: {\n * connection: {\n * rpcUrl: \"/api/rpc\",\n * },\n * iframeConfig: {\n * iframeContainerId: \"alchemy-signer-iframe-container\",\n * },\n * },\n * });\n * ```\n *\n * @param {AlchemySignerParams} params The parameters for the Alchemy signer, including the client and session configuration\n */\n\n constructor(params: AlchemySignerParams) {\n const { sessionConfig, ...params_ } =\n AlchemySignerParamsSchema.parse(params);\n\n let client: AlchemySignerWebClient;\n if (\"connection\" in params_.client) {\n client = new AlchemySignerWebClient(params_.client);\n } else {\n client = params_.client;\n }\n\n const qpStructure = {\n emailBundle: \"bundle\",\n // We don't need this, but we still want to remove it from the URL.\n emailOrgId: \"orgId\",\n status: \"alchemy-status\",\n oauthBundle: \"alchemy-bundle\",\n oauthOrgId: \"alchemy-org-id\",\n idToken: \"alchemy-id-token\",\n isSignup: \"aa-is-signup\",\n otpId: \"alchemy-otp-id\",\n email: \"alchemy-email\",\n authProvider: \"alchemy-auth-provider\",\n oauthError: \"alchemy-error\",\n };\n\n const {\n emailBundle,\n status,\n oauthBundle,\n oauthOrgId,\n idToken,\n isSignup,\n otpId,\n email,\n authProvider,\n oauthError,\n } = getAndRemoveQueryParams(qpStructure);\n\n if (!AlchemyWebSigner.replaceStateFilterInstalled) {\n installReplaceStateFilter(Object.values(qpStructure));\n AlchemyWebSigner.replaceStateFilterInstalled = true;\n }\n\n const initialError =\n oauthError != null\n ? { name: \"OauthError\", message: oauthError }\n : undefined;\n\n const initialAuthLinkingPrompt: AuthLinkingPrompt | undefined = (() => {\n if (status !== \"ACCOUNT_LINKING_CONFIRMATION_REQUIRED\") {\n return undefined;\n }\n if (\n idToken == null ||\n email == null ||\n authProvider == null ||\n otpId == null ||\n oauthOrgId == null\n ) {\n console.error(\"Missing required query params for auth linking prompt\");\n return undefined;\n }\n return {\n status,\n idToken,\n email,\n providerName: authProvider,\n otpId,\n orgId: oauthOrgId,\n };\n })();\n\n super({ client, sessionConfig, initialError, initialAuthLinkingPrompt });\n\n const isNewUser = isSignup === \"true\";\n\n this.signerType = \"alchemy-signer\";\n\n if (emailBundle) {\n this.authenticate({\n type: \"email\",\n bundle: emailBundle,\n isNewUser,\n });\n } else if (oauthBundle && oauthOrgId && idToken) {\n this.authenticate({\n type: \"oauthReturn\",\n bundle: oauthBundle,\n orgId: oauthOrgId,\n idToken,\n isNewUser,\n });\n }\n }\n}\n\n/**\n * Overrides `window.history.replaceState` to remove the specified query params from target URLs.\n *\n * @param {string[]} qpToRemove The query params to remove from target URLs.\n */\nfunction installReplaceStateFilter(qpToRemove: string[]) {\n const originalReplaceState = window.history.replaceState;\n\n const processUrl = (src: string | URL | undefined | null) => {\n if (!src) {\n return src;\n }\n\n try {\n const url = new URL(src, document.baseURI);\n const originalSearch = url.search;\n\n qpToRemove.forEach((qp) => url.searchParams.delete(qp));\n if (originalSearch === url.search) return src;\n\n console.log(\"[Alchemy] filtered query params from URL\");\n return url;\n } catch (e) {\n console.log(\"[Alchemy] failed to process URL in state filter\", e);\n return src;\n }\n };\n\n window.history.replaceState = function (...args) {\n const [state, unused, url] = args;\n\n const result = originalReplaceState.apply(this, [\n state,\n unused,\n processUrl(url),\n ]);\n\n return result;\n };\n\n console.log(\"[Alchemy] installed window.history.replaceState interceptor\");\n}\n\n/**\n * Reads and removes the specified query params from the URL.\n *\n * @param {T} keys object whose values are the query parameter keys to read and\n * remove\n * @returns {{ [K in keyof T]: string | undefined }} object with the same keys\n * as the input whose values are the values of the query params.\n */\nfunction getAndRemoveQueryParams<T extends Record<string, string>>(\n keys: T\n): { [K in keyof T]: string | undefined } {\n const url = new URL(window.location.href);\n const result: Record<string, string | undefined> = {};\n let foundQueryParam = false;\n for (const [key, param] of Object.entries(keys)) {\n const value = url.searchParams.get(param) ?? undefined;\n foundQueryParam ||= value != null;\n result[key] = value;\n url.searchParams.delete(param);\n }\n if (foundQueryParam) {\n window.history.replaceState(window.history.state, \"\", url.toString());\n }\n return result as { [K in keyof T]: string | undefined };\n}\n"]}
|
|
1
|
+
{"version":3,"file":"signer.js","sourceRoot":"","sources":["../../src/signer.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAC9C,OAAO,EACL,+BAA+B,EAC/B,sBAAsB,GACvB,MAAM,mBAAmB,CAAC;AAM3B,OAAO,EAAE,0BAA0B,EAAE,MAAM,sBAAsB,CAAC;AA6ElE,MAAM,CAAC,MAAM,yBAAyB,GAAG,CAAC;KACvC,MAAM,CAAC;IACN,MAAM,EAAE,CAAC;SACN,MAAM,EAA0B;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C;AAC7E,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,uBAAuB,CAC9B,IAAO;IAEP,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC1C,MAAM,MAAM,GAAuC,EAAE,CAAC;IACtD,IAAI,eAAe,GAAG,KAAK,CAAC;IAC5B,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;QAChD,MAAM,KAAK,GAAG,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,SAAS,CAAC;QACvD,eAAe,KAAf,eAAe,GAAK,KAAK,IAAI,IAAI,EAAC;QAClC,MAAM,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QACpB,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACjC,CAAC;IACD,IAAI,eAAe,EAAE,CAAC;QACpB,MAAM,CAAC,OAAO,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,EAAE,GAAG,CAAC,QAAQ,EAAE,CAAC,CAAC;IACxE,CAAC;IACD,OAAO,MAAgD,CAAC;AAC1D,CAAC","sourcesContent":["import { z } from \"zod\";\nimport { BaseAlchemySigner } from \"./base.js\";\nimport {\n AlchemySignerClientParamsSchema,\n AlchemySignerWebClient,\n} from \"./client/index.js\";\nimport type {\n AuthLinkingPrompt,\n CredentialCreationOptionOverrides,\n VerifyMfaParams,\n} from \"./client/types.js\";\nimport { SessionManagerParamsSchema } from \"./session/manager.js\";\n\nexport type AuthParams =\n | {\n type: \"email\";\n email: string;\n /** @deprecated This option will be overriden by dashboard settings. Please use the dashboard settings instead. This option will be removed in a future release. */\n emailMode?: \"magicLink\" | \"otp\";\n redirectParams?: URLSearchParams;\n multiFactors?: VerifyMfaParams[];\n }\n | { type: \"email\"; bundle: string; orgId?: string; isNewUser?: boolean }\n | {\n type: \"passkey\";\n email: string;\n creationOpts?: CredentialCreationOptionOverrides;\n }\n | {\n type: \"passkey\";\n createNew: false;\n }\n | {\n type: \"passkey\";\n createNew: true;\n username: string;\n creationOpts?: CredentialCreationOptionOverrides;\n }\n | ({\n type: \"oauth\";\n scope?: string;\n claims?: string;\n otherParameters?: Record<string, string>;\n } & OauthProviderConfig &\n OauthRedirectConfig)\n | {\n type: \"oauthReturn\";\n bundle: string;\n orgId: string;\n idToken: string;\n isNewUser?: boolean;\n }\n | {\n type: \"otp\";\n otpCode: string;\n multiFactors?: VerifyMfaParams[];\n };\n\nexport type OauthProviderConfig =\n | {\n authProviderId: \"auth0\";\n isCustomProvider?: false;\n auth0Connection?: string;\n }\n | {\n authProviderId: KnownAuthProvider;\n isCustomProvider?: false;\n auth0Connection?: never;\n }\n | {\n authProviderId: string;\n isCustomProvider: true;\n auth0Connection?: never;\n };\n\nexport type OauthRedirectConfig =\n | { mode: \"redirect\"; redirectUrl: string }\n | { mode: \"popup\"; redirectUrl?: never };\n\nexport type KnownAuthProvider =\n | \"google\"\n | \"apple\"\n | \"facebook\"\n | \"twitch\"\n | \"auth0\";\n\nexport type OauthMode = \"redirect\" | \"popup\";\n\nexport const AlchemySignerParamsSchema = z\n .object({\n client: z\n .custom<AlchemySignerWebClient>()\n .or(AlchemySignerClientParamsSchema),\n })\n .extend({\n sessionConfig: SessionManagerParamsSchema.omit({\n client: true,\n }).optional(),\n });\n\nexport type AlchemySignerParams = z.input<typeof AlchemySignerParamsSchema>;\n\n/**\n * A SmartAccountSigner that can be used with any SmartContractAccount\n */\nexport class AlchemyWebSigner extends BaseAlchemySigner<AlchemySignerWebClient> {\n private static replaceStateFilterInstalled = false;\n /**\n * Initializes an instance with the provided Alchemy signer parameters after parsing them with a schema.\n *\n * @example\n * ```ts\n * import { AlchemyWebSigner } from \"@account-kit/signer\";\n *\n * const signer = new AlchemyWebSigner({\n * client: {\n * connection: {\n * rpcUrl: \"/api/rpc\",\n * },\n * iframeConfig: {\n * iframeContainerId: \"alchemy-signer-iframe-container\",\n * },\n * },\n * });\n * ```\n *\n * @param {AlchemySignerParams} params The parameters for the Alchemy signer, including the client and session configuration\n */\n\n constructor(params: AlchemySignerParams) {\n const { sessionConfig, ...params_ } =\n AlchemySignerParamsSchema.parse(params);\n\n let client: AlchemySignerWebClient;\n if (\"connection\" in params_.client) {\n client = new AlchemySignerWebClient(params_.client);\n } else {\n client = params_.client;\n }\n\n const qpStructure = {\n emailBundle: \"bundle\",\n // We don't need this, but we still want to remove it from the URL.\n emailOrgId: \"orgId\",\n status: \"alchemy-status\",\n oauthBundle: \"alchemy-bundle\",\n oauthOrgId: \"alchemy-org-id\",\n idToken: \"alchemy-id-token\",\n isSignup: \"aa-is-signup\",\n otpId: \"alchemy-otp-id\",\n email: \"alchemy-email\",\n authProvider: \"alchemy-auth-provider\",\n oauthError: \"alchemy-error\",\n };\n\n const {\n emailBundle,\n status,\n oauthBundle,\n oauthOrgId,\n idToken,\n isSignup,\n otpId,\n email,\n authProvider,\n oauthError,\n } = getAndRemoveQueryParams(qpStructure);\n\n if (!AlchemyWebSigner.replaceStateFilterInstalled) {\n installReplaceStateFilter(Object.values(qpStructure));\n AlchemyWebSigner.replaceStateFilterInstalled = true;\n }\n\n const initialError =\n oauthError != null\n ? { name: \"OauthError\", message: oauthError }\n : undefined;\n\n const initialAuthLinkingPrompt: AuthLinkingPrompt | undefined = (() => {\n if (status !== \"ACCOUNT_LINKING_CONFIRMATION_REQUIRED\") {\n return undefined;\n }\n if (\n idToken == null ||\n email == null ||\n authProvider == null ||\n otpId == null ||\n oauthOrgId == null\n ) {\n console.error(\"Missing required query params for auth linking prompt\");\n return undefined;\n }\n return {\n status,\n idToken,\n email,\n providerName: authProvider,\n otpId,\n orgId: oauthOrgId,\n };\n })();\n\n super({ client, sessionConfig, initialError, initialAuthLinkingPrompt });\n\n const isNewUser = isSignup === \"true\";\n\n this.signerType = \"alchemy-signer\";\n\n if (emailBundle) {\n this.authenticate({\n type: \"email\",\n bundle: emailBundle,\n isNewUser,\n });\n } else if (oauthBundle && oauthOrgId && idToken) {\n this.authenticate({\n type: \"oauthReturn\",\n bundle: oauthBundle,\n orgId: oauthOrgId,\n idToken,\n isNewUser,\n });\n }\n }\n}\n\n/**\n * Overrides `window.history.replaceState` to remove the specified query params from target URLs.\n *\n * @param {string[]} qpToRemove The query params to remove from target URLs.\n */\nfunction installReplaceStateFilter(qpToRemove: string[]) {\n const originalReplaceState = window.history.replaceState;\n\n const processUrl = (src: string | URL | undefined | null) => {\n if (!src) {\n return src;\n }\n\n try {\n const url = new URL(src, document.baseURI);\n const originalSearch = url.search;\n\n qpToRemove.forEach((qp) => url.searchParams.delete(qp));\n if (originalSearch === url.search) return src;\n\n console.log(\"[Alchemy] filtered query params from URL\");\n return url;\n } catch (e) {\n console.log(\"[Alchemy] failed to process URL in state filter\", e);\n return src;\n }\n };\n\n window.history.replaceState = function (...args) {\n const [state, unused, url] = args;\n\n const result = originalReplaceState.apply(this, [\n state,\n unused,\n processUrl(url),\n ]);\n\n return result;\n };\n\n console.log(\"[Alchemy] installed window.history.replaceState interceptor\");\n}\n\n/**\n * Reads and removes the specified query params from the URL.\n *\n * @param {T} keys object whose values are the query parameter keys to read and\n * remove\n * @returns {{ [K in keyof T]: string | undefined }} object with the same keys\n * as the input whose values are the values of the query params.\n */\nfunction getAndRemoveQueryParams<T extends Record<string, string>>(\n keys: T,\n): { [K in keyof T]: string | undefined } {\n const url = new URL(window.location.href);\n const result: Record<string, string | undefined> = {};\n let foundQueryParam = false;\n for (const [key, param] of Object.entries(keys)) {\n const value = url.searchParams.get(param) ?? undefined;\n foundQueryParam ||= value != null;\n result[key] = value;\n url.searchParams.delete(param);\n }\n if (foundQueryParam) {\n window.history.replaceState(window.history.state, \"\", url.toString());\n }\n return result as { [K in keyof T]: string | undefined };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"solanaSigner.js","sourceRoot":"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\n Connection,\n PublicKey,\n Transaction,\n TransactionInstruction,\n TransactionMessage,\n VersionedTransaction,\n} from \"@solana/web3.js\";\nimport { size, slice, toBytes, toHex, type ByteArray, type Hex } from \"viem\";\nimport type { BaseSignerClient } from \"./client/base\";\nimport { NotAuthenticatedError } from \"./errors.js\";\n\n/**\n * The SolanaSigner class is used to sign transactions and messages for the Solana blockchain.\n * It provides methods to add signatures to transactions and sign messages.\n */\nexport class SolanaSigner {\n readonly alchemyClient: BaseSignerClient;\n public readonly address: string;\n\n /**\n * Constructor for the SolanaSigner class which is a wrapper around the alchemy client, and is more focused on the solana web3\n *\n * @param {object} client This is the client that will be used to sign the transaction, and we are just having functions on top of it.\n */\n constructor(client: BaseSignerClient) {\n this.alchemyClient = client;\n if (!client.getUser()) throw new Error(\"Must be authenticated!\");\n\n // TODO: also throw here\n this.address = client.getUser()!.solanaAddress!;\n }\n\n /**\n * Adds a signature of the client user to a transaction\n *\n * @param {Transaction | VersionedTransaction} transaction - The transaction to add the signature to\n * @returns {Promise<Transaction | VersionedTransaction >} The transaction with the signature added\n */\n async addSignature(\n transaction: Transaction | VersionedTransaction\n ): Promise<Transaction | VersionedTransaction> {\n const user = this.alchemyClient.getUser();\n if (!user) {\n throw new NotAuthenticatedError();\n }\n\n if (!user.solanaAddress) {\n throw new Error(\"no solana address\");\n }\n\n const fromKey = new PublicKey(user.solanaAddress);\n const messageToSign = this.getMessageToSign(transaction);\n const signature = await this.alchemyClient.signRawMessage(\n messageToSign,\n \"SOLANA\"\n );\n\n transaction.addSignature(\n fromKey,\n Buffer.from(toBytes(this.formatSignatureForSolana(signature)))\n );\n return transaction;\n }\n\n /**\n * Signs a message\n *\n * @param {Uint8Array} message - The message to sign\n * @returns {Promise<ByteArray>} The signature of the message\n */\n async signMessage(message: Uint8Array): Promise<ByteArray> {\n const user = this.alchemyClient.getUser();\n if (!user) {\n throw new NotAuthenticatedError();\n }\n\n if (!user.solanaAddress) {\n throw new Error(\"no solana address\");\n }\n\n const messageToSign = toHex(message);\n const signature = await this.alchemyClient.signRawMessage(\n messageToSign,\n \"SOLANA\"\n );\n\n return toBytes(this.formatSignatureForSolana(signature));\n }\n\n async createTransaction(\n instructions: TransactionInstruction[],\n connection: Connection,\n version?: \"versioned\"\n ): Promise<VersionedTransaction>;\n async createTransaction(\n instructions: TransactionInstruction[],\n connection: Connection,\n version?: \"legacy\"\n ): Promise<Transaction>;\n async createTransaction(\n instructions: TransactionInstruction[],\n connection: Connection\n ): Promise<VersionedTransaction>;\n\n /**\n * Creates a transfer transaction. Used for the SolanaCard example.\n *\n * @param {TransactionInstruction[]} instructions - The instructions to add to the transaction\n * @param {Connection} connection - The connection to use for the transaction\n * @param {\"versioned\" | \"legacy\"} [version] - The version of the transaction\n * @returns {Promise<Transaction | VersionedTransaction>} The transfer transaction\n */\n async createTransaction(\n instructions: TransactionInstruction[],\n connection: Connection,\n version?: string\n ): Promise<Transaction | VersionedTransaction> {\n const blockhash = (await connection.getLatestBlockhash()).blockhash;\n\n let transferTransaction;\n\n if (version === \"legacy\") {\n // Legacy transaction\n transferTransaction = instructions.reduce(\n (tx, instruction) => tx.add(instruction),\n new Transaction()\n );\n\n // Get a recent block hash\n transferTransaction.recentBlockhash = blockhash;\n // Set the signer\n transferTransaction.feePayer = new PublicKey(this.address);\n } else {\n // VersionedTransaction\n const txMessage = new TransactionMessage({\n payerKey: new PublicKey(this.address),\n recentBlockhash: blockhash,\n instructions,\n });\n\n const versionedTxMessage = txMessage.compileToV0Message();\n transferTransaction = new VersionedTransaction(versionedTxMessage);\n }\n\n return transferTransaction;\n }\n\n /**\n * Adds sponsorship to a transaction. Used to have a party like Alchemy pay for the transaction.\n *\n * @param {TransactionInstruction[]} instructions - The instructions to add to the transaction\n * @param {Connection} connection - The connection to use for the transaction\n * @param {string} [policyId] - The policy ID to add sponsorship to\n * @returns {Promise<VersionedTransaction>} The transaction with sponsorship added\n */\n async addSponsorship(\n instructions: TransactionInstruction[],\n connection: Connection,\n policyId: string\n ): Promise<VersionedTransaction> {\n const { blockhash } = await connection.getLatestBlockhash({\n commitment: \"finalized\",\n });\n const message = new TransactionMessage({\n // Right now the backend will rewrite this payer Key to the server's address\n payerKey: new PublicKey(this.address),\n recentBlockhash: blockhash,\n instructions,\n }).compileToV0Message();\n const versionedTransaction = new VersionedTransaction(message);\n const serializedTransaction = Buffer.from(\n versionedTransaction.serialize()\n ).toString(\"base64\");\n const body = JSON.stringify({\n id: crypto?.randomUUID() ?? Math.floor(Math.random() * 1000000),\n jsonrpc: \"2.0\",\n method: \"alchemy_requestFeePayer\",\n params: [\n {\n policyId,\n serializedTransaction,\n },\n ],\n });\n const options = {\n method: \"POST\",\n headers: {\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n },\n body,\n };\n\n const response = await fetch(\n // TODO: Use the connection??\n connection.rpcEndpoint,\n options\n );\n const jsonResponse = await response.json();\n if (!jsonResponse?.result?.serializedTransaction)\n throw new Error(\n `Response doesn't include the serializedTransaction ${JSON.stringify(\n jsonResponse\n )}`\n );\n return VersionedTransaction.deserialize(\n decodeBase64(jsonResponse.result.serializedTransaction)\n );\n }\n\n private formatSignatureForSolana(signature: Hex): Hex {\n if (size(signature) === 64) return signature;\n\n return slice(signature, 0, 64);\n }\n\n private getMessageToSign(tx: Transaction | VersionedTransaction): Hex {\n let messageToSign;\n if (tx instanceof Transaction) {\n messageToSign = tx.serializeMessage();\n } else {\n messageToSign = Buffer.from(tx.message.serialize());\n }\n return toHex(messageToSign);\n }\n}\nfunction decodeBase64(serializedTransaction: string): Uint8Array {\n return Buffer.from(serializedTransaction, \"base64\");\n}\n"]}
|
|
1
|
+
{"version":3,"file":"solanaSigner.js","sourceRoot":"","sources":["../../src/solanaSigner.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,SAAS,EACT,WAAW,EACX,sBAAsB,EACtB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,iBAAiB,CAAC;AACzB,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE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QAAQ,GAAG,MAAM,KAAK;QAC1B,6BAA6B;QAC7B,UAAU,CAAC,WAAW,EACtB,OAAO,CACR,CAAC;QACF,MAAM,YAAY,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC3C,IAAI,CAAC,YAAY,EAAE,MAAM,EAAE,qBAAqB;YAC9C,MAAM,IAAI,KAAK,CACb,sDAAsD,IAAI,CAAC,SAAS,CAClE,YAAY,CACb,EAAE,CACJ,CAAC;QACJ,OAAO,oBAAoB,CAAC,WAAW,CACrC,YAAY,CAAC,YAAY,CAAC,MAAM,CAAC,qBAAqB,CAAC,CACxD,CAAC;IACJ,CAAC;IAEO,wBAAwB,CAAC,SAAc;QAC7C,IAAI,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE;YAAE,OAAO,SAAS,CAAC;QAE7C,OAAO,KAAK,CAAC,SAAS,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACjC,CAAC;IAEO,gBAAgB,CAAC,EAAsC;QAC7D,IAAI,aAAa,CAAC;QAClB,IAAI,EAAE,YAAY,WAAW,EAAE,CAAC;YAC9B,aAAa,GAAG,EAAE,CAAC,gBAAgB,EAAE,CAAC;QACxC,CAAC;aAAM,CAAC;YACN,aAAa,GAAG,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,CAAC,CAAC;QACtD,CAAC;QACD,OAAO,KAAK,CAAC,aAAa,CAAC,CAAC;IAC9B,CAAC;CACF;AACD,SAAS,YAAY,CAAC,qBAA6B;IACjD,OAAO,MAAM,CAAC,IAAI,CAAC,qBAAqB,EAAE,QAAQ,CAAC,CAAC;AACtD,CAAC","sourcesContent":["import {\n Connection,\n PublicKey,\n Transaction,\n TransactionInstruction,\n TransactionMessage,\n VersionedTransaction,\n} from \"@solana/web3.js\";\nimport { size, slice, toBytes, toHex, type ByteArray, type Hex } from \"viem\";\nimport type { BaseSignerClient } from \"./client/base\";\nimport { NotAuthenticatedError } from \"./errors.js\";\n\n/**\n * The SolanaSigner class is used to sign transactions and messages for the Solana blockchain.\n * It provides methods to add signatures to transactions and sign messages.\n */\nexport class SolanaSigner {\n readonly alchemyClient: BaseSignerClient;\n public readonly address: string;\n\n /**\n * Constructor for the SolanaSigner class which is a wrapper around the alchemy client, and is more focused on the solana web3\n *\n * @param {object} client This is the client that will be used to sign the transaction, and we are just having functions on top of it.\n */\n constructor(client: BaseSignerClient) {\n this.alchemyClient = client;\n if (!client.getUser()) throw new Error(\"Must be authenticated!\");\n\n // TODO: also throw here\n this.address = client.getUser()!.solanaAddress!;\n }\n\n /**\n * Adds a signature of the client user to a transaction\n *\n * @param {Transaction | VersionedTransaction} transaction - The transaction to add the signature to\n * @returns {Promise<Transaction | VersionedTransaction >} The transaction with the signature added\n */\n async addSignature(\n transaction: Transaction | VersionedTransaction,\n ): Promise<Transaction | VersionedTransaction> {\n const user = this.alchemyClient.getUser();\n if (!user) {\n throw new NotAuthenticatedError();\n }\n\n if (!user.solanaAddress) {\n throw new Error(\"no solana address\");\n }\n\n const fromKey = new PublicKey(user.solanaAddress);\n const messageToSign = this.getMessageToSign(transaction);\n const signature = await this.alchemyClient.signRawMessage(\n messageToSign,\n \"SOLANA\",\n );\n\n transaction.addSignature(\n fromKey,\n Buffer.from(toBytes(this.formatSignatureForSolana(signature))),\n );\n return transaction;\n }\n\n /**\n * Signs a message\n *\n * @param {Uint8Array} message - The message to sign\n * @returns {Promise<ByteArray>} The signature of the message\n */\n async signMessage(message: Uint8Array): Promise<ByteArray> {\n const user = this.alchemyClient.getUser();\n if (!user) {\n throw new NotAuthenticatedError();\n }\n\n if (!user.solanaAddress) {\n throw new Error(\"no solana address\");\n }\n\n const messageToSign = toHex(message);\n const signature = await this.alchemyClient.signRawMessage(\n messageToSign,\n \"SOLANA\",\n );\n\n return toBytes(this.formatSignatureForSolana(signature));\n }\n\n async createTransaction(\n instructions: TransactionInstruction[],\n connection: Connection,\n version?: \"versioned\",\n ): Promise<VersionedTransaction>;\n async createTransaction(\n instructions: TransactionInstruction[],\n connection: Connection,\n version?: \"legacy\",\n ): Promise<Transaction>;\n async createTransaction(\n instructions: TransactionInstruction[],\n connection: Connection,\n ): Promise<VersionedTransaction>;\n\n /**\n * Creates a transfer transaction. Used for the SolanaCard example.\n *\n * @param {TransactionInstruction[]} instructions - The instructions to add to the transaction\n * @param {Connection} connection - The connection to use for the transaction\n * @param {\"versioned\" | \"legacy\"} [version] - The version of the transaction\n * @returns {Promise<Transaction | VersionedTransaction>} The transfer transaction\n */\n async createTransaction(\n instructions: TransactionInstruction[],\n connection: Connection,\n version?: string,\n ): Promise<Transaction | VersionedTransaction> {\n const blockhash = (await connection.getLatestBlockhash()).blockhash;\n\n let transferTransaction;\n\n if (version === \"legacy\") {\n // Legacy transaction\n transferTransaction = instructions.reduce(\n (tx, instruction) => tx.add(instruction),\n new Transaction(),\n );\n\n // Get a recent block hash\n transferTransaction.recentBlockhash = blockhash;\n // Set the signer\n transferTransaction.feePayer = new PublicKey(this.address);\n } else {\n // VersionedTransaction\n const txMessage = new TransactionMessage({\n payerKey: new PublicKey(this.address),\n recentBlockhash: blockhash,\n instructions,\n });\n\n const versionedTxMessage = txMessage.compileToV0Message();\n transferTransaction = new VersionedTransaction(versionedTxMessage);\n }\n\n return transferTransaction;\n }\n\n /**\n * Adds sponsorship to a transaction. Used to have a party like Alchemy pay for the transaction.\n *\n * @param {TransactionInstruction[]} instructions - The instructions to add to the transaction\n * @param {Connection} connection - The connection to use for the transaction\n * @param {string} [policyId] - The policy ID to add sponsorship to\n * @returns {Promise<VersionedTransaction>} The transaction with sponsorship added\n */\n async addSponsorship(\n instructions: TransactionInstruction[],\n connection: Connection,\n policyId: string,\n ): Promise<VersionedTransaction> {\n const { blockhash } = await connection.getLatestBlockhash({\n commitment: \"finalized\",\n });\n const message = new TransactionMessage({\n // Right now the backend will rewrite this payer Key to the server's address\n payerKey: new PublicKey(this.address),\n recentBlockhash: blockhash,\n instructions,\n }).compileToV0Message();\n const versionedTransaction = new VersionedTransaction(message);\n const serializedTransaction = Buffer.from(\n versionedTransaction.serialize(),\n ).toString(\"base64\");\n const body = JSON.stringify({\n id: crypto?.randomUUID() ?? Math.floor(Math.random() * 1000000),\n jsonrpc: \"2.0\",\n method: \"alchemy_requestFeePayer\",\n params: [\n {\n policyId,\n serializedTransaction,\n },\n ],\n });\n const options = {\n method: \"POST\",\n headers: {\n accept: \"application/json\",\n \"content-type\": \"application/json\",\n },\n body,\n };\n\n const response = await fetch(\n // TODO: Use the connection??\n connection.rpcEndpoint,\n options,\n );\n const jsonResponse = await response.json();\n if (!jsonResponse?.result?.serializedTransaction)\n throw new Error(\n `Response doesn't include the serializedTransaction ${JSON.stringify(\n jsonResponse,\n )}`,\n );\n return VersionedTransaction.deserialize(\n decodeBase64(jsonResponse.result.serializedTransaction),\n );\n }\n\n private formatSignatureForSolana(signature: Hex): Hex {\n if (size(signature) === 64) return signature;\n\n return slice(signature, 0, 64);\n }\n\n private getMessageToSign(tx: Transaction | VersionedTransaction): Hex {\n let messageToSign;\n if (tx instanceof Transaction) {\n messageToSign = tx.serializeMessage();\n } else {\n messageToSign = Buffer.from(tx.message.serialize());\n }\n return toHex(messageToSign);\n }\n}\nfunction decodeBase64(serializedTransaction: string): Uint8Array {\n return Buffer.from(serializedTransaction, \"base64\");\n}\n"]}
|
package/dist/esm/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const VERSION = "4.
|
|
1
|
+
export declare const VERSION = "4.36.0";
|
package/dist/esm/version.js
CHANGED
package/dist/esm/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["../../src/version.ts"],"names":[],"mappings":"AAAA,uEAAuE;AACvE,yBAAyB;AACzB,MAAM,CAAC,MAAM,OAAO,GAAG,QAAQ,CAAC","sourcesContent":["// This file is autogenerated by inject-version.ts. Any changes will be\n// overwritten on commit!\nexport const VERSION = \"4.36.0\";\n"]}
|
package/dist/types/base.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { type MfaFactor, type OauthConfig, type User, type VerifyMfaParams, type
|
|
|
5
5
|
import { type SessionManagerParams } from "./session/manager.js";
|
|
6
6
|
import type { AuthParams } from "./signer";
|
|
7
7
|
import { SolanaSigner } from "./solanaSigner.js";
|
|
8
|
-
import { type AlchemySignerEvents, type ErrorInfo, type ValidateMultiFactorsArgs } from "./types.js";
|
|
8
|
+
import { type AlchemySignerEvent, type AlchemySignerEvents, type ErrorInfo, type ValidateMultiFactorsArgs } from "./types.js";
|
|
9
9
|
export interface BaseAlchemySignerParams<TClient extends BaseSignerClient> {
|
|
10
10
|
client: TClient;
|
|
11
11
|
sessionConfig?: Omit<SessionManagerParams, "client">;
|
|
@@ -46,7 +46,7 @@ export declare abstract class BaseAlchemySigner<TClient extends BaseSignerClient
|
|
|
46
46
|
* @param {AlchemySignerEvents[AlchemySignerEvent]} listener the function to run when the event is emitted
|
|
47
47
|
* @returns {() => void} a function to remove the listener
|
|
48
48
|
*/
|
|
49
|
-
on: <E extends
|
|
49
|
+
on: <E extends AlchemySignerEvent>(event: E, listener: AlchemySignerEvents[E]) => () => void;
|
|
50
50
|
/**
|
|
51
51
|
* Prepares the config needed to use popup-based OAuth login. This must be
|
|
52
52
|
* called before calling `.authenticate` with params `{ type: "oauth", mode:
|
package/dist/types/base.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base.d.ts","sourceRoot":"","sources":["../../src/base.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EAC1B,MAAM,cAA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