Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

async imports #370

Open
wants to merge 106 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
106 commits
Select commit Hold shift + click to select a range
826ac77
feat: simplify methods
Mar 29, 2022
34af9d3
Merge branch 'master' into feature/bravo-1832-simplify-methods
Apr 7, 2022
6acde7f
Merge branch 'master' into feature/bravo-1832-simplify-methods
May 26, 2022
9e19b4f
chore: simplified
May 27, 2022
7b84f75
feat: simplified methods
Jun 2, 2022
4b1d62b
chore: burn
Jun 7, 2022
1371339
chore: message
Jun 7, 2022
b82d995
chore: types
Jun 15, 2022
48ab408
chore: methods
Jun 19, 2022
58e085f
chore: tests, internal sdk fixes
Jun 21, 2022
87a16de
docs: add jsdoc for nftSdk
vitalbadjo Jun 21, 2022
2b03a36
chore: solana methods
Jun 21, 2022
1f27f08
chore: tests
Jun 21, 2022
3aa3714
feat: simplify create sdk
rzcoder Jun 22, 2022
5374435
docs: add examples for order methods
vitalbadjo Jun 22, 2022
fb40ef9
docs: tsdoc
vitalbadjo Jun 22, 2022
e98836c
fix: typedoc config
vitalbadjo Jun 22, 2022
605b17a
feat: support create sdk with providers
rzcoder Jun 22, 2022
deb0098
feat: support create sdk with providers
rzcoder Jun 22, 2022
be79a0e
chore: fixes
Jun 23, 2022
ef3cff8
fix: flow buy test
vitalbadjo Jun 23, 2022
57bef20
Merge branch 'master' into PT-468/simple_create_sdk
rzcoder Jun 23, 2022
048cfed
fix: typedoc config, extend docs
vitalbadjo Jun 24, 2022
d51d0e9
Merge pull request #268 from rarible/beta/pt-489-tsdoc
vitalbadjo Jun 24, 2022
2b23902
docs: add usage examples for simplified methods to readme
vitalbadjo Jun 24, 2022
0637a0c
feat: better wallet detection
rzcoder Jul 1, 2022
520a829
docs: add usage examples for simplified methods to readme (#273)
vitalbadjo Jul 11, 2022
8e4ad49
feat: update readme (#278)
rzcoder Jul 13, 2022
da7ee66
feat: migrate to new schema
Jul 19, 2022
d05b9e2
chore: internal methods
Jul 22, 2022
b1ef281
chore: refactor simply & prepare and actions
Jul 24, 2022
6a877c4
chore: update packages with sdk dependency
Jul 24, 2022
c59c45b
chore: readme and examples
Jul 24, 2022
cb6d1f5
chore: merge master
Jul 24, 2022
c5b75b6
chore: staging env was removed
Jul 25, 2022
0baf3d9
chore: updated readme
Jul 26, 2022
21fa90b
chore: merge master
Aug 18, 2022
24e661b
chore: merge master
Aug 22, 2022
6833946
Merge branch 'master' into feature/bravo-1832-simplify-methods
Aug 22, 2022
15bf21f
chore: imx wallet, readme
Aug 23, 2022
fd1bbea
chore: packages peer deps
Aug 23, 2022
833b2c0
chore: merge master
Aug 23, 2022
6ffdfab
chore: typedoc
Aug 23, 2022
b213cba
chore: bump versions after release
Aug 23, 2022
4624ac8
chore: merge master
Sep 22, 2022
8451663
chore: merge update (#339)
ex1st0r Sep 23, 2022
47c745c
chore: bump versions after release
Sep 23, 2022
41fc8a0
chore: simplify version master merge (#349)
ex1st0r Oct 3, 2022
97ea0f7
chore: bump versions after release
Oct 3, 2022
c911dbd
feat: migration guide (#348)
ex1st0r Oct 4, 2022
6a13372
chore: update master
Oct 6, 2022
6da028b
chore: add new network to connector
Oct 6, 2022
fb57218
chore: bump versions after release
Oct 6, 2022
3a3b675
fix: batchbuy for simplify (#354)
ex1st0r Oct 7, 2022
2087ea1
fix: offchain goerli mint
Oct 12, 2022
227172d
chore: offchain mint on goerli
Oct 12, 2022
0517813
chore: bump versions after release
Oct 12, 2022
4b5b369
chore: bump versions after release
Oct 12, 2022
0df4d1c
chore: merge master
Oct 14, 2022
5647716
chore: bump versions after release
Oct 14, 2022
d8cf0b1
fix: can't create polygon collection (#360)
ex1st0r Oct 17, 2022
125e940
chore: merge master
Oct 17, 2022
44648d8
chore: bump versions after release
Oct 17, 2022
f37e340
fix: imx wallet getter (#361)
ex1st0r Oct 18, 2022
f94e952
chore: bump versions after release
Oct 18, 2022
2d9dc18
feat: ethereum wrappers contracts for mainnet and goerli
Oct 20, 2022
f4c2568
chore: bump versions after release
Oct 20, 2022
0feb0ec
chore: merge master
Oct 20, 2022
51c5fe1
chore: bump versions after release
Oct 20, 2022
fc4a312
feat: processMeta method now returns promise
rzcoder Oct 24, 2022
856de99
feat: update wrapper
Oct 25, 2022
b8e7d1e
chore: bump versions after release
Oct 25, 2022
963924b
fix: cancel imx order (#369)
ex1st0r Oct 27, 2022
a5a38da
feat!: make createRaribleSdk method async
rzcoder Oct 28, 2022
88c09e5
Merge branch 'beta/simplify' into feta/PT-1497_async_imports
rzcoder Oct 28, 2022
e2f08be
feat: two builds configs, for esm & commonjs
rzcoder Oct 28, 2022
2e05bbe
feat!: connectors compiling with esnext module system, for asynchrono…
rzcoder Oct 31, 2022
6bd263e
chore: merge master
Oct 31, 2022
030edb5
feat: tezos sdk update
Oct 31, 2022
6512fda
feat: skip cancel imx tx and update eth-sdk (#372)
ex1st0r Oct 31, 2022
8a217e6
chore: bump versions after release
Oct 31, 2022
d2bd93c
chore: merge parent branch
rzcoder Oct 31, 2022
8346b94
fix: prepared method logging
rzcoder Oct 31, 2022
df07bda
Merge branch 'beta/simplify' into PT-1588/fix_logging
rzcoder Oct 31, 2022
d9ece11
chore: merge parent branch
rzcoder Oct 31, 2022
5e3b227
fix: prepared method logging (#373)
rzcoder Oct 31, 2022
a79ded6
fix: api key in context (#374)
ex1st0r Oct 31, 2022
032ca45
chore: webpack analyze config
rzcoder Oct 31, 2022
f718204
chore: bump versions after release
Nov 2, 2022
4391a91
fix: disabled middleware (#376)
ex1st0r Nov 2, 2022
2af7ae2
chore: merge parent branch
rzcoder Nov 3, 2022
62d6ba0
feat: release beta version
Nov 7, 2022
34ade60
chore: bump versions after release
Nov 7, 2022
fa30994
test: logger tests (#379)
rzcoder Nov 7, 2022
85a7657
chore: merge parent branch
rzcoder Nov 7, 2022
889f8d2
fix: example batch fill (#380)
ex1st0r Nov 7, 2022
e75facd
Merge branch 'beta/simplify' into feta/PT-1497_async_imports
rzcoder Nov 7, 2022
72fa5e0
chore: merge master
rzcoder Nov 10, 2022
8266def
Merge branch 'master' into feta/PT-1497_async_imports
rzcoder Nov 14, 2022
435c284
chore: update npm files
rzcoder Nov 14, 2022
4d93840
ci: update sdk exports
rzcoder Nov 16, 2022
9a5a323
Merge branch 'master' into feta/PT-1497_async_imports
rzcoder Nov 17, 2022
ef7df2b
chore: merge master
rzcoder Nov 23, 2022
af64a4a
chore: merge master
rzcoder Nov 23, 2022
70d3ead
chore: merge master
rzcoder Nov 29, 2022
0454a5c
chore: merge master
rzcoder Nov 29, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,6 @@
**/*type.validator.ts
**/umd
**/esm
**/node
**/docs
packages/sdk/example
16 changes: 10 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,19 +68,23 @@ yarn add tslib@2.3.1
yarn add web3@1.5.0 //or ethers@5.6.2
```

## Usage

The package is built with modularity in mind. So that the client browser does not load extra blockchain modules that it does not use. However, some versions of nodejs may not work with the module system used by default in this package, if you need to use sdk in a nodejs environment, use import commonjs version build from `@rarible/sdk/node`

### Ethereum providers
#### Web3
Example of using Metamask provider ([read more about using provider](https://docs.metamask.io/guide/ethereum-provider.html#using-the-provider))
```ts
const blockchainProvider = new Web3(window.ethereum)
const raribleSdk = createRaribleSdk(blockchainProvider, "testnet") //"prod" | "testnet" | "development"
const raribleSdk = await createRaribleSdk(blockchainProvider, "testnet") //"prod" | "testnet" | "development"
```

#### Ethers
```ts
//read-only provider, not for sending transactions!
const blockchainProvider = new ethers.Wallet(pk, new ethers.providers.JsonRpcProvider("https://NODE_URL"))
const raribleSdk = createRaribleSdk(blockchainProvider, "testnet")
const raribleSdk = await createRaribleSdk(blockchainProvider, "testnet")
```

### Flow providers
Expand All @@ -91,31 +95,31 @@ fcl.config({
"accessNode.api": "https://access-testnet.onflow.org", // Mainnet: "https://access-mainnet-beta.onflow.org"
"discovery.wallet": "https://fcl-discovery.onflow.org/testnet/authn" // Mainnet: "https://fcl-discovery.onflow.org/authn"
})
const raribleSdk = createRaribleSdk(fcl, "testnet")
const raribleSdk = await createRaribleSdk(fcl, "testnet")
```

### Solana provider
* Solana provider interface with `publicKey` field and `signTransaction`, `signAllTransactions` methods
```ts
import { SolanaKeypairWallet } from "@rarible/solana-wallet"
const blockchainProvider = SolanaKeypairWallet.createFrom(pk)
const raribleSdk = createRaribleSdk(blockchainProvider, "testnet")
const raribleSdk = await createRaribleSdk(blockchainProvider, "testnet")
```

### Tezos providers
* Tezos provider like in_memory_provider (@rarible/tezos-sdk), Beacon ([source](https://github.com/rarible/tezos-sdk/blob/master/packages/sdk/providers/beacon/beacon_provider.ts)) or etc.
```ts
import { in_memory_provider } from "@rarible/tezos-sdk/dist/providers/in_memory/in_memory_provider"
const blockchainProvider = in_memory_provider(edsk, "https://TEZOS_NODE_URL")
const raribleSdk = createRaribleSdk(blockchainProvider, "testnet")
const raribleSdk = await createRaribleSdk(blockchainProvider, "testnet")
```

### ImmutableX provider
```ts
import { ImxWallet } from "@rarible/immutable-wallet"
const imxConnectorWallet = new ImxWallet("prod")
await imxConnectorWallet.connect()
const raribleSdk = createRaribleSdk(imxConnectorWallet, "prod")
const raribleSdk = await createRaribleSdk(imxConnectorWallet, "prod")
```

### Use Rarible SDK Wallet Connector
Expand Down
3 changes: 3 additions & 0 deletions packages/connector-beacon/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-fcl/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-fortmatic/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-helper/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-iframe/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-immutablex-link/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-mew/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-phantom/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-portis/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-solflare/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-torus/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
3 changes: 3 additions & 0 deletions packages/connector-walletconnect/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"compilerOptions": {
"module": "esnext"
}
}
8 changes: 7 additions & 1 deletion packages/connector-walletlink/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
{
"extends": "../../tsconfig.json",
"include": ["src/**/*"],
"include": [
"src/**/*"
],
"compilerOptions": {
"module": "esnext"
}
}

4 changes: 2 additions & 2 deletions packages/connector/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -156,10 +156,10 @@ const connector = Connector
// .add(fortmatic)


connector.connection.subscribe((con) => {
connector.connection.subscribe(async (con) => {
console.log("connection: " + JSON.stringify(con))
if (con.status === "connected") {
const sdk = createRaribleSdk(con.connection.wallet, "staging")
const sdk = await createRaribleSdk(con.connection.wallet, "staging")
// use sdk here
}
})
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/tests/common/atoms-tests/bid-update.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IRaribleSdk } from "@rarible/sdk/src/domain"
import type { BlockchainWallet } from "@rarible/sdk-wallet"
import type { Order } from "@rarible/api-client"
import type { OrderUpdateRequest, PrepareOrderUpdateRequest } from "@rarible/sdk/build/types/order/common"
import type { OrderUpdateRequest, PrepareOrderUpdateRequest } from "@rarible/sdk/node/types/order/common"
import { WalletType } from "@rarible/sdk-wallet"
import { Logger } from "../logger"

Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/tests/common/atoms-tests/burn.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IRaribleSdk } from "@rarible/sdk/src/domain"
import type { BurnRequest, PrepareBurnRequest } from "@rarible/sdk/build/types/nft/burn/domain"
import type { BurnRequest, PrepareBurnRequest } from "@rarible/sdk/node/types/nft/burn/domain"
import type { BigNumber } from "@rarible/types"
import { awaitForItemSupply } from "../helpers"
import { Logger } from "../logger"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IRaribleSdk } from "@rarible/sdk/src/domain"
import type { BlockchainWallet } from "@rarible/sdk-wallet"
import type { CreateCollectionResponse } from "@rarible/sdk/src/types/nft/deploy/domain"
import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified"
import type { CreateCollectionRequestSimplified } from "@rarible/sdk/node/types/nft/deploy/simplified"
import { Logger } from "../logger"

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import type { BlockchainWallet } from "@rarible/sdk-wallet"
import { toBigNumber } from "@rarible/types"
import type { PrepareMintRequest } from "@rarible/sdk/src/types/nft/mint/prepare-mint-request.type"
import { MintType } from "@rarible/sdk/src/types/nft/mint/prepare"
import type { MintAndSellRequest, MintAndSellResponse } from "@rarible/sdk/build/types/nft/mint-and-sell/domain"
import type { MintAndSellRequest, MintAndSellResponse } from "@rarible/sdk/node/types/nft/mint-and-sell/domain"
import { awaitOrderStock } from "../helpers"
import { Logger } from "../logger"

Expand Down
4 changes: 2 additions & 2 deletions packages/e2e-tests/tests/common/atoms-tests/mint.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import type { IRaribleSdk } from "@rarible/sdk/src/domain"
import { MintType } from "@rarible/sdk/src/types/nft/mint/prepare"
import { retry } from "@rarible/sdk/src/common/retry"
import type { PrepareMintRequest } from "@rarible/sdk/src/types/nft/mint/prepare-mint-request.type"
import type { MintResponse } from "@rarible/sdk/build/types/nft/mint/prepare"
import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request.type"
import type { BlockchainWallet } from "@rarible/sdk-wallet"
import type { MintRequest } from "@rarible/sdk/node/types/nft/mint/mint-request.type"
import type { MintResponse } from "@rarible/sdk/node/types/nft/mint/prepare"
import type { Item } from "@rarible/api-client"
import { Logger } from "../logger"

Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/tests/common/atoms-tests/sell-update.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import type { IRaribleSdk } from "@rarible/sdk/src/domain"
import type { BlockchainWallet } from "@rarible/sdk-wallet"
import { retry } from "@rarible/sdk/src/common/retry"
import type { OrderUpdateRequest, PrepareOrderUpdateRequest } from "@rarible/sdk/build/types/order/common"
import type { OrderUpdateRequest, PrepareOrderUpdateRequest } from "@rarible/sdk/node/types/order/common"
import type { Order } from "@rarible/api-client"
import { WalletType } from "@rarible/sdk-wallet"
import { Logger } from "../logger"
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/tests/common/atoms-tests/transfer.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { IRaribleSdk } from "@rarible/sdk/src/domain"
import type { TransferRequest, PrepareTransferRequest } from "@rarible/sdk/build/types/nft/transfer/domain"
import type { TransferRequest, PrepareTransferRequest } from "@rarible/sdk/node/types/nft/transfer/domain"
import { Logger } from "../logger"

/**
Expand Down
11 changes: 6 additions & 5 deletions packages/e2e-tests/tests/common/create-sdk.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { Blockchain } from "@rarible/api-client"
import type { IRaribleSdk } from "@rarible/sdk"
import type { IRaribleSdk } from "@rarible/sdk/node"
import type { BlockchainWallet } from "@rarible/sdk-wallet"
import type { RaribleSdkEnvironment } from "@rarible/sdk/src/config/domain"
import { createRaribleSdk } from "@rarible/sdk"
import { LogsLevel } from "@rarible/sdk/build/domain"
import { createRaribleSdk } from "@rarible/sdk/node"
import { LogsLevel } from "@rarible/sdk/node/domain"
import type { AuthWithPrivateKey } from "@rarible/flow-sdk/build/types"
import { WalletType } from "@rarible/sdk-wallet"
import { testsConfig } from "./config"

export function createSdk(blockchain: Blockchain, wallet: BlockchainWallet): IRaribleSdk {
export async function createSdk(blockchain: Blockchain, wallet: BlockchainWallet): Promise<IRaribleSdk> {
let env: RaribleSdkEnvironment = testsConfig.env as RaribleSdkEnvironment
let flowAuth: AuthWithPrivateKey = undefined
switch (blockchain) {
Expand All @@ -20,9 +20,10 @@ export function createSdk(blockchain: Blockchain, wallet: BlockchainWallet): IRa
env = "testnet"
break
default:
break
}

return createRaribleSdk(
return await createRaribleSdk(
wallet,
env,
{
Expand Down
2 changes: 1 addition & 1 deletion packages/e2e-tests/tests/common/currency.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { RequestCurrency } from "@rarible/sdk/build/common/domain"
import type { RequestCurrency } from "@rarible/sdk/node/common/domain"
import type { BlockchainWallet } from "@rarible/sdk-wallet"
import { EthereumWallet, FlowWallet, SolanaWallet, TezosWallet } from "@rarible/sdk-wallet"
import { toContractAddress, toAddress } from "@rarible/types"
Expand Down
5 changes: 3 additions & 2 deletions packages/e2e-tests/tests/ethereum/smoke/api/activity.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ActivityType, Blockchain } from "@rarible/api-client"
import type { UnionAddress } from "@rarible/types"
import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request.type"
import type { MintRequest } from "@rarible/sdk/node/types/nft/mint/mint-request.type"
import type { BlockchainWallet } from "@rarible/sdk-wallet"
import type {
GetActivitiesByCollection200,
Expand Down Expand Up @@ -54,9 +54,10 @@ function suites(): {

describe.each(suites())("$blockchain api => activity", (suite) => {
const { seller: sellerWallet } = suite.wallets
const sellerSdk = createSdk(suite.blockchain, sellerWallet)

test("activity controller", async () => {
const sellerSdk = await createSdk(suite.blockchain, sellerWallet)

const walletAddressSeller = await getWalletAddressFull(sellerWallet)

const collection = await getCollection(sellerSdk, suite.collectionId)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import type {
GetAllCollections200,
GetCollectionsByOwner200,
} from "@rarible/api-client/build/apis/CollectionControllerApi"
import type { CreateCollectionRequestSimplified } from "@rarible/sdk/build/types/nft/deploy/simplified"
import type { CreateCollectionRequestSimplified } from "@rarible/sdk/node/types/nft/deploy/simplified"
import { getEthereumWallet, getWalletAddressFull } from "../../../common/wallet"
import { createSdk } from "../../../common/create-sdk"
import {
Expand Down Expand Up @@ -42,9 +42,9 @@ function suites(): {

describe.each(suites())("$blockchain api => collection", (suite) => {
const wallet = suite.wallet
const sdk = createSdk(suite.blockchain, wallet)

test("collection controller", async () => {
const sdk = await createSdk(suite.blockchain, wallet)

const { address } = await createCollection(sdk, wallet, suite.deployRequest)

Expand Down
5 changes: 3 additions & 2 deletions packages/e2e-tests/tests/ethereum/smoke/api/item.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
import type { BlockchainWallet } from "@rarible/sdk-wallet"
import type { UnionAddress } from "@rarible/types"
import { toBigNumber } from "@rarible/types"
import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request.type"
import type { MintRequest } from "@rarible/sdk/node/types/nft/mint/mint-request.type"
import type { GetAllItems200 } from "@rarible/api-client/build/apis/ItemControllerApi"
import { getEthereumWallet, getWalletAddressFull } from "../../../common/wallet"
import { testsConfig } from "../../../common/config"
Expand Down Expand Up @@ -62,9 +62,10 @@ function suites(): {

describe.each(suites())("$blockchain api => ownership", (suite) => {
const wallet = suite.wallet
const sdk = createSdk(suite.blockchain, wallet)

test("item controller", async () => {
const sdk = await createSdk(suite.blockchain, wallet)

const address = await getWalletAddressFull(wallet)
const collection = await getCollection(sdk, suite.collectionId)
const { nft } = await mint(sdk, wallet, { collection },
Expand Down
9 changes: 5 additions & 4 deletions packages/e2e-tests/tests/ethereum/smoke/api/order.test.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Blockchain } from "@rarible/api-client"
import type { UnionAddress } from "@rarible/types"
import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request.type"
import type { MintRequest } from "@rarible/sdk/node/types/nft/mint/mint-request.type"
import type { BlockchainWallet } from "@rarible/sdk-wallet"
import type { RequestCurrency } from "@rarible/sdk/src/common/domain"
import { retry } from "@rarible/sdk/build/common/retry"
import { retry } from "@rarible/sdk/node/common/retry"
import type { OrderRequest } from "@rarible/sdk/src/types/order/common"
import type {
GetOrderBidsByItem200,
Expand Down Expand Up @@ -88,10 +88,11 @@ describe.each(suites())("$blockchain api => order", (suite) => {
seller: sellerWallet,
buyer: buyerWallet,
} = suite.wallets
const sellerSdk = createSdk(suite.blockchain, sellerWallet)
const buyerSdk = createSdk(suite.blockchain, buyerWallet)

test("order controller", async () => {
const sellerSdk = await createSdk(suite.blockchain, sellerWallet)
const buyerSdk = await createSdk(suite.blockchain, buyerWallet)

const walletAddressSeller = await getWalletAddressFull(sellerWallet)

const collection = await getCollection(sellerSdk, suite.collectionId)
Expand Down
5 changes: 3 additions & 2 deletions packages/e2e-tests/tests/ethereum/smoke/api/ownership.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Blockchain } from "@rarible/api-client"
import type { BlockchainWallet } from "@rarible/sdk-wallet"
import type { UnionAddress } from "@rarible/types"
import { toBigNumber } from "@rarible/types"
import type { MintRequest } from "@rarible/sdk/build/types/nft/mint/mint-request.type"
import type { MintRequest } from "@rarible/sdk/node/types/nft/mint/mint-request.type"
import type { GetOwnershipsByItem200 } from "@rarible/api-client/build/apis/OwnershipControllerApi"
import { getEthereumWallet, getWalletAddressFull } from "../../../common/wallet"
import { testsConfig } from "../../../common/config"
Expand Down Expand Up @@ -46,9 +46,10 @@ function suites(): {

describe.each(suites())("$blockchain api => ownership", (suite) => {
const wallet = suite.wallet
const sdk = createSdk(suite.blockchain, wallet)

test("ownership controller", async () => {
const sdk = await createSdk(suite.blockchain, wallet)

const address = await getWalletAddressFull(wallet)
const collection = await getCollection(sdk, suite.collectionId)
const { nft } = await mint(sdk, wallet, { collection },
Expand Down
Loading