@otim/sdk-server 0.0.9 → 0.0.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.cjs +2 -7
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.mts +3 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -7
- package/dist/index.mjs.map +1 -1
- package/package.json +7 -7
package/dist/index.cjs
CHANGED
|
@@ -186,23 +186,18 @@ var OtimServerClient = class {
|
|
|
186
186
|
//#endregion
|
|
187
187
|
//#region src/client/create-server-client.ts
|
|
188
188
|
function createOtimServerClient(config) {
|
|
189
|
-
if (config.chains.length === 0) throw new Error("At least one chain must be provided");
|
|
190
189
|
if ("appId" in config && config.publicKey && config.apiKey) return new OtimServerClient({
|
|
191
190
|
type: __otim_sdk_core_account.ServerAccountType.Api,
|
|
192
191
|
appId: config.appId,
|
|
193
192
|
privateKey: config.privateKey,
|
|
194
193
|
publicKey: config.publicKey,
|
|
195
194
|
apiKey: config.apiKey,
|
|
196
|
-
environment: config.environment
|
|
197
|
-
chains: config.chains,
|
|
198
|
-
defaultChain: config.defaultChain
|
|
195
|
+
environment: config.environment
|
|
199
196
|
});
|
|
200
197
|
return new OtimServerClient({
|
|
201
198
|
type: __otim_sdk_core_account.ServerAccountType.PrivateKey,
|
|
202
199
|
privateKey: config.privateKey,
|
|
203
|
-
environment: config.environment
|
|
204
|
-
chains: config.chains,
|
|
205
|
-
defaultChain: config.defaultChain
|
|
200
|
+
environment: config.environment
|
|
206
201
|
});
|
|
207
202
|
}
|
|
208
203
|
|
package/dist/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.cjs","names":["Environment","APIClient","ApiKeyStamper","TurnkeyClient","ServerAccountType","exhaustiveCheck: never","config: ServerAccountConfig","ActivityClient","AuthClient","ConfigClient","DelegationClient","OrchestrationClient","ServerAccountType"],"sources":["../src/client/api-client.ts","../src/client/utils/asserts.ts","../src/client/server-account.ts","../src/client/server-client.ts","../src/client/create-server-client.ts"],"sourcesContent":["import type { CreateInstanceParameters } from \"@otim/utils/api\";\nimport type { Optional } from \"@otim/utils/helpers\";\n\nimport { Environment, getApiUrl } from \"@otim/sdk-core/config\";\nimport { APIClient, createInstance } from \"@otim/utils/api\";\n\nexport interface CreateServerAPIClientOptions\n extends Omit<CreateInstanceParameters, \"baseURL\"> {\n sessionToken?: Optional<string>;\n environment?: Environment;\n}\n\n/**\n * Creates an API client for server-side requests.\n *\n * Configures the base URL and authentication headers for API communication.\n *\n * @param config - Optional configuration for the API client\n * @returns Configured API client instance\n *\n * @internal\n */\nexport const createServerAPIClient = (\n config?: CreateServerAPIClientOptions,\n) => {\n const {\n sessionToken,\n environment = Environment.Sandbox,\n ...restConfig\n } = config ?? {};\n\n const instance = createInstance({\n baseURL: getApiUrl(environment),\n ...restConfig,\n });\n\n instance.interceptors.request.use(async (requestConfig) => {\n if (sessionToken) {\n requestConfig.headers = requestConfig.headers ?? {};\n\n // If the session token does not start with \"Bearer \", add it.\n const authorizationToken = sessionToken.startsWith(\"Bearer \")\n ? sessionToken\n : `Bearer ${sessionToken}`;\n\n requestConfig.headers.Authorization = authorizationToken;\n }\n\n return requestConfig;\n });\n\n return new APIClient({ instance });\n};\n","export function assertDefined<T>(\n value: T,\n errorMessage: string,\n): asserts value is NonNullable<T> {\n if (value === null || value === undefined) {\n throw new Error(errorMessage);\n }\n}\n","import type {\n ApiAccountConfig,\n OtimAccountSignMessageArgs,\n OtimAccount as OtimAccountType,\n PrivateKeyAccountConfig,\n ServerAccountConfig,\n} from \"@otim/sdk-core/account\";\nimport type { Nullable } from \"@otim/utils/helpers\";\nimport type { Hex } from \"viem\";\n\nimport { ServerAccountType } from \"@otim/sdk-core/account\";\nimport { ApiKeyStamper } from \"@turnkey/api-key-stamper\";\nimport { TurnkeyClient } from \"@turnkey/http\";\nimport { createAccount } from \"@turnkey/viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nimport { assertDefined } from \"./utils/asserts\";\n\nconst TURNKEY_API_URL = \"https://api.turnkey.com\";\n\ntype PrimitiveAccount = {\n signMessage: (args: {\n message: string | { raw: Hex | Uint8Array };\n }) => Promise<Hex>;\n};\n\nconst createApiAccount = async (\n config: ApiAccountConfig,\n): Promise<PrimitiveAccount> => {\n const stamper = new ApiKeyStamper({\n apiPublicKey: config.publicKey,\n apiPrivateKey: config.privateKey,\n });\n\n const client = new TurnkeyClient({ baseUrl: TURNKEY_API_URL }, stamper);\n\n const account = await createAccount({\n organizationId: config.appId,\n signWith: \"0xB54c8E6f303627f392884412ED2C84fFaF4779CA\",\n client,\n });\n\n return {\n signMessage: (args) => account.signMessage(args),\n };\n};\n\nconst createPrivateKeyAccount = (\n config: PrivateKeyAccountConfig,\n): PrimitiveAccount => {\n const account = privateKeyToAccount(config.privateKey);\n\n return {\n signMessage: (args) => account.signMessage(args),\n };\n};\n\nconst initializeAccount = async (\n config: ServerAccountConfig,\n): Promise<PrimitiveAccount> => {\n switch (config.type) {\n case ServerAccountType.Api:\n return createApiAccount(config);\n case ServerAccountType.PrivateKey:\n return createPrivateKeyAccount(config);\n default: {\n const exhaustiveCheck: never = config;\n throw new Error(\n `Unsupported account type: \"${(exhaustiveCheck as ServerAccountConfig).type}\". Supported types are: ${Object.values(ServerAccountType).join(\", \")}`,\n );\n }\n }\n};\n\n/**\n * Server-side account implementation for signing operations.\n *\n * Supports both private key and API authentication methods.\n *\n * @internal\n */\nexport class OtimAccount implements OtimAccountType {\n private account: Nullable<PrimitiveAccount> = null;\n private initialized = false;\n\n constructor(private readonly config: ServerAccountConfig) {}\n\n async initialize(): Promise<void> {\n if (this.initialized) {\n throw new Error(\n \"Account already initialized. The initialize() method should only be called once.\",\n );\n }\n\n this.account = await initializeAccount(this.config);\n this.initialized = true;\n }\n\n async signMessage({ message }: OtimAccountSignMessageArgs) {\n assertDefined(\n this.account,\n \"Account not initialized. Call initialize() before using signMessage().\",\n );\n return this.account.signMessage({ message });\n }\n}\n","import type { ServerAccountConfig } from \"@otim/sdk-core/account\";\nimport type { OtimServerClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient } from \"@otim/utils/api\";\n\nimport {\n createClientContext,\n isApiAccountConfig,\n} from \"@otim/sdk-core/account\";\nimport {\n ActivityClient,\n AuthClient,\n ConfigClient,\n DelegationClient,\n OrchestrationClient,\n} from \"@otim/sdk-core/clients\";\n\nimport { createServerAPIClient } from \"./api-client\";\nimport { OtimAccount } from \"./server-account\";\n\n/**\n * Otim Client for server-side blockchain operations.\n *\n * Provides access to activity, authentication, configuration, delegation, and\n * orchestration services.\n * The client must be initialized before use by calling the init() method.\n\n */\nexport class OtimServerClient {\n private readonly apiClient: APIClient;\n private readonly account: OtimAccount;\n private readonly context: OtimServerClientContext;\n\n readonly activity: ActivityClient;\n readonly auth: AuthClient;\n readonly config: ConfigClient;\n readonly delegation: DelegationClient;\n readonly orchestration: OrchestrationClient;\n\n constructor(config: ServerAccountConfig) {\n this.context = createClientContext(config);\n this.apiClient = createServerAPIClient({\n environment: config.environment,\n ...(isApiAccountConfig(config) ? { sessionToken: config.apiKey } : {}),\n });\n\n this.account = new OtimAccount(config);\n\n this.activity = new ActivityClient(this.apiClient);\n this.auth = new AuthClient(this.apiClient, this.account, this.context);\n this.config = new ConfigClient(this.apiClient);\n this.delegation = new DelegationClient(this.apiClient);\n this.orchestration = new OrchestrationClient(\n this.apiClient,\n this.account,\n this.context,\n );\n }\n\n /**\n * Initializes the Otim Client.\n *\n * This method must be called before using any other client methods.\n * It sets up the authentication account and prepares the client for use.\n *\n * @throws {Error} If the account is already initialized\n */\n async init(): Promise<void> {\n await this.account.initialize();\n }\n}\n","import type { Chain } from \"@otim/sdk-core/account\";\nimport type { Environment } from \"@otim/sdk-core/config\";\n\nimport { ServerAccountType } from \"@otim/sdk-core/account\";\n\nimport { OtimServerClient } from \"./server-client\";\n\ninterface BaseClientConfig {\n environment?: Environment;\n chains: Chain[];\n defaultChain?: Chain;\n}\n\ninterface PrivateKeyClientConfig extends BaseClientConfig {\n privateKey: `0x${string}`;\n}\n\ninterface ApiClientConfig extends BaseClientConfig {\n appId: string;\n privateKey: `0x${string}`;\n publicKey: string;\n apiKey?: string;\n}\n\nexport function createOtimServerClient(\n config: PrivateKeyClientConfig,\n): OtimServerClient;\nexport function createOtimServerClient(\n config: ApiClientConfig,\n): OtimServerClient;\nexport function createOtimServerClient(\n config: PrivateKeyClientConfig | ApiClientConfig,\n): OtimServerClient {\n if (config.chains.length === 0) {\n throw new Error(\"At least one chain must be provided\");\n }\n\n if (\"appId\" in config && config.publicKey && config.apiKey) {\n return new OtimServerClient({\n type: ServerAccountType.Api,\n appId: config.appId,\n privateKey: config.privateKey,\n publicKey: config.publicKey,\n apiKey: config.apiKey,\n environment: config.environment,\n chains: config.chains,\n defaultChain: config.defaultChain,\n });\n }\n\n return new OtimServerClient({\n type: ServerAccountType.PrivateKey,\n privateKey: config.privateKey,\n environment: config.environment,\n chains: config.chains,\n defaultChain: config.defaultChain,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,yBACX,WACG;CACH,MAAM,EACJ,cACA,cAAcA,mCAAY,SAC1B,GAAG,eACD,UAAU,EAAE;CAEhB,MAAM,gDAA0B;EAC9B,+CAAmB,YAAY;EAC/B,GAAG;EACJ,CAAC;AAEF,UAAS,aAAa,QAAQ,IAAI,OAAO,kBAAkB;AACzD,MAAI,cAAc;AAChB,iBAAc,UAAU,cAAc,WAAW,EAAE;GAGnD,MAAM,qBAAqB,aAAa,WAAW,UAAU,GACzD,eACA,UAAU;AAEd,iBAAc,QAAQ,gBAAgB;;AAGxC,SAAO;GACP;AAEF,QAAO,IAAIC,2BAAU,EAAE,UAAU,CAAC;;;;;ACnDpC,SAAgB,cACd,OACA,cACiC;AACjC,KAAI,UAAU,QAAQ,UAAU,OAC9B,OAAM,IAAI,MAAM,aAAa;;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wBACA;wBACA;wBACA;AAGP,OAAK,2DAA8B,OAAO;AAC1C,OAAK,YAAY,sBAAsB;GACrC,aAAa,OAAO;GACpB,mDAAuB,OAAO,GAAG,EAAE,cAAc,OAAO,QAAQ,GAAG,EAAE;GACtE,CAAC;AAEF,OAAK,UAAU,IAAI,YAAY,OAAO;AAEtC,OAAK,WAAW,IAAIC,uCAAe,KAAK,UAAU;AAClD,OAAK,OAAO,IAAIC,mCAAW,KAAK,WAAW,KAAK,SAAS,KAAK,QAAQ;AACtE,OAAK,SAAS,IAAIC,qCAAa,KAAK,UAAU;AAC9C,OAAK,aAAa,IAAIC,yCAAiB,KAAK,UAAU;AACtD,OAAK,gBAAgB,IAAIC,4CACvB,KAAK,WACL,KAAK,SACL,KAAK,QACN;;;;;;;;;;CAWH,MAAM,OAAsB;AAC1B,QAAM,KAAK,QAAQ,YAAY;;;;;;ACrCnC,SAAgB,uBACd,QACkB;AAClB,KAAI,OAAO,OAAO,WAAW,EAC3B,OAAM,IAAI,MAAM,sCAAsC;AAGxD,KAAI,WAAW,UAAU,OAAO,aAAa,OAAO,OAClD,QAAO,IAAI,iBAAiB;EAC1B,MAAMC,0CAAkB;EACxB,OAAO,OAAO;EACd,YAAY,OAAO;EACnB,WAAW,OAAO;EAClB,QAAQ,OAAO;EACf,aAAa,OAAO;EACpB,QAAQ,OAAO;EACf,cAAc,OAAO;EACtB,CAAC;AAGJ,QAAO,IAAI,iBAAiB;EAC1B,MAAMA,0CAAkB;EACxB,YAAY,OAAO;EACnB,aAAa,OAAO;EACpB,QAAQ,OAAO;EACf,cAAc,OAAO;EACtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.cjs","names":["Environment","APIClient","ApiKeyStamper","TurnkeyClient","ServerAccountType","exhaustiveCheck: never","config: ServerAccountConfig","ActivityClient","AuthClient","ConfigClient","DelegationClient","OrchestrationClient","ServerAccountType"],"sources":["../src/client/api-client.ts","../src/client/utils/asserts.ts","../src/client/server-account.ts","../src/client/server-client.ts","../src/client/create-server-client.ts"],"sourcesContent":["import type { CreateInstanceParameters } from \"@otim/utils/api\";\nimport type { Optional } from \"@otim/utils/helpers\";\n\nimport { Environment, getApiUrl } from \"@otim/sdk-core/config\";\nimport { APIClient, createInstance } from \"@otim/utils/api\";\n\nexport interface CreateServerAPIClientOptions\n extends Omit<CreateInstanceParameters, \"baseURL\"> {\n sessionToken?: Optional<string>;\n environment?: Environment;\n}\n\n/**\n * Creates an API client for server-side requests.\n *\n * Configures the base URL and authentication headers for API communication.\n *\n * @param config - Optional configuration for the API client\n * @returns Configured API client instance\n *\n * @internal\n */\nexport const createServerAPIClient = (\n config?: CreateServerAPIClientOptions,\n) => {\n const {\n sessionToken,\n environment = Environment.Sandbox,\n ...restConfig\n } = config ?? {};\n\n const instance = createInstance({\n baseURL: getApiUrl(environment),\n ...restConfig,\n });\n\n instance.interceptors.request.use(async (requestConfig) => {\n if (sessionToken) {\n requestConfig.headers = requestConfig.headers ?? {};\n\n // If the session token does not start with \"Bearer \", add it.\n const authorizationToken = sessionToken.startsWith(\"Bearer \")\n ? sessionToken\n : `Bearer ${sessionToken}`;\n\n requestConfig.headers.Authorization = authorizationToken;\n }\n\n return requestConfig;\n });\n\n return new APIClient({ instance });\n};\n","export function assertDefined<T>(\n value: T,\n errorMessage: string,\n): asserts value is NonNullable<T> {\n if (value === null || value === undefined) {\n throw new Error(errorMessage);\n }\n}\n","import type {\n ApiAccountConfig,\n OtimAccountSignMessageArgs,\n OtimAccount as OtimAccountType,\n PrivateKeyAccountConfig,\n ServerAccountConfig,\n} from \"@otim/sdk-core/account\";\nimport type { Nullable } from \"@otim/utils/helpers\";\nimport type { Hex } from \"viem\";\n\nimport { ServerAccountType } from \"@otim/sdk-core/account\";\nimport { ApiKeyStamper } from \"@turnkey/api-key-stamper\";\nimport { TurnkeyClient } from \"@turnkey/http\";\nimport { createAccount } from \"@turnkey/viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nimport { assertDefined } from \"./utils/asserts\";\n\nconst TURNKEY_API_URL = \"https://api.turnkey.com\";\n\ntype PrimitiveAccount = {\n signMessage: (args: {\n message: string | { raw: Hex | Uint8Array };\n }) => Promise<Hex>;\n};\n\nconst createApiAccount = async (\n config: ApiAccountConfig,\n): Promise<PrimitiveAccount> => {\n const stamper = new ApiKeyStamper({\n apiPublicKey: config.publicKey,\n apiPrivateKey: config.privateKey,\n });\n\n const client = new TurnkeyClient({ baseUrl: TURNKEY_API_URL }, stamper);\n\n const account = await createAccount({\n organizationId: config.appId,\n signWith: \"0xB54c8E6f303627f392884412ED2C84fFaF4779CA\",\n client,\n });\n\n return {\n signMessage: (args) => account.signMessage(args),\n };\n};\n\nconst createPrivateKeyAccount = (\n config: PrivateKeyAccountConfig,\n): PrimitiveAccount => {\n const account = privateKeyToAccount(config.privateKey);\n\n return {\n signMessage: (args) => account.signMessage(args),\n };\n};\n\nconst initializeAccount = async (\n config: ServerAccountConfig,\n): Promise<PrimitiveAccount> => {\n switch (config.type) {\n case ServerAccountType.Api:\n return createApiAccount(config);\n case ServerAccountType.PrivateKey:\n return createPrivateKeyAccount(config);\n default: {\n const exhaustiveCheck: never = config;\n throw new Error(\n `Unsupported account type: \"${(exhaustiveCheck as ServerAccountConfig).type}\". Supported types are: ${Object.values(ServerAccountType).join(\", \")}`,\n );\n }\n }\n};\n\n/**\n * Server-side account implementation for signing operations.\n *\n * Supports both private key and API authentication methods.\n *\n * @internal\n */\nexport class OtimAccount implements OtimAccountType {\n private account: Nullable<PrimitiveAccount> = null;\n private initialized = false;\n\n constructor(private readonly config: ServerAccountConfig) {}\n\n async initialize(): Promise<void> {\n if (this.initialized) {\n throw new Error(\n \"Account already initialized. The initialize() method should only be called once.\",\n );\n }\n\n this.account = await initializeAccount(this.config);\n this.initialized = true;\n }\n\n async signMessage({ message }: OtimAccountSignMessageArgs) {\n assertDefined(\n this.account,\n \"Account not initialized. Call initialize() before using signMessage().\",\n );\n return this.account.signMessage({ message });\n }\n}\n","import type { ServerAccountConfig } from \"@otim/sdk-core/account\";\nimport type { OtimServerClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient } from \"@otim/utils/api\";\n\nimport {\n createClientContext,\n isApiAccountConfig,\n} from \"@otim/sdk-core/account\";\nimport {\n ActivityClient,\n AuthClient,\n ConfigClient,\n DelegationClient,\n OrchestrationClient,\n} from \"@otim/sdk-core/clients\";\n\nimport { createServerAPIClient } from \"./api-client\";\nimport { OtimAccount } from \"./server-account\";\n\n/**\n * Otim Client for server-side blockchain operations.\n *\n * Provides access to activity, authentication, configuration, delegation, and\n * orchestration services.\n * The client must be initialized before use by calling the init() method.\n\n */\nexport class OtimServerClient {\n private readonly apiClient: APIClient;\n private readonly account: OtimAccount;\n private readonly context: OtimServerClientContext;\n\n readonly activity: ActivityClient;\n readonly auth: AuthClient;\n readonly config: ConfigClient;\n readonly delegation: DelegationClient;\n readonly orchestration: OrchestrationClient;\n\n constructor(config: ServerAccountConfig) {\n this.context = createClientContext(config);\n this.apiClient = createServerAPIClient({\n environment: config.environment,\n ...(isApiAccountConfig(config) ? { sessionToken: config.apiKey } : {}),\n });\n\n this.account = new OtimAccount(config);\n\n this.activity = new ActivityClient(this.apiClient);\n this.auth = new AuthClient(this.apiClient, this.account, this.context);\n this.config = new ConfigClient(this.apiClient);\n this.delegation = new DelegationClient(this.apiClient);\n this.orchestration = new OrchestrationClient(\n this.apiClient,\n this.account,\n this.context,\n );\n }\n\n /**\n * Initializes the Otim Client.\n *\n * This method must be called before using any other client methods.\n * It sets up the authentication account and prepares the client for use.\n *\n * @throws {Error} If the account is already initialized\n */\n async init(): Promise<void> {\n await this.account.initialize();\n }\n}\n","import type { Environment } from \"@otim/sdk-core/config\";\n\nimport { ServerAccountType } from \"@otim/sdk-core/account\";\n\nimport { OtimServerClient } from \"./server-client\";\n\ninterface BaseClientConfig {\n environment?: Environment;\n}\n\ninterface PrivateKeyClientConfig extends BaseClientConfig {\n privateKey: `0x${string}`;\n}\n\ninterface ApiClientConfig extends BaseClientConfig {\n appId: string;\n privateKey: `0x${string}`;\n publicKey: string;\n apiKey?: string;\n}\n\nexport function createOtimServerClient(\n config: PrivateKeyClientConfig,\n): OtimServerClient;\nexport function createOtimServerClient(\n config: ApiClientConfig,\n): OtimServerClient;\nexport function createOtimServerClient(\n config: PrivateKeyClientConfig | ApiClientConfig,\n): OtimServerClient {\n if (\"appId\" in config && config.publicKey && config.apiKey) {\n return new OtimServerClient({\n type: ServerAccountType.Api,\n appId: config.appId,\n privateKey: config.privateKey,\n publicKey: config.publicKey,\n apiKey: config.apiKey,\n environment: config.environment,\n });\n }\n\n return new OtimServerClient({\n type: ServerAccountType.PrivateKey,\n privateKey: config.privateKey,\n environment: config.environment,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,yBACX,WACG;CACH,MAAM,EACJ,cACA,cAAcA,mCAAY,SAC1B,GAAG,eACD,UAAU,EAAE;CAEhB,MAAM,gDAA0B;EAC9B,+CAAmB,YAAY;EAC/B,GAAG;EACJ,CAAC;AAEF,UAAS,aAAa,QAAQ,IAAI,OAAO,kBAAkB;AACzD,MAAI,cAAc;AAChB,iBAAc,UAAU,cAAc,WAAW,EAAE;GAGnD,MAAM,qBAAqB,aAAa,WAAW,UAAU,GACzD,eACA,UAAU;AAEd,iBAAc,QAAQ,gBAAgB;;AAGxC,SAAO;GACP;AAEF,QAAO,IAAIC,2BAAU,EAAE,UAAU,CAAC;;;;;ACnDpC,SAAgB,cACd,OACA,cACiC;AACjC,KAAI,UAAU,QAAQ,UAAU,OAC9B,OAAM,IAAI,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACajC,MAAM,kBAAkB;AAQxB,MAAM,mBAAmB,OACvB,WAC8B;CAC9B,MAAM,UAAU,IAAIC,wCAAc;EAChC,cAAc,OAAO;EACrB,eAAe,OAAO;EACvB,CAAC;CAEF,MAAM,SAAS,IAAIC,6BAAc,EAAE,SAAS,iBAAiB,EAAE,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ClD,OAAK,OAAO,IAAIC,mCAAW,KAAK,WAAW,KAAK,SAAS,KAAK,QAAQ;AACtE,OAAK,SAAS,IAAIC,qCAAa,KAAK,UAAU;AAC9C,OAAK,aAAa,IAAIC,yCAAiB,KAAK,UAAU;AACtD,OAAK,gBAAgB,IAAIC,4CACvB,KAAK,WACL,KAAK,SACL,KAAK,QACN;;;;;;;;;;CAWH,MAAM,OAAsB;AAC1B,QAAM,KAAK,QAAQ,YAAY;;;;;;ACxCnC,SAAgB,uBACd,QACkB;AAClB,KAAI,WAAW,UAAU,OAAO,aAAa,OAAO,OAClD,QAAO,IAAI,iBAAiB;EAC1B,MAAMC,0CAAkB;EACxB,OAAO,OAAO;EACd,YAAY,OAAO;EACnB,WAAW,OAAO;EAClB,QAAQ,OAAO;EACf,aAAa,OAAO;EACrB,CAAC;AAGJ,QAAO,IAAI,iBAAiB;EAC1B,MAAMA,0CAAkB;EACxB,YAAY,OAAO;EACnB,aAAa,OAAO;EACrB,CAAC"}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { ApiAccountConfig, Chain,
|
|
1
|
+
import { ApiAccountConfig, Chain, OtimAccount, PrivateKeyAccountConfig, ServerAccountConfig, ServerAccountConfig as ServerAccountConfig$1, ServerAccountType } from "@otim/sdk-core/account";
|
|
2
2
|
import { Environment, Environment as Environment$1, EnvironmentType } from "@otim/sdk-core/config";
|
|
3
3
|
import { OtimServerClientContext } from "@otim/sdk-core/context";
|
|
4
|
-
import { ActivityClient, ActivityClient as ActivityClient$1, AuthClient, AuthClient as AuthClient$1, ConfigClient, ConfigClient as ConfigClient$1, CreateSettlementResponse, DelegationClient, DelegationClient as DelegationClient$1, OrchestrationClient, OrchestrationClient as OrchestrationClient$1, PrepareSettlementParams,
|
|
4
|
+
import { ActivityClient, ActivityClient as ActivityClient$1, AuthClient, AuthClient as AuthClient$1, BuildSettlementRequest, ConfigClient, ConfigClient as ConfigClient$1, CreateSettlementResponse, DelegationClient, DelegationClient as DelegationClient$1, OrchestrationClient, OrchestrationClient as OrchestrationClient$1, OrchestrationParams, PrepareSettlementParams, SettlementParams, VaultWithdrawSettlementParams, prepareSettlement } from "@otim/sdk-core/clients";
|
|
5
5
|
import { allSupportedChains as chains } from "@otim/utils/chains";
|
|
6
6
|
|
|
7
7
|
//#region src/client/server-client.d.ts
|
|
@@ -38,8 +38,6 @@ declare class OtimServerClient {
|
|
|
38
38
|
//#region src/client/create-server-client.d.ts
|
|
39
39
|
interface BaseClientConfig {
|
|
40
40
|
environment?: Environment$1;
|
|
41
|
-
chains: Chain$1[];
|
|
42
|
-
defaultChain?: Chain$1;
|
|
43
41
|
}
|
|
44
42
|
interface PrivateKeyClientConfig extends BaseClientConfig {
|
|
45
43
|
privateKey: `0x${string}`;
|
|
@@ -53,5 +51,5 @@ interface ApiClientConfig extends BaseClientConfig {
|
|
|
53
51
|
declare function createOtimServerClient(config: PrivateKeyClientConfig): OtimServerClient;
|
|
54
52
|
declare function createOtimServerClient(config: ApiClientConfig): OtimServerClient;
|
|
55
53
|
//#endregion
|
|
56
|
-
export { ActivityClient, type ApiAccountConfig, AuthClient, type Chain, ConfigClient, type CreateSettlementResponse, DelegationClient, Environment, type EnvironmentType, OrchestrationClient, type OtimAccount, OtimServerClient, type OtimServerClientContext, type PrepareSettlementParams, type
|
|
54
|
+
export { ActivityClient, type ApiAccountConfig, AuthClient, type BuildSettlementRequest, type Chain, ConfigClient, type CreateSettlementResponse, DelegationClient, Environment, type EnvironmentType, OrchestrationClient, type OrchestrationParams, type OtimAccount, OtimServerClient, type OtimServerClientContext, type PrepareSettlementParams, type PrivateKeyAccountConfig, type ServerAccountConfig, type ServerAccountType, type SettlementParams, type VaultWithdrawSettlementParams, chains, createOtimServerClient, prepareSettlement };
|
|
57
55
|
//# sourceMappingURL=index.d.cts.map
|
package/dist/index.d.cts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/client/server-client.ts","../src/client/create-server-client.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA2BA;;;AAOmB,cAPN,gBAAA,CAOM;EACI,iBAAA,SAAA;EACG,iBAAA,OAAA;EAEJ,iBAAA,OAAA;EA4BN,SAAA,QAAA,EAlCK,gBAkCL;EAAO,SAAA,IAAA,EAjCN,YAiCM;mBAhCJ;uBACI;0BACG;
|
|
1
|
+
{"version":3,"file":"index.d.cts","names":[],"sources":["../src/client/server-client.ts","../src/client/create-server-client.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA2BA;;;AAOmB,cAPN,gBAAA,CAOM;EACI,iBAAA,SAAA;EACG,iBAAA,OAAA;EAEJ,iBAAA,OAAA;EA4BN,SAAA,QAAA,EAlCK,gBAkCL;EAAO,SAAA,IAAA,EAjCN,YAiCM;mBAhCJ;uBACI;0BACG;EC9BhB,WAAA,CAAA,MAAA,EDgCY,qBC/BN;EAGN;AAA+C;AAWzD;AAGA;;;;;UD0CgB;;;;UC5DN,gBAAA;gBACM;;UAGN,sBAAA,SAA+B;;ADiBzC;UCbU,eAAA,SAAwB,gBDkBb,CAAA;EACJ,KAAA,EAAA,MAAA;EACE,UAAA,EAAA,KAAA,MAAA,EAAA;EACI,SAAA,EAAA,MAAA;EACG,MAAA,CAAA,EAAA,MAAA;;AA8BV,iBC7CA,sBAAA,CD6CA,MAAA,EC5CN,sBD4CM,CAAA,EC3Cb,gBD2Ca;AAAO,iBC1CP,sBAAA,CD0CO,MAAA,ECzCb,eDyCa,CAAA,ECxCpB,gBDwCoB"}
|
package/dist/index.d.mts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Environment, Environment as Environment$1, EnvironmentType } from "@otim/sdk-core/config";
|
|
2
|
-
import { ActivityClient, ActivityClient as ActivityClient$1, AuthClient, AuthClient as AuthClient$1, ConfigClient, ConfigClient as ConfigClient$1, CreateSettlementResponse, DelegationClient, DelegationClient as DelegationClient$1, OrchestrationClient, OrchestrationClient as OrchestrationClient$1, PrepareSettlementParams,
|
|
3
|
-
import { ApiAccountConfig, Chain,
|
|
2
|
+
import { ActivityClient, ActivityClient as ActivityClient$1, AuthClient, AuthClient as AuthClient$1, BuildSettlementRequest, ConfigClient, ConfigClient as ConfigClient$1, CreateSettlementResponse, DelegationClient, DelegationClient as DelegationClient$1, OrchestrationClient, OrchestrationClient as OrchestrationClient$1, OrchestrationParams, PrepareSettlementParams, SettlementParams, VaultWithdrawSettlementParams, prepareSettlement } from "@otim/sdk-core/clients";
|
|
3
|
+
import { ApiAccountConfig, Chain, OtimAccount, PrivateKeyAccountConfig, ServerAccountConfig, ServerAccountConfig as ServerAccountConfig$1, ServerAccountType } from "@otim/sdk-core/account";
|
|
4
4
|
import { allSupportedChains as chains } from "@otim/utils/chains";
|
|
5
5
|
import { OtimServerClientContext } from "@otim/sdk-core/context";
|
|
6
6
|
|
|
@@ -38,8 +38,6 @@ declare class OtimServerClient {
|
|
|
38
38
|
//#region src/client/create-server-client.d.ts
|
|
39
39
|
interface BaseClientConfig {
|
|
40
40
|
environment?: Environment$1;
|
|
41
|
-
chains: Chain$1[];
|
|
42
|
-
defaultChain?: Chain$1;
|
|
43
41
|
}
|
|
44
42
|
interface PrivateKeyClientConfig extends BaseClientConfig {
|
|
45
43
|
privateKey: `0x${string}`;
|
|
@@ -53,5 +51,5 @@ interface ApiClientConfig extends BaseClientConfig {
|
|
|
53
51
|
declare function createOtimServerClient(config: PrivateKeyClientConfig): OtimServerClient;
|
|
54
52
|
declare function createOtimServerClient(config: ApiClientConfig): OtimServerClient;
|
|
55
53
|
//#endregion
|
|
56
|
-
export { ActivityClient, type ApiAccountConfig, AuthClient, type Chain, ConfigClient, type CreateSettlementResponse, DelegationClient, Environment, type EnvironmentType, OrchestrationClient, type OtimAccount, OtimServerClient, type OtimServerClientContext, type PrepareSettlementParams, type
|
|
54
|
+
export { ActivityClient, type ApiAccountConfig, AuthClient, type BuildSettlementRequest, type Chain, ConfigClient, type CreateSettlementResponse, DelegationClient, Environment, type EnvironmentType, OrchestrationClient, type OrchestrationParams, type OtimAccount, OtimServerClient, type OtimServerClientContext, type PrepareSettlementParams, type PrivateKeyAccountConfig, type ServerAccountConfig, type ServerAccountType, type SettlementParams, type VaultWithdrawSettlementParams, chains, createOtimServerClient, prepareSettlement };
|
|
57
55
|
//# sourceMappingURL=index.d.mts.map
|
package/dist/index.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/client/server-client.ts","../src/client/create-server-client.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA2BA;;;AAOmB,cAPN,gBAAA,CAOM;EACI,iBAAA,SAAA;EACG,iBAAA,OAAA;EAEJ,iBAAA,OAAA;EA4BN,SAAA,QAAA,EAlCK,gBAkCL;EAAO,SAAA,IAAA,EAjCN,YAiCM;mBAhCJ;uBACI;0BACG;
|
|
1
|
+
{"version":3,"file":"index.d.mts","names":[],"sources":["../src/client/server-client.ts","../src/client/create-server-client.ts"],"sourcesContent":[],"mappings":";;;;;;;;;;;;;AA2BA;;;AAOmB,cAPN,gBAAA,CAOM;EACI,iBAAA,SAAA;EACG,iBAAA,OAAA;EAEJ,iBAAA,OAAA;EA4BN,SAAA,QAAA,EAlCK,gBAkCL;EAAO,SAAA,IAAA,EAjCN,YAiCM;mBAhCJ;uBACI;0BACG;EC9BhB,WAAA,CAAA,MAAA,EDgCY,qBC/BN;EAGN;AAA+C;AAWzD;AAGA;;;;;UD0CgB;;;;UC5DN,gBAAA;gBACM;;UAGN,sBAAA,SAA+B;;ADiBzC;UCbU,eAAA,SAAwB,gBDkBb,CAAA;EACJ,KAAA,EAAA,MAAA;EACE,UAAA,EAAA,KAAA,MAAA,EAAA;EACI,SAAA,EAAA,MAAA;EACG,MAAA,CAAA,EAAA,MAAA;;AA8BV,iBC7CA,sBAAA,CD6CA,MAAA,EC5CN,sBD4CM,CAAA,EC3Cb,gBD2Ca;AAAO,iBC1CP,sBAAA,CD0CO,MAAA,ECzCb,eDyCa,CAAA,ECxCpB,gBDwCoB"}
|
package/dist/index.mjs
CHANGED
|
@@ -186,23 +186,18 @@ var OtimServerClient = class {
|
|
|
186
186
|
//#endregion
|
|
187
187
|
//#region src/client/create-server-client.ts
|
|
188
188
|
function createOtimServerClient(config) {
|
|
189
|
-
if (config.chains.length === 0) throw new Error("At least one chain must be provided");
|
|
190
189
|
if ("appId" in config && config.publicKey && config.apiKey) return new OtimServerClient({
|
|
191
190
|
type: ServerAccountType.Api,
|
|
192
191
|
appId: config.appId,
|
|
193
192
|
privateKey: config.privateKey,
|
|
194
193
|
publicKey: config.publicKey,
|
|
195
194
|
apiKey: config.apiKey,
|
|
196
|
-
environment: config.environment
|
|
197
|
-
chains: config.chains,
|
|
198
|
-
defaultChain: config.defaultChain
|
|
195
|
+
environment: config.environment
|
|
199
196
|
});
|
|
200
197
|
return new OtimServerClient({
|
|
201
198
|
type: ServerAccountType.PrivateKey,
|
|
202
199
|
privateKey: config.privateKey,
|
|
203
|
-
environment: config.environment
|
|
204
|
-
chains: config.chains,
|
|
205
|
-
defaultChain: config.defaultChain
|
|
200
|
+
environment: config.environment
|
|
206
201
|
});
|
|
207
202
|
}
|
|
208
203
|
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.mjs","names":["Environment","exhaustiveCheck: never","config: ServerAccountConfig","ActivityClient","AuthClient","ConfigClient","DelegationClient","OrchestrationClient"],"sources":["../src/client/api-client.ts","../src/client/utils/asserts.ts","../src/client/server-account.ts","../src/client/server-client.ts","../src/client/create-server-client.ts"],"sourcesContent":["import type { CreateInstanceParameters } from \"@otim/utils/api\";\nimport type { Optional } from \"@otim/utils/helpers\";\n\nimport { Environment, getApiUrl } from \"@otim/sdk-core/config\";\nimport { APIClient, createInstance } from \"@otim/utils/api\";\n\nexport interface CreateServerAPIClientOptions\n extends Omit<CreateInstanceParameters, \"baseURL\"> {\n sessionToken?: Optional<string>;\n environment?: Environment;\n}\n\n/**\n * Creates an API client for server-side requests.\n *\n * Configures the base URL and authentication headers for API communication.\n *\n * @param config - Optional configuration for the API client\n * @returns Configured API client instance\n *\n * @internal\n */\nexport const createServerAPIClient = (\n config?: CreateServerAPIClientOptions,\n) => {\n const {\n sessionToken,\n environment = Environment.Sandbox,\n ...restConfig\n } = config ?? {};\n\n const instance = createInstance({\n baseURL: getApiUrl(environment),\n ...restConfig,\n });\n\n instance.interceptors.request.use(async (requestConfig) => {\n if (sessionToken) {\n requestConfig.headers = requestConfig.headers ?? {};\n\n // If the session token does not start with \"Bearer \", add it.\n const authorizationToken = sessionToken.startsWith(\"Bearer \")\n ? sessionToken\n : `Bearer ${sessionToken}`;\n\n requestConfig.headers.Authorization = authorizationToken;\n }\n\n return requestConfig;\n });\n\n return new APIClient({ instance });\n};\n","export function assertDefined<T>(\n value: T,\n errorMessage: string,\n): asserts value is NonNullable<T> {\n if (value === null || value === undefined) {\n throw new Error(errorMessage);\n }\n}\n","import type {\n ApiAccountConfig,\n OtimAccountSignMessageArgs,\n OtimAccount as OtimAccountType,\n PrivateKeyAccountConfig,\n ServerAccountConfig,\n} from \"@otim/sdk-core/account\";\nimport type { Nullable } from \"@otim/utils/helpers\";\nimport type { Hex } from \"viem\";\n\nimport { ServerAccountType } from \"@otim/sdk-core/account\";\nimport { ApiKeyStamper } from \"@turnkey/api-key-stamper\";\nimport { TurnkeyClient } from \"@turnkey/http\";\nimport { createAccount } from \"@turnkey/viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nimport { assertDefined } from \"./utils/asserts\";\n\nconst TURNKEY_API_URL = \"https://api.turnkey.com\";\n\ntype PrimitiveAccount = {\n signMessage: (args: {\n message: string | { raw: Hex | Uint8Array };\n }) => Promise<Hex>;\n};\n\nconst createApiAccount = async (\n config: ApiAccountConfig,\n): Promise<PrimitiveAccount> => {\n const stamper = new ApiKeyStamper({\n apiPublicKey: config.publicKey,\n apiPrivateKey: config.privateKey,\n });\n\n const client = new TurnkeyClient({ baseUrl: TURNKEY_API_URL }, stamper);\n\n const account = await createAccount({\n organizationId: config.appId,\n signWith: \"0xB54c8E6f303627f392884412ED2C84fFaF4779CA\",\n client,\n });\n\n return {\n signMessage: (args) => account.signMessage(args),\n };\n};\n\nconst createPrivateKeyAccount = (\n config: PrivateKeyAccountConfig,\n): PrimitiveAccount => {\n const account = privateKeyToAccount(config.privateKey);\n\n return {\n signMessage: (args) => account.signMessage(args),\n };\n};\n\nconst initializeAccount = async (\n config: ServerAccountConfig,\n): Promise<PrimitiveAccount> => {\n switch (config.type) {\n case ServerAccountType.Api:\n return createApiAccount(config);\n case ServerAccountType.PrivateKey:\n return createPrivateKeyAccount(config);\n default: {\n const exhaustiveCheck: never = config;\n throw new Error(\n `Unsupported account type: \"${(exhaustiveCheck as ServerAccountConfig).type}\". Supported types are: ${Object.values(ServerAccountType).join(\", \")}`,\n );\n }\n }\n};\n\n/**\n * Server-side account implementation for signing operations.\n *\n * Supports both private key and API authentication methods.\n *\n * @internal\n */\nexport class OtimAccount implements OtimAccountType {\n private account: Nullable<PrimitiveAccount> = null;\n private initialized = false;\n\n constructor(private readonly config: ServerAccountConfig) {}\n\n async initialize(): Promise<void> {\n if (this.initialized) {\n throw new Error(\n \"Account already initialized. The initialize() method should only be called once.\",\n );\n }\n\n this.account = await initializeAccount(this.config);\n this.initialized = true;\n }\n\n async signMessage({ message }: OtimAccountSignMessageArgs) {\n assertDefined(\n this.account,\n \"Account not initialized. Call initialize() before using signMessage().\",\n );\n return this.account.signMessage({ message });\n }\n}\n","import type { ServerAccountConfig } from \"@otim/sdk-core/account\";\nimport type { OtimServerClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient } from \"@otim/utils/api\";\n\nimport {\n createClientContext,\n isApiAccountConfig,\n} from \"@otim/sdk-core/account\";\nimport {\n ActivityClient,\n AuthClient,\n ConfigClient,\n DelegationClient,\n OrchestrationClient,\n} from \"@otim/sdk-core/clients\";\n\nimport { createServerAPIClient } from \"./api-client\";\nimport { OtimAccount } from \"./server-account\";\n\n/**\n * Otim Client for server-side blockchain operations.\n *\n * Provides access to activity, authentication, configuration, delegation, and\n * orchestration services.\n * The client must be initialized before use by calling the init() method.\n\n */\nexport class OtimServerClient {\n private readonly apiClient: APIClient;\n private readonly account: OtimAccount;\n private readonly context: OtimServerClientContext;\n\n readonly activity: ActivityClient;\n readonly auth: AuthClient;\n readonly config: ConfigClient;\n readonly delegation: DelegationClient;\n readonly orchestration: OrchestrationClient;\n\n constructor(config: ServerAccountConfig) {\n this.context = createClientContext(config);\n this.apiClient = createServerAPIClient({\n environment: config.environment,\n ...(isApiAccountConfig(config) ? { sessionToken: config.apiKey } : {}),\n });\n\n this.account = new OtimAccount(config);\n\n this.activity = new ActivityClient(this.apiClient);\n this.auth = new AuthClient(this.apiClient, this.account, this.context);\n this.config = new ConfigClient(this.apiClient);\n this.delegation = new DelegationClient(this.apiClient);\n this.orchestration = new OrchestrationClient(\n this.apiClient,\n this.account,\n this.context,\n );\n }\n\n /**\n * Initializes the Otim Client.\n *\n * This method must be called before using any other client methods.\n * It sets up the authentication account and prepares the client for use.\n *\n * @throws {Error} If the account is already initialized\n */\n async init(): Promise<void> {\n await this.account.initialize();\n }\n}\n","import type { Chain } from \"@otim/sdk-core/account\";\nimport type { Environment } from \"@otim/sdk-core/config\";\n\nimport { ServerAccountType } from \"@otim/sdk-core/account\";\n\nimport { OtimServerClient } from \"./server-client\";\n\ninterface BaseClientConfig {\n environment?: Environment;\n chains: Chain[];\n defaultChain?: Chain;\n}\n\ninterface PrivateKeyClientConfig extends BaseClientConfig {\n privateKey: `0x${string}`;\n}\n\ninterface ApiClientConfig extends BaseClientConfig {\n appId: string;\n privateKey: `0x${string}`;\n publicKey: string;\n apiKey?: string;\n}\n\nexport function createOtimServerClient(\n config: PrivateKeyClientConfig,\n): OtimServerClient;\nexport function createOtimServerClient(\n config: ApiClientConfig,\n): OtimServerClient;\nexport function createOtimServerClient(\n config: PrivateKeyClientConfig | ApiClientConfig,\n): OtimServerClient {\n if (config.chains.length === 0) {\n throw new Error(\"At least one chain must be provided\");\n }\n\n if (\"appId\" in config && config.publicKey && config.apiKey) {\n return new OtimServerClient({\n type: ServerAccountType.Api,\n appId: config.appId,\n privateKey: config.privateKey,\n publicKey: config.publicKey,\n apiKey: config.apiKey,\n environment: config.environment,\n chains: config.chains,\n defaultChain: config.defaultChain,\n });\n }\n\n return new OtimServerClient({\n type: ServerAccountType.PrivateKey,\n privateKey: config.privateKey,\n environment: config.environment,\n chains: config.chains,\n defaultChain: config.defaultChain,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,yBACX,WACG;CACH,MAAM,EACJ,cACA,cAAcA,cAAY,SAC1B,GAAG,eACD,UAAU,EAAE;CAEhB,MAAM,WAAW,eAAe;EAC9B,SAAS,UAAU,YAAY;EAC/B,GAAG;EACJ,CAAC;AAEF,UAAS,aAAa,QAAQ,IAAI,OAAO,kBAAkB;AACzD,MAAI,cAAc;AAChB,iBAAc,UAAU,cAAc,WAAW,EAAE;GAGnD,MAAM,qBAAqB,aAAa,WAAW,UAAU,GACzD,eACA,UAAU;AAEd,iBAAc,QAAQ,gBAAgB;;AAGxC,SAAO;GACP;AAEF,QAAO,IAAI,UAAU,EAAE,UAAU,CAAC;;;;;ACnDpC,SAAgB,cACd,OACA,cACiC;AACjC,KAAI,UAAU,QAAQ,UAAU,OAC9B,OAAM,IAAI,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACajC,MAAM,kBAAkB;AAQxB,MAAM,mBAAmB,OACvB,WAC8B;CAC9B,MAAM,UAAU,IAAI,cAAc;EAChC,cAAc,OAAO;EACrB,eAAe,OAAO;EACvB,CAAC;CAEF,MAAM,SAAS,IAAI,cAAc,EAAE,SAAS,iBAAiB,EAAE,QAAQ;CAEvE,MAAM,UAAU,MAAM,cAAc;EAClC,gBAAgB,OAAO;EACvB,UAAU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,KAAK,QAAQ;AACtE,OAAK,SAAS,IAAIC,eAAa,KAAK,UAAU;AAC9C,OAAK,aAAa,IAAIC,mBAAiB,KAAK,UAAU;AACtD,OAAK,gBAAgB,IAAIC,sBACvB,KAAK,WACL,KAAK,SACL,KAAK,QACN;;;;;;;;;;CAWH,MAAM,OAAsB;AAC1B,QAAM,KAAK,QAAQ,YAAY;;;;;;ACrCnC,SAAgB,uBACd,QACkB;AAClB,KAAI,OAAO,OAAO,WAAW,EAC3B,OAAM,IAAI,MAAM,sCAAsC;AAGxD,KAAI,WAAW,UAAU,OAAO,aAAa,OAAO,OAClD,QAAO,IAAI,iBAAiB;EAC1B,MAAM,kBAAkB;EACxB,OAAO,OAAO;EACd,YAAY,OAAO;EACnB,WAAW,OAAO;EAClB,QAAQ,OAAO;EACf,aAAa,OAAO;EACpB,QAAQ,OAAO;EACf,cAAc,OAAO;EACtB,CAAC;AAGJ,QAAO,IAAI,iBAAiB;EAC1B,MAAM,kBAAkB;EACxB,YAAY,OAAO;EACnB,aAAa,OAAO;EACpB,QAAQ,OAAO;EACf,cAAc,OAAO;EACtB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.mjs","names":["Environment","exhaustiveCheck: never","config: ServerAccountConfig","ActivityClient","AuthClient","ConfigClient","DelegationClient","OrchestrationClient"],"sources":["../src/client/api-client.ts","../src/client/utils/asserts.ts","../src/client/server-account.ts","../src/client/server-client.ts","../src/client/create-server-client.ts"],"sourcesContent":["import type { CreateInstanceParameters } from \"@otim/utils/api\";\nimport type { Optional } from \"@otim/utils/helpers\";\n\nimport { Environment, getApiUrl } from \"@otim/sdk-core/config\";\nimport { APIClient, createInstance } from \"@otim/utils/api\";\n\nexport interface CreateServerAPIClientOptions\n extends Omit<CreateInstanceParameters, \"baseURL\"> {\n sessionToken?: Optional<string>;\n environment?: Environment;\n}\n\n/**\n * Creates an API client for server-side requests.\n *\n * Configures the base URL and authentication headers for API communication.\n *\n * @param config - Optional configuration for the API client\n * @returns Configured API client instance\n *\n * @internal\n */\nexport const createServerAPIClient = (\n config?: CreateServerAPIClientOptions,\n) => {\n const {\n sessionToken,\n environment = Environment.Sandbox,\n ...restConfig\n } = config ?? {};\n\n const instance = createInstance({\n baseURL: getApiUrl(environment),\n ...restConfig,\n });\n\n instance.interceptors.request.use(async (requestConfig) => {\n if (sessionToken) {\n requestConfig.headers = requestConfig.headers ?? {};\n\n // If the session token does not start with \"Bearer \", add it.\n const authorizationToken = sessionToken.startsWith(\"Bearer \")\n ? sessionToken\n : `Bearer ${sessionToken}`;\n\n requestConfig.headers.Authorization = authorizationToken;\n }\n\n return requestConfig;\n });\n\n return new APIClient({ instance });\n};\n","export function assertDefined<T>(\n value: T,\n errorMessage: string,\n): asserts value is NonNullable<T> {\n if (value === null || value === undefined) {\n throw new Error(errorMessage);\n }\n}\n","import type {\n ApiAccountConfig,\n OtimAccountSignMessageArgs,\n OtimAccount as OtimAccountType,\n PrivateKeyAccountConfig,\n ServerAccountConfig,\n} from \"@otim/sdk-core/account\";\nimport type { Nullable } from \"@otim/utils/helpers\";\nimport type { Hex } from \"viem\";\n\nimport { ServerAccountType } from \"@otim/sdk-core/account\";\nimport { ApiKeyStamper } from \"@turnkey/api-key-stamper\";\nimport { TurnkeyClient } from \"@turnkey/http\";\nimport { createAccount } from \"@turnkey/viem\";\nimport { privateKeyToAccount } from \"viem/accounts\";\n\nimport { assertDefined } from \"./utils/asserts\";\n\nconst TURNKEY_API_URL = \"https://api.turnkey.com\";\n\ntype PrimitiveAccount = {\n signMessage: (args: {\n message: string | { raw: Hex | Uint8Array };\n }) => Promise<Hex>;\n};\n\nconst createApiAccount = async (\n config: ApiAccountConfig,\n): Promise<PrimitiveAccount> => {\n const stamper = new ApiKeyStamper({\n apiPublicKey: config.publicKey,\n apiPrivateKey: config.privateKey,\n });\n\n const client = new TurnkeyClient({ baseUrl: TURNKEY_API_URL }, stamper);\n\n const account = await createAccount({\n organizationId: config.appId,\n signWith: \"0xB54c8E6f303627f392884412ED2C84fFaF4779CA\",\n client,\n });\n\n return {\n signMessage: (args) => account.signMessage(args),\n };\n};\n\nconst createPrivateKeyAccount = (\n config: PrivateKeyAccountConfig,\n): PrimitiveAccount => {\n const account = privateKeyToAccount(config.privateKey);\n\n return {\n signMessage: (args) => account.signMessage(args),\n };\n};\n\nconst initializeAccount = async (\n config: ServerAccountConfig,\n): Promise<PrimitiveAccount> => {\n switch (config.type) {\n case ServerAccountType.Api:\n return createApiAccount(config);\n case ServerAccountType.PrivateKey:\n return createPrivateKeyAccount(config);\n default: {\n const exhaustiveCheck: never = config;\n throw new Error(\n `Unsupported account type: \"${(exhaustiveCheck as ServerAccountConfig).type}\". Supported types are: ${Object.values(ServerAccountType).join(\", \")}`,\n );\n }\n }\n};\n\n/**\n * Server-side account implementation for signing operations.\n *\n * Supports both private key and API authentication methods.\n *\n * @internal\n */\nexport class OtimAccount implements OtimAccountType {\n private account: Nullable<PrimitiveAccount> = null;\n private initialized = false;\n\n constructor(private readonly config: ServerAccountConfig) {}\n\n async initialize(): Promise<void> {\n if (this.initialized) {\n throw new Error(\n \"Account already initialized. The initialize() method should only be called once.\",\n );\n }\n\n this.account = await initializeAccount(this.config);\n this.initialized = true;\n }\n\n async signMessage({ message }: OtimAccountSignMessageArgs) {\n assertDefined(\n this.account,\n \"Account not initialized. Call initialize() before using signMessage().\",\n );\n return this.account.signMessage({ message });\n }\n}\n","import type { ServerAccountConfig } from \"@otim/sdk-core/account\";\nimport type { OtimServerClientContext } from \"@otim/sdk-core/context\";\nimport type { APIClient } from \"@otim/utils/api\";\n\nimport {\n createClientContext,\n isApiAccountConfig,\n} from \"@otim/sdk-core/account\";\nimport {\n ActivityClient,\n AuthClient,\n ConfigClient,\n DelegationClient,\n OrchestrationClient,\n} from \"@otim/sdk-core/clients\";\n\nimport { createServerAPIClient } from \"./api-client\";\nimport { OtimAccount } from \"./server-account\";\n\n/**\n * Otim Client for server-side blockchain operations.\n *\n * Provides access to activity, authentication, configuration, delegation, and\n * orchestration services.\n * The client must be initialized before use by calling the init() method.\n\n */\nexport class OtimServerClient {\n private readonly apiClient: APIClient;\n private readonly account: OtimAccount;\n private readonly context: OtimServerClientContext;\n\n readonly activity: ActivityClient;\n readonly auth: AuthClient;\n readonly config: ConfigClient;\n readonly delegation: DelegationClient;\n readonly orchestration: OrchestrationClient;\n\n constructor(config: ServerAccountConfig) {\n this.context = createClientContext(config);\n this.apiClient = createServerAPIClient({\n environment: config.environment,\n ...(isApiAccountConfig(config) ? { sessionToken: config.apiKey } : {}),\n });\n\n this.account = new OtimAccount(config);\n\n this.activity = new ActivityClient(this.apiClient);\n this.auth = new AuthClient(this.apiClient, this.account, this.context);\n this.config = new ConfigClient(this.apiClient);\n this.delegation = new DelegationClient(this.apiClient);\n this.orchestration = new OrchestrationClient(\n this.apiClient,\n this.account,\n this.context,\n );\n }\n\n /**\n * Initializes the Otim Client.\n *\n * This method must be called before using any other client methods.\n * It sets up the authentication account and prepares the client for use.\n *\n * @throws {Error} If the account is already initialized\n */\n async init(): Promise<void> {\n await this.account.initialize();\n }\n}\n","import type { Environment } from \"@otim/sdk-core/config\";\n\nimport { ServerAccountType } from \"@otim/sdk-core/account\";\n\nimport { OtimServerClient } from \"./server-client\";\n\ninterface BaseClientConfig {\n environment?: Environment;\n}\n\ninterface PrivateKeyClientConfig extends BaseClientConfig {\n privateKey: `0x${string}`;\n}\n\ninterface ApiClientConfig extends BaseClientConfig {\n appId: string;\n privateKey: `0x${string}`;\n publicKey: string;\n apiKey?: string;\n}\n\nexport function createOtimServerClient(\n config: PrivateKeyClientConfig,\n): OtimServerClient;\nexport function createOtimServerClient(\n config: ApiClientConfig,\n): OtimServerClient;\nexport function createOtimServerClient(\n config: PrivateKeyClientConfig | ApiClientConfig,\n): OtimServerClient {\n if (\"appId\" in config && config.publicKey && config.apiKey) {\n return new OtimServerClient({\n type: ServerAccountType.Api,\n appId: config.appId,\n privateKey: config.privateKey,\n publicKey: config.publicKey,\n apiKey: config.apiKey,\n environment: config.environment,\n });\n }\n\n return new OtimServerClient({\n type: ServerAccountType.PrivateKey,\n privateKey: config.privateKey,\n environment: config.environment,\n });\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsBA,MAAa,yBACX,WACG;CACH,MAAM,EACJ,cACA,cAAcA,cAAY,SAC1B,GAAG,eACD,UAAU,EAAE;CAEhB,MAAM,WAAW,eAAe;EAC9B,SAAS,UAAU,YAAY;EAC/B,GAAG;EACJ,CAAC;AAEF,UAAS,aAAa,QAAQ,IAAI,OAAO,kBAAkB;AACzD,MAAI,cAAc;AAChB,iBAAc,UAAU,cAAc,WAAW,EAAE;GAGnD,MAAM,qBAAqB,aAAa,WAAW,UAAU,GACzD,eACA,UAAU;AAEd,iBAAc,QAAQ,gBAAgB;;AAGxC,SAAO;GACP;AAEF,QAAO,IAAI,UAAU,EAAE,UAAU,CAAC;;;;;ACnDpC,SAAgB,cACd,OACA,cACiC;AACjC,KAAI,UAAU,QAAQ,UAAU,OAC9B,OAAM,IAAI,MAAM,aAAa;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACajC,MAAM,kBAAkB;AAQxB,MAAM,mBAAmB,OACvB,WAC8B;CAC9B,MAAM,UAAU,IAAI,cAAc;EAChC,cAAc,OAAO;EACrB,eAAe,OAAO;EACvB,CAAC;CAEF,MAAM,SAAS,IAAI,cAAc,EAAE,SAAS,iBAAiB,EAAE,QAAQ;CAEvE,MAAM,UAAU,MAAM,cAAc;EAClC,gBAAgB,OAAO;EACvB,UAAU;EACV;EACD,CAAC;AAEF,QAAO,EACL,cAAc,SAAS,QAAQ,YAAY,KAAK,EACjD;;AAGH,MAAM,2BACJ,WACqB;CACrB,MAAM,UAAU,oBAAoB,OAAO,WAAW;AAEtD,QAAO,EACL,cAAc,SAAS,QAAQ,YAAY,KAAK,EACjD;;AAGH,MAAM,oBAAoB,OACxB,WAC8B;AAC9B,SAAQ,OAAO,MAAf;EACE,KAAK,kBAAkB,IACrB,QAAO,iB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UAAU,OAAO,aAAa,OAAO,OAClD,QAAO,IAAI,iBAAiB;EAC1B,MAAM,kBAAkB;EACxB,OAAO,OAAO;EACd,YAAY,OAAO;EACnB,WAAW,OAAO;EAClB,QAAQ,OAAO;EACf,aAAa,OAAO;EACrB,CAAC;AAGJ,QAAO,IAAI,iBAAiB;EAC1B,MAAM,kBAAkB;EACxB,YAAY,OAAO;EACnB,aAAa,OAAO;EACrB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@otim/sdk-server",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.10",
|
|
4
4
|
"description": "Otim's TypeScript SDK for blockchain automation and smart contract interactions",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -61,13 +61,13 @@
|
|
|
61
61
|
"tsdown": "^0.16.5",
|
|
62
62
|
"typescript-eslint": "^8.47.0",
|
|
63
63
|
"vitest": "^4.0.10",
|
|
64
|
-
"@
|
|
65
|
-
"@otim/typescript-config": "0.0.0"
|
|
64
|
+
"@testing-library/user-event": "^14.6.1",
|
|
65
|
+
"@otim/typescript-config": "0.0.0",
|
|
66
|
+
"@otim/eslint-config": "0.0.1"
|
|
66
67
|
},
|
|
67
68
|
"dependencies": {
|
|
68
|
-
"@otim/utils": "0.0.
|
|
69
|
+
"@otim/utils": "0.0.7",
|
|
69
70
|
"@t3-oss/env-core": "^0.13.8",
|
|
70
|
-
"@testing-library/user-event": "^14.6.1",
|
|
71
71
|
"@turnkey/api-key-stamper": "^0.5.0",
|
|
72
72
|
"@turnkey/core": "^1.7.0",
|
|
73
73
|
"@turnkey/http": "^3.15.0",
|
|
@@ -79,8 +79,8 @@
|
|
|
79
79
|
"axios": "^1.13.2",
|
|
80
80
|
"viem": "^2.39.3",
|
|
81
81
|
"ws": "^8.18.3",
|
|
82
|
-
"zod": "^4.1
|
|
83
|
-
"@otim/sdk-core": "0.0.
|
|
82
|
+
"zod": "^4.2.1",
|
|
83
|
+
"@otim/sdk-core": "0.0.10"
|
|
84
84
|
},
|
|
85
85
|
"peerDependencies": {
|
|
86
86
|
"@wagmi/core": "2.x",
|