@otim/sdk-core 0.0.0-alpha-20251204003947
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/LICENSE +201 -0
- package/dist/.tsbuildinfo +1 -0
- package/dist/abi-DW6AS0eM.d.mts +339 -0
- package/dist/abi-DW6AS0eM.d.mts.map +1 -0
- package/dist/abi-OUq-mx1W.d.cts +339 -0
- package/dist/abi-OUq-mx1W.d.cts.map +1 -0
- package/dist/account/index.cjs +7 -0
- package/dist/account/index.d.cts +5 -0
- package/dist/account/index.d.mts +5 -0
- package/dist/account/index.mjs +3 -0
- package/dist/account-CRvC_dXT.cjs +61 -0
- package/dist/account-CRvC_dXT.cjs.map +1 -0
- package/dist/account-D1NVta26.mjs +31 -0
- package/dist/account-D1NVta26.mjs.map +1 -0
- package/dist/authorization-6anhDdQX.d.cts +210 -0
- package/dist/authorization-6anhDdQX.d.cts.map +1 -0
- package/dist/authorization-DnNpWjxB.d.mts +210 -0
- package/dist/authorization-DnNpWjxB.d.mts.map +1 -0
- package/dist/clients/index.cjs +8 -0
- package/dist/clients/index.d.cts +3 -0
- package/dist/clients/index.d.mts +3 -0
- package/dist/clients/index.mjs +3 -0
- package/dist/clients-BCyzdTLc.cjs +260 -0
- package/dist/clients-BCyzdTLc.cjs.map +1 -0
- package/dist/clients-Bn4BUElo.mjs +225 -0
- package/dist/clients-Bn4BUElo.mjs.map +1 -0
- package/dist/config/index.cjs +10 -0
- package/dist/config/index.d.cts +3 -0
- package/dist/config/index.d.mts +3 -0
- package/dist/config/index.mjs +3 -0
- package/dist/config-C_nc1DXn.mjs +67 -0
- package/dist/config-C_nc1DXn.mjs.map +1 -0
- package/dist/config-CjGpscVk.cjs +114 -0
- package/dist/config-CjGpscVk.cjs.map +1 -0
- package/dist/context/index.cjs +5 -0
- package/dist/context/index.d.cts +5 -0
- package/dist/context/index.d.mts +5 -0
- package/dist/context/index.mjs +3 -0
- package/dist/context-B-Wcmhb3.cjs +38 -0
- package/dist/context-B-Wcmhb3.cjs.map +1 -0
- package/dist/context-uTye69B0.mjs +20 -0
- package/dist/context-uTye69B0.mjs.map +1 -0
- package/dist/index-BQMXYh9N.d.cts +14 -0
- package/dist/index-BQMXYh9N.d.cts.map +1 -0
- package/dist/index-C5c51xs0.d.mts +51 -0
- package/dist/index-C5c51xs0.d.mts.map +1 -0
- package/dist/index-C8H-BPGH.d.cts +51 -0
- package/dist/index-C8H-BPGH.d.cts.map +1 -0
- package/dist/index-Ce_qYSJj.d.cts +90 -0
- package/dist/index-Ce_qYSJj.d.cts.map +1 -0
- package/dist/index-CiyyA-wd.d.mts +90 -0
- package/dist/index-CiyyA-wd.d.mts.map +1 -0
- package/dist/index-CnjY7cyS.d.mts +14 -0
- package/dist/index-CnjY7cyS.d.mts.map +1 -0
- package/dist/index-DWE1xfOE.d.mts +23 -0
- package/dist/index-DWE1xfOE.d.mts.map +1 -0
- package/dist/index-D_7CTJDl.d.mts +27 -0
- package/dist/index-D_7CTJDl.d.mts.map +1 -0
- package/dist/index-GSspyLr3.d.cts +23 -0
- package/dist/index-GSspyLr3.d.cts.map +1 -0
- package/dist/index-lW-Oor1B.d.cts +27 -0
- package/dist/index-lW-Oor1B.d.cts.map +1 -0
- package/dist/index.cjs +32 -0
- package/dist/index.d.cts +9 -0
- package/dist/index.d.mts +9 -0
- package/dist/index.mjs +7 -0
- package/dist/rpc-BDoNl1Sp.d.cts +6885 -0
- package/dist/rpc-BDoNl1Sp.d.cts.map +1 -0
- package/dist/rpc-CygBD_f7.d.mts +6885 -0
- package/dist/rpc-CygBD_f7.d.mts.map +1 -0
- package/dist/utils/index.cjs +6 -0
- package/dist/utils/index.d.cts +4 -0
- package/dist/utils/index.d.mts +4 -0
- package/dist/utils/index.mjs +3 -0
- package/dist/utils-CVQFvsfl.cjs +104 -0
- package/dist/utils-CVQFvsfl.cjs.map +1 -0
- package/dist/utils-DziAHBiz.mjs +81 -0
- package/dist/utils-DziAHBiz.mjs.map +1 -0
- package/package.json +162 -0
|
@@ -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
|
+
import "../abi-OUq-mx1W.cjs";
|
|
2
|
+
import "../rpc-BDoNl1Sp.cjs";
|
|
3
|
+
import "../authorization-6anhDdQX.cjs";
|
|
4
|
+
import { a as OtimReactClientContext, i as OtimClientContext, n as assertRequiresAuth, o as OtimServerClientContext, r as assertServerContext, t as isServerContext } from "../index-GSspyLr3.cjs";
|
|
5
|
+
export { OtimClientContext, OtimReactClientContext, OtimServerClientContext, assertRequiresAuth, assertServerContext, isServerContext };
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import "../abi-DW6AS0eM.mjs";
|
|
2
|
+
import "../rpc-CygBD_f7.mjs";
|
|
3
|
+
import "../authorization-DnNpWjxB.mjs";
|
|
4
|
+
import { a as OtimReactClientContext, i as OtimClientContext, n as assertRequiresAuth, o as OtimServerClientContext, r as assertServerContext, t as isServerContext } from "../index-DWE1xfOE.mjs";
|
|
5
|
+
export { OtimClientContext, OtimReactClientContext, OtimServerClientContext, 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,14 @@
|
|
|
1
|
+
import { t as Authorization } from "./authorization-6anhDdQX.cjs";
|
|
2
|
+
import { EIP2098Signature, VRS } from "@otim/utils/schemas";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/rlp.d.ts
|
|
5
|
+
declare const normalizeYParityValue: (value: number | bigint | string | undefined | null) => 0 | 1;
|
|
6
|
+
declare function createRlpEncodedAuthorization(authorization: Authorization): `0x${string}`;
|
|
7
|
+
declare function createRlpEncodedAuthorization(chainId: number, delegateAddress: string, nonce: number, yParity: number | bigint, r: `0x${string}`, s: `0x${string}`): `0x${string}`;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/utils/vrs.d.ts
|
|
10
|
+
declare const createEIP2098Signature: (vrs: VRS) => EIP2098Signature;
|
|
11
|
+
declare const parseSignatureToVRS: (signature: string) => VRS;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { normalizeYParityValue as i, parseSignatureToVRS as n, createRlpEncodedAuthorization as r, createEIP2098Signature as t };
|
|
14
|
+
//# sourceMappingURL=index-BQMXYh9N.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-BQMXYh9N.d.cts","names":[],"sources":["../src/utils/rlp.ts","../src/utils/vrs.ts"],"sourcesContent":[],"mappings":";;;;cAuBa;iBAkCG,6BAAA,gBACC;iBAED,6BAAA;;;cCrBH,8BAA+B,QAAM;cAkBrC,4CAA2C"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { t as Chain } from "./rpc-CygBD_f7.mjs";
|
|
2
|
+
import { c as Hex } from "./authorization-DnNpWjxB.mjs";
|
|
3
|
+
import { Environment } from "@otim/sdk-core/config";
|
|
4
|
+
import { OtimServerClientContext } from "@otim/sdk-core/context";
|
|
5
|
+
|
|
6
|
+
//#region src/account/types.d.ts
|
|
7
|
+
declare const ServerAccountType: {
|
|
8
|
+
readonly PrivateKey: "privateKey";
|
|
9
|
+
readonly Api: "api";
|
|
10
|
+
};
|
|
11
|
+
type ServerAccountType = (typeof ServerAccountType)[keyof typeof ServerAccountType];
|
|
12
|
+
declare const AccountType: {
|
|
13
|
+
readonly PrivateKey: "privateKey";
|
|
14
|
+
readonly Api: "api";
|
|
15
|
+
};
|
|
16
|
+
type AccountType = (typeof AccountType)[keyof typeof AccountType];
|
|
17
|
+
type OtimAccountSignMessageArgs = {
|
|
18
|
+
message: string | {
|
|
19
|
+
raw: Hex | Uint8Array;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
interface OtimAccount {
|
|
23
|
+
initialize(): Promise<void>;
|
|
24
|
+
signMessage(args: OtimAccountSignMessageArgs): Promise<Hex>;
|
|
25
|
+
}
|
|
26
|
+
interface BaseAccountConfig {
|
|
27
|
+
environment?: Environment;
|
|
28
|
+
chains: Chain[];
|
|
29
|
+
defaultChain?: Chain;
|
|
30
|
+
}
|
|
31
|
+
interface ApiAccountConfig extends BaseAccountConfig {
|
|
32
|
+
type: typeof ServerAccountType.Api;
|
|
33
|
+
appId: string;
|
|
34
|
+
privateKey: string;
|
|
35
|
+
publicKey: string;
|
|
36
|
+
apiKey?: string;
|
|
37
|
+
}
|
|
38
|
+
interface PrivateKeyAccountConfig extends BaseAccountConfig {
|
|
39
|
+
type: typeof ServerAccountType.PrivateKey;
|
|
40
|
+
privateKey: `0x${string}`;
|
|
41
|
+
}
|
|
42
|
+
type ServerAccountConfig = ApiAccountConfig | PrivateKeyAccountConfig;
|
|
43
|
+
type AccountConfig = ServerAccountConfig;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/account/helpers.d.ts
|
|
46
|
+
declare function isApiAccountConfig(config: ServerAccountConfig): config is ApiAccountConfig;
|
|
47
|
+
declare function isPrivateKeyAccountConfig(config: ServerAccountConfig): config is PrivateKeyAccountConfig;
|
|
48
|
+
declare function createClientContext(config: ServerAccountConfig): OtimServerClientContext;
|
|
49
|
+
//#endregion
|
|
50
|
+
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 };
|
|
51
|
+
//# sourceMappingURL=index-C5c51xs0.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-C5c51xs0.d.mts","names":[],"sources":["../src/account/types.ts","../src/account/helpers.ts"],"sourcesContent":[],"mappings":";;;;;;cAGa;;;;AAAA,KAID,iBAAA,GADF,CAAA,OAEA,iBAFA,CAAA,CAAA,MAAA,OAEgC,iBAFhC,CAAA;AACE,cAGC,WAHgB,EAAA;EAGhB,SAAA,UAEH,EAAA,YAAA;EACE,SAAA,GAAA,EAAW,KAAA;AAEvB,CAAA;AAIiB,KANL,WAAA,GAMgB,CAAA,OANM,WAMN,CAAA,CAAA,MAAA,OANgC,WAMhC,CAAA;AACZ,KALJ,0BAAA,GAKI;EACI,OAAA,EAAA,MAAA,GAAA;IAAqC,GAAA,EAL9B,GAK8B,GALxB,UAKwB;EAAR,CAAA;CAAO;AAG9C,UALO,WAAA,CAKU;EACX,UAAA,EAAA,EALA,OAKA,CAAA,IAAA,CAAA;EACN,WAAA,CAAA,IAAA,EALU,0BAKV,CAAA,EALuC,OAKvC,CAL+C,GAK/C,CAAA;;UAFA,iBAAA,CAGY;EAGL,WAAA,CAAA,EALD,WAKkB;EAQjB,MAAA,EAZP,KAYO,EAAA;EAKL,YAAA,CAAA,EAhBK,KAgBL;AAEZ;UAfiB,gBAAA,SAAyB;eAC3B,iBAAA,CAAkB;;ECtBjB,UAAA,EAAA,MAAA;EAMA,SAAA,EAAA,MAAA;EAMA,MAAA,CAAA,EAAA,MAAA;;UDiBC,uBAAA,SAAgC;eAClC,iBAAA,CAAkB;;;KAIrB,mBAAA,GAAsB,mBAAmB;KAEzC,aAAA,GAAgB;;;iBCpCZ,kBAAA,SACN,gCACG;iBAIG,yBAAA,SACN,gCACG;iBAIG,mBAAA,SACN,sBACP"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { t as Chain } from "./rpc-BDoNl1Sp.cjs";
|
|
2
|
+
import { c as Hex } from "./authorization-6anhDdQX.cjs";
|
|
3
|
+
import { Environment } from "@otim/sdk-core/config";
|
|
4
|
+
import { OtimServerClientContext } from "@otim/sdk-core/context";
|
|
5
|
+
|
|
6
|
+
//#region src/account/types.d.ts
|
|
7
|
+
declare const ServerAccountType: {
|
|
8
|
+
readonly PrivateKey: "privateKey";
|
|
9
|
+
readonly Api: "api";
|
|
10
|
+
};
|
|
11
|
+
type ServerAccountType = (typeof ServerAccountType)[keyof typeof ServerAccountType];
|
|
12
|
+
declare const AccountType: {
|
|
13
|
+
readonly PrivateKey: "privateKey";
|
|
14
|
+
readonly Api: "api";
|
|
15
|
+
};
|
|
16
|
+
type AccountType = (typeof AccountType)[keyof typeof AccountType];
|
|
17
|
+
type OtimAccountSignMessageArgs = {
|
|
18
|
+
message: string | {
|
|
19
|
+
raw: Hex | Uint8Array;
|
|
20
|
+
};
|
|
21
|
+
};
|
|
22
|
+
interface OtimAccount {
|
|
23
|
+
initialize(): Promise<void>;
|
|
24
|
+
signMessage(args: OtimAccountSignMessageArgs): Promise<Hex>;
|
|
25
|
+
}
|
|
26
|
+
interface BaseAccountConfig {
|
|
27
|
+
environment?: Environment;
|
|
28
|
+
chains: Chain[];
|
|
29
|
+
defaultChain?: Chain;
|
|
30
|
+
}
|
|
31
|
+
interface ApiAccountConfig extends BaseAccountConfig {
|
|
32
|
+
type: typeof ServerAccountType.Api;
|
|
33
|
+
appId: string;
|
|
34
|
+
privateKey: string;
|
|
35
|
+
publicKey: string;
|
|
36
|
+
apiKey?: string;
|
|
37
|
+
}
|
|
38
|
+
interface PrivateKeyAccountConfig extends BaseAccountConfig {
|
|
39
|
+
type: typeof ServerAccountType.PrivateKey;
|
|
40
|
+
privateKey: `0x${string}`;
|
|
41
|
+
}
|
|
42
|
+
type ServerAccountConfig = ApiAccountConfig | PrivateKeyAccountConfig;
|
|
43
|
+
type AccountConfig = ServerAccountConfig;
|
|
44
|
+
//#endregion
|
|
45
|
+
//#region src/account/helpers.d.ts
|
|
46
|
+
declare function isApiAccountConfig(config: ServerAccountConfig): config is ApiAccountConfig;
|
|
47
|
+
declare function isPrivateKeyAccountConfig(config: ServerAccountConfig): config is PrivateKeyAccountConfig;
|
|
48
|
+
declare function createClientContext(config: ServerAccountConfig): OtimServerClientContext;
|
|
49
|
+
//#endregion
|
|
50
|
+
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 };
|
|
51
|
+
//# sourceMappingURL=index-C8H-BPGH.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-C8H-BPGH.d.cts","names":[],"sources":["../src/account/types.ts","../src/account/helpers.ts"],"sourcesContent":[],"mappings":";;;;;;cAGa;;;;AAAA,KAID,iBAAA,GADF,CAAA,OAEA,iBAFA,CAAA,CAAA,MAAA,OAEgC,iBAFhC,CAAA;AACE,cAGC,WAHgB,EAAA;EAGhB,SAAA,UAEH,EAAA,YAAA;EACE,SAAA,GAAA,EAAW,KAAA;AAEvB,CAAA;AAIiB,KANL,WAAA,GAMgB,CAAA,OANM,WAMN,CAAA,CAAA,MAAA,OANgC,WAMhC,CAAA;AACZ,KALJ,0BAAA,GAKI;EACI,OAAA,EAAA,MAAA,GAAA;IAAqC,GAAA,EAL9B,GAK8B,GALxB,UAKwB;EAAR,CAAA;CAAO;AAG9C,UALO,WAAA,CAKU;EACX,UAAA,EAAA,EALA,OAKA,CAAA,IAAA,CAAA;EACN,WAAA,CAAA,IAAA,EALU,0BAKV,CAAA,EALuC,OAKvC,CAL+C,GAK/C,CAAA;;UAFA,iBAAA,CAGY;EAGL,WAAA,CAAA,EALD,WAKkB;EAQjB,MAAA,EAZP,KAYO,EAAA;EAKL,YAAA,CAAA,EAhBK,KAgBL;AAEZ;UAfiB,gBAAA,SAAyB;eAC3B,iBAAA,CAAkB;;ECtBjB,UAAA,EAAA,MAAA;EAMA,SAAA,EAAA,MAAA;EAMA,MAAA,CAAA,EAAA,MAAA;;UDiBC,uBAAA,SAAgC;eAClC,iBAAA,CAAkB;;;KAIrB,mBAAA,GAAsB,mBAAmB;KAEzC,aAAA,GAAgB;;;iBCpCZ,kBAAA,SACN,gCACG;iBAIG,yBAAA,SACN,gCACG;iBAIG,mBAAA,SACN,sBACP"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { c as Address$1 } from "./abi-OUq-mx1W.cjs";
|
|
2
|
+
import { OtimClientContext, OtimServerClientContext } from "@otim/sdk-core/context";
|
|
3
|
+
import { APIClient, AuthLoginResponse, DelegationCreateRequest, DelegationStatusRequest, DelegationStatusResponse, GetDelegateAddressRequest, GetDelegateAddressResponse, GetInstructionActivityRequest, GetInstructionActivityResponse, GetMaxPriorityFeePerGasEstimateRequest, GetMaxPriorityFeePerGasEstimateResponse, GetPaymentRequestsRequest, GetPaymentRequestsResponse, MeResponse, PaginatedServiceResponse, PaymentRequestBuildRequest, PaymentRequestDetailsRequest, PaymentRequestDetailsResponse, ServiceResponse } from "@otim/utils/api";
|
|
4
|
+
import { OtimAccount } from "@otim/sdk-core/account";
|
|
5
|
+
import { Address } from "@otim/utils/schemas";
|
|
6
|
+
import { SupportedChainId } from "@otim/utils/chains";
|
|
7
|
+
import { Nullable } from "@otim/utils/helpers";
|
|
8
|
+
import { PaymentRequestMetadata } from "@otim/utils/payments";
|
|
9
|
+
|
|
10
|
+
//#region src/clients/activity.d.ts
|
|
11
|
+
declare class ActivityClient {
|
|
12
|
+
private readonly apiClient;
|
|
13
|
+
constructor(apiClient: APIClient);
|
|
14
|
+
getInstructionActivity(request: GetInstructionActivityRequest): Promise<GetInstructionActivityResponse>;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/clients/auth.d.ts
|
|
18
|
+
interface LoginOptions {
|
|
19
|
+
address: Address$1;
|
|
20
|
+
}
|
|
21
|
+
declare class AuthClient {
|
|
22
|
+
private readonly apiClient;
|
|
23
|
+
private readonly account;
|
|
24
|
+
private readonly context;
|
|
25
|
+
constructor(apiClient: APIClient, account: OtimAccount, context: OtimClientContext);
|
|
26
|
+
login({
|
|
27
|
+
address
|
|
28
|
+
}: LoginOptions): Promise<AuthLoginResponse>;
|
|
29
|
+
getCurrentUser(): Promise<MeResponse>;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/clients/config.d.ts
|
|
33
|
+
declare class ConfigClient {
|
|
34
|
+
private readonly apiClient;
|
|
35
|
+
constructor(apiClient: APIClient);
|
|
36
|
+
getMaxPriorityFeeEstimate({
|
|
37
|
+
chainId
|
|
38
|
+
}: GetMaxPriorityFeePerGasEstimateRequest): Promise<GetMaxPriorityFeePerGasEstimateResponse>;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/clients/delegation.d.ts
|
|
42
|
+
declare class DelegationClient {
|
|
43
|
+
private readonly apiClient;
|
|
44
|
+
constructor(apiClient: APIClient);
|
|
45
|
+
getDelegateAddress({
|
|
46
|
+
chainId
|
|
47
|
+
}: GetDelegateAddressRequest): Promise<GetDelegateAddressResponse>;
|
|
48
|
+
getDelegationStatus(options: DelegationStatusRequest): Promise<DelegationStatusResponse>;
|
|
49
|
+
createDelegation(delegationRequest: DelegationCreateRequest): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/clients/helpers/prepare-payment-request.d.ts
|
|
53
|
+
interface PreparePaymentRequestParams {
|
|
54
|
+
amount: number;
|
|
55
|
+
chainId: SupportedChainId;
|
|
56
|
+
recipient: Address;
|
|
57
|
+
token?: "USDC" | "USDT";
|
|
58
|
+
payer?: Nullable<Address>;
|
|
59
|
+
dueDate?: string;
|
|
60
|
+
metadata?: PaymentRequestMetadata;
|
|
61
|
+
note?: string;
|
|
62
|
+
maxRuns?: number;
|
|
63
|
+
}
|
|
64
|
+
interface PreparedPaymentRequest {
|
|
65
|
+
payload: PaymentRequestBuildRequest;
|
|
66
|
+
chainId: number;
|
|
67
|
+
}
|
|
68
|
+
declare function preparePaymentRequest(params: PreparePaymentRequestParams): PreparedPaymentRequest;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/clients/orchestration.d.ts
|
|
71
|
+
interface CreatePaymentRequestResponse {
|
|
72
|
+
requestId: string;
|
|
73
|
+
ephemeralWalletAddress: Address;
|
|
74
|
+
}
|
|
75
|
+
declare class OrchestrationClient {
|
|
76
|
+
private readonly apiClient;
|
|
77
|
+
private readonly account;
|
|
78
|
+
private readonly context;
|
|
79
|
+
constructor(apiClient: APIClient, account: OtimAccount, context: OtimServerClientContext);
|
|
80
|
+
create(preparedRequest: PreparedPaymentRequest): Promise<CreatePaymentRequestResponse>;
|
|
81
|
+
getDetails(request: PaymentRequestDetailsRequest): Promise<ServiceResponse<PaymentRequestDetailsResponse>>;
|
|
82
|
+
list(request: GetPaymentRequestsRequest): Promise<PaginatedServiceResponse<GetPaymentRequestsResponse>>;
|
|
83
|
+
private activate;
|
|
84
|
+
private buildAndEnhancePaymentRequest;
|
|
85
|
+
private createPublicClient;
|
|
86
|
+
private fetchDelegateAddresses;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { preparePaymentRequest as a, AuthClient as c, PreparedPaymentRequest as i, LoginOptions as l, OrchestrationClient as n, DelegationClient as o, PreparePaymentRequestParams as r, ConfigClient as s, CreatePaymentRequestResponse as t, ActivityClient as u };
|
|
90
|
+
//# sourceMappingURL=index-Ce_qYSJj.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-Ce_qYSJj.d.cts","names":[],"sources":["../src/clients/activity.ts","../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/helpers/prepare-payment-request.ts","../src/clients/orchestration.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAMa,cAAA;;yBAC6B;kCAG7B,gCACR,QAAQ;;;;UCDI,YAAA;WACN;;cAGE,UAAA;;;EDRA,iBAAc,OAAA;EACe,WAAA,CAAA,SAAA,ECSV,SDTU,EAAA,OAAA,ECUZ,WDVY,EAAA,OAAA,ECWZ,iBDXY;EAG7B,KAAA,CAAA;IAAA;EAAA,CAAA,ECWc,YDXd,CAAA,ECW6B,ODX7B,CCWqC,iBDXrC,CAAA;EACA,cAAA,CAAA,CAAA,ECyBa,ODzBb,CCyBqB,UDzBrB,CAAA;;;;cELA,YAAA;;yBAC6B;;;KAIrC,yCAAyC,QAAQ;;;;cCFzC,gBAAA;;yBAC6B;;;KAIrC,4BAA4B,QAAQ;+BAS5B,0BACR,QAAQ;sCAUU,0BAClB;;;;UCfY,2BAAA;;WAEN;aACE;;EJjBA,KAAA,CAAA,EImBH,QJnBG,CImBM,OJnBQ,CAAA;EACe,OAAA,CAAA,EAAA,MAAA;EAG7B,QAAA,CAAA,EIiBA,sBJjBA;EACA,IAAA,CAAA,EAAA,MAAA;EAAR,OAAA,CAAA,EAAA,MAAA;;UIqBY,sBAAA;WACN;;AHvBX;AAIa,iBGiGG,qBAAA,CHjGO,MAAA,EGkGb,2BHlGa,CAAA,EGmGpB,sBHnGoB;;;UIiBN,4BAAA;;0BAES;;AL3Bb,cKiCA,mBAAA,CLjCc;EACe,iBAAA,SAAA;EAG7B,iBAAA,OAAA;EACA,iBAAA,OAAA;EAAR,WAAA,CAAA,SAAA,EK8B2B,SL9B3B,EAAA,OAAA,EK+ByB,WL/BzB,EAAA,OAAA,EKgCyB,uBLhCzB;EAAO,MAAA,CAAA,eAAA,EKoCS,sBLpCT,CAAA,EKqCP,OLrCO,CKqCC,4BLrCD,CAAA;sBKoDC,+BACR,QAAQ,gBAAgB;gBAKhB,4BACR,QAAQ,yBAAyB;;EJ5DrB,QAAA,6BACC;EAGL,QAAA,kBAAU;EAES,QAAA,sBAAA"}
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
import { c as Address$1 } from "./abi-DW6AS0eM.mjs";
|
|
2
|
+
import { Nullable } from "@otim/utils/helpers";
|
|
3
|
+
import { OtimClientContext, OtimServerClientContext } from "@otim/sdk-core/context";
|
|
4
|
+
import { SupportedChainId } from "@otim/utils/chains";
|
|
5
|
+
import { PaymentRequestMetadata } from "@otim/utils/payments";
|
|
6
|
+
import { Address } from "@otim/utils/schemas";
|
|
7
|
+
import { OtimAccount } from "@otim/sdk-core/account";
|
|
8
|
+
import { APIClient, AuthLoginResponse, DelegationCreateRequest, DelegationStatusRequest, DelegationStatusResponse, GetDelegateAddressRequest, GetDelegateAddressResponse, GetInstructionActivityRequest, GetInstructionActivityResponse, GetMaxPriorityFeePerGasEstimateRequest, GetMaxPriorityFeePerGasEstimateResponse, GetPaymentRequestsRequest, GetPaymentRequestsResponse, MeResponse, PaginatedServiceResponse, PaymentRequestBuildRequest, PaymentRequestDetailsRequest, PaymentRequestDetailsResponse, ServiceResponse } from "@otim/utils/api";
|
|
9
|
+
|
|
10
|
+
//#region src/clients/activity.d.ts
|
|
11
|
+
declare class ActivityClient {
|
|
12
|
+
private readonly apiClient;
|
|
13
|
+
constructor(apiClient: APIClient);
|
|
14
|
+
getInstructionActivity(request: GetInstructionActivityRequest): Promise<GetInstructionActivityResponse>;
|
|
15
|
+
}
|
|
16
|
+
//#endregion
|
|
17
|
+
//#region src/clients/auth.d.ts
|
|
18
|
+
interface LoginOptions {
|
|
19
|
+
address: Address$1;
|
|
20
|
+
}
|
|
21
|
+
declare class AuthClient {
|
|
22
|
+
private readonly apiClient;
|
|
23
|
+
private readonly account;
|
|
24
|
+
private readonly context;
|
|
25
|
+
constructor(apiClient: APIClient, account: OtimAccount, context: OtimClientContext);
|
|
26
|
+
login({
|
|
27
|
+
address
|
|
28
|
+
}: LoginOptions): Promise<AuthLoginResponse>;
|
|
29
|
+
getCurrentUser(): Promise<MeResponse>;
|
|
30
|
+
}
|
|
31
|
+
//#endregion
|
|
32
|
+
//#region src/clients/config.d.ts
|
|
33
|
+
declare class ConfigClient {
|
|
34
|
+
private readonly apiClient;
|
|
35
|
+
constructor(apiClient: APIClient);
|
|
36
|
+
getMaxPriorityFeeEstimate({
|
|
37
|
+
chainId
|
|
38
|
+
}: GetMaxPriorityFeePerGasEstimateRequest): Promise<GetMaxPriorityFeePerGasEstimateResponse>;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
41
|
+
//#region src/clients/delegation.d.ts
|
|
42
|
+
declare class DelegationClient {
|
|
43
|
+
private readonly apiClient;
|
|
44
|
+
constructor(apiClient: APIClient);
|
|
45
|
+
getDelegateAddress({
|
|
46
|
+
chainId
|
|
47
|
+
}: GetDelegateAddressRequest): Promise<GetDelegateAddressResponse>;
|
|
48
|
+
getDelegationStatus(options: DelegationStatusRequest): Promise<DelegationStatusResponse>;
|
|
49
|
+
createDelegation(delegationRequest: DelegationCreateRequest): Promise<void>;
|
|
50
|
+
}
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/clients/helpers/prepare-payment-request.d.ts
|
|
53
|
+
interface PreparePaymentRequestParams {
|
|
54
|
+
amount: number;
|
|
55
|
+
chainId: SupportedChainId;
|
|
56
|
+
recipient: Address;
|
|
57
|
+
token?: "USDC" | "USDT";
|
|
58
|
+
payer?: Nullable<Address>;
|
|
59
|
+
dueDate?: string;
|
|
60
|
+
metadata?: PaymentRequestMetadata;
|
|
61
|
+
note?: string;
|
|
62
|
+
maxRuns?: number;
|
|
63
|
+
}
|
|
64
|
+
interface PreparedPaymentRequest {
|
|
65
|
+
payload: PaymentRequestBuildRequest;
|
|
66
|
+
chainId: number;
|
|
67
|
+
}
|
|
68
|
+
declare function preparePaymentRequest(params: PreparePaymentRequestParams): PreparedPaymentRequest;
|
|
69
|
+
//#endregion
|
|
70
|
+
//#region src/clients/orchestration.d.ts
|
|
71
|
+
interface CreatePaymentRequestResponse {
|
|
72
|
+
requestId: string;
|
|
73
|
+
ephemeralWalletAddress: Address;
|
|
74
|
+
}
|
|
75
|
+
declare class OrchestrationClient {
|
|
76
|
+
private readonly apiClient;
|
|
77
|
+
private readonly account;
|
|
78
|
+
private readonly context;
|
|
79
|
+
constructor(apiClient: APIClient, account: OtimAccount, context: OtimServerClientContext);
|
|
80
|
+
create(preparedRequest: PreparedPaymentRequest): Promise<CreatePaymentRequestResponse>;
|
|
81
|
+
getDetails(request: PaymentRequestDetailsRequest): Promise<ServiceResponse<PaymentRequestDetailsResponse>>;
|
|
82
|
+
list(request: GetPaymentRequestsRequest): Promise<PaginatedServiceResponse<GetPaymentRequestsResponse>>;
|
|
83
|
+
private activate;
|
|
84
|
+
private buildAndEnhancePaymentRequest;
|
|
85
|
+
private createPublicClient;
|
|
86
|
+
private fetchDelegateAddresses;
|
|
87
|
+
}
|
|
88
|
+
//#endregion
|
|
89
|
+
export { preparePaymentRequest as a, AuthClient as c, PreparedPaymentRequest as i, LoginOptions as l, OrchestrationClient as n, DelegationClient as o, PreparePaymentRequestParams as r, ConfigClient as s, CreatePaymentRequestResponse as t, ActivityClient as u };
|
|
90
|
+
//# sourceMappingURL=index-CiyyA-wd.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CiyyA-wd.d.mts","names":[],"sources":["../src/clients/activity.ts","../src/clients/auth.ts","../src/clients/config.ts","../src/clients/delegation.ts","../src/clients/helpers/prepare-payment-request.ts","../src/clients/orchestration.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;cAMa,cAAA;;yBAC6B;kCAG7B,gCACR,QAAQ;;;;UCDI,YAAA;WACN;;cAGE,UAAA;;;EDRA,iBAAc,OAAA;EACe,WAAA,CAAA,SAAA,ECSV,SDTU,EAAA,OAAA,ECUZ,WDVY,EAAA,OAAA,ECWZ,iBDXY;EAG7B,KAAA,CAAA;IAAA;EAAA,CAAA,ECWc,YDXd,CAAA,ECW6B,ODX7B,CCWqC,iBDXrC,CAAA;EACA,cAAA,CAAA,CAAA,ECyBa,ODzBb,CCyBqB,UDzBrB,CAAA;;;;cELA,YAAA;;yBAC6B;;;KAIrC,yCAAyC,QAAQ;;;;cCFzC,gBAAA;;yBAC6B;;;KAIrC,4BAA4B,QAAQ;+BAS5B,0BACR,QAAQ;sCAUU,0BAClB;;;;UCfY,2BAAA;;WAEN;aACE;;EJjBA,KAAA,CAAA,EImBH,QJnBG,CImBM,OJnBQ,CAAA;EACe,OAAA,CAAA,EAAA,MAAA;EAG7B,QAAA,CAAA,EIiBA,sBJjBA;EACA,IAAA,CAAA,EAAA,MAAA;EAAR,OAAA,CAAA,EAAA,MAAA;;UIqBY,sBAAA;WACN;;AHvBX;AAIa,iBGiGG,qBAAA,CHjGO,MAAA,EGkGb,2BHlGa,CAAA,EGmGpB,sBHnGoB;;;UIiBN,4BAAA;;0BAES;;AL3Bb,cKiCA,mBAAA,CLjCc;EACe,iBAAA,SAAA;EAG7B,iBAAA,OAAA;EACA,iBAAA,OAAA;EAAR,WAAA,CAAA,SAAA,EK8B2B,SL9B3B,EAAA,OAAA,EK+ByB,WL/BzB,EAAA,OAAA,EKgCyB,uBLhCzB;EAAO,MAAA,CAAA,eAAA,EKoCS,sBLpCT,CAAA,EKqCP,OLrCO,CKqCC,4BLrCD,CAAA;sBKoDC,+BACR,QAAQ,gBAAgB;gBAKhB,4BACR,QAAQ,yBAAyB;;EJ5DrB,QAAA,6BACC;EAGL,QAAA,kBAAU;EAES,QAAA,sBAAA"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { t as Authorization } from "./authorization-DnNpWjxB.mjs";
|
|
2
|
+
import { EIP2098Signature, VRS } from "@otim/utils/schemas";
|
|
3
|
+
|
|
4
|
+
//#region src/utils/rlp.d.ts
|
|
5
|
+
declare const normalizeYParityValue: (value: number | bigint | string | undefined | null) => 0 | 1;
|
|
6
|
+
declare function createRlpEncodedAuthorization(authorization: Authorization): `0x${string}`;
|
|
7
|
+
declare function createRlpEncodedAuthorization(chainId: number, delegateAddress: string, nonce: number, yParity: number | bigint, r: `0x${string}`, s: `0x${string}`): `0x${string}`;
|
|
8
|
+
//#endregion
|
|
9
|
+
//#region src/utils/vrs.d.ts
|
|
10
|
+
declare const createEIP2098Signature: (vrs: VRS) => EIP2098Signature;
|
|
11
|
+
declare const parseSignatureToVRS: (signature: string) => VRS;
|
|
12
|
+
//#endregion
|
|
13
|
+
export { normalizeYParityValue as i, parseSignatureToVRS as n, createRlpEncodedAuthorization as r, createEIP2098Signature as t };
|
|
14
|
+
//# sourceMappingURL=index-CnjY7cyS.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-CnjY7cyS.d.mts","names":[],"sources":["../src/utils/rlp.ts","../src/utils/vrs.ts"],"sourcesContent":[],"mappings":";;;;cAuBa;iBAkCG,6BAAA,gBACC;iBAED,6BAAA;;;cCrBH,8BAA+B,QAAM;cAkBrC,4CAA2C"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { t as Chain } from "./rpc-CygBD_f7.mjs";
|
|
2
|
+
import { ServerAccountConfig, ServerAccountType } from "@otim/sdk-core/account";
|
|
3
|
+
|
|
4
|
+
//#region src/context/types.d.ts
|
|
5
|
+
interface OtimServerClientContext {
|
|
6
|
+
readonly usesApiKeyAuth: boolean;
|
|
7
|
+
readonly config: ServerAccountConfig;
|
|
8
|
+
readonly accountType: ServerAccountType;
|
|
9
|
+
readonly chains: Chain[];
|
|
10
|
+
readonly defaultChain: Chain;
|
|
11
|
+
}
|
|
12
|
+
interface OtimReactClientContext {}
|
|
13
|
+
type OtimClientContext = OtimServerClientContext | OtimReactClientContext;
|
|
14
|
+
//#endregion
|
|
15
|
+
//#region src/context/asserts.d.ts
|
|
16
|
+
declare function assertRequiresAuth(context: OtimClientContext): void;
|
|
17
|
+
declare function assertServerContext(context: OtimClientContext): asserts context is OtimServerClientContext;
|
|
18
|
+
//#endregion
|
|
19
|
+
//#region src/context/helpers.d.ts
|
|
20
|
+
declare const isServerContext: (context: OtimClientContext) => context is OtimServerClientContext;
|
|
21
|
+
//#endregion
|
|
22
|
+
export { OtimReactClientContext as a, OtimClientContext as i, assertRequiresAuth as n, OtimServerClientContext as o, assertServerContext as r, isServerContext as t };
|
|
23
|
+
//# sourceMappingURL=index-DWE1xfOE.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-DWE1xfOE.d.mts","names":[],"sources":["../src/context/types.ts","../src/context/asserts.ts","../src/context/helpers.ts"],"sourcesContent":[],"mappings":";;;;UAMiB,uBAAA;;EAAA,SAAA,MAAA,EAEE,mBAFqB;EAErB,SAAA,WAAA,EACK,iBADL;EACK,SAAA,MAAA,EACL,KADK,EAAA;EACL,SAAA,YAAA,EACM,KADN;;AACW,UAGb,sBAAA,CAHa,CAG9B;AAEY,KAAA,iBAAA,GACR,uBAAA,GACA,sBAAA;;;iBCVY,kBAAA,UAA4B;iBAQ5B,mBAAA,UACL,uCACW;;;cChBT,2BACF,iCACG"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { c as Address } from "./abi-DW6AS0eM.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-D_7CTJDl.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index-D_7CTJDl.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"}
|