@otim/sdk-core 0.0.1

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 (75) hide show
  1. package/LICENSE +201 -0
  2. package/dist/.tsbuildinfo +1 -0
  3. package/dist/abi-Bd3X6gV9.d.mts +154 -0
  4. package/dist/abi-Bd3X6gV9.d.mts.map +1 -0
  5. package/dist/abi-CQuxrNCU.d.cts +154 -0
  6. package/dist/abi-CQuxrNCU.d.cts.map +1 -0
  7. package/dist/account/index.cjs +7 -0
  8. package/dist/account/index.d.cts +3 -0
  9. package/dist/account/index.d.mts +3 -0
  10. package/dist/account/index.mjs +3 -0
  11. package/dist/account-Bwm5PTcc.cjs +56 -0
  12. package/dist/account-Bwm5PTcc.cjs.map +1 -0
  13. package/dist/account-p4sxzIt3.mjs +26 -0
  14. package/dist/account-p4sxzIt3.mjs.map +1 -0
  15. package/dist/clients/index.cjs +7 -0
  16. package/dist/clients/index.d.cts +3 -0
  17. package/dist/clients/index.d.mts +3 -0
  18. package/dist/clients/index.mjs +3 -0
  19. package/dist/clients-DBRhkU4y.cjs +297 -0
  20. package/dist/clients-DBRhkU4y.cjs.map +1 -0
  21. package/dist/clients-DMKeLhcJ.mjs +268 -0
  22. package/dist/clients-DMKeLhcJ.mjs.map +1 -0
  23. package/dist/config/index.cjs +10 -0
  24. package/dist/config/index.d.cts +3 -0
  25. package/dist/config/index.d.mts +3 -0
  26. package/dist/config/index.mjs +3 -0
  27. package/dist/config-C_nc1DXn.mjs +67 -0
  28. package/dist/config-C_nc1DXn.mjs.map +1 -0
  29. package/dist/config-CjGpscVk.cjs +114 -0
  30. package/dist/config-CjGpscVk.cjs.map +1 -0
  31. package/dist/context/index.cjs +5 -0
  32. package/dist/context/index.d.cts +2 -0
  33. package/dist/context/index.d.mts +2 -0
  34. package/dist/context/index.mjs +3 -0
  35. package/dist/context-B-Wcmhb3.cjs +38 -0
  36. package/dist/context-B-Wcmhb3.cjs.map +1 -0
  37. package/dist/context-uTye69B0.mjs +20 -0
  38. package/dist/context-uTye69B0.mjs.map +1 -0
  39. package/dist/index-B4fkcFy5.d.mts +54 -0
  40. package/dist/index-B4fkcFy5.d.mts.map +1 -0
  41. package/dist/index-BnP8vpJJ.d.cts +25 -0
  42. package/dist/index-BnP8vpJJ.d.cts.map +1 -0
  43. package/dist/index-C1HSAemv.d.cts +20 -0
  44. package/dist/index-C1HSAemv.d.cts.map +1 -0
  45. package/dist/index-C4N2Xixk.d.mts +27 -0
  46. package/dist/index-C4N2Xixk.d.mts.map +1 -0
  47. package/dist/index-CcCMIBgF.d.mts +20 -0
  48. package/dist/index-CcCMIBgF.d.mts.map +1 -0
  49. package/dist/index-DK-40z4V.d.cts +54 -0
  50. package/dist/index-DK-40z4V.d.cts.map +1 -0
  51. package/dist/index-DW_zBRKz.d.mts +25 -0
  52. package/dist/index-DW_zBRKz.d.mts.map +1 -0
  53. package/dist/index-De8OZ-Be.d.cts +96 -0
  54. package/dist/index-De8OZ-Be.d.cts.map +1 -0
  55. package/dist/index-UnaahQgb.d.cts +27 -0
  56. package/dist/index-UnaahQgb.d.cts.map +1 -0
  57. package/dist/index-e5BLgzcW.d.mts +96 -0
  58. package/dist/index-e5BLgzcW.d.mts.map +1 -0
  59. package/dist/index.cjs +31 -0
  60. package/dist/index.d.cts +8 -0
  61. package/dist/index.d.mts +8 -0
  62. package/dist/index.mjs +7 -0
  63. package/dist/misc-CX4pLJaA.d.mts +42 -0
  64. package/dist/misc-CX4pLJaA.d.mts.map +1 -0
  65. package/dist/misc-CpZxSPCP.d.cts +42 -0
  66. package/dist/misc-CpZxSPCP.d.cts.map +1 -0
  67. package/dist/utils/index.cjs +6 -0
  68. package/dist/utils/index.d.cts +4 -0
  69. package/dist/utils/index.d.mts +4 -0
  70. package/dist/utils/index.mjs +3 -0
  71. package/dist/utils-CVQFvsfl.cjs +104 -0
  72. package/dist/utils-CVQFvsfl.cjs.map +1 -0
  73. package/dist/utils-DziAHBiz.mjs +81 -0
  74. package/dist/utils-DziAHBiz.mjs.map +1 -0
  75. package/package.json +162 -0
