@mojito-inc/core-service
Advanced tools
Comparing version 1.0.8-beta.41 to 1.0.8-beta.42
@@ -79,2 +79,25 @@ import { TokenType } from './ListItemParam'; | ||
} | ||
export interface InitiateRemoveListingResponseData { | ||
seller: string; | ||
sellerTokenAccount: string; | ||
mintAccount: string; | ||
metadataId: string; | ||
systemProgram: string; | ||
tokenProgram: string; | ||
rent: string; | ||
bubblegumProgram: string; | ||
compressionProgram: string; | ||
treeAuthority: string; | ||
leafOwner: string; | ||
previousLeafDelegate: string; | ||
newLeafDelegate: string; | ||
logWrapper: string; | ||
merkleTree: string; | ||
listDiscriminator: number[]; | ||
bubblegumListArg: bubbleGumListArgParams; | ||
listingReceipt: string; | ||
} | ||
export interface InitiateRemoveListingData { | ||
initiateRemoveListing: InitiateRemoveListingResponseData; | ||
} | ||
export {}; |
@@ -31,2 +31,7 @@ import { CurrencyCodeFiat } from '../connect-wallet'; | ||
orgID: string; | ||
currency?: CurrencyCodeFiat; | ||
} | ||
export interface InitiateRemoveListingParam { | ||
nftTokenId: string; | ||
orgId: string; | ||
} |
import { Response } from '../data'; | ||
import { CreateSignatureToListNFTForSaleData, RemoveListingData, SubmitProofOfApprovalData } from './ListItemData'; | ||
import { CreateSignatureToListNFTForSaleData, InitiateRemoveListingData, RemoveListingData, SubmitProofOfApprovalData } from './ListItemData'; | ||
import { QueryOptions } from '../domain'; | ||
import { CreateSignatureToListNFTForSaleParam, RemoveListingParam, SubmitProofOfApprovalParam } from './ListItemParam'; | ||
import { CreateSignatureToListNFTForSaleParam, InitiateRemoveListingParam, RemoveListingParam, SubmitProofOfApprovalParam } from './ListItemParam'; | ||
export interface ListItemService { | ||
@@ -42,2 +42,14 @@ /** | ||
removeListing: (param: RemoveListingParam, options?: QueryOptions) => Promise<Response<RemoveListingData>>; | ||
/** | ||
* Returns string | ||
* | ||
* @remarks | ||
* This method is part of list item service | ||
* | ||
* @param param - remove listing {@link InitiateRemoveListingParam} | ||
* @param options - graphql fetch query options {@link QueryOptions} | ||
* @returns {@link InitiateRemoveListingData} success response | ||
* | ||
*/ | ||
initiateRemoveListing: (param: InitiateRemoveListingParam, options?: QueryOptions) => Promise<Response<InitiateRemoveListingData>>; | ||
} |
export declare const createSignatureToListNFTForSaleMutation: import("@apollo/client").DocumentNode; | ||
export declare const submitProofOfApprovalMutation: import("@apollo/client").DocumentNode; | ||
export declare const removeListingMutation: import("@apollo/client").DocumentNode; | ||
export declare const initiateRemoveListingMutation: import("@apollo/client").DocumentNode; |
@@ -116,7 +116,45 @@ import { gql } from '@apollo/client'; | ||
const removeListingMutation = gql ` | ||
mutation removeListing($orgID: UUID1!, $nftTokenId: UUID1!) { | ||
removeListing(nftTokenId: $nftTokenId, orgID: $orgID) | ||
mutation removeListing($orgID: UUID1!, $nftTokenId: UUID1!, $currency: CurrencyCodeFiat) { | ||
removeListing(nftTokenId: $nftTokenId, orgID: $orgID, currency: $currency) | ||
} | ||
`; | ||
const initiateRemoveListingMutation = gql ` | ||
mutation initiateRemoveListingMutation ( | ||
$nftTokenId: UUID1! | ||
$orgId: UUID1! | ||
) { | ||
initiateRemoveListing ( | ||
nftTokenId: $nftTokenId | ||
orgId: $orgId | ||
) { | ||
seller | ||
sellerTokenAccount | ||
mintAccount | ||
metadataId | ||
systemProgram | ||
tokenProgram | ||
rent | ||
bubblegumProgram | ||
compressionProgram | ||
treeAuthority | ||
leafOwner | ||
previousLeafDelegate | ||
newLeafDelegate | ||
logWrapper | ||
merkleTree | ||
listDiscriminator | ||
bubblegumListArg { | ||
price | ||
isCnft | ||
isVin | ||
dataHash | ||
creatorHash | ||
nonce | ||
index | ||
} | ||
listingReceipt | ||
} | ||
} | ||
`; | ||
export { createSignatureToListNFTForSaleMutation, removeListingMutation, submitProofOfApprovalMutation }; | ||
export { createSignatureToListNFTForSaleMutation, initiateRemoveListingMutation, removeListingMutation, submitProofOfApprovalMutation }; |
import { __awaiter } from '../_virtual/_tslib.js'; | ||
import { useCallback, useMemo } from 'react'; | ||
import { useApolloClient } from '@apollo/client'; | ||
import { createSignatureToListNFTForSaleMutation, submitProofOfApprovalMutation, removeListingMutation } from './Queries.js'; | ||
import { createSignatureToListNFTForSaleMutation, submitProofOfApprovalMutation, removeListingMutation, initiateRemoveListingMutation } from './Queries.js'; | ||
@@ -32,7 +32,12 @@ /** | ||
}), [client]); | ||
const initiateRemoveListing = useCallback((param, options) => __awaiter(void 0, void 0, void 0, function* () { | ||
const response = yield client.mutate(Object.assign(Object.assign({}, options), { mutation: initiateRemoveListingMutation, variables: param })); | ||
const responseData = response.data; | ||
return { data: responseData }; | ||
}), [client]); | ||
return useMemo(() => { | ||
return { createSignatureToListNFTForSale, submitProofOfApproval, removeListing }; | ||
}, [createSignatureToListNFTForSale, submitProofOfApproval, removeListing]); | ||
return { createSignatureToListNFTForSale, submitProofOfApproval, removeListing, initiateRemoveListing }; | ||
}, [createSignatureToListNFTForSale, submitProofOfApproval, removeListing, initiateRemoveListing]); | ||
}; | ||
export { useListItem as default }; |
@@ -137,2 +137,13 @@ import { BubbleGumParams } from '../NFT'; | ||
} | ||
export interface InitiateCancelOfferData { | ||
initiateCancelOffer: { | ||
seller: string; | ||
sellerTokenAccount: string; | ||
buyer: string; | ||
offer: string; | ||
offerEscrow: string; | ||
systemProgram: string; | ||
descriminator: number[]; | ||
}; | ||
} | ||
export {}; |
@@ -67,2 +67,6 @@ import { CurrencyCodeFiat } from '../connect-wallet'; | ||
} | ||
export interface InitiateCancelOfferParam { | ||
orderId: string; | ||
orgId: string; | ||
} | ||
export {}; |
import { Response } from '../data'; | ||
import { GetOffersData, CancelOfferData, RejectOfferData, CreateOfferData, GetSignatureForOfferApprovalData, AcceptOfferData, SubmitProofOfOfferData, InitiateRejectOfferData } from './OfferData'; | ||
import { GetOffersData, CancelOfferData, RejectOfferData, CreateOfferData, GetSignatureForOfferApprovalData, AcceptOfferData, SubmitProofOfOfferData, InitiateRejectOfferData, InitiateCancelOfferData } from './OfferData'; | ||
import { QueryOptions } from '../domain'; | ||
import { GetOffersParam, CancelOrRejectOfferParam, CreateOfferParam, GetSignatureForOfferApprovalParam, AcceptOfferParam, SubmitProofOfOfferParam, InitiateRejectOfferParam } from './OfferParam'; | ||
import { GetOffersParam, CancelOrRejectOfferParam, CreateOfferParam, GetSignatureForOfferApprovalParam, AcceptOfferParam, SubmitProofOfOfferParam, InitiateRejectOfferParam, InitiateCancelOfferParam } from './OfferParam'; | ||
export interface OfferService { | ||
@@ -31,2 +31,14 @@ /** | ||
/** | ||
* Returns the success response | ||
* | ||
* @remarks | ||
* This method is part of Offer service | ||
* | ||
* @param param - cancel offer param {@link InitiateCancelOfferParam} | ||
* @param options - graphql fetch query options {@link QueryOptions} | ||
* @returns {@link InitiateCancelOfferData} success response | ||
* | ||
*/ | ||
initiateCancelOffer: (param: InitiateCancelOfferParam, options?: QueryOptions) => Promise<Response<InitiateCancelOfferData>>; | ||
/** | ||
* Returns the success response | ||
@@ -33,0 +45,0 @@ * |
export declare const getOffersQueries: import("@apollo/client").DocumentNode; | ||
export declare const cancelOfferMutation: import("@apollo/client").DocumentNode; | ||
export declare const initiateCancelOfferMutation: import("@apollo/client").DocumentNode; | ||
export declare const rejectOfferMutation: import("@apollo/client").DocumentNode; | ||
@@ -4,0 +5,0 @@ export declare const createOfferMutation: import("@apollo/client").DocumentNode; |
@@ -48,6 +48,25 @@ import { gql } from '@apollo/client'; | ||
const cancelOfferMutation = gql ` | ||
mutation cancelOffer($orderId: UUID1!, $orgId: UUID1!) { | ||
cancelOffer(orderId: $orderId, orgId: $orgId) | ||
mutation cancelOffer($orderId: UUID1!, $orgId: UUID1!, $currency: CurrencyCodeFiat, $signature: String) { | ||
cancelOffer(orderId: $orderId, orgId: $orgId, currency: $currency, signature: $signature) | ||
} | ||
`; | ||
const initiateCancelOfferMutation = gql ` | ||
mutation initiateCancelOfferMutation( | ||
$orderId: UUID1! | ||
$orgId: UUID1! | ||
) { | ||
initiateCancelOffer( | ||
orderId: $orderId | ||
orgId: $orgId | ||
) { | ||
seller | ||
sellerTokenAccount | ||
buyer | ||
offer | ||
offerEscrow | ||
systemProgram | ||
descriminator | ||
} | ||
} | ||
`; | ||
const rejectOfferMutation = gql ` | ||
@@ -302,2 +321,2 @@ mutation rejectOffer( | ||
export { acceptOfferMutation, cancelOfferMutation, createOfferMutation, getOffersQueries, getSignatureForOfferApprovalQueries, initiateRejectOfferMutation, rejectOfferMutation, submitProofOfOfferMutation }; | ||
export { acceptOfferMutation, cancelOfferMutation, createOfferMutation, getOffersQueries, getSignatureForOfferApprovalQueries, initiateCancelOfferMutation, initiateRejectOfferMutation, rejectOfferMutation, submitProofOfOfferMutation }; |
import { __awaiter } from '../_virtual/_tslib.js'; | ||
import { useCallback, useMemo } from 'react'; | ||
import { useApolloClient } from '@apollo/client'; | ||
import { getOffersQueries, cancelOfferMutation, rejectOfferMutation, createOfferMutation, submitProofOfOfferMutation, getSignatureForOfferApprovalQueries, acceptOfferMutation, initiateRejectOfferMutation } from './Queries.js'; | ||
import { getOffersQueries, cancelOfferMutation, rejectOfferMutation, createOfferMutation, submitProofOfOfferMutation, getSignatureForOfferApprovalQueries, acceptOfferMutation, initiateRejectOfferMutation, initiateCancelOfferMutation } from './Queries.js'; | ||
@@ -57,7 +57,32 @@ /** | ||
}), [client]); | ||
const initiateCancelOffer = useCallback((param, options) => __awaiter(void 0, void 0, void 0, function* () { | ||
const response = yield client.mutate(Object.assign(Object.assign({}, options), { mutation: initiateCancelOfferMutation, variables: param })); | ||
const responseData = response.data; | ||
return { data: responseData }; | ||
}), [client]); | ||
return useMemo(() => { | ||
return { getOffers, cancelOffer, rejectOffer, createOffer, submitProofOfOffer, getSignatureForOfferApproval, acceptOffer, initiateRejectOffer }; | ||
}, [getOffers, cancelOffer, rejectOffer, createOffer, submitProofOfOffer, getSignatureForOfferApproval, acceptOffer, initiateRejectOffer]); | ||
return { | ||
getOffers, | ||
cancelOffer, | ||
rejectOffer, | ||
createOffer, | ||
submitProofOfOffer, | ||
getSignatureForOfferApproval, | ||
acceptOffer, | ||
initiateRejectOffer, | ||
initiateCancelOffer, | ||
}; | ||
}, [ | ||
getOffers, | ||
cancelOffer, | ||
rejectOffer, | ||
createOffer, | ||
submitProofOfOffer, | ||
getSignatureForOfferApproval, | ||
acceptOffer, | ||
initiateRejectOffer, | ||
initiateCancelOffer, | ||
]); | ||
}; | ||
export { useOffer as default }; |
{ | ||
"name": "@mojito-inc/core-service", | ||
"version": "1.0.8-beta.41", | ||
"version": "1.0.8-beta.42", | ||
"description": "Mojito Core API service for auction, payment, token", | ||
@@ -5,0 +5,0 @@ "main": "./index.cjs", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
517399
14277