@imtbl/generated-clients 2.8.1-alpha.0 → 2.9.0-alpha.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/index.js +2 -2
- package/dist/node/index.cjs +3 -3
- package/dist/node/index.js +2 -2
- package/dist/types/magic-tee/api.d.ts +2 -2
- package/dist/types/magic-tee/base.d.ts +1 -1
- package/dist/types/magic-tee/common.d.ts +1 -1
- package/dist/types/magic-tee/configuration.d.ts +1 -1
- package/dist/types/magic-tee/domain/sign-operations-api.d.ts +201 -0
- package/dist/types/magic-tee/domain/wallet-api.d.ts +16 -8
- package/dist/types/magic-tee/index.d.ts +1 -1
- package/dist/types/magic-tee/models/chain.d.ts +3 -1
- package/dist/types/magic-tee/models/create-wallet-request-model.d.ts +3 -4
- package/dist/types/magic-tee/models/httpvalidation-error.d.ts +1 -1
- package/dist/types/magic-tee/models/index.d.ts +2 -2
- package/dist/types/magic-tee/models/sign-data-request.d.ts +1 -8
- package/dist/types/magic-tee/models/sign-data-response.d.ts +1 -1
- package/dist/types/magic-tee/models/sign-message-request.d.ts +24 -0
- package/dist/types/magic-tee/models/sign-message-response.d.ts +42 -0
- package/dist/types/magic-tee/models/validation-error-loc-inner.d.ts +1 -1
- package/dist/types/magic-tee/models/validation-error.d.ts +1 -1
- package/dist/types/magic-tee/models/wallet-response-model.d.ts +1 -1
- package/dist/types/magic-tee-api-clients.d.ts +2 -2
- package/package.json +1 -1
- package/dist/types/magic-tee/domain/transaction-api.d.ts +0 -184
- package/dist/types/magic-tee/models/personal-sign-request.d.ts +0 -31
- package/dist/types/magic-tee/models/personal-sign-response.d.ts +0 -42
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TEE Express
|
|
3
|
-
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For
|
|
3
|
+
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For signing messages, encode your data as base64: ```typescript const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); ``` For signing transaction data or other structured data, provide a keccak256 hash: ```typescript import { MessageTypes, SignTypedDataVersion, TypedDataUtils, TypedDataV1, TypedMessage, typedSignatureHash, } from \'@metamask/eth-sig-util\'; import { resolveProperties, Signature, Transaction, TransactionLike, TransactionRequest } from \'ethers\'; const computeEip712Hash = ( data: TypedMessage<MessageTypes>, version: SignTypedDataVersion.V3 | SignTypedDataVersion.V4, ): string => { const hashBuffer = TypedDataUtils.eip712Hash(data, version); return \'0x\' + hashBuffer.toString(\'hex\'); }; const personalSign = async (data: string) => { const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); const body = { message_base64: message, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/message\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV1 = async (data: TypedDataV1) => { const rawDataHash = typedSignatureHash(data); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV3 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V3); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV4 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V4); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTransaction = async (tx: TransactionRequest) => { const resolvedTx = await resolveProperties(tx); const txForSigning = { ...resolvedTx }; delete txForSigning.from; const btx = Transaction.from(txForSigning as TransactionLike); const body = { raw_data_hash: btx.unsignedHash, chain: \'ETH\' }; const res = await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); const { r, s, v } = res.json(); btx.signature = Signature.from({ r, s, v }); return btx.serialized; }; ```
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: 0.1.0
|
|
6
6
|
*
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
export * from './domain/
|
|
12
|
+
export * from './domain/sign-operations-api';
|
|
13
13
|
export * from './domain/wallet-api';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TEE Express
|
|
3
|
-
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For
|
|
3
|
+
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For signing messages, encode your data as base64: ```typescript const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); ``` For signing transaction data or other structured data, provide a keccak256 hash: ```typescript import { MessageTypes, SignTypedDataVersion, TypedDataUtils, TypedDataV1, TypedMessage, typedSignatureHash, } from \'@metamask/eth-sig-util\'; import { resolveProperties, Signature, Transaction, TransactionLike, TransactionRequest } from \'ethers\'; const computeEip712Hash = ( data: TypedMessage<MessageTypes>, version: SignTypedDataVersion.V3 | SignTypedDataVersion.V4, ): string => { const hashBuffer = TypedDataUtils.eip712Hash(data, version); return \'0x\' + hashBuffer.toString(\'hex\'); }; const personalSign = async (data: string) => { const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); const body = { message_base64: message, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/message\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV1 = async (data: TypedDataV1) => { const rawDataHash = typedSignatureHash(data); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV3 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V3); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV4 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V4); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTransaction = async (tx: TransactionRequest) => { const resolvedTx = await resolveProperties(tx); const txForSigning = { ...resolvedTx }; delete txForSigning.from; const btx = Transaction.from(txForSigning as TransactionLike); const body = { raw_data_hash: btx.unsignedHash, chain: \'ETH\' }; const res = await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); const { r, s, v } = res.json(); btx.signature = Signature.from({ r, s, v }); return btx.serialized; }; ```
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: 0.1.0
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TEE Express
|
|
3
|
-
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For
|
|
3
|
+
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For signing messages, encode your data as base64: ```typescript const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); ``` For signing transaction data or other structured data, provide a keccak256 hash: ```typescript import { MessageTypes, SignTypedDataVersion, TypedDataUtils, TypedDataV1, TypedMessage, typedSignatureHash, } from \'@metamask/eth-sig-util\'; import { resolveProperties, Signature, Transaction, TransactionLike, TransactionRequest } from \'ethers\'; const computeEip712Hash = ( data: TypedMessage<MessageTypes>, version: SignTypedDataVersion.V3 | SignTypedDataVersion.V4, ): string => { const hashBuffer = TypedDataUtils.eip712Hash(data, version); return \'0x\' + hashBuffer.toString(\'hex\'); }; const personalSign = async (data: string) => { const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); const body = { message_base64: message, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/message\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV1 = async (data: TypedDataV1) => { const rawDataHash = typedSignatureHash(data); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV3 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V3); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV4 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V4); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTransaction = async (tx: TransactionRequest) => { const resolvedTx = await resolveProperties(tx); const txForSigning = { ...resolvedTx }; delete txForSigning.from; const btx = Transaction.from(txForSigning as TransactionLike); const body = { raw_data_hash: btx.unsignedHash, chain: \'ETH\' }; const res = await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); const { r, s, v } = res.json(); btx.signature = Signature.from({ r, s, v }); return btx.serialized; }; ```
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: 0.1.0
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TEE Express
|
|
3
|
-
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For
|
|
3
|
+
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For signing messages, encode your data as base64: ```typescript const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); ``` For signing transaction data or other structured data, provide a keccak256 hash: ```typescript import { MessageTypes, SignTypedDataVersion, TypedDataUtils, TypedDataV1, TypedMessage, typedSignatureHash, } from \'@metamask/eth-sig-util\'; import { resolveProperties, Signature, Transaction, TransactionLike, TransactionRequest } from \'ethers\'; const computeEip712Hash = ( data: TypedMessage<MessageTypes>, version: SignTypedDataVersion.V3 | SignTypedDataVersion.V4, ): string => { const hashBuffer = TypedDataUtils.eip712Hash(data, version); return \'0x\' + hashBuffer.toString(\'hex\'); }; const personalSign = async (data: string) => { const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); const body = { message_base64: message, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/message\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV1 = async (data: TypedDataV1) => { const rawDataHash = typedSignatureHash(data); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV3 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V3); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV4 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V4); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTransaction = async (tx: TransactionRequest) => { const resolvedTx = await resolveProperties(tx); const txForSigning = { ...resolvedTx }; delete txForSigning.from; const btx = Transaction.from(txForSigning as TransactionLike); const body = { raw_data_hash: btx.unsignedHash, chain: \'ETH\' }; const res = await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); const { r, s, v } = res.json(); btx.signature = Signature.from({ r, s, v }); return btx.serialized; }; ```
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: 0.1.0
|
|
6
6
|
*
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* TEE Express
|
|
3
|
+
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For signing messages, encode your data as base64: ```typescript const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); ``` For signing transaction data or other structured data, provide a keccak256 hash: ```typescript import { MessageTypes, SignTypedDataVersion, TypedDataUtils, TypedDataV1, TypedMessage, typedSignatureHash, } from \'@metamask/eth-sig-util\'; import { resolveProperties, Signature, Transaction, TransactionLike, TransactionRequest } from \'ethers\'; const computeEip712Hash = ( data: TypedMessage<MessageTypes>, version: SignTypedDataVersion.V3 | SignTypedDataVersion.V4, ): string => { const hashBuffer = TypedDataUtils.eip712Hash(data, version); return \'0x\' + hashBuffer.toString(\'hex\'); }; const personalSign = async (data: string) => { const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); const body = { message_base64: message, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/message\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV1 = async (data: TypedDataV1) => { const rawDataHash = typedSignatureHash(data); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV3 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V3); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV4 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V4); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTransaction = async (tx: TransactionRequest) => { const resolvedTx = await resolveProperties(tx); const txForSigning = { ...resolvedTx }; delete txForSigning.from; const btx = Transaction.from(txForSigning as TransactionLike); const body = { raw_data_hash: btx.unsignedHash, chain: \'ETH\' }; const res = await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); const { r, s, v } = res.json(); btx.signature = Signature.from({ r, s, v }); return btx.serialized; }; ```
|
|
4
|
+
*
|
|
5
|
+
* The version of the OpenAPI document: 0.1.0
|
|
6
|
+
*
|
|
7
|
+
*
|
|
8
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
9
|
+
* https://openapi-generator.tech
|
|
10
|
+
* Do not edit the class manually.
|
|
11
|
+
*/
|
|
12
|
+
import type { Configuration } from '../configuration';
|
|
13
|
+
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
|
|
14
|
+
import { RequestArgs, BaseAPI } from '../base';
|
|
15
|
+
import { Chain } from '../models';
|
|
16
|
+
import { SignDataRequest } from '../models';
|
|
17
|
+
import { SignDataResponse } from '../models';
|
|
18
|
+
import { SignMessageRequest } from '../models';
|
|
19
|
+
import { SignMessageResponse } from '../models';
|
|
20
|
+
/**
|
|
21
|
+
* SignOperationsApi - axios parameter creator
|
|
22
|
+
* @export
|
|
23
|
+
*/
|
|
24
|
+
export declare const SignOperationsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
25
|
+
/**
|
|
26
|
+
* Signs a hash of arbitrary data using the wallet\'s private key. **Example cURL:** ```bash curl -X POST \'https://tee.express.magiclabs.com/v1/wallet/sign/data\' \\ -H \'Content-Type: application/json\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' \\ -d \'{ \"chain\": \"ETH\", \"raw_data_hash\": \"0xabc123def4567890abc123def4567890abc123def4567890abc123def4567890\" }\' ``` **Example Response:** ```json { \"message_hash\": \"0xabc123def4567890abc123def4567890abc123def4567890abc123def4567890\", \"signature\": \"0x8e7d6c5b4a3928172635445566778899aabbccddeeff00112233445566778899\", \"r\": \"0x3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef1234\", \"s\": \"0x4e5f678901234567890abcdef1234567890abcdef1234567890abcdef123456\", \"v\": \"27\" } ```
|
|
27
|
+
* @summary Sign data using the wallet\'s private key.
|
|
28
|
+
* @param {Chain} xMagicChain
|
|
29
|
+
* @param {SignDataRequest} signDataRequest
|
|
30
|
+
* @param {string} [xMagicAPIKey]
|
|
31
|
+
* @param {string} [xMagicSecretKey]
|
|
32
|
+
* @param {string} [xOIDCProviderID]
|
|
33
|
+
* @param {*} [options] Override http request option.
|
|
34
|
+
* @throws {RequiredError}
|
|
35
|
+
*/
|
|
36
|
+
signDataV1WalletSignDataPost: (xMagicChain: Chain, signDataRequest: SignDataRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
37
|
+
/**
|
|
38
|
+
* Signs an arbitrary message using the wallet\'s private key. Useful for authentication and off-chain verification. **Example cURL:** ```bash curl -X POST \'https://tee.express.magiclabs.com/v1/wallet/sign/message\' \\ -H \'Content-Type: application/json\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' \\ -d \'{ \"chain\": \"ETH\", \"message_base64\": \"bm9uZQ==\" }\' ``` **Example Response:** ```json { \"signature\": \"0x0cebb670d8375ac74122b46c44def7e1ce593e80434a3e6557108ae124f8b44f3c5068fc104279fe7f51918cbe4c249d707bc1c0ce2ffb6d201d3cf4e2fdee8d1b\", \"r\": \"0x0cebb670d8375ac74122b46c44def7e1ce593e80434a3e6557108ae124f8b44f\", \"s\": \"0x3c5068fc104279fe7f51918cbe4c249d707bc1c0ce2ffb6d201d3cf4e2fdee8d\", \"v\": \"27\" } ```
|
|
39
|
+
* @summary Sign a message using the wallet\'s private key.
|
|
40
|
+
* @param {Chain} xMagicChain
|
|
41
|
+
* @param {SignMessageRequest} signMessageRequest
|
|
42
|
+
* @param {string} [xMagicAPIKey]
|
|
43
|
+
* @param {string} [xMagicSecretKey]
|
|
44
|
+
* @param {string} [xOIDCProviderID]
|
|
45
|
+
* @param {*} [options] Override http request option.
|
|
46
|
+
* @throws {RequiredError}
|
|
47
|
+
*/
|
|
48
|
+
signMessageV1WalletSignMessagePost: (xMagicChain: Chain, signMessageRequest: SignMessageRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
49
|
+
};
|
|
50
|
+
/**
|
|
51
|
+
* SignOperationsApi - functional programming interface
|
|
52
|
+
* @export
|
|
53
|
+
*/
|
|
54
|
+
export declare const SignOperationsApiFp: (configuration?: Configuration) => {
|
|
55
|
+
/**
|
|
56
|
+
* Signs a hash of arbitrary data using the wallet\'s private key. **Example cURL:** ```bash curl -X POST \'https://tee.express.magiclabs.com/v1/wallet/sign/data\' \\ -H \'Content-Type: application/json\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' \\ -d \'{ \"chain\": \"ETH\", \"raw_data_hash\": \"0xabc123def4567890abc123def4567890abc123def4567890abc123def4567890\" }\' ``` **Example Response:** ```json { \"message_hash\": \"0xabc123def4567890abc123def4567890abc123def4567890abc123def4567890\", \"signature\": \"0x8e7d6c5b4a3928172635445566778899aabbccddeeff00112233445566778899\", \"r\": \"0x3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef1234\", \"s\": \"0x4e5f678901234567890abcdef1234567890abcdef1234567890abcdef123456\", \"v\": \"27\" } ```
|
|
57
|
+
* @summary Sign data using the wallet\'s private key.
|
|
58
|
+
* @param {Chain} xMagicChain
|
|
59
|
+
* @param {SignDataRequest} signDataRequest
|
|
60
|
+
* @param {string} [xMagicAPIKey]
|
|
61
|
+
* @param {string} [xMagicSecretKey]
|
|
62
|
+
* @param {string} [xOIDCProviderID]
|
|
63
|
+
* @param {*} [options] Override http request option.
|
|
64
|
+
* @throws {RequiredError}
|
|
65
|
+
*/
|
|
66
|
+
signDataV1WalletSignDataPost(xMagicChain: Chain, signDataRequest: SignDataRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SignDataResponse>>;
|
|
67
|
+
/**
|
|
68
|
+
* Signs an arbitrary message using the wallet\'s private key. Useful for authentication and off-chain verification. **Example cURL:** ```bash curl -X POST \'https://tee.express.magiclabs.com/v1/wallet/sign/message\' \\ -H \'Content-Type: application/json\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' \\ -d \'{ \"chain\": \"ETH\", \"message_base64\": \"bm9uZQ==\" }\' ``` **Example Response:** ```json { \"signature\": \"0x0cebb670d8375ac74122b46c44def7e1ce593e80434a3e6557108ae124f8b44f3c5068fc104279fe7f51918cbe4c249d707bc1c0ce2ffb6d201d3cf4e2fdee8d1b\", \"r\": \"0x0cebb670d8375ac74122b46c44def7e1ce593e80434a3e6557108ae124f8b44f\", \"s\": \"0x3c5068fc104279fe7f51918cbe4c249d707bc1c0ce2ffb6d201d3cf4e2fdee8d\", \"v\": \"27\" } ```
|
|
69
|
+
* @summary Sign a message using the wallet\'s private key.
|
|
70
|
+
* @param {Chain} xMagicChain
|
|
71
|
+
* @param {SignMessageRequest} signMessageRequest
|
|
72
|
+
* @param {string} [xMagicAPIKey]
|
|
73
|
+
* @param {string} [xMagicSecretKey]
|
|
74
|
+
* @param {string} [xOIDCProviderID]
|
|
75
|
+
* @param {*} [options] Override http request option.
|
|
76
|
+
* @throws {RequiredError}
|
|
77
|
+
*/
|
|
78
|
+
signMessageV1WalletSignMessagePost(xMagicChain: Chain, signMessageRequest: SignMessageRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SignMessageResponse>>;
|
|
79
|
+
};
|
|
80
|
+
/**
|
|
81
|
+
* SignOperationsApi - factory interface
|
|
82
|
+
* @export
|
|
83
|
+
*/
|
|
84
|
+
export declare const SignOperationsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
85
|
+
/**
|
|
86
|
+
* Signs a hash of arbitrary data using the wallet\'s private key. **Example cURL:** ```bash curl -X POST \'https://tee.express.magiclabs.com/v1/wallet/sign/data\' \\ -H \'Content-Type: application/json\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' \\ -d \'{ \"chain\": \"ETH\", \"raw_data_hash\": \"0xabc123def4567890abc123def4567890abc123def4567890abc123def4567890\" }\' ``` **Example Response:** ```json { \"message_hash\": \"0xabc123def4567890abc123def4567890abc123def4567890abc123def4567890\", \"signature\": \"0x8e7d6c5b4a3928172635445566778899aabbccddeeff00112233445566778899\", \"r\": \"0x3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef1234\", \"s\": \"0x4e5f678901234567890abcdef1234567890abcdef1234567890abcdef123456\", \"v\": \"27\" } ```
|
|
87
|
+
* @summary Sign data using the wallet\'s private key.
|
|
88
|
+
* @param {SignOperationsApiSignDataV1WalletSignDataPostRequest} requestParameters Request parameters.
|
|
89
|
+
* @param {*} [options] Override http request option.
|
|
90
|
+
* @throws {RequiredError}
|
|
91
|
+
*/
|
|
92
|
+
signDataV1WalletSignDataPost(requestParameters: SignOperationsApiSignDataV1WalletSignDataPostRequest, options?: AxiosRequestConfig): AxiosPromise<SignDataResponse>;
|
|
93
|
+
/**
|
|
94
|
+
* Signs an arbitrary message using the wallet\'s private key. Useful for authentication and off-chain verification. **Example cURL:** ```bash curl -X POST \'https://tee.express.magiclabs.com/v1/wallet/sign/message\' \\ -H \'Content-Type: application/json\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' \\ -d \'{ \"chain\": \"ETH\", \"message_base64\": \"bm9uZQ==\" }\' ``` **Example Response:** ```json { \"signature\": \"0x0cebb670d8375ac74122b46c44def7e1ce593e80434a3e6557108ae124f8b44f3c5068fc104279fe7f51918cbe4c249d707bc1c0ce2ffb6d201d3cf4e2fdee8d1b\", \"r\": \"0x0cebb670d8375ac74122b46c44def7e1ce593e80434a3e6557108ae124f8b44f\", \"s\": \"0x3c5068fc104279fe7f51918cbe4c249d707bc1c0ce2ffb6d201d3cf4e2fdee8d\", \"v\": \"27\" } ```
|
|
95
|
+
* @summary Sign a message using the wallet\'s private key.
|
|
96
|
+
* @param {SignOperationsApiSignMessageV1WalletSignMessagePostRequest} requestParameters Request parameters.
|
|
97
|
+
* @param {*} [options] Override http request option.
|
|
98
|
+
* @throws {RequiredError}
|
|
99
|
+
*/
|
|
100
|
+
signMessageV1WalletSignMessagePost(requestParameters: SignOperationsApiSignMessageV1WalletSignMessagePostRequest, options?: AxiosRequestConfig): AxiosPromise<SignMessageResponse>;
|
|
101
|
+
};
|
|
102
|
+
/**
|
|
103
|
+
* Request parameters for signDataV1WalletSignDataPost operation in SignOperationsApi.
|
|
104
|
+
* @export
|
|
105
|
+
* @interface SignOperationsApiSignDataV1WalletSignDataPostRequest
|
|
106
|
+
*/
|
|
107
|
+
export interface SignOperationsApiSignDataV1WalletSignDataPostRequest {
|
|
108
|
+
/**
|
|
109
|
+
*
|
|
110
|
+
* @type {Chain}
|
|
111
|
+
* @memberof SignOperationsApiSignDataV1WalletSignDataPost
|
|
112
|
+
*/
|
|
113
|
+
readonly xMagicChain: Chain;
|
|
114
|
+
/**
|
|
115
|
+
*
|
|
116
|
+
* @type {SignDataRequest}
|
|
117
|
+
* @memberof SignOperationsApiSignDataV1WalletSignDataPost
|
|
118
|
+
*/
|
|
119
|
+
readonly signDataRequest: SignDataRequest;
|
|
120
|
+
/**
|
|
121
|
+
*
|
|
122
|
+
* @type {string}
|
|
123
|
+
* @memberof SignOperationsApiSignDataV1WalletSignDataPost
|
|
124
|
+
*/
|
|
125
|
+
readonly xMagicAPIKey?: string;
|
|
126
|
+
/**
|
|
127
|
+
*
|
|
128
|
+
* @type {string}
|
|
129
|
+
* @memberof SignOperationsApiSignDataV1WalletSignDataPost
|
|
130
|
+
*/
|
|
131
|
+
readonly xMagicSecretKey?: string;
|
|
132
|
+
/**
|
|
133
|
+
*
|
|
134
|
+
* @type {string}
|
|
135
|
+
* @memberof SignOperationsApiSignDataV1WalletSignDataPost
|
|
136
|
+
*/
|
|
137
|
+
readonly xOIDCProviderID?: string;
|
|
138
|
+
}
|
|
139
|
+
/**
|
|
140
|
+
* Request parameters for signMessageV1WalletSignMessagePost operation in SignOperationsApi.
|
|
141
|
+
* @export
|
|
142
|
+
* @interface SignOperationsApiSignMessageV1WalletSignMessagePostRequest
|
|
143
|
+
*/
|
|
144
|
+
export interface SignOperationsApiSignMessageV1WalletSignMessagePostRequest {
|
|
145
|
+
/**
|
|
146
|
+
*
|
|
147
|
+
* @type {Chain}
|
|
148
|
+
* @memberof SignOperationsApiSignMessageV1WalletSignMessagePost
|
|
149
|
+
*/
|
|
150
|
+
readonly xMagicChain: Chain;
|
|
151
|
+
/**
|
|
152
|
+
*
|
|
153
|
+
* @type {SignMessageRequest}
|
|
154
|
+
* @memberof SignOperationsApiSignMessageV1WalletSignMessagePost
|
|
155
|
+
*/
|
|
156
|
+
readonly signMessageRequest: SignMessageRequest;
|
|
157
|
+
/**
|
|
158
|
+
*
|
|
159
|
+
* @type {string}
|
|
160
|
+
* @memberof SignOperationsApiSignMessageV1WalletSignMessagePost
|
|
161
|
+
*/
|
|
162
|
+
readonly xMagicAPIKey?: string;
|
|
163
|
+
/**
|
|
164
|
+
*
|
|
165
|
+
* @type {string}
|
|
166
|
+
* @memberof SignOperationsApiSignMessageV1WalletSignMessagePost
|
|
167
|
+
*/
|
|
168
|
+
readonly xMagicSecretKey?: string;
|
|
169
|
+
/**
|
|
170
|
+
*
|
|
171
|
+
* @type {string}
|
|
172
|
+
* @memberof SignOperationsApiSignMessageV1WalletSignMessagePost
|
|
173
|
+
*/
|
|
174
|
+
readonly xOIDCProviderID?: string;
|
|
175
|
+
}
|
|
176
|
+
/**
|
|
177
|
+
* SignOperationsApi - object-oriented interface
|
|
178
|
+
* @export
|
|
179
|
+
* @class SignOperationsApi
|
|
180
|
+
* @extends {BaseAPI}
|
|
181
|
+
*/
|
|
182
|
+
export declare class SignOperationsApi extends BaseAPI {
|
|
183
|
+
/**
|
|
184
|
+
* Signs a hash of arbitrary data using the wallet\'s private key. **Example cURL:** ```bash curl -X POST \'https://tee.express.magiclabs.com/v1/wallet/sign/data\' \\ -H \'Content-Type: application/json\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' \\ -d \'{ \"chain\": \"ETH\", \"raw_data_hash\": \"0xabc123def4567890abc123def4567890abc123def4567890abc123def4567890\" }\' ``` **Example Response:** ```json { \"message_hash\": \"0xabc123def4567890abc123def4567890abc123def4567890abc123def4567890\", \"signature\": \"0x8e7d6c5b4a3928172635445566778899aabbccddeeff00112233445566778899\", \"r\": \"0x3d4e5f678901234567890abcdef1234567890abcdef1234567890abcdef1234\", \"s\": \"0x4e5f678901234567890abcdef1234567890abcdef1234567890abcdef123456\", \"v\": \"27\" } ```
|
|
185
|
+
* @summary Sign data using the wallet\'s private key.
|
|
186
|
+
* @param {SignOperationsApiSignDataV1WalletSignDataPostRequest} requestParameters Request parameters.
|
|
187
|
+
* @param {*} [options] Override http request option.
|
|
188
|
+
* @throws {RequiredError}
|
|
189
|
+
* @memberof SignOperationsApi
|
|
190
|
+
*/
|
|
191
|
+
signDataV1WalletSignDataPost(requestParameters: SignOperationsApiSignDataV1WalletSignDataPostRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<SignDataResponse, any>>;
|
|
192
|
+
/**
|
|
193
|
+
* Signs an arbitrary message using the wallet\'s private key. Useful for authentication and off-chain verification. **Example cURL:** ```bash curl -X POST \'https://tee.express.magiclabs.com/v1/wallet/sign/message\' \\ -H \'Content-Type: application/json\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' \\ -d \'{ \"chain\": \"ETH\", \"message_base64\": \"bm9uZQ==\" }\' ``` **Example Response:** ```json { \"signature\": \"0x0cebb670d8375ac74122b46c44def7e1ce593e80434a3e6557108ae124f8b44f3c5068fc104279fe7f51918cbe4c249d707bc1c0ce2ffb6d201d3cf4e2fdee8d1b\", \"r\": \"0x0cebb670d8375ac74122b46c44def7e1ce593e80434a3e6557108ae124f8b44f\", \"s\": \"0x3c5068fc104279fe7f51918cbe4c249d707bc1c0ce2ffb6d201d3cf4e2fdee8d\", \"v\": \"27\" } ```
|
|
194
|
+
* @summary Sign a message using the wallet\'s private key.
|
|
195
|
+
* @param {SignOperationsApiSignMessageV1WalletSignMessagePostRequest} requestParameters Request parameters.
|
|
196
|
+
* @param {*} [options] Override http request option.
|
|
197
|
+
* @throws {RequiredError}
|
|
198
|
+
* @memberof SignOperationsApi
|
|
199
|
+
*/
|
|
200
|
+
signMessageV1WalletSignMessagePost(requestParameters: SignOperationsApiSignMessageV1WalletSignMessagePostRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<SignMessageResponse, any>>;
|
|
201
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TEE Express
|
|
3
|
-
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For
|
|
3
|
+
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For signing messages, encode your data as base64: ```typescript const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); ``` For signing transaction data or other structured data, provide a keccak256 hash: ```typescript import { MessageTypes, SignTypedDataVersion, TypedDataUtils, TypedDataV1, TypedMessage, typedSignatureHash, } from \'@metamask/eth-sig-util\'; import { resolveProperties, Signature, Transaction, TransactionLike, TransactionRequest } from \'ethers\'; const computeEip712Hash = ( data: TypedMessage<MessageTypes>, version: SignTypedDataVersion.V3 | SignTypedDataVersion.V4, ): string => { const hashBuffer = TypedDataUtils.eip712Hash(data, version); return \'0x\' + hashBuffer.toString(\'hex\'); }; const personalSign = async (data: string) => { const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); const body = { message_base64: message, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/message\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV1 = async (data: TypedDataV1) => { const rawDataHash = typedSignatureHash(data); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV3 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V3); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV4 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V4); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTransaction = async (tx: TransactionRequest) => { const resolvedTx = await resolveProperties(tx); const txForSigning = { ...resolvedTx }; delete txForSigning.from; const btx = Transaction.from(txForSigning as TransactionLike); const body = { raw_data_hash: btx.unsignedHash, chain: \'ETH\' }; const res = await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); const { r, s, v } = res.json(); btx.signature = Signature.from({ r, s, v }); return btx.serialized; }; ```
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: 0.1.0
|
|
6
6
|
*
|
|
@@ -23,6 +23,7 @@ export declare const WalletApiAxiosParamCreator: (configuration?: Configuration)
|
|
|
23
23
|
/**
|
|
24
24
|
* Creates a new wallet for the given chain and returns its public address. **Example cURL:** ```bash curl -X POST \'https://tee.express.magiclabs.com/v1/wallet\' \\ -H \'Content-Type: application/json\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' \\ -d \'{ \"chain\": \"ETH\" }\' ``` **Example Response:** ```json { \"public_address\": \"0x6b422EefBFBc47a6900A1fc5454Ef4b940B7e36e\" } ```
|
|
25
25
|
* @summary Create a new wallet.
|
|
26
|
+
* @param {Chain} xMagicChain
|
|
26
27
|
* @param {CreateWalletRequestModel} createWalletRequestModel
|
|
27
28
|
* @param {string} [xMagicAPIKey]
|
|
28
29
|
* @param {string} [xMagicSecretKey]
|
|
@@ -30,18 +31,18 @@ export declare const WalletApiAxiosParamCreator: (configuration?: Configuration)
|
|
|
30
31
|
* @param {*} [options] Override http request option.
|
|
31
32
|
* @throws {RequiredError}
|
|
32
33
|
*/
|
|
33
|
-
createWalletV1WalletPost: (createWalletRequestModel: CreateWalletRequestModel, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
34
|
+
createWalletV1WalletPost: (xMagicChain: Chain, createWalletRequestModel: CreateWalletRequestModel, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
34
35
|
/**
|
|
35
36
|
* Returns the wallet\'s public address for the given chain. **Example cURL:** ```bash curl -X GET \'https://tee.express.magiclabs.com/v1/wallet?chain=ETH\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' ``` **Example Response:** ```json { \"public_address\": \"0x6b422EefBFBc47a6900A1fc5454Ef4b940B7e36e\" } ```
|
|
36
37
|
* @summary Get wallet details.
|
|
37
|
-
* @param {Chain}
|
|
38
|
+
* @param {Chain} xMagicChain
|
|
38
39
|
* @param {string} [xMagicAPIKey]
|
|
39
40
|
* @param {string} [xMagicSecretKey]
|
|
40
41
|
* @param {string} [xOIDCProviderID]
|
|
41
42
|
* @param {*} [options] Override http request option.
|
|
42
43
|
* @throws {RequiredError}
|
|
43
44
|
*/
|
|
44
|
-
getWalletV1WalletGet: (
|
|
45
|
+
getWalletV1WalletGet: (xMagicChain: Chain, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
45
46
|
};
|
|
46
47
|
/**
|
|
47
48
|
* WalletApi - functional programming interface
|
|
@@ -51,6 +52,7 @@ export declare const WalletApiFp: (configuration?: Configuration) => {
|
|
|
51
52
|
/**
|
|
52
53
|
* Creates a new wallet for the given chain and returns its public address. **Example cURL:** ```bash curl -X POST \'https://tee.express.magiclabs.com/v1/wallet\' \\ -H \'Content-Type: application/json\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' \\ -d \'{ \"chain\": \"ETH\" }\' ``` **Example Response:** ```json { \"public_address\": \"0x6b422EefBFBc47a6900A1fc5454Ef4b940B7e36e\" } ```
|
|
53
54
|
* @summary Create a new wallet.
|
|
55
|
+
* @param {Chain} xMagicChain
|
|
54
56
|
* @param {CreateWalletRequestModel} createWalletRequestModel
|
|
55
57
|
* @param {string} [xMagicAPIKey]
|
|
56
58
|
* @param {string} [xMagicSecretKey]
|
|
@@ -58,18 +60,18 @@ export declare const WalletApiFp: (configuration?: Configuration) => {
|
|
|
58
60
|
* @param {*} [options] Override http request option.
|
|
59
61
|
* @throws {RequiredError}
|
|
60
62
|
*/
|
|
61
|
-
createWalletV1WalletPost(createWalletRequestModel: CreateWalletRequestModel, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WalletResponseModel>>;
|
|
63
|
+
createWalletV1WalletPost(xMagicChain: Chain, createWalletRequestModel: CreateWalletRequestModel, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WalletResponseModel>>;
|
|
62
64
|
/**
|
|
63
65
|
* Returns the wallet\'s public address for the given chain. **Example cURL:** ```bash curl -X GET \'https://tee.express.magiclabs.com/v1/wallet?chain=ETH\' \\ -H \'Authorization: Bearer eyJhbGciOiJSUzI1NiIsInR5cCI6IkpXVCIsImtpZCI6IjNhYVl5dGR3d2UwMzJzMXIzVElyOSJ9...\' \\ -H \'X-Magic-API-Key: your-magic-api-key\' \\ -H \'X-OIDC-Provider-ID: your-oidc-provider-id\' ``` **Example Response:** ```json { \"public_address\": \"0x6b422EefBFBc47a6900A1fc5454Ef4b940B7e36e\" } ```
|
|
64
66
|
* @summary Get wallet details.
|
|
65
|
-
* @param {Chain}
|
|
67
|
+
* @param {Chain} xMagicChain
|
|
66
68
|
* @param {string} [xMagicAPIKey]
|
|
67
69
|
* @param {string} [xMagicSecretKey]
|
|
68
70
|
* @param {string} [xOIDCProviderID]
|
|
69
71
|
* @param {*} [options] Override http request option.
|
|
70
72
|
* @throws {RequiredError}
|
|
71
73
|
*/
|
|
72
|
-
getWalletV1WalletGet(
|
|
74
|
+
getWalletV1WalletGet(xMagicChain: Chain, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<WalletResponseModel>>;
|
|
73
75
|
};
|
|
74
76
|
/**
|
|
75
77
|
* WalletApi - factory interface
|
|
@@ -99,6 +101,12 @@ export declare const WalletApiFactory: (configuration?: Configuration, basePath?
|
|
|
99
101
|
* @interface WalletApiCreateWalletV1WalletPostRequest
|
|
100
102
|
*/
|
|
101
103
|
export interface WalletApiCreateWalletV1WalletPostRequest {
|
|
104
|
+
/**
|
|
105
|
+
*
|
|
106
|
+
* @type {Chain}
|
|
107
|
+
* @memberof WalletApiCreateWalletV1WalletPost
|
|
108
|
+
*/
|
|
109
|
+
readonly xMagicChain: Chain;
|
|
102
110
|
/**
|
|
103
111
|
*
|
|
104
112
|
* @type {CreateWalletRequestModel}
|
|
@@ -135,7 +143,7 @@ export interface WalletApiGetWalletV1WalletGetRequest {
|
|
|
135
143
|
* @type {Chain}
|
|
136
144
|
* @memberof WalletApiGetWalletV1WalletGet
|
|
137
145
|
*/
|
|
138
|
-
readonly
|
|
146
|
+
readonly xMagicChain: Chain;
|
|
139
147
|
/**
|
|
140
148
|
*
|
|
141
149
|
* @type {string}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TEE Express
|
|
3
|
-
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For
|
|
3
|
+
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For signing messages, encode your data as base64: ```typescript const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); ``` For signing transaction data or other structured data, provide a keccak256 hash: ```typescript import { MessageTypes, SignTypedDataVersion, TypedDataUtils, TypedDataV1, TypedMessage, typedSignatureHash, } from \'@metamask/eth-sig-util\'; import { resolveProperties, Signature, Transaction, TransactionLike, TransactionRequest } from \'ethers\'; const computeEip712Hash = ( data: TypedMessage<MessageTypes>, version: SignTypedDataVersion.V3 | SignTypedDataVersion.V4, ): string => { const hashBuffer = TypedDataUtils.eip712Hash(data, version); return \'0x\' + hashBuffer.toString(\'hex\'); }; const personalSign = async (data: string) => { const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); const body = { message_base64: message, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/message\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV1 = async (data: TypedDataV1) => { const rawDataHash = typedSignatureHash(data); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV3 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V3); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV4 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V4); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTransaction = async (tx: TransactionRequest) => { const resolvedTx = await resolveProperties(tx); const txForSigning = { ...resolvedTx }; delete txForSigning.from; const btx = Transaction.from(txForSigning as TransactionLike); const body = { raw_data_hash: btx.unsignedHash, chain: \'ETH\' }; const res = await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); const { r, s, v } = res.json(); btx.signature = Signature.from({ r, s, v }); return btx.serialized; }; ```
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: 0.1.0
|
|
6
6
|
*
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TEE Express
|
|
3
|
-
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For
|
|
3
|
+
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For signing messages, encode your data as base64: ```typescript const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); ``` For signing transaction data or other structured data, provide a keccak256 hash: ```typescript import { MessageTypes, SignTypedDataVersion, TypedDataUtils, TypedDataV1, TypedMessage, typedSignatureHash, } from \'@metamask/eth-sig-util\'; import { resolveProperties, Signature, Transaction, TransactionLike, TransactionRequest } from \'ethers\'; const computeEip712Hash = ( data: TypedMessage<MessageTypes>, version: SignTypedDataVersion.V3 | SignTypedDataVersion.V4, ): string => { const hashBuffer = TypedDataUtils.eip712Hash(data, version); return \'0x\' + hashBuffer.toString(\'hex\'); }; const personalSign = async (data: string) => { const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); const body = { message_base64: message, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/message\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV1 = async (data: TypedDataV1) => { const rawDataHash = typedSignatureHash(data); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV3 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V3); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV4 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V4); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTransaction = async (tx: TransactionRequest) => { const resolvedTx = await resolveProperties(tx); const txForSigning = { ...resolvedTx }; delete txForSigning.from; const btx = Transaction.from(txForSigning as TransactionLike); const body = { raw_data_hash: btx.unsignedHash, chain: \'ETH\' }; const res = await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); const { r, s, v } = res.json(); btx.signature = Signature.from({ r, s, v }); return btx.serialized; }; ```
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: 0.1.0
|
|
6
6
|
*
|
|
@@ -16,5 +16,7 @@
|
|
|
16
16
|
*/
|
|
17
17
|
export declare const Chain: {
|
|
18
18
|
readonly Eth: "ETH";
|
|
19
|
+
readonly Sol: "SOL";
|
|
20
|
+
readonly Btc: "BTC";
|
|
19
21
|
};
|
|
20
22
|
export type Chain = typeof Chain[keyof typeof Chain];
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TEE Express
|
|
3
|
-
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For
|
|
3
|
+
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For signing messages, encode your data as base64: ```typescript const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); ``` For signing transaction data or other structured data, provide a keccak256 hash: ```typescript import { MessageTypes, SignTypedDataVersion, TypedDataUtils, TypedDataV1, TypedMessage, typedSignatureHash, } from \'@metamask/eth-sig-util\'; import { resolveProperties, Signature, Transaction, TransactionLike, TransactionRequest } from \'ethers\'; const computeEip712Hash = ( data: TypedMessage<MessageTypes>, version: SignTypedDataVersion.V3 | SignTypedDataVersion.V4, ): string => { const hashBuffer = TypedDataUtils.eip712Hash(data, version); return \'0x\' + hashBuffer.toString(\'hex\'); }; const personalSign = async (data: string) => { const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); const body = { message_base64: message, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/message\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV1 = async (data: TypedDataV1) => { const rawDataHash = typedSignatureHash(data); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV3 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V3); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV4 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V4); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTransaction = async (tx: TransactionRequest) => { const resolvedTx = await resolveProperties(tx); const txForSigning = { ...resolvedTx }; delete txForSigning.from; const btx = Transaction.from(txForSigning as TransactionLike); const body = { raw_data_hash: btx.unsignedHash, chain: \'ETH\' }; const res = await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); const { r, s, v } = res.json(); btx.signature = Signature.from({ r, s, v }); return btx.serialized; }; ```
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: 0.1.0
|
|
6
6
|
*
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
* https://openapi-generator.tech
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
|
-
import { Chain } from './chain';
|
|
13
12
|
/**
|
|
14
13
|
*
|
|
15
14
|
* @export
|
|
@@ -18,8 +17,8 @@ import { Chain } from './chain';
|
|
|
18
17
|
export interface CreateWalletRequestModel {
|
|
19
18
|
/**
|
|
20
19
|
*
|
|
21
|
-
* @type {
|
|
20
|
+
* @type {boolean}
|
|
22
21
|
* @memberof CreateWalletRequestModel
|
|
23
22
|
*/
|
|
24
|
-
'
|
|
23
|
+
'should_sync_to_fortmatic'?: boolean | null;
|
|
25
24
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* TEE Express
|
|
3
|
-
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For
|
|
3
|
+
* TEE Express is a service that simplifies wallet management for developers. Unlike traditional wallet solutions that require complex key management, TEE Express handles all key management internally, providing a streamlined API for wallet operations. TEE Express leverages secure enclave technology to ensure that private keys never leave the secure environment. All wallet operations, including creation, signing, and key management, are performed within a trusted execution environment (TEE). This provides enterprise-grade security while maintaining the simplicity of a REST API. The service supports Ethereum wallets and provides endpoints for wallet creation, transaction signing, and message signing. All operations are authenticated using JWT tokens passed in the Authorization header, ensuring secure access to user wallets. **Migration Notice:** If you\'re an existing customer, your users\' wallets have been automatically migrated to TEE Express. There\'s no action required on your part - all existing wallets are now accessible through the TEE Express API using the same JWT tokens you currently use for authentication. Simply update your API calls to use the TEE Express endpoints, and pass your existing JWT token in the Authorization header for all requests. **Authentication:** - An API key via the `X-Magic-API-Key` header or a secret key via the `X-Magic-Secret-Key` header. - The OIDC provider ID via the `X-OIDC-Provider-ID` header. - Bearer token in the `Authorization` header. **Data Hashing for Signing:** For signing messages, encode your data as base64: ```typescript const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); ``` For signing transaction data or other structured data, provide a keccak256 hash: ```typescript import { MessageTypes, SignTypedDataVersion, TypedDataUtils, TypedDataV1, TypedMessage, typedSignatureHash, } from \'@metamask/eth-sig-util\'; import { resolveProperties, Signature, Transaction, TransactionLike, TransactionRequest } from \'ethers\'; const computeEip712Hash = ( data: TypedMessage<MessageTypes>, version: SignTypedDataVersion.V3 | SignTypedDataVersion.V4, ): string => { const hashBuffer = TypedDataUtils.eip712Hash(data, version); return \'0x\' + hashBuffer.toString(\'hex\'); }; const personalSign = async (data: string) => { const message = Buffer.from(data, \'utf-8\').toString(\'base64\'); const body = { message_base64: message, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/message\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV1 = async (data: TypedDataV1) => { const rawDataHash = typedSignatureHash(data); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV3 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V3); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTypedDataV4 = async (data: TypedMessage<MessageTypes>) => { const rawDataHash = computeEip712Hash(data, SignTypedDataVersion.V4); const body = { raw_data_hash: rawDataHash, chain: \'ETH\' }; return await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); }; const signTransaction = async (tx: TransactionRequest) => { const resolvedTx = await resolveProperties(tx); const txForSigning = { ...resolvedTx }; delete txForSigning.from; const btx = Transaction.from(txForSigning as TransactionLike); const body = { raw_data_hash: btx.unsignedHash, chain: \'ETH\' }; const res = await fetch(\'/v1/wallet/sign/data\', { method: \'POST\', body: JSON.stringify(body) }); const { r, s, v } = res.json(); btx.signature = Signature.from({ r, s, v }); return btx.serialized; }; ```
|
|
4
4
|
*
|
|
5
5
|
* The version of the OpenAPI document: 0.1.0
|
|
6
6
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
export * from './chain';
|
|
2
2
|
export * from './create-wallet-request-model';
|
|
3
3
|
export * from './httpvalidation-error';
|
|
4
|
-
export * from './personal-sign-request';
|
|
5
|
-
export * from './personal-sign-response';
|
|
6
4
|
export * from './sign-data-request';
|
|
7
5
|
export * from './sign-data-response';
|
|
6
|
+
export * from './sign-message-request';
|
|
7
|
+
export * from './sign-message-response';
|
|
8
8
|
export * from './validation-error';
|
|
9
9
|
export * from './validation-error-loc-inner';
|
|
10
10
|
export * from './wallet-response-model';
|