From baf035b4e7ce195f2eabebe07b2c657cf819bbfb Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Tue, 23 Aug 2022 10:15:57 -0700 Subject: [PATCH 1/2] Fix fetching NFTs where names are numbers --- docs/sdk.authenticationoptions.md | 12 + docs/sdk.authenticationpayload.md | 12 + docs/sdk.authenticationpayloaddata.md | 12 + docs/sdk.isdowngradeversion.md | 23 ++ docs/sdk.loginoptions.md | 12 + docs/sdk.loginpayload.md | 12 + docs/sdk.loginpayloaddata.md | 12 + docs/sdk.md | 8 + docs/sdk.pack.create.md | 4 +- docs/sdk.smartcontract.abi.md | 14 + docs/sdk.smartcontract.md | 1 + docs/sdk.verifyoptions.md | 12 + ...k.walletauthenticator.generateauthtoken.md | 4 +- docs/sdk.walletauthenticator.login.md | 4 +- docs/sdk.walletauthenticator.verify.md | 4 +- etc/sdk.api.md | 374 ++++++++++++++---- src/contracts/marketplace.ts | 9 +- src/schema/tokens/common/index.ts | 2 +- 18 files changed, 452 insertions(+), 79 deletions(-) create mode 100644 docs/sdk.authenticationoptions.md create mode 100644 docs/sdk.authenticationpayload.md create mode 100644 docs/sdk.authenticationpayloaddata.md create mode 100644 docs/sdk.isdowngradeversion.md create mode 100644 docs/sdk.loginoptions.md create mode 100644 docs/sdk.loginpayload.md create mode 100644 docs/sdk.loginpayloaddata.md create mode 100644 docs/sdk.smartcontract.abi.md create mode 100644 docs/sdk.verifyoptions.md diff --git a/docs/sdk.authenticationoptions.md b/docs/sdk.authenticationoptions.md new file mode 100644 index 000000000..e376c0bb2 --- /dev/null +++ b/docs/sdk.authenticationoptions.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [AuthenticationOptions](./sdk.authenticationoptions.md) + +## AuthenticationOptions type + + +Signature: + +```typescript +export declare type AuthenticationOptions = z.input; +``` diff --git a/docs/sdk.authenticationpayload.md b/docs/sdk.authenticationpayload.md new file mode 100644 index 000000000..ad966ec88 --- /dev/null +++ b/docs/sdk.authenticationpayload.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [AuthenticationPayload](./sdk.authenticationpayload.md) + +## AuthenticationPayload type + + +Signature: + +```typescript +export declare type AuthenticationPayload = z.output; +``` diff --git a/docs/sdk.authenticationpayloaddata.md b/docs/sdk.authenticationpayloaddata.md new file mode 100644 index 000000000..0bf9c85af --- /dev/null +++ b/docs/sdk.authenticationpayloaddata.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [AuthenticationPayloadData](./sdk.authenticationpayloaddata.md) + +## AuthenticationPayloadData type + + +Signature: + +```typescript +export declare type AuthenticationPayloadData = z.output; +``` diff --git a/docs/sdk.isdowngradeversion.md b/docs/sdk.isdowngradeversion.md new file mode 100644 index 000000000..42aa77935 --- /dev/null +++ b/docs/sdk.isdowngradeversion.md @@ -0,0 +1,23 @@ + + +[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [isDowngradeVersion](./sdk.isdowngradeversion.md) + +## isDowngradeVersion() function + +Signature: + +```typescript +export declare function isDowngradeVersion(current: string, next: string): boolean; +``` + +## Parameters + +| Parameter | Type | Description | +| --- | --- | --- | +| current | string | | +| next | string | | + +Returns: + +boolean + diff --git a/docs/sdk.loginoptions.md b/docs/sdk.loginoptions.md new file mode 100644 index 000000000..e221f534d --- /dev/null +++ b/docs/sdk.loginoptions.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [LoginOptions](./sdk.loginoptions.md) + +## LoginOptions type + + +Signature: + +```typescript +export declare type LoginOptions = z.input; +``` diff --git a/docs/sdk.loginpayload.md b/docs/sdk.loginpayload.md new file mode 100644 index 000000000..cc4ce396a --- /dev/null +++ b/docs/sdk.loginpayload.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [LoginPayload](./sdk.loginpayload.md) + +## LoginPayload type + + +Signature: + +```typescript +export declare type LoginPayload = z.output; +``` diff --git a/docs/sdk.loginpayloaddata.md b/docs/sdk.loginpayloaddata.md new file mode 100644 index 000000000..17c91ac9e --- /dev/null +++ b/docs/sdk.loginpayloaddata.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [LoginPayloadData](./sdk.loginpayloaddata.md) + +## LoginPayloadData type + + +Signature: + +```typescript +export declare type LoginPayloadData = z.output; +``` diff --git a/docs/sdk.md b/docs/sdk.md index 3dcaad6c6..cd6b44fd0 100644 --- a/docs/sdk.md +++ b/docs/sdk.md @@ -83,6 +83,7 @@ | --- | --- | | [getNativeTokenByChainId(chainId)](./sdk.getnativetokenbychainid.md) | Returns the native token for a given chain | | [getReadOnlyProvider(network, chainId)](./sdk.getreadonlyprovider.md) | | +| [isDowngradeVersion(current, next)](./sdk.isdowngradeversion.md) | | ## Interfaces @@ -137,6 +138,9 @@ | [AbiFunction](./sdk.abifunction.md) | | | [AirdropInput](./sdk.airdropinput.md) | Input model to pass a list of addresses + amount to transfer to each one | | [Amount](./sdk.amount.md) | Represents a currency amount already formatted. ie. "1" for 1 ether. | +| [AuthenticationOptions](./sdk.authenticationoptions.md) | | +| [AuthenticationPayload](./sdk.authenticationpayload.md) | | +| [AuthenticationPayloadData](./sdk.authenticationpayloaddata.md) | | | [BufferOrStringWithName](./sdk.bufferorstringwithname.md) | | | [ClaimCondition](./sdk.claimcondition.md) | Represents a claim condition fetched from the SDK | | [ClaimConditionInput](./sdk.claimconditioninput.md) | Input model to create a claim condition with optional snapshot of wallets | @@ -168,6 +172,9 @@ | [FullPublishMetadata](./sdk.fullpublishmetadata.md) | | | [Json](./sdk.json.md) | | | [JsonObject](./sdk.jsonobject.md) | | +| [LoginOptions](./sdk.loginoptions.md) | | +| [LoginPayload](./sdk.loginpayload.md) | | +| [LoginPayloadData](./sdk.loginpayloaddata.md) | | | [NetworkOrSignerOrProvider](./sdk.networkorsignerorprovider.md) | | | [NFTMetadata](./sdk.nftmetadata.md) | | | [NFTMetadataInput](./sdk.nftmetadatainput.md) | | @@ -210,5 +217,6 @@ | [ValidContractClass](./sdk.validcontractclass.md) | | | [ValidContractInstance](./sdk.validcontractinstance.md) | | | [ValueOf](./sdk.valueof.md) | | +| [VerifyOptions](./sdk.verifyoptions.md) | | | [WrappedTokens](./sdk.wrappedtokens.md) | Output for the contents of a bundle wrapped token | diff --git a/docs/sdk.pack.create.md b/docs/sdk.pack.create.md index deedda9e3..3204baa4a 100644 --- a/docs/sdk.pack.create.md +++ b/docs/sdk.pack.create.md @@ -12,7 +12,7 @@ Create Pack create(metadataWithRewards: PackMetadataInput): PromiseReturns: -Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)<{ metadata: { \[x: string\]: import("../core/types").[Json](./sdk.json.md); name?: string \| undefined; description?: string \| null \| undefined; image?: string \| null \| undefined; external\_url?: string \| null \| undefined; animation\_url?: string \| null \| undefined; uri: string; id: BigNumber; }; supply: BigNumber; }>> +Promise<[TransactionResultWithId](./sdk.transactionresultwithid.md)<{ metadata: { \[x: string\]: import("../core/types").[Json](./sdk.json.md); name?: string \| number \| undefined; description?: string \| null \| undefined; image?: string \| null \| undefined; external\_url?: string \| null \| undefined; animation\_url?: string \| null \| undefined; uri: string; id: BigNumber; }; supply: BigNumber; }>> ## Remarks diff --git a/docs/sdk.smartcontract.abi.md b/docs/sdk.smartcontract.abi.md new file mode 100644 index 000000000..dcd23a68b --- /dev/null +++ b/docs/sdk.smartcontract.abi.md @@ -0,0 +1,14 @@ + + +[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [SmartContract](./sdk.smartcontract.md) > [abi](./sdk.smartcontract.abi.md) + +## SmartContract.abi property + +> This API is provided as a preview for developers and may change based on feedback that we receive. Do not use this API in a production environment. +> + +Signature: + +```typescript +abi: ContractInterface; +``` diff --git a/docs/sdk.smartcontract.md b/docs/sdk.smartcontract.md index d999bc4dc..3b518ab81 100644 --- a/docs/sdk.smartcontract.md +++ b/docs/sdk.smartcontract.md @@ -48,6 +48,7 @@ const tx = await contract.nft.mint.to("0x...", { | Property | Modifiers | Type | Description | | --- | --- | --- | --- | +| [abi](./sdk.smartcontract.abi.md) | | ContractInterface | (BETA) | | [contractType](./sdk.smartcontract.contracttype.md) | static | "custom" | (BETA) | | [edition](./sdk.smartcontract.edition.md) | | [Erc1155](./sdk.erc1155.md) \| undefined | (BETA) Auto-detects ERC1155 standard functions. | | [estimator](./sdk.smartcontract.estimator.md) | | [GasCostEstimator](./sdk.gascostestimator.md)<TContract> | (BETA) | diff --git a/docs/sdk.verifyoptions.md b/docs/sdk.verifyoptions.md new file mode 100644 index 000000000..cc6a089de --- /dev/null +++ b/docs/sdk.verifyoptions.md @@ -0,0 +1,12 @@ + + +[Home](./index.md) > [@thirdweb-dev/sdk](./sdk.md) > [VerifyOptions](./sdk.verifyoptions.md) + +## VerifyOptions type + + +Signature: + +```typescript +export declare type VerifyOptions = z.input; +``` diff --git a/docs/sdk.walletauthenticator.generateauthtoken.md b/docs/sdk.walletauthenticator.generateauthtoken.md index 28556e68f..7049d8711 100644 --- a/docs/sdk.walletauthenticator.generateauthtoken.md +++ b/docs/sdk.walletauthenticator.generateauthtoken.md @@ -20,8 +20,8 @@ generateAuthToken(domain: string, payload: LoginPayload, options?: Authenticatio | Parameter | Type | Description | | --- | --- | --- | | domain | string | The domain of the server-side application to authenticate to | -| payload | LoginPayload | The login payload to authenticate with | -| options | AuthenticationOptions | (Optional) Optional configuration options for the authentication request | +| payload | [LoginPayload](./sdk.loginpayload.md) | The login payload to authenticate with | +| options | [AuthenticationOptions](./sdk.authenticationoptions.md) | (Optional) Optional configuration options for the authentication request | Returns: diff --git a/docs/sdk.walletauthenticator.login.md b/docs/sdk.walletauthenticator.login.md index a6f0564e7..834f9e130 100644 --- a/docs/sdk.walletauthenticator.login.md +++ b/docs/sdk.walletauthenticator.login.md @@ -20,11 +20,11 @@ login(domain: string, options?: LoginOptions): Promise; | Parameter | Type | Description | | --- | --- | --- | | domain | string | The domain of the server-side application to login to | -| options | LoginOptions | (Optional) Optional configuration options for the login request | +| options | [LoginOptions](./sdk.loginoptions.md) | (Optional) Optional configuration options for the login request | Returns: -Promise<LoginPayload> +Promise<[LoginPayload](./sdk.loginpayload.md)> Login payload that can be used on the server-side to verify the login request or authenticate diff --git a/docs/sdk.walletauthenticator.verify.md b/docs/sdk.walletauthenticator.verify.md index ab0d8b62c..f0d51dbdd 100644 --- a/docs/sdk.walletauthenticator.verify.md +++ b/docs/sdk.walletauthenticator.verify.md @@ -20,8 +20,8 @@ verify(domain: string, payload: LoginPayload, options?: VerifyOptions): string; | Parameter | Type | Description | | --- | --- | --- | | domain | string | The domain of the server-side application to verify the login request for | -| payload | LoginPayload | The login payload to verify | -| options | VerifyOptions | (Optional) | +| payload | [LoginPayload](./sdk.loginpayload.md) | The login payload to verify | +| options | [VerifyOptions](./sdk.verifyoptions.md) | (Optional) | Returns: diff --git a/etc/sdk.api.md b/etc/sdk.api.md index f47849ff7..fafd3f6e1 100644 --- a/etc/sdk.api.md +++ b/etc/sdk.api.md @@ -439,6 +439,118 @@ export interface AuctionListing { type: ListingType.Auction; } +// Warning: (ae-incompatible-release-tags) The symbol "AuthenticationOptions" is marked as @public, but its signature references "AuthenticationOptionsSchema" which is marked as @internal +// +// @public (undocumented) +export type AuthenticationOptions = z.input; + +// Warning: (ae-internal-missing-underscore) The name "AuthenticationOptionsSchema" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export const AuthenticationOptionsSchema: z.ZodOptional; + expirationTime: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + expirationTime?: Date | undefined; + invalidBefore?: Date | undefined; +}, { + expirationTime?: Date | undefined; + invalidBefore?: Date | undefined; +}>>; + +// Warning: (ae-incompatible-release-tags) The symbol "AuthenticationPayload" is marked as @public, but its signature references "AuthenticationPayloadSchema" which is marked as @internal +// +// @public (undocumented) +export type AuthenticationPayload = z.output; + +// Warning: (ae-incompatible-release-tags) The symbol "AuthenticationPayloadData" is marked as @public, but its signature references "AuthenticationPayloadDataSchema" which is marked as @internal +// +// @public (undocumented) +export type AuthenticationPayloadData = z.output; + +// Warning: (ae-internal-missing-underscore) The name "AuthenticationPayloadDataSchema" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export const AuthenticationPayloadDataSchema: z.ZodObject<{ + iss: z.ZodString; + sub: z.ZodString; + aud: z.ZodString; + exp: z.ZodEffects, number, Date>; + nbf: z.ZodEffects, number, Date>; + iat: z.ZodEffects, number, Date>; + jti: z.ZodDefault; +}, "strip", z.ZodTypeAny, { + iss: string; + sub: string; + aud: string; + exp: number; + nbf: number; + iat: number; + jti: string; +}, { + jti?: string | undefined; + iss: string; + sub: string; + aud: string; + exp: Date; + nbf: Date; + iat: Date; +}>; + +// Warning: (ae-internal-missing-underscore) The name "AuthenticationPayloadSchema" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export const AuthenticationPayloadSchema: z.ZodObject<{ + payload: z.ZodObject<{ + iss: z.ZodString; + sub: z.ZodString; + aud: z.ZodString; + exp: z.ZodEffects, number, Date>; + nbf: z.ZodEffects, number, Date>; + iat: z.ZodEffects, number, Date>; + jti: z.ZodDefault; + }, "strip", z.ZodTypeAny, { + iss: string; + sub: string; + aud: string; + exp: number; + nbf: number; + iat: number; + jti: string; + }, { + jti?: string | undefined; + iss: string; + sub: string; + aud: string; + exp: Date; + nbf: Date; + iat: Date; + }>; + signature: z.ZodString; +}, "strip", z.ZodTypeAny, { + signature: string; + payload: { + iss: string; + sub: string; + aud: string; + exp: number; + nbf: number; + iat: number; + jti: string; + }; +}, { + signature: string; + payload: { + jti?: string | undefined; + iss: string; + sub: string; + aud: string; + exp: Date; + nbf: Date; + iat: Date; + }; +}>; + // Warning: (ae-internal-missing-underscore) The name "BaseSignaturePayloadInput" should be prefixed with an underscore because the declaration is marked as @internal // // @internal (undocumented) @@ -2144,7 +2256,9 @@ export type EditionMetadataInput = z.input; export const EditionMetadataInputOrUriSchema: z.ZodObject<{ supply: z.ZodEffects]>, BigNumber, string | number | bigint | BigNumber>, string, string | number | bigint | BigNumber>; metadata: z.ZodUnion<[z.ZodObject; + name: z.ZodOptional>; /** + * @internal + */ description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -2155,7 +2269,7 @@ export const EditionMetadataInputOrUriSchema: z.ZodObject<{ attributes: z.ZodOptional>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -2165,7 +2279,7 @@ export const EditionMetadataInputOrUriSchema: z.ZodObject<{ attributes?: Record | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -2177,7 +2291,7 @@ export const EditionMetadataInputOrUriSchema: z.ZodObject<{ }, "strip", z.ZodTypeAny, { metadata: string | { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -2190,7 +2304,7 @@ export const EditionMetadataInputOrUriSchema: z.ZodObject<{ }, { metadata: string | { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -2208,7 +2322,9 @@ export const EditionMetadataInputOrUriSchema: z.ZodObject<{ export const EditionMetadataInputSchema: z.ZodObject<{ supply: z.ZodEffects]>, BigNumber, string | number | bigint | BigNumber>, string, string | number | bigint | BigNumber>; metadata: z.ZodObject; + name: z.ZodOptional>; /** + * @internal + */ description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -2219,7 +2335,7 @@ export const EditionMetadataInputSchema: z.ZodObject<{ attributes: z.ZodOptional>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -2229,7 +2345,7 @@ export const EditionMetadataInputSchema: z.ZodObject<{ attributes?: Record | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -2241,7 +2357,7 @@ export const EditionMetadataInputSchema: z.ZodObject<{ }, "strip", z.ZodTypeAny, { metadata: { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -2254,7 +2370,7 @@ export const EditionMetadataInputSchema: z.ZodObject<{ }, { metadata: { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -2277,7 +2393,9 @@ export type EditionMetadataOrUri = z.input]>, BigNumber, string | number | bigint | BigNumber>; metadata: z.ZodObject; + name: z.ZodOptional>; /** + * @internal + */ description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -2290,7 +2408,7 @@ export const EditionMetadataOutputSchema: z.ZodObject<{ animation_url: z.ZodOptional>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: string | null | undefined; external_url?: string | null | undefined; @@ -2299,7 +2417,7 @@ export const EditionMetadataOutputSchema: z.ZodObject<{ id: BigNumber; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: string | null | undefined; external_url?: string | null | undefined; @@ -2310,7 +2428,7 @@ export const EditionMetadataOutputSchema: z.ZodObject<{ }, "strip", z.ZodTypeAny, { metadata: { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: string | null | undefined; external_url?: string | null | undefined; @@ -2322,7 +2440,7 @@ export const EditionMetadataOutputSchema: z.ZodObject<{ }, { metadata: { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: string | null | undefined; external_url?: string | null | undefined; @@ -2344,7 +2462,9 @@ export type EditionMetadataOwner = z.output]>, BigNumber, string | number | bigint | BigNumber>; metadata: z.ZodObject; + name: z.ZodOptional>; /** + * @internal + */ description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -2357,7 +2477,7 @@ export const EditionMetadataWithOwnerOutputSchema: z.ZodObject>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: string | null | undefined; external_url?: string | null | undefined; @@ -2366,7 +2486,7 @@ export const EditionMetadataWithOwnerOutputSchema: z.ZodObject, contractAddress?: string, signerAddress?: string): Promise; } +// @public (undocumented) +export function isDowngradeVersion(current: string, next: string): boolean; + // Warning: (ae-internal-missing-underscore) The name "isFeatureEnabled" should be prefixed with an underscore because the declaration is marked as @internal // // @internal @@ -3361,6 +3484,105 @@ export enum ListingType { Direct = 0 } +// Warning: (ae-incompatible-release-tags) The symbol "LoginOptions" is marked as @public, but its signature references "LoginOptionsSchema" which is marked as @internal +// +// @public (undocumented) +export type LoginOptions = z.input; + +// Warning: (ae-internal-missing-underscore) The name "LoginOptionsSchema" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export const LoginOptionsSchema: z.ZodOptional; + expirationTime: z.ZodOptional; + chainId: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + chainId?: number | undefined; + nonce?: string | undefined; + expirationTime?: Date | undefined; +}, { + chainId?: number | undefined; + nonce?: string | undefined; + expirationTime?: Date | undefined; +}>>; + +// Warning: (ae-incompatible-release-tags) The symbol "LoginPayload" is marked as @public, but its signature references "LoginPayloadSchema" which is marked as @internal +// +// @public (undocumented) +export type LoginPayload = z.output; + +// Warning: (ae-incompatible-release-tags) The symbol "LoginPayloadData" is marked as @public, but its signature references "LoginPayloadDataSchema" which is marked as @internal +// +// @public (undocumented) +export type LoginPayloadData = z.output; + +// Warning: (ae-internal-missing-underscore) The name "LoginPayloadDataSchema" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export const LoginPayloadDataSchema: z.ZodObject<{ + domain: z.ZodString; + address: z.ZodEffects; + nonce: z.ZodDefault; + expiration_time: z.ZodEffects; + chain_id: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + chain_id?: number | undefined; + nonce: string; + address: string; + domain: string; + expiration_time: string; +}, { + nonce?: string | undefined; + chain_id?: number | undefined; + address: string; + domain: string; + expiration_time: Date; +}>; + +// Warning: (ae-internal-missing-underscore) The name "LoginPayloadSchema" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export const LoginPayloadSchema: z.ZodObject<{ + payload: z.ZodObject<{ + domain: z.ZodString; + address: z.ZodEffects; + nonce: z.ZodDefault; + expiration_time: z.ZodEffects; + chain_id: z.ZodOptional; + }, "strip", z.ZodTypeAny, { + chain_id?: number | undefined; + nonce: string; + address: string; + domain: string; + expiration_time: string; + }, { + nonce?: string | undefined; + chain_id?: number | undefined; + address: string; + domain: string; + expiration_time: Date; + }>; + signature: z.ZodString; +}, "strip", z.ZodTypeAny, { + signature: string; + payload: { + chain_id?: number | undefined; + nonce: string; + address: string; + domain: string; + expiration_time: string; + }; +}, { + signature: string; + payload: { + nonce?: string | undefined; + chain_id?: number | undefined; + address: string; + domain: string; + expiration_time: Date; + }; +}>; + // @public export class Marketplace implements UpdateableNetwork { constructor(network: NetworkOrSignerOrProvider, address: string, storage: IStorage, options?: SDKOptions, contractWrapper?: ContractWrapper); @@ -4148,7 +4370,7 @@ export class Pack extends Erc1155 { create(metadataWithRewards: PackMetadataInput): Promise; }, { metadata: z.ZodUnion<[z.ZodObject; + name: z.ZodOptional>; description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -5090,7 +5312,7 @@ export const Signature1155PayloadInput: z.ZodObject>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5100,7 +5322,7 @@ export const Signature1155PayloadInput: z.ZodObject | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5113,7 +5335,7 @@ export const Signature1155PayloadInput: z.ZodObject; }>, { metadata: z.ZodDefault; + name: z.ZodOptional>; description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -5124,7 +5346,7 @@ export const Signature1155PayloadInput: z.ZodObject>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5134,7 +5356,7 @@ export const Signature1155PayloadInput: z.ZodObject | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5157,7 +5379,7 @@ export const Signature1155PayloadInput: z.ZodObject; }, { metadata: z.ZodUnion<[z.ZodObject; + name: z.ZodOptional>; description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -5214,7 +5436,7 @@ export const Signature1155PayloadInputWithTokenId: z.ZodObject>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5224,7 +5446,7 @@ export const Signature1155PayloadInputWithTokenId: z.ZodObject | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5237,7 +5459,7 @@ export const Signature1155PayloadInputWithTokenId: z.ZodObject; }>, { metadata: z.ZodDefault; + name: z.ZodOptional>; description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -5248,7 +5470,7 @@ export const Signature1155PayloadInputWithTokenId: z.ZodObject>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5258,7 +5480,7 @@ export const Signature1155PayloadInputWithTokenId: z.ZodObject | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5284,7 +5506,7 @@ export const Signature1155PayloadInputWithTokenId: z.ZodObject; }, { metadata: z.ZodUnion<[z.ZodObject; + name: z.ZodOptional>; description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -5342,7 +5564,7 @@ export const Signature1155PayloadOutput: z.ZodObject>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5352,7 +5574,7 @@ export const Signature1155PayloadOutput: z.ZodObject | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5386,7 +5608,7 @@ export const Signature1155PayloadOutput: z.ZodObject; }, { metadata: z.ZodUnion<[z.ZodObject; + name: z.ZodOptional>; description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -5514,7 +5736,7 @@ export const Signature721PayloadInput: z.ZodObject>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5524,7 +5746,7 @@ export const Signature721PayloadInput: z.ZodObject | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5547,7 +5769,7 @@ export const Signature721PayloadInput: z.ZodObject; }, { metadata: z.ZodUnion<[z.ZodObject; + name: z.ZodOptional>; description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -5603,7 +5825,7 @@ export const Signature721PayloadOutput: z.ZodObject>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5613,7 +5835,7 @@ export const Signature721PayloadOutput: z.ZodObject | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5642,7 +5864,7 @@ export const Signature721PayloadOutput: z.ZodObject; }, { metadata: z.ZodUnion<[z.ZodObject; + name: z.ZodOptional>; description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -5699,7 +5921,7 @@ export const Signature721WithQuantityInput: z.ZodObject>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5709,7 +5931,7 @@ export const Signature721WithQuantityInput: z.ZodObject | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5722,7 +5944,7 @@ export const Signature721WithQuantityInput: z.ZodObject; }>, { metadata: z.ZodDefault; + name: z.ZodOptional>; description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -5733,7 +5955,7 @@ export const Signature721WithQuantityInput: z.ZodObject>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5743,7 +5965,7 @@ export const Signature721WithQuantityInput: z.ZodObject | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5766,7 +5988,7 @@ export const Signature721WithQuantityInput: z.ZodObject; }, { metadata: z.ZodUnion<[z.ZodObject; + name: z.ZodOptional>; description: z.ZodOptional>; image: z.ZodOptional>>; external_url: z.ZodOptional>>; @@ -5823,7 +6045,7 @@ export const Signature721WithQuantityOutput: z.ZodObject>, "many">, z.ZodRecord>]>>; }>, "strip", z.ZodLazy>, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5833,7 +6055,7 @@ export const Signature721WithQuantityOutput: z.ZodObject | Record[] | undefined; }, { [x: string]: Json; - name?: string | undefined; + name?: string | number | undefined; description?: string | null | undefined; image?: any; external_url?: any; @@ -5865,7 +6087,7 @@ export const Signature721WithQuantityOutput: z.ZodObject implements UpdateableNetwork { constructor(network: NetworkOrSignerOrProvider, address: string, abi: ContractInterface, storage: IStorage, options?: SDKOptions, contractWrapper?: ContractWrapper); + // (undocumented) + abi: ContractInterface; call(functionName: string, ...args: unknown[] | [...unknown[], CallOverrides]): Promise; // (undocumented) static contractType: "custom"; @@ -7055,6 +7279,22 @@ export type ValidContractInstance = Instance; // @public (undocumented) export type ValueOf = T[keyof T]; +// Warning: (ae-incompatible-release-tags) The symbol "VerifyOptions" is marked as @public, but its signature references "VerifyOptionsSchema" which is marked as @internal +// +// @public (undocumented) +export type VerifyOptions = z.input; + +// Warning: (ae-internal-missing-underscore) The name "VerifyOptionsSchema" should be prefixed with an underscore because the declaration is marked as @internal +// +// @internal (undocumented) +export const VerifyOptionsSchema: z.ZodOptional; +}, "strip", z.ZodTypeAny, { + chainId?: number | undefined; +}, { + chainId?: number | undefined; +}>>; + // @public export class Vote implements UpdateableNetwork { constructor(network: NetworkOrSignerOrProvider, address: string, storage: IStorage, options?: SDKOptions, contractWrapper?: ContractWrapper); @@ -7244,12 +7484,8 @@ export enum VoteType { export class WalletAuthenticator extends RPCConnectionHandler { constructor(network: NetworkOrSignerOrProvider, wallet: UserWallet, options: SDKOptions); authenticate(domain: string, token: string): Promise; - // Warning: (ae-forgotten-export) The symbol "AuthenticationOptions" needs to be exported by the entry point index.d.ts generateAuthToken(domain: string, payload: LoginPayload, options?: AuthenticationOptions): Promise; - // Warning: (ae-forgotten-export) The symbol "LoginOptions" needs to be exported by the entry point index.d.ts - // Warning: (ae-forgotten-export) The symbol "LoginPayload" needs to be exported by the entry point index.d.ts login(domain: string, options?: LoginOptions): Promise; - // Warning: (ae-forgotten-export) The symbol "VerifyOptions" needs to be exported by the entry point index.d.ts verify(domain: string, payload: LoginPayload, options?: VerifyOptions): string; } diff --git a/src/contracts/marketplace.ts b/src/contracts/marketplace.ts index 0dc07be9b..7ac619f79 100644 --- a/src/contracts/marketplace.ts +++ b/src/contracts/marketplace.ts @@ -458,7 +458,14 @@ export class Marketplace implements UpdateableNetwork { try { listing = await this.getListing(i); } catch (err) { - return undefined; + if (err instanceof ListingNotFoundError) { + return undefined; + } else { + console.warn( + `Failed to get listing ${i}' - skipping. Try 'marketplace.getListing(${i})' to get the underlying error.`, + ); + return undefined; + } } if (listing.type === ListingType.Auction) { diff --git a/src/schema/tokens/common/index.ts b/src/schema/tokens/common/index.ts index 34341044c..9d47c1bfd 100644 --- a/src/schema/tokens/common/index.ts +++ b/src/schema/tokens/common/index.ts @@ -12,7 +12,7 @@ import { OptionalPropertiesInput } from "./properties"; */ export const CommonTokenInput = z .object({ - name: z.string().optional(), + name: z.union([z.string(), z.number()]).optional(), description: z.string().nullable().optional(), image: FileBufferOrStringSchema.nullable().optional(), external_url: FileBufferOrStringSchema.nullable().optional(), From d7a9cf1ba184e34c8dd478567f6470bbdfad14d2 Mon Sep 17 00:00:00 2001 From: Joaquim Verges Date: Tue, 23 Aug 2022 10:16:39 -0700 Subject: [PATCH 2/2] v2.3.39-0 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 173c9e6ec..21246425c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@thirdweb-dev/sdk", - "version": "2.3.38", + "version": "2.3.39-0", "description": "The main thirdweb SDK.", "repository": { "type": "git",