Skip to content

Commit

Permalink
Merge branch 'feat/dapp' into sdk-wasm-bindgen
Browse files Browse the repository at this point in the history
  • Loading branch information
andrei-marinica committed Sep 26, 2024
2 parents 185a3e2 + f735e6a commit 45384b3
Show file tree
Hide file tree
Showing 35 changed files with 259 additions and 191 deletions.
36 changes: 19 additions & 17 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ members = [
"framework/wasm-adapter",

"sdk/core",
"sdk/reqwest",
"sdk/scenario-format",

"sdk-wbg/core",
Expand Down
4 changes: 2 additions & 2 deletions contracts/examples/nft-minter/src/nft_module.rs
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@ pub trait NftModule {
self.send()
.esdt_system_sc_proxy()
.set_special_roles(
&self.blockchain().get_sc_address(),
&self.nft_token_id().get(),
self.blockchain().get_sc_address(),
self.nft_token_id().get(),
[EsdtLocalRole::NftCreate][..].iter().cloned(),
)
.async_call_and_exit()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ where
self.wrapped_tx
.payment(NotPayable)
.raw_call(CHANGE_OWNER_BUILTIN_FUNC_NAME)
.argument(new_owner)
.argument(&new_owner)
.original_result()
}

Expand All @@ -87,26 +87,26 @@ where
Arg1: ProxyArg<BigUint<Env::Api>>,
>(
self,
token: &Arg0,
token: Arg0,
nonce: u64,
amount: &Arg1,
amount: Arg1,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
if nonce == 0 {
return self
.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_LOCAL_BURN_FUNC_NAME)
.argument(token)
.argument(amount)
.argument(&token)
.argument(&amount)
.original_result();
}

self.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_NFT_BURN_FUNC_NAME)
.argument(token)
.argument(&token)
.argument(&nonce)
.argument(amount)
.argument(&amount)
.original_result()
}

Expand All @@ -115,39 +115,39 @@ where
Arg1: ProxyArg<BigUint<Env::Api>>,
>(
self,
token: &Arg0,
token: Arg0,
nonce: u64,
amount: &Arg1,
amount: Arg1,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
if nonce == 0 {
return self
.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_LOCAL_MINT_FUNC_NAME)
.argument(token)
.argument(amount)
.argument(&token)
.argument(&amount)
.original_result();
}
self.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_NFT_ADD_QUANTITY_FUNC_NAME)
.argument(token)
.argument(&token)
.argument(&nonce)
.argument(amount)
.argument(&amount)
.original_result()
}

pub fn nft_add_multiple_uri<Arg0: ProxyArg<TokenIdentifier<Env::Api>>>(
self,
token_id: &Arg0,
token_id: Arg0,
nft_nonce: u64,
new_uris: &ManagedVec<Env::Api, ManagedBuffer<Env::Api>>,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
let mut tx = self
.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_NFT_ADD_URI_FUNC_NAME)
.argument(token_id)
.argument(&token_id)
.argument(&nft_nonce);

for uri in new_uris {
Expand All @@ -159,16 +159,16 @@ where

pub fn nft_update_attributes<T: TopEncode, Arg0: ProxyArg<TokenIdentifier<Env::Api>>>(
self,
token_id: &Arg0,
token_id: Arg0,
nft_nonce: u64,
new_attributes: &T,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, ()> {
self.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_NFT_UPDATE_ATTRIBUTES_FUNC_NAME)
.argument(token_id)
.argument(&token_id)
.argument(&nft_nonce)
.argument(new_attributes)
.argument(&new_attributes)
.original_result()
}

Expand All @@ -182,24 +182,24 @@ where
Arg4: ProxyArg<ManagedBuffer<Env::Api>>,
>(
self,
token: &Arg0,
amount: &Arg1,
name: &Arg2,
royalties: &Arg3,
hash: &Arg4,
token: Arg0,
amount: Arg1,
name: Arg2,
royalties: Arg3,
hash: Arg4,
attributes: &T,
uris: &ManagedVec<Env::Api, ManagedBuffer<Env::Api>>,
) -> TxTypedCall<Env, From, To, NotPayable, Gas, u64> {
let mut tx = self
.wrapped_tx
.payment(NotPayable)
.raw_call(ESDT_NFT_CREATE_FUNC_NAME)
.argument(token)
.argument(amount)
.argument(name)
.argument(royalties)
.argument(hash)
.argument(attributes);
.argument(&token)
.argument(&amount)
.argument(&name)
.argument(&royalties)
.argument(&hash)
.argument(&attributes);

if uris.is_empty() {
// at least one URI is required, so we push an empty one
Expand Down
Loading

0 comments on commit 45384b3

Please sign in to comment.