Skip to content

Commit a6909ae

Browse files
authored
Merge pull request #23 from usherlabs/feature/missing_event
added missing event
2 parents 9549d3b + 6fe046c commit a6909ae

File tree

12 files changed

+19
-13
lines changed

12 files changed

+19
-13
lines changed

src/bitte_plugin/.env.sample

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
THIRDWEB_CLIENT_ID=xxxxxxxxxxx
22
TWEET_BEARER=XXXXXXXXXXXXXXXXXX
33
ACCOUNT_ID=hello_world.near
4-
NEAR_CONTRACT_ADDRESS="x-bitte-nft.testnet"
4+
NEAR_CONTRACT_ADDRESS="x-bitte-nfts.testnet"
55
# HOST_URL="" -- For production

src/contracts/nft/nft/src/lib.rs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ use events::CancelMintRequest;
2222
use near_contract_standards::non_fungible_token::metadata::{
2323
NFTContractMetadata, NonFungibleTokenMetadataProvider, TokenMetadata, NFT_METADATA_SPEC,
2424
};
25+
use near_contract_standards::non_fungible_token::events::NftMint;
2526
use near_contract_standards::non_fungible_token::NonFungibleToken;
2627
use near_contract_standards::non_fungible_token::{Token, TokenId};
2728
use near_contract_tools::standard::nep297::Event;
@@ -228,7 +229,7 @@ impl Contract {
228229
token_id.clone(),
229230
receiver_id.clone(),
230231
Some(token_metadata.clone()),
231-
Some(receiver_id),
232+
Some(receiver_id.clone()),
232233
);
233234

234235
// Calculate refund amount
@@ -248,7 +249,12 @@ impl Contract {
248249
// Update request status and refund amount
249250
request.claimable_deposit = refund_amount;
250251
self.tweet_requests.insert(&token.token_id, &request);
251-
self.claim_funds(token_id, request, MintRequestStatus::IsFulfilled);
252+
self.claim_funds(token_id.clone(), request, MintRequestStatus::IsFulfilled);
253+
NftMint{
254+
owner_id: &receiver_id,
255+
token_ids: &[&token_id],
256+
memo: None,
257+
}.emit();
252258
return token;
253259
} else {
254260
// penalize user by decreasing Claimable Balance
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
[toolchain]
2-
channel = "1.81.0"
2+
channel = "1.80.0"
33
components = ["clippy", "rustfmt"]
44
targets = ["wasm32-unknown-unknown"]

src/contracts/nft/scripts/deploy.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export NEAR_NFT_ACCOUNT_ID="x-bitte-nft.testnet"
1+
export NEAR_NFT_ACCOUNT_ID="x-bitte-nfts.testnet"
22
# this is the account that would be able to mint nft's, it is also the account of the verifier contract
33
export NEAR_VERIFIER_CONTRACT_ACCOUNT="local-verifier.testnet"
44

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export NEAR_CONTRACT_ACCOUNT="x-bitte-nft.testnet"
1+
export NEAR_CONTRACT_ACCOUNT="x-bitte-nfts.testnet"
22
export ACCOUNT_WITH_NFT="local-verifier.testnet"
33

44
near contract call-function as-read-only $NEAR_CONTRACT_ACCOUNT nft_tokens_for_owner text-args '{"account_id": "'$ACCOUNT_WITH_NFT'"}' network-config testnet now

src/contracts/nft/scripts/mint_request.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# both accounts must be the same
2-
export NEAR_CONTRACT_ACCOUNT=x-bitte-nft.testnet
2+
export NEAR_CONTRACT_ACCOUNT=x-bitte-nfts.testnet
33
export NEAR_SIGNER_ACCOUNT=local-verifier.testnet
44
export TWEET_ID=1859829435182219408
55
export IMAGE_URL="https://ipfs.io/ipfs/QmXLiZP95g8h71QTqzkPvQjKkc52cus4QnkYYbAmnekmRs"

src/contracts/nft/scripts/upgrade_contract.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export NEAR_VERIFIER_CONTRACT_ACCOUNT=x-bitte-nft.testnet
1+
export NEAR_VERIFIER_CONTRACT_ACCOUNT=x-bitte-nfts.testnet
22

33
cargo build --target wasm32-unknown-unknown --release
44
cp target/wasm32-unknown-unknown/release/*.wasm ./target/

src/contracts/verifier/contract/scripts/deploy_contract.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
export NEAR_VERIFIER_CONTRACT_ACCOUNT=local-verifier.testnet
2-
export NEAR_NFT_CONTRACT=x-bitte-nft.testnet
2+
export NEAR_NFT_CONTRACT=x-bitte-nfts.testnet
33
export EVM_VERIFIER_ADDRESS="0xa82219472Be3faC01D0b20F043a5B03AeA64FB25"
44

55

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# both accounts must be the same
22
export NEAR_CONTRACT_ACCOUNT=local-verifier.testnet
3-
export NFT_CONTRACT="x-bitte-nft.testnet"
3+
export NFT_CONTRACT="x-bitte-nfts.testnet"
44

55
near contract call-function as-transaction $NEAR_CONTRACT_ACCOUNT set_nft_account json-args '{"nft_contract": "'$NFT_CONTRACT'"}' prepaid-gas '100.0 Tgas' attached-deposit '0 NEAR' sign-as $NEAR_CONTRACT_ACCOUNT network-config testnet sign-with-keychain send

src/near_indexer/src/main.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,7 @@ pub async fn process_near_transaction(
104104
) -> Result<bool, DbErr> {
105105
// Get the NFT contract ID from environment variable or use default value
106106
let nft_contract_id =
107-
env::var("NEAR_NFT_CONTRACT_ACCOUNT_ID").unwrap_or("x-bitte-nft.testnet".to_owned());
107+
env::var("NEAR_NFT_CONTRACT_ACCOUNT_ID").unwrap_or("x-bitte-nfts.testnet".to_owned());
108108
let nft_contract_id = AccountId::from_str(&nft_contract_id).unwrap();
109109

110110
// Parse the transaction ID as an integer

0 commit comments

Comments
 (0)