@@ -0,0 +1,67 @@
1
+ import { createEnv } from "@t3-oss/env-core";
2
+ import { z } from "zod";
3
+ import { createSiweMessage } from "viem/siwe";
4
+
5
+ //#region src/config/env.ts
6
+ const Environment = {
7
+ Sandbox: "sandbox",
8
+ Production: "production"
9
+ };
10
+ const isEnvironment = (value) => Object.values(Environment).includes(value);
11
+ const environmentValues = Object.values(Environment);
12
+ const API_URLS = {
13
+ [Environment.Sandbox]: "https://dev-cwnvii2d-api.otim.dev",
14
+ [Environment.Production]: "https://api.otim.com"
15
+ };
16
+ const TURNKEY_API_URLS = {
17
+ [Environment.Sandbox]: "https://api.turnkey.com",
18
+ [Environment.Production]: "https://api.turnkey.com"
19
+ };
20
+ const getApiUrl = (environment) => {
21
+ return API_URLS[environment];
22
+ };
23
+ const getTurnkeyApiUrl = (environment) => {
24
+ return TURNKEY_API_URLS[environment];
25
+ };
26
+ const env = createEnv({
27
+ server: {
28
+ ENVIRONMENT: z.enum(environmentValues).default(Environment.Sandbox),
29
+ ENABLE_MSW: z.coerce.boolean().default(false),
30
+ CI: z.coerce.boolean().default(false)
31
+ },
32
+ client: {},
33
+ clientPrefix: "",
34
+ runtimeEnv: {
35
+ ENVIRONMENT: process.env.ENVIRONMENT,
36
+ ENABLE_MSW: process.env.ENABLE_MSW,
37
+ CI: process.env.CI
38
+ },
39
+ onValidationError: (error) => {
40
+ console.error("❌ Invalid environment variables:", error);
41
+ throw new Error("Invalid environment variables");
42
+ },
43
+ skipValidation: process.env.SKIP_ENV_VALIDATION === "true"
44
+ });
45
+
46
+ //#endregion
47
+ //#region src/config/app.ts
48
+ /**
49
+ * SIWE default configuration.
50
+ */
51
+ const SIWE_CHAIN_ID = 0;
52
+ const SIWE_VERSION = "1";
53
+ const createLoginSiweMessage = (address, nonce) => {
54
+ return createSiweMessage({
55
+ address,
56
+ chainId: SIWE_CHAIN_ID,
57
+ nonce,
58
+ domain: "otim.com",
59
+ uri: "https://app.otim.com",
60
+ statement: `Welcome to Otim! By signing in, you accept the Otim Terms and Conditions (https://otim.com/tac). This request will not trigger a blockchain transaction or cost any gas fees.`,
61
+ version: SIWE_VERSION
62
+ });
63
+ };
64
+
65
+ //#endregion
66
+ export { env as a, isEnvironment as c, Environment as i, SIWE_VERSION as n, getApiUrl as o, createLoginSiweMessage as r, getTurnkeyApiUrl as s, SIWE_CHAIN_ID as t };
67
+ //# sourceMappingURL=config-C_nc1DXn.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-C_nc1DXn.mjs","names":["API_URLS: Record<Environment, string>","TURNKEY_API_URLS: Record<Environment, string>"],"sources":["../src/config/env.ts","../src/config/app.ts"],"sourcesContent":["import { createEnv } from \"@t3-oss/env-core\";\nimport { z } from \"zod\";\n\nexport const Environment = {\n Sandbox: \"sandbox\",\n Production: \"production\",\n} as const;\nexport type Environment = (typeof Environment)[keyof typeof Environment];\n\nexport const isEnvironment = (value: string): value is Environment =>\n Object.values(Environment).includes(value as Environment);\n\nexport const environmentValues = Object.values(Environment) as [\n Environment,\n ...Environment[],\n];\n\nexport const API_URLS: Record<Environment, string> = {\n [Environment.Sandbox]: \"https://dev-cwnvii2d-api.otim.dev\",\n [Environment.Production]: \"https://api.otim.com\",\n};\n\nexport const TURNKEY_API_URLS: Record<Environment, string> = {\n [Environment.Sandbox]: \"https://api.turnkey.com\",\n [Environment.Production]: \"https://api.turnkey.com\",\n};\n\nexport const getApiUrl = (environment: Environment): string => {\n return API_URLS[environment];\n};\n\nexport const getTurnkeyApiUrl = (environment: Environment): string => {\n return TURNKEY_API_URLS[environment];\n};\n\nexport const env = createEnv({\n server: {\n ENVIRONMENT: z.enum(environmentValues).default(Environment.Sandbox),\n\n ENABLE_MSW: z.coerce.boolean().default(false),\n\n CI: z.coerce.boolean().default(false),\n },\n\n client: {},\n\n clientPrefix: \"\",\n\n runtimeEnv: {\n ENVIRONMENT: process.env.ENVIRONMENT,\n\n ENABLE_MSW: process.env.ENABLE_MSW,\n\n CI: process.env.CI,\n },\n\n onValidationError: (error) => {\n // eslint-disable-next-line no-console\n console.error(\"❌ Invalid environment variables:\", error);\n throw new Error(\"Invalid environment variables\");\n },\n\n // skip validation of environment variables (should be false in most cases)\n skipValidation: process.env.SKIP_ENV_VALIDATION === \"true\",\n});\n","import type { Address } from \"viem\";\n\nimport { createSiweMessage } from \"viem/siwe\";\n\n/**\n * SIWE default configuration.\n */\nexport const SIWE_CHAIN_ID = 0;\nexport const SIWE_VERSION = \"1\";\n\nexport const createLoginSiweMessage = (\n address: Address,\n nonce: string,\n): string => {\n return createSiweMessage({\n address,\n chainId: SIWE_CHAIN_ID,\n nonce,\n domain: \"otim.com\",\n uri: \"https://app.otim.com\",\n statement: `Welcome to Otim! By signing in, you accept the Otim Terms and Conditions (https://otim.com/tac). This request will not trigger a blockchain transaction or cost any gas fees.`,\n version: SIWE_VERSION,\n });\n};\n"],"mappings":";;;;;AAGA,MAAa,cAAc;CACzB,SAAS;CACT,YAAY;CACb;AAGD,MAAa,iBAAiB,UAC5B,OAAO,OAAO,YAAY,CAAC,SAAS,MAAqB;AAE3D,MAAa,oBAAoB,OAAO,OAAO,YAAY;AAK3D,MAAaA,WAAwC;EAClD,YAAY,UAAU;EACtB,YAAY,aAAa;CAC3B;AAED,MAAaC,mBAAgD;EAC1D,YAAY,UAAU;EACtB,YAAY,aAAa;CAC3B;AAED,MAAa,aAAa,gBAAqC;AAC7D,QAAO,SAAS;;AAGlB,MAAa,oBAAoB,gBAAqC;AACpE,QAAO,iBAAiB;;AAG1B,MAAa,MAAM,UAAU;CAC3B,QAAQ;EACN,aAAa,EAAE,KAAK,kBAAkB,CAAC,QAAQ,YAAY,QAAQ;EAEnE,YAAY,EAAE,OAAO,SAAS,CAAC,QAAQ,MAAM;EAE7C,IAAI,EAAE,OAAO,SAAS,CAAC,QAAQ,MAAM;EACtC;CAED,QAAQ,EAAE;CAEV,cAAc;CAEd,YAAY;EACV,aAAa,QAAQ,IAAI;EAEzB,YAAY,QAAQ,IAAI;EAExB,IAAI,QAAQ,IAAI;EACjB;CAED,oBAAoB,UAAU;AAE5B,UAAQ,MAAM,oCAAoC,MAAM;AACxD,QAAM,IAAI,MAAM,gCAAgC;;CAIlD,gBAAgB,QAAQ,IAAI,wBAAwB;CACrD,CAAC;;;;;;;ACzDF,MAAa,gBAAgB;AAC7B,MAAa,eAAe;AAE5B,MAAa,0BACX,SACA,UACW;AACX,QAAO,kBAAkB;EACvB;EACA,SAAS;EACT;EACA,QAAQ;EACR,KAAK;EACL,WAAW;EACX,SAAS;EACV,CAAC"}
@@ -0,0 +1,114 @@
1
+ let __t3_oss_env_core = require("@t3-oss/env-core");
2
+ let zod = require("zod");
3
+ let viem_siwe = require("viem/siwe");
4
+
5
+ //#region src/config/env.ts
6
+ const Environment = {
7
+ Sandbox: "sandbox",
8
+ Production: "production"
9
+ };
10
+ const isEnvironment = (value) => Object.values(Environment).includes(value);
11
+ const environmentValues = Object.values(Environment);
12
+ const API_URLS = {
13
+ [Environment.Sandbox]: "https://dev-cwnvii2d-api.otim.dev",
14
+ [Environment.Production]: "https://api.otim.com"
15
+ };
16
+ const TURNKEY_API_URLS = {
17
+ [Environment.Sandbox]: "https://api.turnkey.com",
18
+ [Environment.Production]: "https://api.turnkey.com"
19
+ };
20
+ const getApiUrl = (environment) => {
21
+ return API_URLS[environment];
22
+ };
23
+ const getTurnkeyApiUrl = (environment) => {
24
+ return TURNKEY_API_URLS[environment];
25
+ };
26
+ const env = (0, __t3_oss_env_core.createEnv)({
27
+ server: {
28
+ ENVIRONMENT: zod.z.enum(environmentValues).default(Environment.Sandbox),
29
+ ENABLE_MSW: zod.z.coerce.boolean().default(false),
30
+ CI: zod.z.coerce.boolean().default(false)
31
+ },
32
+ client: {},
33
+ clientPrefix: "",
34
+ runtimeEnv: {
35
+ ENVIRONMENT: process.env.ENVIRONMENT,
36
+ ENABLE_MSW: process.env.ENABLE_MSW,
37
+ CI: process.env.CI
38
+ },
39
+ onValidationError: (error) => {
40
+ console.error("❌ Invalid environment variables:", error);
41
+ throw new Error("Invalid environment variables");
42
+ },
43
+ skipValidation: process.env.SKIP_ENV_VALIDATION === "true"
44
+ });
45
+
46
+ //#endregion
47
+ //#region src/config/app.ts
48
+ /**
49
+ * SIWE default configuration.
50
+ */
51
+ const SIWE_CHAIN_ID = 0;
52
+ const SIWE_VERSION = "1";
53
+ const createLoginSiweMessage = (address, nonce) => {
54
+ return (0, viem_siwe.createSiweMessage)({
55
+ address,
56
+ chainId: SIWE_CHAIN_ID,
57
+ nonce,
58
+ domain: "otim.com",
59
+ uri: "https://app.otim.com",
60
+ statement: `Welcome to Otim! By signing in, you accept the Otim Terms and Conditions (https://otim.com/tac). This request will not trigger a blockchain transaction or cost any gas fees.`,
61
+ version: SIWE_VERSION
62
+ });
63
+ };
64
+
65
+ //#endregion
66
+ Object.defineProperty(exports, 'Environment', {
67
+ enumerable: true,
68
+ get: function () {
69
+ return Environment;
70
+ }
71
+ });
72
+ Object.defineProperty(exports, 'SIWE_CHAIN_ID', {
73
+ enumerable: true,
74
+ get: function () {
75
+ return SIWE_CHAIN_ID;
76
+ }
77
+ });
78
+ Object.defineProperty(exports, 'SIWE_VERSION', {
79
+ enumerable: true,
80
+ get: function () {
81
+ return SIWE_VERSION;
82
+ }
83
+ });
84
+ Object.defineProperty(exports, 'createLoginSiweMessage', {
85
+ enumerable: true,
86
+ get: function () {
87
+ return createLoginSiweMessage;
88
+ }
89
+ });
90
+ Object.defineProperty(exports, 'env', {
91
+ enumerable: true,
92
+ get: function () {
93
+ return env;
94
+ }
95
+ });
96
+ Object.defineProperty(exports, 'getApiUrl', {
97
+ enumerable: true,
98
+ get: function () {
99
+ return getApiUrl;
100
+ }
101
+ });
102
+ Object.defineProperty(exports, 'getTurnkeyApiUrl', {
103
+ enumerable: true,
104
+ get: function () {
105
+ return getTurnkeyApiUrl;
106
+ }
107
+ });
108
+ Object.defineProperty(exports, 'isEnvironment', {
109
+ enumerable: true,
110
+ get: function () {
111
+ return isEnvironment;
112
+ }
113
+ });
114
+ //# sourceMappingURL=config-CjGpscVk.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config-CjGpscVk.cjs","names":["API_URLS: Record<Environment, string>","TURNKEY_API_URLS: Record<Environment, string>","z"],"sources":["../src/config/env.ts","../src/config/app.ts"],"sourcesContent":["import { createEnv } from \"@t3-oss/env-core\";\nimport { z } from \"zod\";\n\nexport const Environment = {\n Sandbox: \"sandbox\",\n Production: \"production\",\n} as const;\nexport type Environment = (typeof Environment)[keyof typeof Environment];\n\nexport const isEnvironment = (value: string): value is Environment =>\n Object.values(Environment).includes(value as Environment);\n\nexport const environmentValues = Object.values(Environment) as [\n Environment,\n ...Environment[],\n];\n\nexport const API_URLS: Record<Environment, string> = {\n [Environment.Sandbox]: \"https://dev-cwnvii2d-api.otim.dev\",\n [Environment.Production]: \"https://api.otim.com\",\n};\n\nexport const TURNKEY_API_URLS: Record<Environment, string> = {\n [Environment.Sandbox]: \"https://api.turnkey.com\",\n [Environment.Production]: \"https://api.turnkey.com\",\n};\n\nexport const getApiUrl = (environment: Environment): string => {\n return API_URLS[environment];\n};\n\nexport const getTurnkeyApiUrl = (environment: Environment): string => {\n return TURNKEY_API_URLS[environment];\n};\n\nexport const env = createEnv({\n server: {\n ENVIRONMENT: z.enum(environmentValues).default(Environment.Sandbox),\n\n ENABLE_MSW: z.coerce.boolean().default(false),\n\n CI: z.coerce.boolean().default(false),\n },\n\n client: {},\n\n clientPrefix: \"\",\n\n runtimeEnv: {\n ENVIRONMENT: process.env.ENVIRONMENT,\n\n ENABLE_MSW: process.env.ENABLE_MSW,\n\n CI: process.env.CI,\n },\n\n onValidationError: (error) => {\n // eslint-disable-next-line no-console\n console.error(\"❌ Invalid environment variables:\", error);\n throw new Error(\"Invalid environment variables\");\n },\n\n // skip validation of environment variables (should be false in most cases)\n skipValidation: process.env.SKIP_ENV_VALIDATION === \"true\",\n});\n","import type { Address } from \"viem\";\n\nimport { createSiweMessage } from \"viem/siwe\";\n\n/**\n * SIWE default configuration.\n */\nexport const SIWE_CHAIN_ID = 0;\nexport const SIWE_VERSION = \"1\";\n\nexport const createLoginSiweMessage = (\n address: Address,\n nonce: string,\n): string => {\n return createSiweMessage({\n address,\n chainId: SIWE_CHAIN_ID,\n nonce,\n domain: \"otim.com\",\n uri: \"https://app.otim.com\",\n statement: `Welcome to Otim! By signing in, you accept the Otim Terms and Conditions (https://otim.com/tac). This request will not trigger a blockchain transaction or cost any gas fees.`,\n version: SIWE_VERSION,\n });\n};\n"],"mappings":";;;;;AAGA,MAAa,cAAc;CACzB,SAAS;CACT,YAAY;CACb;AAGD,MAAa,iBAAiB,UAC5B,OAAO,OAAO,YAAY,CAAC,SAAS,MAAqB;AAE3D,MAAa,oBAAoB,OAAO,OAAO,YAAY;AAK3D,MAAaA,WAAwC;EAClD,YAAY,UAAU;EACtB,YAAY,aAAa;CAC3B;AAED,MAAaC,mBAAgD;EAC1D,YAAY,UAAU;EACtB,YAAY,aAAa;CAC3B;AAED,MAAa,aAAa,gBAAqC;AAC7D,QAAO,SAAS;;AAGlB,MAAa,oBAAoB,gBAAqC;AACpE,QAAO,iBAAiB;;AAG1B,MAAa,uCAAgB;CAC3B,QAAQ;EACN,aAAaC,MAAE,KAAK,kBAAkB,CAAC,QAAQ,YAAY,QAAQ;EAEnE,YAAYA,MAAE,OAAO,SAAS,CAAC,QAAQ,MAAM;EAE7C,IAAIA,MAAE,OAAO,SAAS,CAAC,QAAQ,MAAM;EACtC;CAED,QAAQ,EAAE;CAEV,cAAc;CAEd,YAAY;EACV,aAAa,QAAQ,IAAI;EAEzB,YAAY,QAAQ,IAAI;EAExB,IAAI,QAAQ,IAAI;EACjB;CAED,oBAAoB,UAAU;AAE5B,UAAQ,MAAM,oCAAoC,MAAM;AACxD,QAAM,IAAI,MAAM,gCAAgC;;CAIlD,gBAAgB,QAAQ,IAAI,wBAAwB;CACrD,CAAC;;;;;;;ACzDF,MAAa,gBAAgB;AAC7B,MAAa,eAAe;AAE5B,MAAa,0BACX,SACA,UACW;AACX,yCAAyB;EACvB;EACA,SAAS;EACT;EACA,QAAQ;EACR,KAAK;EACL,WAAW;EACX,SAAS;EACV,CAAC"}
@@ -0,0 +1,5 @@
1
+ const require_context = require('../context-B-Wcmhb3.cjs');
2
+
3
+ exports.assertRequiresAuth = require_context.assertRequiresAuth;
4
+ exports.assertServerContext = require_context.assertServerContext;
5
+ exports.isServerContext = require_context.isServerContext;
@@ -0,0 +1,2 @@
1
+ import { a as OtimReactClientContext, i as OtimClientContext, n as assertRequiresAuth, o as OtimServerClientContext, r as assertServerContext, t as isServerContext } from "../index-C1HSAemv.cjs";
2
+ export { OtimClientContext, OtimReactClientContext, OtimServerClientContext, assertRequiresAuth, assertServerContext, isServerContext };
@@ -0,0 +1,2 @@
1
+ import { a as OtimReactClientContext, i as OtimClientContext, n as assertRequiresAuth, o as OtimServerClientContext, r as assertServerContext, t as isServerContext } from "../index-CcCMIBgF.mjs";
2
+ export { OtimClientContext, OtimReactClientContext, OtimServerClientContext, assertRequiresAuth, assertServerContext, isServerContext };
@@ -0,0 +1,3 @@
1
+ import { n as assertRequiresAuth, r as assertServerContext, t as isServerContext } from "../context-uTye69B0.mjs";
2
+
3
+ export { assertRequiresAuth, assertServerContext, isServerContext };
@@ -0,0 +1,38 @@
1
+
2
+ //#region src/context/asserts.ts
3
+ function isServerContext$1(context) {
4
+ return "usesApiKeyAuth" in context;
5
+ }
6
+ function assertRequiresAuth(context) {
7
+ if (isServerContext$1(context) && context.usesApiKeyAuth) throw new Error("Method not allowed. Api key authentication does not require user login.");
8
+ }
9
+ function assertServerContext(context) {
10
+ if (!isServerContext$1(context)) throw new Error("Method only supported in server context");
11
+ }
12
+
13
+ //#endregion
14
+ //#region src/context/helpers.ts
15
+ const isServerContext = (context) => {
16
+ return "usesApiKeyAuth" in context;
17
+ };
18
+
19
+ //#endregion
20
+ Object.defineProperty(exports, 'assertRequiresAuth', {
21
+ enumerable: true,
22
+ get: function () {
23
+ return assertRequiresAuth;
24
+ }
25
+ });
26
+ Object.defineProperty(exports, 'assertServerContext', {
27
+ enumerable: true,
28
+ get: function () {
29
+ return assertServerContext;
30
+ }
31
+ });
32
+ Object.defineProperty(exports, 'isServerContext', {
33
+ enumerable: true,
34
+ get: function () {
35
+ return isServerContext;
36
+ }
37
+ });
38
+ //# sourceMappingURL=context-B-Wcmhb3.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-B-Wcmhb3.cjs","names":["isServerContext"],"sources":["../src/context/asserts.ts","../src/context/helpers.ts"],"sourcesContent":["import type { OtimClientContext, OtimServerClientContext } from \"./types\";\n\nfunction isServerContext(\n context: OtimClientContext,\n): context is OtimServerClientContext {\n return \"usesApiKeyAuth\" in context;\n}\n\nexport function assertRequiresAuth(context: OtimClientContext): void {\n if (isServerContext(context) && context.usesApiKeyAuth) {\n throw new Error(\n \"Method not allowed. Api key authentication does not require user login.\",\n );\n }\n}\n\nexport function assertServerContext(\n context: OtimClientContext,\n): asserts context is OtimServerClientContext {\n if (!isServerContext(context)) {\n throw new Error(\"Method only supported in server context\");\n }\n}\n","import type { OtimClientContext, OtimServerClientContext } from \"./types\";\n\nexport const isServerContext = (\n context: OtimClientContext,\n): context is OtimServerClientContext => {\n return \"usesApiKeyAuth\" in context;\n};\n"],"mappings":";;AAEA,SAASA,kBACP,SACoC;AACpC,QAAO,oBAAoB;;AAG7B,SAAgB,mBAAmB,SAAkC;AACnE,KAAIA,kBAAgB,QAAQ,IAAI,QAAQ,eACtC,OAAM,IAAI,MACR,0EACD;;AAIL,SAAgB,oBACd,SAC4C;AAC5C,KAAI,CAACA,kBAAgB,QAAQ,CAC3B,OAAM,IAAI,MAAM,0CAA0C;;;;;AClB9D,MAAa,mBACX,YACuC;AACvC,QAAO,oBAAoB"}
@@ -0,0 +1,20 @@
1
+ //#region src/context/asserts.ts
2
+ function isServerContext$1(context) {
3
+ return "usesApiKeyAuth" in context;
4
+ }
5
+ function assertRequiresAuth(context) {
6
+ if (isServerContext$1(context) && context.usesApiKeyAuth) throw new Error("Method not allowed. Api key authentication does not require user login.");
7
+ }
8
+ function assertServerContext(context) {
9
+ if (!isServerContext$1(context)) throw new Error("Method only supported in server context");
10
+ }
11
+
12
+ //#endregion
13
+ //#region src/context/helpers.ts
14
+ const isServerContext = (context) => {
15
+ return "usesApiKeyAuth" in context;
16
+ };
17
+
18
+ //#endregion
19
+ export { assertRequiresAuth as n, assertServerContext as r, isServerContext as t };
20
+ //# sourceMappingURL=context-uTye69B0.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"context-uTye69B0.mjs","names":["isServerContext"],"sources":["../src/context/asserts.ts","../src/context/helpers.ts"],"sourcesContent":["import type { OtimClientContext, OtimServerClientContext } from \"./types\";\n\nfunction isServerContext(\n context: OtimClientContext,\n): context is OtimServerClientContext {\n return \"usesApiKeyAuth\" in context;\n}\n\nexport function assertRequiresAuth(context: OtimClientContext): void {\n if (isServerContext(context) && context.usesApiKeyAuth) {\n throw new Error(\n \"Method not allowed. Api key authentication does not require user login.\",\n );\n }\n}\n\nexport function assertServerContext(\n context: OtimClientContext,\n): asserts context is OtimServerClientContext {\n if (!isServerContext(context)) {\n throw new Error(\"Method only supported in server context\");\n }\n}\n","import type { OtimClientContext, OtimServerClientContext } from \"./types\";\n\nexport const isServerContext = (\n context: OtimClientContext,\n): context is OtimServerClientContext => {\n return \"usesApiKeyAuth\" in context;\n};\n"],"mappings":";AAEA,SAASA,kBACP,SACoC;AACpC,QAAO,oBAAoB;;AAG7B,SAAgB,mBAAmB,SAAkC;AACnE,KAAIA,kBAAgB,QAAQ,IAAI,QAAQ,eACtC,OAAM,IAAI,MACR,0EACD;;AAIL,SAAgB,oBACd,SAC4C;AAC5C,KAAI,CAACA,kBAAgB,QAAQ,CAC3B,OAAM,IAAI,MAAM,0CAA0C;;;;;AClB9D,MAAa,mBACX,YACuC;AACvC,QAAO,oBAAoB"}
@@ -0,0 +1,54 @@
1
+ import { t as Hex } from "./misc-CX4pLJaA.mjs";
2
+ import { Environment } from "@otim/sdk-core/config";
3
+ import { OtimServerClientContext } from "@otim/sdk-core/context";
4
+
5
+ //#region src/account/types.d.ts
6
+ declare const ServerAccountType: {
7
+ readonly PrivateKey: "privateKey";
8
+ readonly Api: "api";
9
+ };
10
+ type ServerAccountType = (typeof ServerAccountType)[keyof typeof ServerAccountType];
11
+ declare const AccountType: {
12
+ readonly PrivateKey: "privateKey";
13
+ readonly Api: "api";
14
+ };
15
+ type AccountType = (typeof AccountType)[keyof typeof AccountType];
16
+ /**
17
+ * Otim Account
18
+ */
19
+ type OtimAccountSignMessageArgs = {
20
+ message: string | {
21
+ raw: Hex | Uint8Array;
22
+ };
23
+ };
24
+ interface OtimAccount {
25
+ initialize(): Promise<void>;
26
+ signMessage(args: OtimAccountSignMessageArgs): Promise<Hex>;
27
+ }
28
+ /**
29
+ * Account Config
30
+ */
31
+ interface BaseAccountConfig {
32
+ environment?: Environment;
33
+ }
34
+ interface ApiAccountConfig extends BaseAccountConfig {
35
+ type: typeof ServerAccountType.Api;
36
+ appId: string;
37
+ privateKey: string;
38
+ publicKey: string;
39
+ apiKey?: string;
40
+ }
41
+ interface PrivateKeyAccountConfig extends BaseAccountConfig {
42
+ type: typeof ServerAccountType.PrivateKey;
43
+ privateKey: `0x${string}`;
44
+ }
45
+ type ServerAccountConfig = ApiAccountConfig | PrivateKeyAccountConfig;
46
+ type AccountConfig = ServerAccountConfig;
47
+ //#endregion
48
+ //#region src/account/helpers.d.ts
49
+ declare function isApiAccountConfig(config: ServerAccountConfig): config is ApiAccountConfig;
50
+ declare function isPrivateKeyAccountConfig(config: ServerAccountConfig): config is PrivateKeyAccountConfig;
51
+ declare function createClientContext(config: ServerAccountConfig): OtimServerClientContext;
52
+ //#endregion
53
+ export { AccountType as a, OtimAccountSignMessageArgs as c, ServerAccountType as d, AccountConfig as i, PrivateKeyAccountConfig as l, isApiAccountConfig as n, ApiAccountConfig as o, isPrivateKeyAccountConfig as r, OtimAccount as s, createClientContext as t, ServerAccountConfig as u };
54
+ //# sourceMappingURL=index-B4fkcFy5.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-B4fkcFy5.d.mts","names":[],"sources":["../src/account/types.ts","../src/account/helpers.ts"],"sourcesContent":[],"mappings":";;;;;cAGa;;;AAAb,CAAA;AAIY,KAAA,iBAAA,GAAiB,CAAA,OACnB,iBAAgC,CAAA,CAAA,MAAA,OAAA,iBAAiB,CAAA;AAE9C,cAAA,WAEH,EAAA;EACE,SAAA,UAAW,EAAA,YAAW;EAMtB,SAAA,GAAA,EAAA,KAAA;AAIZ,CAAA;AACgB,KAXJ,WAAA,GAWI,CAAA,OAXkB,WAWlB,CAAA,CAAA,MAAA,OAX4C,WAW5C,CAAA;;;;AACwC,KAN5C,0BAAA,GAM4C;EAO9C,OAAA,EAAA,MAAA,GAAA;IAIO,GAAA,EAhBU,GAgBV,GAhBgB,UAgBC;EAQjB,CAAA;AAKjB,CAAA;AAEY,UA5BK,WAAA,CA4BQ;gBA3BT;oBACI,6BAA6B,QAAQ;;AChBzD;AAMA;AAMA;UDWU,iBAAA;gBACM;;UAGC,gBAAA,SAAyB;eAC3B,iBAAA,CAAkB;;;;;;UAOhB,uBAAA,SAAgC;eAClC,iBAAA,CAAkB;;;KAIrB,mBAAA,GAAsB,mBAAmB;KAEzC,aAAA,GAAgB;;;iBC1CZ,kBAAA,SACN,gCACG;iBAIG,yBAAA,SACN,gCACG;iBAIG,mBAAA,SACN,sBACP"}
@@ -0,0 +1,25 @@
1
+ import { t as Address$1 } from "./abi-CQuxrNCU.cjs";
2
+ import { n as Signature, r as ExactPartial } from "./misc-CpZxSPCP.cjs";
3
+ import { EIP2098Signature, VRS } from "@otim/utils/schemas";
4
+
5
+ //#region ../../node_modules/.pnpm/viem@2.39.3_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.1.12/node_modules/viem/_types/types/authorization.d.ts
6
+ type Authorization<uint32 = number, signed extends boolean = false> = {
7
+ /** Address of the contract to delegate to. */
8
+ address: Address$1;
9
+ /** Chain ID. */
10
+ chainId: uint32;
11
+ /** Nonce of the EOA to delegate to. */
12
+ nonce: uint32;
13
+ } & (signed extends true ? Signature<uint32> : ExactPartial<Signature<uint32>>);
14
+ //#endregion
15
+ //#region src/utils/rlp.d.ts
16
+ declare const normalizeYParityValue: (value: number | bigint | string | undefined | null) => 0 | 1;
17
+ declare function createRlpEncodedAuthorization(authorization: Authorization): `0x${string}`;
18
+ declare function createRlpEncodedAuthorization(chainId: number, delegateAddress: string, nonce: number, yParity: number | bigint, r: `0x${string}`, s: `0x${string}`): `0x${string}`;
19
+ //#endregion
20
+ //#region src/utils/vrs.d.ts
21
+ declare const createEIP2098Signature: (vrs: VRS) => EIP2098Signature;
22
+ declare const parseSignatureToVRS: (signature: string) => VRS;
23
+ //#endregion
24
+ export { normalizeYParityValue as i, parseSignatureToVRS as n, createRlpEncodedAuthorization as r, createEIP2098Signature as t };
25
+ //# sourceMappingURL=index-BnP8vpJJ.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-BnP8vpJJ.d.cts","names":["Address","Hex","Signature","ExactPartial","OneOf","Authorization","uint32","signed","AuthorizationList","AuthorizationRequest","SignedAuthorization","SignedAuthorizationList","SerializedAuthorization","SerializedAuthorizationList"],"sources":["../../../node_modules/.pnpm/viem@2.39.3_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.1.12/node_modules/viem/_types/types/authorization.d.ts","../src/utils/rlp.ts","../src/utils/vrs.ts"],"sourcesContent":["import type { Address } from 'abitype';\nimport type { Hex, Signature } from './misc.js';\nimport type { ExactPartial, OneOf } from './utils.js';\nexport type Authorization<uint32 = number, signed extends boolean = false> = {\n /** Address of the contract to delegate to. */\n address: Address;\n /** Chain ID. */\n chainId: uint32;\n /** Nonce of the EOA to delegate to. */\n nonce: uint32;\n} & (signed extends true ? Signature<uint32> : ExactPartial<Signature<uint32>>);\nexport type AuthorizationList<uint32 = number, signed extends boolean = false> = readonly Authorization<uint32, signed>[];\nexport type AuthorizationRequest<uint32 = number> = OneOf<{\n /** Address of the contract to delegate to. */\n address: Address;\n} | {\n /**\n * Address of the contract to delegate to.\n * @alias `address`\n */\n contractAddress: Address;\n}> & {\n /** Chain ID. */\n chainId: uint32;\n /** Nonce of the EOA to delegate to. */\n nonce: uint32;\n};\nexport type SignedAuthorization<uint32 = number> = Authorization<uint32, true>;\nexport type SignedAuthorizationList<uint32 = number> = readonly SignedAuthorization<uint32>[];\nexport type SerializedAuthorization = readonly [\n chainId: Hex,\n address: Hex,\n nonce: Hex,\n yParity: Hex,\n r: Hex,\n s: Hex\n];\nexport type SerializedAuthorizationList = readonly SerializedAuthorization[];\n//# sourceMappingURL=authorization.d.ts.map"],"x_google_ignoreList":[0],"mappings":";;;;;KAGYK;;EAAAA,OAAAA,EAECL,SAFY;EAEZA;EAEAM,OAAAA,EAAAA,MAAAA;EAEFA;EACNC,KAAAA,EADMD,MACNC;CAAgCD,GAAAA,CAAhCC,MAAgCD,SAAAA,IAAAA,GAAVJ,SAAUI,CAAAA,MAAAA,CAAAA,GAAUH,YAAVG,CAAuBJ,SAAvBI,CAAiCA,MAAjCA,CAAAA,CAAAA,CAAAA;;;cCaxB;iBAkCG,6BAAA,gBACC;iBAED,6BAAA;;;cCrBH,8BAA+B,QAAM;cAkBrC,4CAA2C"}
@@ -0,0 +1,20 @@
1
+ import { ServerAccountConfig, ServerAccountType } from "@otim/sdk-core/account";
2
+
3
+ //#region src/context/types.d.ts
4
+ interface OtimServerClientContext {
5
+ readonly usesApiKeyAuth: boolean;
6
+ readonly config: ServerAccountConfig;
7
+ readonly accountType: ServerAccountType;
8
+ }
9
+ interface OtimReactClientContext {}
10
+ type OtimClientContext = OtimServerClientContext | OtimReactClientContext;
11
+ //#endregion
12
+ //#region src/context/asserts.d.ts
13
+ declare function assertRequiresAuth(context: OtimClientContext): void;
14
+ declare function assertServerContext(context: OtimClientContext): asserts context is OtimServerClientContext;
15
+ //#endregion
16
+ //#region src/context/helpers.d.ts
17
+ declare const isServerContext: (context: OtimClientContext) => context is OtimServerClientContext;
18
+ //#endregion
19
+ export { OtimReactClientContext as a, OtimClientContext as i, assertRequiresAuth as n, OtimServerClientContext as o, assertServerContext as r, isServerContext as t };
20
+ //# sourceMappingURL=index-C1HSAemv.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C1HSAemv.d.cts","names":[],"sources":["../src/context/types.ts","../src/context/asserts.ts","../src/context/helpers.ts"],"sourcesContent":[],"mappings":";;;UAKiB,uBAAA;;EAAA,SAAA,MAAA,EAEE,mBAFqB;EAMvB,SAAA,WAAA,EAHO,iBAGe;AAEvC;UAFiB,sBAAA;KAEL,iBAAA,GACR,0BACA;;;iBCPY,kBAAA,UAA4B;iBAQ5B,mBAAA,UACL,uCACW;;;cChBT,2BACF,iCACG"}
@@ -0,0 +1,27 @@
1
+ import { t as Address } from "./abi-Bd3X6gV9.mjs";
2
+
3
+ //#region src/config/env.d.ts
4
+ declare const Environment: {
5
+ readonly Sandbox: "sandbox";
6
+ readonly Production: "production";
7
+ };
8
+ type Environment = (typeof Environment)[keyof typeof Environment];
9
+ declare const isEnvironment: (value: string) => value is Environment;
10
+ declare const getApiUrl: (environment: Environment) => string;
11
+ declare const getTurnkeyApiUrl: (environment: Environment) => string;
12
+ declare const env: Readonly<{
13
+ ENVIRONMENT: "sandbox" | "production";
14
+ ENABLE_MSW: boolean;
15
+ CI: boolean;
16
+ }>;
17
+ //#endregion
18
+ //#region src/config/app.d.ts
19
+ /**
20
+ * SIWE default configuration.
21
+ */
22
+ declare const SIWE_CHAIN_ID = 0;
23
+ declare const SIWE_VERSION = "1";
24
+ declare const createLoginSiweMessage: (address: Address, nonce: string) => string;
25
+ //#endregion
26
+ export { env as a, isEnvironment as c, Environment as i, SIWE_VERSION as n, getApiUrl as o, createLoginSiweMessage as r, getTurnkeyApiUrl as s, SIWE_CHAIN_ID as t };
27
+ //# sourceMappingURL=index-C4N2Xixk.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-C4N2Xixk.d.mts","names":[],"sources":["../src/config/env.ts","../src/config/app.ts"],"sourcesContent":[],"mappings":";;;cAGa;;;AAAb,CAAA;AAIY,KAAA,WAAA,GAAW,CAAA,OAAW,WAA0B,CAAA,CAAA,MAAA,OAAA,WAAW,CAAA;AAE1D,cAAA,aAA0C,EAAA,CAAA,KAAA,EACI,MAAA,EAAA,GAAA,KAAA,IADJ,WACI;cAiB9C,yBAA0B;cAI1B,gCAAiC;cAIjC,KAAG;EC5BH,WAAA,EAAA,SAAa,GAAA,YAAA;EACb,UAAA,EAAA,OAAY;EAEZ,EAAA,EAAA,OAAA;;;;;;ADPb;AAIY,cCAC,aAAA,GDAqB,CAAA;AAErB,cCDA,YAAA,GDC0C,GAAA;AAkB1C,cCjBA,sBDiBqC,EAAA,CAAA,OAAA,EChBvC,ODgBuC,EAAA,KAAA,EAAA,MAAA,EAAA,GAAA,MAAA"}
@@ -0,0 +1,20 @@
1
+ import { ServerAccountConfig, ServerAccountType } from "@otim/sdk-core/account";
2
+
3
+ //#region src/context/types.d.ts
4
+ interface OtimServerClientContext {
5
+ readonly usesApiKeyAuth: boolean;
6
+ readonly config: ServerAccountConfig;
7
+ readonly accountType: ServerAccountType;
8
+ }
9
+ interface OtimReactClientContext {}
10
+ type OtimClientContext = OtimServerClientContext | OtimReactClientContext;
11
+ //#endregion
12
+ //#region src/context/asserts.d.ts
13
+ declare function assertRequiresAuth(context: OtimClientContext): void;
14
+ declare function assertServerContext(context: OtimClientContext): asserts context is OtimServerClientContext;
15
+ //#endregion
16
+ //#region src/context/helpers.d.ts
17
+ declare const isServerContext: (context: OtimClientContext) => context is OtimServerClientContext;
18
+ //#endregion
19
+ export { OtimReactClientContext as a, OtimClientContext as i, assertRequiresAuth as n, OtimServerClientContext as o, assertServerContext as r, isServerContext as t };
20
+ //# sourceMappingURL=index-CcCMIBgF.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-CcCMIBgF.d.mts","names":[],"sources":["../src/context/types.ts","../src/context/asserts.ts","../src/context/helpers.ts"],"sourcesContent":[],"mappings":";;;UAKiB,uBAAA;;EAAA,SAAA,MAAA,EAEE,mBAFqB;EAMvB,SAAA,WAAA,EAHO,iBAGe;AAEvC;UAFiB,sBAAA;KAEL,iBAAA,GACR,0BACA;;;iBCPY,kBAAA,UAA4B;iBAQ5B,mBAAA,UACL,uCACW;;;cChBT,2BACF,iCACG"}
@@ -0,0 +1,54 @@
1
+ import { t as Hex } from "./misc-CpZxSPCP.cjs";
2
+ import { Environment } from "@otim/sdk-core/config";
3
+ import { OtimServerClientContext } from "@otim/sdk-core/context";
4
+
5
+ //#region src/account/types.d.ts
6
+ declare const ServerAccountType: {
7
+ readonly PrivateKey: "privateKey";
8
+ readonly Api: "api";
9
+ };
10
+ type ServerAccountType = (typeof ServerAccountType)[keyof typeof ServerAccountType];
11
+ declare const AccountType: {
12
+ readonly PrivateKey: "privateKey";
13
+ readonly Api: "api";
14
+ };
15
+ type AccountType = (typeof AccountType)[keyof typeof AccountType];
16
+ /**
17
+ * Otim Account
18
+ */
19
+ type OtimAccountSignMessageArgs = {
20
+ message: string | {
21
+ raw: Hex | Uint8Array;
22
+ };
23
+ };
24
+ interface OtimAccount {
25
+ initialize(): Promise<void>;
26
+ signMessage(args: OtimAccountSignMessageArgs): Promise<Hex>;
27
+ }
28
+ /**
29
+ * Account Config
30
+ */
31
+ interface BaseAccountConfig {
32
+ environment?: Environment;
33
+ }
34
+ interface ApiAccountConfig extends BaseAccountConfig {
35
+ type: typeof ServerAccountType.Api;
36
+ appId: string;
37
+ privateKey: string;
38
+ publicKey: string;
39
+ apiKey?: string;
40
+ }
41
+ interface PrivateKeyAccountConfig extends BaseAccountConfig {
42
+ type: typeof ServerAccountType.PrivateKey;
43
+ privateKey: `0x${string}`;
44
+ }
45
+ type ServerAccountConfig = ApiAccountConfig | PrivateKeyAccountConfig;
46
+ type AccountConfig = ServerAccountConfig;
47
+ //#endregion
48
+ //#region src/account/helpers.d.ts
49
+ declare function isApiAccountConfig(config: ServerAccountConfig): config is ApiAccountConfig;
50
+ declare function isPrivateKeyAccountConfig(config: ServerAccountConfig): config is PrivateKeyAccountConfig;
51
+ declare function createClientContext(config: ServerAccountConfig): OtimServerClientContext;
52
+ //#endregion
53
+ export { AccountType as a, OtimAccountSignMessageArgs as c, ServerAccountType as d, AccountConfig as i, PrivateKeyAccountConfig as l, isApiAccountConfig as n, ApiAccountConfig as o, isPrivateKeyAccountConfig as r, OtimAccount as s, createClientContext as t, ServerAccountConfig as u };
54
+ //# sourceMappingURL=index-DK-40z4V.d.cts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-DK-40z4V.d.cts","names":[],"sources":["../src/account/types.ts","../src/account/helpers.ts"],"sourcesContent":[],"mappings":";;;;;cAGa;;;AAAb,CAAA;AAIY,KAAA,iBAAA,GAAiB,CAAA,OACnB,iBAAgC,CAAA,CAAA,MAAA,OAAA,iBAAiB,CAAA;AAE9C,cAAA,WAEH,EAAA;EACE,SAAA,UAAW,EAAA,YAAW;EAMtB,SAAA,GAAA,EAAA,KAAA;AAIZ,CAAA;AACgB,KAXJ,WAAA,GAWI,CAAA,OAXkB,WAWlB,CAAA,CAAA,MAAA,OAX4C,WAW5C,CAAA;;;;AACwC,KAN5C,0BAAA,GAM4C;EAO9C,OAAA,EAAA,MAAA,GAAA;IAIO,GAAA,EAhBU,GAgBV,GAhBgB,UAgBC;EAQjB,CAAA;AAKjB,CAAA;AAEY,UA5BK,WAAA,CA4BQ;gBA3BT;oBACI,6BAA6B,QAAQ;;AChBzD;AAMA;AAMA;UDWU,iBAAA;gBACM;;UAGC,gBAAA,SAAyB;eAC3B,iBAAA,CAAkB;;;;;;UAOhB,uBAAA,SAAgC;eAClC,iBAAA,CAAkB;;;KAIrB,mBAAA,GAAsB,mBAAmB;KAEzC,aAAA,GAAgB;;;iBC1CZ,kBAAA,SACN,gCACG;iBAIG,yBAAA,SACN,gCACG;iBAIG,mBAAA,SACN,sBACP"}
@@ -0,0 +1,25 @@
1
+ import { t as Address$1 } from "./abi-Bd3X6gV9.mjs";
2
+ import { n as Signature, r as ExactPartial } from "./misc-CX4pLJaA.mjs";
3
+ import { EIP2098Signature, VRS } from "@otim/utils/schemas";
4
+
5
+ //#region ../../node_modules/.pnpm/viem@2.39.3_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.1.12/node_modules/viem/_types/types/authorization.d.ts
6
+ type Authorization<uint32 = number, signed extends boolean = false> = {
7
+ /** Address of the contract to delegate to. */
8
+ address: Address$1;
9
+ /** Chain ID. */
10
+ chainId: uint32;
11
+ /** Nonce of the EOA to delegate to. */
12
+ nonce: uint32;
13
+ } & (signed extends true ? Signature<uint32> : ExactPartial<Signature<uint32>>);
14
+ //#endregion
15
+ //#region src/utils/rlp.d.ts
16
+ declare const normalizeYParityValue: (value: number | bigint | string | undefined | null) => 0 | 1;
17
+ declare function createRlpEncodedAuthorization(authorization: Authorization): `0x${string}`;
18
+ declare function createRlpEncodedAuthorization(chainId: number, delegateAddress: string, nonce: number, yParity: number | bigint, r: `0x${string}`, s: `0x${string}`): `0x${string}`;
19
+ //#endregion
20
+ //#region src/utils/vrs.d.ts
21
+ declare const createEIP2098Signature: (vrs: VRS) => EIP2098Signature;
22
+ declare const parseSignatureToVRS: (signature: string) => VRS;
23
+ //#endregion
24
+ export { normalizeYParityValue as i, parseSignatureToVRS as n, createRlpEncodedAuthorization as r, createEIP2098Signature as t };
25
+ //# sourceMappingURL=index-DW_zBRKz.d.mts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index-DW_zBRKz.d.mts","names":["Address","Hex","Signature","ExactPartial","OneOf","Authorization","uint32","signed","AuthorizationList","AuthorizationRequest","SignedAuthorization","SignedAuthorizationList","SerializedAuthorization","SerializedAuthorizationList"],"sources":["../../../node_modules/.pnpm/viem@2.39.3_bufferutil@4.0.9_typescript@5.9.3_utf-8-validate@5.0.10_zod@4.1.12/node_modules/viem/_types/types/authorization.d.ts","../src/utils/rlp.ts","../src/utils/vrs.ts"],"sourcesContent":["import type { Address } from 'abitype';\nimport type { Hex, Signature } from './misc.js';\nimport type { ExactPartial, OneOf } from './utils.js';\nexport type Authorization<uint32 = number, signed extends boolean = false> = {\n /** Address of the contract to delegate to. */\n address: Address;\n /** Chain ID. */\n chainId: uint32;\n /** Nonce of the EOA to delegate to. */\n nonce: uint32;\n} & (signed extends true ? Signature<uint32> : ExactPartial<Signature<uint32>>);\nexport type AuthorizationList<uint32 = number, signed extends boolean = false> = readonly Authorization<uint32, signed>[];\nexport type AuthorizationRequest<uint32 = number> = OneOf<{\n /** Address of the contract to delegate to. */\n address: Address;\n} | {\n /**\n * Address of the contract to delegate to.\n * @alias `address`\n */\n contractAddress: Address;\n}> & {\n /** Chain ID. */\n chainId: uint32;\n /** Nonce of the EOA to delegate to. */\n nonce: uint32;\n};\nexport type SignedAuthorization<uint32 = number> = Authorization<uint32, true>;\nexport type SignedAuthorizationList<uint32 = number> = readonly SignedAuthorization<uint32>[];\nexport type SerializedAuthorization = readonly [\n chainId: Hex,\n address: Hex,\n nonce: Hex,\n yParity: Hex,\n r: Hex,\n s: Hex\n];\nexport type SerializedAuthorizationList = readonly SerializedAuthorization[];\n//# sourceMappingURL=authorization.d.ts.map"],"x_google_ignoreList":[0],"mappings":";;;;;KAGYK;;EAAAA,OAAAA,EAECL,SAFY;EAEZA;EAEAM,OAAAA,EAAAA,MAAAA;EAEFA;EACNC,KAAAA,EADMD,MACNC;CAAgCD,GAAAA,CAAhCC,MAAgCD,SAAAA,IAAAA,GAAVJ,SAAUI,CAAAA,MAAAA,CAAAA,GAAUH,YAAVG,CAAuBJ,SAAvBI,CAAiCA,MAAjCA,CAAAA,CAAAA,CAAAA;;;cCaxB;iBAkCG,6BAAA,gBACC;iBAED,6BAAA;;;cCrBH,8BAA+B,QAAM;cAkBrC,4CAA2C"}