gondi 0.36.0 → 0.37.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -58,8 +58,18 @@ export declare const zeroAddress: Address;
58
58
  export declare const zeroHash: Hash;
59
59
  export declare const zeroHex: HexString;
60
60
  export declare const REORG_SAFETY_BUFFER: bigint;
61
+ /** Native ETH marker on Ethereum mainnet: the zero address. */
61
62
  export declare const __ETH_ADDRESS: `0x${string}`;
63
+ /** Synthetic sentinel the Gondi API uses for native HYPE on HyperEVM. */
62
64
  export declare const __HYPE_ADDRESS = "0x0000000000000000000000000000000000000999";
65
+ /** Synthetic sentinel the Gondi API uses for native ETH on the Robinhood chain. */
63
66
  export declare const __RETH_ADDRESS = "0x0000000000000000000000000000000000004663";
67
+ /**
68
+ * Whether a currency address returned by the Gondi API represents a chain's native currency.
69
+ *
70
+ * The zero address only marks native ETH on Ethereum; HyperEVM and Robinhood orders carry the
71
+ * synthetic sentinels above instead, so never compare a currency address against the zero
72
+ * address to decide native-ness.
73
+ */
64
74
  export declare const isNativeCurrency: (address: Address) => boolean;
65
75
  export {};
@@ -4,7 +4,6 @@ import { Account, Address, Hash, Hex, TransactionReceipt } from 'viem';
4
4
  import { Auction } from './blockchain';
5
5
  import { Api, Props as ApiProps } from './clients/api';
6
6
  import { Contracts, GondiPublicClient, Wallet } from './clients/contracts';
7
- import { Opensea } from './clients/opensea';
8
7
  import { CollectionOrderInput, DealInput, MarketplaceEnum, NftOrderInput, SingleNftOrderInput, SingleNftSignedOfferInput, TokenStandardType, TraitOrderInput } from './generated/graphql';
9
8
  import * as model from './model';
10
9
  import { NftStandard } from './model';
@@ -20,7 +19,6 @@ interface GondiProps {
20
19
  */
21
20
  publicClient?: GondiPublicClient;
22
21
  apiClient?: ApiProps['apiClient'];
23
- openseaApiKey?: string;
24
22
  onStepChange?: OnStepChange;
25
23
  }
26
24
  type Step = {
@@ -45,8 +43,7 @@ export declare class Gondi {
45
43
  account: Account;
46
44
  bcClient: GondiPublicClient;
47
45
  apiClient: Api;
48
- openseaClient: Opensea;
49
- constructor({ wallet, publicClient, apiClient, openseaApiKey, onStepChange }: GondiProps);
46
+ constructor({ wallet, publicClient, apiClient, onStepChange }: GondiProps);
50
47
  static create(props: GondiProps & {
51
48
  onStepChange: OnStepChange;
52
49
  }): Gondi;
@@ -3153,9 +3150,19 @@ export declare class Gondi {
3153
3150
  txHash: `0x${string}`;
3154
3151
  waitTxInBlock: () => Promise<TransactionReceipt>;
3155
3152
  }>;
3153
+ /**
3154
+ * Sells `nft` into `order`, a Native or OpenSea bid. The Gondi API builds the
3155
+ * sale calldata for both marketplaces, so OpenSea bids need no client-side
3156
+ * OpenSea credentials and no approval beyond the collateral's.
3157
+ */
3156
3158
  sellNft({ order, nft, }: {
3157
3159
  order: {
3158
3160
  id: string;
3161
+ /**
3162
+ * The order's currency as reported by the Gondi API. A native-currency order carries the
3163
+ * zero address on Ethereum, but a synthetic sentinel on other chains (`__HYPE_ADDRESS` on
3164
+ * HyperEVM, `__RETH_ADDRESS` on Robinhood) — check it with `isNativeCurrency`.
3165
+ */
3159
3166
  currencyAddress: Address;
3160
3167
  originalId: string;
3161
3168
  marketPlace: string;
@@ -0,0 +1,22 @@
1
+ type TypedDataField = {
2
+ name: string;
3
+ type: string;
4
+ };
5
+ type TypedDataTypes = Record<string, readonly TypedDataField[]>;
6
+ /**
7
+ * Returns the sign typed data parameters with the message reduced to the fields declared in
8
+ * `types`, recursing into nested structs and arrays.
9
+ *
10
+ * Extra properties do not change the EIP-712 hash, but they are serialized into the
11
+ * `eth_signTypedData_v4` request, so wallets display them and wallet security checks scan them:
12
+ * Rabby warns that "the transaction is not associated with the website that initiated it" when a
13
+ * URL anywhere in the payload does not match the connected site. Structs assembled by spreading
14
+ * API objects (offers carrying nested NFT and collection data) must therefore be stripped before
15
+ * reaching the wallet.
16
+ */
17
+ export declare const sanitizeTypedDataMessage: <const TParameters extends {
18
+ primaryType: string;
19
+ types: TypedDataTypes;
20
+ message: Record<string, unknown>;
21
+ }>(parameters: TParameters) => TParameters;
22
+ export {};