Skip to content

Commit

Permalink
Add bulk register subdomain (#177)
Browse files Browse the repository at this point in the history
  • Loading branch information
BriungRi authored Oct 11, 2023
1 parent 74bc281 commit e00847b
Showing 1 changed file with 29 additions and 0 deletions.
29 changes: 29 additions & 0 deletions bulk/sources/bulk.move
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,33 @@ module bulk::bulk {
bulk_migrate_domain(user, migrate_domain_names);
bulk_renew_domain(user, renew_domain_names, renewal_duration_secs);
}

// ==== Registration ====

/// Subdomains only
public entry fun bulk_register_subdomain(
domain_admin: &signer,
domain_names: vector<String>,
subdomain_names: vector<String>,
expiration_time_secs: vector<u64>,
expiration_policies: vector<u8>,
transferrable: vector<bool>,
target_addrs: vector<address>,
to_addrs: vector<address>,
) {
let idx = 0;
while (idx < vector::length(&domain_names)) {
router::register_subdomain(
domain_admin,
*vector::borrow(&domain_names, idx),
*vector::borrow(&subdomain_names, idx),
*vector::borrow(&expiration_time_secs, idx),
*vector::borrow(&expiration_policies, idx),
*vector::borrow(&transferrable, idx),
option::some(*vector::borrow(&target_addrs, idx)),
option::some(*vector::borrow(&to_addrs, idx)),
);
idx = idx + 1
}
}
}

0 comments on commit e00847b

Please sign in to comment.