@amadeus-protocol/wallet-sdk 0.1.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.
Files changed (76) hide show
  1. package/README.md +73 -0
  2. package/dist/binary.d.ts +30 -0
  3. package/dist/binary.d.ts.map +1 -0
  4. package/dist/binary.js +56 -0
  5. package/dist/binary.js.map +1 -0
  6. package/dist/bytes.d.ts +20 -0
  7. package/dist/bytes.d.ts.map +1 -0
  8. package/dist/bytes.js +48 -0
  9. package/dist/bytes.js.map +1 -0
  10. package/dist/client/injected.d.ts +41 -0
  11. package/dist/client/injected.d.ts.map +1 -0
  12. package/dist/client/injected.js +87 -0
  13. package/dist/client/injected.js.map +1 -0
  14. package/dist/constants.d.ts +70 -0
  15. package/dist/constants.d.ts.map +1 -0
  16. package/dist/constants.js +82 -0
  17. package/dist/constants.js.map +1 -0
  18. package/dist/crypto/apikey.d.ts +72 -0
  19. package/dist/crypto/apikey.d.ts.map +1 -0
  20. package/dist/crypto/apikey.js +109 -0
  21. package/dist/crypto/apikey.js.map +1 -0
  22. package/dist/crypto/bls.d.ts +31 -0
  23. package/dist/crypto/bls.d.ts.map +1 -0
  24. package/dist/crypto/bls.js +65 -0
  25. package/dist/crypto/bls.js.map +1 -0
  26. package/dist/crypto/box.d.ts +43 -0
  27. package/dist/crypto/box.d.ts.map +1 -0
  28. package/dist/crypto/box.js +82 -0
  29. package/dist/crypto/box.js.map +1 -0
  30. package/dist/crypto/connect.d.ts +59 -0
  31. package/dist/crypto/connect.d.ts.map +1 -0
  32. package/dist/crypto/connect.js +72 -0
  33. package/dist/crypto/connect.js.map +1 -0
  34. package/dist/errors.d.ts +10 -0
  35. package/dist/errors.d.ts.map +1 -0
  36. package/dist/errors.js +14 -0
  37. package/dist/errors.js.map +1 -0
  38. package/dist/index.d.ts +18 -0
  39. package/dist/index.js +18 -0
  40. package/dist/react/index.d.ts +20 -0
  41. package/dist/react/index.d.ts.map +1 -0
  42. package/dist/react/index.js +95 -0
  43. package/dist/react/index.js.map +1 -0
  44. package/dist/schema.d.ts +63 -0
  45. package/dist/schema.d.ts.map +1 -0
  46. package/dist/schema.js +52 -0
  47. package/dist/schema.js.map +1 -0
  48. package/dist/transport/bridge.d.ts +82 -0
  49. package/dist/transport/bridge.d.ts.map +1 -0
  50. package/dist/transport/bridge.js +125 -0
  51. package/dist/transport/bridge.js.map +1 -0
  52. package/dist/transport/envelope.d.ts +73 -0
  53. package/dist/transport/envelope.d.ts.map +1 -0
  54. package/dist/transport/envelope.js +123 -0
  55. package/dist/transport/envelope.js.map +1 -0
  56. package/dist/transport/session.d.ts +70 -0
  57. package/dist/transport/session.d.ts.map +1 -0
  58. package/dist/transport/session.js +119 -0
  59. package/dist/transport/session.js.map +1 -0
  60. package/dist/transport/uri.d.ts +49 -0
  61. package/dist/transport/uri.d.ts.map +1 -0
  62. package/dist/transport/uri.js +101 -0
  63. package/dist/transport/uri.js.map +1 -0
  64. package/dist/tx.d.ts +42 -0
  65. package/dist/tx.d.ts.map +1 -0
  66. package/dist/tx.js +61 -0
  67. package/dist/tx.js.map +1 -0
  68. package/dist/types.d.ts +80 -0
  69. package/dist/types.d.ts.map +1 -0
  70. package/dist/types.js +14 -0
  71. package/dist/types.js.map +1 -0
  72. package/dist/wallet/handler.d.ts +18 -0
  73. package/dist/wallet/handler.d.ts.map +1 -0
  74. package/dist/wallet/handler.js +79 -0
  75. package/dist/wallet/handler.js.map +1 -0
  76. package/package.json +92 -0
