diff --git a/packages/internal/generated-clients/src/mr-openapi.json b/packages/internal/generated-clients/src/mr-openapi.json index 653e2d382b..ff4c4b5507 100644 --- a/packages/internal/generated-clients/src/mr-openapi.json +++ b/packages/internal/generated-clients/src/mr-openapi.json @@ -60,6 +60,10 @@ "name": "verification", "x-displayName": "verification" }, + { + "name": "operatorallowlist", + "x-displayName": "operatorallowlist" + }, { "name": "listings", "description": "Listings Endpoints", @@ -1210,6 +1214,20 @@ }, "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" }, + { + "name": "token_id", + "in": "query", + "required": false, + "description": "List of token IDs to filter by", + "schema": { + "type": "array", + "maxItems": 30, + "items": { + "type": "string", + "example": "1" + } + } + }, { "name": "from_updated_at", "in": "query", @@ -2320,7 +2338,7 @@ { "name": "sort_by", "in": "query", - "description": "Order field to sort by", + "description": "Order field to sort by. `buy_item_amount` sorts by per token price, for example if 5 ERC-1155s are on sale for 10eth, it’s sorted as 2eth for `buy_item_amount`.", "required": false, "schema": { "type": "string", @@ -2593,6 +2611,17 @@ "pattern": "^0x[a-fA-F0-9]{40}$" } }, + { + "name": "sell_item_contract_address", + "in": "query", + "required": false, + "schema": { + "type": "string", + "description": "Sell item contract address to filter by", + "example": "0x784578949A4A50DeA641Fb15dd2B11C72E76919a", + "pattern": "^0x[a-fA-F0-9]{40}$" + } + }, { "name": "from_indexed_at", "in": "query", @@ -3290,6 +3319,84 @@ } } }, + "/passport-profile/v2/linked-wallets": { + "post": { + "tags": [ + "passport profile" + ], + "summary": "Link wallet v2", + "description": "Link an external EOA wallet to an Immutable Passport account by providing an EIP-712 signature.", + "operationId": "link-wallet-v2", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/LinkWalletV2Request" + } + } + } + }, + "responses": { + "200": { + "description": "OK", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Wallet" + } + } + } + }, + "400": { + "description": "BadRequestError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError400" + } + } + } + }, + "401": { + "description": "UnauthorizedError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError401" + } + } + } + }, + "403": { + "description": "ForbiddenError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError403" + } + } + } + }, + "500": { + "description": "InternalServerError", + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/APIError500" + } + } + } + } + }, + "security": [ + { + "BearerAuth": [ + "openid" + ] + } + ] + } + }, "/passport-profile/v1/user/info": { "get": { "summary": "Get all info for a Passport user", @@ -3620,6 +3727,15 @@ "withdrawal" ] }, + "OperatorAllowlistAdminAction": { + "description": "The action an admin can take on an operator allowlist request", + "example": "approve", + "type": "string", + "enum": [ + "approve", + "reject" + ] + }, "ActivityNFT": { "type": "object", "properties": { @@ -3637,9 +3753,10 @@ "example": "1" }, "amount": { - "description": "The amount of tokens exchanged", + "description": "(deprecated - will never be filled, use amount on Activity instead) The amount of tokens exchanged", "type": "string", - "example": "1" + "example": "1", + "deprecated": true } }, "required": [ @@ -4315,7 +4432,7 @@ }, "RefreshMetadataByIDRequest": { "type": "object", - "description": "Request body for refreshing metadata by id", + "description": "Request body for refreshing metadata by id. Total size of this list should not exceed 228 KiB", "properties": { "metadata": { "type": "array", @@ -4971,7 +5088,7 @@ }, "NFTMetadataRequest": { "type": "object", - "description": "The NFT metadata", + "description": "The NFT metadata. Total size of this object should not exceed 16 KiB", "properties": { "name": { "type": "string", @@ -5024,7 +5141,7 @@ "properties": { "nft_metadata": { "type": "array", - "description": "List of nft metadata to be refreshed", + "description": "List of nft metadata to be refreshed. Total size of the list should not exceed 228 KiB", "maxItems": 250, "minItems": 1, "items": { @@ -5053,6 +5170,18 @@ "example": "0x43e60b30d5bec48c0f5890e3d1e9f1b1296bb4aa", "nullable": true }, + "root_chain_id": { + "type": "string", + "description": "The id of the root chain for a bridged token", + "example": "eip155:1", + "nullable": true + }, + "bridge_used": { + "type": "string", + "description": "The name of the bridge, for bridged tokens only", + "example": "axelar", + "nullable": true + }, "symbol": { "type": "string", "description": "The symbol of token", @@ -5225,7 +5354,27 @@ "assets" ] }, + "VerificationRequestInternal": { + "description": "The verification request (internal)", + "allOf": [ + { + "$ref": "#/components/schemas/VerificationRequest" + }, + { + "type": "object", + "properties": { + "org_tier": { + "$ref": "#/components/schemas/OrganisationTier" + } + }, + "required": [ + "org_tier" + ] + } + ] + }, "VerificationRequest": { + "description": "The verification request", "type": "object", "properties": { "id": { @@ -5248,12 +5397,6 @@ "type": "string", "example": "Immutable" }, - "project_name": { - "description": "The name of the project associated with this contract", - "nullable": true, - "type": "string", - "example": "Immutable project name" - }, "name": { "type": "string", "nullable": true, @@ -5299,7 +5442,6 @@ "symbol", "description", "contract_type", - "project_name", "org_name", "org_id", "requester_email", @@ -5315,6 +5457,18 @@ "ERC1155" ] }, + "OrganisationTier": { + "description": "The tier of the organisation", + "type": "string", + "nullable": true, + "enum": [ + "common", + "uncommon", + "rare", + "epic", + "legendary" + ] + }, "MintAsset": { "type": "object", "properties": { @@ -5490,6 +5644,127 @@ "failed" ] }, + "OperatorAllowlistStatus": { + "description": "The status of a contract on the operator allowlist", + "example": "requested", + "type": "string", + "enum": [ + "requested", + "approved", + "rejected", + "removed", + "added" + ] + }, + "OperatorAllowlistStatusDetails": { + "description": "The operator allowlist status details", + "oneOf": [ + { + "$ref": "#/components/schemas/OperatorAllowlistStatusRequested" + }, + { + "$ref": "#/components/schemas/OperatorAllowlistStatusUpdated" + } + ] + }, + "OperatorAllowlistStatusRequested": { + "type": "object", + "description": "The request details", + "properties": { + "purpose": { + "description": "Reason this contract needs to be added", + "type": "string", + "example": "Custom crafting contract" + }, + "is_settlement_contract": { + "description": "Attestation of whether this contract is a settlement contract", + "type": "boolean", + "example": false + } + }, + "required": [ + "purpose", + "is_settlement_contract" + ] + }, + "OperatorAllowlistStatusUpdated": { + "type": "object", + "description": "The update details", + "properties": { + "reason": { + "description": "Why this action was performed", + "type": "string", + "example": "Contract meets expectations" + } + }, + "required": [ + "reason" + ] + }, + "OperatorAllowlistContractStatusInternal": { + "allOf": [ + { + "$ref": "#/components/schemas/OperatorAllowlistContractStatus" + }, + { + "type": "object", + "properties": { + "org_name": { + "description": "The name of the organisation associated with this contract", + "nullable": true, + "type": "string", + "example": "Immutable" + }, + "org_tier": { + "$ref": "#/components/schemas/OrganisationTier" + } + }, + "required": [ + "org_name", + "org_tier" + ] + } + ] + }, + "OperatorAllowlistContractStatus": { + "type": "object", + "properties": { + "chain": { + "$ref": "#/components/schemas/Chain" + }, + "contract_address": { + "type": "string", + "description": "The address of the contract", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + "status": { + "$ref": "#/components/schemas/OperatorAllowlistStatus" + }, + "details": { + "$ref": "#/components/schemas/OperatorAllowlistStatusDetails" + }, + "created_at": { + "type": "string", + "format": "date-time", + "example": "2022-08-16T17:43:26.991388Z", + "description": "When the contract status was created" + }, + "created_by": { + "type": "string", + "format": "email", + "description": "Who created the status", + "example": "user@immutable.com" + } + }, + "required": [ + "chain", + "contract_address", + "status", + "details", + "created_at", + "created_by" + ] + }, "BasicAPIError": { "type": "object", "properties": { @@ -6869,10 +7144,11 @@ }, "cancellation_type": { "type": "string", - "description": "Whether the cancellation was done on-chain or off-chain", + "description": "Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account", "enum": [ "ON_CHAIN", - "OFF_CHAIN" + "OFF_CHAIN", + "UNDERFUNDED" ], "example": "ON_CHAIN" } @@ -7227,6 +7503,15 @@ } } }, + "ImmutableVerificationStatusEnum": { + "type": "string", + "enum": [ + "verified", + "unverified", + "spam", + "inactive" + ] + }, "ERC721ApproveMetadata": { "type": "object", "required": [ @@ -7237,7 +7522,9 @@ "asset_name", "is_smart_contract", "is_contract_verified", - "contract_name" + "contract_name", + "token_id", + "immutable_verification_status" ], "properties": { "transaction_type": { @@ -7274,6 +7561,14 @@ "contract_name": { "type": "string", "description": "Smart Contract Name" + }, + "token_id": { + "type": "string", + "description": "ID of the ERC721", + "example": "1" + }, + "immutable_verification_status": { + "$ref": "#/components/schemas/ImmutableVerificationStatusEnum" } } }, @@ -7285,6 +7580,7 @@ "amount", "decimals", "symbol", + "immutable_verification_status", "image_url" ], "properties": { @@ -7305,6 +7601,9 @@ "description": "A string representing the amount of tokens to transfer", "example": "10000000000000000" }, + "immutable_verification_status": { + "$ref": "#/components/schemas/ImmutableVerificationStatusEnum" + }, "decimals": { "type": "integer", "description": "The token decimals", @@ -7326,6 +7625,7 @@ "type": "object", "required": [ "transaction_type", + "immutable_verification_status", "from_address", "to_address", "amount", @@ -7356,6 +7656,9 @@ "description": "A string representing the amount of tokens to transfer", "example": "10000000000000000" }, + "immutable_verification_status": { + "$ref": "#/components/schemas/ImmutableVerificationStatusEnum" + }, "decimals": { "type": "integer", "description": "The token decimals", @@ -7382,7 +7685,9 @@ "spender", "is_smart_contract", "is_contract_verified", - "contract_name" + "immutable_verification_status", + "contract_name", + "image_url" ], "properties": { "transaction_type": { @@ -7392,6 +7697,9 @@ "ERC20_APPROVE" ] }, + "immutable_verification_status": { + "$ref": "#/components/schemas/ImmutableVerificationStatusEnum" + }, "amount": { "type": "string", "description": "Requested approval amount" @@ -7415,6 +7723,10 @@ "contract_name": { "type": "string", "description": "Smart Contract Name" + }, + "image_url": { + "type": "string", + "example": "https://example.com/erc20.jpg" } } }, @@ -7426,7 +7738,8 @@ "collection_image", "is_smart_contract", "is_contract_verified", - "contract_name" + "contract_name", + "immutable_verification_status" ], "properties": { "transaction_type": { @@ -7456,6 +7769,9 @@ "contract_name": { "type": "string", "description": "Smart Contract Name" + }, + "immutable_verification_status": { + "$ref": "#/components/schemas/ImmutableVerificationStatusEnum" } } }, @@ -7468,7 +7784,8 @@ "collection_name", "token_id", "asset_name", - "asset_image" + "asset_image", + "immutable_verification_status" ], "properties": { "transaction_type": { @@ -7506,6 +7823,9 @@ "type": "string", "description": "The image of the ERC721", "example": "https://some-url" + }, + "immutable_verification_status": { + "$ref": "#/components/schemas/ImmutableVerificationStatusEnum" } } }, @@ -7515,7 +7835,8 @@ "transaction_type", "from_address", "collection_name", - "items" + "items", + "immutable_verification_status" ], "properties": { "transaction_type": { @@ -7541,6 +7862,9 @@ "items": { "$ref": "#/components/schemas/ERC721SafeTransferFromBatchItem" } + }, + "immutable_verification_status": { + "$ref": "#/components/schemas/ImmutableVerificationStatusEnum" } } }, @@ -7680,7 +8004,15 @@ ] }, "sell": { - "$ref": "#/components/schemas/SeaportERC721Item" + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/SeaportERC1155Item" + }, + { + "$ref": "#/components/schemas/SeaportERC721Item" + } + ] }, "fees": { "type": "array", @@ -7763,13 +8095,19 @@ "type": "integer", "description": "The decimal of this erc20 item", "example": 18 + }, + "immutable_verification_status": { + "type": "string", + "description": "The Immutable verification status of this collection", + "$ref": "#/components/schemas/ImmutableVerificationStatusEnum" } }, "required": [ "type", "contract_address", "amount", - "decimals" + "decimals", + "immutable_verification_status" ] }, "SeaportERC721Item": { @@ -7811,6 +8149,11 @@ "description": "ID of ERC721 token", "example": "1", "pattern": "\\d+" + }, + "immutable_verification_status": { + "type": "string", + "description": "The Immutable verification status of this collection", + "$ref": "#/components/schemas/ImmutableVerificationStatusEnum" } }, "example": [ @@ -7819,13 +8162,85 @@ "contract_address": "0x87c07c927eba711cbc55ec628a670acd48d0b525", "contract_name": "Guild of Guardians Heroes", "name": "Bestowing Saint", - "token_id": "1" + "token_id": "1", + "immutable_verification_status": "verified" } ], "required": [ "type", "contract_address", - "token_id" + "token_id", + "immutable_verification_status" + ] + }, + "SeaportERC1155Item": { + "type": "object", + "properties": { + "type": { + "type": "string", + "description": "Token type user is offering, which in this case is ERC1155", + "example": "ERC1155", + "enum": [ + "ERC1155" + ] + }, + "contract_address": { + "type": "string", + "description": "Address of ERC1155 token", + "example": "0x692edAd005237c7E737bB2c0F3D8ccCc10D3479E", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "contract_name": { + "type": "string", + "nullable": true, + "description": "The name of the collection", + "example": "0x8a90cab2b38dba80c64b7734e58ee1db38b8992e" + }, + "image_url": { + "type": "string", + "description": "The URL of the asset", + "example": "https://example.com/nft.jpeg" + }, + "name": { + "type": "string", + "nullable": true, + "example": "Sword", + "description": "The name of the asset" + }, + "token_id": { + "type": "string", + "description": "ID of ERC1155 token", + "example": "1", + "pattern": "\\d+" + }, + "amount": { + "type": "string", + "description": "A string representing the total units of an ERC1155 token which the user is selling", + "example": "100" + }, + "immutable_verification_status": { + "type": "string", + "description": "The Immutable verification status of this collection", + "$ref": "#/components/schemas/ImmutableVerificationStatusEnum" + } + }, + "example": [ + { + "type": "ERC1155", + "contract_address": "0x87c07c927eba711cbc55ec628a670acd48d0b525", + "contract_name": "Guild of Guardians Heroes", + "name": "Bestowing Saint", + "token_id": "1", + "amount": "100", + "immutable_verification_status": "verified" + } + ], + "required": [ + "type", + "contract_address", + "token_id", + "amount", + "immutable_verification_status" ] }, "SeaportFee": { @@ -7918,7 +8333,15 @@ ] }, "sell": { - "$ref": "#/components/schemas/SeaportERC721Item" + "type": "object", + "oneOf": [ + { + "$ref": "#/components/schemas/SeaportERC721Item" + }, + { + "$ref": "#/components/schemas/SeaportERC1155Item" + } + ] }, "fees": { "type": "array", @@ -8090,6 +8513,15 @@ "type": "string", "example": 0 }, + "TokenType": { + "description": "Contract type for token (ERC721/ERC1155)", + "type": "string", + "example": "ERC721", + "enum": [ + "ERC721", + "ERC1155" + ] + }, "Network": { "description": "Network", "type": "string", @@ -8126,7 +8558,8 @@ "network", "name", "contract_address", - "balance" + "balance", + "token_type" ], "properties": { "network": { @@ -8153,6 +8586,9 @@ "items": { "$ref": "#/components/schemas/EthAddress" } + }, + "token_type": { + "$ref": "#/components/schemas/TokenType" } } }, @@ -8169,7 +8605,9 @@ "required": [ "network", "token_id", - "owner" + "owner", + "balance", + "token_type" ], "properties": { "network": { @@ -8192,6 +8630,12 @@ }, "owner": { "$ref": "#/components/schemas/EthAddress" + }, + "balance": { + "$ref": "#/components/schemas/Balance" + }, + "token_type": { + "$ref": "#/components/schemas/TokenType" } } }, @@ -8200,11 +8644,82 @@ "type": "string", "example": "MetaMask" }, + "Wallet": { + "description": "Linked wallet", + "type": "object", + "required": [ + "address", + "type", + "created_at", + "updated_at", + "clientName" + ], + "properties": { + "address": { + "$ref": "#/components/schemas/EthAddress" + }, + "type": { + "$ref": "#/components/schemas/WalletType" + }, + "created_at": { + "$ref": "#/components/schemas/CreatedAt" + }, + "updated_at": { + "$ref": "#/components/schemas/CreatedAt" + }, + "name": { + "$ref": "#/components/schemas/Name" + }, + "clientName": { + "type": "string", + "description": "Name of client that linked the wallet", + "example": "Passport Dashboard" + } + } + }, "Signature": { "description": "Signature", "type": "string", "example": "0x..." }, + "LinkWalletV2Request": { + "description": "Link wallet V2 request", + "type": "object", + "required": [ + "type", + "wallet_address", + "signature", + "nonce" + ], + "properties": { + "type": { + "type": "string", + "description": "This should be the EIP-6963 rdns value, if you're unable to get the rdns value you can provide \"External\". If using WalletConnect then provide \"WalletConnect\".", + "example": "io.metamask", + "maxLength": 32, + "not": { + "enum": [ + "Passport", + "com.immutable.passport" + ] + } + }, + "wallet_address": { + "description": "The address of the external wallet being linked to Passport", + "type": "string", + "example": "0xd8da6bf26964af9d7eed9e03e53415d37aa96045", + "pattern": "^0x[a-fA-F0-9]{40}$" + }, + "signature": { + "description": "The EIP-712 signature", + "type": "string" + }, + "nonce": { + "description": "A unique identifier for the signature", + "type": "string" + } + } + }, "PageResponse": { "description": "Response page", "type": "object", @@ -8263,6 +8778,7 @@ "tokens", "demopage", "verification", + "operatorallowlist", "listings", "orders", "passport", diff --git a/packages/internal/generated-clients/src/multi-rollup/.openapi-generator/FILES b/packages/internal/generated-clients/src/multi-rollup/.openapi-generator/FILES index ac82a4f5ca..e9f4e032f0 100644 --- a/packages/internal/generated-clients/src/multi-rollup/.openapi-generator/FILES +++ b/packages/internal/generated-clients/src/multi-rollup/.openapi-generator/FILES @@ -97,9 +97,11 @@ models/get-transaction-metadata-request.ts models/get-transaction-metadata-res.ts models/get-typed-data-metadata-request.ts models/get-typed-data-metadata-res.ts +models/immutable-verification-status-enum.ts models/inactive-order-status.ts models/index.ts models/item.ts +models/link-wallet-v2-request.ts models/list-activities-result.ts models/list-chains-result.ts models/list-collection-owners-result.ts @@ -132,9 +134,18 @@ models/nftsale.ts models/nftset-approval-for-all-metadata.ts models/nftwith-balance.ts models/nftwith-owner.ts +models/operator-allowlist-admin-action.ts +models/operator-allowlist-contract-status-internal-all-of.ts +models/operator-allowlist-contract-status-internal.ts +models/operator-allowlist-contract-status.ts +models/operator-allowlist-status-details.ts +models/operator-allowlist-status-requested.ts +models/operator-allowlist-status-updated.ts +models/operator-allowlist-status.ts models/order-status-name.ts models/order-status.ts models/order.ts +models/organisation-tier.ts models/page-response.ts models/page.ts models/pending-order-status.ts @@ -152,15 +163,19 @@ models/sale-fee.ts models/sale-payment-token.ts models/sale-payment.ts models/seaport-advanced-order-buy.ts +models/seaport-advanced-order-sell.ts models/seaport-advanced-order.ts models/seaport-create-listing-metadata-buy.ts +models/seaport-create-listing-metadata-sell.ts models/seaport-create-listing-metadata.ts +models/seaport-erc1155-item.ts models/seaport-erc20-item.ts models/seaport-erc721-item.ts models/seaport-fee.ts models/seaport-fulfill-available-advanced-orders-metadata.ts models/seaport-native-item.ts models/token-contract-type.ts +models/token-type.ts models/token.ts models/trade-blockchain-metadata.ts models/trade-result.ts @@ -171,6 +186,9 @@ models/unknown-metadata.ts models/unknown-typed-data-metadata.ts models/user-info.ts models/verification-request-contract-type.ts +models/verification-request-internal-all-of.ts +models/verification-request-internal.ts models/verification-request-status.ts models/verification-request.ts +models/wallet.ts models/withdrawal.ts diff --git a/packages/internal/generated-clients/src/multi-rollup/domain/nfts-api.ts b/packages/internal/generated-clients/src/multi-rollup/domain/nfts-api.ts index 30cb789247..3f9a107eb3 100644 --- a/packages/internal/generated-clients/src/multi-rollup/domain/nfts-api.ts +++ b/packages/internal/generated-clients/src/multi-rollup/domain/nfts-api.ts @@ -362,13 +362,14 @@ export const NftsApiAxiosParamCreator = function (configuration?: Configuration) * @param {string} accountAddress Account address * @param {string} chainName The name of chain * @param {string} [contractAddress] The address of contract + * @param {Array} [tokenId] List of token IDs to filter by * @param {string} [fromUpdatedAt] Datetime to use as the oldest updated timestamp * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response. * @param {number} [pageSize] Maximum number of items to return * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listNFTsByAccountAddress: async (accountAddress: string, chainName: string, contractAddress?: string, fromUpdatedAt?: string, pageCursor?: string, pageSize?: number, options: AxiosRequestConfig = {}): Promise => { + listNFTsByAccountAddress: async (accountAddress: string, chainName: string, contractAddress?: string, tokenId?: Array, fromUpdatedAt?: string, pageCursor?: string, pageSize?: number, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'accountAddress' is not null or undefined assertParamExists('listNFTsByAccountAddress', 'accountAddress', accountAddress) // verify required parameter 'chainName' is not null or undefined @@ -391,6 +392,10 @@ export const NftsApiAxiosParamCreator = function (configuration?: Configuration) localVarQueryParameter['contract_address'] = contractAddress; } + if (tokenId) { + localVarQueryParameter['token_id'] = tokenId; + } + if (fromUpdatedAt !== undefined) { localVarQueryParameter['from_updated_at'] = (fromUpdatedAt as any instanceof Date) ? (fromUpdatedAt as any).toISOString() : @@ -516,14 +521,15 @@ export const NftsApiFp = function(configuration?: Configuration) { * @param {string} accountAddress Account address * @param {string} chainName The name of chain * @param {string} [contractAddress] The address of contract + * @param {Array} [tokenId] List of token IDs to filter by * @param {string} [fromUpdatedAt] Datetime to use as the oldest updated timestamp * @param {string} [pageCursor] Encoded page cursor to retrieve previous or next page. Use the value returned in the response. * @param {number} [pageSize] Maximum number of items to return * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listNFTsByAccountAddress(accountAddress: string, chainName: string, contractAddress?: string, fromUpdatedAt?: string, pageCursor?: string, pageSize?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTsByAccountAddress(accountAddress, chainName, contractAddress, fromUpdatedAt, pageCursor, pageSize, options); + async listNFTsByAccountAddress(accountAddress: string, chainName: string, contractAddress?: string, tokenId?: Array, fromUpdatedAt?: string, pageCursor?: string, pageSize?: number, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listNFTsByAccountAddress(accountAddress, chainName, contractAddress, tokenId, fromUpdatedAt, pageCursor, pageSize, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -604,7 +610,7 @@ export const NftsApiFactory = function (configuration?: Configuration, basePath? * @throws {RequiredError} */ listNFTsByAccountAddress(requestParameters: NftsApiListNFTsByAccountAddressRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.listNFTsByAccountAddress(requestParameters.accountAddress, requestParameters.chainName, requestParameters.contractAddress, requestParameters.fromUpdatedAt, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(axios, basePath)); + return localVarFp.listNFTsByAccountAddress(requestParameters.accountAddress, requestParameters.chainName, requestParameters.contractAddress, requestParameters.tokenId, requestParameters.fromUpdatedAt, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(axios, basePath)); }, }; }; @@ -846,6 +852,13 @@ export interface NftsApiListNFTsByAccountAddressRequest { */ readonly contractAddress?: string + /** + * List of token IDs to filter by + * @type {Array} + * @memberof NftsApiListNFTsByAccountAddress + */ + readonly tokenId?: Array + /** * Datetime to use as the oldest updated timestamp * @type {string} @@ -956,7 +969,7 @@ export class NftsApi extends BaseAPI { * @memberof NftsApi */ public listNFTsByAccountAddress(requestParameters: NftsApiListNFTsByAccountAddressRequest, options?: AxiosRequestConfig) { - return NftsApiFp(this.configuration).listNFTsByAccountAddress(requestParameters.accountAddress, requestParameters.chainName, requestParameters.contractAddress, requestParameters.fromUpdatedAt, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath)); + return NftsApiFp(this.configuration).listNFTsByAccountAddress(requestParameters.accountAddress, requestParameters.chainName, requestParameters.contractAddress, requestParameters.tokenId, requestParameters.fromUpdatedAt, requestParameters.pageCursor, requestParameters.pageSize, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/internal/generated-clients/src/multi-rollup/domain/orders-api.ts b/packages/internal/generated-clients/src/multi-rollup/domain/orders-api.ts index 9ce7ab6b7f..f9ee85b2d8 100644 --- a/packages/internal/generated-clients/src/multi-rollup/domain/orders-api.ts +++ b/packages/internal/generated-clients/src/multi-rollup/domain/orders-api.ts @@ -268,7 +268,7 @@ export const OrdersApiAxiosParamCreator = function (configuration?: Configuratio * @param {string} [sellItemTokenId] Sell item token identifier to filter by * @param {string} [fromUpdatedAt] From updated at including given date * @param {number} [pageSize] Maximum number of orders to return per page - * @param {ListListingsSortByEnum} [sortBy] Order field to sort by + * @param {ListListingsSortByEnum} [sortBy] Order field to sort by. `buy_item_amount` sorts by per token price, for example if 5 ERC-1155s are on sale for 10eth, it’s sorted as 2eth for `buy_item_amount`. * @param {ListListingsSortDirectionEnum} [sortDirection] Ascending or descending direction for sort * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response. * @param {*} [options] Override http request option. @@ -356,6 +356,7 @@ export const OrdersApiAxiosParamCreator = function (configuration?: Configuratio * @summary List all trades * @param {string} chainName * @param {string} [accountAddress] + * @param {string} [sellItemContractAddress] * @param {string} [fromIndexedAt] From indexed at including given date * @param {number} [pageSize] Maximum number of trades to return per page * @param {ListTradesSortByEnum} [sortBy] Trade field to sort by @@ -364,7 +365,7 @@ export const OrdersApiAxiosParamCreator = function (configuration?: Configuratio * @param {*} [options] Override http request option. * @throws {RequiredError} */ - listTrades: async (chainName: string, accountAddress?: string, fromIndexedAt?: string, pageSize?: number, sortBy?: ListTradesSortByEnum, sortDirection?: ListTradesSortDirectionEnum, pageCursor?: string, options: AxiosRequestConfig = {}): Promise => { + listTrades: async (chainName: string, accountAddress?: string, sellItemContractAddress?: string, fromIndexedAt?: string, pageSize?: number, sortBy?: ListTradesSortByEnum, sortDirection?: ListTradesSortDirectionEnum, pageCursor?: string, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'chainName' is not null or undefined assertParamExists('listTrades', 'chainName', chainName) const localVarPath = `/v1/chains/{chain_name}/trades` @@ -384,6 +385,10 @@ export const OrdersApiAxiosParamCreator = function (configuration?: Configuratio localVarQueryParameter['account_address'] = accountAddress; } + if (sellItemContractAddress !== undefined) { + localVarQueryParameter['sell_item_contract_address'] = sellItemContractAddress; + } + if (fromIndexedAt !== undefined) { localVarQueryParameter['from_indexed_at'] = (fromIndexedAt as any instanceof Date) ? (fromIndexedAt as any).toISOString() : @@ -500,7 +505,7 @@ export const OrdersApiFp = function(configuration?: Configuration) { * @param {string} [sellItemTokenId] Sell item token identifier to filter by * @param {string} [fromUpdatedAt] From updated at including given date * @param {number} [pageSize] Maximum number of orders to return per page - * @param {ListListingsSortByEnum} [sortBy] Order field to sort by + * @param {ListListingsSortByEnum} [sortBy] Order field to sort by. `buy_item_amount` sorts by per token price, for example if 5 ERC-1155s are on sale for 10eth, it’s sorted as 2eth for `buy_item_amount`. * @param {ListListingsSortDirectionEnum} [sortDirection] Ascending or descending direction for sort * @param {string} [pageCursor] Page cursor to retrieve previous or next page. Use the value returned in the response. * @param {*} [options] Override http request option. @@ -515,6 +520,7 @@ export const OrdersApiFp = function(configuration?: Configuration) { * @summary List all trades * @param {string} chainName * @param {string} [accountAddress] + * @param {string} [sellItemContractAddress] * @param {string} [fromIndexedAt] From indexed at including given date * @param {number} [pageSize] Maximum number of trades to return per page * @param {ListTradesSortByEnum} [sortBy] Trade field to sort by @@ -523,8 +529,8 @@ export const OrdersApiFp = function(configuration?: Configuration) { * @param {*} [options] Override http request option. * @throws {RequiredError} */ - async listTrades(chainName: string, accountAddress?: string, fromIndexedAt?: string, pageSize?: number, sortBy?: ListTradesSortByEnum, sortDirection?: ListTradesSortDirectionEnum, pageCursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { - const localVarAxiosArgs = await localVarAxiosParamCreator.listTrades(chainName, accountAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, options); + async listTrades(chainName: string, accountAddress?: string, sellItemContractAddress?: string, fromIndexedAt?: string, pageSize?: number, sortBy?: ListTradesSortByEnum, sortDirection?: ListTradesSortDirectionEnum, pageCursor?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.listTrades(chainName, accountAddress, sellItemContractAddress, fromIndexedAt, pageSize, sortBy, sortDirection, pageCursor, options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, } @@ -605,7 +611,7 @@ export const OrdersApiFactory = function (configuration?: Configuration, basePat * @throws {RequiredError} */ listTrades(requestParameters: OrdersApiListTradesRequest, options?: AxiosRequestConfig): AxiosPromise { - return localVarFp.listTrades(requestParameters.chainName, requestParameters.accountAddress, requestParameters.fromIndexedAt, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(axios, basePath)); + return localVarFp.listTrades(requestParameters.chainName, requestParameters.accountAddress, requestParameters.sellItemContractAddress, requestParameters.fromIndexedAt, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(axios, basePath)); }, }; }; @@ -792,7 +798,7 @@ export interface OrdersApiListListingsRequest { readonly pageSize?: number /** - * Order field to sort by + * Order field to sort by. `buy_item_amount` sorts by per token price, for example if 5 ERC-1155s are on sale for 10eth, it’s sorted as 2eth for `buy_item_amount`. * @type {'created_at' | 'updated_at' | 'buy_item_amount'} * @memberof OrdersApiListListings */ @@ -833,6 +839,13 @@ export interface OrdersApiListTradesRequest { */ readonly accountAddress?: string + /** + * + * @type {string} + * @memberof OrdersApiListTrades + */ + readonly sellItemContractAddress?: string + /** * From indexed at including given date * @type {string} @@ -957,7 +970,7 @@ export class OrdersApi extends BaseAPI { * @memberof OrdersApi */ public listTrades(requestParameters: OrdersApiListTradesRequest, options?: AxiosRequestConfig) { - return OrdersApiFp(this.configuration).listTrades(requestParameters.chainName, requestParameters.accountAddress, requestParameters.fromIndexedAt, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath)); + return OrdersApiFp(this.configuration).listTrades(requestParameters.chainName, requestParameters.accountAddress, requestParameters.sellItemContractAddress, requestParameters.fromIndexedAt, requestParameters.pageSize, requestParameters.sortBy, requestParameters.sortDirection, requestParameters.pageCursor, options).then((request) => request(this.axios, this.basePath)); } } diff --git a/packages/internal/generated-clients/src/multi-rollup/domain/passport-profile-api.ts b/packages/internal/generated-clients/src/multi-rollup/domain/passport-profile-api.ts index 02879a034f..80f71bdd96 100644 --- a/packages/internal/generated-clients/src/multi-rollup/domain/passport-profile-api.ts +++ b/packages/internal/generated-clients/src/multi-rollup/domain/passport-profile-api.ts @@ -22,13 +22,21 @@ import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObj // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; // @ts-ignore +import { APIError400 } from '../models'; +// @ts-ignore import { APIError401 } from '../models'; // @ts-ignore +import { APIError403 } from '../models'; +// @ts-ignore import { APIError500 } from '../models'; // @ts-ignore import { BasicAPIError } from '../models'; // @ts-ignore +import { LinkWalletV2Request } from '../models'; +// @ts-ignore import { UserInfo } from '../models'; +// @ts-ignore +import { Wallet } from '../models'; /** * PassportProfileApi - axios parameter creator * @export @@ -64,6 +72,44 @@ export const PassportProfileApiAxiosParamCreator = function (configuration?: Con let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + /** + * Link an external EOA wallet to an Immutable Passport account by providing an EIP-712 signature. + * @summary Link wallet v2 + * @param {LinkWalletV2Request} [linkWalletV2Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + linkWalletV2: async (linkWalletV2Request?: LinkWalletV2Request, options: AxiosRequestConfig = {}): Promise => { + const localVarPath = `/passport-profile/v2/linked-wallets`; + // use dummy base URL string because the URL constructor only accepts absolute URLs. + const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); + let baseOptions; + if (configuration) { + baseOptions = configuration.baseOptions; + } + + const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + // authentication BearerAuth required + // http bearer authentication required + await setBearerAuthToObject(localVarHeaderParameter, configuration) + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(linkWalletV2Request, localVarRequestOptions, configuration) + return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, @@ -89,6 +135,17 @@ export const PassportProfileApiFp = function(configuration?: Configuration) { const localVarAxiosArgs = await localVarAxiosParamCreator.getUserInfo(options); return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); }, + /** + * Link an external EOA wallet to an Immutable Passport account by providing an EIP-712 signature. + * @summary Link wallet v2 + * @param {LinkWalletV2Request} [linkWalletV2Request] + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async linkWalletV2(linkWalletV2Request?: LinkWalletV2Request, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.linkWalletV2(linkWalletV2Request, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, } }; @@ -108,9 +165,33 @@ export const PassportProfileApiFactory = function (configuration?: Configuration getUserInfo(options?: AxiosRequestConfig): AxiosPromise { return localVarFp.getUserInfo(options).then((request) => request(axios, basePath)); }, + /** + * Link an external EOA wallet to an Immutable Passport account by providing an EIP-712 signature. + * @summary Link wallet v2 + * @param {PassportProfileApiLinkWalletV2Request} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + linkWalletV2(requestParameters: PassportProfileApiLinkWalletV2Request = {}, options?: AxiosRequestConfig): AxiosPromise { + return localVarFp.linkWalletV2(requestParameters.linkWalletV2Request, options).then((request) => request(axios, basePath)); + }, }; }; +/** + * Request parameters for linkWalletV2 operation in PassportProfileApi. + * @export + * @interface PassportProfileApiLinkWalletV2Request + */ +export interface PassportProfileApiLinkWalletV2Request { + /** + * + * @type {LinkWalletV2Request} + * @memberof PassportProfileApiLinkWalletV2 + */ + readonly linkWalletV2Request?: LinkWalletV2Request +} + /** * PassportProfileApi - object-oriented interface * @export @@ -128,5 +209,17 @@ export class PassportProfileApi extends BaseAPI { public getUserInfo(options?: AxiosRequestConfig) { return PassportProfileApiFp(this.configuration).getUserInfo(options).then((request) => request(this.axios, this.basePath)); } + + /** + * Link an external EOA wallet to an Immutable Passport account by providing an EIP-712 signature. + * @summary Link wallet v2 + * @param {PassportProfileApiLinkWalletV2Request} requestParameters Request parameters. + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof PassportProfileApi + */ + public linkWalletV2(requestParameters: PassportProfileApiLinkWalletV2Request = {}, options?: AxiosRequestConfig) { + return PassportProfileApiFp(this.configuration).linkWalletV2(requestParameters.linkWalletV2Request, options).then((request) => request(this.axios, this.basePath)); + } } diff --git a/packages/internal/generated-clients/src/multi-rollup/models/activity-nft.ts b/packages/internal/generated-clients/src/multi-rollup/models/activity-nft.ts index eb7a67642b..0d5298135f 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/activity-nft.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/activity-nft.ts @@ -42,9 +42,10 @@ export interface ActivityNFT { */ 'token_id': string; /** - * The amount of tokens exchanged + * (deprecated - will never be filled, use amount on Activity instead) The amount of tokens exchanged * @type {string} * @memberof ActivityNFT + * @deprecated */ 'amount': string; } diff --git a/packages/internal/generated-clients/src/multi-rollup/models/cancelled-order-status.ts b/packages/internal/generated-clients/src/multi-rollup/models/cancelled-order-status.ts index aa8911a34f..c71f6381a4 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/cancelled-order-status.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/cancelled-order-status.ts @@ -33,7 +33,7 @@ export interface CancelledOrderStatus { */ 'pending': boolean; /** - * Whether the cancellation was done on-chain or off-chain + * Whether the cancellation was done on-chain or off-chain or as a result of an underfunded account * @type {string} * @memberof CancelledOrderStatus */ @@ -47,7 +47,8 @@ export const CancelledOrderStatusNameEnum = { export type CancelledOrderStatusNameEnum = typeof CancelledOrderStatusNameEnum[keyof typeof CancelledOrderStatusNameEnum]; export const CancelledOrderStatusCancellationTypeEnum = { OnChain: 'ON_CHAIN', - OffChain: 'OFF_CHAIN' + OffChain: 'OFF_CHAIN', + Underfunded: 'UNDERFUNDED' } as const; export type CancelledOrderStatusCancellationTypeEnum = typeof CancelledOrderStatusCancellationTypeEnum[keyof typeof CancelledOrderStatusCancellationTypeEnum]; diff --git a/packages/internal/generated-clients/src/multi-rollup/models/collection-item.ts b/packages/internal/generated-clients/src/multi-rollup/models/collection-item.ts index d5e21636c2..c46b17efed 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/collection-item.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/collection-item.ts @@ -16,6 +16,9 @@ // May contain unused imports in some cases // @ts-ignore import { Network } from './network'; +// May contain unused imports in some cases +// @ts-ignore +import { TokenType } from './token-type'; /** * Item in a collection @@ -65,6 +68,18 @@ export interface CollectionItem { * @memberof CollectionItem */ 'owner': string; + /** + * Balance + * @type {string} + * @memberof CollectionItem + */ + 'balance': string; + /** + * + * @type {TokenType} + * @memberof CollectionItem + */ + 'token_type': TokenType; } diff --git a/packages/internal/generated-clients/src/multi-rollup/models/erc20-approve-metadata.ts b/packages/internal/generated-clients/src/multi-rollup/models/erc20-approve-metadata.ts index b3f04e52b3..253211be03 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/erc20-approve-metadata.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/erc20-approve-metadata.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; /** * @@ -26,6 +29,12 @@ export interface ERC20ApproveMetadata { * @memberof ERC20ApproveMetadata */ 'transaction_type': ERC20ApproveMetadataTransactionTypeEnum; + /** + * + * @type {ImmutableVerificationStatusEnum} + * @memberof ERC20ApproveMetadata + */ + 'immutable_verification_status': ImmutableVerificationStatusEnum; /** * Requested approval amount * @type {string} @@ -62,6 +71,12 @@ export interface ERC20ApproveMetadata { * @memberof ERC20ApproveMetadata */ 'contract_name': string; + /** + * + * @type {string} + * @memberof ERC20ApproveMetadata + */ + 'image_url': string; } export const ERC20ApproveMetadataTransactionTypeEnum = { diff --git a/packages/internal/generated-clients/src/multi-rollup/models/erc20-transfer-from-metadata.ts b/packages/internal/generated-clients/src/multi-rollup/models/erc20-transfer-from-metadata.ts index 74f86a8404..7210c10d66 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/erc20-transfer-from-metadata.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/erc20-transfer-from-metadata.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; /** * @@ -44,6 +47,12 @@ export interface ERC20TransferFromMetadata { * @memberof ERC20TransferFromMetadata */ 'amount': string; + /** + * + * @type {ImmutableVerificationStatusEnum} + * @memberof ERC20TransferFromMetadata + */ + 'immutable_verification_status': ImmutableVerificationStatusEnum; /** * The token decimals * @type {number} diff --git a/packages/internal/generated-clients/src/multi-rollup/models/erc20-transfer-metadata.ts b/packages/internal/generated-clients/src/multi-rollup/models/erc20-transfer-metadata.ts index 54ebc4cfe7..212dfb1bf9 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/erc20-transfer-metadata.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/erc20-transfer-metadata.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; /** * @@ -38,6 +41,12 @@ export interface ERC20TransferMetadata { * @memberof ERC20TransferMetadata */ 'amount': string; + /** + * + * @type {ImmutableVerificationStatusEnum} + * @memberof ERC20TransferMetadata + */ + 'immutable_verification_status': ImmutableVerificationStatusEnum; /** * The token decimals * @type {number} diff --git a/packages/internal/generated-clients/src/multi-rollup/models/erc721-approve-metadata.ts b/packages/internal/generated-clients/src/multi-rollup/models/erc721-approve-metadata.ts index bee2502c32..f0cc851e5e 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/erc721-approve-metadata.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/erc721-approve-metadata.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; /** * @@ -68,6 +71,18 @@ export interface ERC721ApproveMetadata { * @memberof ERC721ApproveMetadata */ 'contract_name': string; + /** + * ID of the ERC721 + * @type {string} + * @memberof ERC721ApproveMetadata + */ + 'token_id': string; + /** + * + * @type {ImmutableVerificationStatusEnum} + * @memberof ERC721ApproveMetadata + */ + 'immutable_verification_status': ImmutableVerificationStatusEnum; } export const ERC721ApproveMetadataTransactionTypeEnum = { diff --git a/packages/internal/generated-clients/src/multi-rollup/models/erc721-safe-transfer-from-batch-metadata.ts b/packages/internal/generated-clients/src/multi-rollup/models/erc721-safe-transfer-from-batch-metadata.ts index 05de8c1c4d..63afab58c7 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/erc721-safe-transfer-from-batch-metadata.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/erc721-safe-transfer-from-batch-metadata.ts @@ -16,6 +16,9 @@ // May contain unused imports in some cases // @ts-ignore import { ERC721SafeTransferFromBatchItem } from './erc721-safe-transfer-from-batch-item'; +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; /** * @@ -47,6 +50,12 @@ export interface ERC721SafeTransferFromBatchMetadata { * @memberof ERC721SafeTransferFromBatchMetadata */ 'items': Array; + /** + * + * @type {ImmutableVerificationStatusEnum} + * @memberof ERC721SafeTransferFromBatchMetadata + */ + 'immutable_verification_status': ImmutableVerificationStatusEnum; } export const ERC721SafeTransferFromBatchMetadataTransactionTypeEnum = { diff --git a/packages/internal/generated-clients/src/multi-rollup/models/erc721-transfer-from-metadata.ts b/packages/internal/generated-clients/src/multi-rollup/models/erc721-transfer-from-metadata.ts index eedb42b00c..082ae14c46 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/erc721-transfer-from-metadata.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/erc721-transfer-from-metadata.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; /** * @@ -62,6 +65,12 @@ export interface ERC721TransferFromMetadata { * @memberof ERC721TransferFromMetadata */ 'asset_image': string; + /** + * + * @type {ImmutableVerificationStatusEnum} + * @memberof ERC721TransferFromMetadata + */ + 'immutable_verification_status': ImmutableVerificationStatusEnum; } export const ERC721TransferFromMetadataTransactionTypeEnum = { diff --git a/packages/internal/generated-clients/src/multi-rollup/models/get-transaction-metadata-res.ts b/packages/internal/generated-clients/src/multi-rollup/models/get-transaction-metadata-res.ts index b28587a8fd..1a30efc805 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/get-transaction-metadata-res.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/get-transaction-metadata-res.ts @@ -36,6 +36,9 @@ import { ERC721SafeTransferFromBatchMetadata } from './erc721-safe-transfer-from import { ERC721TransferFromMetadata } from './erc721-transfer-from-metadata'; // May contain unused imports in some cases // @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; +// May contain unused imports in some cases +// @ts-ignore import { NFTSetApprovalForAllMetadata } from './nftset-approval-for-all-metadata'; // May contain unused imports in some cases // @ts-ignore diff --git a/packages/internal/generated-clients/src/multi-rollup/models/get-typed-data-metadata-res.ts b/packages/internal/generated-clients/src/multi-rollup/models/get-typed-data-metadata-res.ts index dc845ceb0d..7aba3d7e2e 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/get-typed-data-metadata-res.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/get-typed-data-metadata-res.ts @@ -21,7 +21,7 @@ import { SeaportCreateListingMetadata } from './seaport-create-listing-metadata' import { SeaportCreateListingMetadataBuy } from './seaport-create-listing-metadata-buy'; // May contain unused imports in some cases // @ts-ignore -import { SeaportERC721Item } from './seaport-erc721-item'; +import { SeaportCreateListingMetadataSell } from './seaport-create-listing-metadata-sell'; // May contain unused imports in some cases // @ts-ignore import { SeaportFee } from './seaport-fee'; diff --git a/packages/internal/generated-clients/src/multi-rollup/models/immutable-verification-status-enum.ts b/packages/internal/generated-clients/src/multi-rollup/models/immutable-verification-status-enum.ts new file mode 100644 index 0000000000..ef416468bc --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/immutable-verification-status-enum.ts @@ -0,0 +1,33 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * + * @export + * @enum {string} + */ + +export const ImmutableVerificationStatusEnum = { + Verified: 'verified', + Unverified: 'unverified', + Spam: 'spam', + Inactive: 'inactive' +} as const; + +export type ImmutableVerificationStatusEnum = typeof ImmutableVerificationStatusEnum[keyof typeof ImmutableVerificationStatusEnum]; + + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/index.ts b/packages/internal/generated-clients/src/multi-rollup/models/index.ts index 5c3930dbfc..6b668a12cc 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/index.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/index.ts @@ -78,8 +78,10 @@ export * from './get-transaction-metadata-request'; export * from './get-transaction-metadata-res'; export * from './get-typed-data-metadata-request'; export * from './get-typed-data-metadata-res'; +export * from './immutable-verification-status-enum'; export * from './inactive-order-status'; export * from './item'; +export * from './link-wallet-v2-request'; export * from './list-activities-result'; export * from './list-chains-result'; export * from './list-collection-owners-result'; @@ -112,9 +114,18 @@ export * from './nftwith-owner'; export * from './native-item'; export * from './network'; export * from './nft-collection'; +export * from './operator-allowlist-admin-action'; +export * from './operator-allowlist-contract-status'; +export * from './operator-allowlist-contract-status-internal'; +export * from './operator-allowlist-contract-status-internal-all-of'; +export * from './operator-allowlist-status'; +export * from './operator-allowlist-status-details'; +export * from './operator-allowlist-status-requested'; +export * from './operator-allowlist-status-updated'; export * from './order'; export * from './order-status'; export * from './order-status-name'; +export * from './organisation-tier'; export * from './page'; export * from './page-response'; export * from './pending-order-status'; @@ -133,8 +144,11 @@ export * from './sale-payment'; export * from './sale-payment-token'; export * from './seaport-advanced-order'; export * from './seaport-advanced-order-buy'; +export * from './seaport-advanced-order-sell'; export * from './seaport-create-listing-metadata'; export * from './seaport-create-listing-metadata-buy'; +export * from './seaport-create-listing-metadata-sell'; +export * from './seaport-erc1155-item'; export * from './seaport-erc20-item'; export * from './seaport-erc721-item'; export * from './seaport-fee'; @@ -142,6 +156,7 @@ export * from './seaport-fulfill-available-advanced-orders-metadata'; export * from './seaport-native-item'; export * from './token'; export * from './token-contract-type'; +export * from './token-type'; export * from './trade'; export * from './trade-blockchain-metadata'; export * from './trade-result'; @@ -152,5 +167,8 @@ export * from './unknown-typed-data-metadata'; export * from './user-info'; export * from './verification-request'; export * from './verification-request-contract-type'; +export * from './verification-request-internal'; +export * from './verification-request-internal-all-of'; export * from './verification-request-status'; +export * from './wallet'; export * from './withdrawal'; diff --git a/packages/internal/generated-clients/src/multi-rollup/models/link-wallet-v2-request.ts b/packages/internal/generated-clients/src/multi-rollup/models/link-wallet-v2-request.ts new file mode 100644 index 0000000000..aaec723214 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/link-wallet-v2-request.ts @@ -0,0 +1,48 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * Link wallet V2 request + * @export + * @interface LinkWalletV2Request + */ +export interface LinkWalletV2Request { + /** + * This should be the EIP-6963 rdns value, if you\'re unable to get the rdns value you can provide \"External\". If using WalletConnect then provide \"WalletConnect\". + * @type {string} + * @memberof LinkWalletV2Request + */ + 'type': string; + /** + * The address of the external wallet being linked to Passport + * @type {string} + * @memberof LinkWalletV2Request + */ + 'wallet_address': string; + /** + * The EIP-712 signature + * @type {string} + * @memberof LinkWalletV2Request + */ + 'signature': string; + /** + * A unique identifier for the signature + * @type {string} + * @memberof LinkWalletV2Request + */ + 'nonce': string; +} + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/nft-collection.ts b/packages/internal/generated-clients/src/multi-rollup/models/nft-collection.ts index 0f01b107be..7775b63d0b 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/nft-collection.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/nft-collection.ts @@ -16,6 +16,9 @@ // May contain unused imports in some cases // @ts-ignore import { Network } from './network'; +// May contain unused imports in some cases +// @ts-ignore +import { TokenType } from './token-type'; /** * Collection @@ -65,6 +68,12 @@ export interface NftCollection { * @memberof NftCollection */ 'owners'?: Array; + /** + * + * @type {TokenType} + * @memberof NftCollection + */ + 'token_type': TokenType; } diff --git a/packages/internal/generated-clients/src/multi-rollup/models/nftmetadata-request.ts b/packages/internal/generated-clients/src/multi-rollup/models/nftmetadata-request.ts index bf7393894e..8fa513b837 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/nftmetadata-request.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/nftmetadata-request.ts @@ -18,7 +18,7 @@ import { NFTMetadataAttribute } from './nftmetadata-attribute'; /** - * The NFT metadata + * The NFT metadata. Total size of this object should not exceed 16 KiB * @export * @interface NFTMetadataRequest */ diff --git a/packages/internal/generated-clients/src/multi-rollup/models/nftset-approval-for-all-metadata.ts b/packages/internal/generated-clients/src/multi-rollup/models/nftset-approval-for-all-metadata.ts index 08b2eff2ec..0587d0cd3f 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/nftset-approval-for-all-metadata.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/nftset-approval-for-all-metadata.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; /** * @@ -56,6 +59,12 @@ export interface NFTSetApprovalForAllMetadata { * @memberof NFTSetApprovalForAllMetadata */ 'contract_name': string; + /** + * + * @type {ImmutableVerificationStatusEnum} + * @memberof NFTSetApprovalForAllMetadata + */ + 'immutable_verification_status': ImmutableVerificationStatusEnum; } export const NFTSetApprovalForAllMetadataTransactionTypeEnum = { diff --git a/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-admin-action.ts b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-admin-action.ts new file mode 100644 index 0000000000..e9f8d39df6 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-admin-action.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * The action an admin can take on an operator allowlist request + * @export + * @enum {string} + */ + +export const OperatorAllowlistAdminAction = { + Approve: 'approve', + Reject: 'reject' +} as const; + +export type OperatorAllowlistAdminAction = typeof OperatorAllowlistAdminAction[keyof typeof OperatorAllowlistAdminAction]; + + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-contract-status-internal-all-of.ts b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-contract-status-internal-all-of.ts new file mode 100644 index 0000000000..180956fb00 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-contract-status-internal-all-of.ts @@ -0,0 +1,41 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { OrganisationTier } from './organisation-tier'; + +/** + * + * @export + * @interface OperatorAllowlistContractStatusInternalAllOf + */ +export interface OperatorAllowlistContractStatusInternalAllOf { + /** + * The name of the organisation associated with this contract + * @type {string} + * @memberof OperatorAllowlistContractStatusInternalAllOf + */ + 'org_name': string | null; + /** + * + * @type {OrganisationTier} + * @memberof OperatorAllowlistContractStatusInternalAllOf + */ + 'org_tier': OrganisationTier | null; +} + + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-contract-status-internal.ts b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-contract-status-internal.ts new file mode 100644 index 0000000000..15f7be225e --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-contract-status-internal.ts @@ -0,0 +1,41 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { Chain } from './chain'; +// May contain unused imports in some cases +// @ts-ignore +import { OperatorAllowlistContractStatus } from './operator-allowlist-contract-status'; +// May contain unused imports in some cases +// @ts-ignore +import { OperatorAllowlistContractStatusInternalAllOf } from './operator-allowlist-contract-status-internal-all-of'; +// May contain unused imports in some cases +// @ts-ignore +import { OperatorAllowlistStatus } from './operator-allowlist-status'; +// May contain unused imports in some cases +// @ts-ignore +import { OperatorAllowlistStatusDetails } from './operator-allowlist-status-details'; +// May contain unused imports in some cases +// @ts-ignore +import { OrganisationTier } from './organisation-tier'; + +/** + * @type OperatorAllowlistContractStatusInternal + * @export + */ +export type OperatorAllowlistContractStatusInternal = OperatorAllowlistContractStatus & OperatorAllowlistContractStatusInternalAllOf; + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-contract-status.ts b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-contract-status.ts new file mode 100644 index 0000000000..2b0df897ba --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-contract-status.ts @@ -0,0 +1,71 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { Chain } from './chain'; +// May contain unused imports in some cases +// @ts-ignore +import { OperatorAllowlistStatus } from './operator-allowlist-status'; +// May contain unused imports in some cases +// @ts-ignore +import { OperatorAllowlistStatusDetails } from './operator-allowlist-status-details'; + +/** + * + * @export + * @interface OperatorAllowlistContractStatus + */ +export interface OperatorAllowlistContractStatus { + /** + * + * @type {Chain} + * @memberof OperatorAllowlistContractStatus + */ + 'chain': Chain; + /** + * The address of the contract + * @type {string} + * @memberof OperatorAllowlistContractStatus + */ + 'contract_address': string; + /** + * + * @type {OperatorAllowlistStatus} + * @memberof OperatorAllowlistContractStatus + */ + 'status': OperatorAllowlistStatus; + /** + * + * @type {OperatorAllowlistStatusDetails} + * @memberof OperatorAllowlistContractStatus + */ + 'details': OperatorAllowlistStatusDetails; + /** + * When the contract status was created + * @type {string} + * @memberof OperatorAllowlistContractStatus + */ + 'created_at': string; + /** + * Who created the status + * @type {string} + * @memberof OperatorAllowlistContractStatus + */ + 'created_by': string; +} + + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status-details.ts b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status-details.ts new file mode 100644 index 0000000000..6dcb38b3c7 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status-details.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { OperatorAllowlistStatusRequested } from './operator-allowlist-status-requested'; +// May contain unused imports in some cases +// @ts-ignore +import { OperatorAllowlistStatusUpdated } from './operator-allowlist-status-updated'; + +/** + * @type OperatorAllowlistStatusDetails + * The operator allowlist status details + * @export + */ +export type OperatorAllowlistStatusDetails = OperatorAllowlistStatusRequested | OperatorAllowlistStatusUpdated; + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status-requested.ts b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status-requested.ts new file mode 100644 index 0000000000..42e4f7e8c0 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status-requested.ts @@ -0,0 +1,36 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * The request details + * @export + * @interface OperatorAllowlistStatusRequested + */ +export interface OperatorAllowlistStatusRequested { + /** + * Reason this contract needs to be added + * @type {string} + * @memberof OperatorAllowlistStatusRequested + */ + 'purpose': string; + /** + * Attestation of whether this contract is a settlement contract + * @type {boolean} + * @memberof OperatorAllowlistStatusRequested + */ + 'is_settlement_contract': boolean; +} + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status-updated.ts b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status-updated.ts new file mode 100644 index 0000000000..a58813a223 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status-updated.ts @@ -0,0 +1,30 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * The update details + * @export + * @interface OperatorAllowlistStatusUpdated + */ +export interface OperatorAllowlistStatusUpdated { + /** + * Why this action was performed + * @type {string} + * @memberof OperatorAllowlistStatusUpdated + */ + 'reason': string; +} + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status.ts b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status.ts new file mode 100644 index 0000000000..b47ff27b13 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/operator-allowlist-status.ts @@ -0,0 +1,34 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * The status of a contract on the operator allowlist + * @export + * @enum {string} + */ + +export const OperatorAllowlistStatus = { + Requested: 'requested', + Approved: 'approved', + Rejected: 'rejected', + Removed: 'removed', + Added: 'added' +} as const; + +export type OperatorAllowlistStatus = typeof OperatorAllowlistStatus[keyof typeof OperatorAllowlistStatus]; + + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/organisation-tier.ts b/packages/internal/generated-clients/src/multi-rollup/models/organisation-tier.ts new file mode 100644 index 0000000000..f7d0395c10 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/organisation-tier.ts @@ -0,0 +1,34 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * The tier of the organisation + * @export + * @enum {string} + */ + +export const OrganisationTier = { + Common: 'common', + Uncommon: 'uncommon', + Rare: 'rare', + Epic: 'epic', + Legendary: 'legendary' +} as const; + +export type OrganisationTier = typeof OrganisationTier[keyof typeof OrganisationTier]; + + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/refresh-metadata-by-idrequest.ts b/packages/internal/generated-clients/src/multi-rollup/models/refresh-metadata-by-idrequest.ts index da837a2d54..59e3c81552 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/refresh-metadata-by-idrequest.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/refresh-metadata-by-idrequest.ts @@ -18,7 +18,7 @@ import { RefreshMetadataByID } from './refresh-metadata-by-id'; /** - * Request body for refreshing metadata by id + * Request body for refreshing metadata by id. Total size of this list should not exceed 228 KiB * @export * @interface RefreshMetadataByIDRequest */ diff --git a/packages/internal/generated-clients/src/multi-rollup/models/refresh-nftmetadata-by-token-idrequest.ts b/packages/internal/generated-clients/src/multi-rollup/models/refresh-nftmetadata-by-token-idrequest.ts index 5e63655c04..0b6b9b4a83 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/refresh-nftmetadata-by-token-idrequest.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/refresh-nftmetadata-by-token-idrequest.ts @@ -24,7 +24,7 @@ import { RefreshMetadataByTokenID } from './refresh-metadata-by-token-id'; */ export interface RefreshNFTMetadataByTokenIDRequest { /** - * List of nft metadata to be refreshed + * List of nft metadata to be refreshed. Total size of the list should not exceed 228 KiB * @type {Array} * @memberof RefreshNFTMetadataByTokenIDRequest */ diff --git a/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order-buy.ts b/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order-buy.ts index 37c10f00bf..122beaee9d 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order-buy.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order-buy.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; // May contain unused imports in some cases // @ts-ignore import { SeaportERC20Item } from './seaport-erc20-item'; diff --git a/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order-sell.ts b/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order-sell.ts new file mode 100644 index 0000000000..62306204ad --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order-sell.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; +// May contain unused imports in some cases +// @ts-ignore +import { SeaportERC1155Item } from './seaport-erc1155-item'; +// May contain unused imports in some cases +// @ts-ignore +import { SeaportERC721Item } from './seaport-erc721-item'; + +/** + * @type SeaportAdvancedOrderSell + * @export + */ +export type SeaportAdvancedOrderSell = SeaportERC1155Item | SeaportERC721Item; + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order.ts b/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order.ts index 18903f5843..84de228bdd 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/seaport-advanced-order.ts @@ -18,7 +18,7 @@ import { SeaportAdvancedOrderBuy } from './seaport-advanced-order-buy'; // May contain unused imports in some cases // @ts-ignore -import { SeaportERC721Item } from './seaport-erc721-item'; +import { SeaportAdvancedOrderSell } from './seaport-advanced-order-sell'; // May contain unused imports in some cases // @ts-ignore import { SeaportFee } from './seaport-fee'; @@ -37,10 +37,10 @@ export interface SeaportAdvancedOrder { 'buy': SeaportAdvancedOrderBuy; /** * - * @type {SeaportERC721Item} + * @type {SeaportAdvancedOrderSell} * @memberof SeaportAdvancedOrder */ - 'sell': SeaportERC721Item; + 'sell': SeaportAdvancedOrderSell; /** * * @type {Array} diff --git a/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata-buy.ts b/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata-buy.ts index 71d8d1d419..8ae81ed735 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata-buy.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata-buy.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; // May contain unused imports in some cases // @ts-ignore import { SeaportERC20Item } from './seaport-erc20-item'; diff --git a/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata-sell.ts b/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata-sell.ts new file mode 100644 index 0000000000..d6e249e508 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata-sell.ts @@ -0,0 +1,32 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; +// May contain unused imports in some cases +// @ts-ignore +import { SeaportERC1155Item } from './seaport-erc1155-item'; +// May contain unused imports in some cases +// @ts-ignore +import { SeaportERC721Item } from './seaport-erc721-item'; + +/** + * @type SeaportCreateListingMetadataSell + * @export + */ +export type SeaportCreateListingMetadataSell = SeaportERC1155Item | SeaportERC721Item; + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata.ts b/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata.ts index 093a2a0eed..93a4a02e25 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/seaport-create-listing-metadata.ts @@ -18,7 +18,7 @@ import { SeaportCreateListingMetadataBuy } from './seaport-create-listing-metadata-buy'; // May contain unused imports in some cases // @ts-ignore -import { SeaportERC721Item } from './seaport-erc721-item'; +import { SeaportCreateListingMetadataSell } from './seaport-create-listing-metadata-sell'; // May contain unused imports in some cases // @ts-ignore import { SeaportFee } from './seaport-fee'; @@ -43,10 +43,10 @@ export interface SeaportCreateListingMetadata { 'buy': SeaportCreateListingMetadataBuy; /** * - * @type {SeaportERC721Item} + * @type {SeaportCreateListingMetadataSell} * @memberof SeaportCreateListingMetadata */ - 'sell': SeaportERC721Item; + 'sell': SeaportCreateListingMetadataSell; /** * * @type {Array} diff --git a/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc1155-item.ts b/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc1155-item.ts new file mode 100644 index 0000000000..dc68edff46 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc1155-item.ts @@ -0,0 +1,82 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; + +/** + * + * @export + * @interface SeaportERC1155Item + */ +export interface SeaportERC1155Item { + /** + * Token type user is offering, which in this case is ERC1155 + * @type {string} + * @memberof SeaportERC1155Item + */ + 'type': SeaportERC1155ItemTypeEnum; + /** + * Address of ERC1155 token + * @type {string} + * @memberof SeaportERC1155Item + */ + 'contract_address': string; + /** + * The name of the collection + * @type {string} + * @memberof SeaportERC1155Item + */ + 'contract_name'?: string | null; + /** + * The URL of the asset + * @type {string} + * @memberof SeaportERC1155Item + */ + 'image_url'?: string; + /** + * The name of the asset + * @type {string} + * @memberof SeaportERC1155Item + */ + 'name'?: string | null; + /** + * ID of ERC1155 token + * @type {string} + * @memberof SeaportERC1155Item + */ + 'token_id': string; + /** + * A string representing the total units of an ERC1155 token which the user is selling + * @type {string} + * @memberof SeaportERC1155Item + */ + 'amount': string; + /** + * + * @type {ImmutableVerificationStatusEnum} + * @memberof SeaportERC1155Item + */ + 'immutable_verification_status': ImmutableVerificationStatusEnum; +} + +export const SeaportERC1155ItemTypeEnum = { + Erc1155: 'ERC1155' +} as const; + +export type SeaportERC1155ItemTypeEnum = typeof SeaportERC1155ItemTypeEnum[keyof typeof SeaportERC1155ItemTypeEnum]; + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc20-item.ts b/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc20-item.ts index 2c832c6cad..a7412545e8 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc20-item.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc20-item.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; /** * @@ -56,6 +59,12 @@ export interface SeaportERC20Item { * @memberof SeaportERC20Item */ 'decimals': number; + /** + * + * @type {ImmutableVerificationStatusEnum} + * @memberof SeaportERC20Item + */ + 'immutable_verification_status': ImmutableVerificationStatusEnum; } export const SeaportERC20ItemTypeEnum = { diff --git a/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc721-item.ts b/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc721-item.ts index bd11238bf0..50bc74dd9f 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc721-item.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/seaport-erc721-item.ts @@ -13,6 +13,9 @@ */ +// May contain unused imports in some cases +// @ts-ignore +import { ImmutableVerificationStatusEnum } from './immutable-verification-status-enum'; /** * @@ -56,6 +59,12 @@ export interface SeaportERC721Item { * @memberof SeaportERC721Item */ 'token_id': string; + /** + * + * @type {ImmutableVerificationStatusEnum} + * @memberof SeaportERC721Item + */ + 'immutable_verification_status': ImmutableVerificationStatusEnum; } export const SeaportERC721ItemTypeEnum = { diff --git a/packages/internal/generated-clients/src/multi-rollup/models/token-type.ts b/packages/internal/generated-clients/src/multi-rollup/models/token-type.ts new file mode 100644 index 0000000000..3036ac5f91 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/token-type.ts @@ -0,0 +1,31 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * Contract type for token (ERC721/ERC1155) + * @export + * @enum {string} + */ + +export const TokenType = { + Erc721: 'ERC721', + Erc1155: 'ERC1155' +} as const; + +export type TokenType = typeof TokenType[keyof typeof TokenType]; + + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/token.ts b/packages/internal/generated-clients/src/multi-rollup/models/token.ts index d943969256..0e4d5e95fd 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/token.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/token.ts @@ -44,6 +44,18 @@ export interface Token { * @memberof Token */ 'root_contract_address': string | null; + /** + * The id of the root chain for a bridged token + * @type {string} + * @memberof Token + */ + 'root_chain_id'?: string | null; + /** + * The name of the bridge, for bridged tokens only + * @type {string} + * @memberof Token + */ + 'bridge_used'?: string | null; /** * The symbol of token * @type {string} diff --git a/packages/internal/generated-clients/src/multi-rollup/models/verification-request-internal-all-of.ts b/packages/internal/generated-clients/src/multi-rollup/models/verification-request-internal-all-of.ts new file mode 100644 index 0000000000..e93daea9e5 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/verification-request-internal-all-of.ts @@ -0,0 +1,35 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { OrganisationTier } from './organisation-tier'; + +/** + * + * @export + * @interface VerificationRequestInternalAllOf + */ +export interface VerificationRequestInternalAllOf { + /** + * + * @type {OrganisationTier} + * @memberof VerificationRequestInternalAllOf + */ + 'org_tier': OrganisationTier | null; +} + + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/verification-request-internal.ts b/packages/internal/generated-clients/src/multi-rollup/models/verification-request-internal.ts new file mode 100644 index 0000000000..12bfd33dbe --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/verification-request-internal.ts @@ -0,0 +1,42 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + +// May contain unused imports in some cases +// @ts-ignore +import { Chain } from './chain'; +// May contain unused imports in some cases +// @ts-ignore +import { OrganisationTier } from './organisation-tier'; +// May contain unused imports in some cases +// @ts-ignore +import { VerificationRequest } from './verification-request'; +// May contain unused imports in some cases +// @ts-ignore +import { VerificationRequestContractType } from './verification-request-contract-type'; +// May contain unused imports in some cases +// @ts-ignore +import { VerificationRequestInternalAllOf } from './verification-request-internal-all-of'; +// May contain unused imports in some cases +// @ts-ignore +import { VerificationRequestStatus } from './verification-request-status'; + +/** + * @type VerificationRequestInternal + * The verification request (internal) + * @export + */ +export type VerificationRequestInternal = VerificationRequest & VerificationRequestInternalAllOf; + + diff --git a/packages/internal/generated-clients/src/multi-rollup/models/verification-request.ts b/packages/internal/generated-clients/src/multi-rollup/models/verification-request.ts index e723c3d934..053703cb5d 100644 --- a/packages/internal/generated-clients/src/multi-rollup/models/verification-request.ts +++ b/packages/internal/generated-clients/src/multi-rollup/models/verification-request.ts @@ -24,7 +24,7 @@ import { VerificationRequestContractType } from './verification-request-contract import { VerificationRequestStatus } from './verification-request-status'; /** - * + * The verification request * @export * @interface VerificationRequest */ @@ -53,12 +53,6 @@ export interface VerificationRequest { * @memberof VerificationRequest */ 'org_name': string | null; - /** - * The name of the project associated with this contract - * @type {string} - * @memberof VerificationRequest - */ - 'project_name': string | null; /** * The name of the collection * @type {string} diff --git a/packages/internal/generated-clients/src/multi-rollup/models/wallet.ts b/packages/internal/generated-clients/src/multi-rollup/models/wallet.ts new file mode 100644 index 0000000000..dc8365baa6 --- /dev/null +++ b/packages/internal/generated-clients/src/multi-rollup/models/wallet.ts @@ -0,0 +1,60 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * Immutable zkEVM API + * Immutable Multi Rollup API + * + * The version of the OpenAPI document: 1.0.0 + * Contact: support@immutable.com + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + + + +/** + * Linked wallet + * @export + * @interface Wallet + */ +export interface Wallet { + /** + * Ethereum address + * @type {string} + * @memberof Wallet + */ + 'address': string; + /** + * Wallet type + * @type {string} + * @memberof Wallet + */ + 'type': string; + /** + * Created at + * @type {string} + * @memberof Wallet + */ + 'created_at': string; + /** + * Created at + * @type {string} + * @memberof Wallet + */ + 'updated_at': string; + /** + * Name + * @type {string} + * @memberof Wallet + */ + 'name'?: string; + /** + * Name of client that linked the wallet + * @type {string} + * @memberof Wallet + */ + 'clientName': string; +} + diff --git a/packages/passport/sdk-sample-app/src/components/LinkWallet.tsx b/packages/passport/sdk-sample-app/src/components/LinkWallet.tsx new file mode 100644 index 0000000000..6de45ae3d1 --- /dev/null +++ b/packages/passport/sdk-sample-app/src/components/LinkWallet.tsx @@ -0,0 +1,141 @@ +import React, { useState } from 'react'; +import { + Button, Form, Offcanvas, Spinner, Stack, +} from 'react-bootstrap'; +import { ModalProps } from '@/types'; +import { Heading } from '@biom3/react'; + +function LinkWallet({ showModal, setShowModal, onSubmit }: ModalProps & { + onSubmit: (type: string, walletAddress: string, signature: string, nonce: string) => void; +}) { + const [type, setType] = useState(''); + const [walletAddress, setWalletAddress] = useState(''); + const [signature, setSignature] = useState(''); + const [nonce, setNonce] = useState(''); + const [isSubmitting, setIsSubmitting] = useState(false); + const [isInvalid, setInvalid] = useState(undefined); + + const resetForm = () => { + setType(''); + setWalletAddress(''); + setSignature(''); + }; + + const handleClose = () => { + resetForm(); + setInvalid(false); + setIsSubmitting(false); + setShowModal(false); + }; + + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + e.stopPropagation(); + + const form = e.currentTarget; + if (form.checkValidity()) { + setInvalid(false); + setIsSubmitting(true); + try { + await onSubmit(type, walletAddress, signature, nonce); + } catch (err) { + console.error('Error linking wallet:', err); + } finally { + handleClose(); + } + } else { + setInvalid(true); + } + }; + + return ( + + + Link Wallet + + +
+ + + Type + * + + setType(e.target.value)} + /> + + Type is required + + + + + Wallet Address + * + + setWalletAddress(e.target.value)} + /> + + Wallet Address is required + + + + + Signature + * + + setSignature(e.target.value)} + /> + + Signature is required + + + + + Nonce + * + + setNonce(e.target.value)} + /> + + Nonce is required + + + + + {!isSubmitting && ( + + )} + {isSubmitting && } + +
+
+
+ ); +} + +export default LinkWallet; diff --git a/packages/passport/sdk-sample-app/src/components/PassportMethods.tsx b/packages/passport/sdk-sample-app/src/components/PassportMethods.tsx index 20f781a093..6d8065e140 100644 --- a/packages/passport/sdk-sample-app/src/components/PassportMethods.tsx +++ b/packages/passport/sdk-sample-app/src/components/PassportMethods.tsx @@ -1,11 +1,13 @@ -import React from 'react'; +import React, { useCallback, useState } from 'react'; import { Stack } from 'react-bootstrap'; import { useStatusProvider } from '@/context/StatusProvider'; import { usePassportProvider } from '@/context/PassportProvider'; import CardStack from '@/components/CardStack'; import WorkflowButton from '@/components/WorkflowButton'; +import LinkWallet from '@/components/LinkWallet'; function PassportMethods() { + const [showLinkWallet, setShowLinkWallet] = useState(false); const { isLoading } = useStatusProvider(); const { logout, @@ -14,8 +16,30 @@ function PassportMethods() { getAccessToken, getUserInfo, getLinkedAddresses, + linkWallet, } = usePassportProvider(); + const handleLinkWalletClick = async () => { + const userInfo = await getUserInfo(); + if (userInfo) { + setShowLinkWallet(true); + } else { + console.error('Error checking login status'); + } + }; + + const handleLinkWalletSubmit = useCallback(async ( + type: string, + walletAddress: string, + signature: string, + nonce: string, + ) => { + await linkWallet({ + type, walletAddress, signature, nonce, + }); + setShowLinkWallet(false); + }, [linkWallet]); + return ( @@ -55,7 +79,20 @@ function PassportMethods() { > Get Linked Addresses + + Link Wallet + + {showLinkWallet && ( + + )} ); } diff --git a/packages/passport/sdk-sample-app/src/context/PassportProvider.tsx b/packages/passport/sdk-sample-app/src/context/PassportProvider.tsx index 1b35dec6a8..154248f01c 100644 --- a/packages/passport/sdk-sample-app/src/context/PassportProvider.tsx +++ b/packages/passport/sdk-sample-app/src/context/PassportProvider.tsx @@ -2,7 +2,9 @@ import React, { createContext, useCallback, useContext, useMemo, useState, } from 'react'; import { IMXProvider } from '@imtbl/x-provider'; -import { Provider, UserProfile } from '@imtbl/passport'; +import { + LinkedWallet, LinkWalletParams, Provider, UserProfile, +} from '@imtbl/passport'; import { useImmutableProvider } from '@/context/ImmutableProvider'; import { useStatusProvider } from '@/context/StatusProvider'; @@ -17,6 +19,7 @@ const PassportContext = createContext<{ getAccessToken: () => Promise; getUserInfo: () => Promise; getLinkedAddresses: () => Promise; + linkWallet: (params: LinkWalletParams) => Promise; }>({ imxProvider: undefined, zkEvmProvider: undefined, @@ -28,6 +31,7 @@ const PassportContext = createContext<{ getAccessToken: () => Promise.resolve(undefined), getUserInfo: () => Promise.resolve(undefined), getLinkedAddresses: () => Promise.resolve(undefined), + linkWallet: () => Promise.resolve(undefined), }); export function PassportProvider({ @@ -104,6 +108,19 @@ export function PassportProvider({ return linkedAddresses; }, [passportClient, setIsLoading, addMessage]); + const linkWallet = useCallback(async (params: LinkWalletParams) => { + setIsLoading(true); + let linkedWallet; + try { + linkedWallet = await passportClient.linkExternalWallet(params); + addMessage('Link Wallet', linkedWallet); + } catch (e: any) { + addMessage(`Link wallet failed: message: ${e.message} type: ${e.type}`); + } + setIsLoading(false); + return linkedWallet || undefined; + }, [passportClient, setIsLoading, addMessage]); + const logout = useCallback(async () => { try { setIsLoading(true); @@ -142,6 +159,7 @@ export function PassportProvider({ getAccessToken, getUserInfo, getLinkedAddresses, + linkWallet, }), [ imxProvider, zkEvmProvider, @@ -153,6 +171,7 @@ export function PassportProvider({ getAccessToken, getUserInfo, getLinkedAddresses, + linkWallet, ]); return ( @@ -174,6 +193,7 @@ export function usePassportProvider() { getAccessToken, getUserInfo, getLinkedAddresses, + linkWallet, } = useContext(PassportContext); return { imxProvider, @@ -186,5 +206,6 @@ export function usePassportProvider() { getAccessToken, getUserInfo, getLinkedAddresses, + linkWallet, }; } diff --git a/packages/passport/sdk/src/Passport.test.ts b/packages/passport/sdk/src/Passport.test.ts index b60540506c..94e66771ab 100644 --- a/packages/passport/sdk/src/Passport.test.ts +++ b/packages/passport/sdk/src/Passport.test.ts @@ -1,14 +1,24 @@ import { Environment, ImmutableConfiguration } from '@imtbl/config'; import { IMXClient } from '@imtbl/x-client'; -import { ImxApiClients, MultiRollupApiClients, imxApiConfig } from '@imtbl/generated-clients'; +import { ImxApiClients, imxApiConfig, MultiRollupApiClients } from '@imtbl/generated-clients'; +import { trackError } from '@imtbl/metrics'; import AuthManager from './authManager'; import MagicAdapter from './magicAdapter'; import { Passport } from './Passport'; import { PassportImxProvider, PassportImxProviderFactory } from './starkEx'; import { OidcConfiguration, UserProfile } from './types'; -import { mockUser, mockLinkedAddresses, mockUserImx } from './test/mocks'; +import { + mockApiError, + mockLinkedAddresses, + mockLinkedWallet, + mockPassportBadRequest, + mockUser, + mockUserImx, + mockUserZkEvm, +} from './test/mocks'; import { announceProvider, passportProviderInfo } from './zkEvm/provider/eip6963'; import { ZkEvmProvider } from './zkEvm'; +import { PassportError, PassportErrorType } from './errors/passportError'; jest.mock('./authManager'); jest.mock('./magicAdapter'); @@ -17,6 +27,7 @@ jest.mock('./confirmation'); jest.mock('./zkEvm'); jest.mock('./zkEvm/provider/eip6963'); jest.mock('@imtbl/generated-clients'); +jest.mock('@imtbl/metrics'); const oidcConfiguration: OidcConfiguration = { clientId: '11111', @@ -40,6 +51,7 @@ describe('Passport', () => { let getProviderMock: jest.Mock; let getProviderSilentMock: jest.Mock; let getLinkedAddressesMock: jest.Mock; + let linkExternalWalletMock: jest.Mock; beforeEach(() => { authLoginMock = jest.fn().mockReturnValue(mockUser); @@ -54,6 +66,7 @@ describe('Passport', () => { getProviderMock = jest.fn(); getProviderSilentMock = jest.fn(); getLinkedAddressesMock = jest.fn(); + linkExternalWalletMock = jest.fn(); (AuthManager as unknown as jest.Mock).mockReturnValue({ login: authLoginMock, loginCallback: loginCallbackMock, @@ -74,6 +87,7 @@ describe('Passport', () => { (MultiRollupApiClients as jest.Mock).mockReturnValue({ passportProfileApi: { getUserInfo: getLinkedAddressesMock, + linkWalletV2: linkExternalWalletMock, }, }); passport = new Passport({ @@ -364,4 +378,71 @@ describe('Passport', () => { expect(authLoginMock).toBeCalledTimes(0); }); }); + + describe('linkExternalWallet', () => { + const linkWalletParams = { + type: 'MetaMask', + walletAddress: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045', + signature: 'signature123', + nonce: 'nonce123', + }; + + it('should link external wallet when user is logged in', async () => { + getUserMock.mockReturnValue(mockUserZkEvm); + linkExternalWalletMock.mockReturnValue(mockLinkedWallet); + + const result = await passport.linkExternalWallet(linkWalletParams); + + expect(result).toEqual(mockLinkedWallet.data); + }); + + it('should throw error if user is not logged in', async () => { + getUserMock.mockReturnValue(null); + + await expect(passport.linkExternalWallet(linkWalletParams)).rejects.toThrow( + new PassportError('User is not logged in', PassportErrorType.NOT_LOGGED_IN_ERROR), + ); + }); + + it('should handle generic errors from the linkWalletV2 API call', async () => { + getUserMock.mockReturnValue(mockUserImx); + linkExternalWalletMock.mockReturnValue(mockApiError); + + try { + await passport.linkExternalWallet(linkWalletParams); + } catch (error: any) { + expect(error).toBeInstanceOf(PassportError); + expect(error.type).toEqual(PassportErrorType.LINK_WALLET_GENERIC_ERROR); + expect(error.message).toEqual(`Link wallet request failed with status code ${mockApiError.response.status}`); + } + }); + + it('should handle 400 bad requests from the linkWalletV2 API call', async () => { + getUserMock.mockReturnValue(mockUserImx); + linkExternalWalletMock.mockReturnValue(mockPassportBadRequest); + + try { + await passport.linkExternalWallet(linkWalletParams); + } catch (error: any) { + expect(error).toBeInstanceOf(PassportError); + expect(error.type).toEqual(PassportErrorType.LINK_WALLET_ALREADY_LINKED_ERROR); + expect(error.message).toEqual('Already linked'); + } + }); + + it('should call track error function if an error occurs', async () => { + getUserMock.mockReturnValue(mockUserImx); + linkExternalWalletMock.mockReturnValue(mockPassportBadRequest); + + try { + await passport.linkExternalWallet(linkWalletParams); + } catch (error) { + expect(trackError).toHaveBeenCalledWith( + 'passport', + 'linkWallet', + error, + ); + } + }); + }); }); diff --git a/packages/passport/sdk/src/Passport.ts b/packages/passport/sdk/src/Passport.ts index 02348d2c01..a926a6abcd 100644 --- a/packages/passport/sdk/src/Passport.ts +++ b/packages/passport/sdk/src/Passport.ts @@ -1,21 +1,24 @@ import { IMXProvider } from '@imtbl/x-provider'; import { - createConfig, - ImxApiClients, - imxApiConfig, - MultiRollupApiClients, + createConfig, ImxApiClients, imxApiConfig, MultiRollupApiClients, } from '@imtbl/generated-clients'; import { IMXClient } from '@imtbl/x-client'; import { Environment } from '@imtbl/config'; -import { identify, setPassportClientId, track } from '@imtbl/metrics'; - +import { + identify, setPassportClientId, track, trackError, +} from '@imtbl/metrics'; +import { isAxiosError } from 'axios'; import AuthManager from './authManager'; import MagicAdapter from './magicAdapter'; import { PassportImxProviderFactory } from './starkEx'; import { PassportConfiguration } from './config'; import { DeviceConnectResponse, + isUserImx, + isUserZkEvm, + LinkedWallet, + LinkWalletParams, PassportEventMap, PassportEvents, PassportModuleConfiguration, @@ -29,6 +32,7 @@ import TypedEventEmitter from './utils/typedEventEmitter'; import GuardianClient from './guardian'; import logger from './utils/logger'; import { announceProvider, passportProviderInfo } from './zkEvm/provider/eip6963'; +import { isAPIError, PassportError, PassportErrorType } from './errors/passportError'; const buildImxClientConfig = (passportModuleConfiguration: PassportModuleConfiguration) => { if (passportModuleConfiguration.overrides) { @@ -299,4 +303,70 @@ export class Passport { const getUserInfoResult = await this.multiRollupApiClients.passportProfileApi.getUserInfo({ headers }); return getUserInfoResult.data.linked_addresses; } + + public async linkExternalWallet(params: LinkWalletParams): Promise { + track('passport', 'linkWallet', { type: params.type }); + + const user = await this.authManager.getUser(); + if (!user) { + throw new PassportError('User is not logged in', PassportErrorType.NOT_LOGGED_IN_ERROR); + } + + const isRegisteredWithIMX = isUserImx(user); + const isRegisteredWithZkEvm = isUserZkEvm(user); + if (!isRegisteredWithIMX && !isRegisteredWithZkEvm) { + throw new PassportError('User has not been registered', PassportErrorType.USER_NOT_REGISTERED_ERROR); + } + + const headers = { Authorization: `Bearer ${user.accessToken}` }; + const linkWalletV2Request = { + type: params.type, + wallet_address: params.walletAddress, + signature: params.signature, + nonce: params.nonce, + }; + + try { + const linkWalletV2Result = await this.multiRollupApiClients + .passportProfileApi.linkWalletV2({ linkWalletV2Request }, { headers }); + return { ...linkWalletV2Result.data }; + } catch (error) { + trackError('passport', 'linkWallet', error as Error); + + if (isAxiosError(error) && error.response) { + if (error.response.data && isAPIError(error.response.data)) { + const { code, message } = error.response.data; + + switch (code) { + case 'ALREADY_LINKED': + throw new PassportError(message, PassportErrorType.LINK_WALLET_ALREADY_LINKED_ERROR); + case 'MAX_WALLETS_LINKED': + throw new PassportError(message, PassportErrorType.LINK_WALLET_MAX_WALLETS_LINKED_ERROR); + case 'DUPLICATE_NONCE': + throw new PassportError(message, PassportErrorType.LINK_WALLET_DUPLICATE_NONCE_ERROR); + case 'VALIDATION_ERROR': + throw new PassportError(message, PassportErrorType.LINK_WALLET_VALIDATION_ERROR); + default: + throw new PassportError(message, PassportErrorType.LINK_WALLET_GENERIC_ERROR); + } + } else if (error.response.status) { + // Handle unexpected error with a generic error message + throw new PassportError( + `Link wallet request failed with status code ${error.response.status}`, + PassportErrorType.LINK_WALLET_GENERIC_ERROR, + ); + } + } + + let message: string = 'Link wallet request failed'; + if (error instanceof Error) { + message += `: ${error.message}`; + } + + throw new PassportError( + message, + PassportErrorType.LINK_WALLET_GENERIC_ERROR, + ); + } + } } diff --git a/packages/passport/sdk/src/errors/passportError.ts b/packages/passport/sdk/src/errors/passportError.ts index 6bab73f329..d419fac342 100644 --- a/packages/passport/sdk/src/errors/passportError.ts +++ b/packages/passport/sdk/src/errors/passportError.ts @@ -17,9 +17,14 @@ export enum PassportErrorType { EXCHANGE_TRANSFER_ERROR = 'EXCHANGE_TRANSFER_ERROR', CREATE_TRADE_ERROR = 'CREATE_TRADE_ERROR', OPERATION_NOT_SUPPORTED_ERROR = 'OPERATION_NOT_SUPPORTED_ERROR', + LINK_WALLET_ALREADY_LINKED_ERROR = 'LINK_WALLET_ALREADY_LINKED_ERROR', + LINK_WALLET_MAX_WALLETS_LINKED_ERROR = 'LINK_WALLET_MAX_WALLETS_LINKED_ERROR', + LINK_WALLET_VALIDATION_ERROR = 'LINK_WALLET_VALIDATION_ERROR', + LINK_WALLET_DUPLICATE_NONCE_ERROR = 'LINK_WALLET_DUPLICATE_NONCE_ERROR', + LINK_WALLET_GENERIC_ERROR = 'LINK_WALLET_GENERIC_ERROR', } -function isAPIError(error: any): error is imx.APIError { +export function isAPIError(error: any): error is imx.APIError { return 'code' in error && 'message' in error; } diff --git a/packages/passport/sdk/src/index.ts b/packages/passport/sdk/src/index.ts index d39c8ae06b..7a782c1ed8 100644 --- a/packages/passport/sdk/src/index.ts +++ b/packages/passport/sdk/src/index.ts @@ -16,6 +16,8 @@ export { RpcErrorCode, } from './zkEvm/JsonRpcError'; export { + LinkWalletParams, + LinkedWallet, UserProfile, PassportOverrides, PassportModuleConfiguration, diff --git a/packages/passport/sdk/src/test/mocks.ts b/packages/passport/sdk/src/test/mocks.ts index eee29163b1..9a89044240 100644 --- a/packages/passport/sdk/src/test/mocks.ts +++ b/packages/passport/sdk/src/test/mocks.ts @@ -71,3 +71,34 @@ export const mockListChains = { ], }, }; + +export const mockLinkedWallet = { + data: { + address: '0xd8da6bf26964af9d7eed9e03e53415d37aa96045', + type: 'MetaMask', + created_at: '2021-08-31T00:00:00Z', + updated_at: '2021-08-31T00:00:00Z', + name: 'Test', + clientName: 'Passport Dashboard', + }, + status: 200, +}; + +export const mockApiError = { + response: { + data: { + code: 'api_error', + message: 'API error occurred', + }, + status: 500, + }, +}; +export const mockPassportBadRequest = { + response: { + data: { + code: 'ALREADY_LINKED', + message: 'Already linked', + }, + status: 400, + }, +}; diff --git a/packages/passport/sdk/src/types.ts b/packages/passport/sdk/src/types.ts index ec27fc35c0..a425ff0873 100644 --- a/packages/passport/sdk/src/types.ts +++ b/packages/passport/sdk/src/types.ts @@ -160,3 +160,19 @@ export type IMXSigners = { starkSigner: StarkSigner; ethSigner: EthSigner; }; + +export type LinkWalletParams = { + type: string; + walletAddress: string; + signature: string; + nonce: string; +}; + +export type LinkedWallet = { + address: string; + type: string; + created_at: string; + updated_at: string; + name?: string; + clientName: string; +};