@imtbl/generated-clients 2.4.10-alpha.3 → 2.4.10-alpha.4
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 +8 -8
- 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/transaction-api.d.ts +184 -0
- package/dist/types/magic-tee/domain/wallet-api.d.ts +1 -1
- package/dist/types/magic-tee/index.d.ts +1 -1
- package/dist/types/magic-tee/models/chain.d.ts +1 -2
- package/dist/types/magic-tee/models/create-wallet-request-model.d.ts +1 -7
- 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/personal-sign-request.d.ts +31 -0
- package/dist/types/magic-tee/models/personal-sign-response.d.ts +42 -0
- package/dist/types/magic-tee/models/sign-data-request.d.ts +1 -1
- package/dist/types/magic-tee/models/sign-data-response.d.ts +1 -1
- 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/sign-operations-api.d.ts +0 -324
- package/dist/types/magic-tee/models/sign-message-request.d.ts +0 -31
- package/dist/types/magic-tee/models/sign-message-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 personal sign operations, 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/personal-sign\', { 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\', { 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\', { 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\', { 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\', { 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 personal sign operations, 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/personal-sign\', { 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\', { 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\', { 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\', { 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\', { 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 personal sign operations, 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/personal-sign\', { 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\', { 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\', { 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\', { 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\', { 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 personal sign operations, 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/personal-sign\', { 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\', { 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\', { 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\', { 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\', { 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,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { TransactionApi, WalletApi } from './magic-tee';
|
|
2
2
|
export type MagicTeeApiClientsConfig = {
|
|
3
3
|
basePath: string;
|
|
4
4
|
timeout: number;
|
|
@@ -6,7 +6,7 @@ export type MagicTeeApiClientsConfig = {
|
|
|
6
6
|
magicProviderId: string;
|
|
7
7
|
};
|
|
8
8
|
export declare class MagicTeeApiClients {
|
|
9
|
-
|
|
9
|
+
transactionApi: TransactionApi;
|
|
10
10
|
walletApi: WalletApi;
|
|
11
11
|
constructor(config: MagicTeeApiClientsConfig);
|
|
12
12
|
}
|
package/package.json
CHANGED
|
@@ -1,324 +0,0 @@
|
|
|
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 { SignDataRequest } from '../models';
|
|
16
|
-
import { SignDataResponse } from '../models';
|
|
17
|
-
import { SignMessageRequest } from '../models';
|
|
18
|
-
import { SignMessageResponse } from '../models';
|
|
19
|
-
/**
|
|
20
|
-
* SignOperationsApi - axios parameter creator
|
|
21
|
-
* @export
|
|
22
|
-
*/
|
|
23
|
-
export declare const SignOperationsApiAxiosParamCreator: (configuration?: Configuration) => {
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @summary Sign Data
|
|
27
|
-
* @param {SignDataRequest} signDataRequest
|
|
28
|
-
* @param {string} [xMagicAPIKey]
|
|
29
|
-
* @param {string} [xMagicSecretKey]
|
|
30
|
-
* @param {string} [xOIDCProviderID]
|
|
31
|
-
* @param {*} [options] Override http request option.
|
|
32
|
-
* @throws {RequiredError}
|
|
33
|
-
*/
|
|
34
|
-
signDataV1WalletSignDataPost: (signDataRequest: SignDataRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
35
|
-
/**
|
|
36
|
-
* 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\" } ```
|
|
37
|
-
* @summary Sign arbitrary data with the wallet.
|
|
38
|
-
* @param {SignDataRequest} signDataRequest
|
|
39
|
-
* @param {string} [xMagicAPIKey]
|
|
40
|
-
* @param {string} [xMagicSecretKey]
|
|
41
|
-
* @param {string} [xOIDCProviderID]
|
|
42
|
-
* @param {*} [options] Override http request option.
|
|
43
|
-
* @throws {RequiredError}
|
|
44
|
-
*/
|
|
45
|
-
signDataV1WalletSignPost: (signDataRequest: SignDataRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
46
|
-
/**
|
|
47
|
-
* 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\" } ```
|
|
48
|
-
* @summary Sign a message with the wallet.
|
|
49
|
-
* @param {SignMessageRequest} signMessageRequest
|
|
50
|
-
* @param {string} [xMagicAPIKey]
|
|
51
|
-
* @param {string} [xMagicSecretKey]
|
|
52
|
-
* @param {string} [xOIDCProviderID]
|
|
53
|
-
* @param {*} [options] Override http request option.
|
|
54
|
-
* @throws {RequiredError}
|
|
55
|
-
*/
|
|
56
|
-
signMessageV1WalletPersonalSignPost: (signMessageRequest: SignMessageRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
57
|
-
/**
|
|
58
|
-
*
|
|
59
|
-
* @summary Sign Message
|
|
60
|
-
* @param {SignMessageRequest} signMessageRequest
|
|
61
|
-
* @param {string} [xMagicAPIKey]
|
|
62
|
-
* @param {string} [xMagicSecretKey]
|
|
63
|
-
* @param {string} [xOIDCProviderID]
|
|
64
|
-
* @param {*} [options] Override http request option.
|
|
65
|
-
* @throws {RequiredError}
|
|
66
|
-
*/
|
|
67
|
-
signMessageV1WalletSignMessagePost: (signMessageRequest: SignMessageRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig) => Promise<RequestArgs>;
|
|
68
|
-
};
|
|
69
|
-
/**
|
|
70
|
-
* SignOperationsApi - functional programming interface
|
|
71
|
-
* @export
|
|
72
|
-
*/
|
|
73
|
-
export declare const SignOperationsApiFp: (configuration?: Configuration) => {
|
|
74
|
-
/**
|
|
75
|
-
*
|
|
76
|
-
* @summary Sign Data
|
|
77
|
-
* @param {SignDataRequest} signDataRequest
|
|
78
|
-
* @param {string} [xMagicAPIKey]
|
|
79
|
-
* @param {string} [xMagicSecretKey]
|
|
80
|
-
* @param {string} [xOIDCProviderID]
|
|
81
|
-
* @param {*} [options] Override http request option.
|
|
82
|
-
* @throws {RequiredError}
|
|
83
|
-
*/
|
|
84
|
-
signDataV1WalletSignDataPost(signDataRequest: SignDataRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SignDataResponse>>;
|
|
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 arbitrary data with the wallet.
|
|
88
|
-
* @param {SignDataRequest} signDataRequest
|
|
89
|
-
* @param {string} [xMagicAPIKey]
|
|
90
|
-
* @param {string} [xMagicSecretKey]
|
|
91
|
-
* @param {string} [xOIDCProviderID]
|
|
92
|
-
* @param {*} [options] Override http request option.
|
|
93
|
-
* @throws {RequiredError}
|
|
94
|
-
*/
|
|
95
|
-
signDataV1WalletSignPost(signDataRequest: SignDataRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SignDataResponse>>;
|
|
96
|
-
/**
|
|
97
|
-
* 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\" } ```
|
|
98
|
-
* @summary Sign a message with the wallet.
|
|
99
|
-
* @param {SignMessageRequest} signMessageRequest
|
|
100
|
-
* @param {string} [xMagicAPIKey]
|
|
101
|
-
* @param {string} [xMagicSecretKey]
|
|
102
|
-
* @param {string} [xOIDCProviderID]
|
|
103
|
-
* @param {*} [options] Override http request option.
|
|
104
|
-
* @throws {RequiredError}
|
|
105
|
-
*/
|
|
106
|
-
signMessageV1WalletPersonalSignPost(signMessageRequest: SignMessageRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SignMessageResponse>>;
|
|
107
|
-
/**
|
|
108
|
-
*
|
|
109
|
-
* @summary Sign Message
|
|
110
|
-
* @param {SignMessageRequest} signMessageRequest
|
|
111
|
-
* @param {string} [xMagicAPIKey]
|
|
112
|
-
* @param {string} [xMagicSecretKey]
|
|
113
|
-
* @param {string} [xOIDCProviderID]
|
|
114
|
-
* @param {*} [options] Override http request option.
|
|
115
|
-
* @throws {RequiredError}
|
|
116
|
-
*/
|
|
117
|
-
signMessageV1WalletSignMessagePost(signMessageRequest: SignMessageRequest, xMagicAPIKey?: string, xMagicSecretKey?: string, xOIDCProviderID?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<SignMessageResponse>>;
|
|
118
|
-
};
|
|
119
|
-
/**
|
|
120
|
-
* SignOperationsApi - factory interface
|
|
121
|
-
* @export
|
|
122
|
-
*/
|
|
123
|
-
export declare const SignOperationsApiFactory: (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) => {
|
|
124
|
-
/**
|
|
125
|
-
*
|
|
126
|
-
* @summary Sign Data
|
|
127
|
-
* @param {SignOperationsApiSignDataV1WalletSignDataPostRequest} requestParameters Request parameters.
|
|
128
|
-
* @param {*} [options] Override http request option.
|
|
129
|
-
* @throws {RequiredError}
|
|
130
|
-
*/
|
|
131
|
-
signDataV1WalletSignDataPost(requestParameters: SignOperationsApiSignDataV1WalletSignDataPostRequest, options?: AxiosRequestConfig): AxiosPromise<SignDataResponse>;
|
|
132
|
-
/**
|
|
133
|
-
* 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\" } ```
|
|
134
|
-
* @summary Sign arbitrary data with the wallet.
|
|
135
|
-
* @param {SignOperationsApiSignDataV1WalletSignPostRequest} requestParameters Request parameters.
|
|
136
|
-
* @param {*} [options] Override http request option.
|
|
137
|
-
* @throws {RequiredError}
|
|
138
|
-
*/
|
|
139
|
-
signDataV1WalletSignPost(requestParameters: SignOperationsApiSignDataV1WalletSignPostRequest, options?: AxiosRequestConfig): AxiosPromise<SignDataResponse>;
|
|
140
|
-
/**
|
|
141
|
-
* 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\" } ```
|
|
142
|
-
* @summary Sign a message with the wallet.
|
|
143
|
-
* @param {SignOperationsApiSignMessageV1WalletPersonalSignPostRequest} requestParameters Request parameters.
|
|
144
|
-
* @param {*} [options] Override http request option.
|
|
145
|
-
* @throws {RequiredError}
|
|
146
|
-
*/
|
|
147
|
-
signMessageV1WalletPersonalSignPost(requestParameters: SignOperationsApiSignMessageV1WalletPersonalSignPostRequest, options?: AxiosRequestConfig): AxiosPromise<SignMessageResponse>;
|
|
148
|
-
/**
|
|
149
|
-
*
|
|
150
|
-
* @summary Sign Message
|
|
151
|
-
* @param {SignOperationsApiSignMessageV1WalletSignMessagePostRequest} requestParameters Request parameters.
|
|
152
|
-
* @param {*} [options] Override http request option.
|
|
153
|
-
* @throws {RequiredError}
|
|
154
|
-
*/
|
|
155
|
-
signMessageV1WalletSignMessagePost(requestParameters: SignOperationsApiSignMessageV1WalletSignMessagePostRequest, options?: AxiosRequestConfig): AxiosPromise<SignMessageResponse>;
|
|
156
|
-
};
|
|
157
|
-
/**
|
|
158
|
-
* Request parameters for signDataV1WalletSignDataPost operation in SignOperationsApi.
|
|
159
|
-
* @export
|
|
160
|
-
* @interface SignOperationsApiSignDataV1WalletSignDataPostRequest
|
|
161
|
-
*/
|
|
162
|
-
export interface SignOperationsApiSignDataV1WalletSignDataPostRequest {
|
|
163
|
-
/**
|
|
164
|
-
*
|
|
165
|
-
* @type {SignDataRequest}
|
|
166
|
-
* @memberof SignOperationsApiSignDataV1WalletSignDataPost
|
|
167
|
-
*/
|
|
168
|
-
readonly signDataRequest: SignDataRequest;
|
|
169
|
-
/**
|
|
170
|
-
*
|
|
171
|
-
* @type {string}
|
|
172
|
-
* @memberof SignOperationsApiSignDataV1WalletSignDataPost
|
|
173
|
-
*/
|
|
174
|
-
readonly xMagicAPIKey?: string;
|
|
175
|
-
/**
|
|
176
|
-
*
|
|
177
|
-
* @type {string}
|
|
178
|
-
* @memberof SignOperationsApiSignDataV1WalletSignDataPost
|
|
179
|
-
*/
|
|
180
|
-
readonly xMagicSecretKey?: string;
|
|
181
|
-
/**
|
|
182
|
-
*
|
|
183
|
-
* @type {string}
|
|
184
|
-
* @memberof SignOperationsApiSignDataV1WalletSignDataPost
|
|
185
|
-
*/
|
|
186
|
-
readonly xOIDCProviderID?: string;
|
|
187
|
-
}
|
|
188
|
-
/**
|
|
189
|
-
* Request parameters for signDataV1WalletSignPost operation in SignOperationsApi.
|
|
190
|
-
* @export
|
|
191
|
-
* @interface SignOperationsApiSignDataV1WalletSignPostRequest
|
|
192
|
-
*/
|
|
193
|
-
export interface SignOperationsApiSignDataV1WalletSignPostRequest {
|
|
194
|
-
/**
|
|
195
|
-
*
|
|
196
|
-
* @type {SignDataRequest}
|
|
197
|
-
* @memberof SignOperationsApiSignDataV1WalletSignPost
|
|
198
|
-
*/
|
|
199
|
-
readonly signDataRequest: SignDataRequest;
|
|
200
|
-
/**
|
|
201
|
-
*
|
|
202
|
-
* @type {string}
|
|
203
|
-
* @memberof SignOperationsApiSignDataV1WalletSignPost
|
|
204
|
-
*/
|
|
205
|
-
readonly xMagicAPIKey?: string;
|
|
206
|
-
/**
|
|
207
|
-
*
|
|
208
|
-
* @type {string}
|
|
209
|
-
* @memberof SignOperationsApiSignDataV1WalletSignPost
|
|
210
|
-
*/
|
|
211
|
-
readonly xMagicSecretKey?: string;
|
|
212
|
-
/**
|
|
213
|
-
*
|
|
214
|
-
* @type {string}
|
|
215
|
-
* @memberof SignOperationsApiSignDataV1WalletSignPost
|
|
216
|
-
*/
|
|
217
|
-
readonly xOIDCProviderID?: string;
|
|
218
|
-
}
|
|
219
|
-
/**
|
|
220
|
-
* Request parameters for signMessageV1WalletPersonalSignPost operation in SignOperationsApi.
|
|
221
|
-
* @export
|
|
222
|
-
* @interface SignOperationsApiSignMessageV1WalletPersonalSignPostRequest
|
|
223
|
-
*/
|
|
224
|
-
export interface SignOperationsApiSignMessageV1WalletPersonalSignPostRequest {
|
|
225
|
-
/**
|
|
226
|
-
*
|
|
227
|
-
* @type {SignMessageRequest}
|
|
228
|
-
* @memberof SignOperationsApiSignMessageV1WalletPersonalSignPost
|
|
229
|
-
*/
|
|
230
|
-
readonly signMessageRequest: SignMessageRequest;
|
|
231
|
-
/**
|
|
232
|
-
*
|
|
233
|
-
* @type {string}
|
|
234
|
-
* @memberof SignOperationsApiSignMessageV1WalletPersonalSignPost
|
|
235
|
-
*/
|
|
236
|
-
readonly xMagicAPIKey?: string;
|
|
237
|
-
/**
|
|
238
|
-
*
|
|
239
|
-
* @type {string}
|
|
240
|
-
* @memberof SignOperationsApiSignMessageV1WalletPersonalSignPost
|
|
241
|
-
*/
|
|
242
|
-
readonly xMagicSecretKey?: string;
|
|
243
|
-
/**
|
|
244
|
-
*
|
|
245
|
-
* @type {string}
|
|
246
|
-
* @memberof SignOperationsApiSignMessageV1WalletPersonalSignPost
|
|
247
|
-
*/
|
|
248
|
-
readonly xOIDCProviderID?: string;
|
|
249
|
-
}
|
|
250
|
-
/**
|
|
251
|
-
* Request parameters for signMessageV1WalletSignMessagePost operation in SignOperationsApi.
|
|
252
|
-
* @export
|
|
253
|
-
* @interface SignOperationsApiSignMessageV1WalletSignMessagePostRequest
|
|
254
|
-
*/
|
|
255
|
-
export interface SignOperationsApiSignMessageV1WalletSignMessagePostRequest {
|
|
256
|
-
/**
|
|
257
|
-
*
|
|
258
|
-
* @type {SignMessageRequest}
|
|
259
|
-
* @memberof SignOperationsApiSignMessageV1WalletSignMessagePost
|
|
260
|
-
*/
|
|
261
|
-
readonly signMessageRequest: SignMessageRequest;
|
|
262
|
-
/**
|
|
263
|
-
*
|
|
264
|
-
* @type {string}
|
|
265
|
-
* @memberof SignOperationsApiSignMessageV1WalletSignMessagePost
|
|
266
|
-
*/
|
|
267
|
-
readonly xMagicAPIKey?: string;
|
|
268
|
-
/**
|
|
269
|
-
*
|
|
270
|
-
* @type {string}
|
|
271
|
-
* @memberof SignOperationsApiSignMessageV1WalletSignMessagePost
|
|
272
|
-
*/
|
|
273
|
-
readonly xMagicSecretKey?: string;
|
|
274
|
-
/**
|
|
275
|
-
*
|
|
276
|
-
* @type {string}
|
|
277
|
-
* @memberof SignOperationsApiSignMessageV1WalletSignMessagePost
|
|
278
|
-
*/
|
|
279
|
-
readonly xOIDCProviderID?: string;
|
|
280
|
-
}
|
|
281
|
-
/**
|
|
282
|
-
* SignOperationsApi - object-oriented interface
|
|
283
|
-
* @export
|
|
284
|
-
* @class SignOperationsApi
|
|
285
|
-
* @extends {BaseAPI}
|
|
286
|
-
*/
|
|
287
|
-
export declare class SignOperationsApi extends BaseAPI {
|
|
288
|
-
/**
|
|
289
|
-
*
|
|
290
|
-
* @summary Sign Data
|
|
291
|
-
* @param {SignOperationsApiSignDataV1WalletSignDataPostRequest} requestParameters Request parameters.
|
|
292
|
-
* @param {*} [options] Override http request option.
|
|
293
|
-
* @throws {RequiredError}
|
|
294
|
-
* @memberof SignOperationsApi
|
|
295
|
-
*/
|
|
296
|
-
signDataV1WalletSignDataPost(requestParameters: SignOperationsApiSignDataV1WalletSignDataPostRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<SignDataResponse, any>>;
|
|
297
|
-
/**
|
|
298
|
-
* 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\" } ```
|
|
299
|
-
* @summary Sign arbitrary data with the wallet.
|
|
300
|
-
* @param {SignOperationsApiSignDataV1WalletSignPostRequest} requestParameters Request parameters.
|
|
301
|
-
* @param {*} [options] Override http request option.
|
|
302
|
-
* @throws {RequiredError}
|
|
303
|
-
* @memberof SignOperationsApi
|
|
304
|
-
*/
|
|
305
|
-
signDataV1WalletSignPost(requestParameters: SignOperationsApiSignDataV1WalletSignPostRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<SignDataResponse, any>>;
|
|
306
|
-
/**
|
|
307
|
-
* 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\" } ```
|
|
308
|
-
* @summary Sign a message with the wallet.
|
|
309
|
-
* @param {SignOperationsApiSignMessageV1WalletPersonalSignPostRequest} requestParameters Request parameters.
|
|
310
|
-
* @param {*} [options] Override http request option.
|
|
311
|
-
* @throws {RequiredError}
|
|
312
|
-
* @memberof SignOperationsApi
|
|
313
|
-
*/
|
|
314
|
-
signMessageV1WalletPersonalSignPost(requestParameters: SignOperationsApiSignMessageV1WalletPersonalSignPostRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<SignMessageResponse, any>>;
|
|
315
|
-
/**
|
|
316
|
-
*
|
|
317
|
-
* @summary Sign Message
|
|
318
|
-
* @param {SignOperationsApiSignMessageV1WalletSignMessagePostRequest} requestParameters Request parameters.
|
|
319
|
-
* @param {*} [options] Override http request option.
|
|
320
|
-
* @throws {RequiredError}
|
|
321
|
-
* @memberof SignOperationsApi
|
|
322
|
-
*/
|
|
323
|
-
signMessageV1WalletSignMessagePost(requestParameters: SignOperationsApiSignMessageV1WalletSignMessagePostRequest, options?: AxiosRequestConfig): Promise<import("axios").AxiosResponse<SignMessageResponse, any>>;
|
|
324
|
-
}
|
|
@@ -1,31 +0,0 @@
|
|
|
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 { Chain } from './chain';
|
|
13
|
-
/**
|
|
14
|
-
*
|
|
15
|
-
* @export
|
|
16
|
-
* @interface SignMessageRequest
|
|
17
|
-
*/
|
|
18
|
-
export interface SignMessageRequest {
|
|
19
|
-
/**
|
|
20
|
-
*
|
|
21
|
-
* @type {Chain}
|
|
22
|
-
* @memberof SignMessageRequest
|
|
23
|
-
*/
|
|
24
|
-
'chain': Chain;
|
|
25
|
-
/**
|
|
26
|
-
*
|
|
27
|
-
* @type {string}
|
|
28
|
-
* @memberof SignMessageRequest
|
|
29
|
-
*/
|
|
30
|
-
'message_base64': string;
|
|
31
|
-
}
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
/**
|
|
13
|
-
*
|
|
14
|
-
* @export
|
|
15
|
-
* @interface SignMessageResponse
|
|
16
|
-
*/
|
|
17
|
-
export interface SignMessageResponse {
|
|
18
|
-
/**
|
|
19
|
-
*
|
|
20
|
-
* @type {string}
|
|
21
|
-
* @memberof SignMessageResponse
|
|
22
|
-
*/
|
|
23
|
-
'signature': string;
|
|
24
|
-
/**
|
|
25
|
-
*
|
|
26
|
-
* @type {string}
|
|
27
|
-
* @memberof SignMessageResponse
|
|
28
|
-
*/
|
|
29
|
-
'r'?: string | null;
|
|
30
|
-
/**
|
|
31
|
-
*
|
|
32
|
-
* @type {string}
|
|
33
|
-
* @memberof SignMessageResponse
|
|
34
|
-
*/
|
|
35
|
-
's'?: string | null;
|
|
36
|
-
/**
|
|
37
|
-
*
|
|
38
|
-
* @type {string}
|
|
39
|
-
* @memberof SignMessageResponse
|
|
40
|
-
*/
|
|
41
|
-
'v'?: string | null;
|
|
42
|
-
}
|