@@ -0,0 +1,80 @@
1
+ import { NETWORKS, PROVIDER_EVENTS } from "./constants.js";
2
+ //#region src/types.d.ts
3
+ type AmadeusNetwork = (typeof NETWORKS)[number];
4
+ type AmadeusProviderEvent = (typeof PROVIDER_EVENTS)[number];
5
+ interface SignTransactionRequest {
6
+ contract: string;
7
+ method: string;
8
+ args: any[];
9
+ description?: string;
10
+ }
11
+ interface SignTransactionResponse {
12
+ txHash: string;
13
+ /** Packed transaction bytes as a plain number[] (fed into `new Uint8Array(...)`). */
14
+ txPacked: number[];
15
+ }
16
+ interface GenerateApiKeyRequest {
17
+ aud: string;
18
+ /** Lifetime in seconds. */
19
+ exp_in: number;
20
+ }
21
+ interface GenerateApiKeyResponse {
22
+ apiKey: string;
23
+ }
24
+ /** Event payloads emitted through the provider's `.on(name, cb)` channel. */
25
+ interface AmadeusEventPayloadMap {
26
+ accountsChanged: {
27
+ accounts: string[];
28
+ previousAccounts: string[];
29
+ timestamp: number;
30
+ };
31
+ connect: {
32
+ accounts: string[];
33
+ network: string;
34
+ timestamp: number;
35
+ };
36
+ disconnect: {
37
+ reason?: string;
38
+ timestamp: number;
39
+ };
40
+ lock: {
41
+ reason?: string;
42
+ timestamp: number;
43
+ };
44
+ unlock: {
45
+ accounts: string[];
46
+ network: string;
47
+ timestamp: number;
48
+ };
49
+ networkChanged: {
50
+ network: string;
51
+ previousNetwork: string;
52
+ timestamp: number;
53
+ };
54
+ }
55
+ /**
56
+ * The injected provider interface. This is the object a dApp reads off
57
+ * `window.amadeus`. Do not rename methods — dApps call them directly.
58
+ */
59
+ interface AmadeusProvider {
60
+ readonly isAmadeus: boolean;
61
+ isConnected(): Promise<boolean>;
62
+ getAccount(): Promise<string | null>;
63
+ getNetwork(): Promise<string>;
64
+ requestAccounts(): Promise<string[]>;
65
+ requestSwitchNetwork(network: string): Promise<string>;
66
+ signTransaction(params: SignTransactionRequest): Promise<SignTransactionResponse>;
67
+ generateApiKey(params: GenerateApiKeyRequest): Promise<GenerateApiKeyResponse>;
68
+ on<E extends AmadeusProviderEvent>(event: E, callback: (data: AmadeusEventPayloadMap[E]) => void): void;
69
+ off<E extends AmadeusProviderEvent>(event: E, callback: (data: AmadeusEventPayloadMap[E]) => void): void;
70
+ }
71
+ declare global {
72
+ var amadeus: AmadeusProvider | undefined;
73
+ }
74
+ /** Return the injected provider if present and genuine, else null. Browser-only. */
75
+ declare function getAmadeusProvider(): AmadeusProvider | null;
76
+ /** Whether a genuine Amadeus provider is currently injected. */
77
+ declare function isProviderAvailable(): boolean;
78
+ //#endregion
79
+ export { AmadeusEventPayloadMap, AmadeusNetwork, AmadeusProvider, AmadeusProviderEvent, GenerateApiKeyRequest, GenerateApiKeyResponse, SignTransactionRequest, SignTransactionResponse, getAmadeusProvider, isProviderAvailable };
80
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","names":[],"sources":["../src/types.ts"],"mappings":";;KASY,yBAAyB;KAEzB,+BAA+B;UAE1B;EAChB;EACA;EAEA;EACA;;UAGgB;EAChB;;EAEA;;UAGgB;EAChB;;EAEA;;UAGgB;EAChB;;;UAIgB;EAChB;IAAmB;IAAoB;IAA4B;;EACnE;IAAW;IAAoB;IAAiB;;EAChD;IAAc;IAAiB;;EAC/B;IAAQ;IAAiB;;EACzB;IAAU;IAAoB;IAAiB;;EAC/C;IAAkB;IAAiB;IAAyB;;;;;;;UAO5C;WACP;EACT,eAAe;EACf,cAAc;EACd,cAAc;EACd,mBAAmB;EACnB,qBAAqB,kBAAkB;EACvC,gBAAgB,QAAQ,yBAAyB,QAAQ;EACzD,eAAe,QAAQ,wBAAwB,QAAQ;EACvD,GAAG,UAAU,sBACZ,OAAO,GACP,WAAW,MAAM,uBAAuB;EAEzC,IAAI,UAAU,sBACb,OAAO,GACP,WAAW,MAAM,uBAAuB;;QAIlC;MACH,SAAS;;;iBAIE,sBAAsB;;iBAMtB"}
package/dist/types.js ADDED
@@ -0,0 +1,14 @@
1
+ //#region src/types.ts
2
+ /** Return the injected provider if present and genuine, else null. Browser-only. */
3
+ function getAmadeusProvider() {
4
+ const candidate = globalThis.amadeus;
5
+ return candidate && candidate.isAmadeus === true ? candidate : null;
6
+ }
7
+ /** Whether a genuine Amadeus provider is currently injected. */
8
+ function isProviderAvailable() {
9
+ return getAmadeusProvider() !== null;
10
+ }
11
+ //#endregion
12
+ export { getAmadeusProvider, isProviderAvailable };
13
+
14
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","names":[],"sources":["../src/types.ts"],"sourcesContent":["/**\n * The typed public contract every Amadeus dApp already depends on — the injected\n * `window.amadeus` provider — plus the request/response shapes and event names.\n * These mirror the wallet extension exactly; changing a name or shape breaks live\n * dApps, so treat this file as the compatibility surface.\n */\n\nimport { NETWORKS, PROVIDER_EVENTS } from './constants'\n\nexport type AmadeusNetwork = (typeof NETWORKS)[number]\n\nexport type AmadeusProviderEvent = (typeof PROVIDER_EVENTS)[number]\n\nexport interface SignTransactionRequest {\n\tcontract: string\n\tmethod: string\n\t// eslint-disable-next-line @typescript-eslint/no-explicit-any\n\targs: any[]\n\tdescription?: string\n}\n\nexport interface SignTransactionResponse {\n\ttxHash: string\n\t/** Packed transaction bytes as a plain number[] (fed into `new Uint8Array(...)`). */\n\ttxPacked: number[]\n}\n\nexport interface GenerateApiKeyRequest {\n\taud: string\n\t/** Lifetime in seconds. */\n\texp_in: number\n}\n\nexport interface GenerateApiKeyResponse {\n\tapiKey: string\n}\n\n/** Event payloads emitted through the provider's `.on(name, cb)` channel. */\nexport interface AmadeusEventPayloadMap {\n\taccountsChanged: { accounts: string[]; previousAccounts: string[]; timestamp: number }\n\tconnect: { accounts: string[]; network: string; timestamp: number }\n\tdisconnect: { reason?: string; timestamp: number }\n\tlock: { reason?: string; timestamp: number }\n\tunlock: { accounts: string[]; network: string; timestamp: number }\n\tnetworkChanged: { network: string; previousNetwork: string; timestamp: number }\n}\n\n/**\n * The injected provider interface. This is the object a dApp reads off\n * `window.amadeus`. Do not rename methods — dApps call them directly.\n */\nexport interface AmadeusProvider {\n\treadonly isAmadeus: boolean\n\tisConnected(): Promise<boolean>\n\tgetAccount(): Promise<string | null>\n\tgetNetwork(): Promise<string>\n\trequestAccounts(): Promise<string[]>\n\trequestSwitchNetwork(network: string): Promise<string>\n\tsignTransaction(params: SignTransactionRequest): Promise<SignTransactionResponse>\n\tgenerateApiKey(params: GenerateApiKeyRequest): Promise<GenerateApiKeyResponse>\n\ton<E extends AmadeusProviderEvent>(\n\t\tevent: E,\n\t\tcallback: (data: AmadeusEventPayloadMap[E]) => void\n\t): void\n\toff<E extends AmadeusProviderEvent>(\n\t\tevent: E,\n\t\tcallback: (data: AmadeusEventPayloadMap[E]) => void\n\t): void\n}\n\ndeclare global {\n\tvar amadeus: AmadeusProvider | undefined\n}\n\n/** Return the injected provider if present and genuine, else null. Browser-only. */\nexport function getAmadeusProvider(): AmadeusProvider | null {\n\tconst candidate = (globalThis as { amadeus?: AmadeusProvider }).amadeus\n\treturn candidate && candidate.isAmadeus === true ? candidate : null\n}\n\n/** Whether a genuine Amadeus provider is currently injected. */\nexport function isProviderAvailable(): boolean {\n\treturn getAmadeusProvider() !== null\n}\n"],"mappings":";;AA2EA,SAAgB,qBAA6C;CAC5D,MAAM,YAAa,WAA6C;CAChE,OAAO,aAAa,UAAU,cAAc,OAAO,YAAY;AAChE;;AAGA,SAAgB,sBAA+B;CAC9C,OAAO,mBAAmB,MAAM;AACjC"}
@@ -0,0 +1,18 @@
1
+ import { WalletRequest, WalletResponse } from "../transport/envelope.js";
2
+ //#region src/wallet/handler.d.ts
3
+ interface WalletHandlerContext {
4
+ /** Seed (private key) of the account bound to this session. */
5
+ seed: string;
6
+ /** Address (Base58 public key) of the bound account. */
7
+ address: string;
8
+ }
9
+ /**
10
+ * Service one approved request and return a response ready to seal. Never throws
11
+ * — failures come back as `{ ok: false, error }` so the transport can always
12
+ * reply. `amadeus_switchNetwork` is deliberately delegated to the app (it mutates
13
+ * wallet runtime state), signalled with a distinct error the caller can branch on.
14
+ */
15
+ declare function handleRequest(request: WalletRequest, ctx: WalletHandlerContext): WalletResponse;
16
+ //#endregion
17
+ export { WalletHandlerContext, handleRequest };
18
+ //# sourceMappingURL=handler.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.d.ts","names":[],"sources":["../../src/wallet/handler.ts"],"mappings":";;UAkBiB;;EAEhB;;EAEA;;;;;;;;iBAmBe,cAAc,SAAS,eAAe,KAAK,uBAAuB"}
@@ -0,0 +1,79 @@
1
+ import "../constants.js";
2
+ import { WalletSdkError } from "../errors.js";
3
+ import { signTransaction } from "../tx.js";
4
+ import { generateApiKeyRequestSchema, signTransactionRequestSchema } from "../schema.js";
5
+ import { generateApiKey } from "../crypto/apikey.js";
6
+ //#region src/wallet/handler.ts
7
+ /**
8
+ * Wallet-side request dispatch. Once the mobile app has opened + guarded an
9
+ * inbound request and the user has approved it, this turns the request into a
10
+ * signed response by routing to the right primitive. Keeping it here means the
11
+ * app's approval screen only has to call one function; the wallet and extension
12
+ * share identical request semantics.
13
+ *
14
+ * IMPORTANT: call this only AFTER `guardRequest` (expiry + replay) has passed and
15
+ * the user has approved. It signs with the bound account's seed.
16
+ */
17
+ function ok(id, result) {
18
+ return {
19
+ v: 1,
20
+ id,
21
+ ok: true,
22
+ result
23
+ };
24
+ }
25
+ function fail(id, error) {
26
+ return {
27
+ v: 1,
28
+ id,
29
+ ok: false,
30
+ error: {
31
+ code: error instanceof WalletSdkError ? error.code : "INTERNAL",
32
+ message: error instanceof Error ? error.message : "unexpected error"
33
+ }
34
+ };
35
+ }
36
+ /**
37
+ * Service one approved request and return a response ready to seal. Never throws
38
+ * — failures come back as `{ ok: false, error }` so the transport can always
39
+ * reply. `amadeus_switchNetwork` is deliberately delegated to the app (it mutates
40
+ * wallet runtime state), signalled with a distinct error the caller can branch on.
41
+ */
42
+ function handleRequest(request, ctx) {
43
+ try {
44
+ switch (request.method) {
45
+ case "amadeus_signTransaction": {
46
+ const parsed = signTransactionRequestSchema.safeParse(request.params);
47
+ if (!parsed.success) throw new WalletSdkError("INVALID_ARGUMENT", "invalid signTransaction params");
48
+ const signed = signTransaction({
49
+ seed: ctx.seed,
50
+ contract: parsed.data.contract,
51
+ method: parsed.data.method,
52
+ args: parsed.data.args,
53
+ description: parsed.data.description
54
+ });
55
+ return ok(request.id, signed);
56
+ }
57
+ case "amadeus_generateApiKey": {
58
+ const parsed = generateApiKeyRequestSchema.safeParse(request.params);
59
+ if (!parsed.success) throw new WalletSdkError("INVALID_ARGUMENT", "invalid generateApiKey params");
60
+ const { apiKey } = generateApiKey({
61
+ seed: ctx.seed,
62
+ aud: parsed.data.aud,
63
+ expIn: parsed.data.exp_in
64
+ });
65
+ return ok(request.id, { apiKey });
66
+ }
67
+ case "amadeus_getAccounts": return ok(request.id, { accounts: [ctx.address] });
68
+ case "amadeus_signMessage": throw new WalletSdkError("INVALID_ARGUMENT", "amadeus_signMessage is not supported yet");
69
+ case "amadeus_switchNetwork": throw new WalletSdkError("INVALID_ARGUMENT", "amadeus_switchNetwork must be handled by the wallet app (it changes runtime state)");
70
+ default: throw new WalletSdkError("INVALID_ARGUMENT", `unknown method`);
71
+ }
72
+ } catch (error) {
73
+ return fail(request.id, error);
74
+ }
75
+ }
76
+ //#endregion
77
+ export { handleRequest };
78
+
79
+ //# sourceMappingURL=handler.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"handler.js","names":[],"sources":["../../src/wallet/handler.ts"],"sourcesContent":["/**\n * Wallet-side request dispatch. Once the mobile app has opened + guarded an\n * inbound request and the user has approved it, this turns the request into a\n * signed response by routing to the right primitive. Keeping it here means the\n * app's approval screen only has to call one function; the wallet and extension\n * share identical request semantics.\n *\n * IMPORTANT: call this only AFTER `guardRequest` (expiry + replay) has passed and\n * the user has approved. It signs with the bound account's seed.\n */\n\nimport { PROTOCOL_VERSION } from '../constants'\nimport { generateApiKey } from '../crypto/apikey'\nimport { WalletSdkError } from '../errors'\nimport { generateApiKeyRequestSchema, signTransactionRequestSchema } from '../schema'\nimport { signTransaction } from '../tx'\nimport type { WalletRequest, WalletResponse } from '../transport/envelope'\n\nexport interface WalletHandlerContext {\n\t/** Seed (private key) of the account bound to this session. */\n\tseed: string\n\t/** Address (Base58 public key) of the bound account. */\n\taddress: string\n}\n\nfunction ok(id: string, result: unknown): WalletResponse {\n\treturn { v: PROTOCOL_VERSION, id, ok: true, result }\n}\n\nfunction fail(id: string, error: unknown): WalletResponse {\n\tconst code = error instanceof WalletSdkError ? error.code : 'INTERNAL'\n\tconst message = error instanceof Error ? error.message : 'unexpected error'\n\treturn { v: PROTOCOL_VERSION, id, ok: false, error: { code, message } }\n}\n\n/**\n * Service one approved request and return a response ready to seal. Never throws\n * — failures come back as `{ ok: false, error }` so the transport can always\n * reply. `amadeus_switchNetwork` is deliberately delegated to the app (it mutates\n * wallet runtime state), signalled with a distinct error the caller can branch on.\n */\nexport function handleRequest(request: WalletRequest, ctx: WalletHandlerContext): WalletResponse {\n\ttry {\n\t\tswitch (request.method) {\n\t\t\tcase 'amadeus_signTransaction': {\n\t\t\t\tconst parsed = signTransactionRequestSchema.safeParse(request.params)\n\t\t\t\tif (!parsed.success) {\n\t\t\t\t\tthrow new WalletSdkError('INVALID_ARGUMENT', 'invalid signTransaction params')\n\t\t\t\t}\n\t\t\t\tconst signed = signTransaction({\n\t\t\t\t\tseed: ctx.seed,\n\t\t\t\t\tcontract: parsed.data.contract,\n\t\t\t\t\tmethod: parsed.data.method,\n\t\t\t\t\targs: parsed.data.args,\n\t\t\t\t\tdescription: parsed.data.description\n\t\t\t\t})\n\t\t\t\treturn ok(request.id, signed)\n\t\t\t}\n\t\t\tcase 'amadeus_generateApiKey': {\n\t\t\t\tconst parsed = generateApiKeyRequestSchema.safeParse(request.params)\n\t\t\t\tif (!parsed.success) {\n\t\t\t\t\tthrow new WalletSdkError('INVALID_ARGUMENT', 'invalid generateApiKey params')\n\t\t\t\t}\n\t\t\t\tconst { apiKey } = generateApiKey({\n\t\t\t\t\tseed: ctx.seed,\n\t\t\t\t\taud: parsed.data.aud,\n\t\t\t\t\texpIn: parsed.data.exp_in\n\t\t\t\t})\n\t\t\t\treturn ok(request.id, { apiKey })\n\t\t\t}\n\t\t\tcase 'amadeus_getAccounts':\n\t\t\t\treturn ok(request.id, { accounts: [ctx.address] })\n\t\t\tcase 'amadeus_signMessage':\n\t\t\t\t// Structured, non-oracle message signing is not exposed in v0.1.\n\t\t\t\tthrow new WalletSdkError(\n\t\t\t\t\t'INVALID_ARGUMENT',\n\t\t\t\t\t'amadeus_signMessage is not supported yet'\n\t\t\t\t)\n\t\t\tcase 'amadeus_switchNetwork':\n\t\t\t\tthrow new WalletSdkError(\n\t\t\t\t\t'INVALID_ARGUMENT',\n\t\t\t\t\t'amadeus_switchNetwork must be handled by the wallet app (it changes runtime state)'\n\t\t\t\t)\n\t\t\tdefault:\n\t\t\t\tthrow new WalletSdkError('INVALID_ARGUMENT', `unknown method`)\n\t\t}\n\t} catch (error) {\n\t\treturn fail(request.id, error)\n\t}\n}\n"],"mappings":";;;;;;;;;;;;;;;;AAyBA,SAAS,GAAG,IAAY,QAAiC;CACxD,OAAO;EAAE,GAAA;EAAqB;EAAI,IAAI;EAAM;CAAO;AACpD;AAEA,SAAS,KAAK,IAAY,OAAgC;CAGzD,OAAO;EAAE,GAAA;EAAqB;EAAI,IAAI;EAAO,OAAO;GAAE,MAFzC,iBAAiB,iBAAiB,MAAM,OAAO;GAEA,SAD5C,iBAAiB,QAAQ,MAAM,UAAU;EACW;CAAE;AACvE;;;;;;;AAQA,SAAgB,cAAc,SAAwB,KAA2C;CAChG,IAAI;EACH,QAAQ,QAAQ,QAAhB;GACC,KAAK,2BAA2B;IAC/B,MAAM,SAAS,6BAA6B,UAAU,QAAQ,MAAM;IACpE,IAAI,CAAC,OAAO,SACX,MAAM,IAAI,eAAe,oBAAoB,gCAAgC;IAE9E,MAAM,SAAS,gBAAgB;KAC9B,MAAM,IAAI;KACV,UAAU,OAAO,KAAK;KACtB,QAAQ,OAAO,KAAK;KACpB,MAAM,OAAO,KAAK;KAClB,aAAa,OAAO,KAAK;IAC1B,CAAC;IACD,OAAO,GAAG,QAAQ,IAAI,MAAM;GAC7B;GACA,KAAK,0BAA0B;IAC9B,MAAM,SAAS,4BAA4B,UAAU,QAAQ,MAAM;IACnE,IAAI,CAAC,OAAO,SACX,MAAM,IAAI,eAAe,oBAAoB,+BAA+B;IAE7E,MAAM,EAAE,WAAW,eAAe;KACjC,MAAM,IAAI;KACV,KAAK,OAAO,KAAK;KACjB,OAAO,OAAO,KAAK;IACpB,CAAC;IACD,OAAO,GAAG,QAAQ,IAAI,EAAE,OAAO,CAAC;GACjC;GACA,KAAK,uBACJ,OAAO,GAAG,QAAQ,IAAI,EAAE,UAAU,CAAC,IAAI,OAAO,EAAE,CAAC;GAClD,KAAK,uBAEJ,MAAM,IAAI,eACT,oBACA,0CACD;GACD,KAAK,yBACJ,MAAM,IAAI,eACT,oBACA,oFACD;GACD,SACC,MAAM,IAAI,eAAe,oBAAoB,gBAAgB;EAC/D;CACD,SAAS,OAAO;EACf,OAAO,KAAK,QAAQ,IAAI,KAAK;CAC9B;AACD"}
package/package.json ADDED
@@ -0,0 +1,92 @@
1
+ {
2
+ "name": "@amadeus-protocol/wallet-sdk",
3
+ "version": "0.1.0",
4
+ "description": "Shared dApp <-> wallet connection layer for Amadeus Protocol: BLS API-key tokens, transaction signing, message/connect signing, and the typed provider contract. One audited implementation for the wallet, the extension, and every dApp.",
5
+ "type": "module",
6
+ "sideEffects": false,
7
+ "engines": {
8
+ "node": ">=20.0.0"
9
+ },
10
+ "main": "./dist/index.js",
11
+ "module": "./dist/index.js",
12
+ "types": "./dist/index.d.ts",
13
+ "exports": {
14
+ ".": {
15
+ "import": "./dist/index.js",
16
+ "types": "./dist/index.d.ts"
17
+ },
18
+ "./react": {
19
+ "import": "./dist/react/index.js",
20
+ "types": "./dist/react/index.d.ts"
21
+ }
22
+ },
23
+ "files": [
24
+ "dist",
25
+ "README.md"
26
+ ],
27
+ "scripts": {
28
+ "build": "tsdown",
29
+ "dev": "tsdown --watch",
30
+ "lint": "eslint src",
31
+ "lint:fix": "eslint src --fix",
32
+ "prettier:check": "prettier --check .",
33
+ "prettier:format": "prettier --write .",
34
+ "typecheck": "tsc --noEmit",
35
+ "test": "vitest run",
36
+ "test:watch": "vitest",
37
+ "test:coverage": "vitest run --coverage",
38
+ "prepublishOnly": "npm run build && npm run test && npm run lint",
39
+ "prepack": "npm run build"
40
+ },
41
+ "keywords": [
42
+ "amadeus",
43
+ "protocol",
44
+ "wallet",
45
+ "dapp",
46
+ "connect",
47
+ "bls12-381",
48
+ "sdk"
49
+ ],
50
+ "author": "Amadeus Protocol",
51
+ "license": "MIT",
52
+ "repository": {
53
+ "type": "git",
54
+ "url": "git+https://github.com/amadeusprotocol/amadeus-wallet-sdk.git"
55
+ },
56
+ "homepage": "https://github.com/amadeusprotocol/amadeus-wallet-sdk#readme",
57
+ "bugs": {
58
+ "url": "https://github.com/amadeusprotocol/amadeus-wallet-sdk/issues"
59
+ },
60
+ "publishConfig": {
61
+ "access": "public"
62
+ },
63
+ "dependencies": {
64
+ "@noble/ciphers": "^2.1.1",
65
+ "@noble/curves": "^1.9.1",
66
+ "@noble/hashes": "^1.8.0",
67
+ "zod": "^3.24.0"
68
+ },
69
+ "peerDependencies": {
70
+ "@amadeus-protocol/sdk": "^1.1.2",
71
+ "react": ">=18.0.0"
72
+ },
73
+ "peerDependenciesMeta": {
74
+ "react": {
75
+ "optional": true
76
+ }
77
+ },
78
+ "devDependencies": {
79
+ "@amadeus-protocol/sdk": "^1.1.2",
80
+ "@eslint/js": "^9.21.0",
81
+ "@types/node": "^22.14.0",
82
+ "@types/react": "^19.0.0",
83
+ "@vitest/coverage-v8": "^2.1.0",
84
+ "eslint": "^9.21.0",
85
+ "react": "^19.0.0",
86
+ "prettier": "^3.7.2",
87
+ "tsdown": "^0.22.0",
88
+ "typescript": "^5.7.2",
89
+ "typescript-eslint": "^8.24.1",
90
+ "vitest": "^2.1.0"
91
+ }
92
+ }