File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 3434 "update_royalty_address" : " node utils/nftport/updateContract.js -u royalty_address" ,
3535 "update_base_uri" : " node utils/nftport/updateContract.js -u base_uri" ,
3636 "update_prereveal_token_uri" : " node utils/nftport/updateContract.js -u prereveal_token_uri" ,
37- "⏬⏬⏬" : " FOR MAC USERS: Replace %npm_config_xyz% with $npm_config_start ⏬⏬⏬" ,
37+ "⏬⏬⏬" : " FOR MAC USERS: Replace %npm_config_xyz% with $npm_config_xyz ⏬⏬⏬" ,
3838 "refresh_os" : " node utils/functions/refreshOpensea %npm_config_start% %npm_config_end%"
3939 },
4040 "author" : " Jesse Hall (codeSTACKr)" ,
Original file line number Diff line number Diff line change 8383 `${ basePath } /build/contract/_contract.json`
8484 ) ;
8585 const contractData = JSON . parse ( rawContractData ) ;
86- if ( contractData . response === "OK" && contractData . error === null ) {
86+ if ( contractData . response === "OK" ) {
8787 CONTRACT_ADDRESS = contractData . contract_address ;
8888 }
8989} catch ( error ) {
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ const retrieveContract = async () => {
2929 ) ;
3030 if ( response . response === "OK" ) {
3131 console . log ( `Contract ${ CONTRACT_NAME } deployed successfully` ) ;
32+ retrieveABI ( response . contract_address ) ;
3233 } else {
3334 console . log ( `Contract ${ CONTRACT_NAME } deployment failed` ) ;
3435 }
@@ -40,4 +41,29 @@ const retrieveContract = async () => {
4041 }
4142} ;
4243
44+ const retrieveABI = async ( contract_address ) => {
45+ try {
46+ const chain = CHAIN . toLowerCase ( ) ;
47+ const url = `https://api.nftport.xyz/v0/me/contracts/abis/${ contract_address } ?chain=${ chain } ` ;
48+ const options = {
49+ method : "GET" ,
50+ headers : {
51+ "Content-Type" : "application/json" ,
52+ } ,
53+ } ;
54+ const response = await fetchNoRetry ( url , options ) ;
55+ fs . writeFileSync (
56+ `${ basePath } /build/contract/_contract_abi.json` ,
57+ JSON . stringify ( response . abi , null , 2 )
58+ ) ;
59+ if ( response . response === "OK" ) {
60+ console . log ( `Contract ${ CONTRACT_NAME } ABI successful` ) ;
61+ } else {
62+ console . log ( `Contract ${ CONTRACT_NAME } ABI failed` ) ;
63+ }
64+ } catch ( error ) {
65+ console . log ( `CATCH: Contract ${ CONTRACT_NAME } ABI failed` , `ERROR: ${ error } ` ) ;
66+ }
67+ } ;
68+
4369retrieveContract ( ) ;
You can’t perform that action at this time.
0 commit comments