Skip to content

Commit

Permalink
chore: merge remote-tracking branch 'origin/main' into mmackz/lens-co…
Browse files Browse the repository at this point in the history
…llect
  • Loading branch information
mmackz committed Jun 25, 2024
2 parents 70f4a74 + 8e57c6e commit 1c56e74
Show file tree
Hide file tree
Showing 40 changed files with 1,592 additions and 1,029 deletions.
5 changes: 5 additions & 0 deletions .changeset/blue-falcons-camp.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rabbitholegg/questdk-plugin-fabric": patch
---

export functions required for inbox integration
5 changes: 5 additions & 0 deletions .changeset/poor-dragons-scream.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rabbitholegg/questdk-plugin-foundation": patch
---

disable dutch auction type mints (foundation)
7 changes: 6 additions & 1 deletion .changeset/pre.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"big-pants-own",
"big-rice-fly",
"blue-bikes-sip",
"blue-falcons-camp",
"blue-kangaroos-kiss",
"breezy-trees-carry",
"bright-turtles-divide",
Expand Down Expand Up @@ -163,6 +164,7 @@
"purple-trainers-occur",
"quick-eyes-retire",
"quick-otters-deliver",
"quiet-cougars-occur",
"quiet-mails-sneeze",
"quiet-numbers-change",
"quiet-spies-drum",
Expand Down Expand Up @@ -270,10 +272,12 @@
"unlucky-pumpkins-taste",
"unlucky-tigers-deny",
"violet-papayas-promise",
"violet-starfishes-think",
"weak-fishes-unite",
"weak-monkeys-dance",
"weak-trains-boil",
"wet-crabs-switch",
"wet-insects-cough",
"wet-toes-prove",
"wet-zoos-compare",
"wicked-deers-marry",
Expand Down Expand Up @@ -344,6 +348,7 @@
"@rabbitholegg/questdk-plugin-titles": "1.0.0-alpha.0",
"@rabbitholegg/questdk-plugin-foundation": "1.0.0-alpha.0",
"@rabbitholegg/questdk-plugin-thirdweb": "1.0.0-alpha.2",
"@rabbitholegg/questdk-plugin-lens": "1.0.0-alpha.0"
"@rabbitholegg/questdk-plugin-lens": "1.0.0-alpha.0",
"@rabbitholegg/questdk-plugin-moshicam": "1.0.0-alpha.0"
}
}
5 changes: 5 additions & 0 deletions .changeset/quiet-cougars-occur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rabbitholegg/questdk-plugin-okutrade": patch
---

pin okutrade sdk
5 changes: 5 additions & 0 deletions .changeset/serious-tips-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@rabbitholegg/questdk-plugin-zora": patch
---

enable state override for balance
6 changes: 6 additions & 0 deletions .changeset/violet-starfishes-think.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
"@rabbitholegg/questdk-plugin-moshicam": patch
"@rabbitholegg/questdk-plugin-registry": patch
---

Add moshicam plugin
7 changes: 7 additions & 0 deletions .changeset/wild-doors-look.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
"@rabbitholegg/questdk-plugin-foundation": patch
"@rabbitholegg/questdk-plugin-thirdweb": patch
"@rabbitholegg/questdk-plugin-utils": patch
---

extract mint amount functions to utils
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,13 +44,13 @@
"axios": "1.7.2",
"react-intl": "6.6.2",
"ts-pattern": "5.0.1",
"viem": "2.13.1",
"viem": "2.15.1",
"zod": "3.21.4"
},
"pnpm": {
"overrides": {
"jsbi@>3.2.5": "3.2.5",
"viem@<2.13.1": "2.13.1"
"viem@<2.15.1": "2.15.1"
}
},
"packageManager": "pnpm@8.15.4"
Expand Down
6 changes: 6 additions & 0 deletions packages/fabric/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @rabbitholegg/questdk-plugin-fabric

## 1.0.0-alpha.30

### Patch Changes

