forked from polkadot-js/extension
-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Issue-3191] Support Avail OG Mainnet
- Loading branch information
Showing
7 changed files
with
184 additions
and
93 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
packages/extension-base/src/koni/api/nft/blobinscription/consts.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
export const COLLECT_ID = 'Avail OG'; | ||
export const ALC_NFT_RAW_VALUE = { | ||
BRONZE: '{"p":"OIS-AVAIL","op":"create","tick":"AVAIL-OG","imgUrl":"https://storage.googleapis.com/blobscriptions.appspot.com/user-uploads%2Fclyy54fsc0001jpr1bi3thgp7%2F1721723052313-mkyf6c7hkfv9v0mgu0itbof7-bronzeNFT.mp4","tokenType":"NFT","totalSupply":"5000","limit":"5000","traits":{"Tier":"bronze"},"name":"Bronze OG"}', | ||
SILVER: '{"p":"OIS-AVAIL","op":"create","tick":"AVAIL-OG","imgUrl":"https://storage.googleapis.com/blobscriptions.appspot.com/user-uploads%2Fclyy54fsc0001jpr1bi3thgp7%2F1721722886703-hnhan3yc1ma9v8euheq8aj21-silverNFT.mp4","tokenType":"NFT","totalSupply":"4000","limit":"4000","traits":{"Tier":"silver"},"name":"Silver OG"}', | ||
GOLD: '{"p":"OIS-AVAIL","op":"create","tick":"AVAIL-OG","imgUrl":"https://storage.googleapis.com/blobscriptions.appspot.com/user-uploads%2Fclyy54fsc0001jpr1bi3thgp7%2F1721722632268-mdwdbwp1yv58iuyl4zzzr3t8-goldNFT.mp4","tokenType":"NFT","totalSupply":"1000","limit":"1000","traits":{"Tier":"gold"},"name":"Gold OG"}' | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
packages/extension-base/src/koni/api/nft/blobinscription/types.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
// Copyright 2019-2022 @subwallet/extension-koni authors & contributors | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
import { ALC_NFT_RAW_VALUE } from '@subwallet/extension-base/koni/api/nft/blobinscription/consts'; | ||
|
||
export interface NftResponse { | ||
data: { | ||
dataAvailabilities: NftData[] | ||
} | ||
} | ||
|
||
interface NftData { | ||
isJson: boolean, | ||
id: string, | ||
extrinsicHash: string, | ||
dataValue: string, | ||
dataRaw: string, | ||
sender: { | ||
address: string | ||
} | ||
} | ||
|
||
export interface ALC { // need confirm | ||
p: string, | ||
op: string, | ||
tick: string, | ||
imgUrl: string, | ||
name: string, | ||
traits: Record<string, any> | ||
} | ||
|
||
export interface RemarkData { | ||
data: { | ||
remarks: { dataRaw: string }[] | ||
} | ||
} | ||
|
||
export interface transferPayload { | ||
p: string, | ||
op: string, | ||
amount: string, | ||
tick: string, | ||
to: string | ||
} | ||
|
||
export function getNftDetail (nftSlug: string) { | ||
if (nftSlug === 'AVAIL-OG-sqsu5a91qbu0s4oj3ldg8lrf') { // Gold | ||
return JSON.parse(ALC_NFT_RAW_VALUE.GOLD) as ALC; | ||
} | ||
|
||
if (nftSlug === 'AVAIL-OG-zdttjyidincrjgsmwqbxoghz') { // Silver | ||
return JSON.parse(ALC_NFT_RAW_VALUE.SILVER) as ALC; | ||
} | ||
|
||
if (nftSlug === 'AVAIL-OG-zy0n66yqtgw6z139hnf5vdxb') { // Bronze | ||
return JSON.parse(ALC_NFT_RAW_VALUE.BRONZE) as ALC; | ||
} | ||
|
||
return undefined; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters