Merge branch 'master' into wallet-adapter-merge
This commit is contained in:
commit
c6228fea45
|
@ -44,7 +44,7 @@
|
|||
"@types/echarts": "^4.9.0",
|
||||
"@types/react-router-dom": "^5.1.6",
|
||||
"@welldone-software/why-did-you-render": "^6.0.5",
|
||||
"antd": "^4.6.6",
|
||||
"antd": "^4.16.12",
|
||||
"bignumber.js": "^9.0.1",
|
||||
"bn.js": "^5.1.3",
|
||||
"borsh": "^0.4.0",
|
||||
|
|
|
@ -60,6 +60,12 @@ export type MetadataFile = {
|
|||
|
||||
export type FileOrString = MetadataFile | string;
|
||||
|
||||
export type Attribute = {
|
||||
trait_type?: string;
|
||||
display_type?: string;
|
||||
value: string | number;
|
||||
};
|
||||
|
||||
export interface IMetadataExtension {
|
||||
name: string;
|
||||
symbol: string;
|
||||
|
@ -70,6 +76,8 @@ export interface IMetadataExtension {
|
|||
image: string;
|
||||
animation_url?: string;
|
||||
|
||||
attributes?: Attribute[];
|
||||
|
||||
// stores link to item on meta
|
||||
external_url: string;
|
||||
|
||||
|
@ -424,12 +432,17 @@ export const METADATA_SCHEMA = new Map<any, any>([
|
|||
],
|
||||
]);
|
||||
|
||||
const METADATA_REPLACE = new RegExp('\u0000', 'g');
|
||||
|
||||
export const decodeMetadata = (buffer: Buffer): Metadata => {
|
||||
const metadata = deserializeUnchecked(
|
||||
METADATA_SCHEMA,
|
||||
Metadata,
|
||||
buffer,
|
||||
) as Metadata;
|
||||
metadata.data.name = metadata.data.name.replace(METADATA_REPLACE, '');
|
||||
metadata.data.uri = metadata.data.uri.replace(METADATA_REPLACE, '');
|
||||
metadata.data.symbol = metadata.data.symbol.replace(METADATA_REPLACE, '');
|
||||
return metadata;
|
||||
};
|
||||
|
||||
|
|
|
@ -16,7 +16,6 @@ import {
|
|||
import React, { useContext, useEffect, useMemo, useState } from 'react';
|
||||
import { notify } from '../utils/notifications';
|
||||
import { ExplorerLink } from '../components/ExplorerLink';
|
||||
import { setProgramIds, setStoreID } from '../utils/programIds';
|
||||
import {
|
||||
TokenInfo,
|
||||
TokenListProvider,
|
||||
|
@ -87,10 +86,7 @@ const ConnectionContext = React.createContext<ConnectionConfig>({
|
|||
tokenMap: new Map<string, TokenInfo>(),
|
||||
});
|
||||
|
||||
export function ConnectionProvider({
|
||||
storeId = undefined as any,
|
||||
children = undefined as any,
|
||||
}) {
|
||||
export function ConnectionProvider({ children = undefined as any }) {
|
||||
const [endpoint, setEndpoint] = useLocalStorageState(
|
||||
'connectionEndpoint',
|
||||
ENDPOINTS[0].endpoint,
|
||||
|
@ -127,9 +123,6 @@ export function ConnectionProvider({
|
|||
});
|
||||
}, [env]);
|
||||
|
||||
setStoreID(storeId);
|
||||
setProgramIds(env);
|
||||
|
||||
// The websocket library solana/web3.js uses closes its websocket connection when the subscription list
|
||||
// is empty after opening its first time, preventing subsequent subscriptions from receiving responses.
|
||||
// This is a hack to prevent the list from every getting empty
|
||||
|
|
|
@ -4,3 +4,5 @@ export * as Connection from './connection';
|
|||
export * from './connection';
|
||||
export * as Wallet from './wallet';
|
||||
export * from './wallet';
|
||||
export * as Store from './store';
|
||||
export * from './store';
|
||||
|
|
|
@ -0,0 +1,73 @@
|
|||
import React, {
|
||||
createContext,
|
||||
FC,
|
||||
useState,
|
||||
useContext,
|
||||
useEffect,
|
||||
useMemo,
|
||||
} from 'react';
|
||||
import { getStoreID, setProgramIds, StringPublicKey } from '../utils';
|
||||
import { useQuerySearch } from '../hooks';
|
||||
|
||||
interface StoreConfig {
|
||||
// Store Address
|
||||
storeAddress?: StringPublicKey;
|
||||
// Store was configured via ENV or query params
|
||||
isConfigured: boolean;
|
||||
// Initial calculating of store address completed (successfully or not)
|
||||
isReady: boolean;
|
||||
// recalculate store address for specified owner address
|
||||
setStoreForOwner: (ownerAddress?: string) => Promise<string | undefined>;
|
||||
}
|
||||
|
||||
export const StoreContext = createContext<StoreConfig>(null!);
|
||||
|
||||
export const StoreProvider: FC<{
|
||||
ownerAddress?: string;
|
||||
storeAddress?: string;
|
||||
}> = ({ children, ownerAddress, storeAddress }) => {
|
||||
const searchParams = useQuerySearch();
|
||||
const ownerAddressFromQuery = searchParams.get('store');
|
||||
|
||||
const initOwnerAddress = ownerAddressFromQuery || ownerAddress;
|
||||
const initStoreAddress = !ownerAddressFromQuery ? storeAddress : undefined;
|
||||
const isConfigured = Boolean(initStoreAddress || initOwnerAddress);
|
||||
|
||||
const [store, setStore] = useState<
|
||||
Pick<StoreConfig, 'storeAddress' | 'isReady'>
|
||||
>({
|
||||
storeAddress: initStoreAddress,
|
||||
isReady: Boolean(!initOwnerAddress || initStoreAddress),
|
||||
});
|
||||
|
||||
const setStoreForOwner = useMemo(
|
||||
() => async (ownerAddress?: string) => {
|
||||
const storeAddress = await getStoreID(ownerAddress);
|
||||
setProgramIds(storeAddress); // fallback
|
||||
setStore({ storeAddress, isReady: true });
|
||||
console.log(`CUSTOM STORE: ${storeAddress}`);
|
||||
return storeAddress;
|
||||
},
|
||||
[],
|
||||
);
|
||||
|
||||
useEffect(() => {
|
||||
console.log(`STORE_OWNER_ADDRESS: ${initOwnerAddress}`);
|
||||
if (initOwnerAddress && !initStoreAddress) {
|
||||
setStoreForOwner(initOwnerAddress);
|
||||
} else {
|
||||
setProgramIds(initStoreAddress); // fallback
|
||||
console.log(`CUSTOM STORE FROM ENV: ${initStoreAddress}`);
|
||||
}
|
||||
}, [initOwnerAddress]);
|
||||
|
||||
return (
|
||||
<StoreContext.Provider value={{ ...store, setStoreForOwner, isConfigured }}>
|
||||
{children}
|
||||
</StoreContext.Provider>
|
||||
);
|
||||
};
|
||||
|
||||
export const useStore = () => {
|
||||
return useContext(StoreContext);
|
||||
};
|
|
@ -2,3 +2,4 @@ export * from './useUserAccounts';
|
|||
export * from './useAccountByMint';
|
||||
export * from './useTokenName';
|
||||
export * from './useThatState';
|
||||
export * from './useQuerySearch';
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import { useLocation } from 'react-router-dom';
|
||||
|
||||
export function useQuerySearch() {
|
||||
return new URLSearchParams(useLocation().search);
|
||||
}
|
|
@ -14,76 +14,26 @@ import {
|
|||
toPublicKey,
|
||||
} from './ids';
|
||||
|
||||
export const ENABLE_FEES_INPUT = false;
|
||||
|
||||
// legacy pools are used to show users contributions in those pools to allow for withdrawals of funds
|
||||
export const PROGRAM_IDS = [
|
||||
{
|
||||
name: 'mainnet-beta',
|
||||
},
|
||||
{
|
||||
name: 'testnet',
|
||||
},
|
||||
|
||||
{
|
||||
name: 'devnet',
|
||||
},
|
||||
{
|
||||
name: 'localnet',
|
||||
},
|
||||
];
|
||||
|
||||
let STORE_OWNER_ADDRESS: PublicKey | undefined;
|
||||
|
||||
export const setStoreID = (storeId: any) => {
|
||||
STORE_OWNER_ADDRESS = storeId
|
||||
? new PublicKey(`${storeId}`)
|
||||
: // DEFAULT STORE FRONT OWNER FOR METAPLEX
|
||||
undefined;
|
||||
};
|
||||
|
||||
const getStoreID = async () => {
|
||||
if (!STORE_OWNER_ADDRESS) {
|
||||
export const getStoreID = async (storeOwnerAddress?: string) => {
|
||||
if (!storeOwnerAddress) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
let urlStoreId: PublicKey | null = null;
|
||||
try {
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const text = urlParams.get('store');
|
||||
if (text) {
|
||||
urlStoreId = new PublicKey(text);
|
||||
}
|
||||
} catch {
|
||||
// ignore
|
||||
}
|
||||
|
||||
const storeOwnerAddress = urlStoreId || STORE_OWNER_ADDRESS;
|
||||
console.log(`STORE_OWNER_ADDRESS: ${storeOwnerAddress?.toBase58()}`);
|
||||
const programs = await findProgramAddress(
|
||||
[
|
||||
Buffer.from('metaplex'),
|
||||
toPublicKey(METAPLEX_ID).toBuffer(),
|
||||
storeOwnerAddress.toBuffer(),
|
||||
toPublicKey(storeOwnerAddress).toBuffer(),
|
||||
],
|
||||
toPublicKey(METAPLEX_ID),
|
||||
);
|
||||
const CUSTOM = programs[0];
|
||||
console.log(`CUSTOM STORE: ${CUSTOM}`);
|
||||
const storeAddress = programs[0];
|
||||
|
||||
return CUSTOM;
|
||||
return storeAddress;
|
||||
};
|
||||
|
||||
export const setProgramIds = async (envName: string) => {
|
||||
let instance = PROGRAM_IDS.find(env => envName.indexOf(env.name) >= 0);
|
||||
if (!instance) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (!STORE) {
|
||||
const potential_store = await getStoreID();
|
||||
STORE = potential_store ? toPublicKey(potential_store) : undefined;
|
||||
}
|
||||
export const setProgramIds = async (store?: string) => {
|
||||
STORE = store ? toPublicKey(store) : undefined;
|
||||
};
|
||||
|
||||
let STORE: PublicKey | undefined;
|
||||
|
|
|
@ -1,2 +1,3 @@
|
|||
REACT_APP_STORE_OWNER_ADDRESS_ADDRESS=
|
||||
REACT_APP_STORE_ADDRESS=
|
||||
REACT_APP_BIG_STORE=FALSE
|
||||
|
|
|
@ -28,9 +28,12 @@ module.exports = withPlugins(plugins, {
|
|||
ignoreDuringBuilds: true,
|
||||
},
|
||||
env: {
|
||||
NEXT_PUBLIC_STORE_OWNER_ADDRESS_ADDRESS:
|
||||
NEXT_PUBLIC_STORE_OWNER_ADDRESS:
|
||||
process.env.STORE_OWNER_ADDRESS ||
|
||||
process.env.REACT_APP_STORE_OWNER_ADDRESS_ADDRESS,
|
||||
NEXT_PUBLIC_STORE_ADDRESS: process.env.STORE_ADDRESS,
|
||||
NEXT_PUBLIC_BIG_STORE: process.env.REACT_APP_BIG_STORE,
|
||||
NEXT_PUBLIC_CLIENT_ID: process.env.REACT_APP_CLIENT_ID,
|
||||
},
|
||||
async rewrites() {
|
||||
return [
|
||||
|
|
|
@ -5,6 +5,7 @@
|
|||
"@ant-design/icons": "^4.4.0",
|
||||
"@babel/preset-typescript": "^7.12.13",
|
||||
"@cloudflare/stream-react": "^1.1.0",
|
||||
"@google/model-viewer": "^1.7.2",
|
||||
"@oyster/common": "0.0.2",
|
||||
"@project-serum/serum": "^0.13.52",
|
||||
"@solana/spl-name-service": "0.1.3",
|
||||
|
|
|
@ -1,32 +0,0 @@
|
|||
# Draco 3D Data Compression
|
||||
|
||||
Draco is an open-source library for compressing and decompressing 3D geometric meshes and point clouds. It is intended to improve the storage and transmission of 3D graphics.
|
||||
|
||||
[Website](https://google.github.io/draco/) | [GitHub](https://github.com/google/draco)
|
||||
|
||||
## Contents
|
||||
|
||||
This folder contains three utilities:
|
||||
|
||||
* `draco_decoder.js` — Emscripten-compiled decoder, compatible with any modern browser.
|
||||
* `draco_decoder.wasm` — WebAssembly decoder, compatible with newer browsers and devices.
|
||||
* `draco_wasm_wrapper.js` — JavaScript wrapper for the WASM decoder.
|
||||
|
||||
Each file is provided in two variations:
|
||||
|
||||
* **Default:** Latest stable builds, tracking the project's [master branch](https://github.com/google/draco).
|
||||
* **glTF:** Builds targeted by the [glTF mesh compression extension](https://github.com/KhronosGroup/glTF/tree/master/extensions/2.0/Khronos/KHR_draco_mesh_compression), tracking the [corresponding Draco branch](https://github.com/google/draco/tree/gltf_2.0_draco_extension).
|
||||
|
||||
Either variation may be used with `THREE.DRACOLoader`:
|
||||
|
||||
```js
|
||||
var dracoLoader = new THREE.DRACOLoader();
|
||||
dracoLoader.setDecoderPath('path/to/decoders/');
|
||||
dracoLoader.setDecoderConfig({type: 'js'}); // (Optional) Override detection of WASM support.
|
||||
```
|
||||
|
||||
Further [documentation on GitHub](https://github.com/google/draco/tree/master/javascript/example#static-loading-javascript-decoder).
|
||||
|
||||
## License
|
||||
|
||||
[Apache License 2.0](https://github.com/google/draco/blob/master/LICENSE)
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -1,104 +0,0 @@
|
|||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(f){var m=0;return function(){return m<f.length?{done:!1,value:f[m++]}:{done:!0}}};$jscomp.arrayIterator=function(f){return{next:$jscomp.arrayIteratorImpl(f)}};$jscomp.makeIterator=function(f){var m="undefined"!=typeof Symbol&&Symbol.iterator&&f[Symbol.iterator];return m?m.call(f):$jscomp.arrayIterator(f)};
|
||||
$jscomp.getGlobal=function(f){return"undefined"!=typeof window&&window===f?f:"undefined"!=typeof global&&null!=global?global:f};$jscomp.global=$jscomp.getGlobal(this);$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(f,m,v){f!=Array.prototype&&f!=Object.prototype&&(f[m]=v.value)};
|
||||
$jscomp.polyfill=function(f,m,v,t){if(m){v=$jscomp.global;f=f.split(".");for(t=0;t<f.length-1;t++){var h=f[t];h in v||(v[h]={});v=v[h]}f=f[f.length-1];t=v[f];m=m(t);m!=t&&null!=m&&$jscomp.defineProperty(v,f,{configurable:!0,writable:!0,value:m})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
|
||||
$jscomp.polyfill("Promise",function(f){function m(){this.batch_=null}function v(e){return e instanceof h?e:new h(function(l,f){l(e)})}if(f&&!$jscomp.FORCE_POLYFILL_PROMISE)return f;m.prototype.asyncExecute=function(e){if(null==this.batch_){this.batch_=[];var l=this;this.asyncExecuteFunction(function(){l.executeBatch_()})}this.batch_.push(e)};var t=$jscomp.global.setTimeout;m.prototype.asyncExecuteFunction=function(e){t(e,0)};m.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var e=
|
||||
this.batch_;this.batch_=[];for(var l=0;l<e.length;++l){var f=e[l];e[l]=null;try{f()}catch(z){this.asyncThrow_(z)}}}this.batch_=null};m.prototype.asyncThrow_=function(e){this.asyncExecuteFunction(function(){throw e;})};var h=function(e){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var l=this.createResolveAndReject_();try{e(l.resolve,l.reject)}catch(S){l.reject(S)}};h.prototype.createResolveAndReject_=function(){function e(e){return function(h){f||(f=!0,e.call(l,h))}}var l=this,f=!1;
|
||||
return{resolve:e(this.resolveTo_),reject:e(this.reject_)}};h.prototype.resolveTo_=function(e){if(e===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof h)this.settleSameAsPromise_(e);else{a:switch(typeof e){case "object":var l=null!=e;break a;case "function":l=!0;break a;default:l=!1}l?this.resolveToNonPromiseObj_(e):this.fulfill_(e)}};h.prototype.resolveToNonPromiseObj_=function(e){var l=void 0;try{l=e.then}catch(S){this.reject_(S);return}"function"==typeof l?
|
||||
this.settleSameAsThenable_(l,e):this.fulfill_(e)};h.prototype.reject_=function(e){this.settle_(2,e)};h.prototype.fulfill_=function(e){this.settle_(1,e)};h.prototype.settle_=function(e,l){if(0!=this.state_)throw Error("Cannot settle("+e+", "+l+"): Promise already settled in state"+this.state_);this.state_=e;this.result_=l;this.executeOnSettledCallbacks_()};h.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var e=0;e<this.onSettledCallbacks_.length;++e)X.asyncExecute(this.onSettledCallbacks_[e]);
|
||||
this.onSettledCallbacks_=null}};var X=new m;h.prototype.settleSameAsPromise_=function(e){var l=this.createResolveAndReject_();e.callWhenSettled_(l.resolve,l.reject)};h.prototype.settleSameAsThenable_=function(e,l){var f=this.createResolveAndReject_();try{e.call(l,f.resolve,f.reject)}catch(z){f.reject(z)}};h.prototype.then=function(e,f){function l(e,f){return"function"==typeof e?function(f){try{m(e(f))}catch(p){v(p)}}:f}var m,v,t=new h(function(e,f){m=e;v=f});this.callWhenSettled_(l(e,m),l(f,v));return t};
|
||||
h.prototype.catch=function(e){return this.then(void 0,e)};h.prototype.callWhenSettled_=function(e,f){function l(){switch(h.state_){case 1:e(h.result_);break;case 2:f(h.result_);break;default:throw Error("Unexpected state: "+h.state_);}}var h=this;null==this.onSettledCallbacks_?X.asyncExecute(l):this.onSettledCallbacks_.push(l)};h.resolve=v;h.reject=function(e){return new h(function(f,h){h(e)})};h.race=function(e){return new h(function(f,h){for(var l=$jscomp.makeIterator(e),m=l.next();!m.done;m=l.next())v(m.value).callWhenSettled_(f,
|
||||
h)})};h.all=function(e){var f=$jscomp.makeIterator(e),m=f.next();return m.done?v([]):new h(function(e,h){function l(f){return function(h){t[f]=h;z--;0==z&&e(t)}}var t=[],z=0;do t.push(void 0),z++,v(m.value).callWhenSettled_(l(t.length-1),h),m=f.next();while(!m.done)})};return h},"es6","es3");
|
||||
var DracoDecoderModule=function(){var f="undefined"!==typeof document&&document.currentScript?document.currentScript.src:void 0;"undefined"!==typeof __filename&&(f=f||__filename);return function(m){function v(k){return a.locateFile?a.locateFile(k,M):M+k}function t(a,c){a||z("Assertion failed: "+c)}function h(a,c,b){var d=c+b;for(b=c;a[b]&&!(b>=d);)++b;if(16<b-c&&a.subarray&&xa)return xa.decode(a.subarray(c,b));for(d="";c<b;){var k=a[c++];if(k&128){var e=a[c++]&63;if(192==(k&224))d+=String.fromCharCode((k&
|
||||
31)<<6|e);else{var f=a[c++]&63;k=224==(k&240)?(k&15)<<12|e<<6|f:(k&7)<<18|e<<12|f<<6|a[c++]&63;65536>k?d+=String.fromCharCode(k):(k-=65536,d+=String.fromCharCode(55296|k>>10,56320|k&1023))}}else d+=String.fromCharCode(k)}return d}function X(a,c){return a?h(ca,a,c):""}function e(a,c){0<a%c&&(a+=c-a%c);return a}function l(k){ka=k;a.HEAP8=T=new Int8Array(k);a.HEAP16=new Int16Array(k);a.HEAP32=P=new Int32Array(k);a.HEAPU8=ca=new Uint8Array(k);a.HEAPU16=new Uint16Array(k);a.HEAPU32=new Uint32Array(k);
|
||||
a.HEAPF32=new Float32Array(k);a.HEAPF64=new Float64Array(k)}function S(k){for(;0<k.length;){var c=k.shift();if("function"==typeof c)c();else{var b=c.func;"number"===typeof b?void 0===c.arg?a.dynCall_v(b):a.dynCall_vi(b,c.arg):b(void 0===c.arg?null:c.arg)}}}function z(k){if(a.onAbort)a.onAbort(k);k+="";ya(k);Y(k);za=!0;throw new WebAssembly.RuntimeError("abort("+k+"). Build with -s ASSERTIONS=1 for more info.");}function va(a){return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):
|
||||
0===a.indexOf("data:application/octet-stream;base64,")}function wa(){try{if(da)return new Uint8Array(da);if(la)return la(U);throw"both async and sync fetching of the wasm failed";}catch(k){z(k)}}function Ma(){return da||!ea&&!Z||"function"!==typeof fetch?new Promise(function(a,c){a(wa())}):fetch(U,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+U+"'";return a.arrayBuffer()}).catch(function(){return wa()})}function ba(){if(!ba.strings){var a={USER:"web_user",
|
||||
LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:na},c;for(c in Aa)a[c]=Aa[c];var b=[];for(c in a)b.push(c+"="+a[c]);ba.strings=b}return ba.strings}function ma(k){function c(){if(!fa&&(fa=!0,!za)){Ba=!0;S(Ca);S(Da);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ea.unshift(a.postRun.shift());
|
||||
S(Ea)}}if(!(0<aa)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Fa.unshift(a.preRun.shift());S(Fa);0<aa||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);c()},1)):c())}}function p(){}function u(a){return(a||p).__cache__}function N(a,c){var b=u(c),d=b[a];if(d)return d;d=Object.create((c||p).prototype);d.ptr=a;return b[a]=d}function V(a){if("string"===typeof a){for(var c=0,b=0;b<a.length;++b){var d=a.charCodeAt(b);
|
||||
55296<=d&&57343>=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++b)&1023);127>=d?++c:c=2047>=d?c+2:65535>=d?c+3:c+4}c=Array(c+1);b=0;d=c.length;if(0<d){d=b+d-1;for(var k=0;k<a.length;++k){var e=a.charCodeAt(k);if(55296<=e&&57343>=e){var f=a.charCodeAt(++k);e=65536+((e&1023)<<10)|f&1023}if(127>=e){if(b>=d)break;c[b++]=e}else{if(2047>=e){if(b+1>=d)break;c[b++]=192|e>>6}else{if(65535>=e){if(b+2>=d)break;c[b++]=224|e>>12}else{if(b+3>=d)break;c[b++]=240|e>>18;c[b++]=128|e>>12&63}c[b++]=128|e>>6&63}c[b++]=128|
|
||||
e&63}}c[b]=0}a=n.alloc(c,T);n.copy(c,T,a)}return a}function x(){throw"cannot construct a Status, no constructor in IDL";}function A(){this.ptr=Oa();u(A)[this.ptr]=this}function B(){this.ptr=Pa();u(B)[this.ptr]=this}function C(){this.ptr=Qa();u(C)[this.ptr]=this}function D(){this.ptr=Ra();u(D)[this.ptr]=this}function E(){this.ptr=Sa();u(E)[this.ptr]=this}function q(){this.ptr=Ta();u(q)[this.ptr]=this}function J(){this.ptr=Ua();u(J)[this.ptr]=this}function w(){this.ptr=Va();u(w)[this.ptr]=this}function F(){this.ptr=
|
||||
Wa();u(F)[this.ptr]=this}function r(){this.ptr=Xa();u(r)[this.ptr]=this}function G(){this.ptr=Ya();u(G)[this.ptr]=this}function H(){this.ptr=Za();u(H)[this.ptr]=this}function O(){this.ptr=$a();u(O)[this.ptr]=this}function K(){this.ptr=ab();u(K)[this.ptr]=this}function g(){this.ptr=bb();u(g)[this.ptr]=this}function y(){this.ptr=cb();u(y)[this.ptr]=this}function Q(){throw"cannot construct a VoidPtr, no constructor in IDL";}function I(){this.ptr=db();u(I)[this.ptr]=this}function L(){this.ptr=eb();u(L)[this.ptr]=
|
||||
this}m=m||{};var a="undefined"!==typeof m?m:{},Ga=!1,Ha=!1;a.onRuntimeInitialized=function(){Ga=!0;if(Ha&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ha=!0;if(Ga&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3<a.length?!1:1==a[0]&&0<=a[1]&&3>=a[1]?!0:0!=a[0]||10<a[1]?!1:!0};var ha={},W;for(W in a)a.hasOwnProperty(W)&&(ha[W]=a[W]);var na="./this.program",
|
||||
ea=!1,Z=!1,oa=!1,fb=!1,Ia=!1;ea="object"===typeof window;Z="function"===typeof importScripts;oa=(fb="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)&&!ea&&!Z;Ia=!ea&&!oa&&!Z;var M="",pa,qa;if(oa){M=__dirname+"/";var ra=function(a,c){pa||(pa=require("fs"));qa||(qa=require("path"));a=qa.normalize(a);return pa.readFileSync(a,c?null:"utf8")};var la=function(a){a=ra(a,!0);a.buffer||(a=new Uint8Array(a));t(a.buffer);return a};1<process.argv.length&&
|
||||
(na=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);process.on("uncaughtException",function(a){throw a;});process.on("unhandledRejection",z);a.inspect=function(){return"[Emscripten Module object]"}}else if(Ia)"undefined"!=typeof read&&(ra=function(a){return read(a)}),la=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");t("object"===typeof a);return a},"undefined"!==typeof print&&("undefined"===typeof console&&(console={}),console.log=print,
|
||||
console.warn=console.error="undefined"!==typeof printErr?printErr:print);else if(ea||Z)Z?M=self.location.href:document.currentScript&&(M=document.currentScript.src),f&&(M=f),M=0!==M.indexOf("blob:")?M.substr(0,M.lastIndexOf("/")+1):"",ra=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);return c.responseText},Z&&(la=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)});var ya=a.print||console.log.bind(console),
|
||||
Y=a.printErr||console.warn.bind(console);for(W in ha)ha.hasOwnProperty(W)&&(a[W]=ha[W]);ha=null;a.thisProgram&&(na=a.thisProgram);var da;a.wasmBinary&&(da=a.wasmBinary);"object"!==typeof WebAssembly&&Y("no native wasm support detected");var ia,gb=new WebAssembly.Table({initial:381,maximum:381,element:"anyfunc"}),za=!1,xa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");var T,ca,P,Ja=a.TOTAL_MEMORY||16777216;if(ia=a.wasmMemory?
|
||||
a.wasmMemory:new WebAssembly.Memory({initial:Ja/65536}))var ka=ia.buffer;Ja=ka.byteLength;l(ka);P[4604]=5261456;var Fa=[],Ca=[],Da=[],Ea=[],Ba=!1,aa=0,sa=null,ja=null;a.preloadedImages={};a.preloadedAudios={};var U="draco_decoder.wasm";va(U)||(U=v(U));Ca.push({func:function(){hb()}});var Aa={},R={buffers:[null,[],[]],printChar:function(a,c){var b=R.buffers[a];0===c||10===c?((1===a?ya:Y)(h(b,0)),b.length=0):b.push(c)},varargs:0,get:function(a){R.varargs+=4;return P[R.varargs-4>>2]},getStr:function(){return X(R.get())},
|
||||
get64:function(){var a=R.get();R.get();return a},getZero:function(){R.get()}},Ka={__cxa_allocate_exception:function(a){return ib(a)},__cxa_throw:function(a,c,b){"uncaught_exception"in ta?ta.uncaught_exceptions++:ta.uncaught_exceptions=1;throw a;},abort:function(){z()},emscripten_get_sbrk_ptr:function(){return 18416},emscripten_memcpy_big:function(a,c,b){ca.set(ca.subarray(c,c+b),a)},emscripten_resize_heap:function(a){if(2147418112<a)return!1;for(var c=Math.max(T.length,16777216);c<a;)c=536870912>=
|
||||
c?e(2*c,65536):Math.min(e((3*c+2147483648)/4,65536),2147418112);a:{try{ia.grow(c-ka.byteLength+65535>>16);l(ia.buffer);var b=1;break a}catch(d){}b=void 0}return b?!0:!1},environ_get:function(a,c){var b=0;ba().forEach(function(d,e){var f=c+b;e=P[a+4*e>>2]=f;for(f=0;f<d.length;++f)T[e++>>0]=d.charCodeAt(f);T[e>>0]=0;b+=d.length+1});return 0},environ_sizes_get:function(a,c){var b=ba();P[a>>2]=b.length;var d=0;b.forEach(function(a){d+=a.length+1});P[c>>2]=d;return 0},fd_close:function(a){return 0},fd_seek:function(a,
|
||||
c,b,d,e){return 0},fd_write:function(a,c,b,d){try{for(var e=0,f=0;f<b;f++){for(var g=P[c+8*f>>2],k=P[c+(8*f+4)>>2],h=0;h<k;h++)R.printChar(a,ca[g+h]);e+=k}P[d>>2]=e;return 0}catch(ua){return"undefined"!==typeof FS&&ua instanceof FS.ErrnoError||z(ua),ua.errno}},memory:ia,setTempRet0:function(a){},table:gb},La=function(){function e(c,b){a.asm=c.exports;aa--;a.monitorRunDependencies&&a.monitorRunDependencies(aa);0==aa&&(null!==sa&&(clearInterval(sa),sa=null),ja&&(c=ja,ja=null,c()))}function c(a){e(a.instance)}
|
||||
function b(a){return Ma().then(function(a){return WebAssembly.instantiate(a,d)}).then(a,function(a){Y("failed to asynchronously prepare wasm: "+a);z(a)})}var d={env:Ka,wasi_unstable:Ka};aa++;a.monitorRunDependencies&&a.monitorRunDependencies(aa);if(a.instantiateWasm)try{return a.instantiateWasm(d,e)}catch(Na){return Y("Module.instantiateWasm callback failed with error: "+Na),!1}(function(){if(da||"function"!==typeof WebAssembly.instantiateStreaming||va(U)||"function"!==typeof fetch)return b(c);fetch(U,
|
||||
{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,d).then(c,function(a){Y("wasm streaming compile failed: "+a);Y("falling back to ArrayBuffer instantiation");b(c)})})})();return{}}();a.asm=La;var hb=a.___wasm_call_ctors=function(){return a.asm.__wasm_call_ctors.apply(null,arguments)},jb=a._emscripten_bind_Status_code_0=function(){return a.asm.emscripten_bind_Status_code_0.apply(null,arguments)},kb=a._emscripten_bind_Status_ok_0=function(){return a.asm.emscripten_bind_Status_ok_0.apply(null,
|
||||
arguments)},lb=a._emscripten_bind_Status_error_msg_0=function(){return a.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},mb=a._emscripten_bind_Status___destroy___0=function(){return a.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Oa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},nb=a._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null,
|
||||
arguments)},ob=a._emscripten_bind_DracoUInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},pb=a._emscripten_bind_DracoUInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Pa=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},qb=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null,
|
||||
arguments)},rb=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},sb=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Qa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},tb=a._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null,
|
||||
arguments)},ub=a._emscripten_bind_DracoUInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},vb=a._emscripten_bind_DracoUInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Ra=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},wb=a._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null,
|
||||
arguments)},xb=a._emscripten_bind_DracoUInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},yb=a._emscripten_bind_DracoUInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},Sa=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},zb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=
|
||||
function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ab=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},Bb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Ta=a._emscripten_bind_PointAttribute_PointAttribute_0=
|
||||
function(){return a.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Cb=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Db=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Eb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null,
|
||||
arguments)},Fb=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},Gb=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Hb=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Ib=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null,
|
||||
arguments)},Jb=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},Kb=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},Lb=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},Ua=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0=
|
||||
function(){return a.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},Mb=a._emscripten_bind_AttributeTransformData_transform_type_0=function(){return a.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},Nb=a._emscripten_bind_AttributeTransformData___destroy___0=function(){return a.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},Va=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=
|
||||
function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},Ob=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},Pb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)},
|
||||
Qb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},Rb=a._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},Sb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},
|
||||
Wa=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return a.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},Tb=a._emscripten_bind_DracoInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},Ub=a._emscripten_bind_DracoInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Vb=a._emscripten_bind_DracoInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null,
|
||||
arguments)},Xa=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Wb=a._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},Xb=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Yb=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=
|
||||
function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},Zb=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},$b=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},ac=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null,
|
||||
arguments)},bc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},cc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Ya=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return a.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt16Array_GetValue_1=
|
||||
function(){return a.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ec=a._emscripten_bind_DracoInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},fc=a._emscripten_bind_DracoInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Za=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null,
|
||||
arguments)},gc=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},hc=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},ic=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},$a=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,
|
||||
arguments)},jc=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ab=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return a.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},kc=a._emscripten_bind_DecoderBuffer_Init_2=function(){return a.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},lc=a._emscripten_bind_DecoderBuffer___destroy___0=function(){return a.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null,
|
||||
arguments)},bb=a._emscripten_bind_Decoder_Decoder_0=function(){return a.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},mc=a._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return a.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},nc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},oc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null,
|
||||
arguments)},pc=a._emscripten_bind_Decoder_GetAttributeId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},sc=a._emscripten_bind_Decoder_GetAttribute_2=
|
||||
function(){return a.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},uc=a._emscripten_bind_Decoder_GetMetadata_1=function(){return a.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null,
|
||||
arguments)},wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return a.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=
|
||||
function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},Ac=a._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null,
|
||||
arguments)},Dc=a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)},
|
||||
Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},Jc=
|
||||
a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return a.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return a.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},Lc=a._emscripten_bind_Decoder___destroy___0=function(){return a.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},cb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm.emscripten_bind_Mesh_Mesh_0.apply(null,
|
||||
arguments)},Mc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},Nc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},Oc=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Pc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)},
|
||||
Qc=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},db=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Rc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Sc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoInt32Array_size_0.apply(null,
|
||||
arguments)},Tc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},eb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},Uc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Vc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm.emscripten_enum_draco_StatusCode_OK.apply(null,
|
||||
arguments)},Wc=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Xc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=
|
||||
function(){return a.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},ad=a._emscripten_enum_draco_DataType_DT_INVALID=function(){return a.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},bd=a._emscripten_enum_draco_DataType_DT_INT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null,
|
||||
arguments)},cd=a._emscripten_enum_draco_DataType_DT_UINT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},dd=a._emscripten_enum_draco_DataType_DT_INT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},ed=a._emscripten_enum_draco_DataType_DT_UINT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},fd=a._emscripten_enum_draco_DataType_DT_INT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null,
|
||||
arguments)},gd=a._emscripten_enum_draco_DataType_DT_UINT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},hd=a._emscripten_enum_draco_DataType_DT_INT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},id=a._emscripten_enum_draco_DataType_DT_UINT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},jd=a._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null,
|
||||
arguments)},kd=a._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},ld=a._emscripten_enum_draco_DataType_DT_BOOL=function(){return a.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},md=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return a.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},nd=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,
|
||||
arguments)},od=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},pd=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,
|
||||
arguments)},rd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},sd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},td=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,
|
||||
arguments)},ud=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},vd=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},wd=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},xd=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=
|
||||
function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},yd=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},zd=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};a._setThrew=function(){return a.asm.setThrew.apply(null,arguments)};var ta=a.__ZSt18uncaught_exceptionv=
|
||||
function(){return a.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};a._free=function(){return a.asm.free.apply(null,arguments)};var ib=a._malloc=function(){return a.asm.malloc.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.__growWasmMemory=function(){return a.asm.__growWasmMemory.apply(null,arguments)};
|
||||
a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)};
|
||||
a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_iidiiii=function(){return a.asm.dynCall_iidiiii.apply(null,arguments)};a.dynCall_jiji=function(){return a.asm.dynCall_jiji.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.asm=La;var fa;a.then=function(e){if(fa)e(a);
|
||||
else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();e(a)}}return a};ja=function c(){fa||ma();fa||(ja=c)};a.run=ma;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ma();p.prototype=Object.create(p.prototype);p.prototype.constructor=p;p.prototype.__class__=p;p.__cache__={};a.WrapperObject=p;a.getCache=u;a.wrapPointer=N;a.castObject=function(a,b){return N(a.ptr,b)};a.NULL=N(0);a.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";
|
||||
a.__destroy__();delete u(a.__class__)[a.ptr]};a.compare=function(a,b){return a.ptr===b.ptr};a.getPointer=function(a){return a.ptr};a.getClass=function(a){return a.__class__};var n={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(n.needed){for(var c=0;c<n.temps.length;c++)a._free(n.temps[c]);n.temps.length=0;a._free(n.buffer);n.buffer=0;n.size+=n.needed;n.needed=0}n.buffer||(n.size+=128,n.buffer=a._malloc(n.size),t(n.buffer));n.pos=0},alloc:function(c,b){t(n.buffer);c=c.length*b.BYTES_PER_ELEMENT;
|
||||
c=c+7&-8;n.pos+c>=n.size?(t(0<c),n.needed+=c,b=a._malloc(c),n.temps.push(b)):(b=n.buffer+n.pos,n.pos+=c);return b},copy:function(a,b,d){switch(b.BYTES_PER_ELEMENT){case 2:d>>=1;break;case 4:d>>=2;break;case 8:d>>=3}for(var c=0;c<a.length;c++)b[d+c]=a[c]}};x.prototype=Object.create(p.prototype);x.prototype.constructor=x;x.prototype.__class__=x;x.__cache__={};a.Status=x;x.prototype.code=x.prototype.code=function(){return jb(this.ptr)};x.prototype.ok=x.prototype.ok=function(){return!!kb(this.ptr)};x.prototype.error_msg=
|
||||
x.prototype.error_msg=function(){return X(lb(this.ptr))};x.prototype.__destroy__=x.prototype.__destroy__=function(){mb(this.ptr)};A.prototype=Object.create(p.prototype);A.prototype.constructor=A;A.prototype.__class__=A;A.__cache__={};a.DracoUInt16Array=A;A.prototype.GetValue=A.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return nb(c,a)};A.prototype.size=A.prototype.size=function(){return ob(this.ptr)};A.prototype.__destroy__=A.prototype.__destroy__=function(){pb(this.ptr)};
|
||||
B.prototype=Object.create(p.prototype);B.prototype.constructor=B;B.prototype.__class__=B;B.__cache__={};a.PointCloud=B;B.prototype.num_attributes=B.prototype.num_attributes=function(){return qb(this.ptr)};B.prototype.num_points=B.prototype.num_points=function(){return rb(this.ptr)};B.prototype.__destroy__=B.prototype.__destroy__=function(){sb(this.ptr)};C.prototype=Object.create(p.prototype);C.prototype.constructor=C;C.prototype.__class__=C;C.__cache__={};a.DracoUInt8Array=C;C.prototype.GetValue=
|
||||
C.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return tb(c,a)};C.prototype.size=C.prototype.size=function(){return ub(this.ptr)};C.prototype.__destroy__=C.prototype.__destroy__=function(){vb(this.ptr)};D.prototype=Object.create(p.prototype);D.prototype.constructor=D;D.prototype.__class__=D;D.__cache__={};a.DracoUInt32Array=D;D.prototype.GetValue=D.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return wb(c,a)};D.prototype.size=D.prototype.size=
|
||||
function(){return xb(this.ptr)};D.prototype.__destroy__=D.prototype.__destroy__=function(){yb(this.ptr)};E.prototype=Object.create(p.prototype);E.prototype.constructor=E;E.prototype.__class__=E;E.__cache__={};a.AttributeOctahedronTransform=E;E.prototype.InitFromAttribute=E.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!zb(c,a)};E.prototype.quantization_bits=E.prototype.quantization_bits=function(){return Ab(this.ptr)};E.prototype.__destroy__=E.prototype.__destroy__=
|
||||
function(){Bb(this.ptr)};q.prototype=Object.create(p.prototype);q.prototype.constructor=q;q.prototype.__class__=q;q.__cache__={};a.PointAttribute=q;q.prototype.size=q.prototype.size=function(){return Cb(this.ptr)};q.prototype.GetAttributeTransformData=q.prototype.GetAttributeTransformData=function(){return N(Db(this.ptr),J)};q.prototype.attribute_type=q.prototype.attribute_type=function(){return Eb(this.ptr)};q.prototype.data_type=q.prototype.data_type=function(){return Fb(this.ptr)};q.prototype.num_components=
|
||||
q.prototype.num_components=function(){return Gb(this.ptr)};q.prototype.normalized=q.prototype.normalized=function(){return!!Hb(this.ptr)};q.prototype.byte_stride=q.prototype.byte_stride=function(){return Ib(this.ptr)};q.prototype.byte_offset=q.prototype.byte_offset=function(){return Jb(this.ptr)};q.prototype.unique_id=q.prototype.unique_id=function(){return Kb(this.ptr)};q.prototype.__destroy__=q.prototype.__destroy__=function(){Lb(this.ptr)};J.prototype=Object.create(p.prototype);J.prototype.constructor=
|
||||
J;J.prototype.__class__=J;J.__cache__={};a.AttributeTransformData=J;J.prototype.transform_type=J.prototype.transform_type=function(){return Mb(this.ptr)};J.prototype.__destroy__=J.prototype.__destroy__=function(){Nb(this.ptr)};w.prototype=Object.create(p.prototype);w.prototype.constructor=w;w.prototype.__class__=w;w.__cache__={};a.AttributeQuantizationTransform=w;w.prototype.InitFromAttribute=w.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!Ob(c,a)};
|
||||
w.prototype.quantization_bits=w.prototype.quantization_bits=function(){return Pb(this.ptr)};w.prototype.min_value=w.prototype.min_value=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Qb(c,a)};w.prototype.range=w.prototype.range=function(){return Rb(this.ptr)};w.prototype.__destroy__=w.prototype.__destroy__=function(){Sb(this.ptr)};F.prototype=Object.create(p.prototype);F.prototype.constructor=F;F.prototype.__class__=F;F.__cache__={};a.DracoInt8Array=F;F.prototype.GetValue=F.prototype.GetValue=
|
||||
function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Tb(c,a)};F.prototype.size=F.prototype.size=function(){return Ub(this.ptr)};F.prototype.__destroy__=F.prototype.__destroy__=function(){Vb(this.ptr)};r.prototype=Object.create(p.prototype);r.prototype.constructor=r;r.prototype.__class__=r;r.__cache__={};a.MetadataQuerier=r;r.prototype.HasEntry=r.prototype.HasEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return!!Wb(c,
|
||||
a,b)};r.prototype.GetIntEntry=r.prototype.GetIntEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return Xb(c,a,b)};r.prototype.GetIntEntryArray=r.prototype.GetIntEntryArray=function(a,b,d){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);d&&"object"===typeof d&&(d=d.ptr);Yb(c,a,b,d)};r.prototype.GetDoubleEntry=r.prototype.GetDoubleEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===
|
||||
typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return Zb(c,a,b)};r.prototype.GetStringEntry=r.prototype.GetStringEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return X($b(c,a,b))};r.prototype.NumEntries=r.prototype.NumEntries=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return ac(c,a)};r.prototype.GetEntryName=r.prototype.GetEntryName=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===
|
||||
typeof b&&(b=b.ptr);return X(bc(c,a,b))};r.prototype.__destroy__=r.prototype.__destroy__=function(){cc(this.ptr)};G.prototype=Object.create(p.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.DracoInt16Array=G;G.prototype.GetValue=G.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return dc(c,a)};G.prototype.size=G.prototype.size=function(){return ec(this.ptr)};G.prototype.__destroy__=G.prototype.__destroy__=function(){fc(this.ptr)};H.prototype=
|
||||
Object.create(p.prototype);H.prototype.constructor=H;H.prototype.__class__=H;H.__cache__={};a.DracoFloat32Array=H;H.prototype.GetValue=H.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return gc(c,a)};H.prototype.size=H.prototype.size=function(){return hc(this.ptr)};H.prototype.__destroy__=H.prototype.__destroy__=function(){ic(this.ptr)};O.prototype=Object.create(p.prototype);O.prototype.constructor=O;O.prototype.__class__=O;O.__cache__={};a.GeometryAttribute=O;O.prototype.__destroy__=
|
||||
O.prototype.__destroy__=function(){jc(this.ptr)};K.prototype=Object.create(p.prototype);K.prototype.constructor=K;K.prototype.__class__=K;K.__cache__={};a.DecoderBuffer=K;K.prototype.Init=K.prototype.Init=function(a,b){var c=this.ptr;n.prepare();if("object"==typeof a&&"object"===typeof a){var e=n.alloc(a,T);n.copy(a,T,e);a=e}b&&"object"===typeof b&&(b=b.ptr);kc(c,a,b)};K.prototype.__destroy__=K.prototype.__destroy__=function(){lc(this.ptr)};g.prototype=Object.create(p.prototype);g.prototype.constructor=
|
||||
g;g.prototype.__class__=g;g.__cache__={};a.Decoder=g;g.prototype.GetEncodedGeometryType=g.prototype.GetEncodedGeometryType=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return mc(c,a)};g.prototype.DecodeBufferToPointCloud=g.prototype.DecodeBufferToPointCloud=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(nc(c,a,b),x)};g.prototype.DecodeBufferToMesh=g.prototype.DecodeBufferToMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&
|
||||
(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(oc(c,a,b),x)};g.prototype.GetAttributeId=g.prototype.GetAttributeId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return pc(c,a,b)};g.prototype.GetAttributeIdByName=g.prototype.GetAttributeIdByName=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return qc(c,a,b)};g.prototype.GetAttributeIdByMetadataEntry=g.prototype.GetAttributeIdByMetadataEntry=
|
||||
function(a,b,d){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);d=d&&"object"===typeof d?d.ptr:V(d);return rc(c,a,b,d)};g.prototype.GetAttribute=g.prototype.GetAttribute=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(sc(c,a,b),q)};g.prototype.GetAttributeByUniqueId=g.prototype.GetAttributeByUniqueId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);
|
||||
return N(tc(c,a,b),q)};g.prototype.GetMetadata=g.prototype.GetMetadata=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return N(uc(c,a),L)};g.prototype.GetAttributeMetadata=g.prototype.GetAttributeMetadata=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(vc(c,a,b),L)};g.prototype.GetFaceFromMesh=g.prototype.GetFaceFromMesh=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===
|
||||
typeof d&&(d=d.ptr);return!!wc(c,a,b,d)};g.prototype.GetTriangleStripsFromMesh=g.prototype.GetTriangleStripsFromMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return xc(c,a,b)};g.prototype.GetTrianglesUInt16Array=g.prototype.GetTrianglesUInt16Array=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!yc(c,a,b,d)};g.prototype.GetTrianglesUInt32Array=g.prototype.GetTrianglesUInt32Array=
|
||||
function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!zc(c,a,b,d)};g.prototype.GetAttributeFloat=g.prototype.GetAttributeFloat=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ac(c,a,b,d)};g.prototype.GetAttributeFloatForAllPoints=g.prototype.GetAttributeFloatForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&
|
||||
(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Bc(c,a,b,d)};g.prototype.GetAttributeIntForAllPoints=g.prototype.GetAttributeIntForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Cc(c,a,b,d)};g.prototype.GetAttributeInt8ForAllPoints=g.prototype.GetAttributeInt8ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&
|
||||
(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Dc(c,a,b,d)};g.prototype.GetAttributeUInt8ForAllPoints=g.prototype.GetAttributeUInt8ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ec(c,a,b,d)};g.prototype.GetAttributeInt16ForAllPoints=g.prototype.GetAttributeInt16ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&
|
||||
(d=d.ptr);return!!Fc(c,a,b,d)};g.prototype.GetAttributeUInt16ForAllPoints=g.prototype.GetAttributeUInt16ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Gc(c,a,b,d)};g.prototype.GetAttributeInt32ForAllPoints=g.prototype.GetAttributeInt32ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Hc(c,
|
||||
a,b,d)};g.prototype.GetAttributeUInt32ForAllPoints=g.prototype.GetAttributeUInt32ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ic(c,a,b,d)};g.prototype.GetAttributeDataArrayForAllPoints=g.prototype.GetAttributeDataArrayForAllPoints=function(a,b,d,e,f){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);e&&"object"===typeof e&&
|
||||
(e=e.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Jc(c,a,b,d,e,f)};g.prototype.SkipAttributeTransform=g.prototype.SkipAttributeTransform=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);Kc(b,a)};g.prototype.__destroy__=g.prototype.__destroy__=function(){Lc(this.ptr)};y.prototype=Object.create(p.prototype);y.prototype.constructor=y;y.prototype.__class__=y;y.__cache__={};a.Mesh=y;y.prototype.num_faces=y.prototype.num_faces=function(){return Mc(this.ptr)};y.prototype.num_attributes=y.prototype.num_attributes=
|
||||
function(){return Nc(this.ptr)};y.prototype.num_points=y.prototype.num_points=function(){return Oc(this.ptr)};y.prototype.__destroy__=y.prototype.__destroy__=function(){Pc(this.ptr)};Q.prototype=Object.create(p.prototype);Q.prototype.constructor=Q;Q.prototype.__class__=Q;Q.__cache__={};a.VoidPtr=Q;Q.prototype.__destroy__=Q.prototype.__destroy__=function(){Qc(this.ptr)};I.prototype=Object.create(p.prototype);I.prototype.constructor=I;I.prototype.__class__=I;I.__cache__={};a.DracoInt32Array=I;I.prototype.GetValue=
|
||||
I.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Rc(b,a)};I.prototype.size=I.prototype.size=function(){return Sc(this.ptr)};I.prototype.__destroy__=I.prototype.__destroy__=function(){Tc(this.ptr)};L.prototype=Object.create(p.prototype);L.prototype.constructor=L;L.prototype.__class__=L;L.__cache__={};a.Metadata=L;L.prototype.__destroy__=L.prototype.__destroy__=function(){Uc(this.ptr)};(function(){function c(){a.OK=Vc();a.DRACO_ERROR=Wc();a.IO_ERROR=Xc();a.INVALID_PARAMETER=
|
||||
Yc();a.UNSUPPORTED_VERSION=Zc();a.UNKNOWN_VERSION=$c();a.DT_INVALID=ad();a.DT_INT8=bd();a.DT_UINT8=cd();a.DT_INT16=dd();a.DT_UINT16=ed();a.DT_INT32=fd();a.DT_UINT32=gd();a.DT_INT64=hd();a.DT_UINT64=id();a.DT_FLOAT32=jd();a.DT_FLOAT64=kd();a.DT_BOOL=ld();a.DT_TYPES_COUNT=md();a.INVALID_GEOMETRY_TYPE=nd();a.POINT_CLOUD=od();a.TRIANGULAR_MESH=pd();a.ATTRIBUTE_INVALID_TRANSFORM=qd();a.ATTRIBUTE_NO_TRANSFORM=rd();a.ATTRIBUTE_QUANTIZATION_TRANSFORM=sd();a.ATTRIBUTE_OCTAHEDRON_TRANSFORM=td();a.INVALID=ud();
|
||||
a.POSITION=vd();a.NORMAL=wd();a.COLOR=xd();a.TEX_COORD=yd();a.GENERIC=zd()}Ba?c():Da.unshift(c)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();return m}}();"object"===typeof exports&&"object"===typeof module?module.exports=DracoDecoderModule:"function"===typeof define&&define.amd?define([],function(){return DracoDecoderModule}):"object"===typeof exports&&(exports.DracoDecoderModule=DracoDecoderModule);
|
File diff suppressed because one or more lines are too long
Binary file not shown.
File diff suppressed because one or more lines are too long
|
@ -1,104 +0,0 @@
|
|||
var $jscomp=$jscomp||{};$jscomp.scope={};$jscomp.arrayIteratorImpl=function(f){var m=0;return function(){return m<f.length?{done:!1,value:f[m++]}:{done:!0}}};$jscomp.arrayIterator=function(f){return{next:$jscomp.arrayIteratorImpl(f)}};$jscomp.makeIterator=function(f){var m="undefined"!=typeof Symbol&&Symbol.iterator&&f[Symbol.iterator];return m?m.call(f):$jscomp.arrayIterator(f)};
|
||||
$jscomp.getGlobal=function(f){return"undefined"!=typeof window&&window===f?f:"undefined"!=typeof global&&null!=global?global:f};$jscomp.global=$jscomp.getGlobal(this);$jscomp.ASSUME_ES5=!1;$jscomp.ASSUME_NO_NATIVE_MAP=!1;$jscomp.ASSUME_NO_NATIVE_SET=!1;$jscomp.SIMPLE_FROUND_POLYFILL=!1;$jscomp.defineProperty=$jscomp.ASSUME_ES5||"function"==typeof Object.defineProperties?Object.defineProperty:function(f,m,v){f!=Array.prototype&&f!=Object.prototype&&(f[m]=v.value)};
|
||||
$jscomp.polyfill=function(f,m,v,t){if(m){v=$jscomp.global;f=f.split(".");for(t=0;t<f.length-1;t++){var h=f[t];h in v||(v[h]={});v=v[h]}f=f[f.length-1];t=v[f];m=m(t);m!=t&&null!=m&&$jscomp.defineProperty(v,f,{configurable:!0,writable:!0,value:m})}};$jscomp.FORCE_POLYFILL_PROMISE=!1;
|
||||
$jscomp.polyfill("Promise",function(f){function m(){this.batch_=null}function v(e){return e instanceof h?e:new h(function(l,f){l(e)})}if(f&&!$jscomp.FORCE_POLYFILL_PROMISE)return f;m.prototype.asyncExecute=function(e){if(null==this.batch_){this.batch_=[];var l=this;this.asyncExecuteFunction(function(){l.executeBatch_()})}this.batch_.push(e)};var t=$jscomp.global.setTimeout;m.prototype.asyncExecuteFunction=function(e){t(e,0)};m.prototype.executeBatch_=function(){for(;this.batch_&&this.batch_.length;){var e=
|
||||
this.batch_;this.batch_=[];for(var l=0;l<e.length;++l){var f=e[l];e[l]=null;try{f()}catch(z){this.asyncThrow_(z)}}}this.batch_=null};m.prototype.asyncThrow_=function(e){this.asyncExecuteFunction(function(){throw e;})};var h=function(e){this.state_=0;this.result_=void 0;this.onSettledCallbacks_=[];var l=this.createResolveAndReject_();try{e(l.resolve,l.reject)}catch(S){l.reject(S)}};h.prototype.createResolveAndReject_=function(){function e(e){return function(h){f||(f=!0,e.call(l,h))}}var l=this,f=!1;
|
||||
return{resolve:e(this.resolveTo_),reject:e(this.reject_)}};h.prototype.resolveTo_=function(e){if(e===this)this.reject_(new TypeError("A Promise cannot resolve to itself"));else if(e instanceof h)this.settleSameAsPromise_(e);else{a:switch(typeof e){case "object":var l=null!=e;break a;case "function":l=!0;break a;default:l=!1}l?this.resolveToNonPromiseObj_(e):this.fulfill_(e)}};h.prototype.resolveToNonPromiseObj_=function(e){var l=void 0;try{l=e.then}catch(S){this.reject_(S);return}"function"==typeof l?
|
||||
this.settleSameAsThenable_(l,e):this.fulfill_(e)};h.prototype.reject_=function(e){this.settle_(2,e)};h.prototype.fulfill_=function(e){this.settle_(1,e)};h.prototype.settle_=function(e,l){if(0!=this.state_)throw Error("Cannot settle("+e+", "+l+"): Promise already settled in state"+this.state_);this.state_=e;this.result_=l;this.executeOnSettledCallbacks_()};h.prototype.executeOnSettledCallbacks_=function(){if(null!=this.onSettledCallbacks_){for(var e=0;e<this.onSettledCallbacks_.length;++e)X.asyncExecute(this.onSettledCallbacks_[e]);
|
||||
this.onSettledCallbacks_=null}};var X=new m;h.prototype.settleSameAsPromise_=function(e){var l=this.createResolveAndReject_();e.callWhenSettled_(l.resolve,l.reject)};h.prototype.settleSameAsThenable_=function(e,l){var f=this.createResolveAndReject_();try{e.call(l,f.resolve,f.reject)}catch(z){f.reject(z)}};h.prototype.then=function(e,f){function l(e,f){return"function"==typeof e?function(f){try{m(e(f))}catch(p){v(p)}}:f}var m,v,t=new h(function(e,f){m=e;v=f});this.callWhenSettled_(l(e,m),l(f,v));return t};
|
||||
h.prototype.catch=function(e){return this.then(void 0,e)};h.prototype.callWhenSettled_=function(e,f){function l(){switch(h.state_){case 1:e(h.result_);break;case 2:f(h.result_);break;default:throw Error("Unexpected state: "+h.state_);}}var h=this;null==this.onSettledCallbacks_?X.asyncExecute(l):this.onSettledCallbacks_.push(l)};h.resolve=v;h.reject=function(e){return new h(function(f,h){h(e)})};h.race=function(e){return new h(function(f,h){for(var l=$jscomp.makeIterator(e),m=l.next();!m.done;m=l.next())v(m.value).callWhenSettled_(f,
|
||||
h)})};h.all=function(e){var f=$jscomp.makeIterator(e),m=f.next();return m.done?v([]):new h(function(e,h){function l(f){return function(h){t[f]=h;z--;0==z&&e(t)}}var t=[],z=0;do t.push(void 0),z++,v(m.value).callWhenSettled_(l(t.length-1),h),m=f.next();while(!m.done)})};return h},"es6","es3");
|
||||
var DracoDecoderModule=function(){var f="undefined"!==typeof document&&document.currentScript?document.currentScript.src:void 0;"undefined"!==typeof __filename&&(f=f||__filename);return function(m){function v(k){return a.locateFile?a.locateFile(k,M):M+k}function t(a,c){a||z("Assertion failed: "+c)}function h(a,c,b){var d=c+b;for(b=c;a[b]&&!(b>=d);)++b;if(16<b-c&&a.subarray&&xa)return xa.decode(a.subarray(c,b));for(d="";c<b;){var k=a[c++];if(k&128){var e=a[c++]&63;if(192==(k&224))d+=String.fromCharCode((k&
|
||||
31)<<6|e);else{var f=a[c++]&63;k=224==(k&240)?(k&15)<<12|e<<6|f:(k&7)<<18|e<<12|f<<6|a[c++]&63;65536>k?d+=String.fromCharCode(k):(k-=65536,d+=String.fromCharCode(55296|k>>10,56320|k&1023))}}else d+=String.fromCharCode(k)}return d}function X(a,c){return a?h(ca,a,c):""}function e(a,c){0<a%c&&(a+=c-a%c);return a}function l(k){ka=k;a.HEAP8=T=new Int8Array(k);a.HEAP16=new Int16Array(k);a.HEAP32=P=new Int32Array(k);a.HEAPU8=ca=new Uint8Array(k);a.HEAPU16=new Uint16Array(k);a.HEAPU32=new Uint32Array(k);
|
||||
a.HEAPF32=new Float32Array(k);a.HEAPF64=new Float64Array(k)}function S(k){for(;0<k.length;){var c=k.shift();if("function"==typeof c)c();else{var b=c.func;"number"===typeof b?void 0===c.arg?a.dynCall_v(b):a.dynCall_vi(b,c.arg):b(void 0===c.arg?null:c.arg)}}}function z(k){if(a.onAbort)a.onAbort(k);k+="";ya(k);Y(k);za=!0;throw new WebAssembly.RuntimeError("abort("+k+"). Build with -s ASSERTIONS=1 for more info.");}function va(a){return String.prototype.startsWith?a.startsWith("data:application/octet-stream;base64,"):
|
||||
0===a.indexOf("data:application/octet-stream;base64,")}function wa(){try{if(da)return new Uint8Array(da);if(la)return la(U);throw"both async and sync fetching of the wasm failed";}catch(k){z(k)}}function Ma(){return da||!ea&&!Z||"function"!==typeof fetch?new Promise(function(a,c){a(wa())}):fetch(U,{credentials:"same-origin"}).then(function(a){if(!a.ok)throw"failed to load wasm binary file at '"+U+"'";return a.arrayBuffer()}).catch(function(){return wa()})}function ba(){if(!ba.strings){var a={USER:"web_user",
|
||||
LOGNAME:"web_user",PATH:"/",PWD:"/",HOME:"/home/web_user",LANG:("object"===typeof navigator&&navigator.languages&&navigator.languages[0]||"C").replace("-","_")+".UTF-8",_:na},c;for(c in Aa)a[c]=Aa[c];var b=[];for(c in a)b.push(c+"="+a[c]);ba.strings=b}return ba.strings}function ma(k){function c(){if(!fa&&(fa=!0,!za)){Ba=!0;S(Ca);S(Da);if(a.onRuntimeInitialized)a.onRuntimeInitialized();if(a.postRun)for("function"==typeof a.postRun&&(a.postRun=[a.postRun]);a.postRun.length;)Ea.unshift(a.postRun.shift());
|
||||
S(Ea)}}if(!(0<aa)){if(a.preRun)for("function"==typeof a.preRun&&(a.preRun=[a.preRun]);a.preRun.length;)Fa.unshift(a.preRun.shift());S(Fa);0<aa||(a.setStatus?(a.setStatus("Running..."),setTimeout(function(){setTimeout(function(){a.setStatus("")},1);c()},1)):c())}}function p(){}function u(a){return(a||p).__cache__}function N(a,c){var b=u(c),d=b[a];if(d)return d;d=Object.create((c||p).prototype);d.ptr=a;return b[a]=d}function V(a){if("string"===typeof a){for(var c=0,b=0;b<a.length;++b){var d=a.charCodeAt(b);
|
||||
55296<=d&&57343>=d&&(d=65536+((d&1023)<<10)|a.charCodeAt(++b)&1023);127>=d?++c:c=2047>=d?c+2:65535>=d?c+3:c+4}c=Array(c+1);b=0;d=c.length;if(0<d){d=b+d-1;for(var k=0;k<a.length;++k){var e=a.charCodeAt(k);if(55296<=e&&57343>=e){var f=a.charCodeAt(++k);e=65536+((e&1023)<<10)|f&1023}if(127>=e){if(b>=d)break;c[b++]=e}else{if(2047>=e){if(b+1>=d)break;c[b++]=192|e>>6}else{if(65535>=e){if(b+2>=d)break;c[b++]=224|e>>12}else{if(b+3>=d)break;c[b++]=240|e>>18;c[b++]=128|e>>12&63}c[b++]=128|e>>6&63}c[b++]=128|
|
||||
e&63}}c[b]=0}a=n.alloc(c,T);n.copy(c,T,a)}return a}function x(){throw"cannot construct a Status, no constructor in IDL";}function A(){this.ptr=Oa();u(A)[this.ptr]=this}function B(){this.ptr=Pa();u(B)[this.ptr]=this}function C(){this.ptr=Qa();u(C)[this.ptr]=this}function D(){this.ptr=Ra();u(D)[this.ptr]=this}function E(){this.ptr=Sa();u(E)[this.ptr]=this}function q(){this.ptr=Ta();u(q)[this.ptr]=this}function J(){this.ptr=Ua();u(J)[this.ptr]=this}function w(){this.ptr=Va();u(w)[this.ptr]=this}function F(){this.ptr=
|
||||
Wa();u(F)[this.ptr]=this}function r(){this.ptr=Xa();u(r)[this.ptr]=this}function G(){this.ptr=Ya();u(G)[this.ptr]=this}function H(){this.ptr=Za();u(H)[this.ptr]=this}function O(){this.ptr=$a();u(O)[this.ptr]=this}function K(){this.ptr=ab();u(K)[this.ptr]=this}function g(){this.ptr=bb();u(g)[this.ptr]=this}function y(){this.ptr=cb();u(y)[this.ptr]=this}function Q(){throw"cannot construct a VoidPtr, no constructor in IDL";}function I(){this.ptr=db();u(I)[this.ptr]=this}function L(){this.ptr=eb();u(L)[this.ptr]=
|
||||
this}m=m||{};var a="undefined"!==typeof m?m:{},Ga=!1,Ha=!1;a.onRuntimeInitialized=function(){Ga=!0;if(Ha&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.onModuleParsed=function(){Ha=!0;if(Ga&&"function"===typeof a.onModuleLoaded)a.onModuleLoaded(a)};a.isVersionSupported=function(a){if("string"!==typeof a)return!1;a=a.split(".");return 2>a.length||3<a.length?!1:1==a[0]&&0<=a[1]&&3>=a[1]?!0:0!=a[0]||10<a[1]?!1:!0};var ha={},W;for(W in a)a.hasOwnProperty(W)&&(ha[W]=a[W]);var na="./this.program",
|
||||
ea=!1,Z=!1,oa=!1,fb=!1,Ia=!1;ea="object"===typeof window;Z="function"===typeof importScripts;oa=(fb="object"===typeof process&&"object"===typeof process.versions&&"string"===typeof process.versions.node)&&!ea&&!Z;Ia=!ea&&!oa&&!Z;var M="",pa,qa;if(oa){M=__dirname+"/";var ra=function(a,c){pa||(pa=require("fs"));qa||(qa=require("path"));a=qa.normalize(a);return pa.readFileSync(a,c?null:"utf8")};var la=function(a){a=ra(a,!0);a.buffer||(a=new Uint8Array(a));t(a.buffer);return a};1<process.argv.length&&
|
||||
(na=process.argv[1].replace(/\\/g,"/"));process.argv.slice(2);process.on("uncaughtException",function(a){throw a;});process.on("unhandledRejection",z);a.inspect=function(){return"[Emscripten Module object]"}}else if(Ia)"undefined"!=typeof read&&(ra=function(a){return read(a)}),la=function(a){if("function"===typeof readbuffer)return new Uint8Array(readbuffer(a));a=read(a,"binary");t("object"===typeof a);return a},"undefined"!==typeof print&&("undefined"===typeof console&&(console={}),console.log=print,
|
||||
console.warn=console.error="undefined"!==typeof printErr?printErr:print);else if(ea||Z)Z?M=self.location.href:document.currentScript&&(M=document.currentScript.src),f&&(M=f),M=0!==M.indexOf("blob:")?M.substr(0,M.lastIndexOf("/")+1):"",ra=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.send(null);return c.responseText},Z&&(la=function(a){var c=new XMLHttpRequest;c.open("GET",a,!1);c.responseType="arraybuffer";c.send(null);return new Uint8Array(c.response)});var ya=a.print||console.log.bind(console),
|
||||
Y=a.printErr||console.warn.bind(console);for(W in ha)ha.hasOwnProperty(W)&&(a[W]=ha[W]);ha=null;a.thisProgram&&(na=a.thisProgram);var da;a.wasmBinary&&(da=a.wasmBinary);"object"!==typeof WebAssembly&&Y("no native wasm support detected");var ia,gb=new WebAssembly.Table({initial:293,maximum:293,element:"anyfunc"}),za=!1,xa="undefined"!==typeof TextDecoder?new TextDecoder("utf8"):void 0;"undefined"!==typeof TextDecoder&&new TextDecoder("utf-16le");var T,ca,P,Ja=a.TOTAL_MEMORY||16777216;if(ia=a.wasmMemory?
|
||||
a.wasmMemory:new WebAssembly.Memory({initial:Ja/65536}))var ka=ia.buffer;Ja=ka.byteLength;l(ka);P[3416]=5256704;var Fa=[],Ca=[],Da=[],Ea=[],Ba=!1,aa=0,sa=null,ja=null;a.preloadedImages={};a.preloadedAudios={};var U="draco_decoder.wasm";va(U)||(U=v(U));Ca.push({func:function(){hb()}});var Aa={},R={buffers:[null,[],[]],printChar:function(a,c){var b=R.buffers[a];0===c||10===c?((1===a?ya:Y)(h(b,0)),b.length=0):b.push(c)},varargs:0,get:function(a){R.varargs+=4;return P[R.varargs-4>>2]},getStr:function(){return X(R.get())},
|
||||
get64:function(){var a=R.get();R.get();return a},getZero:function(){R.get()}},Ka={__cxa_allocate_exception:function(a){return ib(a)},__cxa_throw:function(a,c,b){"uncaught_exception"in ta?ta.uncaught_exceptions++:ta.uncaught_exceptions=1;throw a;},abort:function(){z()},emscripten_get_sbrk_ptr:function(){return 13664},emscripten_memcpy_big:function(a,c,b){ca.set(ca.subarray(c,c+b),a)},emscripten_resize_heap:function(a){if(2147418112<a)return!1;for(var c=Math.max(T.length,16777216);c<a;)c=536870912>=
|
||||
c?e(2*c,65536):Math.min(e((3*c+2147483648)/4,65536),2147418112);a:{try{ia.grow(c-ka.byteLength+65535>>16);l(ia.buffer);var b=1;break a}catch(d){}b=void 0}return b?!0:!1},environ_get:function(a,c){var b=0;ba().forEach(function(d,e){var f=c+b;e=P[a+4*e>>2]=f;for(f=0;f<d.length;++f)T[e++>>0]=d.charCodeAt(f);T[e>>0]=0;b+=d.length+1});return 0},environ_sizes_get:function(a,c){var b=ba();P[a>>2]=b.length;var d=0;b.forEach(function(a){d+=a.length+1});P[c>>2]=d;return 0},fd_close:function(a){return 0},fd_seek:function(a,
|
||||
c,b,d,e){return 0},fd_write:function(a,c,b,d){try{for(var e=0,f=0;f<b;f++){for(var g=P[c+8*f>>2],k=P[c+(8*f+4)>>2],h=0;h<k;h++)R.printChar(a,ca[g+h]);e+=k}P[d>>2]=e;return 0}catch(ua){return"undefined"!==typeof FS&&ua instanceof FS.ErrnoError||z(ua),ua.errno}},memory:ia,setTempRet0:function(a){},table:gb},La=function(){function e(c,b){a.asm=c.exports;aa--;a.monitorRunDependencies&&a.monitorRunDependencies(aa);0==aa&&(null!==sa&&(clearInterval(sa),sa=null),ja&&(c=ja,ja=null,c()))}function c(a){e(a.instance)}
|
||||
function b(a){return Ma().then(function(a){return WebAssembly.instantiate(a,d)}).then(a,function(a){Y("failed to asynchronously prepare wasm: "+a);z(a)})}var d={env:Ka,wasi_unstable:Ka};aa++;a.monitorRunDependencies&&a.monitorRunDependencies(aa);if(a.instantiateWasm)try{return a.instantiateWasm(d,e)}catch(Na){return Y("Module.instantiateWasm callback failed with error: "+Na),!1}(function(){if(da||"function"!==typeof WebAssembly.instantiateStreaming||va(U)||"function"!==typeof fetch)return b(c);fetch(U,
|
||||
{credentials:"same-origin"}).then(function(a){return WebAssembly.instantiateStreaming(a,d).then(c,function(a){Y("wasm streaming compile failed: "+a);Y("falling back to ArrayBuffer instantiation");b(c)})})})();return{}}();a.asm=La;var hb=a.___wasm_call_ctors=function(){return a.asm.__wasm_call_ctors.apply(null,arguments)},jb=a._emscripten_bind_Status_code_0=function(){return a.asm.emscripten_bind_Status_code_0.apply(null,arguments)},kb=a._emscripten_bind_Status_ok_0=function(){return a.asm.emscripten_bind_Status_ok_0.apply(null,
|
||||
arguments)},lb=a._emscripten_bind_Status_error_msg_0=function(){return a.asm.emscripten_bind_Status_error_msg_0.apply(null,arguments)},mb=a._emscripten_bind_Status___destroy___0=function(){return a.asm.emscripten_bind_Status___destroy___0.apply(null,arguments)},Oa=a._emscripten_bind_DracoUInt16Array_DracoUInt16Array_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_DracoUInt16Array_0.apply(null,arguments)},nb=a._emscripten_bind_DracoUInt16Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt16Array_GetValue_1.apply(null,
|
||||
arguments)},ob=a._emscripten_bind_DracoUInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt16Array_size_0.apply(null,arguments)},pb=a._emscripten_bind_DracoUInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt16Array___destroy___0.apply(null,arguments)},Pa=a._emscripten_bind_PointCloud_PointCloud_0=function(){return a.asm.emscripten_bind_PointCloud_PointCloud_0.apply(null,arguments)},qb=a._emscripten_bind_PointCloud_num_attributes_0=function(){return a.asm.emscripten_bind_PointCloud_num_attributes_0.apply(null,
|
||||
arguments)},rb=a._emscripten_bind_PointCloud_num_points_0=function(){return a.asm.emscripten_bind_PointCloud_num_points_0.apply(null,arguments)},sb=a._emscripten_bind_PointCloud___destroy___0=function(){return a.asm.emscripten_bind_PointCloud___destroy___0.apply(null,arguments)},Qa=a._emscripten_bind_DracoUInt8Array_DracoUInt8Array_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_DracoUInt8Array_0.apply(null,arguments)},tb=a._emscripten_bind_DracoUInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt8Array_GetValue_1.apply(null,
|
||||
arguments)},ub=a._emscripten_bind_DracoUInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt8Array_size_0.apply(null,arguments)},vb=a._emscripten_bind_DracoUInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt8Array___destroy___0.apply(null,arguments)},Ra=a._emscripten_bind_DracoUInt32Array_DracoUInt32Array_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_DracoUInt32Array_0.apply(null,arguments)},wb=a._emscripten_bind_DracoUInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoUInt32Array_GetValue_1.apply(null,
|
||||
arguments)},xb=a._emscripten_bind_DracoUInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoUInt32Array_size_0.apply(null,arguments)},yb=a._emscripten_bind_DracoUInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoUInt32Array___destroy___0.apply(null,arguments)},Sa=a._emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_AttributeOctahedronTransform_0.apply(null,arguments)},zb=a._emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1=
|
||||
function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_InitFromAttribute_1.apply(null,arguments)},Ab=a._emscripten_bind_AttributeOctahedronTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform_quantization_bits_0.apply(null,arguments)},Bb=a._emscripten_bind_AttributeOctahedronTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeOctahedronTransform___destroy___0.apply(null,arguments)},Ta=a._emscripten_bind_PointAttribute_PointAttribute_0=
|
||||
function(){return a.asm.emscripten_bind_PointAttribute_PointAttribute_0.apply(null,arguments)},Cb=a._emscripten_bind_PointAttribute_size_0=function(){return a.asm.emscripten_bind_PointAttribute_size_0.apply(null,arguments)},Db=a._emscripten_bind_PointAttribute_GetAttributeTransformData_0=function(){return a.asm.emscripten_bind_PointAttribute_GetAttributeTransformData_0.apply(null,arguments)},Eb=a._emscripten_bind_PointAttribute_attribute_type_0=function(){return a.asm.emscripten_bind_PointAttribute_attribute_type_0.apply(null,
|
||||
arguments)},Fb=a._emscripten_bind_PointAttribute_data_type_0=function(){return a.asm.emscripten_bind_PointAttribute_data_type_0.apply(null,arguments)},Gb=a._emscripten_bind_PointAttribute_num_components_0=function(){return a.asm.emscripten_bind_PointAttribute_num_components_0.apply(null,arguments)},Hb=a._emscripten_bind_PointAttribute_normalized_0=function(){return a.asm.emscripten_bind_PointAttribute_normalized_0.apply(null,arguments)},Ib=a._emscripten_bind_PointAttribute_byte_stride_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_stride_0.apply(null,
|
||||
arguments)},Jb=a._emscripten_bind_PointAttribute_byte_offset_0=function(){return a.asm.emscripten_bind_PointAttribute_byte_offset_0.apply(null,arguments)},Kb=a._emscripten_bind_PointAttribute_unique_id_0=function(){return a.asm.emscripten_bind_PointAttribute_unique_id_0.apply(null,arguments)},Lb=a._emscripten_bind_PointAttribute___destroy___0=function(){return a.asm.emscripten_bind_PointAttribute___destroy___0.apply(null,arguments)},Ua=a._emscripten_bind_AttributeTransformData_AttributeTransformData_0=
|
||||
function(){return a.asm.emscripten_bind_AttributeTransformData_AttributeTransformData_0.apply(null,arguments)},Mb=a._emscripten_bind_AttributeTransformData_transform_type_0=function(){return a.asm.emscripten_bind_AttributeTransformData_transform_type_0.apply(null,arguments)},Nb=a._emscripten_bind_AttributeTransformData___destroy___0=function(){return a.asm.emscripten_bind_AttributeTransformData___destroy___0.apply(null,arguments)},Va=a._emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0=
|
||||
function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_AttributeQuantizationTransform_0.apply(null,arguments)},Ob=a._emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_InitFromAttribute_1.apply(null,arguments)},Pb=a._emscripten_bind_AttributeQuantizationTransform_quantization_bits_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_quantization_bits_0.apply(null,arguments)},
|
||||
Qb=a._emscripten_bind_AttributeQuantizationTransform_min_value_1=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_min_value_1.apply(null,arguments)},Rb=a._emscripten_bind_AttributeQuantizationTransform_range_0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform_range_0.apply(null,arguments)},Sb=a._emscripten_bind_AttributeQuantizationTransform___destroy___0=function(){return a.asm.emscripten_bind_AttributeQuantizationTransform___destroy___0.apply(null,arguments)},
|
||||
Wa=a._emscripten_bind_DracoInt8Array_DracoInt8Array_0=function(){return a.asm.emscripten_bind_DracoInt8Array_DracoInt8Array_0.apply(null,arguments)},Tb=a._emscripten_bind_DracoInt8Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt8Array_GetValue_1.apply(null,arguments)},Ub=a._emscripten_bind_DracoInt8Array_size_0=function(){return a.asm.emscripten_bind_DracoInt8Array_size_0.apply(null,arguments)},Vb=a._emscripten_bind_DracoInt8Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt8Array___destroy___0.apply(null,
|
||||
arguments)},Xa=a._emscripten_bind_MetadataQuerier_MetadataQuerier_0=function(){return a.asm.emscripten_bind_MetadataQuerier_MetadataQuerier_0.apply(null,arguments)},Wb=a._emscripten_bind_MetadataQuerier_HasEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_HasEntry_2.apply(null,arguments)},Xb=a._emscripten_bind_MetadataQuerier_GetIntEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntry_2.apply(null,arguments)},Yb=a._emscripten_bind_MetadataQuerier_GetIntEntryArray_3=
|
||||
function(){return a.asm.emscripten_bind_MetadataQuerier_GetIntEntryArray_3.apply(null,arguments)},Zb=a._emscripten_bind_MetadataQuerier_GetDoubleEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetDoubleEntry_2.apply(null,arguments)},$b=a._emscripten_bind_MetadataQuerier_GetStringEntry_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetStringEntry_2.apply(null,arguments)},ac=a._emscripten_bind_MetadataQuerier_NumEntries_1=function(){return a.asm.emscripten_bind_MetadataQuerier_NumEntries_1.apply(null,
|
||||
arguments)},bc=a._emscripten_bind_MetadataQuerier_GetEntryName_2=function(){return a.asm.emscripten_bind_MetadataQuerier_GetEntryName_2.apply(null,arguments)},cc=a._emscripten_bind_MetadataQuerier___destroy___0=function(){return a.asm.emscripten_bind_MetadataQuerier___destroy___0.apply(null,arguments)},Ya=a._emscripten_bind_DracoInt16Array_DracoInt16Array_0=function(){return a.asm.emscripten_bind_DracoInt16Array_DracoInt16Array_0.apply(null,arguments)},dc=a._emscripten_bind_DracoInt16Array_GetValue_1=
|
||||
function(){return a.asm.emscripten_bind_DracoInt16Array_GetValue_1.apply(null,arguments)},ec=a._emscripten_bind_DracoInt16Array_size_0=function(){return a.asm.emscripten_bind_DracoInt16Array_size_0.apply(null,arguments)},fc=a._emscripten_bind_DracoInt16Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt16Array___destroy___0.apply(null,arguments)},Za=a._emscripten_bind_DracoFloat32Array_DracoFloat32Array_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_DracoFloat32Array_0.apply(null,
|
||||
arguments)},gc=a._emscripten_bind_DracoFloat32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoFloat32Array_GetValue_1.apply(null,arguments)},hc=a._emscripten_bind_DracoFloat32Array_size_0=function(){return a.asm.emscripten_bind_DracoFloat32Array_size_0.apply(null,arguments)},ic=a._emscripten_bind_DracoFloat32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoFloat32Array___destroy___0.apply(null,arguments)},$a=a._emscripten_bind_GeometryAttribute_GeometryAttribute_0=function(){return a.asm.emscripten_bind_GeometryAttribute_GeometryAttribute_0.apply(null,
|
||||
arguments)},jc=a._emscripten_bind_GeometryAttribute___destroy___0=function(){return a.asm.emscripten_bind_GeometryAttribute___destroy___0.apply(null,arguments)},ab=a._emscripten_bind_DecoderBuffer_DecoderBuffer_0=function(){return a.asm.emscripten_bind_DecoderBuffer_DecoderBuffer_0.apply(null,arguments)},kc=a._emscripten_bind_DecoderBuffer_Init_2=function(){return a.asm.emscripten_bind_DecoderBuffer_Init_2.apply(null,arguments)},lc=a._emscripten_bind_DecoderBuffer___destroy___0=function(){return a.asm.emscripten_bind_DecoderBuffer___destroy___0.apply(null,
|
||||
arguments)},bb=a._emscripten_bind_Decoder_Decoder_0=function(){return a.asm.emscripten_bind_Decoder_Decoder_0.apply(null,arguments)},mc=a._emscripten_bind_Decoder_GetEncodedGeometryType_1=function(){return a.asm.emscripten_bind_Decoder_GetEncodedGeometryType_1.apply(null,arguments)},nc=a._emscripten_bind_Decoder_DecodeBufferToPointCloud_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToPointCloud_2.apply(null,arguments)},oc=a._emscripten_bind_Decoder_DecodeBufferToMesh_2=function(){return a.asm.emscripten_bind_Decoder_DecodeBufferToMesh_2.apply(null,
|
||||
arguments)},pc=a._emscripten_bind_Decoder_GetAttributeId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeId_2.apply(null,arguments)},qc=a._emscripten_bind_Decoder_GetAttributeIdByName_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByName_2.apply(null,arguments)},rc=a._emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIdByMetadataEntry_3.apply(null,arguments)},sc=a._emscripten_bind_Decoder_GetAttribute_2=
|
||||
function(){return a.asm.emscripten_bind_Decoder_GetAttribute_2.apply(null,arguments)},tc=a._emscripten_bind_Decoder_GetAttributeByUniqueId_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeByUniqueId_2.apply(null,arguments)},uc=a._emscripten_bind_Decoder_GetMetadata_1=function(){return a.asm.emscripten_bind_Decoder_GetMetadata_1.apply(null,arguments)},vc=a._emscripten_bind_Decoder_GetAttributeMetadata_2=function(){return a.asm.emscripten_bind_Decoder_GetAttributeMetadata_2.apply(null,
|
||||
arguments)},wc=a._emscripten_bind_Decoder_GetFaceFromMesh_3=function(){return a.asm.emscripten_bind_Decoder_GetFaceFromMesh_3.apply(null,arguments)},xc=a._emscripten_bind_Decoder_GetTriangleStripsFromMesh_2=function(){return a.asm.emscripten_bind_Decoder_GetTriangleStripsFromMesh_2.apply(null,arguments)},yc=a._emscripten_bind_Decoder_GetTrianglesUInt16Array_3=function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt16Array_3.apply(null,arguments)},zc=a._emscripten_bind_Decoder_GetTrianglesUInt32Array_3=
|
||||
function(){return a.asm.emscripten_bind_Decoder_GetTrianglesUInt32Array_3.apply(null,arguments)},Ac=a._emscripten_bind_Decoder_GetAttributeFloat_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloat_3.apply(null,arguments)},Bc=a._emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeFloatForAllPoints_3.apply(null,arguments)},Cc=a._emscripten_bind_Decoder_GetAttributeIntForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeIntForAllPoints_3.apply(null,
|
||||
arguments)},Dc=a._emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt8ForAllPoints_3.apply(null,arguments)},Ec=a._emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt8ForAllPoints_3.apply(null,arguments)},Fc=a._emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt16ForAllPoints_3.apply(null,arguments)},
|
||||
Gc=a._emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt16ForAllPoints_3.apply(null,arguments)},Hc=a._emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeInt32ForAllPoints_3.apply(null,arguments)},Ic=a._emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3=function(){return a.asm.emscripten_bind_Decoder_GetAttributeUInt32ForAllPoints_3.apply(null,arguments)},Jc=
|
||||
a._emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5=function(){return a.asm.emscripten_bind_Decoder_GetAttributeDataArrayForAllPoints_5.apply(null,arguments)},Kc=a._emscripten_bind_Decoder_SkipAttributeTransform_1=function(){return a.asm.emscripten_bind_Decoder_SkipAttributeTransform_1.apply(null,arguments)},Lc=a._emscripten_bind_Decoder___destroy___0=function(){return a.asm.emscripten_bind_Decoder___destroy___0.apply(null,arguments)},cb=a._emscripten_bind_Mesh_Mesh_0=function(){return a.asm.emscripten_bind_Mesh_Mesh_0.apply(null,
|
||||
arguments)},Mc=a._emscripten_bind_Mesh_num_faces_0=function(){return a.asm.emscripten_bind_Mesh_num_faces_0.apply(null,arguments)},Nc=a._emscripten_bind_Mesh_num_attributes_0=function(){return a.asm.emscripten_bind_Mesh_num_attributes_0.apply(null,arguments)},Oc=a._emscripten_bind_Mesh_num_points_0=function(){return a.asm.emscripten_bind_Mesh_num_points_0.apply(null,arguments)},Pc=a._emscripten_bind_Mesh___destroy___0=function(){return a.asm.emscripten_bind_Mesh___destroy___0.apply(null,arguments)},
|
||||
Qc=a._emscripten_bind_VoidPtr___destroy___0=function(){return a.asm.emscripten_bind_VoidPtr___destroy___0.apply(null,arguments)},db=a._emscripten_bind_DracoInt32Array_DracoInt32Array_0=function(){return a.asm.emscripten_bind_DracoInt32Array_DracoInt32Array_0.apply(null,arguments)},Rc=a._emscripten_bind_DracoInt32Array_GetValue_1=function(){return a.asm.emscripten_bind_DracoInt32Array_GetValue_1.apply(null,arguments)},Sc=a._emscripten_bind_DracoInt32Array_size_0=function(){return a.asm.emscripten_bind_DracoInt32Array_size_0.apply(null,
|
||||
arguments)},Tc=a._emscripten_bind_DracoInt32Array___destroy___0=function(){return a.asm.emscripten_bind_DracoInt32Array___destroy___0.apply(null,arguments)},eb=a._emscripten_bind_Metadata_Metadata_0=function(){return a.asm.emscripten_bind_Metadata_Metadata_0.apply(null,arguments)},Uc=a._emscripten_bind_Metadata___destroy___0=function(){return a.asm.emscripten_bind_Metadata___destroy___0.apply(null,arguments)},Vc=a._emscripten_enum_draco_StatusCode_OK=function(){return a.asm.emscripten_enum_draco_StatusCode_OK.apply(null,
|
||||
arguments)},Wc=a._emscripten_enum_draco_StatusCode_DRACO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_DRACO_ERROR.apply(null,arguments)},Xc=a._emscripten_enum_draco_StatusCode_IO_ERROR=function(){return a.asm.emscripten_enum_draco_StatusCode_IO_ERROR.apply(null,arguments)},Yc=a._emscripten_enum_draco_StatusCode_INVALID_PARAMETER=function(){return a.asm.emscripten_enum_draco_StatusCode_INVALID_PARAMETER.apply(null,arguments)},Zc=a._emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION=
|
||||
function(){return a.asm.emscripten_enum_draco_StatusCode_UNSUPPORTED_VERSION.apply(null,arguments)},$c=a._emscripten_enum_draco_StatusCode_UNKNOWN_VERSION=function(){return a.asm.emscripten_enum_draco_StatusCode_UNKNOWN_VERSION.apply(null,arguments)},ad=a._emscripten_enum_draco_DataType_DT_INVALID=function(){return a.asm.emscripten_enum_draco_DataType_DT_INVALID.apply(null,arguments)},bd=a._emscripten_enum_draco_DataType_DT_INT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT8.apply(null,
|
||||
arguments)},cd=a._emscripten_enum_draco_DataType_DT_UINT8=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT8.apply(null,arguments)},dd=a._emscripten_enum_draco_DataType_DT_INT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT16.apply(null,arguments)},ed=a._emscripten_enum_draco_DataType_DT_UINT16=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT16.apply(null,arguments)},fd=a._emscripten_enum_draco_DataType_DT_INT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT32.apply(null,
|
||||
arguments)},gd=a._emscripten_enum_draco_DataType_DT_UINT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT32.apply(null,arguments)},hd=a._emscripten_enum_draco_DataType_DT_INT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_INT64.apply(null,arguments)},id=a._emscripten_enum_draco_DataType_DT_UINT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_UINT64.apply(null,arguments)},jd=a._emscripten_enum_draco_DataType_DT_FLOAT32=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT32.apply(null,
|
||||
arguments)},kd=a._emscripten_enum_draco_DataType_DT_FLOAT64=function(){return a.asm.emscripten_enum_draco_DataType_DT_FLOAT64.apply(null,arguments)},ld=a._emscripten_enum_draco_DataType_DT_BOOL=function(){return a.asm.emscripten_enum_draco_DataType_DT_BOOL.apply(null,arguments)},md=a._emscripten_enum_draco_DataType_DT_TYPES_COUNT=function(){return a.asm.emscripten_enum_draco_DataType_DT_TYPES_COUNT.apply(null,arguments)},nd=a._emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_INVALID_GEOMETRY_TYPE.apply(null,
|
||||
arguments)},od=a._emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_POINT_CLOUD.apply(null,arguments)},pd=a._emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH=function(){return a.asm.emscripten_enum_draco_EncodedGeometryType_TRIANGULAR_MESH.apply(null,arguments)},qd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_INVALID_TRANSFORM.apply(null,
|
||||
arguments)},rd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_NO_TRANSFORM.apply(null,arguments)},sd=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_QUANTIZATION_TRANSFORM.apply(null,arguments)},td=a._emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM=function(){return a.asm.emscripten_enum_draco_AttributeTransformType_ATTRIBUTE_OCTAHEDRON_TRANSFORM.apply(null,
|
||||
arguments)},ud=a._emscripten_enum_draco_GeometryAttribute_Type_INVALID=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_INVALID.apply(null,arguments)},vd=a._emscripten_enum_draco_GeometryAttribute_Type_POSITION=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_POSITION.apply(null,arguments)},wd=a._emscripten_enum_draco_GeometryAttribute_Type_NORMAL=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_NORMAL.apply(null,arguments)},xd=a._emscripten_enum_draco_GeometryAttribute_Type_COLOR=
|
||||
function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_COLOR.apply(null,arguments)},yd=a._emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_TEX_COORD.apply(null,arguments)},zd=a._emscripten_enum_draco_GeometryAttribute_Type_GENERIC=function(){return a.asm.emscripten_enum_draco_GeometryAttribute_Type_GENERIC.apply(null,arguments)};a._setThrew=function(){return a.asm.setThrew.apply(null,arguments)};var ta=a.__ZSt18uncaught_exceptionv=
|
||||
function(){return a.asm._ZSt18uncaught_exceptionv.apply(null,arguments)};a._free=function(){return a.asm.free.apply(null,arguments)};var ib=a._malloc=function(){return a.asm.malloc.apply(null,arguments)};a.stackSave=function(){return a.asm.stackSave.apply(null,arguments)};a.stackAlloc=function(){return a.asm.stackAlloc.apply(null,arguments)};a.stackRestore=function(){return a.asm.stackRestore.apply(null,arguments)};a.__growWasmMemory=function(){return a.asm.__growWasmMemory.apply(null,arguments)};
|
||||
a.dynCall_ii=function(){return a.asm.dynCall_ii.apply(null,arguments)};a.dynCall_vi=function(){return a.asm.dynCall_vi.apply(null,arguments)};a.dynCall_iii=function(){return a.asm.dynCall_iii.apply(null,arguments)};a.dynCall_vii=function(){return a.asm.dynCall_vii.apply(null,arguments)};a.dynCall_iiii=function(){return a.asm.dynCall_iiii.apply(null,arguments)};a.dynCall_v=function(){return a.asm.dynCall_v.apply(null,arguments)};a.dynCall_viii=function(){return a.asm.dynCall_viii.apply(null,arguments)};
|
||||
a.dynCall_viiii=function(){return a.asm.dynCall_viiii.apply(null,arguments)};a.dynCall_iiiiiii=function(){return a.asm.dynCall_iiiiiii.apply(null,arguments)};a.dynCall_iidiiii=function(){return a.asm.dynCall_iidiiii.apply(null,arguments)};a.dynCall_jiji=function(){return a.asm.dynCall_jiji.apply(null,arguments)};a.dynCall_viiiiii=function(){return a.asm.dynCall_viiiiii.apply(null,arguments)};a.dynCall_viiiii=function(){return a.asm.dynCall_viiiii.apply(null,arguments)};a.asm=La;var fa;a.then=function(e){if(fa)e(a);
|
||||
else{var c=a.onRuntimeInitialized;a.onRuntimeInitialized=function(){c&&c();e(a)}}return a};ja=function c(){fa||ma();fa||(ja=c)};a.run=ma;if(a.preInit)for("function"==typeof a.preInit&&(a.preInit=[a.preInit]);0<a.preInit.length;)a.preInit.pop()();ma();p.prototype=Object.create(p.prototype);p.prototype.constructor=p;p.prototype.__class__=p;p.__cache__={};a.WrapperObject=p;a.getCache=u;a.wrapPointer=N;a.castObject=function(a,b){return N(a.ptr,b)};a.NULL=N(0);a.destroy=function(a){if(!a.__destroy__)throw"Error: Cannot destroy object. (Did you create it yourself?)";
|
||||
a.__destroy__();delete u(a.__class__)[a.ptr]};a.compare=function(a,b){return a.ptr===b.ptr};a.getPointer=function(a){return a.ptr};a.getClass=function(a){return a.__class__};var n={buffer:0,size:0,pos:0,temps:[],needed:0,prepare:function(){if(n.needed){for(var c=0;c<n.temps.length;c++)a._free(n.temps[c]);n.temps.length=0;a._free(n.buffer);n.buffer=0;n.size+=n.needed;n.needed=0}n.buffer||(n.size+=128,n.buffer=a._malloc(n.size),t(n.buffer));n.pos=0},alloc:function(c,b){t(n.buffer);c=c.length*b.BYTES_PER_ELEMENT;
|
||||
c=c+7&-8;n.pos+c>=n.size?(t(0<c),n.needed+=c,b=a._malloc(c),n.temps.push(b)):(b=n.buffer+n.pos,n.pos+=c);return b},copy:function(a,b,d){switch(b.BYTES_PER_ELEMENT){case 2:d>>=1;break;case 4:d>>=2;break;case 8:d>>=3}for(var c=0;c<a.length;c++)b[d+c]=a[c]}};x.prototype=Object.create(p.prototype);x.prototype.constructor=x;x.prototype.__class__=x;x.__cache__={};a.Status=x;x.prototype.code=x.prototype.code=function(){return jb(this.ptr)};x.prototype.ok=x.prototype.ok=function(){return!!kb(this.ptr)};x.prototype.error_msg=
|
||||
x.prototype.error_msg=function(){return X(lb(this.ptr))};x.prototype.__destroy__=x.prototype.__destroy__=function(){mb(this.ptr)};A.prototype=Object.create(p.prototype);A.prototype.constructor=A;A.prototype.__class__=A;A.__cache__={};a.DracoUInt16Array=A;A.prototype.GetValue=A.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return nb(c,a)};A.prototype.size=A.prototype.size=function(){return ob(this.ptr)};A.prototype.__destroy__=A.prototype.__destroy__=function(){pb(this.ptr)};
|
||||
B.prototype=Object.create(p.prototype);B.prototype.constructor=B;B.prototype.__class__=B;B.__cache__={};a.PointCloud=B;B.prototype.num_attributes=B.prototype.num_attributes=function(){return qb(this.ptr)};B.prototype.num_points=B.prototype.num_points=function(){return rb(this.ptr)};B.prototype.__destroy__=B.prototype.__destroy__=function(){sb(this.ptr)};C.prototype=Object.create(p.prototype);C.prototype.constructor=C;C.prototype.__class__=C;C.__cache__={};a.DracoUInt8Array=C;C.prototype.GetValue=
|
||||
C.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return tb(c,a)};C.prototype.size=C.prototype.size=function(){return ub(this.ptr)};C.prototype.__destroy__=C.prototype.__destroy__=function(){vb(this.ptr)};D.prototype=Object.create(p.prototype);D.prototype.constructor=D;D.prototype.__class__=D;D.__cache__={};a.DracoUInt32Array=D;D.prototype.GetValue=D.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return wb(c,a)};D.prototype.size=D.prototype.size=
|
||||
function(){return xb(this.ptr)};D.prototype.__destroy__=D.prototype.__destroy__=function(){yb(this.ptr)};E.prototype=Object.create(p.prototype);E.prototype.constructor=E;E.prototype.__class__=E;E.__cache__={};a.AttributeOctahedronTransform=E;E.prototype.InitFromAttribute=E.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!zb(c,a)};E.prototype.quantization_bits=E.prototype.quantization_bits=function(){return Ab(this.ptr)};E.prototype.__destroy__=E.prototype.__destroy__=
|
||||
function(){Bb(this.ptr)};q.prototype=Object.create(p.prototype);q.prototype.constructor=q;q.prototype.__class__=q;q.__cache__={};a.PointAttribute=q;q.prototype.size=q.prototype.size=function(){return Cb(this.ptr)};q.prototype.GetAttributeTransformData=q.prototype.GetAttributeTransformData=function(){return N(Db(this.ptr),J)};q.prototype.attribute_type=q.prototype.attribute_type=function(){return Eb(this.ptr)};q.prototype.data_type=q.prototype.data_type=function(){return Fb(this.ptr)};q.prototype.num_components=
|
||||
q.prototype.num_components=function(){return Gb(this.ptr)};q.prototype.normalized=q.prototype.normalized=function(){return!!Hb(this.ptr)};q.prototype.byte_stride=q.prototype.byte_stride=function(){return Ib(this.ptr)};q.prototype.byte_offset=q.prototype.byte_offset=function(){return Jb(this.ptr)};q.prototype.unique_id=q.prototype.unique_id=function(){return Kb(this.ptr)};q.prototype.__destroy__=q.prototype.__destroy__=function(){Lb(this.ptr)};J.prototype=Object.create(p.prototype);J.prototype.constructor=
|
||||
J;J.prototype.__class__=J;J.__cache__={};a.AttributeTransformData=J;J.prototype.transform_type=J.prototype.transform_type=function(){return Mb(this.ptr)};J.prototype.__destroy__=J.prototype.__destroy__=function(){Nb(this.ptr)};w.prototype=Object.create(p.prototype);w.prototype.constructor=w;w.prototype.__class__=w;w.__cache__={};a.AttributeQuantizationTransform=w;w.prototype.InitFromAttribute=w.prototype.InitFromAttribute=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return!!Ob(c,a)};
|
||||
w.prototype.quantization_bits=w.prototype.quantization_bits=function(){return Pb(this.ptr)};w.prototype.min_value=w.prototype.min_value=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Qb(c,a)};w.prototype.range=w.prototype.range=function(){return Rb(this.ptr)};w.prototype.__destroy__=w.prototype.__destroy__=function(){Sb(this.ptr)};F.prototype=Object.create(p.prototype);F.prototype.constructor=F;F.prototype.__class__=F;F.__cache__={};a.DracoInt8Array=F;F.prototype.GetValue=F.prototype.GetValue=
|
||||
function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Tb(c,a)};F.prototype.size=F.prototype.size=function(){return Ub(this.ptr)};F.prototype.__destroy__=F.prototype.__destroy__=function(){Vb(this.ptr)};r.prototype=Object.create(p.prototype);r.prototype.constructor=r;r.prototype.__class__=r;r.__cache__={};a.MetadataQuerier=r;r.prototype.HasEntry=r.prototype.HasEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return!!Wb(c,
|
||||
a,b)};r.prototype.GetIntEntry=r.prototype.GetIntEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return Xb(c,a,b)};r.prototype.GetIntEntryArray=r.prototype.GetIntEntryArray=function(a,b,d){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);d&&"object"===typeof d&&(d=d.ptr);Yb(c,a,b,d)};r.prototype.GetDoubleEntry=r.prototype.GetDoubleEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===
|
||||
typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return Zb(c,a,b)};r.prototype.GetStringEntry=r.prototype.GetStringEntry=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return X($b(c,a,b))};r.prototype.NumEntries=r.prototype.NumEntries=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return ac(c,a)};r.prototype.GetEntryName=r.prototype.GetEntryName=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===
|
||||
typeof b&&(b=b.ptr);return X(bc(c,a,b))};r.prototype.__destroy__=r.prototype.__destroy__=function(){cc(this.ptr)};G.prototype=Object.create(p.prototype);G.prototype.constructor=G;G.prototype.__class__=G;G.__cache__={};a.DracoInt16Array=G;G.prototype.GetValue=G.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return dc(c,a)};G.prototype.size=G.prototype.size=function(){return ec(this.ptr)};G.prototype.__destroy__=G.prototype.__destroy__=function(){fc(this.ptr)};H.prototype=
|
||||
Object.create(p.prototype);H.prototype.constructor=H;H.prototype.__class__=H;H.__cache__={};a.DracoFloat32Array=H;H.prototype.GetValue=H.prototype.GetValue=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return gc(c,a)};H.prototype.size=H.prototype.size=function(){return hc(this.ptr)};H.prototype.__destroy__=H.prototype.__destroy__=function(){ic(this.ptr)};O.prototype=Object.create(p.prototype);O.prototype.constructor=O;O.prototype.__class__=O;O.__cache__={};a.GeometryAttribute=O;O.prototype.__destroy__=
|
||||
O.prototype.__destroy__=function(){jc(this.ptr)};K.prototype=Object.create(p.prototype);K.prototype.constructor=K;K.prototype.__class__=K;K.__cache__={};a.DecoderBuffer=K;K.prototype.Init=K.prototype.Init=function(a,b){var c=this.ptr;n.prepare();if("object"==typeof a&&"object"===typeof a){var e=n.alloc(a,T);n.copy(a,T,e);a=e}b&&"object"===typeof b&&(b=b.ptr);kc(c,a,b)};K.prototype.__destroy__=K.prototype.__destroy__=function(){lc(this.ptr)};g.prototype=Object.create(p.prototype);g.prototype.constructor=
|
||||
g;g.prototype.__class__=g;g.__cache__={};a.Decoder=g;g.prototype.GetEncodedGeometryType=g.prototype.GetEncodedGeometryType=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return mc(c,a)};g.prototype.DecodeBufferToPointCloud=g.prototype.DecodeBufferToPointCloud=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(nc(c,a,b),x)};g.prototype.DecodeBufferToMesh=g.prototype.DecodeBufferToMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&
|
||||
(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(oc(c,a,b),x)};g.prototype.GetAttributeId=g.prototype.GetAttributeId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return pc(c,a,b)};g.prototype.GetAttributeIdByName=g.prototype.GetAttributeIdByName=function(a,b){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);return qc(c,a,b)};g.prototype.GetAttributeIdByMetadataEntry=g.prototype.GetAttributeIdByMetadataEntry=
|
||||
function(a,b,d){var c=this.ptr;n.prepare();a&&"object"===typeof a&&(a=a.ptr);b=b&&"object"===typeof b?b.ptr:V(b);d=d&&"object"===typeof d?d.ptr:V(d);return rc(c,a,b,d)};g.prototype.GetAttribute=g.prototype.GetAttribute=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(sc(c,a,b),q)};g.prototype.GetAttributeByUniqueId=g.prototype.GetAttributeByUniqueId=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);
|
||||
return N(tc(c,a,b),q)};g.prototype.GetMetadata=g.prototype.GetMetadata=function(a){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return N(uc(c,a),L)};g.prototype.GetAttributeMetadata=g.prototype.GetAttributeMetadata=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return N(vc(c,a,b),L)};g.prototype.GetFaceFromMesh=g.prototype.GetFaceFromMesh=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===
|
||||
typeof d&&(d=d.ptr);return!!wc(c,a,b,d)};g.prototype.GetTriangleStripsFromMesh=g.prototype.GetTriangleStripsFromMesh=function(a,b){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);return xc(c,a,b)};g.prototype.GetTrianglesUInt16Array=g.prototype.GetTrianglesUInt16Array=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!yc(c,a,b,d)};g.prototype.GetTrianglesUInt32Array=g.prototype.GetTrianglesUInt32Array=
|
||||
function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!zc(c,a,b,d)};g.prototype.GetAttributeFloat=g.prototype.GetAttributeFloat=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ac(c,a,b,d)};g.prototype.GetAttributeFloatForAllPoints=g.prototype.GetAttributeFloatForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&
|
||||
(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Bc(c,a,b,d)};g.prototype.GetAttributeIntForAllPoints=g.prototype.GetAttributeIntForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Cc(c,a,b,d)};g.prototype.GetAttributeInt8ForAllPoints=g.prototype.GetAttributeInt8ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&
|
||||
(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Dc(c,a,b,d)};g.prototype.GetAttributeUInt8ForAllPoints=g.prototype.GetAttributeUInt8ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ec(c,a,b,d)};g.prototype.GetAttributeInt16ForAllPoints=g.prototype.GetAttributeInt16ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&
|
||||
(d=d.ptr);return!!Fc(c,a,b,d)};g.prototype.GetAttributeUInt16ForAllPoints=g.prototype.GetAttributeUInt16ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Gc(c,a,b,d)};g.prototype.GetAttributeInt32ForAllPoints=g.prototype.GetAttributeInt32ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Hc(c,
|
||||
a,b,d)};g.prototype.GetAttributeUInt32ForAllPoints=g.prototype.GetAttributeUInt32ForAllPoints=function(a,b,d){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);return!!Ic(c,a,b,d)};g.prototype.GetAttributeDataArrayForAllPoints=g.prototype.GetAttributeDataArrayForAllPoints=function(a,b,d,e,f){var c=this.ptr;a&&"object"===typeof a&&(a=a.ptr);b&&"object"===typeof b&&(b=b.ptr);d&&"object"===typeof d&&(d=d.ptr);e&&"object"===typeof e&&
|
||||
(e=e.ptr);f&&"object"===typeof f&&(f=f.ptr);return!!Jc(c,a,b,d,e,f)};g.prototype.SkipAttributeTransform=g.prototype.SkipAttributeTransform=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);Kc(b,a)};g.prototype.__destroy__=g.prototype.__destroy__=function(){Lc(this.ptr)};y.prototype=Object.create(p.prototype);y.prototype.constructor=y;y.prototype.__class__=y;y.__cache__={};a.Mesh=y;y.prototype.num_faces=y.prototype.num_faces=function(){return Mc(this.ptr)};y.prototype.num_attributes=y.prototype.num_attributes=
|
||||
function(){return Nc(this.ptr)};y.prototype.num_points=y.prototype.num_points=function(){return Oc(this.ptr)};y.prototype.__destroy__=y.prototype.__destroy__=function(){Pc(this.ptr)};Q.prototype=Object.create(p.prototype);Q.prototype.constructor=Q;Q.prototype.__class__=Q;Q.__cache__={};a.VoidPtr=Q;Q.prototype.__destroy__=Q.prototype.__destroy__=function(){Qc(this.ptr)};I.prototype=Object.create(p.prototype);I.prototype.constructor=I;I.prototype.__class__=I;I.__cache__={};a.DracoInt32Array=I;I.prototype.GetValue=
|
||||
I.prototype.GetValue=function(a){var b=this.ptr;a&&"object"===typeof a&&(a=a.ptr);return Rc(b,a)};I.prototype.size=I.prototype.size=function(){return Sc(this.ptr)};I.prototype.__destroy__=I.prototype.__destroy__=function(){Tc(this.ptr)};L.prototype=Object.create(p.prototype);L.prototype.constructor=L;L.prototype.__class__=L;L.__cache__={};a.Metadata=L;L.prototype.__destroy__=L.prototype.__destroy__=function(){Uc(this.ptr)};(function(){function c(){a.OK=Vc();a.DRACO_ERROR=Wc();a.IO_ERROR=Xc();a.INVALID_PARAMETER=
|
||||
Yc();a.UNSUPPORTED_VERSION=Zc();a.UNKNOWN_VERSION=$c();a.DT_INVALID=ad();a.DT_INT8=bd();a.DT_UINT8=cd();a.DT_INT16=dd();a.DT_UINT16=ed();a.DT_INT32=fd();a.DT_UINT32=gd();a.DT_INT64=hd();a.DT_UINT64=id();a.DT_FLOAT32=jd();a.DT_FLOAT64=kd();a.DT_BOOL=ld();a.DT_TYPES_COUNT=md();a.INVALID_GEOMETRY_TYPE=nd();a.POINT_CLOUD=od();a.TRIANGULAR_MESH=pd();a.ATTRIBUTE_INVALID_TRANSFORM=qd();a.ATTRIBUTE_NO_TRANSFORM=rd();a.ATTRIBUTE_QUANTIZATION_TRANSFORM=sd();a.ATTRIBUTE_OCTAHEDRON_TRANSFORM=td();a.INVALID=ud();
|
||||
a.POSITION=vd();a.NORMAL=wd();a.COLOR=xd();a.TEX_COORD=yd();a.GENERIC=zd()}Ba?c():Da.unshift(c)})();if("function"===typeof a.onModuleParsed)a.onModuleParsed();return m}}();"object"===typeof exports&&"object"===typeof module?module.exports=DracoDecoderModule:"function"===typeof define&&define.amd?define([],function(){return DracoDecoderModule}):"object"===typeof exports&&(exports.DracoDecoderModule=DracoDecoderModule);
|
|
@ -11,6 +11,7 @@ import {
|
|||
BidderMetadata,
|
||||
StringPublicKey,
|
||||
WalletSigner,
|
||||
toPublicKey,
|
||||
} from '@oyster/common';
|
||||
import { AccountLayout } from '@solana/spl-token';
|
||||
import { TransactionInstruction, Keypair, Connection } from '@solana/web3.js';
|
||||
|
@ -34,6 +35,7 @@ export async function sendCancelBid(
|
|||
|
||||
let signers: Array<Keypair[]> = [];
|
||||
let instructions: Array<TransactionInstruction[]> = [];
|
||||
|
||||
if (
|
||||
auctionView.auction.info.ended() &&
|
||||
auctionView.auction.info.state !== AuctionState.Ended
|
||||
|
@ -64,7 +66,9 @@ export async function sendCancelBid(
|
|||
);
|
||||
|
||||
if (
|
||||
wallet.publicKey.toBase58() === auctionView.auctionManager.authority &&
|
||||
wallet.publicKey.equals(
|
||||
toPublicKey(auctionView.auctionManager.authority),
|
||||
) &&
|
||||
auctionView.auction.info.ended()
|
||||
) {
|
||||
await claimUnusedPrizes(
|
||||
|
|
|
@ -1,23 +1,27 @@
|
|||
import { Keypair, Connection, TransactionInstruction } from '@solana/web3.js';
|
||||
import {
|
||||
ParsedAccount,
|
||||
SafetyDepositBox,
|
||||
sendTransactionsWithManualRetry,
|
||||
setAuctionAuthority,
|
||||
setVaultAuthority,
|
||||
TokenAccount,
|
||||
WalletSigner,
|
||||
} from '@oyster/common';
|
||||
|
||||
import { WalletNotConnectedError } from '@solana/wallet-adapter-base';
|
||||
import { AuctionView } from '../hooks';
|
||||
import { AuctionManagerStatus } from '../models/metaplex';
|
||||
import { decommissionAuctionManager } from '../models/metaplex/decommissionAuctionManager';
|
||||
import { claimUnusedPrizes } from './claimUnusedPrizes';
|
||||
import { WalletNotConnectedError } from '@solana/wallet-adapter-base';
|
||||
import { unwindVault } from './unwindVault';
|
||||
|
||||
export async function decommAuctionManagerAndReturnPrizes(
|
||||
connection: Connection,
|
||||
wallet: WalletSigner,
|
||||
auctionView: AuctionView,
|
||||
accountsByMint: Map<string, TokenAccount>,
|
||||
safetyDepositBoxesByVaultAndIndex: Record<
|
||||
string,
|
||||
ParsedAccount<SafetyDepositBox>
|
||||
>,
|
||||
) {
|
||||
if (!wallet.publicKey) throw new WalletNotConnectedError();
|
||||
|
||||
|
@ -55,22 +59,19 @@ export async function decommAuctionManagerAndReturnPrizes(
|
|||
instructions.push(decomInstructions);
|
||||
}
|
||||
|
||||
await claimUnusedPrizes(
|
||||
connection,
|
||||
wallet,
|
||||
auctionView,
|
||||
accountsByMint,
|
||||
[],
|
||||
{},
|
||||
{},
|
||||
signers,
|
||||
instructions,
|
||||
);
|
||||
|
||||
await sendTransactionsWithManualRetry(
|
||||
connection,
|
||||
wallet,
|
||||
instructions,
|
||||
signers,
|
||||
);
|
||||
|
||||
// now that is rightfully decommed, we have authority back properly to the vault,
|
||||
// and the auction manager is in disbursing, so we can unwind the vault.
|
||||
await unwindVault(
|
||||
connection,
|
||||
wallet,
|
||||
auctionView.vault,
|
||||
safetyDepositBoxesByVaultAndIndex,
|
||||
);
|
||||
}
|
||||
|
|
|
@ -14,6 +14,7 @@ import {
|
|||
StringPublicKey,
|
||||
toPublicKey,
|
||||
WalletSigner,
|
||||
Attribute,
|
||||
} from '@oyster/common';
|
||||
import React from 'react';
|
||||
import { MintLayout, Token } from '@solana/spl-token';
|
||||
|
@ -50,6 +51,7 @@ export const mintNFT = async (
|
|||
description: string;
|
||||
image: string | undefined;
|
||||
animation_url: string | undefined;
|
||||
attributes: Attribute[] | undefined;
|
||||
external_url: string;
|
||||
properties: any;
|
||||
creators: Creator[] | null;
|
||||
|
@ -68,6 +70,7 @@ export const mintNFT = async (
|
|||
seller_fee_basis_points: metadata.sellerFeeBasisPoints,
|
||||
image: metadata.image,
|
||||
animation_url: metadata.animation_url,
|
||||
attributes: metadata.attributes,
|
||||
external_url: metadata.external_url,
|
||||
properties: {
|
||||
...metadata.properties,
|
||||
|
|
|
@ -5,11 +5,10 @@ import {
|
|||
sendTransactionWithRetry,
|
||||
WalletSigner,
|
||||
} from '@oyster/common';
|
||||
|
||||
import { WalletNotConnectedError } from '@solana/wallet-adapter-base';
|
||||
import { WhitelistedCreator } from '../models/metaplex';
|
||||
import { setStore } from '../models/metaplex/setStore';
|
||||
import { setWhitelistedCreator } from '../models/metaplex/setWhitelistedCreator';
|
||||
import { WalletNotConnectedError } from '@solana/wallet-adapter-base';
|
||||
|
||||
// TODO if this becomes very slow move to batching txns like we do with settle.ts
|
||||
// but given how little this should be used keep it simple
|
||||
|
@ -29,8 +28,8 @@ export async function saveAdmin(
|
|||
|
||||
await setStore(
|
||||
isPublic,
|
||||
wallet.publicKey.toBase58(),
|
||||
wallet.publicKey.toBase58(),
|
||||
wallet.publicKey!.toBase58(),
|
||||
wallet.publicKey!.toBase58(),
|
||||
storeInstructions,
|
||||
);
|
||||
signers.push(storeSigners);
|
||||
|
@ -44,8 +43,8 @@ export async function saveAdmin(
|
|||
await setWhitelistedCreator(
|
||||
wc.address,
|
||||
wc.activated,
|
||||
wallet.publicKey.toBase58(),
|
||||
wallet.publicKey.toBase58(),
|
||||
wallet.publicKey!.toBase58(),
|
||||
wallet.publicKey!.toBase58(),
|
||||
wcInstructions,
|
||||
);
|
||||
signers.push(wcSigners);
|
||||
|
|
|
@ -113,7 +113,7 @@ export async function unwindVault(
|
|||
nft.info.store,
|
||||
vault.pubkey,
|
||||
vault.info.fractionMint,
|
||||
vault.info.authority,
|
||||
wallet.publicKey,
|
||||
currInstructions,
|
||||
);
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
@import '../../_colors.less';
|
||||
|
||||
.App-Bar {
|
||||
padding: 0px;
|
||||
justify-content: space-between !important;
|
||||
|
|
|
@ -15,14 +15,14 @@ const UserActions = () => {
|
|||
|
||||
const canCreate = useMemo(() => {
|
||||
return (
|
||||
store &&
|
||||
store.info &&
|
||||
(store.info.public ||
|
||||
whitelistedCreatorsByCreator[pubkey]?.info?.activated)
|
||||
store?.info?.public ||
|
||||
whitelistedCreatorsByCreator[pubkey]?.info?.activated
|
||||
);
|
||||
}, [pubkey, whitelistedCreatorsByCreator, store]);
|
||||
|
||||
return (
|
||||
<>
|
||||
{store && (
|
||||
<>
|
||||
{/* <Link to={`#`}>
|
||||
<Button className="app-btn">Bids</Button>
|
||||
|
@ -38,6 +38,8 @@ const UserActions = () => {
|
|||
</Button>
|
||||
</Link>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
|
|
@ -1,237 +1,23 @@
|
|||
import React from 'react';
|
||||
import * as THREE from 'three';
|
||||
import { DRACOLoader } from 'three/examples/jsm/loaders/DRACOLoader';
|
||||
import { GLTFLoader } from 'three/examples/jsm/loaders/GLTFLoader';
|
||||
import { TouchableOrbitControls } from './utils';
|
||||
|
||||
// const OrbitControls = oc(THREE);
|
||||
import React, { useRef } from 'react';
|
||||
import '@google/model-viewer/dist/model-viewer';
|
||||
|
||||
type MeshViewerProps = {
|
||||
className?: string;
|
||||
url?: string;
|
||||
gltf?: string;
|
||||
style?: React.CSSProperties;
|
||||
forcePhongMaterialForVertexColors?: boolean;
|
||||
onError?: () => void;
|
||||
};
|
||||
|
||||
const phongifyVertexColors = (gltfScene: any) => {
|
||||
const phongMaterial = new THREE.MeshPhongMaterial({
|
||||
shininess: 200,
|
||||
flatShading: true,
|
||||
});
|
||||
phongMaterial.vertexColors = true;
|
||||
|
||||
gltfScene.traverse((o: any) => {
|
||||
if (o instanceof THREE.Mesh && o.isMesh) {
|
||||
const meshO = o;
|
||||
if (
|
||||
!(meshO.material instanceof THREE.MeshPhongMaterial) &&
|
||||
meshO.material.vertexColors
|
||||
) {
|
||||
meshO.material = phongMaterial;
|
||||
meshO.material.needsUpdate = true;
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
export class MeshViewer extends React.Component<MeshViewerProps, {}> {
|
||||
private threeMountRef = React.createRef<HTMLDivElement>();
|
||||
|
||||
private gltfLoader: GLTFLoader = new GLTFLoader();
|
||||
|
||||
private renderer?: THREE.WebGLRenderer;
|
||||
|
||||
private camera?: THREE.OrthographicCamera;
|
||||
|
||||
private gltfScene?: THREE.Object3D;
|
||||
|
||||
private controls?: any;
|
||||
|
||||
private windowResizeListener?: any;
|
||||
|
||||
componentDidMount() {
|
||||
if (!this.threeMountRef.current) {
|
||||
return;
|
||||
}
|
||||
// === THREE.JS CODE START ===
|
||||
this.renderer = new THREE.WebGLRenderer({ antialias: true });
|
||||
|
||||
const width = this.threeMountRef.current.clientWidth;
|
||||
const height = this.threeMountRef.current.clientHeight;
|
||||
this.renderer.setSize(width, height, false);
|
||||
this.renderer.setClearColor(0);
|
||||
this.threeMountRef.current.appendChild(this.renderer.domElement);
|
||||
const self = this;
|
||||
this.windowResizeListener = () => self.handleWindowResize();
|
||||
window.addEventListener(`resize`, this.windowResizeListener);
|
||||
|
||||
const scene = new THREE.Scene();
|
||||
// this.camera = new THREE.PerspectiveCamera(75, width / height, 0.1, 1000);
|
||||
this.camera = new THREE.OrthographicCamera(
|
||||
width / -20,
|
||||
width / 20,
|
||||
height / 20,
|
||||
height / -20,
|
||||
0.1,
|
||||
10000,
|
||||
);
|
||||
this.controls = new TouchableOrbitControls(
|
||||
this.camera,
|
||||
this.renderer.domElement,
|
||||
);
|
||||
this.controls.target.set(0, 0, 0);
|
||||
this.controls.enableZoom = false;
|
||||
this.controls.enablePan = false;
|
||||
this.controls.autorotate = true;
|
||||
|
||||
let dirLight = new THREE.DirectionalLight(0xffffff, 0.4);
|
||||
dirLight.position.set(-20, 0, 50);
|
||||
scene.add(dirLight);
|
||||
|
||||
dirLight = new THREE.DirectionalLight(0xffffff, 0.4);
|
||||
dirLight.position.set(-20, 0, -50);
|
||||
scene.add(dirLight);
|
||||
|
||||
const ambientLight = new THREE.AmbientLight(0xffffff, 0.7);
|
||||
scene.add(ambientLight);
|
||||
|
||||
this.resetCamera();
|
||||
|
||||
const { renderer } = this;
|
||||
const { camera } = this;
|
||||
const { controls } = this;
|
||||
let meshURL = ``;
|
||||
|
||||
if (this.props.gltf) {
|
||||
meshURL = this.props.gltf;
|
||||
this.controls.enableZoom = true;
|
||||
this.controls.enablePan = true;
|
||||
this.controls.autorotate = false;
|
||||
} else if (this.props.url) {
|
||||
meshURL = this.props.url;
|
||||
}
|
||||
|
||||
const dracoLoader = new DRACOLoader();
|
||||
dracoLoader.setDecoderPath('js/libs/draco/');
|
||||
this.gltfLoader.setDRACOLoader(dracoLoader);
|
||||
|
||||
this.gltfLoader.load(
|
||||
meshURL,
|
||||
gltf => {
|
||||
const gltfScene = gltf.scene;
|
||||
|
||||
if (
|
||||
this.props.forcePhongMaterialForVertexColors ||
|
||||
this.props.forcePhongMaterialForVertexColors === undefined
|
||||
) {
|
||||
phongifyVertexColors(gltfScene);
|
||||
}
|
||||
|
||||
const bbox = new THREE.Box3().setFromObject(gltfScene);
|
||||
const c = new THREE.Vector3();
|
||||
bbox.getCenter(c);
|
||||
gltfScene.position.set(-c.x, -c.y, -c.z);
|
||||
this.gltfScene = gltfScene;
|
||||
scene.add(gltfScene);
|
||||
|
||||
let mixer: THREE.AnimationMixer | undefined;
|
||||
if (gltf.animations && gltf.animations.length > 0) {
|
||||
const clip = gltf.animations[0];
|
||||
mixer = new THREE.AnimationMixer(gltfScene);
|
||||
const action = mixer.clipAction(clip);
|
||||
action.play();
|
||||
}
|
||||
const clock = new THREE.Clock();
|
||||
|
||||
const animate = () => {
|
||||
requestAnimationFrame(animate);
|
||||
if (mixer) {
|
||||
mixer.update(clock.getDelta());
|
||||
}
|
||||
controls.update();
|
||||
renderer.render(scene, camera);
|
||||
};
|
||||
animate();
|
||||
this.handleWindowResize();
|
||||
},
|
||||
undefined,
|
||||
error => {
|
||||
if (this.props.onError) {
|
||||
this.props.onError();
|
||||
}
|
||||
console.error(error);
|
||||
},
|
||||
);
|
||||
this.handleWindowResize();
|
||||
}
|
||||
|
||||
componentWillUnmount() {
|
||||
window.removeEventListener(`resize`, this.windowResizeListener);
|
||||
if (this.threeMountRef && this.threeMountRef.current && this.renderer) {
|
||||
this.threeMountRef.current.removeChild(this.renderer.domElement);
|
||||
}
|
||||
}
|
||||
|
||||
handleWindowResize() {
|
||||
if (
|
||||
!this.threeMountRef ||
|
||||
!this.threeMountRef.current ||
|
||||
!this.camera ||
|
||||
!this.renderer
|
||||
) {
|
||||
return;
|
||||
}
|
||||
|
||||
let defaultZoom = 0.035;
|
||||
if (this.gltfScene) {
|
||||
const box = new THREE.Box3().setFromObject(this.gltfScene);
|
||||
const size = box.getSize(new THREE.Vector3()).length();
|
||||
const center = box.getCenter(new THREE.Vector3());
|
||||
defaultZoom = 2.1 / size;
|
||||
}
|
||||
|
||||
const width = this.threeMountRef.current.clientWidth;
|
||||
const height = this.threeMountRef.current.clientHeight;
|
||||
const zoom = defaultZoom * Math.min(width, height);
|
||||
|
||||
this.camera.left = width / -zoom;
|
||||
this.camera.right = width / zoom;
|
||||
this.camera.top = height / zoom;
|
||||
this.camera.bottom = height / -zoom;
|
||||
this.camera.updateProjectionMatrix();
|
||||
|
||||
this.renderer.setSize(width, height, false);
|
||||
}
|
||||
|
||||
resetCamera() {
|
||||
if (!this.camera || !this.controls) {
|
||||
return;
|
||||
}
|
||||
this.camera.position.setFromSphericalCoords(
|
||||
40,
|
||||
THREE.MathUtils.degToRad(45),
|
||||
-THREE.MathUtils.degToRad(0),
|
||||
);
|
||||
this.controls.autorotate = true;
|
||||
this.controls.update();
|
||||
}
|
||||
|
||||
render() {
|
||||
export function MeshViewer(props: MeshViewerProps) {
|
||||
return (
|
||||
<div
|
||||
ref={this.threeMountRef}
|
||||
style={{
|
||||
width: `100%`,
|
||||
height: `100%`,
|
||||
minHeight: `300px`,
|
||||
minWidth: 150,
|
||||
maxHeight: 300,
|
||||
...this.props.style,
|
||||
}}
|
||||
className={`three-orbit ${this.props.className || ''}`.trim()}
|
||||
// @ts-ignore
|
||||
<model-viewer
|
||||
style={{ width: `100%`, height: `100%`, minHeight: 400, minWidth: 400, maxHeight: 400, ...props.style }}
|
||||
src={props.url}
|
||||
auto-rotate
|
||||
rotation-per-second="40deg"
|
||||
className={props.className}
|
||||
camera-controls
|
||||
/>
|
||||
);
|
||||
}
|
||||
)
|
||||
}
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -369,7 +369,7 @@ export function Notifications() {
|
|||
connection,
|
||||
wallet,
|
||||
v,
|
||||
accountByMint,
|
||||
safetyDepositBoxesByVaultAndIndex,
|
||||
);
|
||||
} catch (e) {
|
||||
console.error(e);
|
||||
|
|
|
@ -0,0 +1,45 @@
|
|||
import { CopyOutlined } from '@ant-design/icons';
|
||||
import { Button, Card } from 'antd';
|
||||
import { FC } from 'react';
|
||||
import { useCallback, useRef } from 'react';
|
||||
|
||||
interface Variables {
|
||||
storeAddress?: string;
|
||||
storeOwnerAddress?: string;
|
||||
}
|
||||
|
||||
export const SetupVariables: FC<Variables> = ({
|
||||
storeAddress,
|
||||
storeOwnerAddress,
|
||||
}) => {
|
||||
const ref = useRef<HTMLDivElement>(null);
|
||||
|
||||
const copySettings = useCallback(() => {
|
||||
const text = ref.current?.innerText;
|
||||
if (text) {
|
||||
navigator.clipboard.writeText(text);
|
||||
}
|
||||
}, []);
|
||||
|
||||
if (!storeAddress && !storeOwnerAddress) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<Card
|
||||
title="Store configuration"
|
||||
extra={
|
||||
<Button
|
||||
type="dashed"
|
||||
onClick={copySettings}
|
||||
icon={<CopyOutlined />}
|
||||
></Button>
|
||||
}
|
||||
>
|
||||
<div ref={ref}>
|
||||
{storeOwnerAddress && <p>STORE_OWNER_ADDRESS={storeOwnerAddress}</p>}
|
||||
{storeAddress && <p>STORE_ADDRESS={storeAddress}</p>}
|
||||
</div>
|
||||
</Card>
|
||||
);
|
||||
};
|
|
@ -14,7 +14,6 @@ import { processMetaplexAccounts } from './processMetaplexAccounts';
|
|||
import { processMetaData } from './processMetaData';
|
||||
import { processVaultData } from './processVaultData';
|
||||
import {
|
||||
findProgramAddress,
|
||||
getEdition,
|
||||
getMultipleAccounts,
|
||||
MAX_CREATOR_LEN,
|
||||
|
@ -25,11 +24,8 @@ import {
|
|||
Metadata,
|
||||
METADATA_PREFIX,
|
||||
ParsedAccount,
|
||||
} from '../../../../common/dist/lib';
|
||||
import {
|
||||
MAX_WHITELISTED_CREATOR_SIZE,
|
||||
MetaplexKey,
|
||||
} from '../../models/metaplex';
|
||||
} from '@oyster/common';
|
||||
import { MAX_WHITELISTED_CREATOR_SIZE } from '../../models/metaplex';
|
||||
|
||||
async function getProgramAccounts(
|
||||
connection: Connection,
|
||||
|
@ -242,6 +238,13 @@ export const loadAccounts = async (connection: Connection, all: boolean) => {
|
|||
}
|
||||
}
|
||||
|
||||
if (setOf100MetadataEditionKeys.length >= 0) {
|
||||
editionPromises.push(
|
||||
getMultipleAccounts(connection, setOf100MetadataEditionKeys, 'recent'),
|
||||
);
|
||||
setOf100MetadataEditionKeys = [];
|
||||
}
|
||||
|
||||
const responses = await Promise.all(editionPromises);
|
||||
for (let i = 0; i < responses.length; i++) {
|
||||
const returnedAccounts = responses[i];
|
||||
|
|
|
@ -1,12 +1,12 @@
|
|||
import {
|
||||
useConnection,
|
||||
setProgramIds,
|
||||
useConnectionConfig,
|
||||
useStore,
|
||||
AUCTION_ID,
|
||||
METAPLEX_ID,
|
||||
VAULT_ID,
|
||||
METADATA_PROGRAM_ID,
|
||||
toPublicKey,
|
||||
useQuerySearch,
|
||||
} from '@oyster/common';
|
||||
import React, {
|
||||
useCallback,
|
||||
|
@ -56,9 +56,9 @@ const MetaContext = React.createContext<MetaContextState>({
|
|||
|
||||
export function MetaProvider({ children = null as any }) {
|
||||
const connection = useConnection();
|
||||
const { env } = useConnectionConfig();
|
||||
const urlParams = new URLSearchParams(window.location.search);
|
||||
const all = urlParams.get('all') == 'true';
|
||||
const { isReady, storeAddress } = useStore();
|
||||
const searchParams = useQuerySearch();
|
||||
const all = searchParams.get('all') == 'true';
|
||||
|
||||
const [state, setState] = useState<MetaState>({
|
||||
metadata: [],
|
||||
|
@ -110,7 +110,14 @@ export function MetaProvider({ children = null as any }) {
|
|||
|
||||
useEffect(() => {
|
||||
(async () => {
|
||||
await setProgramIds(env);
|
||||
if (!storeAddress) {
|
||||
if (isReady) {
|
||||
setIsLoading(false);
|
||||
}
|
||||
return;
|
||||
} else if (!state.store) {
|
||||
setIsLoading(true);
|
||||
}
|
||||
|
||||
console.log('-----> Query started');
|
||||
|
||||
|
@ -125,7 +132,7 @@ export function MetaProvider({ children = null as any }) {
|
|||
|
||||
updateMints(nextState.metadataByMint);
|
||||
})();
|
||||
}, [connection, setState, updateMints, env]);
|
||||
}, [connection, setState, updateMints, storeAddress, isReady]);
|
||||
|
||||
const updateStateValue = useMemo<UpdateStateValueFunc>(
|
||||
() => (prop, key, value) => {
|
||||
|
|
|
@ -48,6 +48,7 @@ export interface AuctionView {
|
|||
// items 1:1 with winning configs FOR NOW
|
||||
// once tiered auctions come along, this becomes an array of arrays.
|
||||
items: AuctionViewItem[][];
|
||||
safetyDepositBoxes: ParsedAccount<SafetyDepositBox>[];
|
||||
auction: ParsedAccount<AuctionData>;
|
||||
auctionManager: AuctionManager;
|
||||
participationItem?: AuctionViewItem;
|
||||
|
@ -398,6 +399,7 @@ export function processAccountsIntoAuctionView(
|
|||
auctionManager,
|
||||
state,
|
||||
vault,
|
||||
safetyDepositBoxes: boxes,
|
||||
items: auctionManager.getItemsFromSafetyDepositBoxes(
|
||||
metadataByMint,
|
||||
masterEditionsByPrintingMint,
|
||||
|
|
|
@ -41,7 +41,7 @@ export async function decommissionAuctionManager(
|
|||
{
|
||||
pubkey: toPublicKey(vault),
|
||||
isSigner: false,
|
||||
isWritable: false,
|
||||
isWritable: true,
|
||||
},
|
||||
{
|
||||
pubkey: toPublicKey(store),
|
||||
|
@ -58,6 +58,11 @@ export async function decommissionAuctionManager(
|
|||
isSigner: false,
|
||||
isWritable: false,
|
||||
},
|
||||
{
|
||||
pubkey: toPublicKey(programIds().vault),
|
||||
isSigner: false,
|
||||
isWritable: false,
|
||||
},
|
||||
];
|
||||
|
||||
instructions.push(
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
import type { AppProps } from 'next/app';
|
||||
import Head from 'next/head';
|
||||
|
||||
import '../styles.less';
|
||||
import '../styles/index.less';
|
||||
|
||||
export default function App({ Component, pageProps }: AppProps) {
|
||||
return (
|
||||
|
@ -10,7 +10,9 @@ export default function App({ Component, pageProps }: AppProps) {
|
|||
<meta name="viewport" content="width=device-width, initial-scale=1" />
|
||||
<title>Metaplex NFT Marketplace</title>
|
||||
</Head>
|
||||
{typeof window === 'undefined' ? null : <Component {...pageProps} />}
|
||||
<div id="root">
|
||||
<Component {...pageProps} />
|
||||
</div>
|
||||
</>
|
||||
);
|
||||
}
|
||||
|
|
|
@ -6,16 +6,6 @@ const CreateReactAppEntryPoint = dynamic(() => import('../App'), {
|
|||
});
|
||||
|
||||
function App() {
|
||||
const [isMounted, setIsMounted] = useState(false);
|
||||
|
||||
useEffect(() => {
|
||||
setIsMounted(true);
|
||||
}, []);
|
||||
|
||||
if (!isMounted) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return <CreateReactAppEntryPoint />;
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,37 @@
|
|||
import {
|
||||
AccountsProvider,
|
||||
ConnectionProvider,
|
||||
StoreProvider,
|
||||
WalletProvider,
|
||||
} from '@oyster/common';
|
||||
import { FC } from 'react';
|
||||
import { UseWalletProvider } from 'use-wallet';
|
||||
import { ConfettiProvider } from './components/Confetti';
|
||||
import { AppLayout } from './components/Layout';
|
||||
import { MetaProvider } from './contexts/meta';
|
||||
import { CoingeckoProvider } from './contexts/coingecko';
|
||||
|
||||
export const Providers: FC = ({ children }) => {
|
||||
return (
|
||||
<ConnectionProvider>
|
||||
<WalletProvider>
|
||||
<UseWalletProvider chainId={5}>
|
||||
<AccountsProvider>
|
||||
<CoingeckoProvider>
|
||||
<StoreProvider
|
||||
ownerAddress={process.env.NEXT_PUBLIC_STORE_OWNER_ADDRESS}
|
||||
storeAddress={process.env.NEXT_PUBLIC_STORE_ADDRESS}
|
||||
>
|
||||
<MetaProvider>
|
||||
<ConfettiProvider>
|
||||
<AppLayout>{children}</AppLayout>
|
||||
</ConfettiProvider>
|
||||
</MetaProvider>
|
||||
</StoreProvider>
|
||||
</CoingeckoProvider>
|
||||
</AccountsProvider>
|
||||
</UseWalletProvider>
|
||||
</WalletProvider>
|
||||
</ConnectionProvider>
|
||||
);
|
||||
};
|
|
@ -1,49 +1,26 @@
|
|||
import React from 'react';
|
||||
import { HashRouter, Route, Switch } from 'react-router-dom';
|
||||
import { contexts } from '@oyster/common';
|
||||
import { MetaProvider } from './contexts';
|
||||
import { AppLayout } from './components/Layout';
|
||||
|
||||
import { Providers } from './providers';
|
||||
import {
|
||||
AnalyticsView,
|
||||
ArtCreateView,
|
||||
ArtistsView,
|
||||
ArtistView,
|
||||
ArtView,
|
||||
ArtworksView,
|
||||
AuctionCreateView,
|
||||
AuctionView,
|
||||
HomeView,
|
||||
ArtworksView,
|
||||
AnalyticsView,
|
||||
} from './views';
|
||||
import { UseWalletProvider } from 'use-wallet';
|
||||
import { CoingeckoProvider } from './contexts/coingecko';
|
||||
import { BillingView } from './views/auction/billing';
|
||||
import { AdminView } from './views/admin';
|
||||
import { ConfettiProvider } from './components/Confetti';
|
||||
const { WalletProvider } = contexts.Wallet;
|
||||
const { ConnectionProvider } = contexts.Connection;
|
||||
const { AccountsProvider } = contexts.Accounts;
|
||||
import { BillingView } from './views/auction/billing';
|
||||
|
||||
export function Routes() {
|
||||
return (
|
||||
<>
|
||||
<HashRouter basename={'/'}>
|
||||
<ConnectionProvider
|
||||
storeId={process.env.NEXT_PUBLIC_STORE_OWNER_ADDRESS_ADDRESS}
|
||||
>
|
||||
<WalletProvider>
|
||||
<UseWalletProvider chainId={5}>
|
||||
<AccountsProvider>
|
||||
<CoingeckoProvider>
|
||||
<MetaProvider>
|
||||
<ConfettiProvider>
|
||||
<AppLayout>
|
||||
<Providers>
|
||||
<Switch>
|
||||
<Route
|
||||
exact
|
||||
path="/admin"
|
||||
component={() => <AdminView />}
|
||||
/>
|
||||
<Route exact path="/admin" component={() => <AdminView />} />
|
||||
<Route
|
||||
exact
|
||||
path="/analytics"
|
||||
|
@ -59,21 +36,9 @@ export function Routes() {
|
|||
path="/artworks/:id?"
|
||||
component={() => <ArtworksView />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/art/:id"
|
||||
component={() => <ArtView />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/artists/:id"
|
||||
component={() => <ArtistView />}
|
||||
/>
|
||||
<Route
|
||||
exact
|
||||
path="/artists"
|
||||
component={() => <ArtistsView />}
|
||||
/>
|
||||
<Route exact path="/art/:id" component={() => <ArtView />} />
|
||||
<Route exact path="/artists/:id" component={() => <ArtistView />} />
|
||||
<Route exact path="/artists" component={() => <ArtistsView />} />
|
||||
<Route
|
||||
exact
|
||||
path="/auction/create/:step_param?"
|
||||
|
@ -91,14 +56,7 @@ export function Routes() {
|
|||
/>
|
||||
<Route path="/" component={() => <HomeView />} />
|
||||
</Switch>
|
||||
</AppLayout>
|
||||
</ConfettiProvider>
|
||||
</MetaProvider>
|
||||
</CoingeckoProvider>
|
||||
</AccountsProvider>
|
||||
</UseWalletProvider>
|
||||
</WalletProvider>
|
||||
</ConnectionProvider>
|
||||
</Providers>
|
||||
</HashRouter>
|
||||
</>
|
||||
);
|
||||
|
|
|
@ -1,24 +0,0 @@
|
|||
@import './fonts.less';
|
||||
@import './App.less';
|
||||
|
||||
@import '@oyster/common/styles.css';
|
||||
|
||||
@import './views/home/index.less';
|
||||
@import './views/styles.less';
|
||||
@import './views/auction/billing.less';
|
||||
@import './views/auction/index.less';
|
||||
@import './views/art/index.less';
|
||||
@import './views/admin/index.less';
|
||||
|
||||
@import './components/AuctionRenderCard/index.less';
|
||||
@import './components/AppBar/index.less';
|
||||
@import './components/AppBar/searchBox.less';
|
||||
@import './components/Footer/index.less';
|
||||
@import './components/AmountLabel/index.less';
|
||||
@import './components/Layout/index.less';
|
||||
@import './components/UserSearch/styles.less';
|
||||
@import './components/PreSaleBanner/index.less';
|
||||
@import './components/AuctionCard/index.less';
|
||||
@import './components/ArtCard/index.less';
|
||||
@import './components/ArtistCard/index.less';
|
||||
@import './components/Notifications/index.less';
|
|
@ -1,8 +1,6 @@
|
|||
@import '~antd/es/style/themes/dark.less';
|
||||
@import '~antd/dist/antd.dark.less';
|
||||
|
||||
@solana-green: #3d4844;
|
||||
|
||||
html {
|
||||
overflow-y: scroll;
|
||||
width: 100vw;
|
||||
|
@ -183,3 +181,7 @@ code {
|
|||
transition: 150ms;
|
||||
padding-top: 5px;
|
||||
}
|
||||
|
||||
model-viewer {
|
||||
--poster-color: transparent;
|
||||
}
|
|
@ -3,3 +3,5 @@
|
|||
@tungsten-60: #547595;
|
||||
@tungsten-50: #0D1B28;
|
||||
@tungsten-40: #7BA4C7;
|
||||
|
||||
@solana-green: #3d4844;
|
|
@ -0,0 +1,25 @@
|
|||
@import './fonts.less';
|
||||
@import './colors.less';
|
||||
@import './app.less';
|
||||
|
||||
@import '@oyster/common/styles.css';
|
||||
|
||||
@import '../views/home/index.less';
|
||||
@import '../views/styles.less';
|
||||
@import '../views/auction/billing.less';
|
||||
@import '../views/auction/index.less';
|
||||
@import '../views/art/index.less';
|
||||
@import '../views/admin/index.less';
|
||||
|
||||
@import '../components/AuctionRenderCard/index.less';
|
||||
@import '../components/AppBar/index.less';
|
||||
@import '../components/AppBar/searchBox.less';
|
||||
@import '../components/Footer/index.less';
|
||||
@import '../components/AmountLabel/index.less';
|
||||
@import '../components/Layout/index.less';
|
||||
@import '../components/UserSearch/styles.less';
|
||||
@import '../components/PreSaleBanner/index.less';
|
||||
@import '../components/AuctionCard/index.less';
|
||||
@import '../components/ArtCard/index.less';
|
||||
@import '../components/ArtistCard/index.less';
|
||||
@import '../components/Notifications/index.less';
|
|
@ -1,4 +1,4 @@
|
|||
import React, { useState } from 'react';
|
||||
import React, {useCallback, useEffect, useMemo, useState} from 'react';
|
||||
import {
|
||||
Layout,
|
||||
Row,
|
||||
|
@ -9,6 +9,7 @@ import {
|
|||
Modal,
|
||||
Button,
|
||||
Input,
|
||||
Divider,
|
||||
} from 'antd';
|
||||
import { useMeta } from '../../contexts';
|
||||
import { Store, WhitelistedCreator } from '../../models/metaplex';
|
||||
|
@ -17,27 +18,54 @@ import {
|
|||
notify,
|
||||
ParsedAccount,
|
||||
shortenAddress,
|
||||
useConnection,
|
||||
useUserAccounts,
|
||||
StringPublicKey,
|
||||
useConnection,
|
||||
useStore,
|
||||
useUserAccounts, useWalletModal,
|
||||
WalletSigner,
|
||||
} from '@oyster/common';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import { Connection } from '@solana/web3.js';
|
||||
import { saveAdmin } from '../../actions/saveAdmin';
|
||||
import { useMemo } from 'react';
|
||||
import {
|
||||
convertMasterEditions,
|
||||
filterMetadata,
|
||||
} from '../../actions/convertMasterEditions';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { SetupVariables } from '../../components/SetupVariables';
|
||||
|
||||
const { Content } = Layout;
|
||||
export const AdminView = () => {
|
||||
const { store, whitelistedCreatorsByCreator } = useMeta();
|
||||
const { store, whitelistedCreatorsByCreator, isLoading } = useMeta();
|
||||
const connection = useConnection();
|
||||
const wallet = useWallet();
|
||||
const { setVisible } = useWalletModal();
|
||||
const connect = useCallback(
|
||||
() => (wallet.wallet ? wallet.connect().catch() : setVisible(true)),
|
||||
[wallet.wallet, wallet.connect, setVisible],
|
||||
);
|
||||
const { storeAddress, setStoreForOwner, isConfigured } = useStore();
|
||||
|
||||
return store && connection && wallet.connected ? (
|
||||
useEffect(() => {
|
||||
if (!store && !storeAddress && wallet.publicKey) {
|
||||
setStoreForOwner(wallet.publicKey.toBase58());
|
||||
}
|
||||
}, [store, storeAddress, wallet.publicKey]);
|
||||
console.log('@admin', wallet.connected, storeAddress, isLoading, store);
|
||||
|
||||
return (
|
||||
<>
|
||||
{!wallet.connected ? (
|
||||
<p>
|
||||
<Button type="primary" className="app-btn" onClick={connect}>
|
||||
Connect
|
||||
</Button>{' '}
|
||||
to admin store.
|
||||
</p>
|
||||
) : !storeAddress || isLoading ? (
|
||||
<Spin />
|
||||
) : store && wallet ? (
|
||||
<>
|
||||
<InnerAdminView
|
||||
store={store}
|
||||
whitelistedCreatorsByCreator={whitelistedCreatorsByCreator}
|
||||
|
@ -45,8 +73,28 @@ export const AdminView = () => {
|
|||
wallet={wallet}
|
||||
connected={wallet.connected}
|
||||
/>
|
||||
{!isConfigured && (
|
||||
<>
|
||||
<Divider />
|
||||
<Divider />
|
||||
<p>
|
||||
To finish initialization please copy config below into{' '}
|
||||
<b>packages/web/.env</b> and restart yarn or redeploy
|
||||
</p>
|
||||
<SetupVariables
|
||||
storeAddress={storeAddress}
|
||||
storeOwnerAddress={wallet.publicKey?.toBase58()}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
) : (
|
||||
<Spin />
|
||||
<>
|
||||
<p>Store is not initialized</p>
|
||||
<Link to={`/`}>Go to initialize</Link>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
|
@ -156,10 +204,6 @@ function InnerAdminView({
|
|||
fn();
|
||||
}, [connected]);
|
||||
|
||||
if (!store || !newStore) {
|
||||
return <p>Store is not defined</p>;
|
||||
}
|
||||
|
||||
const uniqueCreators = Object.values(whitelistedCreatorsByCreator).reduce(
|
||||
(acc: Record<string, WhitelistedCreator>, e) => {
|
||||
acc[e.info.address] = e.info;
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import React from 'react';
|
||||
import { Row, Col, Divider, Layout, Tag, Button, Skeleton } from 'antd';
|
||||
import { Row, Col, Divider, Layout, Tag, Button, Skeleton, List, Card } from 'antd';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { useArt, useExtendedArt } from './../../hooks';
|
||||
|
||||
|
@ -37,6 +37,7 @@ export const ArtView = () => {
|
|||
// }, new Map<string, TokenAccount>());
|
||||
|
||||
const description = data?.description;
|
||||
const attributes = data?.attributes;
|
||||
|
||||
const pubkey = wallet.publicKey?.toBase58() || '';
|
||||
|
||||
|
@ -181,7 +182,7 @@ export const ArtView = () => {
|
|||
Mark as Sold
|
||||
</Button> */}
|
||||
</Col>
|
||||
<Col span="24">
|
||||
<Col span="12">
|
||||
<Divider />
|
||||
{art.creators?.find(c => !c.verified) && unverified}
|
||||
<br />
|
||||
|
@ -195,6 +196,25 @@ export const ArtView = () => {
|
|||
<div className="info-header">ABOUT THE CREATOR</div>
|
||||
<div className="info-content">{art.about}</div> */}
|
||||
</Col>
|
||||
<Col span="12">
|
||||
{attributes &&
|
||||
<>
|
||||
<Divider />
|
||||
<br />
|
||||
<div className="info-header">Attributes</div>
|
||||
<List
|
||||
size="large"
|
||||
grid={{ column: 4 }}
|
||||
>
|
||||
{attributes.map(attribute =>
|
||||
<List.Item>
|
||||
<Card title={attribute.trait_type}>{attribute.value}</Card>
|
||||
</List.Item>
|
||||
)}
|
||||
</List>
|
||||
</>
|
||||
}
|
||||
</Col>
|
||||
</Row>
|
||||
</Col>
|
||||
</Content>
|
||||
|
|
|
@ -13,6 +13,7 @@ import {
|
|||
InputNumber,
|
||||
Form,
|
||||
Typography,
|
||||
Space,
|
||||
} from 'antd';
|
||||
import { ArtCard } from './../../components/ArtCard';
|
||||
import { UserSearch, UserValue } from './../../components/UserSearch';
|
||||
|
@ -22,6 +23,7 @@ import {
|
|||
MAX_METADATA_LEN,
|
||||
useConnection,
|
||||
IMetadataExtension,
|
||||
Attribute,
|
||||
MetadataCategory,
|
||||
useConnectionConfig,
|
||||
Creator,
|
||||
|
@ -39,6 +41,7 @@ import { useHistory, useParams } from 'react-router-dom';
|
|||
import { cleanName, getLast } from '../../utils/utils';
|
||||
import { AmountLabel } from '../../components/AmountLabel';
|
||||
import useWindowDimensions from '../../utils/layout';
|
||||
import { MinusCircleOutlined, PlusOutlined } from '@ant-design/icons';
|
||||
|
||||
const { Step } = Steps;
|
||||
const { Dragger } = Upload;
|
||||
|
@ -65,6 +68,7 @@ export const ArtCreateView = () => {
|
|||
external_url: '',
|
||||
image: '',
|
||||
animation_url: undefined,
|
||||
attributes: undefined,
|
||||
seller_fee_basis_points: 0,
|
||||
creators: [],
|
||||
properties: {
|
||||
|
@ -96,6 +100,7 @@ export const ArtCreateView = () => {
|
|||
sellerFeeBasisPoints: attributes.seller_fee_basis_points,
|
||||
image: attributes.image,
|
||||
animation_url: attributes.animation_url,
|
||||
attributes: attributes.attributes,
|
||||
external_url: attributes.external_url,
|
||||
properties: {
|
||||
files: attributes.properties.files,
|
||||
|
@ -547,6 +552,7 @@ const InfoStep = (props: {
|
|||
props.files,
|
||||
props.attributes,
|
||||
);
|
||||
const [form] = Form.useForm();
|
||||
|
||||
useEffect(() => {
|
||||
setRoyalties(
|
||||
|
@ -642,6 +648,54 @@ const InfoStep = (props: {
|
|||
className="royalties-input"
|
||||
/>
|
||||
</label>
|
||||
<label className="action-field">
|
||||
<span className="field-title">Attributes</span>
|
||||
</label>
|
||||
<Form
|
||||
name="dynamic_attributes"
|
||||
form={form}
|
||||
autoComplete="off"
|
||||
>
|
||||
<Form.List name="attributes">
|
||||
{(fields, { add, remove }) => (
|
||||
<>
|
||||
{fields.map(({ key, name, fieldKey }) => (
|
||||
<Space key={key} align="baseline">
|
||||
<Form.Item
|
||||
name={[name, 'trait_type']}
|
||||
fieldKey={[fieldKey, 'trait_type']}
|
||||
hasFeedback
|
||||
>
|
||||
<Input placeholder="trait_type (Optional)" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
name={[name, 'value']}
|
||||
fieldKey={[fieldKey, 'value']}
|
||||
rules={[{ required: true, message: 'Missing value' }]}
|
||||
hasFeedback
|
||||
>
|
||||
<Input placeholder="value" />
|
||||
</Form.Item>
|
||||
<Form.Item
|
||||
|
||||
name={[name, 'display_type']}
|
||||
fieldKey={[fieldKey, 'display_type']}
|
||||
hasFeedback
|
||||
>
|
||||
<Input placeholder="display_type (Optional)" />
|
||||
</Form.Item>
|
||||
<MinusCircleOutlined onClick={() => remove(name)} />
|
||||
</Space>
|
||||
))}
|
||||
<Form.Item>
|
||||
<Button type="dashed" onClick={() => add()} block icon={<PlusOutlined />}>
|
||||
Add attribute
|
||||
</Button>
|
||||
</Form.Item>
|
||||
</>
|
||||
)}
|
||||
</Form.List>
|
||||
</Form>
|
||||
</Col>
|
||||
</Row>
|
||||
|
||||
|
@ -650,11 +704,24 @@ const InfoStep = (props: {
|
|||
type="primary"
|
||||
size="large"
|
||||
onClick={() => {
|
||||
form.validateFields()
|
||||
.then(values => {
|
||||
const nftAttributes = values.attributes;
|
||||
// value is number if possible
|
||||
for (const nftAttribute of nftAttributes || []) {
|
||||
const newValue = Number(nftAttribute.value);
|
||||
if (!isNaN(newValue)) {
|
||||
nftAttribute.value = newValue;
|
||||
}
|
||||
}
|
||||
console.log('Adding NFT attributes:', nftAttributes)
|
||||
props.setAttributes({
|
||||
...props.attributes,
|
||||
attributes: nftAttributes,
|
||||
});
|
||||
|
||||
props.confirm();
|
||||
})
|
||||
}}
|
||||
className="action-btn"
|
||||
>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
import React, { useState, useEffect } from 'react';
|
||||
import { useParams } from 'react-router-dom';
|
||||
import { Row, Col, Button, Skeleton, Carousel } from 'antd';
|
||||
import { Row, Col, Button, Skeleton, Carousel, List, Card } from 'antd';
|
||||
import { AuctionCard } from '../../components/AuctionCard';
|
||||
import { Connection } from '@solana/web3.js';
|
||||
import {
|
||||
|
@ -95,6 +95,7 @@ export const AuctionView = () => {
|
|||
|
||||
const hasDescription = data === undefined || data.description === undefined;
|
||||
const description = data?.description;
|
||||
const attributes = data?.attributes;
|
||||
|
||||
const items = [
|
||||
...(auction?.items
|
||||
|
@ -158,7 +159,22 @@ export const AuctionView = () => {
|
|||
No description provided.
|
||||
</div>
|
||||
))}
|
||||
|
||||
</div>
|
||||
|
||||
{attributes &&
|
||||
<>
|
||||
<h6>Attributes</h6>
|
||||
<List
|
||||
grid={{ column: 4 }}
|
||||
>
|
||||
{attributes.map(attribute =>
|
||||
<List.Item>
|
||||
<Card title={attribute.trait_type}>{attribute.value}</Card>
|
||||
</List.Item>
|
||||
)}
|
||||
</List>
|
||||
</>}
|
||||
{/* {auctionData[id] && (
|
||||
<>
|
||||
<h6>About this Auction</h6>
|
||||
|
|
|
@ -0,0 +1,206 @@
|
|||
import { useWallet } from '@oyster/common';
|
||||
import { Col, Layout, Row, Tabs } from 'antd';
|
||||
import BN from 'bn.js';
|
||||
import React, { useMemo, useState } from 'react';
|
||||
import Masonry from 'react-masonry-css';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { AuctionRenderCard } from '../../components/AuctionRenderCard';
|
||||
import { CardLoader } from '../../components/MyLoader';
|
||||
import { PreSaleBanner } from '../../components/PreSaleBanner';
|
||||
import { useMeta } from '../../contexts';
|
||||
import { AuctionView, AuctionViewState, useAuctions } from '../../hooks';
|
||||
|
||||
const { TabPane } = Tabs;
|
||||
|
||||
const { Content } = Layout;
|
||||
|
||||
export enum LiveAuctionViewState {
|
||||
All = '0',
|
||||
Participated = '1',
|
||||
Ended = '2',
|
||||
Resale = '3',
|
||||
}
|
||||
|
||||
export const AuctionListView = () => {
|
||||
const auctions = useAuctions(AuctionViewState.Live);
|
||||
const auctionsEnded = useAuctions(AuctionViewState.Ended);
|
||||
const [activeKey, setActiveKey] = useState(LiveAuctionViewState.All);
|
||||
const { isLoading } = useMeta();
|
||||
const { wallet, connected } = useWallet();
|
||||
const breakpointColumnsObj = {
|
||||
default: 4,
|
||||
1100: 3,
|
||||
700: 2,
|
||||
500: 1,
|
||||
};
|
||||
|
||||
// Check if the auction is primary sale or not
|
||||
const checkPrimarySale = (auc: AuctionView) => {
|
||||
var flag = 0;
|
||||
auc.items.forEach(i => {
|
||||
i.forEach(j => {
|
||||
if (j.metadata.info.primarySaleHappened == true) {
|
||||
flag = 1;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (flag == 1) return true;
|
||||
});
|
||||
if (flag == 1) return true;
|
||||
else return false;
|
||||
};
|
||||
|
||||
const resaleAuctions = auctions
|
||||
.sort(
|
||||
(a, b) =>
|
||||
a.auction.info.endedAt
|
||||
?.sub(b.auction.info.endedAt || new BN(0))
|
||||
.toNumber() || 0,
|
||||
)
|
||||
.filter(m => checkPrimarySale(m) == true);
|
||||
|
||||
// Removed resales from live auctions
|
||||
const liveAuctions = auctions
|
||||
.sort(
|
||||
(a, b) =>
|
||||
a.auction.info.endedAt
|
||||
?.sub(b.auction.info.endedAt || new BN(0))
|
||||
.toNumber() || 0,
|
||||
)
|
||||
.filter(a => !resaleAuctions.includes(a));
|
||||
|
||||
let items = liveAuctions;
|
||||
|
||||
switch (activeKey) {
|
||||
case LiveAuctionViewState.All:
|
||||
items = liveAuctions;
|
||||
break;
|
||||
case LiveAuctionViewState.Participated:
|
||||
items = liveAuctions
|
||||
.concat(auctionsEnded)
|
||||
.filter(
|
||||
(m, idx) =>
|
||||
m.myBidderMetadata?.info.bidderPubkey ==
|
||||
wallet?.publicKey?.toBase58(),
|
||||
);
|
||||
break;
|
||||
case LiveAuctionViewState.Resale:
|
||||
items = resaleAuctions;
|
||||
break;
|
||||
case LiveAuctionViewState.Ended:
|
||||
items = auctionsEnded;
|
||||
break;
|
||||
}
|
||||
|
||||
const heroAuction = useMemo(
|
||||
() =>
|
||||
auctions.filter(a => {
|
||||
// const now = moment().unix();
|
||||
return !a.auction.info.ended() && !resaleAuctions.includes(a);
|
||||
// filter out auction for banner that are further than 30 days in the future
|
||||
// return Math.floor(delta / 86400) <= 30;
|
||||
})?.[0],
|
||||
[auctions],
|
||||
);
|
||||
|
||||
const liveAuctionsView = (
|
||||
<Masonry
|
||||
breakpointCols={breakpointColumnsObj}
|
||||
className="my-masonry-grid"
|
||||
columnClassName="my-masonry-grid_column"
|
||||
>
|
||||
{!isLoading
|
||||
? items.map((m, idx) => {
|
||||
if (m === heroAuction) {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = m.auction.pubkey;
|
||||
return (
|
||||
<Link to={`/auction/${id}`} key={idx}>
|
||||
<AuctionRenderCard key={id} auctionView={m} />
|
||||
</Link>
|
||||
);
|
||||
})
|
||||
: [...Array(10)].map((_, idx) => <CardLoader key={idx} />)}
|
||||
</Masonry>
|
||||
);
|
||||
const endedAuctions = (
|
||||
<Masonry
|
||||
breakpointCols={breakpointColumnsObj}
|
||||
className="my-masonry-grid"
|
||||
columnClassName="my-masonry-grid_column"
|
||||
>
|
||||
{!isLoading
|
||||
? auctionsEnded.map((m, idx) => {
|
||||
if (m === heroAuction) {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = m.auction.pubkey;
|
||||
return (
|
||||
<Link to={`/auction/${id}`} key={idx}>
|
||||
<AuctionRenderCard key={id} auctionView={m} />
|
||||
</Link>
|
||||
);
|
||||
})
|
||||
: [...Array(10)].map((_, idx) => <CardLoader key={idx} />)}
|
||||
</Masonry>
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<PreSaleBanner auction={heroAuction} />
|
||||
<Layout>
|
||||
<Content style={{ display: 'flex', flexWrap: 'wrap' }}>
|
||||
<Col style={{ width: '100%', marginTop: 10 }}>
|
||||
{liveAuctions.length >= 0 && (
|
||||
<Row>
|
||||
<Tabs
|
||||
activeKey={activeKey}
|
||||
onTabClick={key => setActiveKey(key as LiveAuctionViewState)}
|
||||
>
|
||||
<TabPane
|
||||
tab={<span className="tab-title">Live Auctions</span>}
|
||||
key={LiveAuctionViewState.All}
|
||||
>
|
||||
{liveAuctionsView}
|
||||
</TabPane>
|
||||
{auctionsEnded.length > 0 && (
|
||||
<TabPane
|
||||
tab={
|
||||
<span className="tab-title">Secondary Marketplace</span>
|
||||
}
|
||||
key={LiveAuctionViewState.Resale}
|
||||
>
|
||||
{liveAuctionsView}
|
||||
</TabPane>
|
||||
)}
|
||||
{auctionsEnded.length > 0 && (
|
||||
<TabPane
|
||||
tab={<span className="tab-title">Ended Auctions</span>}
|
||||
key={LiveAuctionViewState.Ended}
|
||||
>
|
||||
{endedAuctions}
|
||||
</TabPane>
|
||||
)}
|
||||
{
|
||||
// Show all participated live and ended auctions except hero auction
|
||||
}
|
||||
{connected && (
|
||||
<TabPane
|
||||
tab={<span className="tab-title">Participated</span>}
|
||||
key={LiveAuctionViewState.Participated}
|
||||
>
|
||||
{liveAuctionsView}
|
||||
</TabPane>
|
||||
)}
|
||||
</Tabs>
|
||||
</Row>
|
||||
)}
|
||||
</Col>
|
||||
</Content>
|
||||
</Layout>
|
||||
</>
|
||||
);
|
||||
};
|
|
@ -1,5 +1,3 @@
|
|||
@import '../../_colors.less';
|
||||
|
||||
section.ant-layout {
|
||||
width: 100%;
|
||||
margin: auto;
|
||||
|
|
|
@ -1,276 +1,19 @@
|
|||
import React, { useState, useMemo, useCallback } from 'react';
|
||||
import { Layout, Row, Col, Tabs, Button } from 'antd';
|
||||
import Masonry from 'react-masonry-css';
|
||||
|
||||
import { PreSaleBanner } from '../../components/PreSaleBanner';
|
||||
import { AuctionViewState, useAuctions, AuctionView } from '../../hooks';
|
||||
|
||||
import { AuctionRenderCard } from '../../components/AuctionRenderCard';
|
||||
import { Link, useHistory } from 'react-router-dom';
|
||||
import { CardLoader } from '../../components/MyLoader';
|
||||
import { Layout } from 'antd';
|
||||
import React from 'react';
|
||||
import { useStore } from '@oyster/common';
|
||||
import { useMeta } from '../../contexts';
|
||||
import BN from 'bn.js';
|
||||
import { programIds, useConnection, useWalletModal } from '@oyster/common';
|
||||
import { useWallet } from '@solana/wallet-adapter-react';
|
||||
import { saveAdmin } from '../../actions/saveAdmin';
|
||||
import { WhitelistedCreator } from '../../models/metaplex';
|
||||
|
||||
const { TabPane } = Tabs;
|
||||
|
||||
const { Content } = Layout;
|
||||
|
||||
export enum LiveAuctionViewState {
|
||||
All = '0',
|
||||
Participated = '1',
|
||||
Ended = '2',
|
||||
Resale = '3',
|
||||
}
|
||||
import { AuctionListView } from './auctionList';
|
||||
import { SetupView } from './setup';
|
||||
|
||||
export const HomeView = () => {
|
||||
const auctions = useAuctions(AuctionViewState.Live);
|
||||
const auctionsEnded = useAuctions(AuctionViewState.Ended);
|
||||
const [activeKey, setActiveKey] = useState(LiveAuctionViewState.All);
|
||||
const { isLoading, store } = useMeta();
|
||||
const [isInitalizingStore, setIsInitalizingStore] = useState(false);
|
||||
const connection = useConnection();
|
||||
const history = useHistory();
|
||||
const { isConfigured } = useStore();
|
||||
|
||||
const wallet = useWallet();
|
||||
const { setVisible } = useWalletModal();
|
||||
const connect = useCallback(
|
||||
() => (wallet.wallet ? wallet.connect().catch() : setVisible(true)),
|
||||
[wallet.wallet, wallet.connect, setVisible],
|
||||
);
|
||||
|
||||
const breakpointColumnsObj = {
|
||||
default: 4,
|
||||
1100: 3,
|
||||
700: 2,
|
||||
500: 1,
|
||||
};
|
||||
|
||||
// Check if the auction is primary sale or not
|
||||
const checkPrimarySale = (auc: AuctionView) => {
|
||||
var flag = 0;
|
||||
auc.items.forEach(i => {
|
||||
i.forEach(j => {
|
||||
if (j.metadata.info.primarySaleHappened == true) {
|
||||
flag = 1;
|
||||
return true;
|
||||
}
|
||||
});
|
||||
if (flag == 1) return true;
|
||||
});
|
||||
if (flag == 1) return true;
|
||||
else return false;
|
||||
};
|
||||
|
||||
const resaleAuctions = auctions
|
||||
.sort(
|
||||
(a, b) =>
|
||||
a.auction.info.endedAt
|
||||
?.sub(b.auction.info.endedAt || new BN(0))
|
||||
.toNumber() || 0,
|
||||
)
|
||||
.filter(m => checkPrimarySale(m) == true);
|
||||
|
||||
// Removed resales from live auctions
|
||||
const liveAuctions = auctions
|
||||
.sort(
|
||||
(a, b) =>
|
||||
a.auction.info.endedAt
|
||||
?.sub(b.auction.info.endedAt || new BN(0))
|
||||
.toNumber() || 0,
|
||||
)
|
||||
.filter(a => !resaleAuctions.includes(a));
|
||||
|
||||
let items = liveAuctions;
|
||||
|
||||
switch (activeKey) {
|
||||
case LiveAuctionViewState.All:
|
||||
items = liveAuctions;
|
||||
break;
|
||||
case LiveAuctionViewState.Participated:
|
||||
items = liveAuctions
|
||||
.concat(auctionsEnded)
|
||||
.filter(
|
||||
(m, idx) =>
|
||||
m.myBidderMetadata?.info.bidderPubkey ==
|
||||
wallet?.publicKey?.toBase58(),
|
||||
);
|
||||
break;
|
||||
case LiveAuctionViewState.Resale:
|
||||
items = resaleAuctions;
|
||||
break;
|
||||
case LiveAuctionViewState.Ended:
|
||||
items = auctionsEnded;
|
||||
break;
|
||||
}
|
||||
|
||||
const heroAuction = useMemo(
|
||||
() =>
|
||||
auctions.filter(a => {
|
||||
// const now = moment().unix();
|
||||
return !a.auction.info.ended() && !resaleAuctions.includes(a);
|
||||
// filter out auction for banner that are further than 30 days in the future
|
||||
// return Math.floor(delta / 86400) <= 30;
|
||||
})?.[0],
|
||||
[auctions],
|
||||
);
|
||||
|
||||
const liveAuctionsView = (
|
||||
<Masonry
|
||||
breakpointCols={breakpointColumnsObj}
|
||||
className="my-masonry-grid"
|
||||
columnClassName="my-masonry-grid_column"
|
||||
>
|
||||
{!isLoading
|
||||
? items.map((m, idx) => {
|
||||
if (m === heroAuction) {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = m.auction.pubkey;
|
||||
return (
|
||||
<Link to={`/auction/${id}`} key={idx}>
|
||||
<AuctionRenderCard key={id} auctionView={m} />
|
||||
</Link>
|
||||
);
|
||||
})
|
||||
: [...Array(10)].map((_, idx) => <CardLoader key={idx} />)}
|
||||
</Masonry>
|
||||
);
|
||||
const endedAuctions = (
|
||||
<Masonry
|
||||
breakpointCols={breakpointColumnsObj}
|
||||
className="my-masonry-grid"
|
||||
columnClassName="my-masonry-grid_column"
|
||||
>
|
||||
{!isLoading
|
||||
? auctionsEnded.map((m, idx) => {
|
||||
if (m === heroAuction) {
|
||||
return;
|
||||
}
|
||||
|
||||
const id = m.auction.pubkey;
|
||||
return (
|
||||
<Link to={`/auction/${id}`} key={idx}>
|
||||
<AuctionRenderCard key={id} auctionView={m} />
|
||||
</Link>
|
||||
);
|
||||
})
|
||||
: [...Array(10)].map((_, idx) => <CardLoader key={idx} />)}
|
||||
</Masonry>
|
||||
);
|
||||
|
||||
const CURRENT_STORE = programIds().store;
|
||||
const showAuctions = (store && isConfigured) || isLoading;
|
||||
|
||||
return (
|
||||
<Layout style={{ margin: 0, marginTop: 30, alignItems: 'center' }}>
|
||||
{!store && !isLoading && (
|
||||
<>
|
||||
{!CURRENT_STORE && (
|
||||
<p>
|
||||
Store has not been configured please set{' '}
|
||||
<em>REACT_APP_STORE_OWNER_ADDRESS_ADDRESS</em> to admin wallet
|
||||
inside <em>packages/web/.env</em> and restart yarn
|
||||
</p>
|
||||
)}
|
||||
{CURRENT_STORE && !wallet.publicKey && (
|
||||
<p>
|
||||
<Button type="primary" className="app-btn" onClick={connect}>
|
||||
Connect
|
||||
</Button>{' '}
|
||||
to configure store.
|
||||
</p>
|
||||
)}
|
||||
{CURRENT_STORE && wallet.publicKey && (
|
||||
<>
|
||||
<p>
|
||||
Initializing store will allow you to control list of creators.
|
||||
</p>
|
||||
|
||||
<Button
|
||||
className="app-btn"
|
||||
type="primary"
|
||||
loading={isInitalizingStore}
|
||||
disabled={!CURRENT_STORE}
|
||||
onClick={async () => {
|
||||
if (!wallet.publicKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
setIsInitalizingStore(true);
|
||||
|
||||
await saveAdmin(connection, wallet, false, [
|
||||
new WhitelistedCreator({
|
||||
address: wallet.publicKey.toBase58(),
|
||||
activated: true,
|
||||
}),
|
||||
]);
|
||||
|
||||
history.push('/admin');
|
||||
|
||||
window.location.reload();
|
||||
}}
|
||||
>
|
||||
Init Store
|
||||
</Button>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
)}
|
||||
<PreSaleBanner auction={heroAuction} />
|
||||
<Layout>
|
||||
<Content style={{ display: 'flex', flexWrap: 'wrap' }}>
|
||||
<Col style={{ width: '100%', marginTop: 10 }}>
|
||||
{liveAuctions.length >= 0 && (
|
||||
<Row>
|
||||
<Tabs
|
||||
activeKey={activeKey}
|
||||
onTabClick={key => setActiveKey(key as LiveAuctionViewState)}
|
||||
>
|
||||
<TabPane
|
||||
tab={<span className="tab-title">Live Auctions</span>}
|
||||
key={LiveAuctionViewState.All}
|
||||
>
|
||||
{liveAuctionsView}
|
||||
</TabPane>
|
||||
{auctionsEnded.length > 0 && (
|
||||
<TabPane
|
||||
tab={
|
||||
<span className="tab-title">Secondary Marketplace</span>
|
||||
}
|
||||
key={LiveAuctionViewState.Resale}
|
||||
>
|
||||
{liveAuctionsView}
|
||||
</TabPane>
|
||||
)}
|
||||
{auctionsEnded.length > 0 && (
|
||||
<TabPane
|
||||
tab={<span className="tab-title">Ended Auctions</span>}
|
||||
key={LiveAuctionViewState.Ended}
|
||||
>
|
||||
{endedAuctions}
|
||||
</TabPane>
|
||||
)}
|
||||
{
|
||||
// Show all participated live and ended auctions except hero auction
|
||||
}
|
||||
{wallet.connected && (
|
||||
<TabPane
|
||||
tab={<span className="tab-title">Participated</span>}
|
||||
key={LiveAuctionViewState.Participated}
|
||||
>
|
||||
{liveAuctionsView}
|
||||
</TabPane>
|
||||
)}
|
||||
</Tabs>
|
||||
</Row>
|
||||
)}
|
||||
</Col>
|
||||
</Content>
|
||||
</Layout>
|
||||
{showAuctions ? <AuctionListView /> : <SetupView />}
|
||||
</Layout>
|
||||
);
|
||||
};
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
import { useConnection, useStore, useWallet } from '@oyster/common';
|
||||
import { Button } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useHistory } from 'react-router-dom';
|
||||
import { saveAdmin } from '../../actions/saveAdmin';
|
||||
import { useMeta } from '../../contexts';
|
||||
import { WhitelistedCreator } from '../../models/metaplex';
|
||||
import { SetupVariables } from '../../components/SetupVariables';
|
||||
|
||||
export const SetupView = () => {
|
||||
const [isInitalizingStore, setIsInitalizingStore] = useState(false);
|
||||
const connection = useConnection();
|
||||
const { store } = useMeta();
|
||||
const { setStoreForOwner } = useStore();
|
||||
const history = useHistory();
|
||||
const { wallet, connected, connect } = useWallet();
|
||||
const [storeAddress, setStoreAddress] = useState<string | undefined>();
|
||||
|
||||
useEffect(() => {
|
||||
const getStore = async () => {
|
||||
if (connected && wallet) {
|
||||
const store = await setStoreForOwner(wallet?.publicKey?.toBase58());
|
||||
setStoreAddress(store);
|
||||
} else {
|
||||
setStoreAddress(undefined);
|
||||
}
|
||||
};
|
||||
getStore();
|
||||
}, [wallet?.publicKey, connected]);
|
||||
|
||||
const initializeStore = async () => {
|
||||
if (!wallet?.publicKey) {
|
||||
return;
|
||||
}
|
||||
|
||||
setIsInitalizingStore(true);
|
||||
|
||||
await saveAdmin(connection, wallet, false, [
|
||||
new WhitelistedCreator({
|
||||
address: wallet.publicKey.toBase58(),
|
||||
activated: true,
|
||||
}),
|
||||
]);
|
||||
|
||||
// TODO: process errors
|
||||
|
||||
// Fack to reload meta
|
||||
await setStoreForOwner(undefined);
|
||||
await setStoreForOwner(wallet?.publicKey?.toBase58());
|
||||
|
||||
history.push('/admin');
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
{!connected && (
|
||||
<p>
|
||||
<Button type="primary" className="app-btn" onClick={connect}>
|
||||
Connect
|
||||
</Button>{' '}
|
||||
to configure store.
|
||||
</p>
|
||||
)}
|
||||
{connected && !store && (
|
||||
<>
|
||||
<p>Store is not initialized yet</p>
|
||||
<p>There must be some ◎ SOL in the wallet before initialization.</p>
|
||||
<p>
|
||||
After initialization, you will be able to manage the list of
|
||||
creators
|
||||
</p>
|
||||
|
||||
<p>
|
||||
<Button
|
||||
className="app-btn"
|
||||
type="primary"
|
||||
loading={isInitalizingStore}
|
||||
onClick={initializeStore}
|
||||
>
|
||||
Init Store
|
||||
</Button>
|
||||
</p>
|
||||
</>
|
||||
)}
|
||||
{connected && store && (
|
||||
<>
|
||||
<p>
|
||||
To finish initialization please copy config below into{' '}
|
||||
<b>packages/web/.env</b> and restart yarn or redeploy
|
||||
</p>
|
||||
<SetupVariables
|
||||
storeAddress={storeAddress}
|
||||
storeOwnerAddress={wallet?.publicKey?.toBase58()}
|
||||
/>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
};
|
|
@ -1,6 +1,5 @@
|
|||
|
||||
* {
|
||||
font-family: "GraphikWeb";
|
||||
font-family: 'GraphikWeb';
|
||||
}
|
||||
|
||||
.ant-layout-content {
|
||||
|
@ -23,7 +22,7 @@
|
|||
display: flex;
|
||||
align-items: center;
|
||||
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
}
|
||||
|
||||
p {
|
||||
|
@ -73,12 +72,12 @@
|
|||
align-items: center;
|
||||
padding: 20px 24px;
|
||||
|
||||
background: linear-gradient(270deg, #616774 7.29%, #403F4C 100%);
|
||||
background: linear-gradient(270deg, #616774 7.29%, #403f4c 100%);
|
||||
border-radius: 8px;
|
||||
}
|
||||
|
||||
.type-btn:hover {
|
||||
background: linear-gradient(270deg, #616774 7.29%, #403F4C 100%) !important;
|
||||
background: linear-gradient(270deg, #616774 7.29%, #403f4c 100%) !important;
|
||||
}
|
||||
.type-btn:disabled {
|
||||
pointer-events: none;
|
||||
|
@ -93,7 +92,6 @@
|
|||
width: 100%;
|
||||
margin-bottom: 20px;
|
||||
|
||||
|
||||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: center;
|
||||
|
@ -101,7 +99,7 @@
|
|||
padding: 20px 10px;
|
||||
|
||||
/* button/primary/default */
|
||||
background: linear-gradient(180deg, #768BF9 0%, #5870EE 100%);
|
||||
background: linear-gradient(180deg, #768bf9 0%, #5870ee 100%);
|
||||
border-radius: 8px;
|
||||
height: 58px;
|
||||
|
||||
|
@ -127,13 +125,19 @@
|
|||
border-color: #fff;
|
||||
}
|
||||
|
||||
.connector:hover, .connector:focus {
|
||||
.connector:hover,
|
||||
.connector:focus {
|
||||
background: #fff;
|
||||
border-color: #141414;
|
||||
color: #141414;
|
||||
}
|
||||
|
||||
.ant-btn-primary:hover, .ant-btn-primary:focus {
|
||||
.ant-badge-count {
|
||||
color: black;
|
||||
}
|
||||
|
||||
.ant-btn-primary:hover,
|
||||
.ant-btn-primary:focus {
|
||||
color: #5969d4;
|
||||
background: transparent;
|
||||
border-color: #5969d4;
|
||||
|
@ -165,7 +169,7 @@
|
|||
font-weight: 600;
|
||||
font-size: 36px;
|
||||
line-height: 44px;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
flex: none;
|
||||
order: 0;
|
||||
flex-grow: 0;
|
||||
|
@ -216,7 +220,7 @@
|
|||
|
||||
.selected-card {
|
||||
border-width: 3px;
|
||||
border-color: #5870EE !important;
|
||||
border-color: #5870ee !important;
|
||||
border-style: solid;
|
||||
}
|
||||
|
||||
|
@ -240,7 +244,7 @@
|
|||
.waiting-title {
|
||||
font-weight: 600;
|
||||
font-size: 2rem;
|
||||
color: #FFFFFF;
|
||||
color: #ffffff;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
|
@ -265,7 +269,7 @@
|
|||
align-items: center;
|
||||
|
||||
margin: 5px auto;
|
||||
background: linear-gradient(270deg, #616774 7.29%, #403F4C 100%);
|
||||
background: linear-gradient(270deg, #616774 7.29%, #403f4c 100%);
|
||||
border-radius: 8px;
|
||||
|
||||
font-size: 1rem;
|
||||
|
@ -275,7 +279,7 @@
|
|||
.particle {
|
||||
position: absolute;
|
||||
opacity: 0.9;
|
||||
background: linear-gradient(180deg, #D329FC 0%, #8F6DDE 49.48%, #19E6AD 100%);
|
||||
background: linear-gradient(180deg, #d329fc 0%, #8f6dde 49.48%, #19e6ad 100%);
|
||||
}
|
||||
|
||||
.slider-elem {
|
||||
|
@ -287,7 +291,7 @@
|
|||
}
|
||||
|
||||
.ant-slider-step {
|
||||
background: linear-gradient(270deg, #616774 7.29%, #403F4C 100%);
|
||||
background: linear-gradient(270deg, #616774 7.29%, #403f4c 100%);
|
||||
border-radius: 4px;
|
||||
height: 10px;
|
||||
}
|
||||
|
|
120
js/yarn.lock
120
js/yarn.lock
|
@ -23,7 +23,7 @@
|
|||
resolved "https://registry.yarnpkg.com/@ant-design/icons-svg/-/icons-svg-4.1.0.tgz#480b025f4b20ef7fe8f47d4a4846e4fee84ea06c"
|
||||
integrity sha512-Fi03PfuUqRs76aI3UWYpP864lkrfPo0hluwGqh7NJdLhvH4iRDc3jbJqZIvRDLHKbXrvAfPPV3+zjUccfFvWOQ==
|
||||
|
||||
"@ant-design/icons@^4.4.0", "@ant-design/icons@^4.6.2":
|
||||
"@ant-design/icons@^4.4.0":
|
||||
version "4.6.2"
|
||||
resolved "https://registry.yarnpkg.com/@ant-design/icons/-/icons-4.6.2.tgz#290f2e8cde505ab081fda63e511e82d3c48be982"
|
||||
integrity sha512-QsBG2BxBYU/rxr2eb8b2cZ4rPKAPBpzAR+0v6rrZLp/lnyvflLH3tw1vregK+M7aJauGWjIGNdFmUfpAOtw25A==
|
||||
|
@ -34,6 +34,17 @@
|
|||
classnames "^2.2.6"
|
||||
rc-util "^5.9.4"
|
||||
|
||||
"@ant-design/icons@^4.6.3":
|
||||
version "4.6.3"
|
||||
resolved "https://registry.yarnpkg.com/@ant-design/icons/-/icons-4.6.3.tgz#cdcccf4df24d51501acef9228444efb7ef8938b1"
|
||||
integrity sha512-OO4JW3OE13FKahplPYhqEg3uEhMiMDxujVUUx/RJUCEkSgBtAEnpKnq8oz2sBKqXeEhkr9/GE2tAHO1gyc70Uw==
|
||||
dependencies:
|
||||
"@ant-design/colors" "^6.0.0"
|
||||
"@ant-design/icons-svg" "^4.0.0"
|
||||
"@babel/runtime" "^7.11.2"
|
||||
classnames "^2.2.6"
|
||||
rc-util "^5.9.4"
|
||||
|
||||
"@ant-design/react-slick@~0.28.1":
|
||||
version "0.28.3"
|
||||
resolved "https://registry.yarnpkg.com/@ant-design/react-slick/-/react-slick-0.28.3.tgz#ad5cf1cf50363c1a3842874d69d0ce1f26696e71"
|
||||
|
@ -789,6 +800,11 @@
|
|||
unique-filename "^1.1.1"
|
||||
which "^1.3.1"
|
||||
|
||||
"@google/model-viewer@^1.7.2":
|
||||
version "1.7.2"
|
||||
resolved "https://registry.yarnpkg.com/@google/model-viewer/-/model-viewer-1.7.2.tgz#f8a5a2215616dc51d4e6b70861a6de16b4599322"
|
||||
integrity sha512-SoUTpYYlWPxIknfTM3gYQ240Q7eUqZuEHDH/YD2oMxuG7pWQB4DfW67O0EvgIh3vJ0rNG6eenXm0luqzK1i4Cw==
|
||||
|
||||
"@hapi/accept@5.0.2":
|
||||
version "5.0.2"
|
||||
resolved "https://registry.yarnpkg.com/@hapi/accept/-/accept-5.0.2.tgz#ab7043b037e68b722f93f376afb05e85c0699523"
|
||||
|
@ -3198,13 +3214,13 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0:
|
|||
dependencies:
|
||||
color-convert "^2.0.1"
|
||||
|
||||
antd@^4.6.6:
|
||||
version "4.16.1"
|
||||
resolved "https://registry.yarnpkg.com/antd/-/antd-4.16.1.tgz#7e6bcd24a8b7afb0e0c96239bc3a986ef3958167"
|
||||
integrity sha512-v7KfUYvEAiqfTECKC4/VkpRPB/4RRxZLR3b2kKCYEtcj4nEHvsOKfO5CDbWVtSUmCehxOXNR2lV+UNy06KHBnA==
|
||||
antd@^4.16.12:
|
||||
version "4.16.12"
|
||||
resolved "https://registry.yarnpkg.com/antd/-/antd-4.16.12.tgz#8d32a1ad6a80fd2ea61e6f1c432b31782fd2cd50"
|
||||
integrity sha512-vFptOyOo0EubF6sgdJdH8GwnphcZcxV2QG+znSUj4hMOzRI8a0p3XS2mvKpsS92bu4PBuvsc9wmNQNnOfh1GrA==
|
||||
dependencies:
|
||||
"@ant-design/colors" "^6.0.0"
|
||||
"@ant-design/icons" "^4.6.2"
|
||||
"@ant-design/icons" "^4.6.3"
|
||||
"@ant-design/react-slick" "~0.28.1"
|
||||
"@babel/runtime" "^7.12.5"
|
||||
array-tree-filter "^2.1.0"
|
||||
|
@ -3215,17 +3231,17 @@ antd@^4.6.6:
|
|||
rc-cascader "~1.4.0"
|
||||
rc-checkbox "~2.3.0"
|
||||
rc-collapse "~3.1.0"
|
||||
rc-dialog "~8.5.1"
|
||||
rc-dialog "~8.6.0"
|
||||
rc-drawer "~4.3.0"
|
||||
rc-dropdown "~3.2.0"
|
||||
rc-field-form "~1.20.0"
|
||||
rc-image "~5.2.4"
|
||||
rc-image "~5.2.5"
|
||||
rc-input-number "~7.1.0"
|
||||
rc-mentions "~1.6.1"
|
||||
rc-menu "~9.0.9"
|
||||
rc-menu "~9.0.12"
|
||||
rc-motion "^2.4.0"
|
||||
rc-notification "~4.5.7"
|
||||
rc-pagination "~3.1.6"
|
||||
rc-pagination "~3.1.9"
|
||||
rc-picker "~2.5.10"
|
||||
rc-progress "~3.1.0"
|
||||
rc-rate "~2.9.0"
|
||||
|
@ -3235,16 +3251,15 @@ antd@^4.6.6:
|
|||
rc-steps "~4.1.0"
|
||||
rc-switch "~3.2.0"
|
||||
rc-table "~7.15.1"
|
||||
rc-tabs "~11.9.1"
|
||||
rc-tabs "~11.10.0"
|
||||
rc-textarea "~0.3.0"
|
||||
rc-tooltip "~5.1.1"
|
||||
rc-tree "~4.1.0"
|
||||
rc-tree "~4.2.1"
|
||||
rc-tree-select "~4.3.0"
|
||||
rc-trigger "^5.2.1"
|
||||
rc-trigger "^5.2.10"
|
||||
rc-upload "~4.3.0"
|
||||
rc-util "^5.13.1"
|
||||
scroll-into-view-if-needed "^2.2.25"
|
||||
warning "^4.0.3"
|
||||
|
||||
any-promise@^1.0.0:
|
||||
version "1.3.0"
|
||||
|
@ -11998,10 +12013,10 @@ rc-collapse@~3.1.0:
|
|||
rc-util "^5.2.1"
|
||||
shallowequal "^1.1.0"
|
||||
|
||||
rc-dialog@~8.5.0, rc-dialog@~8.5.1:
|
||||
version "8.5.2"
|
||||
resolved "https://registry.yarnpkg.com/rc-dialog/-/rc-dialog-8.5.2.tgz#530e289c25a31c15c85a0e8a4ba3f33414bff418"
|
||||
integrity sha512-3n4taFcjqhTE9uNuzjB+nPDeqgRBTEGBfe46mb1e7r88DgDo0lL4NnxY/PZ6PJKd2tsCt+RrgF/+YeTvJ/Thsw==
|
||||
rc-dialog@~8.6.0:
|
||||
version "8.6.0"
|
||||
resolved "https://registry.yarnpkg.com/rc-dialog/-/rc-dialog-8.6.0.tgz#3b228dac085de5eed8c6237f31162104687442e7"
|
||||
integrity sha512-GSbkfqjqxpZC5/zc+8H332+q5l/DKUhpQr0vdX2uDsxo5K0PhvaMEVjyoJUTkZ3+JstEADQji1PVLVb/2bJeOQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.10.1"
|
||||
classnames "^2.2.6"
|
||||
|
@ -12035,14 +12050,14 @@ rc-field-form@~1.20.0:
|
|||
async-validator "^3.0.3"
|
||||
rc-util "^5.8.0"
|
||||
|
||||
rc-image@~5.2.4:
|
||||
version "5.2.4"
|
||||
resolved "https://registry.yarnpkg.com/rc-image/-/rc-image-5.2.4.tgz#ff1059f937bde6ca918c6f1beb316beba911f255"
|
||||
integrity sha512-kWOjhZC1OoGKfvWqtDoO9r8WUNswBwnjcstI6rf7HMudz0usmbGvewcWqsOhyaBRJL9+I4eeG+xiAoxV1xi75Q==
|
||||
rc-image@~5.2.5:
|
||||
version "5.2.5"
|
||||
resolved "https://registry.yarnpkg.com/rc-image/-/rc-image-5.2.5.tgz#44e6ffc842626827960e7ab72e1c0d6f3a8ce440"
|
||||
integrity sha512-qUfZjYIODxO0c8a8P5GeuclYXZjzW4hV/5hyo27XqSFo1DmTCs2HkVeQObkcIk5kNsJtgsj1KoPThVsSc/PXOw==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.11.2"
|
||||
classnames "^2.2.6"
|
||||
rc-dialog "~8.5.0"
|
||||
rc-dialog "~8.6.0"
|
||||
rc-util "^5.0.6"
|
||||
|
||||
rc-input-number@~7.1.0:
|
||||
|
@ -12066,7 +12081,7 @@ rc-mentions@~1.6.1:
|
|||
rc-trigger "^5.0.4"
|
||||
rc-util "^5.0.1"
|
||||
|
||||
rc-menu@^9.0.0, rc-menu@~9.0.9:
|
||||
rc-menu@^9.0.0:
|
||||
version "9.0.10"
|
||||
resolved "https://registry.yarnpkg.com/rc-menu/-/rc-menu-9.0.10.tgz#59fde6442c138dc60693fbe02ea50c33c8164f38"
|
||||
integrity sha512-wb7fZZ3f5KBqr7v3q8U1DB5K4SEm31KLPe/aANyrHajVJjQpiiGTMLF7ZB7vyqjC4QJq0SJewB4FkumT2U86fw==
|
||||
|
@ -12079,6 +12094,19 @@ rc-menu@^9.0.0, rc-menu@~9.0.9:
|
|||
rc-util "^5.12.0"
|
||||
shallowequal "^1.1.0"
|
||||
|
||||
rc-menu@~9.0.12:
|
||||
version "9.0.12"
|
||||
resolved "https://registry.yarnpkg.com/rc-menu/-/rc-menu-9.0.12.tgz#492c4bb07a596e2ce07587c669b27ee28c3810c5"
|
||||
integrity sha512-8uy47DL36iDEwVZdUO/fjhhW5+4j0tYlrCsOzw6iy8MJqKL7/HC2pj7sL/S9ayp2+hk9fYQYB9Tu+UN+N2OOOQ==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.10.1"
|
||||
classnames "2.x"
|
||||
rc-motion "^2.4.3"
|
||||
rc-overflow "^1.2.0"
|
||||
rc-trigger "^5.1.2"
|
||||
rc-util "^5.12.0"
|
||||
shallowequal "^1.1.0"
|
||||
|
||||
rc-motion@^2.0.0, rc-motion@^2.0.1, rc-motion@^2.2.0, rc-motion@^2.3.0, rc-motion@^2.3.4, rc-motion@^2.4.0, rc-motion@^2.4.3:
|
||||
version "2.4.3"
|
||||
resolved "https://registry.yarnpkg.com/rc-motion/-/rc-motion-2.4.3.tgz#2afd129da8764ee0372ba83442949d8ecb1c7ad2"
|
||||
|
@ -12108,10 +12136,10 @@ rc-overflow@^1.0.0, rc-overflow@^1.2.0:
|
|||
rc-resize-observer "^1.0.0"
|
||||
rc-util "^5.5.1"
|
||||
|
||||
rc-pagination@~3.1.6:
|
||||
version "3.1.6"
|
||||
resolved "https://registry.yarnpkg.com/rc-pagination/-/rc-pagination-3.1.6.tgz#db3c06e50270b52fe272ac527c1fdc2c8d28af1f"
|
||||
integrity sha512-Pb2zJEt8uxXzYCWx/2qwsYZ3vSS9Eqdw0cJBli6C58/iYhmvutSBqrBJh51Z5UzYc5ZcW5CMeP5LbbKE1J3rpw==
|
||||
rc-pagination@~3.1.9:
|
||||
version "3.1.9"
|
||||
resolved "https://registry.yarnpkg.com/rc-pagination/-/rc-pagination-3.1.9.tgz#797ad75d85b1ef7a82801207ead410110337fdd6"
|
||||
integrity sha512-IKBKaJ4icVPeEk9qRHrFBJmHxBUrCp3+nENBYob4Ofqsu3RXjBOy4N36zONO7oubgLyiG3PxVmyAuVlTkoc7Jg==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.10.1"
|
||||
classnames "^2.2.1"
|
||||
|
@ -12209,10 +12237,10 @@ rc-table@~7.15.1:
|
|||
rc-util "^5.13.0"
|
||||
shallowequal "^1.1.0"
|
||||
|
||||
rc-tabs@~11.9.1:
|
||||
version "11.9.1"
|
||||
resolved "https://registry.yarnpkg.com/rc-tabs/-/rc-tabs-11.9.1.tgz#5b2e74da9a276978c2172ef9a05ae8af14da74cb"
|
||||
integrity sha512-CLNx3qaWnO8KBWPd+7r52Pfk0MoPyKtlr+2ltWq2I9iqAjd1nZu6iBpQP7wbWBwIomyeFNw/WjHdRN7VcX5Qtw==
|
||||
rc-tabs@~11.10.0:
|
||||
version "11.10.1"
|
||||
resolved "https://registry.yarnpkg.com/rc-tabs/-/rc-tabs-11.10.1.tgz#7b112f78bac998480c777ae160adc425e3fdb7cb"
|
||||
integrity sha512-ey1i2uMyfnRNYbViLcUYGH+Y7hueJbdCVSLaXnXki9hxBcGqxJMPy9t5xR0n/3QFQspj7Tf6+2VTXVtmO7Yaug==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.11.2"
|
||||
classnames "2.x"
|
||||
|
@ -12250,7 +12278,7 @@ rc-tree-select@~4.3.0:
|
|||
rc-tree "^4.0.0"
|
||||
rc-util "^5.0.5"
|
||||
|
||||
rc-tree@^4.0.0, rc-tree@~4.1.0:
|
||||
rc-tree@^4.0.0:
|
||||
version "4.1.5"
|
||||
resolved "https://registry.yarnpkg.com/rc-tree/-/rc-tree-4.1.5.tgz#734ab1bfe835e78791be41442ca0e571147ab6fa"
|
||||
integrity sha512-q2vjcmnBDylGZ9/ZW4F9oZMKMJdbFWC7um+DAQhZG1nqyg1iwoowbBggUDUaUOEryJP+08bpliEAYnzJXbI5xQ==
|
||||
|
@ -12261,7 +12289,18 @@ rc-tree@^4.0.0, rc-tree@~4.1.0:
|
|||
rc-util "^5.0.0"
|
||||
rc-virtual-list "^3.0.1"
|
||||
|
||||
rc-trigger@^5.0.0, rc-trigger@^5.0.4, rc-trigger@^5.1.2, rc-trigger@^5.2.1:
|
||||
rc-tree@~4.2.1:
|
||||
version "4.2.2"
|
||||
resolved "https://registry.yarnpkg.com/rc-tree/-/rc-tree-4.2.2.tgz#4429187cbbfbecbe989714a607e3de8b3ab7763f"
|
||||
integrity sha512-V1hkJt092VrOVjNyfj5IYbZKRMHxWihZarvA5hPL/eqm7o2+0SNkeidFYm7LVVBrAKBpOpa0l8xt04uiqOd+6w==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.10.1"
|
||||
classnames "2.x"
|
||||
rc-motion "^2.0.1"
|
||||
rc-util "^5.0.0"
|
||||
rc-virtual-list "^3.0.1"
|
||||
|
||||
rc-trigger@^5.0.0, rc-trigger@^5.0.4, rc-trigger@^5.1.2:
|
||||
version "5.2.8"
|
||||
resolved "https://registry.yarnpkg.com/rc-trigger/-/rc-trigger-5.2.8.tgz#27c8291c24518b8f11d76c848f5424e0c429e94a"
|
||||
integrity sha512-Tn84oGmvNBLXI+ptpzxyJx4ArKTduuB6l74ShDLhDaJaF9f5JAMizfx31L30ELVIzRr3Ze4sekG7rzwPGwVOdw==
|
||||
|
@ -12272,6 +12311,17 @@ rc-trigger@^5.0.0, rc-trigger@^5.0.4, rc-trigger@^5.1.2, rc-trigger@^5.2.1:
|
|||
rc-motion "^2.0.0"
|
||||
rc-util "^5.5.0"
|
||||
|
||||
rc-trigger@^5.2.10:
|
||||
version "5.2.10"
|
||||
resolved "https://registry.yarnpkg.com/rc-trigger/-/rc-trigger-5.2.10.tgz#8a0057a940b1b9027eaa33beec8a6ecd85cce2b1"
|
||||
integrity sha512-FkUf4H9BOFDaIwu42fvRycXMAvkttph9AlbCZXssZDVzz2L+QZ0ERvfB/4nX3ZFPh1Zd+uVGr1DEDeXxq4J1TA==
|
||||
dependencies:
|
||||
"@babel/runtime" "^7.11.2"
|
||||
classnames "^2.2.6"
|
||||
rc-align "^4.0.0"
|
||||
rc-motion "^2.0.0"
|
||||
rc-util "^5.5.0"
|
||||
|
||||
rc-upload@~4.3.0:
|
||||
version "4.3.0"
|
||||
resolved "https://registry.yarnpkg.com/rc-upload/-/rc-upload-4.3.0.tgz#2fbbd11242f730802b900c09b469f28437bac0ff"
|
||||
|
@ -14873,7 +14923,7 @@ walletlink@^2.1.0:
|
|||
preact "^10.5.9"
|
||||
rxjs "^6.6.3"
|
||||
|
||||
warning@^4.0.1, warning@^4.0.3:
|
||||
warning@^4.0.1:
|
||||
version "4.0.3"
|
||||
resolved "https://registry.yarnpkg.com/warning/-/warning-4.0.3.tgz#16e9e077eb8a86d6af7d64aa1e05fd85b4678ca3"
|
||||
integrity sha512-rpJyN222KWIvHJ/F53XSZv0Zl/accqHR8et1kpaMTD/fLCRxtV8iX8czMzY7sVZupTI3zcUTg8eycS2kNF9l6w==
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -42,7 +42,7 @@ fn create_auction(app_matches: &ArgMatches, payer: Keypair, client: RpcClient) {
|
|||
let mint = read_keypair_file(app_matches.value_of("mint").unwrap()).unwrap();
|
||||
|
||||
// Auction seeds.
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref(), &resource.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref(), resource.as_ref()];
|
||||
let (auction_pubkey, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
|
||||
// Configure a price floor
|
||||
|
@ -199,7 +199,7 @@ fn place_bid(app_matches: &ArgMatches, payer: Keypair, client: RpcClient) {
|
|||
let bidder = read_keypair_file(app_matches.value_of("bidder").unwrap()).unwrap();
|
||||
|
||||
// Auction seeds.
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref(), &resource.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref(), resource.as_ref()];
|
||||
let (auction_pubkey, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
|
||||
// Parse CLI amount value, fail if not a number.
|
||||
|
@ -342,14 +342,14 @@ fn claim_bid(app_matches: &ArgMatches, payer: Keypair, client: RpcClient) {
|
|||
let destination = read_keypair_file(app_matches.value_of("destination").unwrap()).unwrap();
|
||||
|
||||
// Auction seeds.
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref(), &resource.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref(), resource.as_ref()];
|
||||
let (auction, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
let bidder_pubkey = bidder.pubkey();
|
||||
let seeds = &[
|
||||
PREFIX.as_bytes(),
|
||||
&program_key.as_ref(),
|
||||
&auction.as_ref(),
|
||||
&bidder_pubkey.as_ref(),
|
||||
program_key.as_ref(),
|
||||
auction.as_ref(),
|
||||
bidder_pubkey.as_ref(),
|
||||
];
|
||||
let (bidpot, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
let bidpot_data = client.get_account(&bidpot).unwrap();
|
||||
|
@ -435,14 +435,14 @@ fn cancel_bid(app_matches: &ArgMatches, payer: Keypair, client: RpcClient) {
|
|||
let bidder = read_keypair_file(app_matches.value_of("bidder").unwrap()).unwrap();
|
||||
|
||||
// Load Bidpot data.
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref(), &resource.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref(), resource.as_ref()];
|
||||
let (auction, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
let bidder_pubkey = bidder.pubkey();
|
||||
let seeds = &[
|
||||
PREFIX.as_bytes(),
|
||||
&program_key.as_ref(),
|
||||
&auction.as_ref(),
|
||||
&bidder_pubkey.as_ref(),
|
||||
program_key.as_ref(),
|
||||
auction.as_ref(),
|
||||
bidder_pubkey.as_ref(),
|
||||
];
|
||||
let (bidpot, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
let bidpot_data = client.get_account(&bidpot).unwrap();
|
||||
|
|
|
@ -261,7 +261,7 @@ impl AuctionManager for AuctionManagerV1 {
|
|||
edition_offset_min += matching
|
||||
}
|
||||
if !short_circuit_total {
|
||||
if n <= winners {
|
||||
if n < winners {
|
||||
// once we hit the number of winnrs in this auction (which coulkd be less than possible total)
|
||||
// we need to stop as its never possible to redeem more than number of winners in the auction
|
||||
expected_redemptions += matching
|
||||
|
|
|
@ -384,6 +384,9 @@ pub enum MetaplexInstruction {
|
|||
/// The items inside of it. This will allow you to move it straight to Disbursing, and then you can, as Auctioneer,
|
||||
/// Redeem those items using the RedeemUnusedWinningConfigItemsAsAuctioneer endpoint.
|
||||
///
|
||||
/// If you pass the vault program account, authority over the vault will be returned to you, so you can unwind the vault
|
||||
/// to get your items back that way instead.
|
||||
///
|
||||
/// Be WARNED: Because the boxes have not been validated, the logic for redemptions may not work quite right. For instance,
|
||||
/// if your validation step failed because you provided an empty box but said there was a token in it, when you go
|
||||
/// and try to redeem it, you yourself will experience quite the explosion. It will be up to you to tactfully
|
||||
|
@ -394,11 +397,12 @@ pub enum MetaplexInstruction {
|
|||
///
|
||||
/// 0. `[writable]` Auction Manager
|
||||
/// 1. `[writable]` Auction
|
||||
/// 2. `[Signer]` Authority of the Auction Manager
|
||||
/// 3. `[]` Vault
|
||||
/// 2. `[signer]` Authority of the Auction Manager
|
||||
/// 3. `[writable]` Vault
|
||||
/// 4. `[]` Store
|
||||
/// 5. `[]` Auction program
|
||||
/// 6. `[]` Clock sysvar
|
||||
/// 7. `[]` Vault program (Optional)
|
||||
DecommissionAuctionManager,
|
||||
|
||||
/// Note: This requires that auction manager be in a Running state and that be of the V1 type.
|
||||
|
|
|
@ -10,12 +10,39 @@ use {
|
|||
solana_program::{
|
||||
account_info::{next_account_info, AccountInfo},
|
||||
entrypoint::ProgramResult,
|
||||
program::invoke_signed,
|
||||
pubkey::Pubkey,
|
||||
},
|
||||
spl_auction::processor::AuctionData,
|
||||
spl_token_vault::state::Vault,
|
||||
spl_token_vault::{instruction::create_set_authority_instruction, state::Vault},
|
||||
};
|
||||
|
||||
fn set_vault_authority_to_auction_manager_authority<'a>(
|
||||
auction_manager_info: &AccountInfo<'a>,
|
||||
authority_info: &AccountInfo<'a>,
|
||||
vault_info: &AccountInfo<'a>,
|
||||
vault_program_info: &AccountInfo<'a>,
|
||||
signer_seeds: &[&[u8]],
|
||||
) -> ProgramResult {
|
||||
invoke_signed(
|
||||
&create_set_authority_instruction(
|
||||
*vault_program_info.key,
|
||||
*vault_info.key,
|
||||
*auction_manager_info.key,
|
||||
*authority_info.key,
|
||||
),
|
||||
&[
|
||||
auction_manager_info.clone(),
|
||||
authority_info.clone(),
|
||||
vault_info.clone(),
|
||||
vault_program_info.clone(),
|
||||
],
|
||||
&[&signer_seeds],
|
||||
)?;
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn process_decommission_auction_manager<'a>(
|
||||
program_id: &'a Pubkey,
|
||||
accounts: &'a [AccountInfo<'a>],
|
||||
|
@ -29,6 +56,7 @@ pub fn process_decommission_auction_manager<'a>(
|
|||
let store_info = next_account_info(account_info_iter)?;
|
||||
let auction_program_info = next_account_info(account_info_iter)?;
|
||||
let clock_info = next_account_info(account_info_iter)?;
|
||||
let vault_program_info = next_account_info(account_info_iter).ok();
|
||||
assert_owned_by(auction_manager_info, program_id)?;
|
||||
assert_owned_by(store_info, program_id)?;
|
||||
assert_signer(authority_info)?;
|
||||
|
@ -81,6 +109,19 @@ pub fn process_decommission_auction_manager<'a>(
|
|||
authority_seeds,
|
||||
)?;
|
||||
|
||||
// Using newer version of this endpoint means you just want to take back vault authority instead
|
||||
// of relying on auction manager to redeem items. after all, this thing was in initialized state
|
||||
// so it has no winners or anything, so you can use vault contract instead.
|
||||
if let Some(vault_program) = vault_program_info {
|
||||
set_vault_authority_to_auction_manager_authority(
|
||||
auction_manager_info,
|
||||
authority_info,
|
||||
vault_info,
|
||||
vault_program,
|
||||
authority_seeds,
|
||||
)?;
|
||||
}
|
||||
|
||||
auction_manager.set_status(AuctionManagerStatus::Disbursing);
|
||||
|
||||
auction_manager.save(&mut auction_manager_info)?;
|
||||
|
|
|
@ -224,7 +224,7 @@ pub fn process_redeem_bid<'a>(
|
|||
{
|
||||
let master_edition_info = match safety_deposit_config_info {
|
||||
Some(val) => val,
|
||||
None => return Err(ProgramError::NotEnoughAccountKeys)
|
||||
None => return Err(ProgramError::NotEnoughAccountKeys),
|
||||
};
|
||||
let reservation_list_info = next_account_info(account_info_iter)?;
|
||||
|
||||
|
|
|
@ -314,18 +314,11 @@ pub fn update_metadata_accounts(
|
|||
}
|
||||
|
||||
/// puff metadata account instruction
|
||||
pub fn puff_metadata_account(
|
||||
program_id: Pubkey,
|
||||
metadata_account: Pubkey,
|
||||
) -> Instruction {
|
||||
pub fn puff_metadata_account(program_id: Pubkey, metadata_account: Pubkey) -> Instruction {
|
||||
Instruction {
|
||||
program_id,
|
||||
accounts: vec![
|
||||
AccountMeta::new(metadata_account, false),
|
||||
],
|
||||
data: MetadataInstruction::PuffMetadata
|
||||
.try_to_vec()
|
||||
.unwrap(),
|
||||
accounts: vec![AccountMeta::new(metadata_account, false)],
|
||||
data: MetadataInstruction::PuffMetadata.try_to_vec().unwrap(),
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -19,9 +19,9 @@ use {
|
|||
assert_token_program_matches_package, assert_update_authority_is_correct,
|
||||
create_or_allocate_account_raw, get_owner_from_token_account,
|
||||
process_create_metadata_accounts_logic,
|
||||
process_mint_new_edition_from_master_edition_via_token_logic, transfer_mint_authority,
|
||||
puff_out_data_fields,
|
||||
CreateMetadataAccountsLogicArgs, MintNewEditionFromMasterEditionViaTokenLogicArgs,
|
||||
process_mint_new_edition_from_master_edition_via_token_logic, puff_out_data_fields,
|
||||
transfer_mint_authority, CreateMetadataAccountsLogicArgs,
|
||||
MintNewEditionFromMasterEditionViaTokenLogicArgs,
|
||||
},
|
||||
},
|
||||
arrayref::array_ref,
|
||||
|
@ -132,10 +132,7 @@ pub fn process_instruction<'a>(
|
|||
}
|
||||
MetadataInstruction::PuffMetadata => {
|
||||
msg!("Instruction: Puff Metadata");
|
||||
process_puff_metadata_account(
|
||||
program_id,
|
||||
accounts
|
||||
)
|
||||
process_puff_metadata_account(program_id, accounts)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -597,10 +594,9 @@ pub fn process_puff_metadata_account(
|
|||
PREFIX.as_bytes(),
|
||||
program_id.as_ref(),
|
||||
metadata.mint.as_ref(),
|
||||
EDITION.as_bytes()
|
||||
EDITION.as_bytes(),
|
||||
];
|
||||
let (_, edition_bump_seed) =
|
||||
Pubkey::find_program_address(edition_seeds, program_id);
|
||||
let (_, edition_bump_seed) = Pubkey::find_program_address(edition_seeds, program_id);
|
||||
metadata.edition_nonce = Some(edition_bump_seed);
|
||||
|
||||
metadata.serialize(&mut *metadata_account_info.data.borrow_mut())?;
|
||||
|
|
|
@ -100,7 +100,7 @@ pub struct Metadata {
|
|||
// Whether or not the data struct is mutable, default is not
|
||||
pub is_mutable: bool,
|
||||
/// nonce for easy calculation of editions, if present
|
||||
pub edition_nonce: Option<u8>
|
||||
pub edition_nonce: Option<u8>,
|
||||
}
|
||||
|
||||
impl Metadata {
|
||||
|
|
|
@ -856,10 +856,9 @@ pub fn process_create_metadata_accounts_logic(
|
|||
PREFIX.as_bytes(),
|
||||
program_id.as_ref(),
|
||||
metadata.mint.as_ref(),
|
||||
EDITION.as_bytes()
|
||||
EDITION.as_bytes(),
|
||||
];
|
||||
let (_, edition_bump_seed) =
|
||||
Pubkey::find_program_address(edition_seeds, program_id);
|
||||
let (_, edition_bump_seed) = Pubkey::find_program_address(edition_seeds, program_id);
|
||||
metadata.edition_nonce = Some(edition_bump_seed);
|
||||
|
||||
metadata.serialize(&mut *metadata_account_info.data.borrow_mut())?;
|
||||
|
@ -872,13 +871,15 @@ pub fn puff_out_data_fields(metadata: &mut Metadata) {
|
|||
while array_of_zeroes.len() < MAX_NAME_LENGTH - metadata.data.name.len() {
|
||||
array_of_zeroes.push(0u8);
|
||||
}
|
||||
metadata.data.name = metadata.data.name.clone() + std::str::from_utf8(&array_of_zeroes).unwrap();
|
||||
metadata.data.name =
|
||||
metadata.data.name.clone() + std::str::from_utf8(&array_of_zeroes).unwrap();
|
||||
|
||||
let mut array_of_zeroes = vec![];
|
||||
while array_of_zeroes.len() < MAX_SYMBOL_LENGTH - metadata.data.symbol.len() {
|
||||
array_of_zeroes.push(0u8);
|
||||
}
|
||||
metadata.data.symbol = metadata.data.symbol.clone() + std::str::from_utf8(&array_of_zeroes).unwrap();
|
||||
metadata.data.symbol =
|
||||
metadata.data.symbol.clone() + std::str::from_utf8(&array_of_zeroes).unwrap();
|
||||
|
||||
let mut array_of_zeroes = vec![];
|
||||
while array_of_zeroes.len() < MAX_URI_LENGTH - metadata.data.uri.len() {
|
||||
|
|
|
@ -98,7 +98,7 @@ impl EditionMarker {
|
|||
spl_token_vault_id.as_ref(),
|
||||
vault_pubkey.as_ref(),
|
||||
];
|
||||
let (authority, _) = Pubkey::find_program_address(vault_mint_seeds, &spl_token_vault_id);
|
||||
let (_authority, _) = Pubkey::find_program_address(vault_mint_seeds, &spl_token_vault_id);
|
||||
|
||||
create_mint(context, &self.mint, &context.payer.pubkey(), None).await?;
|
||||
create_token_account(
|
||||
|
|
|
@ -23,11 +23,12 @@ use {
|
|||
spl_token_metadata::{
|
||||
instruction::{
|
||||
create_master_edition, create_metadata_accounts,
|
||||
mint_new_edition_from_master_edition_via_token, update_metadata_accounts,puff_metadata_account
|
||||
mint_new_edition_from_master_edition_via_token, puff_metadata_account,
|
||||
update_metadata_accounts,
|
||||
},
|
||||
state::{
|
||||
get_reservation_list, Data, Edition, Key, MasterEditionV1, MasterEditionV2, Metadata,
|
||||
EDITION, PREFIX,MAX_NAME_LENGTH, MAX_URI_LENGTH, MAX_SYMBOL_LENGTH
|
||||
EDITION, MAX_NAME_LENGTH, MAX_SYMBOL_LENGTH, MAX_URI_LENGTH, PREFIX,
|
||||
},
|
||||
},
|
||||
std::str::FromStr,
|
||||
|
@ -35,18 +36,26 @@ use {
|
|||
|
||||
const TOKEN_PROGRAM_PUBKEY: &str = "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA";
|
||||
fn puff_unpuffed_metadata(_app_matches: &ArgMatches, payer: Keypair, client: RpcClient) {
|
||||
let metadata_accounts = client.get_program_accounts(&spl_token_metadata::id()).unwrap();
|
||||
let metadata_accounts = client
|
||||
.get_program_accounts(&spl_token_metadata::id())
|
||||
.unwrap();
|
||||
let mut needing_puffing = vec![];
|
||||
for acct in metadata_accounts {
|
||||
if acct.1.data[0] == Key::MetadataV1 as u8 {
|
||||
match try_from_slice_unchecked(&acct.1.data) {
|
||||
Ok(val) => {
|
||||
let account: Metadata = val;
|
||||
if account.data.name.len() < MAX_NAME_LENGTH || account.data.uri.len() < MAX_URI_LENGTH || account.data.symbol.len() < MAX_SYMBOL_LENGTH || account.edition_nonce.is_none() {
|
||||
if account.data.name.len() < MAX_NAME_LENGTH
|
||||
|| account.data.uri.len() < MAX_URI_LENGTH
|
||||
|| account.data.symbol.len() < MAX_SYMBOL_LENGTH
|
||||
|| account.edition_nonce.is_none()
|
||||
{
|
||||
needing_puffing.push(acct.0);
|
||||
}
|
||||
},
|
||||
Err(_) => { println!("Skipping {}", acct.0)},
|
||||
}
|
||||
Err(_) => {
|
||||
println!("Skipping {}", acct.0)
|
||||
}
|
||||
};
|
||||
}
|
||||
}
|
||||
|
@ -67,11 +76,11 @@ fn puff_unpuffed_metadata(_app_matches: &ArgMatches, payer: Keypair, client: Rpc
|
|||
println!("Another 20 down. At {} / {}", i, needing_puffing.len());
|
||||
instructions = vec![];
|
||||
i += 1;
|
||||
},
|
||||
}
|
||||
Err(_) => {
|
||||
println!("Txn failed. Retry.");
|
||||
std::thread::sleep(std::time::Duration::from_millis(1000));
|
||||
},
|
||||
}
|
||||
}
|
||||
} else {
|
||||
i += 1;
|
||||
|
@ -541,11 +550,7 @@ fn create_metadata_account_call(
|
|||
Some(_val) => pubkey_of(app_matches, "mint").unwrap(),
|
||||
None => new_mint.pubkey(),
|
||||
};
|
||||
let metadata_seeds = &[
|
||||
PREFIX.as_bytes(),
|
||||
&program_key.as_ref(),
|
||||
mint_key.as_ref(),
|
||||
];
|
||||
let metadata_seeds = &[PREFIX.as_bytes(), &program_key.as_ref(), mint_key.as_ref()];
|
||||
let (metadata_key, _) = Pubkey::find_program_address(metadata_seeds, &program_key);
|
||||
|
||||
let mut new_mint_instructions = vec![
|
||||
|
@ -568,8 +573,7 @@ fn create_metadata_account_call(
|
|||
.unwrap(),
|
||||
];
|
||||
|
||||
let new_metadata_instruction =
|
||||
create_metadata_accounts(
|
||||
let new_metadata_instruction = create_metadata_accounts(
|
||||
program_key,
|
||||
metadata_key,
|
||||
mint_key,
|
||||
|
@ -870,7 +874,8 @@ fn main() {
|
|||
);
|
||||
}
|
||||
("mint_new_edition_from_master_edition_via_token", Some(arg_matches)) => {
|
||||
let (edition, edition_key, mint) = mint_edition_via_token_call(arg_matches, payer, client);
|
||||
let (edition, edition_key, mint) =
|
||||
mint_edition_via_token_call(arg_matches, payer, client);
|
||||
println!(
|
||||
"New edition: {:?}\nParent edition: {:?}\nEdition number: {:?}\nToken mint: {:?}",
|
||||
edition_key, edition.parent, edition.edition, mint
|
||||
|
|
|
@ -134,7 +134,7 @@ pub fn process_set_authority(program_id: &Pubkey, accounts: &[AccountInfo]) -> P
|
|||
}
|
||||
|
||||
// Make sure new authority actually exists in some form.
|
||||
if new_authority_info.data_is_empty() || new_authority_info.lamports() == 0 {
|
||||
if new_authority_info.data_is_empty() && new_authority_info.lamports() == 0 {
|
||||
msg!("Disallowing new authority because it does not exist.");
|
||||
return Err(VaultError::InvalidAuthority.into());
|
||||
}
|
||||
|
@ -304,8 +304,8 @@ pub fn process_mint_fractional_shares(
|
|||
assert_token_program_matches_package(token_program_info)?;
|
||||
assert_token_matching(&vault, token_program_info)?;
|
||||
assert_owned_by(vault_info, program_id)?;
|
||||
assert_owned_by(fraction_mint_info, &token_program_info.key)?;
|
||||
assert_owned_by(fraction_treasury_info, &token_program_info.key)?;
|
||||
assert_owned_by(fraction_mint_info, token_program_info.key)?;
|
||||
assert_owned_by(fraction_treasury_info, token_program_info.key)?;
|
||||
assert_vault_authority_correct(&vault, vault_authority_info)?;
|
||||
|
||||
if vault.state != VaultState::Active {
|
||||
|
@ -849,7 +849,7 @@ pub fn process_add_token_to_inactivated_vault(
|
|||
|
||||
let seeds = &[
|
||||
PREFIX.as_bytes(),
|
||||
&program_id.as_ref(),
|
||||
program_id.as_ref(),
|
||||
vault_info.key.as_ref(),
|
||||
];
|
||||
let (authority, _) = Pubkey::find_program_address(seeds, program_id);
|
||||
|
@ -964,10 +964,10 @@ pub fn process_init_vault(
|
|||
|
||||
let seeds = &[
|
||||
PREFIX.as_bytes(),
|
||||
&program_id.as_ref(),
|
||||
program_id.as_ref(),
|
||||
vault_info.key.as_ref(),
|
||||
];
|
||||
let (authority, _) = Pubkey::find_program_address(seeds, &program_id);
|
||||
let (authority, _) = Pubkey::find_program_address(seeds, program_id);
|
||||
|
||||
match fraction_mint.mint_authority {
|
||||
solana_program::program_option::COption::None => {
|
||||
|
|
|
@ -97,7 +97,7 @@ pub fn create_or_allocate_account_raw<'a>(
|
|||
if required_lamports > 0 {
|
||||
msg!("Transfer {} lamports to the new account", required_lamports);
|
||||
invoke(
|
||||
&system_instruction::transfer(&payer_info.key, new_account_info.key, required_lamports),
|
||||
&system_instruction::transfer(payer_info.key, new_account_info.key, required_lamports),
|
||||
&[
|
||||
payer_info.clone(),
|
||||
new_account_info.clone(),
|
||||
|
@ -110,14 +110,14 @@ pub fn create_or_allocate_account_raw<'a>(
|
|||
invoke_signed(
|
||||
&system_instruction::allocate(new_account_info.key, size.try_into().unwrap()),
|
||||
&[new_account_info.clone(), system_program_info.clone()],
|
||||
&[&signer_seeds],
|
||||
&[signer_seeds],
|
||||
)?;
|
||||
|
||||
msg!("Assign the account to the owning program");
|
||||
invoke_signed(
|
||||
&system_instruction::assign(new_account_info.key, &program_id),
|
||||
&[new_account_info.clone(), system_program_info.clone()],
|
||||
&[&signer_seeds],
|
||||
&[signer_seeds],
|
||||
)?;
|
||||
msg!("Completed assignation!");
|
||||
|
||||
|
@ -268,7 +268,7 @@ pub fn assert_derivation(
|
|||
account: &AccountInfo,
|
||||
path: &[&[u8]],
|
||||
) -> Result<u8, ProgramError> {
|
||||
let (key, bump) = Pubkey::find_program_address(&path, program_id);
|
||||
let (key, bump) = Pubkey::find_program_address(path, program_id);
|
||||
if key != *account.key {
|
||||
return Err(VaultError::DerivedKeyInvalid.into());
|
||||
}
|
||||
|
|
|
@ -50,7 +50,7 @@ fn initialize_vault(app_matches: &ArgMatches, payer: Keypair, client: RpcClient)
|
|||
let vault = Keypair::new();
|
||||
let allow_further_share_creation = app_matches.is_present("allow_further_share_creation");
|
||||
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref()];
|
||||
let (authority, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
|
||||
let instructions = [
|
||||
|
@ -241,11 +241,11 @@ fn add_token_to_vault(app_matches: &ArgMatches, payer: Keypair, client: RpcClien
|
|||
let clone_of_key = token_mint.pubkey().clone();
|
||||
let seeds = &[
|
||||
PREFIX.as_bytes(),
|
||||
&vault_key.as_ref(),
|
||||
&clone_of_key.as_ref(),
|
||||
vault_key.as_ref(),
|
||||
clone_of_key.as_ref(),
|
||||
];
|
||||
let (safety_deposit_box, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref()];
|
||||
let (authority, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
|
||||
let instructions = [
|
||||
|
@ -364,7 +364,7 @@ fn activate_vault(app_matches: &ArgMatches, payer: Keypair, client: RpcClient) -
|
|||
let vault_account = client.get_account(&vault_key).unwrap();
|
||||
let vault: Vault = try_from_slice_unchecked(&vault_account.data).unwrap();
|
||||
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref()];
|
||||
let (mint_authority, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
|
||||
let instructions = [create_activate_vault_instruction(
|
||||
|
@ -422,7 +422,7 @@ fn combine_vault(app_matches: &ArgMatches, payer: Keypair, client: RpcClient) ->
|
|||
try_from_slice_unchecked(&external_price_account.data).unwrap();
|
||||
let payment_account = Keypair::new();
|
||||
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref()];
|
||||
let (uncirculated_burn_authority, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
|
||||
let transfer_authority = Keypair::new();
|
||||
|
@ -572,7 +572,7 @@ fn redeem_shares(app_matches: &ArgMatches, payer: Keypair, client: RpcClient) ->
|
|||
let burn_authority = Keypair::new();
|
||||
let mut signers = vec![&payer, &vault_authority, &burn_authority];
|
||||
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref()];
|
||||
let (transfer_authority, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
|
||||
let mut instructions = vec![];
|
||||
|
@ -662,7 +662,7 @@ fn withdraw_tokens(app_matches: &ArgMatches, payer: Keypair, client: RpcClient)
|
|||
.unwrap();
|
||||
|
||||
let mut signers = vec![&payer, &vault_authority];
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref()];
|
||||
let (transfer_authority, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
|
||||
let mut instructions = vec![];
|
||||
|
@ -725,7 +725,7 @@ fn mint_shares(app_matches: &ArgMatches, payer: Keypair, client: RpcClient) -> P
|
|||
let vault: Vault = try_from_slice_unchecked(&vault_account.data).unwrap();
|
||||
|
||||
let signers = vec![&payer, &vault_authority];
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref()];
|
||||
let (mint_authority, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
|
||||
let number_of_shares: u64 = app_matches
|
||||
|
@ -774,7 +774,7 @@ fn withdraw_shares(app_matches: &ArgMatches, payer: Keypair, client: RpcClient)
|
|||
.unwrap();
|
||||
|
||||
let mut signers = vec![&payer, &vault_authority];
|
||||
let seeds = &[PREFIX.as_bytes(), &program_key.as_ref()];
|
||||
let seeds = &[PREFIX.as_bytes(), program_key.as_ref()];
|
||||
let (transfer_authority, _) = Pubkey::find_program_address(seeds, &program_key);
|
||||
|
||||
let mut instructions = vec![];
|
||||
|
|
Loading…
Reference in New Issue