- [#460](https://github.com/rabbitholegg/questdk-plugins/pull/460) [`388ad5ef`](https://github.com/rabbitholegg/questdk-plugins/commit/388ad5efdf682fa7d7b890a4af1cea89df7e88dd) Thanks [@mmackz](https://github.com/mmackz)! - export functions required for inbox integration

## 1.0.0-alpha.29

### Patch Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/fabric/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@rabbitholegg/questdk-plugin-fabric",
"private": false,
"version": "1.0.0-alpha.29",
"version": "1.0.0-alpha.30",
"exports": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js",
Expand Down
16 changes: 15 additions & 1 deletion packages/fabric/src/index.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,28 @@
import { type IActionPlugin } from '@rabbitholegg/questdk'
import type {
ActionParams,
IActionPlugin,
MintActionParams,
} from '@rabbitholegg/questdk-plugin-utils'

import {
getFees,
getProjectFees,
getMintIntent,
getSupportedChainIds,
getSupportedTokenAddresses,
mint,
simulateMint,
} from './Fabric.js'

export const Fabric: IActionPlugin = {
pluginId: 'fabric',
getSupportedTokenAddresses,
getSupportedChainIds,
mint,
getProjectFees: async (params: ActionParams) =>
getProjectFees(params as unknown as MintActionParams),
getFees: async (params: ActionParams) =>
getFees(params as unknown as MintActionParams),
getMintIntent,
simulateMint,
}
16 changes: 5 additions & 11 deletions packages/foundation/src/Foundation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,10 @@ import {
} from './constants'
import {
calculateFees,
formatAmount,
getContractType,
getDutchAuctionData,
getFixedPriceData,
getFixedPriceSaleTerms,
getMintAmount,
getSaleTermsId,
} from './utils'
import {
Expand All @@ -25,6 +23,8 @@ import {
import {
Chains,
DEFAULT_ACCOUNT,
formatAmount,
getMintAmount,
type MintIntentParams,
chainIdToViemChain,
} from '@rabbitholegg/questdk-plugin-utils'
Expand Down Expand Up @@ -313,15 +313,9 @@ export const simulateMint = async (
contractAddress,
)
if (dutchAuctionSeller && dutchAuctionSeller !== zeroAddress) {
const result = await _client.simulateContract({
address: dropFactoryAddress,
value,
abi: [DUTCH_AUCTION_FRAGMENT],
functionName: 'mintFromDutchAuctionV2',
args: [contractAddress, mintAmount, recipient],
account: account || DEFAULT_ACCOUNT,
})
return result
// Not supported due to the way we calculate fees.
// https://github.com/rabbitholegg/questdk-plugins/pull/445#pullrequestreview-2111167218
throw new Error('Dutch auction is not supported')
}

throw new Error('Invalid mint arguments')
Expand Down
33 changes: 0 additions & 33 deletions packages/foundation/src/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import {
} from './constants'
import { type SaleTerms } from './types'
import {
type FilterOperator,
type MintActionParams,
chainIdToViemChain,
} from '@rabbitholegg/questdk-plugin-utils'
Expand Down Expand Up @@ -125,35 +124,3 @@ export async function getContractType(
}
return null
}

export function formatAmount(amount: FilterOperator | undefined) {
if (amount === undefined) {
return undefined
}
if (amount && ['string', 'number', 'bigint'].includes(typeof amount)) {
return { $gte: amount }
}

return amount
}

export function getMintAmount(amount: FilterOperator | undefined) {
// If the amount is a primitive, pass that value through
if (['number', 'bigint'].includes(typeof amount)) {
return BigInt(amount as number | bigint)
}
if (typeof amount === 'string' && !isNaN(Number(amount))) {
return BigInt(amount)
}

// For $gte, the minimum amount required to pass is the value of $gte
if (typeof amount === 'object' && '$gte' in amount && amount.$gte) {
return BigInt(amount.$gte)
}
// For $gt, the minimum amount required to pass is the value of $gt + 1
if (typeof amount === 'object' && '$gt' in amount && amount.$gt) {
return BigInt(amount.$gt) + 1n
}
// For all other conditions, the minimum amount required to pass is 1
return 1n
}
6 changes: 6 additions & 0 deletions packages/lens/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# @rabbitholegg/questdk-plugin-lens

## 1.0.0-alpha.2

### Minor Changes

- [#455](https://github.com/rabbitholegg/questdk-plugins/pull/455) [`7f9566b8`](https://github.com/rabbitholegg/questdk-plugins/commit/7f9566b8c2830b76e0808f71283f58d08c081033) Thanks [@mmackz](https://github.com/mmackz)! - change validation method

## 1.0.0-alpha.1

### Minor Changes
Expand Down
2 changes: 1 addition & 1 deletion packages/lens/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@rabbitholegg/questdk-plugin-lens",
"private": false,
"version": "1.0.0-alpha.1",
"version": "1.0.0-alpha.2",
"exports": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js",
Expand Down
7 changes: 7 additions & 0 deletions packages/moshicam/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# @rabbitholegg/questdk-plugin-moshicam

## 1.0.0-alpha.1

### Patch Changes

- [#454](https://github.com/rabbitholegg/questdk-plugins/pull/454) [`27af0264`](https://github.com/rabbitholegg/questdk-plugins/commit/27af02649d8338a25f4ce1b76786d4b487094f60) Thanks [@jarrel-b](https://github.com/jarrel-b)! - Add moshicam plugin
12 changes: 12 additions & 0 deletions packages/moshicam/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# Moshicam Plugin

## Overview
[Moshicam](https://moshi.cam) is a photo-sharing app where users can mint their photos with a customizable borders from well-known artists and web3 brands. The proceeds of each mint are sent directly to the creator of the border and to the creator of the pic.

## Implementation Details
User contracts are deployed as a proxy to a central beacon ERC1155 contract. Other users can collect existing NFTs from each of these contracts.
- [Beacon contract](https://basescan.org/address/0x168dbc5ea60d03eba4d8083f7a95a4bcb8137700)
- [Implementation contract](https://basescan.org/address/0x56d4808987696279bC78FF3F5349bB5280687164)

### Sample Transactions
- [Collect from user Moshi contract](https://basescan.org/tx/0x619762bdbded2725b58d62a164e52aa7a340e5ca64e37a6b8aeea4b63e9ff877)
35 changes: 35 additions & 0 deletions packages/moshicam/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
{
"name": "@rabbitholegg/questdk-plugin-moshicam",
"version": "1.0.0-alpha.1",
"exports": {
"require": "./dist/cjs/index.js",
"import": "./dist/esm/index.js",
"types": "./dist/types/index.d.ts"
},
"main": "./dist/cjs/index.js",
"module": "./dist/esm/index.js",
"description": "Plugin for moshicam",
"types": "./dist/types/index.d.ts",
"typings": "./dist/types/index.d.ts",
"scripts": {
"build": "vite build && tsc --project tsconfig.build.json --emitDeclarationOnly --declaration --declarationMap --declarationDir ./dist/types",
"bench": "vitest bench",
"bench:ci": "CI=true vitest bench",
"clean": "rimraf dist",
"format": "rome format . --write",
"lint": "eslint .",
"lint:fix": "eslint . --fix",
"test": "vitest dev",
"test:cov": "vitest dev --coverage",
"test:ci": "CI=true vitest --coverage",
"test:ui": "vitest dev --ui"
},
"keywords": [],
"author": "",
"license": "ISC",
"devDependencies": {},
"dependencies": {
"@rabbitholegg/questdk-plugin-utils": "workspace:*",
"@rabbitholegg/questdk": "workspace:*"
}
}
10 changes: 10 additions & 0 deletions packages/moshicam/plugin-details.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
project:
name: Moshicam
iconOption:
appLink: https://moshi.cam/metadata/favicon-64x64.png

tasks:
- name: Mint on Moshicam
link: https://moshi.cam/
iconOption: https://moshi.cam/metadata/favicon-64x64.png
actionPluginId: mint
Loading

0 comments on commit 1c56e74

Please sign in to comment.