File tree Expand file tree Collapse file tree 4 files changed +29
-1070
lines changed Expand file tree Collapse file tree 4 files changed +29
-1070
lines changed Original file line number Diff line number Diff line change 34
34
"update_royalty_address" : " node utils/nftport/updateContract.js -u royalty_address" ,
35
35
"update_base_uri" : " node utils/nftport/updateContract.js -u base_uri" ,
36
36
"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 ⏬⏬⏬" ,
38
38
"refresh_os" : " node utils/functions/refreshOpensea %npm_config_start% %npm_config_end%"
39
39
},
40
40
"author" : " Jesse Hall (codeSTACKr)" ,
Original file line number Diff line number Diff line change 83
83
`${ basePath } /build/contract/_contract.json`
84
84
) ;
85
85
const contractData = JSON . parse ( rawContractData ) ;
86
- if ( contractData . response === "OK" && contractData . error === null ) {
86
+ if ( contractData . response === "OK" ) {
87
87
CONTRACT_ADDRESS = contractData . contract_address ;
88
88
}
89
89
} catch ( error ) {
Original file line number Diff line number Diff line change @@ -29,6 +29,7 @@ const retrieveContract = async () => {
29
29
) ;
30
30
if ( response . response === "OK" ) {
31
31
console . log ( `Contract ${ CONTRACT_NAME } deployed successfully` ) ;
32
+ retrieveABI ( response . contract_address ) ;
32
33
} else {
33
34
console . log ( `Contract ${ CONTRACT_NAME } deployment failed` ) ;
34
35
}
@@ -40,4 +41,29 @@ const retrieveContract = async () => {
40
41
}
41
42
} ;
42
43
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
+
43
69
retrieveContract ( ) ;
You can’t perform that action at this time.
0 commit comments